From owner-svn-src-head@freebsd.org Sun Feb 4 10:33:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2410EC95E2; Sun, 4 Feb 2018 10:33:43 +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 13C0A78FFE; Sun, 4 Feb 2018 10:33:42 +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 w14AXZY2081526 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 4 Feb 2018 12:33:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w14AXZY2081526 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w14AXYdu081525; Sun, 4 Feb 2018 12:33:34 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 4 Feb 2018 12:33:34 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327495 - head/usr.sbin/rpcbind Message-ID: <20180204103334.GC9536@kib.kiev.ua> References: <201801021725.w02HPDaj068477@repo.freebsd.org> <20180203232725.U1389@besplex.bde.org> <20180204150751.V909@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180204150751.V909@besplex.bde.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: 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, 04 Feb 2018 10:33:43 -0000 On Sun, Feb 04, 2018 at 04:15:16PM +1100, Bruce Evans wrote: > sig_atomic_t is no better than plain int. This behaviour now makes complete > sense. It is just like the undefined behaviour with the ctype functions, > except since we own terminate_wfd we can guarantee that it doesn't change > while the handler is active (and is valid when the handler is entered). > We could also use atomic ops. However, the C standard doesn't require > anything that we do to work (except maybe in C11, atomic ops might be > explicitly or implicitly specifed to work for things like this). Atomics are atomic WRT the signal handlers as well, the usual guarantees of no torn writes and no out of air values on read hold. Since FreeBSD memory model, as documented in atomic(9), claims that naturally aligned machine-native integer types are atomic without special declarations on access, all guarantees for the handler accesses are already provided. C11 also has a tool to ensure weaker than usual consistency guarantee, only between the thread and a signal handler executing in the context of the thread. I do not see it useful in the discussed case. From owner-svn-src-head@freebsd.org Sun Feb 4 08:22:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B9EEEF380; Sun, 4 Feb 2018 08:22:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF6EB7325B; Sun, 4 Feb 2018 08:22:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8E6117AF4; Sun, 4 Feb 2018 08:22:11 +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 w148MBg7067009; Sun, 4 Feb 2018 08:22:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w148MBdg067007; Sun, 4 Feb 2018 08:22:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802040822.w148MBdg067007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 4 Feb 2018 08:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328838 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328838 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.25 Precedence: list List-Id: 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, 04 Feb 2018 08:22:12 -0000 Author: adrian Date: Sun Feb 4 08:22:11 2018 New Revision: 328838 URL: https://svnweb.freebsd.org/changeset/base/328838 Log: [arswitch] fix up issues on the AR8327. This correctly dumps the ethernet bridge contents on an AR8327 switch. Tested: * AP135 - QCA9550 + AR8327 ethernet switch: # etherswitchcfg atu dump [0] c0:3f:d5:7e:6f:45: portmask 0x00000004 [1] f6:b6:03:96:1e:ba: portmask 0x00000004 [2] 00:03:7f:11:38:4f: portmask 0x00000040 # arp -na ? (192.168.3.170) at 00:03:7f:11:38:4f on arge0 permanent [ethernet] ? (192.168.3.12) at c0:3f:d5:7e:6f:45 on arge0 expires in 1188 seconds [ethernet] ? (192.168.3.1) at f6:b6:03:96:1e:ba on arge0 expires in 1186 seconds [ethernet] Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitch_8327.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Feb 4 03:15:06 2018 (r328837) +++ head/sys/dev/etherswitch/arswitch/arswitch_8327.c Sun Feb 4 08:22:11 2018 (r328838) @@ -1151,12 +1151,12 @@ ar8327_atu_fetch_table(struct arswitch_softc *sc, ethe return (-1); /* MAC address */ - e->es_macaddr[5] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR5); - e->es_macaddr[4] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR4); - e->es_macaddr[3] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR3); - e->es_macaddr[2] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR2); - e->es_macaddr[1] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR1); - e->es_macaddr[0] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR0); + e->es_macaddr[5] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR3); + e->es_macaddr[4] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR2); + e->es_macaddr[3] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR1); + e->es_macaddr[2] = MS(ret0, AR8327_ATU_DATA0_MAC_ADDR0); + e->es_macaddr[0] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR5); + e->es_macaddr[1] = MS(ret1, AR8327_ATU_DATA1_MAC_ADDR4); /* Bitmask of ports this entry is for */ e->es_portmask = MS(ret1, AR8327_ATU_DATA1_DEST_PORT); Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Feb 4 03:15:06 2018 (r328837) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Sun Feb 4 08:22:11 2018 (r328838) @@ -498,7 +498,7 @@ #define AR8327_ATU_DATA1_MAC_ADDR4 BITS(0, 8) #define AR8327_ATU_DATA1_MAC_ADDR4_S 0 #define AR8327_ATU_DATA1_MAC_ADDR5 BITS(8, 8) -#define AR8327_ATU_DATA1_MAC_ADDR5_S 0 +#define AR8327_ATU_DATA1_MAC_ADDR5_S 8 #define AR8327_ATU_DATA1_DEST_PORT BITS(16, 7) #define AR8327_ATU_DATA1_DEST_PORT_S 16 #define AR8327_ATU_DATA1_CROSS_PORT_STATE_EN BIT(23) From owner-svn-src-head@freebsd.org Sun Feb 4 12:33:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1980ECEE7A; Sun, 4 Feb 2018 12:33:54 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (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 34B637D6F7; Sun, 4 Feb 2018 12:33:53 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.179.182.56]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M6SE3-1exCqd1Sd1-00yOat; Sun, 04 Feb 2018 13:33:48 +0100 Date: Sun, 4 Feb 2018 13:33:10 +0100 From: "O. Hartmann" To: David Wolfskill Cc: Jason Harmening , "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328489 - head/sys/conf Message-ID: <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20180129130022.GT1125@albert.catwhisker.org> References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> 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_/S5Iawh7XtgTyZrIe3dy2apX"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:hibmGnM1zlQyB1onl+MuFQmHg57tvVZJA8IIC59niaaX4jOpgu8 7r8zx1DJSVow2zn8xd0I+ItxlN9+VJYzs/4KDumZU7xePjhGUvWKIuN6R2h5zfbuNTwKTPK UeJ2S3AaKUeLKmdB1NFKc5P7eoNSUYoMKgUqIHL6BN3bA9gbR4ko4+ZJLBrdIFZK0AkBQOC v3ZxmAqkSLzcV4dBCQD1g== X-UI-Out-Filterresults: notjunk:1;V01:K0:pKsLbqs55+Y=:m0NQbtCaP3IUe/iVh2+6Gn C4c2BmqO4jERVPZ58R04733ewKMu1gNDtCbBUm9rs4FCG2OhhwRnqD6YAk28jjrt8nsiek9S4 dMWQIjylsZVWhfg6qKasb6rdjyuPHSRk7EDtll9KIln+GwS7XeAk/wMhrmajFqy+n4o1n+Wo8 9BQ5sPIrbKGjdLWFkUSzOuOail6hewAAOXf8jkrRquIlQfl1KIf4xW+S9n1U4biFoWKR25X5j ll+egI4AsJXl6Ryu4clKEnygvnptUqJhkC9QtsaozJb1Dq0kCIKjenySHUs+Li+esglvMcSOz XIirIXwO3lFv0X8GkO85e7xUQOPyOYQ9OLpqhJyM5fUu9lWPkSjjEvJi96HKwzirBtQM0uLj8 wH9D/79lECk71hTnDPFR43URS8BoRd61tCInQVqgeOqD9oi+68oAT7gB+ZjbSGoFkNgRHcVSf PZBxK9/TRQ86LgDt8Ylt03nBGvRbhpskOETypLAVqxV/ktbthzsk8PSUzKGCnDzh8PUlSx1Qf P7nBrSuXirZad7DRWWubW2eRK86hH4u09U1NcPCEZ2dt9A1VcmbZlZQU0SS3zZRT4WOzh0klT wxuYn2eMwgs4qTO7c7Gy/UjL39Nz6qAhOsZEE/hsEpaR8QwubXWRZkdd7m5uarSqD7TSXyKPU 29whI3dg4+RmrGKw6A03P22N5nRd8SVLhMNPB39PQXafFnwUBToOsMz5ndf+QI4/dbupa9w3y RPPIFJyO9Kue8R7f2n9V2yCxaDft17MQpvUn7O9mk2IGFYwIKwa6186kebjewwJKafb+QKV40 Fd5GkIyyw7HnqQdDKkdaOqQqHCF+g== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 04 Feb 2018 12:33:55 -0000 --Sig_/S5Iawh7XtgTyZrIe3dy2apX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am Mon, 29 Jan 2018 05:00:22 -0800 David Wolfskill schrieb: > On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: > > >=20 > > > This happens now if PORTS_MODULE=3Dx11/nvidia-driver is defined in /e= tc/src.conf: > > >=20 > > > [...] > > > --- kernel-install --- > > > mkdir -p /boot/kernel > > > install -p -m 555 -o root -g wheel kernel /boot/kernel/ > > > --- ports-install --- > > > Variable OBJTOP is recursive. > > >=20 > > > make[8]: stopped =20 > > ... > >=20 > > David sent me logs of the failing case; thanks David! =20 >=20 > Happy to help! :-) >=20 > > The failure happens when buildkernel and installkernel are run=20 > > separately instead of all-up, e.g. 'make kernel'. The installkernel=20 > > step is leaving MK_AUTO_OBJ=3Dno in the env passed to the port build. = It=20 > > looks like at least one of the install stages of nvidia-driver needs to= =20 > > generate temporary output, which leads to confusion when the port isn't= =20 > > built as though it's an in-tree component. > >=20 > > Can you guys try out the attached patch? =20 >=20 > I tried it both on my build machine (which does not use kernel modules > from ports, and thus did not exhibit the problem -- but I thought that > verifying that the patch did not break that case worth checking) and on > my laptop (which did exhibit the problem). >=20 > It worked in both cases with no issues for me. >=20 > Thanks! :-) >=20 > Peace, > david The problem still persists! I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 2018 amd6= 4, the source tree is at revision 328839. I use WITH_META_MODE=3DYES in /etc/src.conf. My /etc/make.conf consists of = a .include statement which reels in /usr/local/etc/ports.conf in which I define everyt= hing outside the source tree for ports (in case of the nvidia driver, its DISTVERSION). = This worked before and should work again. Today I checked out a completely fresh /usr/s= rc and gleanced the /usr/obj folder and rebuilt the system - and get the error again: [...] =3D=3D=3D> Ports module x11/nvidia-driver (install) cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CPP -= u MAKESYSPATH MAKEFLAGS=3D"-j 4 -J 15,16 .MAKE.LEVEL.ENV=3DMAKELEVEL KERNEL=3Dkernel MK_A= UTO_OBJ=3Dno TARGET=3Damd64 TARGET_ARCH=3Damd64" SYSDIR=3D/usr/src/sys PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/am= d64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/u= sr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/us= r/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin SRC_BASE=3D/usr/src OSVERSION=3D1200056 WRKDIRPREFIX=3D/usr/obj/usr/src/a= md64.amd64/sys/THOR make -B deinstall reinstall =3D=3D=3D> Deinstalling for nvidia-driver =3D= =3D=3D> Deinstalling nvidia-driver-387.34 Updating database digests format: . done Checking inte= grity... done (0 conflicting) Deinstallation has been requested for the following 1 packa= ges (of 0 packages in the universe): Installed packages to be REMOVED: nvidia-driver-387.34 Number of packages to be removed: 1 The operation will free 99 MiB. [1/1] Deinstalling nvidia-driver-387.34... [1/1] Deleting files for nvidia-driver-387.34: .......... done =3D=3D=3D> Staging for nvidia-driver-387.34 =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib/libGL.so = - found =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgco= nfig/x11.pc - found =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgco= nfig/xorg-server.pc - found =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libda= ta/pkgconfig/xext.pc - found =3D=3D=3D> Generating temporary packing list =3D=3D=3D> src (install) =3D=3D=3D> src/nvidia (install) Variable OBJTOP is recursive. make[8]: stopped in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/nvidia-driver/wor= k/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia *** Error code 2 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_/S5Iawh7XtgTyZrIe3dy2apX Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWnb9oQAKCRDS528fyFhY lFWsAgCSs4C8ltf4ov+MhEpkxoaYC60Sm+oBODuddw1Dv3SpeAZUZIonbhlRCxzS gexQf0+t1Zj7FPYiVQsE4nBlfiwLAf9LuBW+ktdSkdr/cVBgJXiur2oMPDEY6zHg XQGZyncV/++xOwW89aYfnjb35e87wXpJtEQ/kr6rjchnhnMtVviS =OMYC -----END PGP SIGNATURE----- --Sig_/S5Iawh7XtgTyZrIe3dy2apX-- From owner-svn-src-head@freebsd.org Sun Feb 4 05:15:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5835EEE7C24; Sun, 4 Feb 2018 05:15:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 9F09F6DBA0; Sun, 4 Feb 2018 05:15:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id E80D6D4E645; Sun, 4 Feb 2018 16:15:16 +1100 (AEDT) Date: Sun, 4 Feb 2018 16:15:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327495 - head/usr.sbin/rpcbind In-Reply-To: Message-ID: <20180204150751.V909@besplex.bde.org> References: <201801021725.w02HPDaj068477@repo.freebsd.org> <20180203232725.U1389@besplex.bde.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=YbvN30Zf c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=6COIcUhGSTRIru9ACGAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 04 Feb 2018 05:15:23 -0000 On Sat, 3 Feb 2018, Conrad Meyer wrote: > On Sat, Feb 3, 2018 at 6:46 AM, Bruce Evans wrote: >> On Tue, 2 Jan 2018, Conrad Meyer wrote: >>> ... >> Today I learned from the POSIX list that the pselect() function is designed >> to avoid this bug. It takes a signal mask arg (like msleep() in the >> kernel). >> >> I haven't noticed any function related to poll() or kevent that takes a >> signal mask. > > There is the similar function ppoll(), although it complies only with > the Linux standard, not POSIX. ppoll() is relatively new in FreeBSD (2014-11-13). Its man page says that it is first appeared in 11.0, but it is now in 10.x, and according to bsd-family-tree it actually appeared in the 10.2 release more than a year before it appeared in the 11.0 release: - 2014-11-13 pre-11.0 source tree commit - 2014-12-21 10.x source tree commit - 2015-08-13 10.2 release - 2016-10-10 11.0 release. > With kevent, you can simply mask all (or most) signals and watch on a > signal event. Conversion to kevent is more complicated, though. > >> Programs broken by buggy conversion: >> ... >> - rpcbind(8). This is not interactive and normally doesn't use ttys >> which might block. However, the -d flag makes it do fprintf() to >> stderr. This may block forever (e.g., for flow control), and you >> would like to be able to kill it using a signal. But write() will >> restart. rpcbind also uses plain signal() and doesn't know anything >> about SA_RESTART. > > This was not broken by conversion -- it was already broken in this > case. If the signal delivery raced with an fprintf, we ended up > invoking the stdio atexit handlers via exit(3) call in terminate(), > which of course encountered corrupted state. Now it is broken in a > slightly different way, yes, if signal delivery races fprintf *and* > fprintf is blocked in flow control. This might happen with a slow > serial for stderr but seems extraordinarily unlikely otherwise. Unsafe signal handlers are broken by their existence, but sometimes work. It is unlikely for ttys too. I forgot that stdio is clueless about ttys so it doesn't wait for output to drain even for stderr. So the output is normally buffered in the kernel and write() returns. > ... >> perror() >> is broken as designed since it uses stdio, so it is unsafe in signal >> handlers. The err() family copies this bug. Even *s*printf() is not >> required to be safe in signal handlers. I would fix the latter first. > > It does seem like the printf family of routines should be > signal-handler safe. Unfortunately, they are implemented in terms of > the unsafe stdio streams :-(. Even sprintf() uses the generic function __vfprintf() on a fake FILE. I think it has problems with locales. No ctype functions are in the list of async-signal-safe functions in at least the 2001 version of POSIX. It is easy to see why they might not be safe. They access lots of static storage, and setlocale() or a simpler function that changes state might run in another or just a nested signal handler, so locking is required... So the safe sprintf() would probably have to use the C locale. The locale is already passed to __vfprintf(), as needed for sprintf_l(). >... >>> Modified: head/usr.sbin/rpcbind/rpcbind.c >>> ... >>> terminate(int signum) >>> ... >>> + wr = write(terminate_wfd, &c, 1); >> >> >> Not async-signal-safe. Acccesses in signal handlers to objects with >> static storage duration give undefined behaviour except for assignment to >> objects of type volatile sig_atomic_t, but the access to terminate_wfd is >> a read and the type is plain int. > > The type can be changed to volatile sig_atomic_t if you believe plain > int will trigger nonsensical compiler behavior. The value is > initialized once, before the signal handler is registered, so unless > the compiler does something totally insane it should be fine on all > architectures FreeBSD runs on. sig_atomic_t is no better than plain int. This behaviour now makes complete sense. It is just like the undefined behaviour with the ctype functions, except since we own terminate_wfd we can guarantee that it doesn't change while the handler is active (and is valid when the handler is entered). We could also use atomic ops. However, the C standard doesn't require anything that we do to work (except maybe in C11, atomic ops might be explicitly or implicitly specifed to work for things like this). >>> + if (wr < 1) >>> + _exit(2); >> >> >> Best to not check for write errors, since the error handling of using >> _exit() >> is worse than none. It loses stdio flushing to handle an almost-harmless >> error. The main problem with keeping everything in a safe handler is that >> it >> is impossible to keep stdio flushing there and we would prefer to not lost >> the stdio flushing. > > I don't necessarily agree. If the write fails, we missed the signal > telling us to terminate the program and will never exit. That said, > how would the write ever fail? We still set the flag, so can only fail to exit() in the race case, but the write() failure affects all cases. I can't see how the write() can fail. That was part of the excuse for removing the check. Bruce From owner-svn-src-head@freebsd.org Sun Feb 4 12:16:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6905FECE244; Sun, 4 Feb 2018 12:16:37 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 081617CC1A; Sun, 4 Feb 2018 12:16:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8C1E19FF7; Sun, 4 Feb 2018 12:16:36 +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 w14CGaNH086714; Sun, 4 Feb 2018 12:16:36 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14CGaDG086713; Sun, 4 Feb 2018 12:16:36 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201802041216.w14CGaDG086713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 4 Feb 2018 12:16:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328839 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 328839 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.25 Precedence: list List-Id: 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, 04 Feb 2018 12:16:37 -0000 Author: allanjude Date: Sun Feb 4 12:16:36 2018 New Revision: 328839 URL: https://svnweb.freebsd.org/changeset/base/328839 Log: Add the ThinkPad X1 (sandybridge) to the bsdinstall blacklist MFC after: 2 weeks Sponsored by: FOSDEM IllumOS Table Modified: head/usr.sbin/bsdinstall/scripts/auto Modified: head/usr.sbin/bsdinstall/scripts/auto ============================================================================== --- head/usr.sbin/bsdinstall/scripts/auto Sun Feb 4 08:22:11 2018 (r328838) +++ head/usr.sbin/bsdinstall/scripts/auto Sun Feb 4 12:16:36 2018 (r328839) @@ -182,7 +182,7 @@ if f_interactive; then case "$sys_maker" in "LENOVO") case "$sys_version" in - "ThinkPad X220"|"ThinkPad T420"|"ThinkPad T520"|"ThinkPad W520") + "ThinkPad X220"|"ThinkPad T420"|"ThinkPad T520"|"ThinkPad W520"|"ThinkPad X1") dialog_workaround "$msg_lenovo_fix" retval=$? f_dprintf "lenovofix_prompt=[%s]" "$retval" From owner-svn-src-head@freebsd.org Sun Feb 4 13:00:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30A9BED206B; Sun, 4 Feb 2018 13:00:34 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FE7E7E1B7; Sun, 4 Feb 2018 13:00:33 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id w14D0VJO002121; Sun, 4 Feb 2018 13:00:31 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id w14D0VjJ002120; Sun, 4 Feb 2018 05:00:31 -0800 (PST) (envelope-from david) Date: Sun, 4 Feb 2018 05:00:31 -0800 From: David Wolfskill To: "O. Hartmann" Cc: Jason Harmening , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328489 - head/sys/conf Message-ID: <20180204130031.GC1178@albert.catwhisker.org> References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="m51xatjYGsM+13rf" Content-Disposition: inline In-Reply-To: <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 04 Feb 2018 13:00:34 -0000 --m51xatjYGsM+13rf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 04, 2018 at 01:33:10PM +0100, O. Hartmann wrote: > Am Mon, 29 Jan 2018 05:00:22 -0800 > David Wolfskill schrieb: > > On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: > > > > This happens now if PORTS_MODULE=3Dx11/nvidia-driver is defined in = /etc/src.conf: > > > >=20 > > > > [...] > > > > --- kernel-install --- > > > > mkdir -p /boot/kernel > > > > install -p -m 555 -o root -g wheel kernel /boot/kernel/ > > > > --- ports-install --- > > > > Variable OBJTOP is recursive. > > > >=20 > > > > make[8]: stopped =20 > > > ... > > >=20 > > > David sent me logs of the failing case; thanks David! =20 > >=20 > > Happy to help! :-) > >=20 > > > The failure happens when buildkernel and installkernel are run=20 > > > separately instead of all-up, e.g. 'make kernel'. The installkernel= =20 > > > step is leaving MK_AUTO_OBJ=3Dno in the env passed to the port build.= It=20 > > > looks like at least one of the install stages of nvidia-driver needs = to=20 > > > generate temporary output, which leads to confusion when the port isn= 't=20 > > > built as though it's an in-tree component. > > >=20 > > > Can you guys try out the attached patch? =20 > >=20 > > I tried it both on my build machine (which does not use kernel modules > > from ports, and thus did not exhibit the problem -- but I thought that > > verifying that the patch did not break that case worth checking) and on > > my laptop (which did exhibit the problem). > >=20 > > It worked in both cases with no issues for me. > >=20 > > Thanks! :-) > >=20 > > Peace, > > david >=20 > The problem still persists! >=20 > I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 2018 am= d64, the source > tree is at revision 328839. I have augmented with "new_typescript.txt" -- the typescript from this morning's update of head/amd64 from r328830 to r328838... which worked without complaint for me. And you can see in the log where x11/nvidia-driver-340 is rebuilt (starting around line 23660). > I use WITH_META_MODE=3DYES in /etc/src.conf. My /etc/make.conf consists o= f a .include > statement which reels in /usr/local/etc/ports.conf in which I define ever= ything outside > the source tree for ports (in case of the nvidia driver, its DISTVERSION)= =2E This worked > before and should work again. Today I checked out a completely fresh /usr= /src and gleanced > the /usr/obj folder and rebuilt the system - and get the error again: I also use 'WITH_META_MODE=3Dyes' (in /etc/src-env.conf). > [...] > =3D=3D=3D> Ports module x11/nvidia-driver (install) > cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CPP = -u MAKESYSPATH > MAKEFLAGS=3D"-j 4 -J 15,16 .MAKE.LEVEL.ENV=3DMAKELEVEL KERNEL=3Dkernel MK= _AUTO_OBJ=3Dno > TARGET=3Damd64 TARGET_ARCH=3Damd64" SYSDIR=3D/usr/src/sys > PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/= amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:= /usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/= usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin > SRC_BASE=3D/usr/src OSVERSION=3D1200056 WRKDIRPREFIX=3D/usr/obj/usr/src= /amd64.amd64/sys/THOR > make -B deinstall reinstall =3D=3D=3D> Deinstalling for nvidia-driver = =3D=3D=3D> Deinstalling > nvidia-driver-387.34 Updating database digests format: . done Checking in= tegrity... done > (0 conflicting) Deinstallation has been requested for the following 1 pac= kages (of 0 > packages in the universe): >=20 > Installed packages to be REMOVED: > nvidia-driver-387.34 >=20 > Number of packages to be removed: 1 >=20 > The operation will free 99 MiB. > [1/1] Deinstalling nvidia-driver-387.34... > [1/1] Deleting files for nvidia-driver-387.34: .......... done > =3D=3D=3D> Staging for nvidia-driver-387.34 > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib/libGL.s= o - found > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkg= config/x11.pc - found > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkg= config/xorg-server.pc > - found =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib= data/pkgconfig/xext.pc > - found =3D=3D=3D> Generating temporary packing list > =3D=3D=3D> src (install) > =3D=3D=3D> src/nvidia (install) > Variable OBJTOP is recursive. >=20 > make[8]: stopped > in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/nvidia-driver/w= ork/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia > *** Error code 2 >=20 >=20 >=20 > Oliver >=20 > --=20 > O. Hartmann > .... Well, it is working for me.... Peace, david --=20 David H. Wolfskill david@catwhisker.org The circus around that memo helps confirm that Mr. Trump is unfit for offic= e. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --m51xatjYGsM+13rf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEzLfO+ReoAfQwZNd7FTnMQKBJ7hcFAlp3A+9fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEND QjdDRUY5MTdBODAxRjQzMDY0RDc3QjE1MzlDQzQwQTA0OUVFMTcACgkQFTnMQKBJ 7hePMgf+M3h3HJY/38/aqdG5uZKDG8yKrFOSBizr32KgN70fT83tpEKjgpbf0nku Byx+o5Zj1IDSl5pprb8MDpNcdtDgQp+E40ldJ9EVEdroYg068/XqJUR71vrmSZB9 KZ9jBsCxx0SVH+3iDmTqB9EQVFlZbbSLJJfpTVt08oFX1b5B8NGz0DDx469A3+Bw V+vuw3sRPrPv3Mhka+DTD356n5DcLpREH+UuSu4IjwSvjZw6EdBkududJYEI4G1g JsnUiI5KHaJ5iGZXzq0s+iL/yvJuQaRaxmbGsoLUVKA9e82ykdrbazSMDJCgZfKY kEV9QuZHwPwb1JVCrapuNv+rpcyQuA== =/pEO -----END PGP SIGNATURE----- --m51xatjYGsM+13rf-- From owner-svn-src-head@freebsd.org Sun Feb 4 13:54:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D6CDED7E49; Sun, 4 Feb 2018 13:54:06 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2DD880AE0; Sun, 4 Feb 2018 13:54:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC9A11B010; Sun, 4 Feb 2018 13:54:05 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14Ds5JR036831; Sun, 4 Feb 2018 13:54:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14Ds5j7036830; Sun, 4 Feb 2018 13:54:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041354.w14Ds5j7036830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 13:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328841 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328841 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.25 Precedence: list List-Id: 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, 04 Feb 2018 13:54:06 -0000 Author: trasz Date: Sun Feb 4 13:54:05 2018 New Revision: 328841 URL: https://svnweb.freebsd.org/changeset/base/328841 Log: Remove unused variable. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/extern.h Modified: head/libexec/getty/extern.h ============================================================================== --- head/libexec/getty/extern.h Sun Feb 4 13:53:45 2018 (r328840) +++ head/libexec/getty/extern.h Sun Feb 4 13:54:05 2018 (r328841) @@ -36,7 +36,6 @@ struct delayval; struct termios; extern char hostname[]; -extern int hopcount; extern struct termios tmode, omode; extern struct gettyflags gettyflags[]; extern struct gettynums gettynums[]; From owner-svn-src-head@freebsd.org Sun Feb 4 14:27:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13DCCED8D25; Sun, 4 Feb 2018 14:27:13 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6A9B81DE7; Sun, 4 Feb 2018 14:27:12 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA7111B4E8; Sun, 4 Feb 2018 14:27:12 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14ERCCH052522; Sun, 4 Feb 2018 14:27:12 GMT (envelope-from swills@FreeBSD.org) Received: (from swills@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14ERCBK052521; Sun, 4 Feb 2018 14:27:12 GMT (envelope-from swills@FreeBSD.org) Message-Id: <201802041427.w14ERCBK052521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: swills set sender to swills@FreeBSD.org using -f From: Steve Wills Date: Sun, 4 Feb 2018 14:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328848 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: swills X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 328848 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.25 Precedence: list List-Id: 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, 04 Feb 2018 14:27:13 -0000 Author: swills (ports committer) Date: Sun Feb 4 14:27:12 2018 New Revision: 328848 URL: https://svnweb.freebsd.org/changeset/base/328848 Log: Create GENERIC64-NODEBUG for powerpc64 Approved by: jhibbits Differential Revision: https://reviews.freebsd.org/D14192 Added: head/sys/powerpc/conf/GENERIC64-NODEBUG (contents, props changed) Added: head/sys/powerpc/conf/GENERIC64-NODEBUG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/conf/GENERIC64-NODEBUG Sun Feb 4 14:27:12 2018 (r328848) @@ -0,0 +1,37 @@ +# +# GENERIC64-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file +# for FreeBSD/powerpc +# +# This configuration file removes several debugging options, including +# WITNESS and INVARIANTS checking, which are known to have significant +# performance impact on running systems. When benchmarking new features +# this kernel should be used instead of the standard GENERIC64. +# This kernel configuration should never appear outside of the HEAD +# of the FreeBSD tree. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# https://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (https://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC64 + +ident GENERIC64-NODEBUG + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions DEADLKRES From owner-svn-src-head@freebsd.org Sun Feb 4 15:39:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 535DEEDCA11; Sun, 4 Feb 2018 15:39:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08E2C84D20; Sun, 4 Feb 2018 15:39:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03D761C022; Sun, 4 Feb 2018 15:39:16 +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 w14FdFkD087614; Sun, 4 Feb 2018 15:39:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14FdF9w087613; Sun, 4 Feb 2018 15:39:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802041539.w14FdF9w087613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Feb 2018 15:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328851 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 328851 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.25 Precedence: list List-Id: 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, 04 Feb 2018 15:39:16 -0000 Author: jhibbits Date: Sun Feb 4 15:39:15 2018 New Revision: 328851 URL: https://svnweb.freebsd.org/changeset/base/328851 Log: Add sdhci to MPC85XX build Modified: head/sys/powerpc/conf/MPC85XX Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Sun Feb 4 15:37:58 2018 (r328850) +++ head/sys/powerpc/conf/MPC85XX Sun Feb 4 15:39:15 2018 (r328851) @@ -95,6 +95,7 @@ device random #device rl device scbus device scc +device sdhci device sec device spibus device spigen From owner-svn-src-head@freebsd.org Sun Feb 4 15:37:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C2D8EDC999; Sun, 4 Feb 2018 15:37:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEB5784BD2; Sun, 4 Feb 2018 15:37:58 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A55CA1C01C; Sun, 4 Feb 2018 15:37:58 +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 w14FbwVW087525; Sun, 4 Feb 2018 15:37:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14Fbw6T087524; Sun, 4 Feb 2018 15:37:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802041537.w14Fbw6T087524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Feb 2018 15:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328850 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 328850 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.25 Precedence: list List-Id: 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, 04 Feb 2018 15:37:59 -0000 Author: jhibbits Date: Sun Feb 4 15:37:58 2018 New Revision: 328850 URL: https://svnweb.freebsd.org/changeset/base/328850 Log: Minimal changes for MPR to build on architectures with physical addresses larger than virtual Summary: Some architectures use large (36-bit) physical addresses, with smaller virtual addresses. Casting between vm_paddr_t (or bus_addr_t) and void * is considered illegal, so cast through uintptr_t. No functional change on existing platforms. Reviewed By: scottl Differential Revision: https://reviews.freebsd.org/D14042 Modified: head/sys/dev/mpr/mpr.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sun Feb 4 14:49:55 2018 (r328849) +++ head/sys/dev/mpr/mpr.c Sun Feb 4 15:37:58 2018 (r328850) @@ -2763,7 +2763,7 @@ mpr_build_nvme_prp(struct mpr_softc *sc, struct mpr_co prp_entry_phys = prp_page_phys; /* Get physical address and length of the data buffer. */ - paddr = (bus_addr_t)data; + paddr = (bus_addr_t)(uintptr_t)data; if (data_in_sz) length = data_in_sz; else @@ -2947,7 +2947,7 @@ mpr_check_pcie_native_sgl(struct mpr_softc *sc, struct else if ((buff_len > (PAGE_SIZE * 4)) && (buff_len <= (PAGE_SIZE * 5)) ) { - msg_phys = (uint64_t *)segs[0].ds_addr; + msg_phys = (uint64_t *)(uintptr_t)segs[0].ds_addr; first_page_offset = ((uint32_t)(uint64_t)(uintptr_t)msg_phys & page_mask); From owner-svn-src-head@freebsd.org Sun Feb 4 13:58:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9E92ED8042; Sun, 4 Feb 2018 13:58:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FFD380F06; Sun, 4 Feb 2018 13:58:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AEC31B015; Sun, 4 Feb 2018 13:58:31 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14DwVG0037349; Sun, 4 Feb 2018 13:58:31 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14DwVB2037348; Sun, 4 Feb 2018 13:58:31 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041358.w14DwVB2037348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 13:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328846 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328846 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.25 Precedence: list List-Id: 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, 04 Feb 2018 13:58:32 -0000 Author: trasz Date: Sun Feb 4 13:58:31 2018 New Revision: 328846 URL: https://svnweb.freebsd.org/changeset/base/328846 Log: Initialize all the fields. This is one of the steps required to bump WARNS. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/init.c Modified: head/libexec/getty/init.c ============================================================================== --- head/libexec/getty/init.c Sun Feb 4 13:58:29 2018 (r328845) +++ head/libexec/getty/init.c Sun Feb 4 13:58:31 2018 (r328846) @@ -42,6 +42,7 @@ static const char rcsid[] = * * Melbourne getty. */ +#include #include #include "gettytab.h" #include "extern.h" @@ -55,101 +56,101 @@ static char datefmt[] = "%+"; #define M(a) (&omode.c_cc[a]) struct gettystrs gettystrs[] = { - { "nx" }, /* next table */ - { "cl" }, /* screen clear characters */ - { "im" }, /* initial message */ - { "lm", loginmsg }, /* login message */ - { "er", M(VERASE) }, /* erase character */ - { "kl", M(VKILL) }, /* kill character */ - { "et", M(VEOF) }, /* eof chatacter (eot) */ - { "pc", nullstr }, /* pad character */ - { "tt" }, /* terminal type */ - { "ev" }, /* environment */ - { "lo", loginprg }, /* login program */ - { "hn", hostname }, /* host name */ - { "he" }, /* host name edit */ - { "in", M(VINTR) }, /* interrupt char */ - { "qu", M(VQUIT) }, /* quit char */ - { "xn", M(VSTART) }, /* XON (start) char */ - { "xf", M(VSTOP) }, /* XOFF (stop) char */ - { "bk", M(VEOL) }, /* brk char (alt \n) */ - { "su", M(VSUSP) }, /* suspend char */ - { "ds", M(VDSUSP) }, /* delayed suspend */ - { "rp", M(VREPRINT) }, /* reprint char */ - { "fl", M(VDISCARD) }, /* flush output */ - { "we", M(VWERASE) }, /* word erase */ - { "ln", M(VLNEXT) }, /* literal next */ - { "Lo" }, /* locale for strftime() */ - { "pp" }, /* ppp login program */ - { "if" }, /* sysv-like 'issue' filename */ - { "ic" }, /* modem init-chat */ - { "ac" }, /* modem answer-chat */ - { "al" }, /* user to auto-login */ - { "df", datefmt}, /* format for strftime() */ - { "iM" }, /* initial message program */ - { 0 } + { "nx", NULL, NULL }, /* next table */ + { "cl", NULL, NULL }, /* screen clear characters */ + { "im", NULL, NULL }, /* initial message */ + { "lm", loginmsg, NULL }, /* login message */ + { "er", M(VERASE), NULL }, /* erase character */ + { "kl", M(VKILL), NULL }, /* kill character */ + { "et", M(VEOF), NULL }, /* eof chatacter (eot) */ + { "pc", nullstr, NULL }, /* pad character */ + { "tt", NULL, NULL }, /* terminal type */ + { "ev", NULL, NULL }, /* environment */ + { "lo", loginprg, NULL }, /* login program */ + { "hn", hostname, NULL }, /* host name */ + { "he", NULL, NULL }, /* host name edit */ + { "in", M(VINTR), NULL }, /* interrupt char */ + { "qu", M(VQUIT), NULL }, /* quit char */ + { "xn", M(VSTART), NULL }, /* XON (start) char */ + { "xf", M(VSTOP), NULL }, /* XOFF (stop) char */ + { "bk", M(VEOL), NULL }, /* brk char (alt \n) */ + { "su", M(VSUSP), NULL }, /* suspend char */ + { "ds", M(VDSUSP), NULL }, /* delayed suspend */ + { "rp", M(VREPRINT), NULL }, /* reprint char */ + { "fl", M(VDISCARD), NULL }, /* flush output */ + { "we", M(VWERASE), NULL }, /* word erase */ + { "ln", M(VLNEXT), NULL }, /* literal next */ + { "Lo", NULL, NULL }, /* locale for strftime() */ + { "pp", NULL, NULL }, /* ppp login program */ + { "if", NULL, NULL }, /* sysv-like 'issue' filename */ + { "ic", NULL, NULL }, /* modem init-chat */ + { "ac", NULL, NULL }, /* modem answer-chat */ + { "al", NULL, NULL }, /* user to auto-login */ + { "df", datefmt, NULL }, /* format for strftime() */ + { "iM" , NULL, NULL }, /* initial message program */ + { NULL, NULL, NULL } }; struct gettynums gettynums[] = { - { "is" }, /* input speed */ - { "os" }, /* output speed */ - { "sp" }, /* both speeds */ - { "nd" }, /* newline delay */ - { "cd" }, /* carriage-return delay */ - { "td" }, /* tab delay */ - { "fd" }, /* form-feed delay */ - { "bd" }, /* backspace delay */ - { "to" }, /* timeout */ - { "f0" }, /* output flags */ - { "f1" }, /* input flags */ - { "f2" }, /* user mode flags */ - { "pf" }, /* delay before flush at 1st prompt */ - { "c0" }, /* output c_flags */ - { "c1" }, /* input c_flags */ - { "c2" }, /* user mode c_flags */ - { "i0" }, /* output i_flags */ - { "i1" }, /* input i_flags */ - { "i2" }, /* user mode i_flags */ - { "l0" }, /* output l_flags */ - { "l1" }, /* input l_flags */ - { "l2" }, /* user mode l_flags */ - { "o0" }, /* output o_flags */ - { "o1" }, /* input o_flags */ - { "o2" }, /* user mode o_flags */ - { "de" }, /* delay before sending 1st prompt */ - { "rt" }, /* reset timeout */ - { "ct" }, /* chat script timeout */ - { "dc" }, /* debug chat script value */ - { 0 } + { "is", 0, 0, 0 }, /* input speed */ + { "os", 0, 0, 0 }, /* output speed */ + { "sp", 0, 0, 0 }, /* both speeds */ + { "nd", 0, 0, 0 }, /* newline delay */ + { "cd", 0, 0, 0 }, /* carriage-return delay */ + { "td", 0, 0, 0 }, /* tab delay */ + { "fd", 0, 0, 0 }, /* form-feed delay */ + { "bd", 0, 0, 0 }, /* backspace delay */ + { "to", 0, 0, 0 }, /* timeout */ + { "f0", 0, 0, 0 }, /* output flags */ + { "f1", 0, 0, 0 }, /* input flags */ + { "f2", 0, 0, 0 }, /* user mode flags */ + { "pf", 0, 0, 0 }, /* delay before flush at 1st prompt */ + { "c0", 0, 0, 0 }, /* output c_flags */ + { "c1", 0, 0, 0 }, /* input c_flags */ + { "c2", 0, 0, 0 }, /* user mode c_flags */ + { "i0", 0, 0, 0 }, /* output i_flags */ + { "i1", 0, 0, 0 }, /* input i_flags */ + { "i2", 0, 0, 0 }, /* user mode i_flags */ + { "l0", 0, 0, 0 }, /* output l_flags */ + { "l1", 0, 0, 0 }, /* input l_flags */ + { "l2", 0, 0, 0 }, /* user mode l_flags */ + { "o0", 0, 0, 0 }, /* output o_flags */ + { "o1", 0, 0, 0 }, /* input o_flags */ + { "o2", 0, 0, 0 }, /* user mode o_flags */ + { "de", 0, 0, 0 }, /* delay before sending 1st prompt */ + { "rt", 0, 0, 0 }, /* reset timeout */ + { "ct", 0, 0, 0 }, /* chat script timeout */ + { "dc", 0, 0, 0 }, /* debug chat script value */ + { NULL, 0, 0, 0 } }; struct gettyflags gettyflags[] = { - { "ht", 0 }, /* has tabs */ - { "nl", 1 }, /* has newline char */ - { "ep", 0 }, /* even parity */ - { "op", 0 }, /* odd parity */ - { "ap", 0 }, /* any parity */ - { "ec", 1 }, /* no echo */ - { "co", 0 }, /* console special */ - { "cb", 0 }, /* crt backspace */ - { "ck", 0 }, /* crt kill */ - { "ce", 0 }, /* crt erase */ - { "pe", 0 }, /* printer erase */ - { "rw", 1 }, /* don't use raw */ - { "xc", 1 }, /* don't ^X ctl chars */ - { "lc", 0 }, /* terminal las lower case */ - { "uc", 0 }, /* terminal has no lower case */ - { "ig", 0 }, /* ignore garbage */ - { "ps", 0 }, /* do port selector speed select */ - { "hc", 1 }, /* don't set hangup on close */ - { "ub", 0 }, /* unbuffered output */ - { "ab", 0 }, /* auto-baud detect with '\r' */ - { "dx", 0 }, /* set decctlq */ - { "np", 0 }, /* no parity at all (8bit chars) */ - { "mb", 0 }, /* do MDMBUF flow control */ - { "hw", 0 }, /* do CTSRTS flow control */ - { "nc", 0 }, /* set clocal (no carrier) */ - { "pl", 0 }, /* use PPP instead of login(1) */ - { 0 } + { "ht", 0, 0, 0, 0 }, /* has tabs */ + { "nl", 1, 0, 0, 0 }, /* has newline char */ + { "ep", 0, 0, 0, 0 }, /* even parity */ + { "op", 0, 0, 0, 0 }, /* odd parity */ + { "ap", 0, 0, 0, 0 }, /* any parity */ + { "ec", 1, 0, 0, 0 }, /* no echo */ + { "co", 0, 0, 0, 0 }, /* console special */ + { "cb", 0, 0, 0, 0 }, /* crt backspace */ + { "ck", 0, 0, 0, 0 }, /* crt kill */ + { "ce", 0, 0, 0, 0 }, /* crt erase */ + { "pe", 0, 0, 0, 0 }, /* printer erase */ + { "rw", 1, 0, 0, 0 }, /* don't use raw */ + { "xc", 1, 0, 0, 0 }, /* don't ^X ctl chars */ + { "lc", 0, 0, 0, 0 }, /* terminal las lower case */ + { "uc", 0, 0, 0, 0 }, /* terminal has no lower case */ + { "ig", 0, 0, 0, 0 }, /* ignore garbage */ + { "ps", 0, 0, 0, 0 }, /* do port selector speed select */ + { "hc", 1, 0, 0, 0 }, /* don't set hangup on close */ + { "ub", 0, 0, 0, 0 }, /* unbuffered output */ + { "ab", 0, 0, 0, 0 }, /* auto-baud detect with '\r' */ + { "dx", 0, 0, 0, 0 }, /* set decctlq */ + { "np", 0, 0, 0, 0 }, /* no parity at all (8bit chars) */ + { "mb", 0, 0, 0, 0 }, /* do MDMBUF flow control */ + { "hw", 0, 0, 0, 0 }, /* do CTSRTS flow control */ + { "nc", 0, 0, 0, 0 }, /* set clocal (no carrier) */ + { "pl", 0, 0, 0, 0 }, /* use PPP instead of login(1) */ + { NULL, 0, 0, 0, 0 } }; From owner-svn-src-head@freebsd.org Sun Feb 4 14:49:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54B4AED9CA4; Sun, 4 Feb 2018 14:49:57 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E701182932; Sun, 4 Feb 2018 14:49:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2A921B816; Sun, 4 Feb 2018 14:49:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14Enu1N062349; Sun, 4 Feb 2018 14:49:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14EntCw062339; Sun, 4 Feb 2018 14:49:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802041449.w14EntCw062339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 4 Feb 2018 14:49:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328849 - in head: sbin/geom/class/cache sbin/geom/class/concat sbin/geom/class/journal sbin/geom/class/label sbin/geom/class/mirror sbin/geom/class/raid3 sbin/geom/class/shsec sbin/geo... X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: sbin/geom/class/cache sbin/geom/class/concat sbin/geom/class/journal sbin/geom/class/label sbin/geom/class/mirror sbin/geom/class/raid3 sbin/geom/class/shsec sbin/geom/class/stripe sbin/geom/... X-SVN-Commit-Revision: 328849 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.25 Precedence: list List-Id: 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, 04 Feb 2018 14:49:57 -0000 Author: asomers Date: Sun Feb 4 14:49:55 2018 New Revision: 328849 URL: https://svnweb.freebsd.org/changeset/base/328849 Log: geom: don't write stack garbage in disk labels Most consumers of g_metadata_store were passing in partially unallocated memory, resulting in stack garbage being written to disk labels. Fix them by zeroing the memory first. gvirstor repeated the same mistake, but in the kernel. Also, glabel's label contained a fixed-size string that wasn't initialized to zero. PR: 222077 Reported by: Maxim Khitrov Reviewed by: cem MFC after: 3 weeks X-MFC-With: 323314 X-MFC-With: 323338 Differential Revision: https://reviews.freebsd.org/D14164 Modified: head/sbin/geom/class/cache/geom_cache.c head/sbin/geom/class/concat/geom_concat.c head/sbin/geom/class/journal/geom_journal.c head/sbin/geom/class/label/geom_label.c head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/raid3/geom_raid3.c head/sbin/geom/class/shsec/geom_shsec.c head/sbin/geom/class/stripe/geom_stripe.c head/sbin/geom/misc/subr.c head/sys/geom/virstor/g_virstor.c Modified: head/sbin/geom/class/cache/geom_cache.c ============================================================================== --- head/sbin/geom/class/cache/geom_cache.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/cache/geom_cache.c Sun Feb 4 14:49:55 2018 (r328849) @@ -137,6 +137,7 @@ cache_label(struct gctl_req *req) int error, nargs; intmax_t val; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs != 2) { gctl_error(req, "Invalid number of arguments."); Modified: head/sbin/geom/class/concat/geom_concat.c ============================================================================== --- head/sbin/geom/class/concat/geom_concat.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/concat/geom_concat.c Sun Feb 4 14:49:55 2018 (r328849) @@ -119,6 +119,7 @@ concat_label(struct gctl_req *req) const char *name; int error, i, hardcode, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 2) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/class/journal/geom_journal.c ============================================================================== --- head/sbin/geom/class/journal/geom_journal.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/journal/geom_journal.c Sun Feb 4 14:49:55 2018 (r328849) @@ -144,6 +144,7 @@ journal_label(struct gctl_req *req) intmax_t jsize, msize, ssize; int error, force, i, nargs, checksum, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); str = NULL; /* gcc */ Modified: head/sbin/geom/class/label/geom_label.c ============================================================================== --- head/sbin/geom/class/label/geom_label.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/label/geom_label.c Sun Feb 4 14:49:55 2018 (r328849) @@ -125,6 +125,7 @@ label_label(struct gctl_req *req) u_char sector[512]; int error, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs != 2) { gctl_error(req, "Invalid number of arguments."); @@ -145,6 +146,7 @@ label_label(struct gctl_req *req) strlcpy(md.md_magic, G_LABEL_MAGIC, sizeof(md.md_magic)); md.md_version = G_LABEL_VERSION; label = gctl_get_ascii(req, "arg0"); + bzero(md.md_label, sizeof(md.md_label)); strlcpy(md.md_label, label, sizeof(md.md_label)); md.md_provsize = g_get_mediasize(name); if (md.md_provsize == 0) { Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/mirror/geom_mirror.c Sun Feb 4 14:49:55 2018 (r328849) @@ -188,6 +188,7 @@ mirror_label(struct gctl_req *req) intmax_t val; int error, i, nargs, bal, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 2) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/class/raid3/geom_raid3.c ============================================================================== --- head/sbin/geom/class/raid3/geom_raid3.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/raid3/geom_raid3.c Sun Feb 4 14:49:55 2018 (r328849) @@ -151,6 +151,7 @@ raid3_label(struct gctl_req *req) int hardcode, round_robin, verify; int error, i, nargs; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 4) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/class/shsec/geom_shsec.c ============================================================================== --- head/sbin/geom/class/shsec/geom_shsec.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/shsec/geom_shsec.c Sun Feb 4 14:49:55 2018 (r328849) @@ -112,6 +112,7 @@ shsec_label(struct gctl_req *req) const char *name; int error, i, nargs, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs <= 2) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/class/stripe/geom_stripe.c ============================================================================== --- head/sbin/geom/class/stripe/geom_stripe.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/class/stripe/geom_stripe.c Sun Feb 4 14:49:55 2018 (r328849) @@ -130,6 +130,7 @@ stripe_label(struct gctl_req *req) const char *name; int error, i, nargs, hardcode; + bzero(sector, sizeof(sector)); nargs = gctl_get_int(req, "nargs"); if (nargs < 3) { gctl_error(req, "Too few arguments."); Modified: head/sbin/geom/misc/subr.c ============================================================================== --- head/sbin/geom/misc/subr.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sbin/geom/misc/subr.c Sun Feb 4 14:49:55 2018 (r328849) @@ -273,6 +273,13 @@ out: return (error); } +/* + * Actually write the GEOM label to the provider + * + * @param name GEOM provider's name (ie "ada0") + * @param md Pointer to the label data to write + * @param size Size of the data pointed to by md + */ int g_metadata_store(const char *name, const unsigned char *md, size_t size) { Modified: head/sys/geom/virstor/g_virstor.c ============================================================================== --- head/sys/geom/virstor/g_virstor.c Sun Feb 4 14:27:12 2018 (r328848) +++ head/sys/geom/virstor/g_virstor.c Sun Feb 4 14:49:55 2018 (r328849) @@ -1042,6 +1042,7 @@ write_metadata(struct g_consumer *cp, struct g_virstor pp = cp->provider; buf = malloc(pp->sectorsize, M_GVIRSTOR, M_WAITOK); + bzero(buf, pp->sectorsize); virstor_metadata_encode(md, buf); g_topology_unlock(); error = g_write_data(cp, pp->mediasize - pp->sectorsize, buf, From owner-svn-src-head@freebsd.org Sun Feb 4 15:40:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B54DEDCC52; Sun, 4 Feb 2018 15:40:49 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE2A784EFB; Sun, 4 Feb 2018 15:40:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A94891C034; Sun, 4 Feb 2018 15:40:48 +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 w14FemFg088638; Sun, 4 Feb 2018 15:40:48 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14FemEQ088636; Sun, 4 Feb 2018 15:40:48 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802041540.w14FemEQ088636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Feb 2018 15:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328852 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 328852 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.25 Precedence: list List-Id: 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, 04 Feb 2018 15:40:49 -0000 Author: jhibbits Date: Sun Feb 4 15:40:48 2018 New Revision: 328852 URL: https://svnweb.freebsd.org/changeset/base/328852 Log: Start building modules for MPC85XX and MPC85XXSPE These kernels aren't restricted to development boards anymore, they are closer in behavior to GENERIC, so build modules. Modified: head/sys/powerpc/conf/MPC85XX head/sys/powerpc/conf/MPC85XXSPE Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Sun Feb 4 15:39:15 2018 (r328851) +++ head/sys/powerpc/conf/MPC85XX Sun Feb 4 15:40:48 2018 (r328852) @@ -14,7 +14,6 @@ include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" -makeoptions NO_MODULES=yes options FPU_EMU Modified: head/sys/powerpc/conf/MPC85XXSPE ============================================================================== --- head/sys/powerpc/conf/MPC85XXSPE Sun Feb 4 15:39:15 2018 (r328851) +++ head/sys/powerpc/conf/MPC85XXSPE Sun Feb 4 15:40:48 2018 (r328852) @@ -14,7 +14,6 @@ include "dpaa/config.dpaa" makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 makeoptions WERROR="-Werror -Wno-format -Wno-redundant-decls" -makeoptions NO_MODULES=yes options FPU_EMU From owner-svn-src-head@freebsd.org Sun Feb 4 13:55:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B60FED7E8E; Sun, 4 Feb 2018 13:55:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D06880C98; Sun, 4 Feb 2018 13:55:21 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDD311B012; Sun, 4 Feb 2018 13:55:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14DtK53037023; Sun, 4 Feb 2018 13:55:20 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14DtKJt037022; Sun, 4 Feb 2018 13:55:20 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041355.w14DtKJt037022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 13:55:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328843 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328843 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.25 Precedence: list List-Id: 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, 04 Feb 2018 13:55:21 -0000 Author: trasz Date: Sun Feb 4 13:55:20 2018 New Revision: 328843 URL: https://svnweb.freebsd.org/changeset/base/328843 Log: Reduce code duplication; no functional changes. Obtained from: NetBSD MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/init.c Modified: head/libexec/getty/init.c ============================================================================== --- head/libexec/getty/init.c Sun Feb 4 13:54:43 2018 (r328842) +++ head/libexec/getty/init.c Sun Feb 4 13:55:20 2018 (r328843) @@ -52,31 +52,33 @@ static char nullstr[] = ""; static char loginprg[] = _PATH_LOGIN; static char datefmt[] = "%+"; +#define M(a) (&omode.c_cc[a]) + struct gettystrs gettystrs[] = { { "nx" }, /* next table */ { "cl" }, /* screen clear characters */ { "im" }, /* initial message */ { "lm", loginmsg }, /* login message */ - { "er", &omode.c_cc[VERASE] }, /* erase character */ - { "kl", &omode.c_cc[VKILL] }, /* kill character */ - { "et", &omode.c_cc[VEOF] }, /* eof chatacter (eot) */ + { "er", M(VERASE) }, /* erase character */ + { "kl", M(VKILL) }, /* kill character */ + { "et", M(VEOF) }, /* eof chatacter (eot) */ { "pc", nullstr }, /* pad character */ { "tt" }, /* terminal type */ { "ev" }, /* environment */ { "lo", loginprg }, /* login program */ { "hn", hostname }, /* host name */ { "he" }, /* host name edit */ - { "in", &omode.c_cc[VINTR] }, /* interrupt char */ - { "qu", &omode.c_cc[VQUIT] }, /* quit char */ - { "xn", &omode.c_cc[VSTART] }, /* XON (start) char */ - { "xf", &omode.c_cc[VSTOP] }, /* XOFF (stop) char */ - { "bk", &omode.c_cc[VEOL] }, /* brk char (alt \n) */ - { "su", &omode.c_cc[VSUSP] }, /* suspend char */ - { "ds", &omode.c_cc[VDSUSP] }, /* delayed suspend */ - { "rp", &omode.c_cc[VREPRINT] },/* reprint char */ - { "fl", &omode.c_cc[VDISCARD] },/* flush output */ - { "we", &omode.c_cc[VWERASE] }, /* word erase */ - { "ln", &omode.c_cc[VLNEXT] }, /* literal next */ + { "in", M(VINTR) }, /* interrupt char */ + { "qu", M(VQUIT) }, /* quit char */ + { "xn", M(VSTART) }, /* XON (start) char */ + { "xf", M(VSTOP) }, /* XOFF (stop) char */ + { "bk", M(VEOL) }, /* brk char (alt \n) */ + { "su", M(VSUSP) }, /* suspend char */ + { "ds", M(VDSUSP) }, /* delayed suspend */ + { "rp", M(VREPRINT) }, /* reprint char */ + { "fl", M(VDISCARD) }, /* flush output */ + { "we", M(VWERASE) }, /* word erase */ + { "ln", M(VLNEXT) }, /* literal next */ { "Lo" }, /* locale for strftime() */ { "pp" }, /* ppp login program */ { "if" }, /* sysv-like 'issue' filename */ From owner-svn-src-head@freebsd.org Sun Feb 4 17:31:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 820A6EE33F2; Sun, 4 Feb 2018 17:31:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33A3C69B6B; Sun, 4 Feb 2018 17:31:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E9301D2F3; Sun, 4 Feb 2018 17:31:51 +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 w14HVp0J045762; Sun, 4 Feb 2018 17:31:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14HVpel045761; Sun, 4 Feb 2018 17:31:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802041731.w14HVpel045761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 4 Feb 2018 17:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328853 - head/stand/efi/fdt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/efi/fdt X-SVN-Commit-Revision: 328853 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.25 Precedence: list List-Id: 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, 04 Feb 2018 17:31:51 -0000 Author: kevans Date: Sun Feb 4 17:31:50 2018 New Revision: 328853 URL: https://svnweb.freebsd.org/changeset/base/328853 Log: Remove now-unused variable after r328809 Fixed already in stable/11 by r328836 (emaste); remove now-unused variable. Modified: head/stand/efi/fdt/efi_fdt.c Modified: head/stand/efi/fdt/efi_fdt.c ============================================================================== --- head/stand/efi/fdt/efi_fdt.c Sun Feb 4 15:40:48 2018 (r328852) +++ head/stand/efi/fdt/efi_fdt.c Sun Feb 4 17:31:50 2018 (r328853) @@ -44,7 +44,6 @@ int fdt_platform_load_dtb(void) { struct fdt_header *hdr; - const char *s; hdr = efi_get_table(&fdtdtb); if (hdr == NULL) From owner-svn-src-head@freebsd.org Sun Feb 4 18:08:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F24ADEE5C9D; Sun, 4 Feb 2018 18:08:31 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-pg0-x22f.google.com (mail-pg0-x22f.google.com [IPv6:2607:f8b0:400e:c05::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 2888E6B2A5; Sun, 4 Feb 2018 18:08:31 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-pg0-x22f.google.com with SMTP id g2so715439pgn.7; Sun, 04 Feb 2018 10:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ib0BItbcjswz/FCRl2Fs+hK5UUVSsa2T/fzS9JQqvhI=; b=eTUChHaIXyXeoN0Y5WPuw4y3EOoBbROU/rvYQ3XY5QkNZ17MFEJHAKtRft6scIyguA gtQtUNZaMFxZ+kETtgEVtWzhRVxyFNCvTE5LbK+18sft9wwnBWlNsPuyl6wAkwcq4T2T 1kkSsvc22Qko5I76720xshq0KUJkM47blbRQE5mJSi1uaUs9MMgGGz9a/Rvh+gXdKA3b OJhfnW2fEB18ExfETmPfnRoYPAy846NXlRs1Qn4pBqQoSlSnwjCVdQYk1S2m2G6zd0KD RUE3b2O8oaczjSOynFgkITbmtm7oKIvepL9nm5V4MBQtU7w06g5G1JBRxLZ0XzrdOK1D 0cmQ== 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=ib0BItbcjswz/FCRl2Fs+hK5UUVSsa2T/fzS9JQqvhI=; b=VLybhCLftCS7ZGG4pq0Cg6lwETXIETYKPku0QB/L3wpIWqZivq8svxPgsaAgEBBBcT 70DUK113RkfK835V9lf75uwZlHGAdv2ko4cRAKq6V7Jafyl/CFw9+0LaaxfKY+o6efTF h1x73z2NibHYzFJh0bbck625clNwtrx+xNlxl2sc2JzRhERbID+2ol7m54LI3D/sNy08 PjUbA4LD1yHwJaN2vo7TeM7GhUA+Ml+/6MmDj2UNBOiVepIK7oORblzZl63E7d6Peb8n dKUuCeWOqTPNbcdRTVNJlZkvfGvjQ/TbhAiHgAliZOuggOFXYn7mSXili82J5FAmhM28 OJzg== X-Gm-Message-State: AKwxytfnD5uJFjeyD8ypLKxwF4y3N+w1s2hJDj40rm4KaxFHugmTwLWg VfnMnw/pHjd2ysEZZh26q23A X-Google-Smtp-Source: AH8x227KlzeUzsAAhR2fPlXEjL9sbQ7G0FL9BytSVJgKo1lFYG6NFEE6V7Ak/PPPH4Wh283IPGU/5w== X-Received: by 10.99.55.65 with SMTP id g1mr27810546pgn.284.1517767709805; Sun, 04 Feb 2018 10:08:29 -0800 (PST) Received: from [192.168.1.3] (c-67-188-30-11.hsd1.ca.comcast.net. [67.188.30.11]) by smtp.googlemail.com with ESMTPSA id z19sm14583896pff.3.2018.02.04.10.08.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Feb 2018 10:08:29 -0800 (PST) Subject: Re: svn commit: r328489 - head/sys/conf To: "O. Hartmann" , David Wolfskill Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> From: Jason Harmening Message-ID: Date: Sun, 4 Feb 2018 10:22:31 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> 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.25 Precedence: list List-Id: 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, 04 Feb 2018 18:08:32 -0000 On 02/04/18 04:33, O. Hartmann wrote: > Am Mon, 29 Jan 2018 05:00:22 -0800 > David Wolfskill schrieb: > >> On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: >>>> >>>> This happens now if PORTS_MODULE=x11/nvidia-driver is defined in /etc/src.conf: >>>> >>>> [...] >>>> --- kernel-install --- >>>> mkdir -p /boot/kernel >>>> install -p -m 555 -o root -g wheel kernel /boot/kernel/ >>>> --- ports-install --- >>>> Variable OBJTOP is recursive. >>>> >>>> make[8]: stopped >>> ... >>> >>> David sent me logs of the failing case; thanks David! >> >> Happy to help! :-) >> >>> The failure happens when buildkernel and installkernel are run >>> separately instead of all-up, e.g. 'make kernel'. The installkernel >>> step is leaving MK_AUTO_OBJ=no in the env passed to the port build. It >>> looks like at least one of the install stages of nvidia-driver needs to >>> generate temporary output, which leads to confusion when the port isn't >>> built as though it's an in-tree component. >>> >>> Can you guys try out the attached patch? >> >> I tried it both on my build machine (which does not use kernel modules >> from ports, and thus did not exhibit the problem -- but I thought that >> verifying that the patch did not break that case worth checking) and on >> my laptop (which did exhibit the problem). >> >> It worked in both cases with no issues for me. >> >> Thanks! :-) >> >> Peace, >> david > > The problem still persists! > > I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 2018 amd64, the source > tree is at revision 328839. > > > I use WITH_META_MODE=YES in /etc/src.conf. My /etc/make.conf consists of a .include > statement which reels in /usr/local/etc/ports.conf in which I define everything outside > the source tree for ports (in case of the nvidia driver, its DISTVERSION). This worked > before and should work again. Today I checked out a completely fresh /usr/src and gleanced > the /usr/obj folder and rebuilt the system - and get the error again: > > [...] > ===> Ports module x11/nvidia-driver (install) > cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CPP -u MAKESYSPATH > MAKEFLAGS="-j 4 -J 15,16 .MAKE.LEVEL.ENV=MAKELEVEL KERNEL=kernel MK_AUTO_OBJ=no ^^^^^ Looks like you haven't applied the patch? MK_AUTO_OBJ being left set in MAKEFLAGS by installkernel was part of the problem. That said, the fix I have up for review is slightly different: https://reviews.freebsd.org/D14143 > TARGET=amd64 TARGET_ARCH=amd64" SYSDIR=/usr/src/sys > PATH=/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin > SRC_BASE=/usr/src OSVERSION=1200056 WRKDIRPREFIX=/usr/obj/usr/src/amd64.amd64/sys/THOR > make -B deinstall reinstall ===> Deinstalling for nvidia-driver ===> Deinstalling > nvidia-driver-387.34 Updating database digests format: . done Checking integrity... done > (0 conflicting) Deinstallation has been requested for the following 1 packages (of 0 > packages in the universe): > > Installed packages to be REMOVED: > nvidia-driver-387.34 > > Number of packages to be removed: 1 > > The operation will free 99 MiB. > [1/1] Deinstalling nvidia-driver-387.34... > [1/1] Deleting files for nvidia-driver-387.34: .......... done > ===> Staging for nvidia-driver-387.34 > ===> nvidia-driver-387.34 depends on file: /usr/local/lib/libGL.so - found > ===> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgconfig/x11.pc - found > ===> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgconfig/xorg-server.pc > - found ===> nvidia-driver-387.34 depends on file: /usr/local/libdata/pkgconfig/xext.pc > - found ===> Generating temporary packing list > ===> src (install) > ===> src/nvidia (install) > Variable OBJTOP is recursive. > > make[8]: stopped > in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia > *** Error code 2 > > > > Oliver > From owner-svn-src-head@freebsd.org Sun Feb 4 18:36:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D530EE7C55; Sun, 4 Feb 2018 18:36:25 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2C026C4DE; Sun, 4 Feb 2018 18:36:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8D931DCCB; Sun, 4 Feb 2018 18:36:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14IaOZM077093; Sun, 4 Feb 2018 18:36:24 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14IaOEh077092; Sun, 4 Feb 2018 18:36:24 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041836.w14IaOEh077092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 18:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328855 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328855 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.25 Precedence: list List-Id: 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, 04 Feb 2018 18:36:25 -0000 Author: trasz Date: Sun Feb 4 18:36:24 2018 New Revision: 328855 URL: https://svnweb.freebsd.org/changeset/base/328855 Log: Don't cast away the const, it's not been needed since r92925. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/subr.c Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Sun Feb 4 17:38:45 2018 (r328854) +++ head/libexec/getty/subr.c Sun Feb 4 18:36:24 2018 (r328855) @@ -101,7 +101,7 @@ gettable(const char *name, char *buf) firsttime = 0; } - switch (cgetent(&buf, (char **)dba, (char *)name)) { + switch (cgetent(&buf, (char **)dba, name)) { case 1: msg = "%s: couldn't resolve 'tc=' in gettytab '%s'"; case 0: @@ -126,7 +126,7 @@ gettable(const char *name, char *buf) } for (sp = gettystrs; sp->field; sp++) { - if ((l = cgetstr(buf, (char*)sp->field, &p)) >= 0) { + if ((l = cgetstr(buf, sp->field, &p)) >= 0) { if (sp->value) { /* prefer existing value */ if (strcmp(p, sp->value) != 0) @@ -144,7 +144,7 @@ gettable(const char *name, char *buf) } for (np = gettynums; np->field; np++) { - if (cgetnum(buf, (char*)np->field, &n) == -1) + if (cgetnum(buf, np->field, &n) == -1) np->set = 0; else { np->set = 1; @@ -153,7 +153,7 @@ gettable(const char *name, char *buf) } for (fp = gettyflags; fp->field; fp++) { - if (cgetcap(buf, (char *)fp->field, ':') == NULL) + if (cgetcap(buf, fp->field, ':') == NULL) fp->set = 0; else { fp->set = 1; From owner-svn-src-head@freebsd.org Sun Feb 4 18:39:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52F5BEE808C; Sun, 4 Feb 2018 18:39:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04B066C812; Sun, 4 Feb 2018 18:39:59 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F39D91DCCE; Sun, 4 Feb 2018 18:39:58 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14Idwvo077381; Sun, 4 Feb 2018 18:39:58 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14IdwP0077380; Sun, 4 Feb 2018 18:39:58 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041839.w14IdwP0077380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 18:39:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328856 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328856 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.25 Precedence: list List-Id: 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, 04 Feb 2018 18:39:59 -0000 Author: trasz Date: Sun Feb 4 18:39:58 2018 New Revision: 328856 URL: https://svnweb.freebsd.org/changeset/base/328856 Log: Rename getty's getline() to get_line(), to avoid clash with getline(3). Obtained from: DragonFlyBSD MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/main.c Modified: head/libexec/getty/main.c ============================================================================== --- head/libexec/getty/main.c Sun Feb 4 18:36:24 2018 (r328855) +++ head/libexec/getty/main.c Sun Feb 4 18:39:58 2018 (r328856) @@ -146,7 +146,7 @@ static void putf(const char *); static void putpad(const char *); static void puts(const char *); static void timeoverrun(int); -static char *getline(int); +static char *get_line(int); static void setttymode(int); static int opentty(const char *, int); @@ -318,7 +318,7 @@ main(int argc, char *argv[]) if ((fd = open(IF, O_RDONLY)) != -1) { char * cp; - while ((cp = getline(fd)) != NULL) { + while ((cp = get_line(fd)) != NULL) { putf(cp); } close(fd); @@ -707,7 +707,7 @@ prompt(void) static char * -getline(int fd) +get_line(int fd) { int i = 0; static char linebuf[512]; From owner-svn-src-head@freebsd.org Sun Feb 4 18:40:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27D30EE819D; Sun, 4 Feb 2018 18:40:37 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA6526C949; Sun, 4 Feb 2018 18:40:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C551D1DCD6; Sun, 4 Feb 2018 18:40:36 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14Iea81077477; Sun, 4 Feb 2018 18:40:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14Ieavh077476; Sun, 4 Feb 2018 18:40:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041840.w14Ieavh077476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 18:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328857 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328857 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.25 Precedence: list List-Id: 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, 04 Feb 2018 18:40:37 -0000 Author: trasz Date: Sun Feb 4 18:40:36 2018 New Revision: 328857 URL: https://svnweb.freebsd.org/changeset/base/328857 Log: Add missing initializer. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/subr.c Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Sun Feb 4 18:39:58 2018 (r328856) +++ head/libexec/getty/subr.c Sun Feb 4 18:40:36 2018 (r328857) @@ -539,7 +539,7 @@ static struct speedtab { { 57600, B57600 }, { 115200, B115200 }, { 230400, B230400 }, - { 0 } + { 0, 0 } }; int From owner-svn-src-head@freebsd.org Sun Feb 4 19:05:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0CDBEE9BD7; Sun, 4 Feb 2018 19:05:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 727196D981; Sun, 4 Feb 2018 19:05:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D4781E1B9; Sun, 4 Feb 2018 19:05:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14J5ESc092674; Sun, 4 Feb 2018 19:05:14 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14J5Eoe092670; Sun, 4 Feb 2018 19:05:14 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201802041905.w14J5Eoe092670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 4 Feb 2018 19:05:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328858 - head/libexec/getty X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/libexec/getty X-SVN-Commit-Revision: 328858 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.25 Precedence: list List-Id: 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, 04 Feb 2018 19:05:15 -0000 Author: trasz Date: Sun Feb 4 19:05:13 2018 New Revision: 328858 URL: https://svnweb.freebsd.org/changeset/base/328858 Log: Sprinkle static; avoid nested externs. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/libexec/getty/extern.h head/libexec/getty/main.c head/libexec/getty/subr.c Modified: head/libexec/getty/extern.h ============================================================================== --- head/libexec/getty/extern.h Sun Feb 4 18:40:36 2018 (r328857) +++ head/libexec/getty/extern.h Sun Feb 4 19:05:13 2018 (r328858) @@ -35,6 +35,8 @@ struct delayval; struct termios; +extern char **environ; +extern char editedhost[]; extern char hostname[]; extern struct termios tmode, omode; extern struct gettyflags gettyflags[]; Modified: head/libexec/getty/main.c ============================================================================== --- head/libexec/getty/main.c Sun Feb 4 18:40:36 2018 (r328857) +++ head/libexec/getty/main.c Sun Feb 4 19:05:13 2018 (r328858) @@ -93,23 +93,23 @@ struct termios omode; /* current mode */ struct termios tmode; -int crmod, digit, lower, upper; +static int crmod, digit, lower, upper; char hostname[MAXHOSTNAMELEN]; -char name[MAXLOGNAME*3]; -char dev[] = _PATH_DEV; -char ttyn[32]; +static char name[MAXLOGNAME*3]; +static char dev[] = _PATH_DEV; +static char ttyn[32]; #define OBUFSIZ 128 #define TABBUFSIZ 512 -char defent[TABBUFSIZ]; -char tabent[TABBUFSIZ]; -const char *tname; +static char defent[TABBUFSIZ]; +static char tabent[TABBUFSIZ]; +static const char *tname; -char *env[128]; +static char *env[128]; -char partab[] = { +static char partab[] = { 0001,0201,0201,0001,0201,0001,0001,0201, 0202,0004,0003,0205,0005,0206,0201,0001, 0201,0001,0001,0201,0001,0201,0201,0001, @@ -150,7 +150,7 @@ static char *get_line(int); static void setttymode(int); static int opentty(const char *, int); -jmp_buf timeout; +static jmp_buf timeout; static void dingdong(int signo __unused) @@ -159,7 +159,7 @@ dingdong(int signo __unused) longjmp(timeout, 1); } -jmp_buf intrupt; +static jmp_buf intrupt; static void interrupt(int signo __unused) @@ -181,7 +181,6 @@ timeoverrun(int signo __unused) int main(int argc, char *argv[]) { - extern char **environ; int first_sleep = 1, first_time = 1; struct rlimit limit; int rval; @@ -666,8 +665,8 @@ puts(const char *s) putchr(*s++); } -char outbuf[OBUFSIZ]; -int obufcnt = 0; +static char outbuf[OBUFSIZ]; +static int obufcnt = 0; static void putchr(int cc) @@ -733,7 +732,6 @@ get_line(int fd) static void putf(const char *cp) { - extern char editedhost[]; time_t t; char *slash, db[100]; Modified: head/libexec/getty/subr.c ============================================================================== --- head/libexec/getty/subr.c Sun Feb 4 18:40:36 2018 (r328857) +++ head/libexec/getty/subr.c Sun Feb 4 19:05:13 2018 (r328858) @@ -588,7 +588,7 @@ makeenv(char *env[]) * baud rate. This string indicates the user's actual speed. * The routine below returns the terminal type mapped from derived speed. */ -struct portselect { +static struct portselect { const char *ps_baud; const char *ps_type; } portspeeds[] = { From owner-svn-src-head@freebsd.org Sun Feb 4 19:43:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97E67EEC570; Sun, 4 Feb 2018 19:43:52 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 491486F19D; Sun, 4 Feb 2018 19:43:52 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 435591E862; Sun, 4 Feb 2018 19:43:52 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14JhqME012465; Sun, 4 Feb 2018 19:43:52 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14JhqR4012464; Sun, 4 Feb 2018 19:43:52 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201802041943.w14JhqR4012464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Sun, 4 Feb 2018 19:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328861 - head/contrib/blacklist/libexec X-SVN-Group: head X-SVN-Commit-Author: lidl X-SVN-Commit-Paths: head/contrib/blacklist/libexec X-SVN-Commit-Revision: 328861 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.25 Precedence: list List-Id: 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, 04 Feb 2018 19:43:52 -0000 Author: lidl Date: Sun Feb 4 19:43:51 2018 New Revision: 328861 URL: https://svnweb.freebsd.org/changeset/base/328861 Log: Update blacklist-helper to not emit messages from pf during operation. Use 'pfctl -k' when blocking a site to kill active tcp connections from the blocked address. Fix 'purge' operation for pf, which must dynamically determine which filters have been created, so the filters can be flushed by name. MFC after: 2 weeks Modified: head/contrib/blacklist/libexec/blacklistd-helper Modified: head/contrib/blacklist/libexec/blacklistd-helper ============================================================================== --- head/contrib/blacklist/libexec/blacklistd-helper Sun Feb 4 19:14:09 2018 (r328860) +++ head/contrib/blacklist/libexec/blacklistd-helper Sun Feb 4 19:43:51 2018 (r328861) @@ -80,8 +80,8 @@ add) echo "block in quick $proto from to any $port" | \ /sbin/pfctl -a "$2/$6" -f - # insert $ip/$mask into per-protocol/port anchored table - /sbin/pfctl -a "$2/$6" -t "port$6" -T add "$addr/$mask" && \ - echo OK + /sbin/pfctl -qa "$2/$6" -t "port$6" -T add "$addr/$mask" && \ + /sbin/pfctl -q -k $addr && echo OK ;; esac ;; @@ -101,7 +101,7 @@ rem) /sbin/npfctl rule "$2" rem-id "$7" ;; pf) - /sbin/pfctl -a "$2/$6" -t "port$6" -T delete "$addr/$mask" && \ + /sbin/pfctl -qa "$2/$6" -t "port$6" -T delete "$addr/$mask" && \ echo OK ;; esac @@ -118,7 +118,13 @@ flush) /sbin/npfctl rule "$2" flush ;; pf) - /sbin/pfctl -a "$2/$6" -t "port$6" -T flush && echo OK + # dynamically determine which anchors exist + anchors=$(/sbin/pfctl -a $2 -s Anchors) + for anchor in $anchors; do + /sbin/pfctl -a $anchor -t "port${anchor##*/}" -T flush + /sbin/pfctl -a $anchor -F rules + done + echo OK ;; esac ;; From owner-svn-src-head@freebsd.org Sun Feb 4 20:07:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84060EEDD70; Sun, 4 Feb 2018 20:07:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31FE66FF97; Sun, 4 Feb 2018 20:07:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CEED1EBAF; Sun, 4 Feb 2018 20:07:09 +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 w14K79XF022676; Sun, 4 Feb 2018 20:07:09 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14K79aQ022675; Sun, 4 Feb 2018 20:07:09 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802042007.w14K79aQ022675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 4 Feb 2018 20:07:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328862 - 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: 328862 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.25 Precedence: list List-Id: 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, 04 Feb 2018 20:07:09 -0000 Author: jhibbits Date: Sun Feb 4 20:07:08 2018 New Revision: 328862 URL: https://svnweb.freebsd.org/changeset/base/328862 Log: Only look for L2 cache controllers for mpc85xx_cache The L3 cache controller (Corenet Platform Cache) is listed with one of its compatible strings as "cache", which this driver can't attach to. Restrict to a known list of primary cache controller strings, as found in the l2cache devicetree binding. Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c Modified: head/sys/powerpc/mpc85xx/mpc85xx_cache.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sun Feb 4 19:43:51 2018 (r328861) +++ head/sys/powerpc/mpc85xx/mpc85xx_cache.c Sun Feb 4 20:07:08 2018 (r328862) @@ -56,11 +56,53 @@ struct mpc85xx_cache_softc { struct resource *sc_mem; }; +static struct ofw_compat_data compats[] = { + {"fsl,8540-l2-cache-controller", 1}, + {"fsl,8541-l2-cache-controller", 1}, + {"fsl,8544-l2-cache-controller", 1}, + {"fsl,8548-l2-cache-controller", 1}, + {"fsl,8555-l2-cache-controller", 1}, + {"fsl,8568-l2-cache-controller", 1}, + {"fsl,b4420-l2-cache-controller", 1}, + {"fsl,b4860-l2-cache-controller", 1}, + {"fsl,bsc9131-l2-cache-controller", 1}, + {"fsl,bsc9132-l2-cache-controller", 1}, + {"fsl,c293-l2-cache-controller", 1}, + {"fsl,mpc8536-l2-cache-controller", 1}, + {"fsl,mpc8540-l2-cache-controller", 1}, + {"fsl,mpc8541-l2-cache-controller", 1}, + {"fsl,mpc8544-l2-cache-controller", 1}, + {"fsl,mpc8548-l2-cache-controller", 1}, + {"fsl,mpc8555-l2-cache-controller", 1}, + {"fsl,mpc8560-l2-cache-controller", 1}, + {"fsl,mpc8568-l2-cache-controller", 1}, + {"fsl,mpc8569-l2-cache-controller", 1}, + {"fsl,mpc8572-l2-cache-controller", 1}, + {"fsl,p1010-l2-cache-controller", 1}, + {"fsl,p1011-l2-cache-controller", 1}, + {"fsl,p1012-l2-cache-controller", 1}, + {"fsl,p1013-l2-cache-controller", 1}, + {"fsl,p1014-l2-cache-controller", 1}, + {"fsl,p1015-l2-cache-controller", 1}, + {"fsl,p1016-l2-cache-controller", 1}, + {"fsl,p1020-l2-cache-controller", 1}, + {"fsl,p1021-l2-cache-controller", 1}, + {"fsl,p1022-l2-cache-controller", 1}, + {"fsl,p1023-l2-cache-controller", 1}, + {"fsl,p1024-l2-cache-controller", 1}, + {"fsl,p1025-l2-cache-controller", 1}, + {"fsl,p2010-l2-cache-controller", 1}, + {"fsl,p2020-l2-cache-controller", 1}, + {"fsl,t2080-l2-cache-controller", 1}, + {"fsl,t4240-l2-cache-controller", 1}, + {0, 0} +}; + static int mpc85xx_cache_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "cache")) + if (ofw_bus_search_compatible(dev, compats)->ocd_str == NULL) return (ENXIO); device_set_desc(dev, "MPC85xx L2 cache"); From owner-svn-src-head@freebsd.org Sun Feb 4 20:33:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61AD3EEF8CC; Sun, 4 Feb 2018 20:33:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04A1570F5D; Sun, 4 Feb 2018 20:33:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3AAE1F095; Sun, 4 Feb 2018 20:33:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14KXlqC037144; Sun, 4 Feb 2018 20:33:47 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14KXlbe037143; Sun, 4 Feb 2018 20:33:47 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802042033.w14KXlbe037143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 4 Feb 2018 20:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328863 - head/lib/clang X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/clang X-SVN-Commit-Revision: 328863 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.25 Precedence: list List-Id: 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, 04 Feb 2018 20:33:48 -0000 Author: dim Date: Sun Feb 4 20:33:47 2018 New Revision: 328863 URL: https://svnweb.freebsd.org/changeset/base/328863 Log: Bump clang's __FreeBSD_cc_version, to cope with r328816, which removed -Wno-error=tautological-constant-compare again (this flag is now out of -Wextra after upstream https://reviews.llvm.org/rL322901). Otherwise the MK_SYSTEM_COMPILER logic will not build a cross-tools compiler. Reported by: jpaetzel, tuexen, Stefan Hagen Modified: head/lib/clang/freebsd_cc_version.h Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Sun Feb 4 20:07:08 2018 (r328862) +++ head/lib/clang/freebsd_cc_version.h Sun Feb 4 20:33:47 2018 (r328863) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200009 +#define FREEBSD_CC_VERSION 1200010 From owner-svn-src-head@freebsd.org Sun Feb 4 20:53:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65064EF0F95; Sun, 4 Feb 2018 20:53:15 +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 DB9B971DC4; Sun, 4 Feb 2018 20:53:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 6D8C1D6CBA5; Mon, 5 Feb 2018 07:53:05 +1100 (AEDT) Date: Mon, 5 Feb 2018 07:53:03 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327495 - head/usr.sbin/rpcbind In-Reply-To: <20180204103334.GC9536@kib.kiev.ua> Message-ID: <20180205064120.K996@besplex.bde.org> References: <201801021725.w02HPDaj068477@repo.freebsd.org> <20180203232725.U1389@besplex.bde.org> <20180204150751.V909@besplex.bde.org> <20180204103334.GC9536@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=DIX/22Fb c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=vm9bT6jSjgWHGVm1leUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 04 Feb 2018 20:53:15 -0000 On Sun, 4 Feb 2018, Konstantin Belousov wrote: > On Sun, Feb 04, 2018 at 04:15:16PM +1100, Bruce Evans wrote: >> sig_atomic_t is no better than plain int. This behaviour now makes complete >> sense. It is just like the undefined behaviour with the ctype functions, >> except since we own terminate_wfd we can guarantee that it doesn't change >> while the handler is active (and is valid when the handler is entered). >> We could also use atomic ops. However, the C standard doesn't require >> anything that we do to work (except maybe in C11, atomic ops might be >> explicitly or implicitly specifed to work for things like this). > > Atomics are atomic WRT the signal handlers as well, the usual guarantees > of no torn writes and no out of air values on read hold. Since FreeBSD > memory model, as documented in atomic(9), claims that naturally aligned > machine-native integer types are atomic without special declarations on > access, all guarantees for the handler accesses are already provided. C11's precise wording is: [for async signals] the behavior is undefined if the signal handler refers to any object with static or thread storage duration that is not a lock-free atomic object other than by assigning a value to an object declared as volatile sig_atomic_t i.e., the same as in C99 except the behaviour is not specifically undefined for accesses to lock-free atomic objects. Do we document atomics in userland? C11 atomics are too hard for me. "lock-free atomic object" is a technical term and I don't know of any userland documentation that associates this term with naive ideas of atomics. atomic(9) doesn't mention this either. > C11 also has a tool to ensure weaker than usual consistency guarantee, > only between the thread and a signal handler executing in the context of > the thread. I do not see it useful in the discussed case. Is that just a check for the case if !async signals (ones that are the result of raise() and abort()?). Bruce From owner-svn-src-head@freebsd.org Sun Feb 4 21:02:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF8DDEC1C0F; Sun, 4 Feb 2018 21:02:15 +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 772CB724BC; Sun, 4 Feb 2018 21:02:15 +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 w14L27LZ022191 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 4 Feb 2018 23:02:10 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w14L27LZ022191 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w14L27Pv022190; Sun, 4 Feb 2018 23:02:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 4 Feb 2018 23:02:07 +0200 From: Konstantin Belousov To: Bruce Evans Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327495 - head/usr.sbin/rpcbind Message-ID: <20180204210207.GF9536@kib.kiev.ua> References: <201801021725.w02HPDaj068477@repo.freebsd.org> <20180203232725.U1389@besplex.bde.org> <20180204150751.V909@besplex.bde.org> <20180204103334.GC9536@kib.kiev.ua> <20180205064120.K996@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180205064120.K996@besplex.bde.org> User-Agent: Mutt/1.9.3 (2018-01-21) 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.25 Precedence: list List-Id: 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, 04 Feb 2018 21:02:16 -0000 On Mon, Feb 05, 2018 at 07:53:03AM +1100, Bruce Evans wrote: > On Sun, 4 Feb 2018, Konstantin Belousov wrote: > > > On Sun, Feb 04, 2018 at 04:15:16PM +1100, Bruce Evans wrote: > >> sig_atomic_t is no better than plain int. This behaviour now makes complete > >> sense. It is just like the undefined behaviour with the ctype functions, > >> except since we own terminate_wfd we can guarantee that it doesn't change > >> while the handler is active (and is valid when the handler is entered). > >> We could also use atomic ops. However, the C standard doesn't require > >> anything that we do to work (except maybe in C11, atomic ops might be > >> explicitly or implicitly specifed to work for things like this). > > > > Atomics are atomic WRT the signal handlers as well, the usual guarantees > > of no torn writes and no out of air values on read hold. Since FreeBSD > > memory model, as documented in atomic(9), claims that naturally aligned > > machine-native integer types are atomic without special declarations on > > access, all guarantees for the handler accesses are already provided. > > C11's precise wording is: > > [for async signals] the behavior is undefined if the signal handler > refers to any object with static or thread storage duration that > is not a lock-free atomic object other than by assigning a value > to an object declared as volatile sig_atomic_t > > i.e., the same as in C99 except the behaviour is not specifically undefined > for accesses to lock-free atomic objects. > > Do we document atomics in userland? C11 atomics are too hard for me. > "lock-free atomic object" is a technical term and I don't know of any > userland documentation that associates this term with naive ideas of > atomics. atomic(9) doesn't mention this either. C11 atomics are not exactly same as FreeBSD atomics, and they are implemented by different API. Our atomic(9) API works same in kernel and in userland. A (C11) lock-free atomic is the object for which the atomic_is_lock_free() returns true. > > > C11 also has a tool to ensure weaker than usual consistency guarantee, > > only between the thread and a signal handler executing in the context of > > the thread. I do not see it useful in the discussed case. > > Is that just a check for the case if !async signals (ones that are the > result of raise() and abort()?). Probably it was too obscure. I mean atomic_signal_fence(). From owner-svn-src-head@freebsd.org Sun Feb 4 23:01:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DED23ED9698; Sun, 4 Feb 2018 23:01:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 95A1F76578; Sun, 4 Feb 2018 23:01:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90869207AB; Sun, 4 Feb 2018 23:01:48 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w14N1mDw011856; Sun, 4 Feb 2018 23:01:48 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w14N1mj9011855; Sun, 4 Feb 2018 23:01:48 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201802042301.w14N1mj9011855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 4 Feb 2018 23:01:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328864 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 328864 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.25 Precedence: list List-Id: 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, 04 Feb 2018 23:01:49 -0000 Author: wulf Date: Sun Feb 4 23:01:48 2018 New Revision: 328864 URL: https://svnweb.freebsd.org/changeset/base/328864 Log: psm(4): Fix panic occuring soon after PS/2 packet has been rejected by synaptics or elantech sanity checker. After packet has been rejected contents of packet buffer is not cleared with setting of inputbytes counter to 0. So when this packet buffer is filled again being an element of circular queue, new data appends to old data rather than overwrites it. This leads to packet buffer overflow after 10 rounds. Fix it with setting of packet's inputbytes counter to 0 after rejection. While here add extra logging of rejected packets. PR: 222667 (for reference) Reported by: Neel Chauhan Tested by: Neel Chauhan MFC after: 1 week Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Sun Feb 4 20:33:47 2018 (r328863) +++ head/sys/dev/atkbdc/psm.c Sun Feb 4 23:01:48 2018 (r328864) @@ -4935,13 +4935,19 @@ psmsoftintr(void *arg) break; case MOUSE_MODEL_SYNAPTICS: - if (proc_synaptics(sc, pb, &ms, &x, &y, &z) != 0) + if (proc_synaptics(sc, pb, &ms, &x, &y, &z) != 0) { + VLOG(3, (LOG_DEBUG, "synaptics: " + "packet rejected\n")); goto next; + } break; case MOUSE_MODEL_ELANTECH: - if (proc_elantech(sc, pb, &ms, &x, &y, &z) != 0) + if (proc_elantech(sc, pb, &ms, &x, &y, &z) != 0) { + VLOG(3, (LOG_DEBUG, "elantech: " + "packet rejected\n")); goto next; + } break; case MOUSE_MODEL_TRACKPOINT: @@ -5037,9 +5043,9 @@ next_native: sizeof(sc->queue.buf); sc->queue.count += pb->inputbytes; } - pb->inputbytes = 0; next: + pb->inputbytes = 0; if (++sc->pqueue_start >= PSM_PACKETQUEUE) sc->pqueue_start = 0; } while (sc->pqueue_start != sc->pqueue_end); From owner-svn-src-head@freebsd.org Mon Feb 5 00:18:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 888B8EDF3D0; Mon, 5 Feb 2018 00:18:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AEE579160; Mon, 5 Feb 2018 00:18:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3127821416; Mon, 5 Feb 2018 00:18:22 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w150IMwv047655; Mon, 5 Feb 2018 00:18:22 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w150ILoi047653; Mon, 5 Feb 2018 00:18:21 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201802050018.w150ILoi047653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Mon, 5 Feb 2018 00:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328865 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 328865 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.25 Precedence: list List-Id: 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, 05 Feb 2018 00:18:22 -0000 Author: marius Date: Mon Feb 5 00:18:21 2018 New Revision: 328865 URL: https://svnweb.freebsd.org/changeset/base/328865 Log: Flesh out the creation of sparc64 UFS images. This has only been verified to yield working images in a native build as rootgen.sh generally doesn't support cross-testing so far. Modified: head/tools/boot/install-boot.sh head/tools/boot/rootgen.sh Modified: head/tools/boot/install-boot.sh ============================================================================== --- head/tools/boot/install-boot.sh Sun Feb 4 23:01:48 2018 (r328864) +++ head/tools/boot/install-boot.sh Mon Feb 5 00:18:21 2018 (r328865) @@ -78,12 +78,22 @@ boot_nogeli_mbr_ufs_legacy() { doit gpart bootcode -b ${mbr0} ${dev} s=$(findpart $dev "freebsd-ufs") if [ -z "$s" ] ; then - die "No freebsd-zfs slice found" + die "No freebsd-ufs slice found" fi doit gpart bootcode -p ${mbr2} ${dev}s${s} exit 0 } +boot_nogeli_vtoc8_ufs_ofw() { + dev=$1 + dst=$2 + + # For non-native builds, ensure that geom_part(4) supports VTOC8. + kldload geom_part_vtoc8.ko + doit gpart bootcode -p ${vtoc8} ${dev} + exit 0 +} + DESTDIR=/ # Note: we really don't support geli boot in this script yet. @@ -127,6 +137,9 @@ gptzfs2=${DESTDIR}/boot/gptzfsboot # For MBR, we have lots of choices, but select boot0 mbr0=${DESTDIR}/boot/boot0 mbr2=${DESTDIR}/boot/boot + +# VTOC8 +vtoc8=${DESTDIR}/boot/boot1 # sanity check here Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Sun Feb 4 23:01:48 2018 (r328864) +++ head/tools/boot/rootgen.sh Mon Feb 5 00:18:21 2018 (r328865) @@ -193,6 +193,29 @@ mk_geli_mbr_zfs_both() { # u-boot # powerpc +mk_sparc64_nogeli_vtoc8_ufs_ofw() { + src=$1 + img=$2 + mntpt=$3 + geli=$4 + scheme=$5 + fs=$6 + bios=$7 + + cat > ${src}/etc/fstab < ${DESTDIR}/boot.config # XXX @@ -396,18 +420,21 @@ for arch in powerpc powerpc64; do done for arch in sparc64; do - for scheme in sun; do - fs=ufs - for bios in ofw; do - # Create sparse file and mount newly created filesystem(s) on it - img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img - sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh - echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" - rm -f ${img}* - eval mk_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} - eval qemu_${arch}_${bios} ${img} ${sh} - [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* - echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + for geli in nogeli; do + for scheme in vtoc8; do + for fs in ufs; do + for bios in ofw; do + # Create sparse file and mount newly created filesystem(s) on it + img=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.img + sh=${IMGDIR}/${arch}-${geli}-${scheme}-${fs}-${bios}.sh + echo "vvvvvvvvvvvvvvvvvvvvvv Creating $img vvvvvvvvvvvvvvvvvvvvvvv" + rm -f ${img}* + eval mk_${arch}_${geli}_${scheme}_${fs}_${bios} ${DESTDIR} ${img} ${MNTPT} ${geli} ${scheme} ${fs} ${bios} + eval qemu_${arch}_${bios} ${img} ${sh} + [ -n "${SUDO_USER}" ] && chown ${SUDO_USER} ${img}* + echo "^^^^^^^^^^^^^^^^^^^^^^ Creating $img ^^^^^^^^^^^^^^^^^^^^^^^" + done + done done done done From owner-svn-src-head@freebsd.org Mon Feb 5 04:46:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA35BEF05BA; Mon, 5 Feb 2018 04:46:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98F6281B83; Mon, 5 Feb 2018 04:46:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CDEF23FB0; Mon, 5 Feb 2018 04:46:36 +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 w154ka7n082035; Mon, 5 Feb 2018 04:46:36 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w154kaHn082034; Mon, 5 Feb 2018 04:46:36 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050446.w154kaHn082034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 04:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328867 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 328867 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.25 Precedence: list List-Id: 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, 05 Feb 2018 04:46:37 -0000 Author: adrian Date: Mon Feb 5 04:46:36 2018 New Revision: 328867 URL: https://svnweb.freebsd.org/changeset/base/328867 Log: [ar71xx] New world order - don't reference ath_pci here, it's a module now Modified: head/sys/mips/conf/DB120 Modified: head/sys/mips/conf/DB120 ============================================================================== --- head/sys/mips/conf/DB120 Mon Feb 5 04:00:59 2018 (r328866) +++ head/sys/mips/conf/DB120 Mon Feb 5 04:46:36 2018 (r328867) @@ -45,7 +45,6 @@ options GEOM_UZIP device geom_map # yes, this board has a PCI connected atheros device -device ath_pci options AR71XX_ATH_EEPROM device firmware # Used by the above options ATH_EEPROM_FIRMWARE From owner-svn-src-head@freebsd.org Mon Feb 5 04:47:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73777EF06B8; Mon, 5 Feb 2018 04:47:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 242C581CEE; Mon, 5 Feb 2018 04:47:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F25723FB1; Mon, 5 Feb 2018 04:47:14 +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 w154lDON082105; Mon, 5 Feb 2018 04:47:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w154lDbS082104; Mon, 5 Feb 2018 04:47:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050447.w154lDbS082104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 04:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328868 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 328868 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.25 Precedence: list List-Id: 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, 05 Feb 2018 04:47:14 -0000 Author: adrian Date: Mon Feb 5 04:47:13 2018 New Revision: 328868 URL: https://svnweb.freebsd.org/changeset/base/328868 Log: [ar71xx] AR934x is a MIPS74k board - use the right hwpmc module Modified: head/sys/mips/conf/std.AR934X Modified: head/sys/mips/conf/std.AR934X ============================================================================== --- head/sys/mips/conf/std.AR934X Mon Feb 5 04:46:36 2018 (r328867) +++ head/sys/mips/conf/std.AR934X Mon Feb 5 04:47:13 2018 (r328868) @@ -49,7 +49,7 @@ options FFS #Berkeley Fast Filesy options NO_FFS_SNAPSHOT # We don't require snapshot support include "std.AR_MIPS_BASE" -makeoptions MODULES_OVERRIDE+="hwpmc_mips24k" +makeoptions MODULES_OVERRIDE+="hwpmc_mips74k" # EEPROM caldata for AHB connected device options AR71XX_ATH_EEPROM From owner-svn-src-head@freebsd.org Mon Feb 5 04:48:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CDC3EF082A; Mon, 5 Feb 2018 04:48:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EB0181E90; Mon, 5 Feb 2018 04:48:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FC9223FB2; Mon, 5 Feb 2018 04:48:42 +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 w154mfVI082198; Mon, 5 Feb 2018 04:48:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w154mfwv082197; Mon, 5 Feb 2018 04:48:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050448.w154mfwv082197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 04:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328869 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 328869 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.25 Precedence: list List-Id: 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, 05 Feb 2018 04:48:42 -0000 Author: adrian Date: Mon Feb 5 04:48:41 2018 New Revision: 328869 URL: https://svnweb.freebsd.org/changeset/base/328869 Log: [ar71xx] Fix DB120 AHB device hints in the new world order. This allows the on-chip (AHB bus) device to attach correctly as a module. Tested: * DB120, AR9344 (SoC + 2x2 2G wifi) + QCA9580 PCI 3x3 5G wifi Modified: head/sys/mips/conf/DB120.hints Modified: head/sys/mips/conf/DB120.hints ============================================================================== --- head/sys/mips/conf/DB120.hints Mon Feb 5 04:47:13 2018 (r328868) +++ head/sys/mips/conf/DB120.hints Mon Feb 5 04:48:41 2018 (r328869) @@ -84,10 +84,16 @@ hint.arge.1.miimode=1 # GMII # MAC for arge1 is the second 6 bytes of the ART hint.arge.1.eeprommac=0x1f7f0006 -# ath0: Where the ART is - last 64k in the flash -hint.ath.0.eepromaddr=0x1fff0000 -hint.ath.0.eepromsize=16384 +# ART calibration data mapping - for the AR934x AHB device +hint.ar71xx_caldata.0.at="nexus0" +hint.ar71xx_caldata.0.order=0 +# Where the ART is - last 64k in the first 8MB of flash +hint.ar71xx_caldata.0.map.0.ath_fixup_addr=0x1fff0000 +hint.ar71xx_caldata.0.map.0.ath_fixup_size=16384 +# And now tell the ath(4) driver where to look! +hint.ath.0.eeprom_firmware="ar71xx_caldata.0.map.0.eeprom_firmware" + # ath1: it's different; it's a PCIe attached device, so # we instead need to teach the PCIe bridge code about it # (ie, the 'early pci fixup' stuff that programs the PCIe @@ -119,19 +125,20 @@ hint.map.1.end=0x00050000 # 64k u-boot-env hint.map.1.name="u-boot-env" hint.map.1.readonly=1 -# 6336KiB rootfs +# 6336KiB rootfs + 1344KiB uImage; turn into a single long +# combo image for FreeBSD. + hint.map.2.at="flash/spi0" hint.map.2.start=0x00050000 -hint.map.2.end=0x00680000 # 6336k rootfs -hint.map.2.name="rootfs" -hint.map.2.readonly=1 +hint.map.2.end="search:0x00050000:0x10000:.!/bin/sh" +hint.map.2.name="kernel" +hint.map.2.readonly=0 -# 1344KiB uImage hint.map.3.at="flash/spi0" -hint.map.3.start=0x00680000 -hint.map.3.end=0x007d0000 # 1408k uImage, 64k off the end.. -hint.map.3.name="uImage" -hint.map.3.readonly=1 +hint.map.3.start="search:0x00050000:0x10000:.!/bin/sh" +hint.map.3.end=0x007d0000 +hint.map.3.name="rootfs" +hint.map.3.readonly=0 # 64KiB cfg hint.map.4.at="flash/spi0" From owner-svn-src-head@freebsd.org Mon Feb 5 05:51:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97FBCEF3CC5; Mon, 5 Feb 2018 05:51:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47EDD83CCC; Mon, 5 Feb 2018 05:51:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42BC524996; Mon, 5 Feb 2018 05:51:38 +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 w155pc9T013787; Mon, 5 Feb 2018 05:51:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w155pcwx013786; Mon, 5 Feb 2018 05:51:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050551.w155pcwx013786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 05:51:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328871 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328871 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.25 Precedence: list List-Id: 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, 05 Feb 2018 05:51:38 -0000 Author: adrian Date: Mon Feb 5 05:51:37 2018 New Revision: 328871 URL: https://svnweb.freebsd.org/changeset/base/328871 Log: [arswitch] Break out of the loop upon any error, not just -1. This fixes the AR9340 "unimplemented" thingy for now. Modified: head/sys/dev/etherswitch/arswitch/arswitch.c Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Mon Feb 5 05:02:01 2018 (r328870) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Mon Feb 5 05:51:37 2018 (r328871) @@ -1187,7 +1187,7 @@ arswitch_atu_fetch_table(device_t dev, etherswitch_atu err = sc->hal.arswitch_atu_fetch_table(sc, NULL, 0); /* fetch - ideally yes we'd fetch into a separate table then switch */ - while (err != -1 && nitems < sc->atu.size) { + while (err == 0 && nitems < sc->atu.size) { err = sc->hal.arswitch_atu_fetch_table(sc, &sc->atu.entries[nitems], 1); if (err == 0) { From owner-svn-src-head@freebsd.org Mon Feb 5 07:03:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F50AECBD84; Mon, 5 Feb 2018 07:03:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE17385B97; Mon, 5 Feb 2018 07:03:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFF09255F3; Mon, 5 Feb 2018 07:03:45 +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 w1573jNT051353; Mon, 5 Feb 2018 07:03:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1573jxL051352; Mon, 5 Feb 2018 07:03:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050703.w1573jxL051352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 07:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328872 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328872 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.25 Precedence: list List-Id: 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, 05 Feb 2018 07:03:46 -0000 Author: adrian Date: Mon Feb 5 07:03:45 2018 New Revision: 328872 URL: https://svnweb.freebsd.org/changeset/base/328872 Log: [arswitch] fix mac address field definition. Whilst here, add some further fields for future experimenting. Tested: * AR9340 switch * AR9330 switch * AR7240 switch Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 5 05:51:37 2018 (r328871) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 5 07:03:45 2018 (r328872) @@ -139,10 +139,10 @@ #define AR8216_ATU_PORT_NUM BITS(8, 4) #define AR8216_ATU_PORT_NUM_S 8 #define AR8216_ATU_FULL_VIO BIT(12) -#define AR8216_ATU_ADDR4 BITS(16, 8) -#define AR8216_ATU_ADDR4_S 16 -#define AR8216_ATU_ADDR5 BITS(24, 8) -#define AR8216_ATU_ADDR5_S 24 +#define AR8216_ATU_ADDR5 BITS(16, 8) +#define AR8216_ATU_ADDR5_S 16 +#define AR8216_ATU_ADDR4 BITS(24, 8) +#define AR8216_ATU_ADDR4_S 24 #define AR8216_REG_ATU_DATA 0x0054 #define AR8216_ATU_ADDR3 BITS(0, 8) @@ -157,13 +157,26 @@ #define AR8216_REG_ATU_CTRL2 0x0058 #define AR8216_ATU_CTRL2_DESPORT BITS(0, 5) #define AR8216_ATU_CTRL2_DESPORT_S 0 +#define AR934X_ATU_CROSS_STATE_PORT_EN BIT(8) +#define AR934X_ATU_HASH_HIGH_ADDR BIT(9) /* Used for CPU_FUNC (get_next_valid) */ #define AR8216_ATU_CTRL2_AT_PRIORITY BITS(10, 2) #define AR8216_ATU_CTRL2_AT_PRIORITY_EN BIT(12) #define AR8216_ATU_CTRL2_MIRROR_EN BIT(13) #define AR8216_ATU_CTRL2_SA_DROP_EN BIT(14) +#define AR934X_ATU_CTRL2_MAC_CLONE BIT(15) #define AR8216_ATU_CTRL2_AT_STATUS BITS(16, 4) #define AR8216_ATU_CTRL2_AT_STATUS_S 16 +/* + * For at least the AR9340 - + * 0: empty + * 1-7: dynamic, valid + * 15: static, won't be aged + */ #define AR8216_ATU_CTRL2_VLAN_LEAKY_EN BIT(24) +/* + * This defines whether this MAC will leak between VLANs; + * controlled by ARL_UNI_LEAKY_EN and ARL_MULTI_LEAKY_EN. + */ #define AR8216_ATU_CTRL2_REDIRECT2CPU BIT(25) #define AR8216_ATU_CTRL2_COPY2CPU BIT(26) @@ -351,6 +364,7 @@ #define AR934X_REG_OPER_MODE1_PHY4_MII_EN (1 << 28) #define AR934X_REG_FLOOD_MASK 0x2c +#define AR934X_FLOOD_MASK_MC_DP(_p) (1 << (0 + (_p))) #define AR934X_FLOOD_MASK_MC_DP(_p) (1 << (16 + (_p))) #define AR934X_FLOOD_MASK_BC_DP(_p) (1 << (25 + (_p))) From owner-svn-src-head@freebsd.org Mon Feb 5 07:05:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85121ECBF89; Mon, 5 Feb 2018 07:05:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3898B85D1B; Mon, 5 Feb 2018 07:05:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C93F255F4; Mon, 5 Feb 2018 07:05:29 +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 w1575TLo051469; Mon, 5 Feb 2018 07:05:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1575T9K051468; Mon, 5 Feb 2018 07:05:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802050705.w1575T9K051468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 07:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328873 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328873 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.25 Precedence: list List-Id: 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, 05 Feb 2018 07:05:29 -0000 Author: adrian Date: Mon Feb 5 07:05:28 2018 New Revision: 328873 URL: https://svnweb.freebsd.org/changeset/base/328873 Log: [arswitch] Enable ATU dump support for the AR9340. This indeed uses the same registers as the AR8216 and later chips. There seems to be an issue with ARP requests being sent out from the CPU through this switch here, so figuring that out is next. Learning works fine on the AR8327 ethernet switch on the /other/ gigabit ethernet port, so I don't think it's the network stack or ethernet driver. Tested: * DB120 - AR9340 SOC + ethernet switch (and other bits.) Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 07:03:45 2018 (r328872) +++ head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 07:05:28 2018 (r328873) @@ -120,6 +120,11 @@ ar9340_hw_global_setup(struct arswitch_softc *sc) arswitch_modifyreg(sc->sc_dev, AR934X_REG_FLOOD_MASK, AR934X_FLOOD_MASK_MC_DP(0), AR934X_FLOOD_MASK_MC_DP(0)); +#if 0 + arswitch_modifyreg(sc->sc_dev, AR934X_REG_FLOOD_MASK, + AR934X_FLOOD_MASK_UC_DP(0), + AR934X_FLOOD_MASK_UC_DP(0)); +#endif /* Enable MIB counters */ arswitch_modifyreg(sc->sc_dev, AR8X16_REG_MIB_FUNC0, @@ -183,16 +188,6 @@ ar9340_hw_global_setup(struct arswitch_softc *sc) return (0); } -static int -ar9340_atu_fetch_table(struct arswitch_softc *sc, etherswitch_atu_entry_t *e, - int atu_fetch_op) -{ - - /* XXX TODO */ - return (ENXIO); -} - - /* * The AR9340 switch probes (almost) the same as the AR7240 on-chip switch. * @@ -223,7 +218,12 @@ ar9340_attach(struct arswitch_softc *sc) sc->hal.arswitch_hw_setup = ar9340_hw_setup; sc->hal.arswitch_hw_global_setup = ar9340_hw_global_setup; sc->hal.arswitch_atu_learn_default = ar9340_atu_learn_default; - sc->hal.arswitch_atu_fetch_table = ar9340_atu_fetch_table; + /* + * Note: the ar9340 table fetch code/registers matche + * the ar8216/ar8316 for now because we're not supporting + * static entry programming that includes any of the extra + * bits in the AR9340. + */ /* Set the switch vlan capabilities. */ sc->info.es_vlan_caps = ETHERSWITCH_VLAN_DOT1Q | From owner-svn-src-head@freebsd.org Mon Feb 5 09:22:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8353EDDEEB; Mon, 5 Feb 2018 09:22:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF5656A8B1; Mon, 5 Feb 2018 09:22:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9C8226B16; Mon, 5 Feb 2018 09:22:07 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w159M7a7020871; Mon, 5 Feb 2018 09:22:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w159M7TP020867; Mon, 5 Feb 2018 09:22:07 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802050922.w159M7TP020867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 5 Feb 2018 09:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328876 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 328876 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.25 Precedence: list List-Id: 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, 05 Feb 2018 09:22:08 -0000 Author: ae Date: Mon Feb 5 09:22:07 2018 New Revision: 328876 URL: https://svnweb.freebsd.org/changeset/base/328876 Log: Modify ip6_get_prevhdr() to be able use it safely. Instead of returning pointer to the previous header, return its offset. In frag6_input() use m_copyback() and determined offset to store next header instead of accessing to it by pointer and assuming that the memory is contiguous. In rip6_input() use offset returned by ip6_get_prevhdr() instead of calculating it from pointers arithmetic, because IP header can belong to another mbuf in the chain. Reported by: Maxime Villard Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14158 Modified: head/sys/netinet6/frag6.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_var.h head/sys/netinet6/raw_ip6.c Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Mon Feb 5 08:50:34 2018 (r328875) +++ head/sys/netinet6/frag6.c Mon Feb 5 09:22:07 2018 (r328876) @@ -578,10 +578,8 @@ insert: /* * Store NXT to the original. */ - { - char *prvnxtp = ip6_get_prevhdr(m, offset); /* XXX */ - *prvnxtp = nxt; - } + m_copyback(m, ip6_get_prevhdr(m, offset), sizeof(uint8_t), + (caddr_t)&nxt); frag6_remque(q6); V_frag6_nfrags -= q6->ip6q_nfrag; Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Mon Feb 5 08:50:34 2018 (r328875) +++ head/sys/netinet6/ip6_input.c Mon Feb 5 09:22:07 2018 (r328876) @@ -1711,49 +1711,39 @@ ip6_pullexthdr(struct mbuf *m, size_t off, int nxt) /* * Get pointer to the previous header followed by the header * currently processed. - * XXX: This function supposes that - * M includes all headers, - * the next header field and the header length field of each header - * are valid, and - * the sum of each header length equals to OFF. - * Because of these assumptions, this function must be called very - * carefully. Moreover, it will not be used in the near future when - * we develop `neater' mechanism to process extension headers. */ -char * +int ip6_get_prevhdr(const struct mbuf *m, int off) { - struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *); + struct ip6_ext ip6e; + struct ip6_hdr *ip6; + int len, nlen, nxt; if (off == sizeof(struct ip6_hdr)) - return (&ip6->ip6_nxt); - else { - int len, nxt; - struct ip6_ext *ip6e = NULL; + return (offsetof(struct ip6_hdr, ip6_nxt)); + if (off < sizeof(struct ip6_hdr)) + panic("%s: off < sizeof(struct ip6_hdr)", __func__); - nxt = ip6->ip6_nxt; - len = sizeof(struct ip6_hdr); - while (len < off) { - ip6e = (struct ip6_ext *)(mtod(m, caddr_t) + len); - - switch (nxt) { - case IPPROTO_FRAGMENT: - len += sizeof(struct ip6_frag); - break; - case IPPROTO_AH: - len += (ip6e->ip6e_len + 2) << 2; - break; - default: - len += (ip6e->ip6e_len + 1) << 3; - break; - } - nxt = ip6e->ip6e_nxt; + ip6 = mtod(m, struct ip6_hdr *); + nxt = ip6->ip6_nxt; + len = sizeof(struct ip6_hdr); + nlen = 0; + while (len < off) { + m_copydata(m, len, sizeof(ip6e), (caddr_t)&ip6e); + switch (nxt) { + case IPPROTO_FRAGMENT: + nlen = sizeof(struct ip6_frag); + break; + case IPPROTO_AH: + nlen = (ip6e.ip6e_len + 2) << 2; + break; + default: + nlen = (ip6e.ip6e_len + 1) << 3; } - if (ip6e) - return (&ip6e->ip6e_nxt); - else - return NULL; + len += nlen; + nxt = ip6e.ip6e_nxt; } + return (len - nlen); } /* Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Mon Feb 5 08:50:34 2018 (r328875) +++ head/sys/netinet6/ip6_var.h Mon Feb 5 09:22:07 2018 (r328876) @@ -364,7 +364,7 @@ void ip6_direct_input(struct mbuf *); void ip6_freepcbopts(struct ip6_pktopts *); int ip6_unknown_opt(u_int8_t *, struct mbuf *, int); -char * ip6_get_prevhdr(const struct mbuf *, int); +int ip6_get_prevhdr(const struct mbuf *, int); int ip6_nexthdr(const struct mbuf *, int, int, int *); int ip6_lasthdr(const struct mbuf *, int, int, int *); Modified: head/sys/netinet6/raw_ip6.c ============================================================================== --- head/sys/netinet6/raw_ip6.c Mon Feb 5 08:50:34 2018 (r328875) +++ head/sys/netinet6/raw_ip6.c Mon Feb 5 09:22:07 2018 (r328876) @@ -325,12 +325,10 @@ rip6_input(struct mbuf **mp, int *offp, int proto) RIP6STAT_INC(rip6s_nosockmcast); if (proto == IPPROTO_NONE) m_freem(m); - else { - char *prvnxtp = ip6_get_prevhdr(m, *offp); /* XXX */ + else icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_NEXTHEADER, - prvnxtp - mtod(m, char *)); - } + ip6_get_prevhdr(m, *offp)); IP6STAT_DEC(ip6s_delivered); } return (IPPROTO_DONE); From owner-svn-src-head@freebsd.org Mon Feb 5 12:49:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2CCEEDC3A; Mon, 5 Feb 2018 12:49:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C333D71C5D; Mon, 5 Feb 2018 12:49:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A54BDD29; Mon, 5 Feb 2018 12:49:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15CnKnL020408; Mon, 5 Feb 2018 12:49:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15CnKxn020407; Mon, 5 Feb 2018 12:49:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802051249.w15CnKxn020407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 5 Feb 2018 12:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328880 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 328880 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.25 Precedence: list List-Id: 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, 05 Feb 2018 12:49:21 -0000 Author: kib Date: Mon Feb 5 12:49:20 2018 New Revision: 328880 URL: https://svnweb.freebsd.org/changeset/base/328880 Log: On munlock(), unwire correct page. It is possible, for complex fork()/collapse situations, to have sibling address spaces to partially share shadow chains. If one sibling performs wiring, it can happen that a transient page, invalid and busy, is installed into a shadow object which is visible to other sibling for the duration of vm_fault_hold(). When the backing object contains the valid page, and the wiring is performed on read-only entry, the transient page is eventually removed. But the sibling which observed the transient page might perform the unwire, executing vm_object_unwire(). There, the first page found in the shadow chain is considered as the page that was wired for the mapping. It is really the page below it which is wired. So we unwire the wrong page, either triggering the asserts of breaking the page' wire counter. As the fix, wait for the busy state to finish if we find such page during unwire, and restart the shadow chain walk after the sleep. Reported and tested by: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14184 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Feb 5 10:29:57 2018 (r328879) +++ head/sys/vm/vm_object.c Mon Feb 5 12:49:20 2018 (r328880) @@ -2278,7 +2278,7 @@ void vm_object_unwire(vm_object_t object, vm_ooffset_t offset, vm_size_t length, uint8_t queue) { - vm_object_t tobject; + vm_object_t tobject, t1object; vm_page_t m, tm; vm_pindex_t end_pindex, pindex, tpindex; int depth, locked_depth; @@ -2292,6 +2292,7 @@ vm_object_unwire(vm_object_t object, vm_ooffset_t offs return; pindex = OFF_TO_IDX(offset); end_pindex = pindex + atop(length); +again: locked_depth = 1; VM_OBJECT_RLOCK(object); m = vm_page_find_least(object, pindex); @@ -2325,16 +2326,26 @@ vm_object_unwire(vm_object_t object, vm_ooffset_t offs m = TAILQ_NEXT(m, listq); } vm_page_lock(tm); + if (vm_page_xbusied(tm)) { + for (tobject = object; locked_depth >= 1; + locked_depth--) { + t1object = tobject->backing_object; + VM_OBJECT_RUNLOCK(tobject); + tobject = t1object; + } + vm_page_busy_sleep(tm, "unwbo", true); + goto again; + } vm_page_unwire(tm, queue); vm_page_unlock(tm); next_page: pindex++; } /* Release the accumulated object locks. */ - for (depth = 0; depth < locked_depth; depth++) { - tobject = object->backing_object; - VM_OBJECT_RUNLOCK(object); - object = tobject; + for (tobject = object; locked_depth >= 1; locked_depth--) { + t1object = tobject->backing_object; + VM_OBJECT_RUNLOCK(tobject); + tobject = t1object; } } From owner-svn-src-head@freebsd.org Mon Feb 5 14:19:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55FB8EF3C74; Mon, 5 Feb 2018 14:19:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B682751D8; Mon, 5 Feb 2018 14:19:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 012341B96; Mon, 5 Feb 2018 14:19:36 +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 w15EJa5Z065380; Mon, 5 Feb 2018 14:19:36 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15EJarM065379; Mon, 5 Feb 2018 14:19:36 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802051419.w15EJarM065379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 5 Feb 2018 14:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328881 - 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: 328881 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.25 Precedence: list List-Id: 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, 05 Feb 2018 14:19:37 -0000 Author: avg Date: Mon Feb 5 14:19:36 2018 New Revision: 328881 URL: https://svnweb.freebsd.org/changeset/base/328881 Log: zfs: move a utility function, ioflags, closer to its consumers No functional change. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 5 12:49:20 2018 (r328880) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 5 14:19:36 2018 (r328881) @@ -4514,21 +4514,6 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int fla } static int -ioflags(int ioflags) -{ - int flags = 0; - - if (ioflags & IO_APPEND) - flags |= FAPPEND; - if (ioflags & IO_NDELAY) - flags |= FNONBLOCK; - if (ioflags & IO_SYNC) - flags |= (FSYNC | FDSYNC | FRSYNC); - - return (flags); -} - -static int zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int *rbehind, int *rahead) { @@ -4848,6 +4833,21 @@ zfs_freebsd_ioctl(ap) return (zfs_ioctl(ap->a_vp, ap->a_command, (intptr_t)ap->a_data, ap->a_fflag, ap->a_cred, NULL, NULL)); +} + +static int +ioflags(int ioflags) +{ + int flags = 0; + + if (ioflags & IO_APPEND) + flags |= FAPPEND; + if (ioflags & IO_NDELAY) + flags |= FNONBLOCK; + if (ioflags & IO_SYNC) + flags |= (FSYNC | FDSYNC | FRSYNC); + + return (flags); } static int From owner-svn-src-head@freebsd.org Mon Feb 5 14:30:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17600EF4771; Mon, 5 Feb 2018 14:30:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B743E75887; Mon, 5 Feb 2018 14:30:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE0B71D32; Mon, 5 Feb 2018 14:30:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15EURHB070274; Mon, 5 Feb 2018 14:30:27 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15EURWm070273; Mon, 5 Feb 2018 14:30:27 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802051430.w15EURWm070273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 5 Feb 2018 14:30:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328882 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 328882 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.25 Precedence: list List-Id: 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, 05 Feb 2018 14:30:28 -0000 Author: pfg Date: Mon Feb 5 14:30:27 2018 New Revision: 328882 URL: https://svnweb.freebsd.org/changeset/base/328882 Log: ext2fs: Cleanup variable assignments for extents. Delay the initialization of variables until the are needed. In the case of ext4_ext_rm_leaf(), make sure 'error' value is not undefined. Reported by: Clang's static analyzer Differential Revision: https://reviews.freebsd.org/D14193 Modified: head/sys/fs/ext2fs/ext2_extents.c Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Mon Feb 5 14:19:36 2018 (r328881) +++ head/sys/fs/ext2fs/ext2_extents.c Mon Feb 5 14:30:27 2018 (r328882) @@ -1159,14 +1159,13 @@ ext4_new_blocks(struct inode *ip, daddr_t lbn, e4fs_da struct m_ext2fs *fs; e4fs_daddr_t newblk; - fs = ip->i_e2fs; - /* * We will allocate only single block for now. */ if (*count > 1) return (0); + fs = ip->i_e2fs; EXT2_LOCK(ip->i_ump); *perror = ext2_alloc(ip, lbn, pref, (int)fs->e2fs_bsize, cred, &newblk); if (*perror) @@ -1193,13 +1192,12 @@ ext4_ext_get_blocks(struct inode *ip, e4fs_daddr_t ibl unsigned long allocated = 0; int error = 0, depth; - fs = ip->i_e2fs; - *pallocated = 0; - path = NULL; if(bpp) *bpp = NULL; + *pallocated = 0; /* Check cache. */ + path = NULL; if ((bpref = ext4_ext_in_cache(ip, iblk, &newex))) { if (bpref == EXT4_EXT_CACHE_IN) { /* Block is already allocated. */ @@ -1271,6 +1269,7 @@ out: if (bpp) { + fs = ip->i_e2fs; error = bread(ip->i_devvp, fsbtodb(fs, newblk), fs->e2fs_bsize, cred, &bp); if (error) { @@ -1304,7 +1303,7 @@ static inline struct ext4_extent_header * ext4_ext_header(struct inode *ip) { - return (struct ext4_extent_header *)ip->i_db; + return ((struct ext4_extent_header *)ip->i_db); } static int @@ -1345,19 +1344,15 @@ static int ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_path *path, uint64_t start) { - struct m_ext2fs *fs; - int depth; struct ext4_extent_header *eh; + struct ext4_extent *ex; unsigned int a, b, block, num; unsigned long ex_blk; unsigned short ex_len; - struct ext4_extent *ex; + int depth; int error, correct_index; - fs = ip->i_e2fs; depth = ext4_ext_inode_depth(ip); - correct_index = 0; - if (!path[depth].ep_header) { if (path[depth].ep_data == NULL) return (EINVAL); @@ -1367,7 +1362,8 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ eh = path[depth].ep_header; if (!eh) { - ext2_fserr(fs, ip->i_uid, "bad header => extent corrupted"); + ext2_fserr(ip->i_e2fs, ip->i_uid, + "bad header => extent corrupted"); return (EIO); } @@ -1375,6 +1371,8 @@ ext4_ext_rm_leaf(struct inode *ip, struct ext4_extent_ ex_blk = ex->e_blk; ex_len = ext4_ext_get_actual_len(ex); + error = 0; + correct_index = 0; while (ex >= EXT_FIRST_EXTENT(eh) && ex_blk + ex_len > start) { path[depth].ep_ext = ex; a = ex_blk > start ? ex_blk : start; @@ -1442,7 +1440,6 @@ ext4_read_extent_tree_block(struct inode *ip, e4fs_dad int error; fs = ip->i_e2fs; - error = bread(ip->i_devvp, fsbtodb(fs, pblk), fs->e2fs_bsize, NOCRED, &bp); if (error) { @@ -1506,10 +1503,10 @@ ext4_ext_remove_space(struct inode *ip, off_t length, if (!path) return (ENOMEM); - i = 0; path[0].ep_header = ehp; path[0].ep_depth = depth; - while (i >= 0 && error == 0) { + i = 0; + while (error == 0 && i >= 0) { if (i == depth) { /* This is leaf. */ error = ext4_ext_rm_leaf(ip, path, length); @@ -1568,7 +1565,6 @@ ext4_ext_remove_space(struct inode *ip, off_t length, ext4_ext_header(ip)->eh_depth = 0; ext4_ext_header(ip)->eh_max = ext4_ext_space_root(ip); ext4_ext_dirty(ip, path); - } ext4_ext_drop_refs(path); From owner-svn-src-head@freebsd.org Mon Feb 5 14:53:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 500EDEC9680; Mon, 5 Feb 2018 14:53:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01E8D76844; Mon, 5 Feb 2018 14:53:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0A3721FB; Mon, 5 Feb 2018 14:53:18 +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 w15ErIc4084865; Mon, 5 Feb 2018 14:53:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15ErI2M084863; Mon, 5 Feb 2018 14:53:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802051453.w15ErI2M084863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 5 Feb 2018 14:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328883 - in head/sys/modules: linux linux64 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys/modules: linux linux64 X-SVN-Commit-Revision: 328883 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.25 Precedence: list List-Id: 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, 05 Feb 2018 14:53:19 -0000 Author: emaste Date: Mon Feb 5 14:53:18 2018 New Revision: 328883 URL: https://svnweb.freebsd.org/changeset/base/328883 Log: Move assym.s to DPSRCS in linux modules assym.s exists only to be included by other .s files, and should not actually be assembled by itself. Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/modules/linux/Makefile head/sys/modules/linux64/Makefile Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Mon Feb 5 14:30:27 2018 (r328882) +++ head/sys/modules/linux/Makefile Mon Feb 5 14:53:18 2018 (r328883) @@ -17,9 +17,9 @@ SRCS= linux_fork.c linux${SFX}_dummy.c linux_file.c li linux${SFX}_sysvec.c linux_uid16.c linux_time.c \ linux_timer.c linux_vdso.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h vnode_if.h \ - device_if.h bus_if.h assym.s \ + device_if.h bus_if.h \ linux${SFX}_support.s -DPSRCS= linux${SFX}_genassym.c +DPSRCS= assym.s linux${SFX}_genassym.c # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_compat.h opt_hwpmc_hooks.h Modified: head/sys/modules/linux64/Makefile ============================================================================== --- head/sys/modules/linux64/Makefile Mon Feb 5 14:30:27 2018 (r328882) +++ head/sys/modules/linux64/Makefile Mon Feb 5 14:53:18 2018 (r328883) @@ -11,9 +11,9 @@ SRCS= linux_fork.c linux_dummy.c linux_file.c linux_ev linux_socket.c linux_stats.c linux_sysctl.c linux_sysent.c \ linux_sysvec.c linux_time.c linux_vdso.c linux_timer.c \ opt_inet6.h opt_compat.h opt_posix.h opt_usb.h \ - vnode_if.h device_if.h bus_if.h assym.s \ + vnode_if.h device_if.h bus_if.h \ linux_support.s -DPSRCS= linux_genassym.c +DPSRCS= assym.s linux_genassym.c # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h From owner-svn-src-head@freebsd.org Mon Feb 5 15:14:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08DC9ECC316; Mon, 5 Feb 2018 15:14:02 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2AD9777A0; Mon, 5 Feb 2018 15:14:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD7F1252D; Mon, 5 Feb 2018 15:14:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15FE1ZN095076; Mon, 5 Feb 2018 15:14:01 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15FE1IW095074; Mon, 5 Feb 2018 15:14:01 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802051514.w15FE1IW095074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 5 Feb 2018 15:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328885 - head/sys/fs/ext2fs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/fs/ext2fs X-SVN-Commit-Revision: 328885 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.25 Precedence: list List-Id: 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, 05 Feb 2018 15:14:02 -0000 Author: pfg Date: Mon Feb 5 15:14:01 2018 New Revision: 328885 URL: https://svnweb.freebsd.org/changeset/base/328885 Log: ext2fs: remove EXT4F_RO_INCOMPAT_SUPP This was a hack to be able to mount ext4 filesystems read-only while not supporting all the features. We now support all those features so it doesn't make sense to keep the undocumented hack. Discussed with: fsu Modified: head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2fs.h Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Mon Feb 5 15:02:35 2018 (r328884) +++ head/sys/fs/ext2fs/ext2_vfsops.c Mon Feb 5 15:14:01 2018 (r328885) @@ -290,8 +290,7 @@ ext2_check_sb_compat(struct ext2fs *es, struct cdev *d return (1); } if (es->e2fs_rev > E2FS_REV0) { - mask = es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP | - EXT4F_RO_INCOMPAT_SUPP); + mask = es->e2fs_features_incompat & ~(EXT2F_INCOMPAT_SUPP); if (mask) { printf("WARNING: mount of %s denied due to " "unsupported optional features:\n", devtoname(dev)); Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Mon Feb 5 15:02:35 2018 (r328884) +++ head/sys/fs/ext2fs/ext2fs.h Mon Feb 5 15:14:01 2018 (r328885) @@ -319,11 +319,6 @@ static const struct ext2_feature incompat[] = { * - EXT2F_ROCOMPAT_HUGE_FILE * - EXT2F_INCOMPAT_EXTENTS * - * We do not support these EXT4 features but they are irrelevant - * for read-only support: - * - EXT2F_INCOMPAT_RECOVER - * - EXT2F_INCOMPAT_FLEX_BG - * - EXT2F_INCOMPAT_META_BG */ #define EXT2F_COMPAT_SUPP EXT2F_COMPAT_DIRHASHINDEX #define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \ @@ -339,7 +334,6 @@ static const struct ext2_feature incompat[] = { EXT2F_INCOMPAT_64BIT | \ EXT2F_INCOMPAT_FLEX_BG | \ EXT2F_INCOMPAT_CSUM_SEED) -#define EXT4F_RO_INCOMPAT_SUPP EXT2F_INCOMPAT_RECOVER /* Assume that user mode programs are passing in an ext2fs superblock, not * a kernel struct super_block. This will allow us to call the feature-test From owner-svn-src-head@freebsd.org Mon Feb 5 17:29:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED857EDF3FA; Mon, 5 Feb 2018 17:29:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B0F57DA2D; Mon, 5 Feb 2018 17:29:15 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 955AC3E3A; Mon, 5 Feb 2018 17:29:15 +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 w15HTF4L060939; Mon, 5 Feb 2018 17:29:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15HTCri060904; Mon, 5 Feb 2018 17:29:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802051729.w15HTCri060904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 5 Feb 2018 17:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328890 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 328890 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.25 Precedence: list List-Id: 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, 05 Feb 2018 17:29:16 -0000 Author: emaste Date: Mon Feb 5 17:29:12 2018 New Revision: 328890 URL: https://svnweb.freebsd.org/changeset/base/328890 Log: Linuxolator whitespace cleanup A version of each of the MD files by necessity exists for each CPU architecture supported by the Linuxolator. Clean these up so that new architectures do not inherit whitespace issues. Clean up shared Linuxolator files while here. Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/amd64/linux/linux.h head/sys/amd64/linux/linux_ptrace.c head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux/syscalls.master head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_dummy.c head/sys/amd64/linux32/linux32_locore.s head/sys/amd64/linux32/linux32_sysvec.c head/sys/amd64/linux32/syscalls.master head/sys/compat/linux/check_internal_locks.d head/sys/compat/linux/linux_emul.c head/sys/compat/linux/linux_event.c head/sys/compat/linux/linux_file.h head/sys/compat/linux/linux_fork.c head/sys/compat/linux/linux_ioctl.c head/sys/compat/linux/linux_ioctl.h head/sys/compat/linux/linux_ipc.c head/sys/compat/linux/linux_ipc.h head/sys/compat/linux/linux_ipc64.h head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_persona.h head/sys/compat/linux/linux_signal.c head/sys/compat/linux/linux_socket.c head/sys/compat/linux/linux_socket.h head/sys/compat/linux/linux_time.c head/sys/compat/linux/linux_util.h head/sys/compat/linux/stats_timing.d head/sys/compat/linux/trace_futexes.d head/sys/i386/linux/linux.h head/sys/i386/linux/linux_dummy.c head/sys/i386/linux/linux_locore.s head/sys/i386/linux/linux_machdep.c head/sys/i386/linux/linux_support.s head/sys/i386/linux/linux_sysvec.c head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/linux.h ============================================================================== --- head/sys/amd64/linux/linux.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux/linux.h Mon Feb 5 17:29:12 2018 (r328890) @@ -459,7 +459,7 @@ struct l_pollfd { struct linux_robust_list { l_uintptr_t next; }; - + struct linux_robust_list_head { struct linux_robust_list list; l_long futex_offset; Modified: head/sys/amd64/linux/linux_ptrace.c ============================================================================== --- head/sys/amd64/linux/linux_ptrace.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux/linux_ptrace.c Mon Feb 5 17:29:12 2018 (r328890) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #define LINUX_PTRACE_O_TRACEVFORKDONE 32 #define LINUX_PTRACE_O_TRACEEXIT 64 #define LINUX_PTRACE_O_TRACESECCOMP 128 -#define LINUX_PTRACE_O_EXITKILL 1048576 +#define LINUX_PTRACE_O_EXITKILL 1048576 #define LINUX_PTRACE_O_SUSPEND_SECCOMP 2097152 #define LINUX_NT_PRSTATUS 1 @@ -239,7 +239,7 @@ linux_ptrace_setoptions(struct thread *td, pid_t pid, if (data & LINUX_PTRACE_O_TRACEFORK) mask |= PTRACE_FORK; - if (data & LINUX_PTRACE_O_TRACEVFORK) + if (data & LINUX_PTRACE_O_TRACEVFORK) mask |= PTRACE_VFORK; if (data & LINUX_PTRACE_O_TRACECLONE) Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux/linux_sysvec.c Mon Feb 5 17:29:12 2018 (r328890) @@ -758,7 +758,7 @@ linux_vsyscall(struct thread *td) struct trapframe *frame; uint64_t retqaddr; int code, traced; - int error; + int error; frame = td->td_frame; @@ -832,7 +832,7 @@ linux_vdso_install(void *param) amd64_lower_shared_page(&elf_linux_sysvec); - linux_szsigcode = (&_binary_linux_locore_o_end - + linux_szsigcode = (&_binary_linux_locore_o_end - &_binary_linux_locore_o_start); if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux/syscalls.master Mon Feb 5 17:29:12 2018 (r328890) @@ -471,10 +471,10 @@ 278 AUE_NULL STD { int linux_vmsplice(void); } 279 AUE_NULL STD { int linux_move_pages(void); } 280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ - const struct l_timespec *times, l_int flags); } -281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask, \ - l_size_t sigsetsize); } + const struct l_timespec *times, l_int flags); } +281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } 282 AUE_NULL STD { int linux_signalfd(void); } 283 AUE_NULL STD { int linux_timerfd_create(l_int clockid, l_int flags); } 284 AUE_NULL STD { int linux_eventfd(l_uint initval); } @@ -496,10 +496,10 @@ 293 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); } 294 AUE_NULL STD { int linux_inotify_init1(l_int flags); } ; linux 2.6.30: -295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ +295 AUE_NULL STD { int linux_preadv(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } -296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ +296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \ struct iovec *vec, l_ulong vlen, \ l_ulong pos_l, l_ulong pos_h); } ; linux 2.6.31: @@ -551,7 +551,7 @@ void *attr, l_uint size, l_uint flags); } ; linux 3.15: 316 AUE_NULL STD { int linux_renameat2(l_int oldfd, \ - const char *oldname, l_int newfd, \ + const char *oldname, l_int newfd, \ const char *newname, unsigned int flags); } ; linux 3.17: 317 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \ Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/linux.h Mon Feb 5 17:29:12 2018 (r328890) @@ -242,19 +242,19 @@ struct l_stat64 { l_ulonglong st_ino; } __packed; -struct l_statfs64 { - l_int f_type; - l_int f_bsize; - uint64_t f_blocks; - uint64_t f_bfree; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; - l_fsid_t f_fsid; - l_int f_namelen; - l_int f_frsize; - l_int f_flags; - l_int f_spare[4]; +struct l_statfs64 { + l_int f_type; + l_int f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + l_fsid_t f_fsid; + l_int f_namelen; + l_int f_frsize; + l_int f_flags; + l_int f_spare[4]; } __packed; /* sigaction flags */ @@ -454,11 +454,11 @@ struct l_sigframe { struct l_rt_sigframe { l_int sf_sig; - l_uintptr_t sf_siginfo; + l_uintptr_t sf_siginfo; l_uintptr_t sf_ucontext; l_siginfo_t sf_si; - struct l_ucontext sf_sc; - l_handler_t sf_handler; + struct l_ucontext sf_sc; + l_handler_t sf_handler; } __packed; /* Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/linux32_dummy.c Mon Feb 5 17:29:12 2018 (r328890) @@ -8,7 +8,7 @@ * 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 + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the Modified: head/sys/amd64/linux32/linux32_locore.s ============================================================================== --- head/sys/amd64/linux32/linux32_locore.s Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/linux32_locore.s Mon Feb 5 17:29:12 2018 (r328890) @@ -72,12 +72,12 @@ NON_GPROF_ENTRY(linux32_vsyscall) .previous #endif -#define do_cfa_expr(offset) \ - .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ - .uleb128 11f-10f; /* length */ \ -10: .byte 0x74; /* DW_OP_breg4 */ \ - .sleb128 offset; /* offset */ \ - .byte 0x06; /* DW_OP_deref */ \ +#define do_cfa_expr(offset) \ + .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ + .uleb128 11f-10f; /* length */ \ +10: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ + .byte 0x06; /* DW_OP_deref */ \ 11: Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/linux32_sysvec.c Mon Feb 5 17:29:12 2018 (r328890) @@ -125,7 +125,7 @@ static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); static register_t *linux_copyout_strings(struct image_params *imgp); static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); -static void exec_linux_setregs(struct thread *td, +static void exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack); static void linux32_fixlimit(struct rlimit *rl, int which); static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel); @@ -298,7 +298,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigse int oonstack; int sig; int code; - + sig = ksi->ksi_signo; code = ksi->ksi_code; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -971,10 +971,8 @@ SYSCTL_ULONG(_compat_linux32, OID_AUTO, maxvmem, CTLFL &linux32_maxvmem, 0, ""); #if defined(DEBUG) -SYSCTL_PROC(_compat_linux32, OID_AUTO, debug, - CTLTYPE_STRING | CTLFLAG_RW, - 0, 0, linux_sysctl_debug, "A", - "Linux debugging control"); +SYSCTL_PROC(_compat_linux32, OID_AUTO, debug, CTLTYPE_STRING | CTLFLAG_RW, 0, 0, + linux_sysctl_debug, "A", "Linux debugging control"); #endif static void @@ -1042,14 +1040,14 @@ struct sysentvec elf_linux_sysvec = { .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, .sv_thread_detach = linux_thread_detach, - .sv_trap = NULL, + .sv_trap = NULL, }; static void linux_vdso_install(void *param) { - linux_szsigcode = (&_binary_linux32_locore_o_end - + linux_szsigcode = (&_binary_linux32_locore_o_end - &_binary_linux32_locore_o_start); if (linux_szsigcode > elf_linux_sysvec.sv_shared_page_len) Modified: head/sys/amd64/linux32/syscalls.master ============================================================================== --- head/sys/amd64/linux32/syscalls.master Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/amd64/linux32/syscalls.master Mon Feb 5 17:29:12 2018 (r328890) @@ -22,7 +22,7 @@ ; types: ; STD always included ; UNIMPL not implemented, placeholder only -; NOPROTO same as STD except do not create structure or +; NOPROTO same as STD except do not create structure or ; function prototype in sys/sysproto.h. Does add a ; definition to syscall.h besides adding a sysent. @@ -532,9 +532,9 @@ 317 AUE_NULL STD { int linux_move_pages(void); } ; linux 2.6.19: 318 AUE_NULL STD { int linux_getcpu(void); } -319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ - l_int maxevents, l_int timeout, l_sigset_t *mask, \ - l_size_t sigsetsize); } +319 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ + l_int maxevents, l_int timeout, l_sigset_t *mask, \ + l_size_t sigsetsize); } ; linux 2.6.22: 320 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } Modified: head/sys/compat/linux/check_internal_locks.d ============================================================================== --- head/sys/compat/linux/check_internal_locks.d Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/check_internal_locks.d Mon Feb 5 17:29:12 2018 (r328890) @@ -92,6 +92,6 @@ tick-10s END { - printf("Number of locks per type:"); + printf("Number of locks per type:"); printa(@stats); } Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_emul.c Mon Feb 5 17:29:12 2018 (r328890) @@ -140,7 +140,7 @@ linux_proc_init(struct thread *td, struct thread *newt } -void +void linux_proc_exit(void *arg __unused, struct proc *p) { struct linux_pemuldata *pem; @@ -155,7 +155,7 @@ linux_proc_exit(void *arg __unused, struct proc *p) pem = pem_find(p); if (pem == NULL) - return; + return; (p->p_sysent->sv_thread_detach)(td); p->p_emuldata = NULL; @@ -170,7 +170,7 @@ linux_proc_exit(void *arg __unused, struct proc *p) free(pem, M_LINUX); } -int +int linux_common_execve(struct thread *td, struct image_args *eargs) { struct linux_pemuldata *pem; @@ -218,7 +218,7 @@ linux_common_execve(struct thread *td, struct image_ar return (EJUSTRETURN); } -void +void linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { struct thread *td = curthread; Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_event.c Mon Feb 5 17:29:12 2018 (r328890) @@ -343,7 +343,7 @@ epoll_to_kevent(struct thread *td, struct file *epfp, return (0); } -/* +/* * Structure converting function from kevent to epoll. In a case * this is called on error in registration we store the error in * event->data and pick it up later in linux_epoll_ctl(). @@ -370,7 +370,7 @@ kevent_to_epoll(struct kevent *kevent, struct epoll_ev } } -/* +/* * Copyout callback used by kevent. This converts kevent * events to epoll events and copies them back to the * userspace. This is also called on error on registering @@ -417,7 +417,7 @@ epoll_kev_copyout(void *arg, struct kevent *kevp, int /* * Copyin callback used by kevent. This copies already - * converted filters from kernel memory to the kevent + * converted filters from kernel memory to the kevent * internal kernel memory. Hence the memcpy instead of * copyin. */ @@ -600,7 +600,7 @@ linux_epoll_wait_common(struct thread *td, int epfd, s if (error == 0 && coargs.error != 0) error = coargs.error; - /* + /* * kern_kevent might return ENOMEM which is not expected from epoll_wait. * Maybe we should translate that but I don't think it matters at all. */ @@ -696,7 +696,7 @@ eventfd_create(struct thread *td, uint32_t initval, in knlist_init_mtx(&efd->efd_sel.si_note, &efd->efd_lock); - fflags = FREAD | FWRITE; + fflags = FREAD | FWRITE; if ((flags & LINUX_O_NONBLOCK) != 0) fflags |= FNONBLOCK; Modified: head/sys/compat/linux/linux_file.h ============================================================================== --- head/sys/compat/linux/linux_file.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_file.h Mon Feb 5 17:29:12 2018 (r328890) @@ -42,10 +42,10 @@ */ #define LINUX_POSIX_FADV_NORMAL 0 #define LINUX_POSIX_FADV_RANDOM 1 -#define LINUX_POSIX_FADV_SEQUENTIAL 2 -#define LINUX_POSIX_FADV_WILLNEED 3 -#define LINUX_POSIX_FADV_DONTNEED 4 -#define LINUX_POSIX_FADV_NOREUSE 5 +#define LINUX_POSIX_FADV_SEQUENTIAL 2 +#define LINUX_POSIX_FADV_WILLNEED 3 +#define LINUX_POSIX_FADV_DONTNEED 4 +#define LINUX_POSIX_FADV_NOREUSE 5 /* * mount flags Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_fork.c Mon Feb 5 17:29:12 2018 (r328890) @@ -123,7 +123,7 @@ linux_vfork(struct thread *td, struct linux_vfork_args linux_proc_init(td, td2, 0); - td->td_retval[0] = p2->p_pid; + td->td_retval[0] = p2->p_pid; /* * Make this runnable after we are finished with it. @@ -198,12 +198,12 @@ linux_clone_proc(struct thread *td, struct linux_clone if (args->flags & LINUX_CLONE_CHILD_SETTID) em->child_set_tid = args->child_tidptr; else - em->child_set_tid = NULL; + em->child_set_tid = NULL; if (args->flags & LINUX_CLONE_CHILD_CLEARTID) em->child_clear_tid = args->child_tidptr; else - em->child_clear_tid = NULL; + em->child_clear_tid = NULL; if (args->flags & LINUX_CLONE_PARENT_SETTID) { error = copyout(&p2->p_pid, args->parent_tidptr, @@ -226,7 +226,7 @@ linux_clone_proc(struct thread *td, struct linux_clone linux_set_cloned_tls(td2, args->tls); /* - * If CLONE_PARENT is set, then the parent of the new process will be + * If CLONE_PARENT is set, then the parent of the new process will be * the same as that of the calling process. */ if (args->flags & LINUX_CLONE_PARENT) { @@ -324,15 +324,15 @@ linux_clone_thread(struct thread *td, struct linux_clo if (args->flags & LINUX_CLONE_CHILD_SETTID) em->child_set_tid = args->child_tidptr; else - em->child_set_tid = NULL; + em->child_set_tid = NULL; if (args->flags & LINUX_CLONE_CHILD_CLEARTID) em->child_clear_tid = args->child_tidptr; else - em->child_clear_tid = NULL; + em->child_clear_tid = NULL; cpu_thread_clean(newtd); - + linux_set_upcall_kse(newtd, PTROUT(args->stack)); PROC_LOCK(p); @@ -465,7 +465,7 @@ linux_thread_detach(struct thread *td) LINUX_CTR2(thread_detach, "thread(%d) %p", em->em_tid, child_clear_tid); - + error = suword32(child_clear_tid, 0); if (error != 0) return; Modified: head/sys/compat/linux/linux_ioctl.c ============================================================================== --- head/sys/compat/linux/linux_ioctl.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ioctl.c Mon Feb 5 17:29:12 2018 (r328890) @@ -241,7 +241,7 @@ linux_ioctl_hdio(struct thread *td, struct linux_ioctl #if defined(DEBUG) linux_msg(td, "HDIO_GET_GEO: mediasize %jd, c/h/s %d/%d/%d, " "bpc %jd", - (intmax_t)mediasize, fwcylinders, fwheads, fwsectors, + (intmax_t)mediasize, fwcylinders, fwheads, fwsectors, (intmax_t)bytespercyl); #endif if ((args->cmd & 0xffff) == LINUX_HDIO_GET_GEO) { @@ -1050,7 +1050,7 @@ linux_ioctl_termio(struct thread *td, struct linux_ioc break; case LINUX_TIOCGPTN: { int nb; - + error = fo_ioctl(fp, TIOCGPTN, (caddr_t)&nb, td->td_ucred, td); if (!error) error = copyout(&nb, (void *)args->arg, @@ -2319,7 +2319,7 @@ again: goto again; } - ifc.ifc_len = valid_len; + ifc.ifc_len = valid_len; sbuf_finish(sb); error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); if (error == 0) @@ -2393,12 +2393,12 @@ bsd_to_linux_ifreq(struct ifreq *arg) struct ifreq ifr; size_t ifr_len = sizeof(struct ifreq); int error; - + if ((error = copyin(arg, &ifr, ifr_len))) return (error); - + *(u_short *)&ifr.ifr_addr = ifr.ifr_addr.sa_family; - + error = copyout(&ifr, arg, ifr_len); return (error); @@ -2980,7 +2980,7 @@ linux_v4l_cliplist_copy(struct l_video_window *lvw, st } } ppvc = &((*ppvc)->next); - plvc = PTRIN(((struct l_video_clip *) plvc)->next); + plvc = PTRIN(((struct l_video_clip *) plvc)->next); } } else { /* Modified: head/sys/compat/linux/linux_ioctl.h ============================================================================== --- head/sys/compat/linux/linux_ioctl.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ioctl.h Mon Feb 5 17:29:12 2018 (r328890) @@ -252,7 +252,7 @@ #define LINUX_IOCTL_SOCKET_MAX LINUX_SIOCGIFCOUNT /* - * Device private ioctl calls + * Device private ioctl calls */ #define LINUX_SIOCDEVPRIVATE 0x89F0 /* to 89FF */ #define LINUX_IOCTL_PRIVATE_MIN LINUX_SIOCDEVPRIVATE @@ -430,7 +430,7 @@ /* In addition to the termio values */ #define LINUX_VSTART 8 #define LINUX_VSTOP 9 -#define LINUX_VSUSP 10 +#define LINUX_VSUSP 10 #define LINUX_VEOL 11 #define LINUX_VREPRINT 12 #define LINUX_VDISCARD 13 Modified: head/sys/compat/linux/linux_ipc.c ============================================================================== --- head/sys/compat/linux/linux_ipc.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ipc.c Mon Feb 5 17:29:12 2018 (r328890) @@ -731,8 +731,8 @@ linux_msgctl(struct thread *td, struct linux_msgctl_ar return (error); } - /* - * TODO: implement this + /* + * TODO: implement this * case LINUX_MSG_STAT: */ case LINUX_IPC_STAT: Modified: head/sys/compat/linux/linux_ipc.h ============================================================================== --- head/sys/compat/linux/linux_ipc.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ipc.h Mon Feb 5 17:29:12 2018 (r328890) @@ -86,7 +86,7 @@ #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32)) -struct linux_msgctl_args +struct linux_msgctl_args { l_int msqid; l_int cmd; Modified: head/sys/compat/linux/linux_ipc64.h ============================================================================== --- head/sys/compat/linux/linux_ipc64.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_ipc64.h Mon Feb 5 17:29:12 2018 (r328890) @@ -149,7 +149,7 @@ struct l_shminfo64 { l_ulong shmmni; l_ulong shmseg; l_ulong shmall; - l_ulong __unused1; + l_ulong __unused1; l_ulong __unused2; l_ulong __unused3; l_ulong __unused4; Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_misc.c Mon Feb 5 17:29:12 2018 (r328890) @@ -116,7 +116,7 @@ int stclohz; /* Statistics clock frequency */ static unsigned int linux_to_bsd_resource[LINUX_RLIM_NLIMITS] = { RLIMIT_CPU, RLIMIT_FSIZE, RLIMIT_DATA, RLIMIT_STACK, RLIMIT_CORE, RLIMIT_RSS, RLIMIT_NPROC, RLIMIT_NOFILE, - RLIMIT_MEMLOCK, RLIMIT_AS + RLIMIT_MEMLOCK, RLIMIT_AS }; struct l_sysinfo { @@ -839,7 +839,7 @@ linux_utimensat_nsec_valid(l_long nsec) return (1); } -int +int linux_utimensat(struct thread *td, struct linux_utimensat_args *args) { struct l_timespec l_times[2]; @@ -914,7 +914,7 @@ linux_utimensat(struct thread *td, struct linux_utimen error = kern_futimens(td, dfd, timesp, UIO_SYSSPACE); else { error = kern_utimensat(td, dfd, path, UIO_SYSSPACE, timesp, - UIO_SYSSPACE, flags); + UIO_SYSSPACE, flags); LFREEPATH(path); } @@ -1222,7 +1222,7 @@ struct l_itimerval { l_timeval it_value; }; -#define B2L_ITIMERVAL(bip, lip) \ +#define B2L_ITIMERVAL(bip, lip) \ (bip)->it_interval.tv_sec = (lip)->it_interval.tv_sec; \ (bip)->it_interval.tv_usec = (lip)->it_interval.tv_usec; \ (bip)->it_value.tv_sec = (lip)->it_value.tv_sec; \ Modified: head/sys/compat/linux/linux_persona.h ============================================================================== --- head/sys/compat/linux/linux_persona.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_persona.h Mon Feb 5 17:29:12 2018 (r328890) @@ -12,7 +12,7 @@ */ enum { LINUX_UNAME26 = 0x0020000, - LINUX_ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization + LINUX_ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization * of VA space */ LINUX_FDPIC_FUNCPTRS = 0x0080000, /* userspace function Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_signal.c Mon Feb 5 17:29:12 2018 (r328890) @@ -436,7 +436,7 @@ linux_rt_sigtimedwait(struct thread *td, tv.tv_sec = (long)ltv.tv_sec; tv.tv_usec = (suseconds_t)ltv.tv_usec; if (itimerfix(&tv)) { - /* + /* * The timeout was invalid. Convert it to something * valid that will act as it does under Linux. */ @@ -475,7 +475,7 @@ linux_rt_sigtimedwait(struct thread *td, error = copyout(&linfo, args->ptr, sizeof(linfo)); } if (error == 0) - td->td_retval[0] = sig; + td->td_retval[0] = sig; return (error); } Modified: head/sys/compat/linux/linux_socket.c ============================================================================== --- head/sys/compat/linux/linux_socket.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_socket.c Mon Feb 5 17:29:12 2018 (r328890) @@ -170,7 +170,7 @@ linux_getsockaddr(struct sockaddr **sap, const struct name = ((struct sockaddr_un *)kosa)->sun_path; if (*name == '\0') { /* - * Linux abstract namespace starts with a NULL byte. + * Linux abstract namespace starts with a NULL byte. * XXX We do not support abstract namespace yet. */ namelen = strnlen(name + 1, salen - hdrlen - 1) + 1; @@ -761,7 +761,7 @@ linux_bind(struct thread *td, struct linux_bind_args * error = kern_bindat(td, AT_FDCWD, args->s, sa); free(sa, M_SONAME); if (error == EADDRNOTAVAIL && args->namelen != sizeof(struct sockaddr_in)) - return (EINVAL); + return (EINVAL); return (error); } Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_socket.h Mon Feb 5 17:29:12 2018 (r328890) @@ -152,19 +152,19 @@ struct linux_accept_args { int linux_accept(struct thread *td, struct linux_accept_args *args); /* Operations for socketcall */ -#define LINUX_SOCKET 1 +#define LINUX_SOCKET 1 #define LINUX_BIND 2 -#define LINUX_CONNECT 3 -#define LINUX_LISTEN 4 -#define LINUX_ACCEPT 5 +#define LINUX_CONNECT 3 +#define LINUX_LISTEN 4 +#define LINUX_ACCEPT 5 #define LINUX_GETSOCKNAME 6 #define LINUX_GETPEERNAME 7 #define LINUX_SOCKETPAIR 8 #define LINUX_SEND 9 #define LINUX_RECV 10 -#define LINUX_SENDTO 11 -#define LINUX_RECVFROM 12 -#define LINUX_SHUTDOWN 13 +#define LINUX_SENDTO 11 +#define LINUX_RECVFROM 12 +#define LINUX_SHUTDOWN 13 #define LINUX_SETSOCKOPT 14 #define LINUX_GETSOCKOPT 15 #define LINUX_SENDMSG 16 Modified: head/sys/compat/linux/linux_time.c ============================================================================== --- head/sys/compat/linux/linux_time.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_time.c Mon Feb 5 17:29:12 2018 (r328890) @@ -437,7 +437,7 @@ linux_clock_getres(struct thread *td, struct linux_clo } /* - * Check user supplied clock id in case of per-process + * Check user supplied clock id in case of per-process * or thread-specific cpu-time clock. */ switch (nwhich) { @@ -464,7 +464,7 @@ linux_clock_getres(struct thread *td, struct linux_clo if (args->tp == NULL) { LIN_SDT_PROBE0(time, linux_clock_getres, nullcall); LIN_SDT_PROBE1(time, linux_clock_getres, return, 0); - return (0); + return (0); } switch (nwhich) { Modified: head/sys/compat/linux/linux_util.h ============================================================================== --- head/sys/compat/linux/linux_util.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/linux_util.h Mon Feb 5 17:29:12 2018 (r328890) @@ -64,7 +64,7 @@ int linux_emul_convpath(struct thread *, const char *, return (_error); \ } while (0) -#define LCONVPATH(td, upath, pathp, i) \ +#define LCONVPATH(td, upath, pathp, i) \ LCONVPATH_AT(td, upath, pathp, i, AT_FDCWD) #define LCONVPATHEXIST(td, upath, pathp) LCONVPATH(td, upath, pathp, 0) Modified: head/sys/compat/linux/stats_timing.d ============================================================================== --- head/sys/compat/linux/stats_timing.d Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/stats_timing.d Mon Feb 5 17:29:12 2018 (r328890) @@ -57,7 +57,7 @@ linuxulator*:::return @stats[probeprov, execname, probefunc] = quantize(this->timediff); @longest[probeprov, probefunc] = max(this->timediff); - + self->time[probefunc] = 0; } Modified: head/sys/compat/linux/trace_futexes.d ============================================================================== --- head/sys/compat/linux/trace_futexes.d Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/compat/linux/trace_futexes.d Mon Feb 5 17:29:12 2018 (r328890) @@ -157,10 +157,10 @@ linuxulator*:futex::return { this->timediff = self->time[probefunc] - timestamp; - @timestats[probeprov, execname, probefunc] = quantize(this->timediff); - @longest[probeprov, probefunc] = max(this->timediff); + @timestats[probeprov, execname, probefunc] = quantize(this->timediff); + @longest[probeprov, probefunc] = max(this->timediff); - self->time[probefunc] = 0; + self->time[probefunc] = 0; } Modified: head/sys/i386/linux/linux.h ============================================================================== --- head/sys/i386/linux/linux.h Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux.h Mon Feb 5 17:29:12 2018 (r328890) @@ -217,19 +217,19 @@ struct l_stat64 { l_ulonglong st_ino; }; -struct l_statfs64 { - l_int f_type; - l_int f_bsize; - uint64_t f_blocks; - uint64_t f_bfree; - uint64_t f_bavail; - uint64_t f_files; - uint64_t f_ffree; - l_fsid_t f_fsid; - l_int f_namelen; - l_int f_frsize; - l_int f_flags; - l_int f_spare[4]; +struct l_statfs64 { + l_int f_type; + l_int f_bsize; + uint64_t f_blocks; + uint64_t f_bfree; + uint64_t f_bavail; + uint64_t f_files; + uint64_t f_ffree; + l_fsid_t f_fsid; + l_int f_namelen; + l_int f_frsize; + l_int f_flags; + l_int f_spare[4]; }; #define LINUX_NSIG_WORDS 2 @@ -431,11 +431,11 @@ struct l_sigframe { struct l_rt_sigframe { l_int sf_sig; - l_siginfo_t *sf_siginfo; + l_siginfo_t *sf_siginfo; struct l_ucontext *sf_ucontext; l_siginfo_t sf_si; - struct l_ucontext sf_sc; - l_handler_t sf_handler; + struct l_ucontext sf_sc; + l_handler_t sf_handler; }; extern struct sysentvec linux_sysvec; Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux_dummy.c Mon Feb 5 17:29:12 2018 (r328890) @@ -8,7 +8,7 @@ * 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 + * notice, this list of conditions and the following disclaimer * in this position and unchanged. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the Modified: head/sys/i386/linux/linux_locore.s ============================================================================== --- head/sys/i386/linux/linux_locore.s Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux_locore.s Mon Feb 5 17:29:12 2018 (r328890) @@ -65,12 +65,12 @@ NON_GPROF_ENTRY(linux_vsyscall) .previous #endif -#define do_cfa_expr(offset) \ - .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ - .uleb128 11f-10f; /* length */ \ -10: .byte 0x74; /* DW_OP_breg4 */ \ - .sleb128 offset; /* offset */ \ - .byte 0x06; /* DW_OP_deref */ \ +#define do_cfa_expr(offset) \ + .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ + .uleb128 11f-10f; /* length */ \ +10: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ + .byte 0x06; /* DW_OP_deref */ \ 11: Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux_machdep.c Mon Feb 5 17:29:12 2018 (r328890) @@ -282,7 +282,7 @@ linux_set_cloned_tls(struct thread *td, void *desc) } else { idx = info.entry_number; - /* + /* * looks like we're getting the idx we returned * in the set_thread_area() syscall */ @@ -293,8 +293,8 @@ linux_set_cloned_tls(struct thread *td, void *desc) /* this doesnt happen in practice */ if (idx == 6) { - /* we might copy out the entry_number as 3 */ - info.entry_number = 3; + /* we might copy out the entry_number as 3 */ + info.entry_number = 3; error = copyout(&info, desc, sizeof(struct l_user_desc)); if (error) printf(LMSG("copyout failed!")); @@ -638,51 +638,51 @@ linux_set_thread_area(struct thread *td, struct linux_ #ifdef DEBUG if (ldebug(set_thread_area)) - printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, %i, %i, %i\n"), + printf(ARGS(set_thread_area, "%i, %x, %x, %i, %i, %i, %i, %i, %i\n"), info.entry_number, - info.base_addr, - info.limit, - info.seg_32bit, + info.base_addr, + info.limit, + info.seg_32bit, info.contents, - info.read_exec_only, - info.limit_in_pages, - info.seg_not_present, - info.useable); + info.read_exec_only, + info.limit_in_pages, + info.seg_not_present, + info.useable); #endif idx = info.entry_number; - /* + /* * Semantics of linux version: every thread in the system has array of - * 3 tls descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. This + * 3 tls descriptors. 1st is GLIBC TLS, 2nd is WINE, 3rd unknown. This * syscall loads one of the selected tls decriptors with a value and * also loads GDT descriptors 6, 7 and 8 with the content of the * per-thread descriptors. * - * Semantics of fbsd version: I think we can ignore that linux has 3 + * Semantics of fbsd version: I think we can ignore that linux has 3 * per-thread descriptors and use just the 1st one. The tls_array[] * is used only in set/get-thread_area() syscalls and for loading the * GDT descriptors. In fbsd we use just one GDT descriptor for TLS so - * we will load just one. + * we will load just one. * * XXX: this doesn't work when a user space process tries to use more * than 1 TLS segment. Comment in the linux sources says wine might do * this. */ - /* - * we support just GLIBC TLS now + /* + * we support just GLIBC TLS now * we should let 3 proceed as well because we use this segment so * if code does two subsequent calls it should succeed */ if (idx != 6 && idx != -1 && idx != 3) return (EINVAL); - /* + /* * we have to copy out the GDT entry we use * FreeBSD uses GDT entry #3 for storing %gs so load that * * XXX: what if a user space program doesn't check this value and tries - * to use 6, 7 or 8? + * to use 6, 7 or 8? */ idx = info.entry_number = 3; error = copyout(&info, args->desc, sizeof(struct l_user_desc)); @@ -700,7 +700,7 @@ linux_set_thread_area(struct thread *td, struct linux_ memcpy(&sd, &a, sizeof(a)); #ifdef DEBUG if (ldebug(set_thread_area)) - printf("Segment created in set_thread_area: lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, type: %i, dpl: %i, p: %i, xx: %i, def32: %i, gran: %i\n", sd.sd_lobase, + printf("Segment created in set_thread_area: lobase: %x, hibase: %x, lolimit: %x, hilimit: %x, type: %i, dpl: %i, p: %i, xx: %i, def32: %i, gran: %i\n", sd.sd_lobase, sd.sd_hibase, sd.sd_lolimit, sd.sd_hilimit, @@ -719,14 +719,14 @@ linux_set_thread_area(struct thread *td, struct linux_ PCPU_GET(fsgs_gdt)[1] = sd; load_gs(GSEL(GUGS_SEL, SEL_UPL)); critical_exit(); - + return (0); } int linux_get_thread_area(struct thread *td, struct linux_get_thread_area_args *args) { - + struct l_user_desc info; int error; int idx; @@ -767,7 +767,7 @@ linux_get_thread_area(struct thread *td, struct linux_ error = copyout(&info, args->desc, sizeof(struct l_user_desc)); if (error) - return (EFAULT); + return (EFAULT); return (0); } @@ -777,7 +777,7 @@ int linux_mq_open(struct thread *td, struct linux_mq_open_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_open(td, (struct kmq_open_args *) args); + return sys_kmq_open(td, (struct kmq_open_args *) args); #else return (ENOSYS); #endif @@ -787,7 +787,7 @@ int linux_mq_unlink(struct thread *td, struct linux_mq_unlink_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_unlink(td, (struct kmq_unlink_args *) args); + return sys_kmq_unlink(td, (struct kmq_unlink_args *) args); #else return (ENOSYS); #endif @@ -797,7 +797,7 @@ int linux_mq_timedsend(struct thread *td, struct linux_mq_timedsend_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedsend(td, (struct kmq_timedsend_args *) args); + return sys_kmq_timedsend(td, (struct kmq_timedsend_args *) args); #else return (ENOSYS); #endif @@ -807,7 +807,7 @@ int linux_mq_timedreceive(struct thread *td, struct linux_mq_timedreceive_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *) args); + return sys_kmq_timedreceive(td, (struct kmq_timedreceive_args *) args); #else return (ENOSYS); #endif @@ -827,7 +827,7 @@ int linux_mq_getsetattr(struct thread *td, struct linux_mq_getsetattr_args *args) { #ifdef P1003_1B_MQUEUE - return sys_kmq_setattr(td, (struct kmq_setattr_args *) args); + return sys_kmq_setattr(td, (struct kmq_setattr_args *) args); #else return (ENOSYS); #endif Modified: head/sys/i386/linux/linux_support.s ============================================================================== --- head/sys/i386/linux/linux_support.s Mon Feb 5 17:01:18 2018 (r328889) +++ head/sys/i386/linux/linux_support.s Mon Feb 5 17:29:12 2018 (r328890) @@ -46,7 +46,7 @@ ENTRY(futex_xchgl) movl 4(%esp),%eax movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault + ja futex_fault xchgl %eax,(%edx) movl 12(%esp),%edx movl %eax,(%edx) @@ -60,7 +60,7 @@ ENTRY(futex_addl) movl 4(%esp),%eax movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault + ja futex_fault #ifdef SMP lock #endif @@ -76,7 +76,7 @@ ENTRY(futex_orl) movl $futex_fault_decx,PCB_ONFAULT(%ecx) movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx - ja futex_fault + ja futex_fault movl (%edx),%eax 1: movl %eax,%ecx orl 4(%esp),%ecx @@ -85,7 +85,7 @@ ENTRY(futex_orl) #endif cmpxchgl %ecx,(%edx) jnz 1b -futex_tail: +futex_tail: movl 12(%esp),%edx movl %eax,(%edx) xorl %eax,%eax @@ -98,7 +98,7 @@ ENTRY(futex_andl) movl $futex_fault_decx,PCB_ONFAULT(%ecx) movl 8(%esp),%edx cmpl $VM_MAXUSER_ADDRESS-4,%edx *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Feb 5 17:33:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB5ABEDFB26; Mon, 5 Feb 2018 17:33:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B9CE7DFA2; Mon, 5 Feb 2018 17:33:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 863E3400D; Mon, 5 Feb 2018 17:33:16 +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 w15HXGDo065826; Mon, 5 Feb 2018 17:33:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15HXG6D065825; Mon, 5 Feb 2018 17:33:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802051733.w15HXG6D065825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 5 Feb 2018 17:33:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328891 - head/lib/libcasper/libcasper X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libcasper/libcasper X-SVN-Commit-Revision: 328891 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.25 Precedence: list List-Id: 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, 05 Feb 2018 17:33:17 -0000 Author: markj Date: Mon Feb 5 17:33:16 2018 New Revision: 328891 URL: https://svnweb.freebsd.org/changeset/base/328891 Log: Document the need for WITH_CASPER. After r325062, consumers need to define WITH_CASPER for libcasper to function as expected. Modified: head/lib/libcasper/libcasper/libcasper.3 Modified: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper.3 Mon Feb 5 17:29:12 2018 (r328890) +++ head/lib/libcasper/libcasper/libcasper.3 Mon Feb 5 17:33:16 2018 (r328891) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 3, 2018 +.Dd February 5, 2018 .Dt LIBCASPER 3 .Os .Sh NAME @@ -47,6 +47,7 @@ .Sh LIBRARY .Lb libcasper .Sh SYNOPSIS +.Fd #define WITH_CASPER .In sys/nv.h .In libcasper.h .Ft "cap_channel_t *" From owner-svn-src-head@freebsd.org Mon Feb 5 18:06:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D46BAEE2A65; Mon, 5 Feb 2018 18:06:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 845F580951; Mon, 5 Feb 2018 18:06:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78E364561; Mon, 5 Feb 2018 18:06:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15I6sZU083366; Mon, 5 Feb 2018 18:06:54 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15I6sEA083365; Mon, 5 Feb 2018 18:06:54 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802051806.w15I6sEA083365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Feb 2018 18:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328892 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 328892 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.25 Precedence: list List-Id: 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, 05 Feb 2018 18:06:55 -0000 Author: brooks Date: Mon Feb 5 18:06:54 2018 New Revision: 328892 URL: https://svnweb.freebsd.org/changeset/base/328892 Log: Garbage collect trailing whitespace. Sponsored by: DARPA, AFRL Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Mon Feb 5 17:33:16 2018 (r328891) +++ head/sys/mips/mips/busdma_machdep.c Mon Feb 5 18:06:54 2018 (r328892) @@ -277,7 +277,7 @@ run_filter(bus_dma_tag_t dmat, bus_addr_t paddr) || (*dmat->filter)(dmat->filterarg, paddr) != 0)) retval = 1; - dmat = dmat->parent; + dmat = dmat->parent; } while (retval == 0 && dmat != NULL); return (retval); } @@ -292,7 +292,7 @@ _bus_dma_can_bounce(vm_offset_t lowaddr, vm_offset_t h int i; for (i = 0; phys_avail[i] && phys_avail[i + 1]; i += 2) { if ((lowaddr >= phys_avail[i] && lowaddr <= phys_avail[i + 1]) - || (lowaddr < phys_avail[i] && + || (lowaddr < phys_avail[i] && highaddr > phys_avail[i])) return (1); } @@ -356,7 +356,7 @@ _busdma_alloc_dmamap(bus_dma_tag_t dmat) return (map); } -static __inline void +static __inline void _busdma_free_dmamap(bus_dmamap_t map) { @@ -497,10 +497,10 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat) if (dmat != NULL) { if (dmat->map_count != 0) return (EBUSY); - + while (dmat != NULL) { bus_dma_tag_t parent; - + parent = dmat->parent; atomic_subtract_int(&dmat->ref_count, 1); if (dmat->ref_count == 0) { @@ -1394,7 +1394,7 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) break; } bpage->busaddr = pmap_kextract(bpage->vaddr); - bpage->vaddr_nocache = + bpage->vaddr_nocache = (vm_offset_t)pmap_mapdev(bpage->busaddr, PAGE_SIZE); mtx_lock(&bounce_lock); STAILQ_INSERT_TAIL(&bz->bounce_page_list, bpage, links); From owner-svn-src-head@freebsd.org Mon Feb 5 18:10:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB39CEE2ECF; Mon, 5 Feb 2018 18:10:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 889C080BD0; Mon, 5 Feb 2018 18:10: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E0964565; Mon, 5 Feb 2018 18:10:28 +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 w15IASlr083555; Mon, 5 Feb 2018 18:10:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15IASQX083554; Mon, 5 Feb 2018 18:10:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802051810.w15IASQX083554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Feb 2018 18:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328893 - head/lib/libc/mips/gen X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libc/mips/gen X-SVN-Commit-Revision: 328893 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.25 Precedence: list List-Id: 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, 05 Feb 2018 18:10:29 -0000 Author: jhb Date: Mon Feb 5 18:10:28 2018 New Revision: 328893 URL: https://svnweb.freebsd.org/changeset/base/328893 Log: Fix makecontext() on MIPS O32. The GP register can be clobbered by the callback, so save it in S1 while invoking the callback function. While here, add a comment expounding on the treatment of GP for the various ABIs and the assumptions made. Reviewed by: jmallett (earlier version) Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D14179 Modified: head/lib/libc/mips/gen/_ctx_start.S Modified: head/lib/libc/mips/gen/_ctx_start.S ============================================================================== --- head/lib/libc/mips/gen/_ctx_start.S Mon Feb 5 18:06:54 2018 (r328892) +++ head/lib/libc/mips/gen/_ctx_start.S Mon Feb 5 18:10:28 2018 (r328893) @@ -28,11 +28,25 @@ __FBSDID("$FreeBSD$"); /* - * XXX gp? + * This requires makecontext() to setup a valid GP for locating + * _ctx_done rather than deriving GP from T9 on entry. Currently this + * uses the GP inherited from getcontext() assuming that getcontext() + * is in the same shared object as _ctx_done(). For N32 and N64, GP + * is caller-save so will be preserved across the call to the callback + * function. For O32, GP is callee-save, so save it in a different + * caller-save register (S1) while invoking the callback. This is + * done instead of the usual SETUP_GP/SAVE_GP to avoid disturbing the + * stack frame setup by makecontext() for the callback function. */ ENTRY(_ctx_start) +#ifdef __mips_o32 + move s1, gp +#endif jalr t9 +#ifdef __mips_o32 + move gp, s1 +#endif move a0, s0 PTR_LA t9, _ctx_done jalr t9 From owner-svn-src-head@freebsd.org Mon Feb 5 18:39:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D6DBEE52BC; Mon, 5 Feb 2018 18:39:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0B7582167; Mon, 5 Feb 2018 18:39:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D741E4A83; Mon, 5 Feb 2018 18:39:06 +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 w15Id6Pw098795; Mon, 5 Feb 2018 18:39:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15Id6ir098793; Mon, 5 Feb 2018 18:39:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802051839.w15Id6ir098793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 5 Feb 2018 18:39:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328894 - in head/sys: amd64/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head/sys: amd64/linux i386/linux X-SVN-Commit-Revision: 328894 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.25 Precedence: list List-Id: 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, 05 Feb 2018 18:39:07 -0000 Author: emaste Date: Mon Feb 5 18:39:06 2018 New Revision: 328894 URL: https://svnweb.freebsd.org/changeset/base/328894 Log: Additional linuxolator whitespace cleanup, missed in r328890 Modified: head/sys/amd64/linux/syscalls.master head/sys/i386/linux/syscalls.master Modified: head/sys/amd64/linux/syscalls.master ============================================================================== --- head/sys/amd64/linux/syscalls.master Mon Feb 5 18:10:28 2018 (r328893) +++ head/sys/amd64/linux/syscalls.master Mon Feb 5 18:39:06 2018 (r328894) @@ -76,7 +76,7 @@ l_size_t nbyte, l_loff_t offset); } 18 AUE_PWRITE STD { int linux_pwrite(l_uint fd, char *buf, \ l_size_t nbyte, l_loff_t offset); } -19 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ +19 AUE_READV NOPROTO { int readv(int fd, struct iovec *iovp, \ u_int iovcnt); } 20 AUE_WRITEV NOPROTO { int writev(int fd, struct iovec *iovp, \ u_int iovcnt); } @@ -472,7 +472,7 @@ 279 AUE_NULL STD { int linux_move_pages(void); } 280 AUE_FUTIMESAT STD { int linux_utimensat(l_int dfd, const char *pathname, \ const struct l_timespec *times, l_int flags); } -281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ +281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \ l_int maxevents, l_int timeout, l_sigset_t *mask, \ l_size_t sigsetsize); } 282 AUE_NULL STD { int linux_signalfd(void); } Modified: head/sys/i386/linux/syscalls.master ============================================================================== --- head/sys/i386/linux/syscalls.master Mon Feb 5 18:10:28 2018 (r328893) +++ head/sys/i386/linux/syscalls.master Mon Feb 5 18:39:06 2018 (r328894) @@ -121,10 +121,10 @@ 61 AUE_CHROOT NOPROTO { int chroot(char *path); } 62 AUE_NULL STD { int linux_ustat(l_dev_t dev, \ struct l_ustat *ubuf); } -63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } +63 AUE_DUP2 NOPROTO { int dup2(u_int from, u_int to); } 64 AUE_GETPPID STD { int linux_getppid(void); } -65 AUE_GETPGRP NOPROTO { int getpgrp(void); } -66 AUE_SETSID NOPROTO { int setsid(void); } +65 AUE_GETPGRP NOPROTO { int getpgrp(void); } +66 AUE_SETSID NOPROTO { int setsid(void); } 67 AUE_NULL STD { int linux_sigaction(l_int sig, \ l_osigaction_t *nsa, \ l_osigaction_t *osa); } From owner-svn-src-head@freebsd.org Mon Feb 5 18:45:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328C5EE5C2A; Mon, 5 Feb 2018 18:45:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC31E829DC; Mon, 5 Feb 2018 18:45:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2BC24C1F; Mon, 5 Feb 2018 18:45:21 +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 w15IjLV2003876; Mon, 5 Feb 2018 18:45:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15IjLHq003875; Mon, 5 Feb 2018 18:45:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802051845.w15IjLHq003875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 5 Feb 2018 18:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328895 - head/etc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 328895 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.25 Precedence: list List-Id: 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, 05 Feb 2018 18:45:22 -0000 Author: emaste Date: Mon Feb 5 18:45:21 2018 New Revision: 328895 URL: https://svnweb.freebsd.org/changeset/base/328895 Log: Correct Russia spelling in regdomain.xml PR: 225658 MFC after: 1 week Modified: head/etc/regdomain.xml Modified: head/etc/regdomain.xml ============================================================================== --- head/etc/regdomain.xml Mon Feb 5 18:39:06 2018 (r328894) +++ head/etc/regdomain.xml Mon Feb 5 18:45:21 2018 (r328895) @@ -1595,7 +1595,7 @@ 642 Romania - 643 Rusia + 643 Russia 682 Saudi Arabia From owner-svn-src-head@freebsd.org Mon Feb 5 18:48:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C307EE6086; Mon, 5 Feb 2018 18:48:01 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDC4282DC0; Mon, 5 Feb 2018 18:48:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C89BC4C24; Mon, 5 Feb 2018 18:48:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15Im0EB004134; Mon, 5 Feb 2018 18:48:00 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15Im031004131; Mon, 5 Feb 2018 18:48:00 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802051848.w15Im031004131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Feb 2018 18:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328896 - in head: contrib/netbsd-tests/kernel tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head: contrib/netbsd-tests/kernel tests/sys/kern X-SVN-Commit-Revision: 328896 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.25 Precedence: list List-Id: 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, 05 Feb 2018 18:48:01 -0000 Author: brooks Date: Mon Feb 5 18:48:00 2018 New Revision: 328896 URL: https://svnweb.freebsd.org/changeset/base/328896 Log: Fix and enable SysV IPC tests. Don't declare some types that FreeBSD incorrectly declares. Fix an incorrect call to open() (missing mode). ANSIfy prototypes. Enable SysV message queue, semaphore, and shared memory tests. With exception of the workaround for union semun, these fixes have been committed to NetBSD. Reviewed by: asomers Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13471 Modified: head/contrib/netbsd-tests/kernel/t_sysv.c head/tests/sys/kern/Makefile Modified: head/contrib/netbsd-tests/kernel/t_sysv.c ============================================================================== --- head/contrib/netbsd-tests/kernel/t_sysv.c Mon Feb 5 18:45:21 2018 (r328895) +++ head/contrib/netbsd-tests/kernel/t_sysv.c Mon Feb 5 18:48:00 2018 (r328896) @@ -72,7 +72,7 @@ void sharer(void); #define MESSAGE_TEXT_LEN 256 -struct mymsg { +struct testmsg { long mtype; char mtext[MESSAGE_TEXT_LEN]; }; @@ -94,11 +94,13 @@ key_t msgkey, semkey, shmkey; int maxloop = 1; +#ifndef __FreeBSD__ union semun { int val; /* value for SETVAL */ struct semid_ds *buf; /* buffer for IPC_{STAT,SET} */ u_short *array; /* array for GETALL & SETALL */ }; +#endif /* Writes an integer to a file. To be used from the body of the test @@ -174,7 +176,7 @@ key_t get_ftok(int id) /* Create the file, since ftok() requires it to exist! */ - fd = open(token_key, O_RDWR | O_CREAT | O_EXCL); + fd = open(token_key, O_RDWR | O_CREAT | O_EXCL, 0600); if (fd == -1) { rmdir(tmpdir); atf_tc_fail("open() of temp file failed: %d", errno); @@ -202,7 +204,7 @@ ATF_TC_BODY(msg, tc) { struct sigaction sa; struct msqid_ds m_ds; - struct mymsg m; + struct testmsg m; sigset_t sigmask; int sender_msqid; int loop; @@ -347,9 +349,7 @@ ATF_TC_CLEANUP(msg, tc) } void -print_msqid_ds(mp, mode) - struct msqid_ds *mp; - mode_t mode; +print_msqid_ds(struct msqid_ds *mp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -381,9 +381,9 @@ print_msqid_ds(mp, mode) } void -receiver() +receiver(void) { - struct mymsg m; + struct testmsg m; int msqid, loop; if ((msqid = msgget(msgkey, 0)) == -1) @@ -588,9 +588,7 @@ ATF_TC_CLEANUP(sem, tc) } void -print_semid_ds(sp, mode) - struct semid_ds *sp; - mode_t mode; +print_semid_ds(struct semid_ds *sp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -620,7 +618,7 @@ print_semid_ds(sp, mode) } void -waiter() +waiter(void) { struct sembuf s; int semid; @@ -789,9 +787,7 @@ ATF_TC_CLEANUP(shm, tc) } void -print_shmid_ds(sp, mode) - struct shmid_ds *sp; - mode_t mode; +print_shmid_ds(struct shmid_ds *sp, mode_t mode) { uid_t uid = geteuid(); gid_t gid = getegid(); @@ -823,7 +819,7 @@ print_shmid_ds(sp, mode) } void -sharer() +sharer(void) { int shmid; void *shm_buf; Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Mon Feb 5 18:45:21 2018 (r328895) +++ head/tests/sys/kern/Makefile Mon Feb 5 18:48:00 2018 (r328896) @@ -26,6 +26,7 @@ LIBADD.unix_seqpacket_test+= pthread NETBSD_ATF_TESTS_C+= lockf_test NETBSD_ATF_TESTS_C+= mqueue_test +NETBSD_ATF_TESTS_C+= sysv_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt From owner-svn-src-head@freebsd.org Mon Feb 5 18:58:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61766EE6FDC; Mon, 5 Feb 2018 18:58:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17F0983C02; Mon, 5 Feb 2018 18:58:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E1344DBC; Mon, 5 Feb 2018 18:58:56 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15Iwtci009736; Mon, 5 Feb 2018 18:58:55 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15IwtjP009735; Mon, 5 Feb 2018 18:58:55 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802051858.w15IwtjP009735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Feb 2018 18:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328898 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328898 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.25 Precedence: list List-Id: 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, 05 Feb 2018 18:58:56 -0000 Author: brooks Date: Mon Feb 5 18:58:55 2018 New Revision: 328898 URL: https://svnweb.freebsd.org/changeset/base/328898 Log: ANSIfy syscall implementations. Reviewed by: rwatson Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14172 Modified: head/sys/kern/vfs_extattr.c Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Mon Feb 5 18:56:34 2018 (r328897) +++ head/sys/kern/vfs_extattr.c Mon Feb 5 18:58:55 2018 (r328898) @@ -56,16 +56,17 @@ __FBSDID("$FreeBSD$"); * * Currently this is used only by UFS1 extended attributes. */ +#ifndef _SYS_SYSPROTO_H_ +struct extattrctl_args { + const char *path; + int cmd; + const char *filename; + int attrnamespace; + const char *attrname; +}; +#endif int -sys_extattrctl(td, uap) - struct thread *td; - struct extattrctl_args /* { - const char *path; - int cmd; - const char *filename; - int attrnamespace; - const char *attrname; - } */ *uap; +sys_extattrctl(struct thread *td, struct extattrctl_args *uap) { struct vnode *filename_vp; struct nameidata nd; @@ -206,16 +207,17 @@ done: return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_set_fd_args { + int fd; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_set_fd(td, uap) - struct thread *td; - struct extattr_set_fd_args /* { - int fd; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_set_fd(struct thread *td, struct extattr_set_fd_args *uap) { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; @@ -241,16 +243,17 @@ sys_extattr_set_fd(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_set_file_args { + const char *path; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_set_file(td, uap) - struct thread *td; - struct extattr_set_file_args /* { - const char *path; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_set_file(struct thread *td, struct extattr_set_file_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -276,16 +279,17 @@ sys_extattr_set_file(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_set_link_args { + const char *path; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_set_link(td, uap) - struct thread *td; - struct extattr_set_link_args /* { - const char *path; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_set_link(struct thread *td, struct extattr_set_link_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -381,16 +385,17 @@ done: return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_get_fd_args { + int fd; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_get_fd(td, uap) - struct thread *td; - struct extattr_get_fd_args /* { - int fd; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_get_fd(struct thread *td, struct extattr_get_fd_args *uap) { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; @@ -416,16 +421,17 @@ sys_extattr_get_fd(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_get_file_args { + const char *path; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_get_file(td, uap) - struct thread *td; - struct extattr_get_file_args /* { - const char *path; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_get_file(struct thread *td, struct extattr_get_file_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -450,16 +456,17 @@ sys_extattr_get_file(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_get_link_args { + const char *path; + int attrnamespace; + const char *attrname; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_get_link(td, uap) - struct thread *td; - struct extattr_get_link_args /* { - const char *path; - int attrnamespace; - const char *attrname; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_get_link(struct thread *td, struct extattr_get_link_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -527,14 +534,15 @@ done: return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_delete_fd_args { + int fd; + int attrnamespace; + const char *attrname; +}; +#endif int -sys_extattr_delete_fd(td, uap) - struct thread *td; - struct extattr_delete_fd_args /* { - int fd; - int attrnamespace; - const char *attrname; - } */ *uap; +sys_extattr_delete_fd(struct thread *td, struct extattr_delete_fd_args *uap) { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; @@ -559,14 +567,15 @@ sys_extattr_delete_fd(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_delete_file_args { + const char *path; + int attrnamespace; + const char *attrname; +}; +#endif int -sys_extattr_delete_file(td, uap) - struct thread *td; - struct extattr_delete_file_args /* { - const char *path; - int attrnamespace; - const char *attrname; - } */ *uap; +sys_extattr_delete_file(struct thread *td, struct extattr_delete_file_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -589,14 +598,15 @@ sys_extattr_delete_file(td, uap) return(error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_delete_link_args { + const char *path; + int attrnamespace; + const char *attrname; +}; +#endif int -sys_extattr_delete_link(td, uap) - struct thread *td; - struct extattr_delete_link_args /* { - const char *path; - int attrnamespace; - const char *attrname; - } */ *uap; +sys_extattr_delete_link(struct thread *td, struct extattr_delete_link_args *uap) { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; @@ -684,15 +694,16 @@ done: } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_list_fd_args { + int fd; + int attrnamespace; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_list_fd(td, uap) - struct thread *td; - struct extattr_list_fd_args /* { - int fd; - int attrnamespace; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_list_fd(struct thread *td, struct extattr_list_fd_args *uap) { struct file *fp; cap_rights_t rights; @@ -712,15 +723,16 @@ sys_extattr_list_fd(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_list_file_args { + const char *path; + int attrnamespace; + void *data; + size_t nbytes; +} +#endif int -sys_extattr_list_file(td, uap) - struct thread*td; - struct extattr_list_file_args /* { - const char *path; - int attrnamespace; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_list_file(struct thread *td, struct extattr_list_file_args *uap) { struct nameidata nd; int error; @@ -739,15 +751,16 @@ sys_extattr_list_file(td, uap) return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct extattr_list_link_args { + const char *path; + int attrnamespace; + void *data; + size_t nbytes; +}; +#endif int -sys_extattr_list_link(td, uap) - struct thread*td; - struct extattr_list_link_args /* { - const char *path; - int attrnamespace; - void *data; - size_t nbytes; - } */ *uap; +sys_extattr_list_link(struct thread *td, struct extattr_list_link_args *uap) { struct nameidata nd; int error; From owner-svn-src-head@freebsd.org Mon Feb 5 19:06:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AA31EE79CF; Mon, 5 Feb 2018 19:06:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 000BA8441A; Mon, 5 Feb 2018 19:06:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA89D4F58; Mon, 5 Feb 2018 19:06:34 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15J6YwM015008; Mon, 5 Feb 2018 19:06:34 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15J6YgE015007; Mon, 5 Feb 2018 19:06:34 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802051906.w15J6YgE015007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Feb 2018 19:06:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328899 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328899 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.25 Precedence: list List-Id: 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, 05 Feb 2018 19:06:35 -0000 Author: brooks Date: Mon Feb 5 19:06:34 2018 New Revision: 328899 URL: https://svnweb.freebsd.org/changeset/base/328899 Log: Reduce duplication in extattr_*_(file|link) syscalls. Reviewed by: rwatson Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14173 Modified: head/sys/kern/vfs_extattr.c Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Mon Feb 5 18:58:55 2018 (r328898) +++ head/sys/kern/vfs_extattr.c Mon Feb 5 19:06:34 2018 (r328899) @@ -49,6 +49,17 @@ __FBSDID("$FreeBSD$"); #include #include +static int kern_extattr_set_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, void *data, + size_t nbytes, int follow); +static int kern_extattr_get_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, void *data, + size_t nbytes, int follow); +static int kern_extattr_delete_path(struct thread *td, const char *path, + int attrnamespace, const char *attrname, int follow); +static int kern_extattr_list_path(struct thread *td, const char *path, + int attrnamespace, void *data, size_t nbytes, int follow); + /* * Syscall to push extended attribute configuration information into the VFS. * Accepts a path, which it converts to a mountpoint, as well as a command @@ -255,28 +266,9 @@ struct extattr_set_file_args { int sys_extattr_set_file(struct thread *td, struct extattr_set_file_args *uap) { - struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; - int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); - if (error) - return (error); - AUDIT_ARG_TEXT(attrname); - - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); - error = namei(&nd); - if (error) - return (error); - NDFREE(&nd, NDF_ONLY_PNBUF); - - error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, - uap->data, uap->nbytes, td); - - vrele(nd.ni_vp); - return (error); + return (kern_extattr_set_path(td, uap->path, uap->attrnamespace, + uap->attrname, uap->data, uap->nbytes, FOLLOW)); } #ifndef _SYS_SYSPROTO_H_ @@ -291,25 +283,33 @@ struct extattr_set_link_args { int sys_extattr_set_link(struct thread *td, struct extattr_set_link_args *uap) { + + return (kern_extattr_set_path(td, uap->path, uap->attrnamespace, + uap->attrname, uap->data, uap->nbytes, NOFOLLOW)); +} + +static int +kern_extattr_set_path(struct thread *td, const char *path, int attrnamespace, + const char *uattrname, void *data, size_t nbytes, int follow) +{ struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + AUDIT_ARG_VALUE(attrnamespace); + error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, - uap->path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, - uap->data, uap->nbytes, td); + error = extattr_set_vp(nd.ni_vp, attrnamespace, attrname, data, + nbytes, td); vrele(nd.ni_vp); return (error); @@ -433,27 +433,8 @@ struct extattr_get_file_args { int sys_extattr_get_file(struct thread *td, struct extattr_get_file_args *uap) { - struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; - int error; - - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); - if (error) - return (error); - AUDIT_ARG_TEXT(attrname); - - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error) - return (error); - NDFREE(&nd, NDF_ONLY_PNBUF); - - error = extattr_get_vp(nd.ni_vp, uap->attrnamespace, attrname, - uap->data, uap->nbytes, td); - - vrele(nd.ni_vp); - return (error); + return (kern_extattr_get_path(td, uap->path, uap->attrnamespace, + uap->attrname, uap->data, uap->nbytes, FOLLOW)); } #ifndef _SYS_SYSPROTO_H_ @@ -468,25 +449,32 @@ struct extattr_get_link_args { int sys_extattr_get_link(struct thread *td, struct extattr_get_link_args *uap) { + return (kern_extattr_get_path(td, uap->path, uap->attrnamespace, + uap->attrname, uap->data, uap->nbytes, NOFOLLOW)); +} + +static int +kern_extattr_get_path(struct thread *td, const char *path, int attrnamespace, + const char *uattrname, void *data, size_t nbytes, int follow) +{ struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + AUDIT_ARG_VALUE(attrnamespace); + error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = extattr_get_vp(nd.ni_vp, uap->attrnamespace, attrname, - uap->data, uap->nbytes, td); + error = extattr_get_vp(nd.ni_vp, attrnamespace, attrname, data, + nbytes, td); vrele(nd.ni_vp); return (error); @@ -577,25 +565,9 @@ struct extattr_delete_file_args { int sys_extattr_delete_file(struct thread *td, struct extattr_delete_file_args *uap) { - struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; - int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); - if (error) - return(error); - AUDIT_ARG_TEXT(attrname); - - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error) - return(error); - NDFREE(&nd, NDF_ONLY_PNBUF); - - error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); - vrele(nd.ni_vp); - return(error); + return (kern_extattr_delete_path(td, uap->path, uap->attrnamespace, + uap->attrname, FOLLOW)); } #ifndef _SYS_SYSPROTO_H_ @@ -608,23 +580,32 @@ struct extattr_delete_link_args { int sys_extattr_delete_link(struct thread *td, struct extattr_delete_link_args *uap) { + + return (kern_extattr_delete_path(td, uap->path, uap->attrnamespace, + uap->attrname, NOFOLLOW)); +} + +static int +kern_extattr_delete_path(struct thread *td, const char *path, int attrnamespace, + const char *uattrname, int follow) +{ struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + AUDIT_ARG_VALUE(attrnamespace); + error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return(error); AUDIT_ARG_TEXT(attrname); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error) return(error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); + error = extattr_delete_vp(nd.ni_vp, attrnamespace, attrname, td); vrele(nd.ni_vp); return(error); } @@ -734,21 +715,9 @@ struct extattr_list_file_args { int sys_extattr_list_file(struct thread *td, struct extattr_list_file_args *uap) { - struct nameidata nd; - int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); - error = namei(&nd); - if (error) - return (error); - NDFREE(&nd, NDF_ONLY_PNBUF); - - error = extattr_list_vp(nd.ni_vp, uap->attrnamespace, uap->data, - uap->nbytes, td); - - vrele(nd.ni_vp); - return (error); + return (kern_extattr_list_path(td, uap->path, uap->attrnamespace, + uap->data, uap->nbytes, FOLLOW)); } #ifndef _SYS_SYSPROTO_H_ @@ -762,19 +731,26 @@ struct extattr_list_link_args { int sys_extattr_list_link(struct thread *td, struct extattr_list_link_args *uap) { + + return (kern_extattr_list_path(td, uap->path, uap->attrnamespace, + uap->data, uap->nbytes, NOFOLLOW)); +} + +static int +kern_extattr_list_path(struct thread *td, const char *path, int attrnamespace, + void *data, size_t nbytes, int follow) +{ struct nameidata nd; int error; - AUDIT_ARG_VALUE(uap->attrnamespace); - NDINIT(&nd, LOOKUP, NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, - td); + AUDIT_ARG_VALUE(attrnamespace); + NDINIT(&nd, LOOKUP, follow | AUDITVNODE1, UIO_USERSPACE, path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); - error = extattr_list_vp(nd.ni_vp, uap->attrnamespace, uap->data, - uap->nbytes, td); + error = extattr_list_vp(nd.ni_vp, attrnamespace, data, nbytes, td); vrele(nd.ni_vp); return (error); From owner-svn-src-head@freebsd.org Mon Feb 5 20:30:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98D88EED40A; Mon, 5 Feb 2018 20:30:54 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AA3987AFE; Mon, 5 Feb 2018 20:30:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45AE05C58; Mon, 5 Feb 2018 20:30:54 +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 w15KUsd0056562; Mon, 5 Feb 2018 20:30:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15KUsjO056561; Mon, 5 Feb 2018 20:30:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802052030.w15KUsjO056561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 20:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328900 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328900 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.25 Precedence: list List-Id: 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, 05 Feb 2018 20:30:54 -0000 Author: adrian Date: Mon Feb 5 20:30:53 2018 New Revision: 328900 URL: https://svnweb.freebsd.org/changeset/base/328900 Log: [arswitch] fix build breakage. Apparently the last time I checked building this it didn't pick up that the header had changed. Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 5 19:06:34 2018 (r328899) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Mon Feb 5 20:30:53 2018 (r328900) @@ -364,7 +364,7 @@ #define AR934X_REG_OPER_MODE1_PHY4_MII_EN (1 << 28) #define AR934X_REG_FLOOD_MASK 0x2c -#define AR934X_FLOOD_MASK_MC_DP(_p) (1 << (0 + (_p))) +#define AR934X_FLOOD_MASK_UC_DP(_p) (1 << (0 + (_p))) #define AR934X_FLOOD_MASK_MC_DP(_p) (1 << (16 + (_p))) #define AR934X_FLOOD_MASK_BC_DP(_p) (1 << (25 + (_p))) From owner-svn-src-head@freebsd.org Mon Feb 5 20:37:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90A66EEDDD8; Mon, 5 Feb 2018 20:37:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34942881E6; Mon, 5 Feb 2018 20:37:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ACE75DDE; Mon, 5 Feb 2018 20:37:30 +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 w15KbTCo061595; Mon, 5 Feb 2018 20:37:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15KbTsw061594; Mon, 5 Feb 2018 20:37:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802052037.w15KbTsw061594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 5 Feb 2018 20:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328901 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328901 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.25 Precedence: list List-Id: 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, 05 Feb 2018 20:37:30 -0000 Author: adrian Date: Mon Feb 5 20:37:29 2018 New Revision: 328901 URL: https://svnweb.freebsd.org/changeset/base/328901 Log: [arswitch] disable ARP copy-to-CPU port for AR9340 for now. I'll have to go double check to see if it does indeed pass ARP frames between switch ports with this disabled, but it seems required for the CPU port to see ARP traffic. I'll dig into this some more. Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c Modified: head/sys/dev/etherswitch/arswitch/arswitch_9340.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 20:30:53 2018 (r328900) +++ head/sys/dev/etherswitch/arswitch/arswitch_9340.c Mon Feb 5 20:37:29 2018 (r328901) @@ -90,9 +90,11 @@ ar9340_atu_learn_default(struct arswitch_softc *sc) arswitch_modifyreg(sc->sc_dev, AR934X_REG_QM_CTRL, AR934X_QM_CTRL_ARP_EN, AR934X_QM_CTRL_ARP_EN); +#if 0 /* Copy frame to CPU port, not just redirect it */ arswitch_modifyreg(sc->sc_dev, AR934X_REG_QM_CTRL, AR934X_QM_CTRL_ARP_COPY_EN, AR934X_QM_CTRL_ARP_COPY_EN); +#endif return (0); } From owner-svn-src-head@freebsd.org Mon Feb 5 21:26:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82E72EF1347; Mon, 5 Feb 2018 21:26:46 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (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 F10668A284; Mon, 5 Feb 2018 21:26:45 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([92.227.81.85]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MgoiC-1eMlC241IG-00M6T2; Mon, 05 Feb 2018 22:26:31 +0100 Date: Mon, 5 Feb 2018 22:25:55 +0100 From: "O. Hartmann" To: Jason Harmening Cc: "O. Hartmann" , David Wolfskill , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328489 - head/sys/conf Message-ID: <20180205222622.43f5d3e7@thor.intern.walstatt.dynvpn.de> In-Reply-To: References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@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_/VM=+vVrQKfdJb0xnMWBnlly"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:2W40jUPsBrc9JQVtU+nkZjmqDGrA4oOsO5TzfK09xjse3pr53bx MYDwH/MszrF8AezZfolnHEjacfLyfDvc9hCADE8ZY1K9aKCbZw8nZDuShpLzzTjHRiL11WF KFsLaUaDZZ0onPBvc24h4cX50Vyh38+tUD/xxBFsnSVKWHx5WO/+a4R8VuEbFllzQA9z1di 18xUSP3Va58470G2AWAwQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:tjDhg+ZyQfo=:akX5zXwpvULNfoclX1xYjx GNl/LuvJBVx4gwmehh+P6LU7Q1XskK7rtJTjGCZDupq/uacrIIROD/ccNoOJ+mJLxZSLC8535 HCPCL6lKOaU0TKIbouAmGOvqi6nYBuVpQXICcQpOMRkPoPm7I1LU1wgazS3GymhA9ksQZ1Qo6 ETK1l91Qy0sexn4WyfVGDvVHxPx0dfoENbyl2hz0EAXq/ZMO16k31tWxA+ZKYIqhtzeu2giiB iee2KtGQiPKSgfUBBYxyBRWFcMU67sngXiYeLay15xOy/BgqZJN1M3YVjgK/hAkMrVy3qbj1/ /k0Ot4rYW5YNzRg1j9Hxllql1tgDYx9nOmcf4B5XyQylgPmoI9YQon55f6Nzq4FoQQS1d6UzG M/Ng69CIvbfMJSmZM1Ax68T12dqqG3ju48iC/kxLXrqyGLF4Y3/+zBGW3q3+zrC+C+V63ywkm sUAPKSeO8q7+a6LPY1a2/c4mjWFghW9wO68i9b+vJSaaPsHk4GKkEn4wmr7gBdhmu2oSnWAKs Wrr79Dy7LVaUb4twea4gOUT6w5fuXY11nHBpL1CY0e3Tz3Lmh8RVXEqm193hw7OFzouLVuws5 18NtADD/wMQ0FVITCX8SVWlFvKFrzrGRkKmd3jvvyefgtv+owBet/h2LTLYZOsSsNNO7aii5+ Fx0RFGN4u6ijvLldGQMPGCRVxehfIBDBsF77YKkRbgI90KDPODvIXyVV6H7hCv/BBW2PNOqCa mUs+lExB2gpWUU1kSX9bUR58HUEXcyEauA+edG1KfJukVNby7wDDEoKjXnJjt25pdxPmc15lR 9hWIBCj4XKP2nKWtxiai9R1C6XDBA== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 05 Feb 2018 21:26:46 -0000 --Sig_/VM=+vVrQKfdJb0xnMWBnlly Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Am Sun, 4 Feb 2018 10:22:31 -0800 Jason Harmening schrieb: > On 02/04/18 04:33, O. Hartmann wrote: > > Am Mon, 29 Jan 2018 05:00:22 -0800 > > David Wolfskill schrieb: > > =20 > >> On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: =20 > >>>> > >>>> This happens now if PORTS_MODULE=3Dx11/nvidia-driver is defined in /= etc/src.conf: > >>>> > >>>> [...] > >>>> --- kernel-install --- > >>>> mkdir -p /boot/kernel > >>>> install -p -m 555 -o root -g wheel kernel /boot/kernel/ > >>>> --- ports-install --- > >>>> Variable OBJTOP is recursive. > >>>> > >>>> make[8]: stopped =20 > >>> ... > >>> > >>> David sent me logs of the failing case; thanks David! =20 > >> > >> Happy to help! :-) > >> =20 > >>> The failure happens when buildkernel and installkernel are run > >>> separately instead of all-up, e.g. 'make kernel'. The installkernel > >>> step is leaving MK_AUTO_OBJ=3Dno in the env passed to the port build.= It > >>> looks like at least one of the install stages of nvidia-driver needs = to > >>> generate temporary output, which leads to confusion when the port isn= 't > >>> built as though it's an in-tree component. > >>> > >>> Can you guys try out the attached patch? =20 > >> > >> I tried it both on my build machine (which does not use kernel modules > >> from ports, and thus did not exhibit the problem -- but I thought that > >> verifying that the patch did not break that case worth checking) and on > >> my laptop (which did exhibit the problem). > >> > >> It worked in both cases with no issues for me. > >> > >> Thanks! :-) > >> > >> Peace, > >> david =20 > >=20 > > The problem still persists! > >=20 > > I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 2018 = amd64, the > > source tree is at revision 328839. > >=20 > >=20 > > I use WITH_META_MODE=3DYES in /etc/src.conf. My /etc/make.conf consists= of a .include > > statement which reels in /usr/local/etc/ports.conf in which I define ev= erything > > outside the source tree for ports (in case of the nvidia driver, its DI= STVERSION). > > This worked before and should work again. Today I checked out a complet= ely > > fresh /usr/src and gleanced the /usr/obj folder and rebuilt the system = - and get the > > error again: > >=20 > > [...] =20 > > =3D=3D=3D> Ports module x11/nvidia-driver (install) =20 > > cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u CP= P -u > > MAKESYSPATH MAKEFLAGS=3D"-j 4 -J 15,16 .MAKE.LEVEL.ENV=3DMAKELEVEL KERN= EL=3Dkernel > > MK_AUTO_OBJ=3Dno =20 > ^^^^^ > Looks like you haven't applied the patch? MK_AUTO_OBJ being left set in= =20 > MAKEFLAGS by installkernel was part of the problem. >=20 > That said, the fix I have up for review is slightly different: > https://reviews.freebsd.org/D14143 >=20 > > TARGET=3Damd64 TARGET_ARCH=3Damd64" SYSDIR=3D/usr/src/sys > > PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/usr/obj/usr/sr= c/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/usr/src/amd64.amd64/tmp/legacy/bi= n:/usr/obj/usr/src/amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tm= p/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin > > SRC_BASE=3D/usr/src OSVERSION=3D1200056 > > WRKDIRPREFIX=3D/usr/obj/usr/src/amd64.amd64/sys/THOR make -B deinstall = reinstall =3D=3D=3D> > > Deinstalling for nvidia-driver =3D=3D=3D> Deinstalling nvidia-driver-= 387.34 Updating > > database digests format: . done Checking integrity... done (0 conflicti= ng) > > Deinstallation has been requested for the following 1 packages (of 0 pa= ckages in the > > universe): > >=20 > > Installed packages to be REMOVED: > > nvidia-driver-387.34 > >=20 > > Number of packages to be removed: 1 > >=20 > > The operation will free 99 MiB. > > [1/1] Deinstalling nvidia-driver-387.34... > > [1/1] Deleting files for nvidia-driver-387.34: .......... done =20 > > =3D=3D=3D> Staging for nvidia-driver-387.34 > > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib/libGL= .so - found > > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/libdata/p= kgconfig/x11.pc - > > found =3D=3D=3D> nvidia-driver-387.34 depends on > > file: /usr/local/libdata/pkgconfig/xorg-server.pc =20 > > - found =3D=3D=3D> nvidia-driver-387.34 depends on > > file: /usr/local/libdata/pkgconfig/xext.pc > > - found =3D=3D=3D> Generating temporary packing list =20 > > =3D=3D=3D> src (install) > > =3D=3D=3D> src/nvidia (install) =20 > > Variable OBJTOP is recursive. > >=20 > > make[8]: stopped > > in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/nvidia-driver= /work/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia > > *** Error code 2 > >=20 > >=20 > >=20 > > Oliver > > =20 make -jX installkernel with the above mentioned setting of PORTS_MODULE=3D = set in /usr/src.conf doesn't wor even on recent CURRENT r328901. make kernel doesn't fail. oh --=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_/VM=+vVrQKfdJb0xnMWBnlly Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWnjL/gAKCRDS528fyFhY lD7RAf9Xd2j2xaDwQ3uzijGFe/YgSD2tW21DJDDUZgvGNE1WMaCyd/ctys4ZSAu7 UBQYAzdXB88tu5FXsYNV9i51eYx9AgCNfJgxbZ9/sVzkrWuqmnkeUF3kwo/IY6gj C/QHiTXsKPNIC2uHK9n6RLEgumnOjsc6MnJjMl7HIpnh+PaS+vbh =MNNn -----END PGP SIGNATURE----- --Sig_/VM=+vVrQKfdJb0xnMWBnlly-- From owner-svn-src-head@freebsd.org Mon Feb 5 21:32:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C79BEF1ACF; Mon, 5 Feb 2018 21:32:06 +0000 (UTC) (envelope-from jason.harmening@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 DA4D18A8B3; Mon, 5 Feb 2018 21:32:05 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id k6so256881ita.3; Mon, 05 Feb 2018 13:32:05 -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=RzJuzoNnBwCPQfEG5h1GskVDsbU3gF6YUlhuW5V/qmk=; b=nSrqlTvZvM/7RFTHhZ0JfaZd1HfReniUuVOftLPZsfIUeJYUOqRIvEom4LEAdD4//B /+PLGKnbnjmxV2gQ0TRu5m4s7JjK8LiFcdJgfsctW6WpR1pwGiaQ+HVNe8U7Y+EKTSSw lHywk+xKA0E8pcnbS+Ykk2+fk9iVdA7cbcTj3/8W8gIOZIDJW2sd4iG6MQqslv1mXXBh +4KC7saq1Ji+tHxv4XlPmZnZ3QFDbCgnmUV7MLe379HzbZxkfNA1AhxX9BHY/8MNpvyy U14RCDCKuU/Cl1EJXOcunBDJGRqgN9jDxUCojvtS4yM7Av1ztU+6jkGLExuf3Ob3F1L+ f06Q== 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=RzJuzoNnBwCPQfEG5h1GskVDsbU3gF6YUlhuW5V/qmk=; b=hkc4imUNRfjOlFwdmEF4zLy0wGX9EQKkRWYyGnryq9U7d2j4ie+cl2+svdc2iYqQ+X AV6lYs2ellbNFhMV8xvgI03EXC5Pt7t9UIw4OGlB54DNzTiQEXMV3AmqxrHBUIKKGNr7 zJo6hELCA17hEbK84+qqqhtAjGEk8fGhmQ4zJDRGsaQZAE2prVXI0DL6ivR8MRJQzb3G XeFly9gv5toUiSZine0dGhjeBLVnzT1ht1x97sgXU6Iv1J8+q99LnVby4cxMurFk5Ayz 3bE3cwq2wJgTwKUkHAy549L6hCM7rZoZptDARQpqAWNYl5sZ47YwIbu8THl24T0UxEc4 tasg== X-Gm-Message-State: APf1xPAmpPtBuOJAa7AUHlMEaUP7l7V4SRv+3NlQZPqPIh4wZW9lNgna 1yDK5ujhwGXjTkienzTVXm5Rw6hQOe+ExcJ7OjIA X-Google-Smtp-Source: AH8x227dPf19eM1quuyajdFueH4/wCfNBmJuVpu6Sb78C2Jg4hAnp0tJB8GNYzH2pDT3VSnjfm8YOk9rTxFnMEyGCjA= X-Received: by 10.36.2.213 with SMTP id 204mr179660itu.121.1517866324996; Mon, 05 Feb 2018 13:32:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.136.103 with HTTP; Mon, 5 Feb 2018 13:32:04 -0800 (PST) In-Reply-To: <20180205222622.43f5d3e7@thor.intern.walstatt.dynvpn.de> References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> <20180205222622.43f5d3e7@thor.intern.walstatt.dynvpn.de> From: Jason Harmening Date: Mon, 5 Feb 2018 13:32:04 -0800 Message-ID: Subject: Re: svn commit: r328489 - head/sys/conf To: "O. Hartmann" Cc: David Wolfskill , src-committers@freebsd.org, 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 05 Feb 2018 21:32:06 -0000 On Mon, Feb 5, 2018 at 1:25 PM, O. Hartmann wrote: > Am Sun, 4 Feb 2018 10:22:31 -0800 > Jason Harmening schrieb: > > > On 02/04/18 04:33, O. Hartmann wrote: > > > Am Mon, 29 Jan 2018 05:00:22 -0800 > > > David Wolfskill schrieb: > > > > > >> On Mon, Jan 29, 2018 at 02:10:04AM -0800, Jason Harmening wrote: > > >>>> > > >>>> This happens now if PORTS_MODULE=3Dx11/nvidia-driver is defined in > /etc/src.conf: > > >>>> > > >>>> [...] > > >>>> --- kernel-install --- > > >>>> mkdir -p /boot/kernel > > >>>> install -p -m 555 -o root -g wheel kernel /boot/kernel/ > > >>>> --- ports-install --- > > >>>> Variable OBJTOP is recursive. > > >>>> > > >>>> make[8]: stopped > > >>> ... > > >>> > > >>> David sent me logs of the failing case; thanks David! > > >> > > >> Happy to help! :-) > > >> > > >>> The failure happens when buildkernel and installkernel are run > > >>> separately instead of all-up, e.g. 'make kernel'. The installkerne= l > > >>> step is leaving MK_AUTO_OBJ=3Dno in the env passed to the port buil= d. > It > > >>> looks like at least one of the install stages of nvidia-driver need= s > to > > >>> generate temporary output, which leads to confusion when the port > isn't > > >>> built as though it's an in-tree component. > > >>> > > >>> Can you guys try out the attached patch? > > >> > > >> I tried it both on my build machine (which does not use kernel modul= es > > >> from ports, and thus did not exhibit the problem -- but I thought th= at > > >> verifying that the patch did not break that case worth checking) and > on > > >> my laptop (which did exhibit the problem). > > >> > > >> It worked in both cases with no issues for me. > > >> > > >> Thanks! :-) > > >> > > >> Peace, > > >> david > > > > > > The problem still persists! > > > > > > I'm on CURRENT, FreeBSD 12.0-CURRENT #32: Sun Feb 4 09:41:39 CET 201= 8 > amd64, the > > > source tree is at revision 328839. > > > > > > > > > I use WITH_META_MODE=3DYES in /etc/src.conf. My /etc/make.conf consis= ts > of a .include > > > statement which reels in /usr/local/etc/ports.conf in which I define > everything > > > outside the source tree for ports (in case of the nvidia driver, its > DISTVERSION). > > > This worked before and should work again. Today I checked out a > completely > > > fresh /usr/src and gleanced the /usr/obj folder and rebuilt the syste= m > - and get the > > > error again: > > > > > > [...] > > > =3D=3D=3D> Ports module x11/nvidia-driver (install) > > > cd ${PORTSDIR:-/usr/ports}/x11/nvidia-driver; env -u CC -u CXX -u > CPP -u > > > MAKESYSPATH MAKEFLAGS=3D"-j 4 -J 15,16 .MAKE.LEVEL.ENV=3DMAKELEVEL > KERNEL=3Dkernel > > > MK_AUTO_OBJ=3Dno > > ^^^= ^^ > > Looks like you haven't applied the patch? MK_AUTO_OBJ being left set i= n > > MAKEFLAGS by installkernel was part of the problem. > > > > That said, the fix I have up for review is slightly different: > > https://reviews.freebsd.org/D14143 > > > > > TARGET=3Damd64 TARGET_ARCH=3Damd64" SYSDIR=3D/usr/src/sys > > > PATH=3D/usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/sbin:/ > usr/obj/usr/src/amd64.amd64/tmp/legacy/usr/bin:/usr/obj/ > usr/src/amd64.amd64/tmp/legacy/bin:/usr/obj/usr/src/ > amd64.amd64/tmp/usr/sbin:/usr/obj/usr/src/amd64.amd64/tmp/ > usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin > > > SRC_BASE=3D/usr/src OSVERSION=3D1200056 > > > WRKDIRPREFIX=3D/usr/obj/usr/src/amd64.amd64/sys/THOR make -B deinstal= l > reinstall =3D=3D=3D> > > > Deinstalling for nvidia-driver =3D=3D=3D> Deinstalling > nvidia-driver-387.34 Updating > > > database digests format: . done Checking integrity... done (0 > conflicting) > > > Deinstallation has been requested for the following 1 packages (of 0 > packages in the > > > universe): > > > > > > Installed packages to be REMOVED: > > > nvidia-driver-387.34 > > > > > > Number of packages to be removed: 1 > > > > > > The operation will free 99 MiB. > > > [1/1] Deinstalling nvidia-driver-387.34... > > > [1/1] Deleting files for nvidia-driver-387.34: .......... done > > > =3D=3D=3D> Staging for nvidia-driver-387.34 > > > =3D=3D=3D> nvidia-driver-387.34 depends on file: /usr/local/lib/lib= GL.so - > found > > > =3D=3D=3D> nvidia-driver-387.34 depends on file: > /usr/local/libdata/pkgconfig/x11.pc - > > > found =3D=3D=3D> nvidia-driver-387.34 depends on > > > file: /usr/local/libdata/pkgconfig/xorg-server.pc > > > - found =3D=3D=3D> nvidia-driver-387.34 depends on > > > file: /usr/local/libdata/pkgconfig/xext.pc > > > - found =3D=3D=3D> Generating temporary packing list > > > =3D=3D=3D> src (install) > > > =3D=3D=3D> src/nvidia (install) > > > Variable OBJTOP is recursive. > > > > > > make[8]: stopped > > > in /usr/obj/usr/src/amd64.amd64/sys/DUMMBOX/usr/ports/x11/ > nvidia-driver/work/NVIDIA-FreeBSD-x86_64-387.34/src/nvidia > > > *** Error code 2 > > > > > > > > > > > > Oliver > > > > > make -jX installkernel with the above mentioned setting of PORTS_MODULE= =3D > set > in /usr/src.conf doesn't wor even on recent CURRENT r328901. > > make kernel doesn't fail. > Yes, that is because there is a patch, included in an earlier email, which fixes this failure and hasn't yet made it into the tree. Based on the fact that I can see MK_AUTO_OBJ=3Dno in your installkernel output, it looks like you haven't applied the patch to your src tree. Can you try downloading the raw diff from https://reviews.freebsd.org/D14143 and applying that to src? > > > oh > > -- > 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 Ab= s. 4 BDSG). > From owner-svn-src-head@freebsd.org Mon Feb 5 21:37:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5F4CEF2047; Mon, 5 Feb 2018 21:37:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::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 380A28ACAB; Mon, 5 Feb 2018 21:37:42 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x229.google.com with SMTP id f4so243706ioh.8; Mon, 05 Feb 2018 13:37:42 -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=QW+yJ5iaBtbwQuCYd8sEa7b73RDcT6d6PyUT2jG74/o=; b=Rxf1ZstoBURdpE2L2BVRtY20ETwG+9rsu/qK4OuAjHAklWZzd73Pv+LvJR1WBO/u20 kvDZM7aMHZ5YofNLY1/9UowkY12ekkuzu8sILXNp9RG6Fbr8gcOv9HY3dPX79B0wVX4O Qg5pviOc7dFnBTFPtCRuekN6otRxlGUWSHg9zLdOxyHlAx5ORk1qew7MUuRGPw3tqtdY ndPNl/RFr9zGSfXdOVRBVNeuNH9g7Rq8R0HHvxNb3o7nGYzqGCLt4okJJqaBGTRPnGf6 ae0uaCdr1SPS2NdwZN0PpDeJd0dM2xLNy+WEiGD7zooELmKpYaBXI4kPp7PLMPpov7gC /N+Q== 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=QW+yJ5iaBtbwQuCYd8sEa7b73RDcT6d6PyUT2jG74/o=; b=dX/YUiNtBZ1xP8MoZ4foawUWAfQWrny8IcMHAFW6rk2WUinWupIT2pYN0b+IkYMV14 wDUPG+QyYtakTIXdwcwEtzp+mbLFTgGHKLieKyna/l4yvbb3CJwrld/EPua+szv9kovj NVPRWfyP+FqHQaNuoJPwgrMv7JpI0wptufPU7R+cVjtTYrDRqFCooiIFd1uEbe1SYToK 73mv5MCXKQPeaZROXfkqCRj1QQVGIHiq2vAjbzOuHMAwrYEJ0C8dNPJ9GbllZC5IA5/R PHHHIjWl0gC+rF9bGVqmgGBcWNFFVCrDRTzQfqyPOV0hCGOtuHEhkXL9bMjF6kD7gpHT iIVA== X-Gm-Message-State: APf1xPBepzglNxZWzL3zNcVjcGCaloAS7F+9sL2qQEzKEBQgJctWQMyT 5HmPdujXhoqIm9ZPFvZaihJ/NB21yftG4Y4aq/qRUttu X-Google-Smtp-Source: AH8x226PGmXpt1dlLJr6huXP6obTSTcv7HcxJ2kjHWmAh2zboJUjmZWToCI9hVSX3vDgTBy5OmQRCnlt8w1jkoT7oCU= X-Received: by 10.107.173.225 with SMTP id m94mr337674ioo.36.1517866661432; Mon, 05 Feb 2018 13:37:41 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.152.9 with HTTP; Mon, 5 Feb 2018 13:37:20 -0800 (PST) In-Reply-To: <3114578.qyyx4qh6ii@ralph.baldwin.cx> References: <201801302329.w0UNTRHn080138@repo.freebsd.org> <3195814.6PcFLP86qD@ralph.baldwin.cx> <3114578.qyyx4qh6ii@ralph.baldwin.cx> From: Ed Maste Date: Mon, 5 Feb 2018 16:37:20 -0500 X-Google-Sender-Auth: htCGaSOla4NRi3BPQqmLra8JXJ8 Message-ID: Subject: Re: svn commit: r328610 - head/sys/amd64/amd64 To: John Baldwin Cc: Wojciech Macek , 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.25 Precedence: list List-Id: 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, 05 Feb 2018 21:37:42 -0000 On 31 January 2018 at 11:14, John Baldwin wrote: > On Wednesday, January 31, 2018 10:31:36 AM Ed Maste wrote: >> On 30 January 2018 at 21:01, John Baldwin wrote: >> > On Tuesday, January 30, 2018 11:29:27 PM John Baldwin wrote: >> >> Author: jhb >> >> Date: Tue Jan 30 23:29:27 2018 >> >> New Revision: 328610 >> >> URL: https://svnweb.freebsd.org/changeset/base/328610 >> >> >> >> Log: >> >> Ensure 'name' is not NULL before passing to strcmp(). >> >> >> >> This avoids a nested page fault when obtaining a stack trace in DDB if >> >> the address from the first frame does not resolve to a known symbol. >> >> >> >> MFC after: 1 week >> >> Sponsored by: Chelsio Communications >> > >> > This appears to be fallout from lld? After fixing this, the stack trace >> > for my next panic shows no symbols for functions in the kernel, only >> > functions in kernel modules: >> >> It's fallout from loader changes in r328536. I reverted r328536 (and >> r328603) locally and stack traces are fixed. > > Ouch. I'll try to look at this later today unless someone else beats me to > it. I committed a band-aid fix in r328826 but it still needs more investigation / proper fix. From owner-svn-src-head@freebsd.org Mon Feb 5 23:27:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B59CED7202; Mon, 5 Feb 2018 23:27:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE868F307; Mon, 5 Feb 2018 23:27:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4391E79B5; Mon, 5 Feb 2018 23:27:43 +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 w15NRh28048723; Mon, 5 Feb 2018 23:27:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15NRhpr048722; Mon, 5 Feb 2018 23:27:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802052327.w15NRhpr048722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Feb 2018 23:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328909 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328909 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.25 Precedence: list List-Id: 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, 05 Feb 2018 23:27:43 -0000 Author: jhb Date: Mon Feb 5 23:27:42 2018 New Revision: 328909 URL: https://svnweb.freebsd.org/changeset/base/328909 Log: Always give ELF brands a chance to veto a match. If a brand provides a header_supported hook, check it when trying to find a brand based on a matching interpreter as well as in the final loop for the fallback brand. Previously a brand might reject a binary via a header_supported hook in one of the earlier loops, but still be chosen by one of these later loops. Reviewed by: kib Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D13945 Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Feb 5 23:14:20 2018 (r328908) +++ head/sys/kern/imgact_elf.c Mon Feb 5 23:27:42 2018 (r328909) @@ -321,7 +321,7 @@ __elfN(get_brandinfo)(struct image_params *imgp, const strcmp((const char *)&hdr->e_ident[OLD_EI_BRAND], bi->compat_3_brand) == 0))) { /* Looks good, but give brand a chance to veto */ - if (!bi->header_supported || + if (bi->header_supported == NULL || bi->header_supported(imgp)) { /* * Again, prefer strictly matching @@ -369,7 +369,8 @@ __elfN(get_brandinfo)(struct image_params *imgp, const /* ELF image p_filesz includes terminating zero */ strlen(bi->interp_path) + 1 == interp_name_len && strncmp(interp, bi->interp_path, interp_name_len) - == 0) + == 0 && (bi->header_supported == NULL || + bi->header_supported(imgp))) return (bi); } } @@ -381,7 +382,9 @@ __elfN(get_brandinfo)(struct image_params *imgp, const (interp != NULL && (bi->flags & BI_BRAND_ONLY_STATIC) != 0)) continue; if (hdr->e_machine == bi->machine && - __elfN(fallback_brand) == bi->brand) + __elfN(fallback_brand) == bi->brand && + (bi->header_supported == NULL || + bi->header_supported(imgp))) return (bi); } return (NULL); From owner-svn-src-head@freebsd.org Mon Feb 5 23:29:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31295ED7445; Mon, 5 Feb 2018 23:29:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7ABF8F4B0; Mon, 5 Feb 2018 23:29:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDFE179B9; Mon, 5 Feb 2018 23:29:50 +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 w15NToQA048868; Mon, 5 Feb 2018 23:29:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15NTo03048867; Mon, 5 Feb 2018 23:29:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802052329.w15NTo03048867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Feb 2018 23:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328910 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 328910 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.25 Precedence: list List-Id: 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, 05 Feb 2018 23:29:51 -0000 Author: jhb Date: Mon Feb 5 23:29:50 2018 New Revision: 328910 URL: https://svnweb.freebsd.org/changeset/base/328910 Log: Fix a typo. Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Mon Feb 5 23:27:42 2018 (r328909) +++ head/share/man/man7/arch.7 Mon Feb 5 23:29:50 2018 (r328910) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 31, 2018 +.Dd February 5, 2018 .Dt ARCH 7 .Os .Sh NAME @@ -416,7 +416,7 @@ imply little endian. If we ever were to support the so-called x32 ABI (using 32-bit pointers on the amd64 architecture), it would most likely be encoded as amd64-x32. -It is unfortunate that amd64 speifies the 64-bit evolution of the x86 +It is unfortunate that amd64 specifies the 64-bit evolution of the x86 platform (it matches the 'first rule') as everybody else uses x86_64. There is no standard name for the processor: each OS selects its own conventions. From owner-svn-src-head@freebsd.org Mon Feb 5 23:35:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8103ED7C8C; Mon, 5 Feb 2018 23:35:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77B188F9D5; Mon, 5 Feb 2018 23:35:34 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68FCE7B56; Mon, 5 Feb 2018 23:35:34 +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 w15NZYBg053649; Mon, 5 Feb 2018 23:35:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15NZYpI053647; Mon, 5 Feb 2018 23:35:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802052335.w15NZYpI053647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Feb 2018 23:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328911 - in head: stand/common sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: stand/common sys/kern X-SVN-Commit-Revision: 328911 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.25 Precedence: list List-Id: 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, 05 Feb 2018 23:35:35 -0000 Author: jhb Date: Mon Feb 5 23:35:33 2018 New Revision: 328911 URL: https://svnweb.freebsd.org/changeset/base/328911 Log: Ignore relocation tables for non-memory-resident sections. As a followup to r328101, ignore relocation tables for ELF object sections that are not memory resident. For modules loaded by the loader, ignore relocation tables whose associated section was not loaded by the loader (sh_addr is zero). For modules loaded at runtime via kldload(2), ignore relocation tables whose associated section is not marked with SHF_ALLOC. Reported by: Mori Hiroki , adrian Tested on: mips, mips64 MFC after: 1 month Sponsored by: DARPA / AFRL Modified: head/stand/common/load_elf_obj.c head/sys/kern/link_elf_obj.c Modified: head/stand/common/load_elf_obj.c ============================================================================== --- head/stand/common/load_elf_obj.c Mon Feb 5 23:29:50 2018 (r328910) +++ head/stand/common/load_elf_obj.c Mon Feb 5 23:35:33 2018 (r328911) @@ -282,6 +282,8 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f switch (shdr[i].sh_type) { case SHT_REL: case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; lastaddr = roundup(lastaddr, shdr[i].sh_addralign); shdr[i].sh_addr = (Elf_Addr)lastaddr; lastaddr += shdr[i].sh_size; Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Mon Feb 5 23:29:50 2018 (r328910) +++ head/sys/kern/link_elf_obj.c Mon Feb 5 23:35:33 2018 (r328911) @@ -272,9 +272,17 @@ link_elf_link_preload(linker_class_t cls, const char * symstrindex = shdr[i].sh_link; break; case SHT_REL: + /* + * Ignore relocation tables for sections not + * loaded by the loader. + */ + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->nreltab++; break; case SHT_RELA: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->nrelatab++; break; } @@ -398,12 +406,16 @@ link_elf_link_preload(linker_class_t cls, const char * pb++; break; case SHT_REL: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->reltab[rl].rel = (Elf_Rel *)shdr[i].sh_addr; ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); ef->reltab[rl].sec = shdr[i].sh_info; rl++; break; case SHT_RELA: + if (shdr[shdr[i].sh_info].sh_addr == 0) + break; ef->relatab[ra].rela = (Elf_Rela *)shdr[i].sh_addr; ef->relatab[ra].nrela = shdr[i].sh_size / sizeof(Elf_Rela); @@ -620,9 +632,17 @@ link_elf_load_file(linker_class_t cls, const char *fil symstrindex = shdr[i].sh_link; break; case SHT_REL: + /* + * Ignore relocation tables for unallocated + * sections. + */ + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->nreltab++; break; case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->nrelatab++; break; case SHT_STRTAB: @@ -880,6 +900,8 @@ link_elf_load_file(linker_class_t cls, const char *fil pb++; break; case SHT_REL: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->reltab[rl].rel = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel); @@ -898,6 +920,8 @@ link_elf_load_file(linker_class_t cls, const char *fil rl++; break; case SHT_RELA: + if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0) + break; ef->relatab[ra].rela = malloc(shdr[i].sh_size, M_LINKER, M_WAITOK); ef->relatab[ra].nrela = From owner-svn-src-head@freebsd.org Mon Feb 5 23:38:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 983CAED805E; Mon, 5 Feb 2018 23:38:16 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48EB18FBD3; Mon, 5 Feb 2018 23:38:16 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F5E47B5A; Mon, 5 Feb 2018 23:38:16 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w15NcGE9053833; Mon, 5 Feb 2018 23:38:16 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w15NcFfD053829; Mon, 5 Feb 2018 23:38:15 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201802052338.w15NcFfD053829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Mon, 5 Feb 2018 23:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328912 - in head: share/man/man4 sys/conf sys/dev/bhnd sys/dev/bwn sys/dev/siba sys/gnu/dev/bwn/phy_n sys/modules sys/modules/bwn sys/modules/bwn_pci sys/modules/siba_bwn X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/bhnd sys/dev/bwn sys/dev/siba sys/gnu/dev/bwn/phy_n sys/modules sys/modules/bwn sys/modules/bwn_pci sys/modules/siba_bwn X-SVN-Commit-Revision: 328912 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.25 Precedence: list List-Id: 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, 05 Feb 2018 23:38:17 -0000 Author: landonf Date: Mon Feb 5 23:38:15 2018 New Revision: 328912 URL: https://svnweb.freebsd.org/changeset/base/328912 Log: bwn(4): migrate bwn(4) to the native bhnd(9) interface, and drop siba_bwn. - Remove the shim interface that allowed bwn(4) to use either siba_bwn or bhnd(4), replacing all siba_bwn calls with their bhnd(4) bus equivalents. - Drop the legay, now-unused siba_bwn bus driver. - Clean up bhnd(4) board flag defines referenced by bwn(4). Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13518 Added: head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.c (contents, props changed) head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_sprom.h (contents, props changed) Deleted: head/sys/dev/bwn/if_bwn_bhnd.c head/sys/dev/bwn/if_bwn_chipid.h head/sys/dev/bwn/if_bwn_siba.c head/sys/dev/bwn/if_bwn_siba.h head/sys/dev/bwn/if_bwn_siba_compat.c head/sys/dev/bwn/if_bwn_siba_compat.h head/sys/dev/siba/ head/sys/modules/bwn_pci/ head/sys/modules/siba_bwn/ Modified: head/share/man/man4/bwn.4 head/sys/conf/files head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bwn/if_bwn.c head/sys/dev/bwn/if_bwn_misc.h head/sys/dev/bwn/if_bwn_pci.c head/sys/dev/bwn/if_bwn_phy_common.c head/sys/dev/bwn/if_bwn_phy_common.h head/sys/dev/bwn/if_bwn_phy_g.c head/sys/dev/bwn/if_bwn_phy_lp.c head/sys/dev/bwn/if_bwn_phy_n.c head/sys/dev/bwn/if_bwn_util.c head/sys/dev/bwn/if_bwnreg.h head/sys/dev/bwn/if_bwnvar.h head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.c head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_core.h head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_ppr.c head/sys/gnu/dev/bwn/phy_n/if_bwn_phy_n_tables.c head/sys/modules/Makefile head/sys/modules/bwn/Makefile Modified: head/share/man/man4/bwn.4 ============================================================================== --- head/share/man/man4/bwn.4 Mon Feb 5 23:35:33 2018 (r328911) +++ head/share/man/man4/bwn.4 Mon Feb 5 23:38:15 2018 (r328912) @@ -24,26 +24,29 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2015 +.Dd December 16, 2017 .Dt BWN 4 .Os .Sh NAME .Nm bwn -.Nd Broadcom BCM43xx IEEE 802.11b/g wireless network driver +.Nd Broadcom BCM43xx SoftMAC IEEE 802.11 wireless network driver .Sh SYNOPSIS -To compile this driver into the kernel, -place the following lines in your -kernel configuration file: +To compile this driver into the kernel, add the following lines to the kernel +configuration file: .Bd -ragged -offset indent -.Cd "device siba_bwn" .Cd "device bwn" +.Cd "device bhnd" +.Cd "device bhndb" +.Cd "device bhndb_pci" +.Cd "device bcma" +.Cd "device siba" +.Cd "device gpio" .Cd "device wlan" .Cd "device wlan_amrr" .Cd "device firmware" .Ed .Pp -Alternatively, to load the driver as a -module at boot time, place the following line in +To load the driver as a module at boot, add the following lines to .Xr loader.conf 5 : .Bd -literal -offset indent if_bwn_load="YES" @@ -122,9 +125,6 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.bwn.msi_disable -This tunable disables MSI support on the hardware. -The default value is 0. .It Va hw.bwn.usedma This tunable enables DMA operations on the hardware. If the value is 0, PIO mode would be used. @@ -132,10 +132,14 @@ The default value is 1. .El .Sh SEE ALSO .Xr arp 4 , +.Xr bcma 4 , +.Xr bhnd 4 , +.Xr bhndb 4 , .Xr bwi 4 , .Xr cardbus 4 , .Xr intro 4 , .Xr pci 4 , +.Xr siba 4 , .Xr wlan 4 , .Xr wlan_amrr 4 , .Xr ifconfig 8 , @@ -145,12 +149,20 @@ The .Nm driver first appeared in .Fx 8.1 . +The driver was updated to support the common Broadcom +.Xr bhnd 4 +bus interface in +.Fx 12.0 . .Sh AUTHORS .An -nosplit The .Nm driver was written by .An Weongyo Jeong Aq Mt weongyo@FreeBSD.org . +Support for +.Xr bhnd 4 +was added by +.An Landon Fuller Aq Mt landonf@FreeBSD.org . .\".Sh BUGS .\"Some card based on the BCM4306 and BCM4309 chips do not work properly .\"on channel 1, 2 and 3. Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Feb 5 23:35:33 2018 (r328911) +++ head/sys/conf/files Mon Feb 5 23:38:15 2018 (r328912) @@ -1250,9 +1250,9 @@ dev/bhnd/bhndb/bhndb.c optional bhndb bhnd dev/bhnd/bhndb/bhndb_bus_if.m optional bhndb bhnd dev/bhnd/bhndb/bhndb_hwdata.c optional bhndb bhnd dev/bhnd/bhndb/bhndb_if.m optional bhndb bhnd -dev/bhnd/bhndb/bhndb_pci.c optional bhndb bhnd pci -dev/bhnd/bhndb/bhndb_pci_hwdata.c optional bhndb bhnd pci -dev/bhnd/bhndb/bhndb_pci_sprom.c optional bhndb bhnd pci +dev/bhnd/bhndb/bhndb_pci.c optional bhndb_pci bhndb bhnd pci +dev/bhnd/bhndb/bhndb_pci_hwdata.c optional bhndb_pci bhndb bhnd pci +dev/bhnd/bhndb/bhndb_pci_sprom.c optional bhndb_pci bhndb bhnd pci dev/bhnd/bhndb/bhndb_subr.c optional bhndb bhnd dev/bhnd/bcma/bcma.c optional bcma bhnd dev/bhnd/bcma/bcma_bhndb.c optional bcma bhnd bhndb @@ -1327,19 +1327,16 @@ dev/bwi/bwirf.c optional bwi dev/bwi/if_bwi.c optional bwi dev/bwi/if_bwi_pci.c optional bwi pci # XXX Work around clang warnings, until maintainer approves fix. -dev/bwn/if_bwn.c optional bwn siba_bwn \ +dev/bwn/if_bwn.c optional bwn bhnd \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" -dev/bwn/if_bwn_bhnd.c optional bwn bhnd -dev/bwn/if_bwn_pci.c optional bwn pci bhnd bhndb -dev/bwn/if_bwn_phy_common.c optional bwn siba_bwn -dev/bwn/if_bwn_phy_g.c optional bwn siba_bwn \ +dev/bwn/if_bwn_pci.c optional bwn pci bhnd bhndb bhndb_pci +dev/bwn/if_bwn_phy_common.c optional bwn bhnd +dev/bwn/if_bwn_phy_g.c optional bwn bhnd \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED} ${NO_WCONSTANT_CONVERSION}" -dev/bwn/if_bwn_phy_lp.c optional bwn siba_bwn \ +dev/bwn/if_bwn_phy_lp.c optional bwn bhnd \ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}" -dev/bwn/if_bwn_phy_n.c optional bwn siba_bwn -dev/bwn/if_bwn_siba.c optional bwn siba_bwn -dev/bwn/if_bwn_siba_compat.c optional bwn bhnd !bwn_use_siba -dev/bwn/if_bwn_util.c optional bwn siba_bwn +dev/bwn/if_bwn_phy_n.c optional bwn bhnd +dev/bwn/if_bwn_util.c optional bwn bhnd dev/cardbus/cardbus.c optional cardbus dev/cardbus/cardbus_cis.c optional cardbus dev/cardbus/cardbus_device.c optional cardbus @@ -3020,8 +3017,6 @@ dev/sdhci/sdhci_acpi.c optional sdhci acpi dev/sdhci/sdhci_pci.c optional sdhci pci dev/sf/if_sf.c optional sf pci dev/sge/if_sge.c optional sge pci -dev/siba/siba_bwn.c optional siba_bwn pci -dev/siba/siba_core.c optional siba_bwn pci dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci dev/sk/if_sk.c optional sk pci Modified: head/sys/dev/bhnd/bhnd_ids.h ============================================================================== --- head/sys/dev/bhnd/bhnd_ids.h Mon Feb 5 23:35:33 2018 (r328911) +++ head/sys/dev/bhnd/bhnd_ids.h Mon Feb 5 23:38:15 2018 (r328912) @@ -69,6 +69,7 @@ /* PCI vendor IDs */ +#define PCI_VENDOR_ASUSTEK 0x1043 #define PCI_VENDOR_EPIGRAM 0xfeda #define PCI_VENDOR_BROADCOM 0x14e4 #define PCI_VENDOR_3COM 0x10b7 @@ -78,6 +79,8 @@ #define PCI_VENDOR_DELL 0x1028 #define PCI_VENDOR_HP 0x103c #define PCI_VENDOR_HP_COMPAQ 0x0e11 +#define PCI_VENDOR_LINKSYS 0x1737 +#define PCI_VENDOR_MOTOROLA 0x1057 #define PCI_VENDOR_APPLE 0x106b #define PCI_VENDOR_SI_IMAGE 0x1095 /* Silicon Image, used by Arasan SDIO Host */ #define PCI_VENDOR_BUFFALO 0x1154 /* Buffalo vendor id */ @@ -581,10 +584,10 @@ #define BHND_BFL_LNLDO2_2P5 0x04000000 /* Select 2.5V as LNLDO2 output voltage */ #define BHND_BFL_FASTPWR 0x08000000 #define BHND_BFL_UCPWRCTL_MININDX 0x08000000 /* Enforce min power index to avoid FEM damage */ -#define BHND_BFL_EXTLNA_5GHz 0x10000000 /* Board has an external LNA in 5GHz band */ -#define BHND_BFL_TRSW_1by2 0x20000000 /* Board has 2 TRSW's in 1by2 designs */ +#define BHND_BFL_EXTLNA_5GHZ 0x10000000 /* Board has an external LNA in 5GHz band */ +#define BHND_BFL_TRSW_1BY2 0x20000000 /* Board has 2 TRSW's in 1by2 designs */ #define BHND_BFL_GAINBOOSTA01 0x20000000 /* 5g Gainboost for core0 and core1 */ -#define BHND_BFL_LO_TRSW_R_5GHz 0x40000000 /* In 5G do not throw TRSW to T for clipLO gain */ +#define BHND_BFL_LO_TRSW_R_5GHZ 0x40000000 /* In 5G do not throw TRSW to T for clipLO gain */ #define BHND_BFL_ELNA_GAINDEF 0x80000000 /* Backoff InitGain based on elna_2g/5g field * when this flag is set */ @@ -644,7 +647,7 @@ #define BHND_BFL_SROM11_BTCOEX 0x00000001 /* Board supports BTCOEX */ #define BHND_BFL_SROM11_WLAN_BT_SH_XTL 0x00000002 /* bluetooth and wlan share same crystal */ #define BHND_BFL_SROM11_EXTLNA 0x00001000 /* Board has an external LNA in 2.4GHz band */ -#define BHND_BFL_SROM11_EXTLNA_5GHz 0x10000000 /* Board has an external LNA in 5GHz band */ +#define BHND_BFL_SROM11_EXTLNA_5GHZ 0x10000000 /* Board has an external LNA in 5GHz band */ #define BHND_BFL_SROM11_GAINBOOSTA01 0x20000000 /* 5g Gainboost for core0 and core1 */ #define BHND_BFL2_SROM11_APLL_WAR 0x00000002 /* Flag to implement alternative A-band PLL settings */ #define BHND_BFL2_SROM11_ANAPACTRL_2G 0x00100000 /* 2G ext PAs are ctrl-ed by analog PA ctrl lines */ Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Mon Feb 5 23:35:33 2018 (r328911) +++ head/sys/dev/bwn/if_bwn.c Mon Feb 5 23:38:15 2018 (r328912) @@ -2,7 +2,12 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2009-2010 Weongyo Jeong + * Copyright (c) 2016 Landon Fuller + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. + * + * Portions of this software were developed by Landon Fuller + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -65,17 +71,18 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include #include #include #include #include -#include +#include +#include +#include +#include + #include #include @@ -87,6 +94,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include "bhnd_nvram_map.h" + +#include "gpio_if.h" + static SYSCTL_NODE(_hw, OID_AUTO, bwn, CTLFLAG_RD, 0, "Broadcom driver parameters"); @@ -109,8 +120,6 @@ SYSCTL_INT(_hw_bwn, OID_AUTO, bluetooth, CTLFLAG_RW, & static int bwn_hwpctl = 0; SYSCTL_INT(_hw_bwn, OID_AUTO, hwpctl, CTLFLAG_RW, &bwn_hwpctl, 0, "uses H/W power control"); -static int bwn_msi_disable = 0; /* MSI disabled */ -TUNABLE_INT("hw.bwn.msi_disable", &bwn_msi_disable); static int bwn_usedma = 1; SYSCTL_INT(_hw_bwn, OID_AUTO, usedma, CTLFLAG_RD, &bwn_usedma, 0, "uses DMA"); @@ -121,6 +130,8 @@ SYSCTL_INT(_hw_bwn, OID_AUTO, wme, CTLFLAG_RW, &bwn_wm static void bwn_attach_pre(struct bwn_softc *); static int bwn_attach_post(struct bwn_softc *); +static int bwn_retain_bus_providers(struct bwn_softc *sc); +static void bwn_release_bus_providers(struct bwn_softc *sc); static void bwn_sprom_bugfixes(device_t); static int bwn_init(struct bwn_softc *); static void bwn_parent(struct ieee80211com *); @@ -153,6 +164,7 @@ static struct ieee80211vap *bwn_vap_create(struct ieee const uint8_t [IEEE80211_ADDR_LEN]); static void bwn_vap_delete(struct ieee80211vap *); static void bwn_stop(struct bwn_softc *); +static int bwn_core_forceclk(struct bwn_mac *, bool); static int bwn_core_init(struct bwn_mac *); static void bwn_core_start(struct bwn_mac *); static void bwn_core_exit(struct bwn_mac *); @@ -211,8 +223,6 @@ static struct bwn_pio_txqueue *bwn_pio_parse_cookie(st uint16_t, struct bwn_pio_txpkt **); static void bwn_dma_init(struct bwn_mac *); static void bwn_dma_rxdirectfifo(struct bwn_mac *, int, uint8_t); -static int bwn_dma_mask2type(uint64_t); -static uint64_t bwn_dma_mask(struct bwn_mac *); static uint16_t bwn_dma_base(int, int); static void bwn_dma_ringfree(struct bwn_dma_ring **); static void bwn_dma_32_getdesc(struct bwn_dma_ring *, @@ -248,7 +258,6 @@ static int bwn_dma_rx_reset(struct bwn_mac *, uint16_t static void bwn_dma_free_descbuf(struct bwn_dma_ring *, struct bwn_dmadesc_meta *); static void bwn_dma_set_redzone(struct bwn_dma_ring *, struct mbuf *); -static int bwn_dma_gettype(struct bwn_mac *); static void bwn_dma_ring_addr(void *, bus_dma_segment_t *, int, int); static int bwn_dma_freeslot(struct bwn_dma_ring *); static int bwn_dma_nextslot(struct bwn_dma_ring *, int); @@ -270,7 +279,7 @@ static struct bwn_dma_ring *bwn_dma_select(struct bwn_ uint8_t); static int bwn_dma_attach(struct bwn_mac *); static struct bwn_dma_ring *bwn_dma_ringsetup(struct bwn_mac *, - int, int, int); + int, int); static struct bwn_dma_ring *bwn_dma_parse_cookie(struct bwn_mac *, const struct bwn_txstatus *, uint16_t, int *); static void bwn_dma_free(struct bwn_mac *); @@ -296,7 +305,7 @@ static void bwn_phy_exit(struct bwn_mac *); static void bwn_core_stop(struct bwn_mac *); static int bwn_switch_band(struct bwn_softc *, struct ieee80211_channel *); -static void bwn_phy_reset(struct bwn_mac *); +static int bwn_phy_reset(struct bwn_mac *); static int bwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void bwn_set_pretbtt(struct bwn_mac *); static int bwn_intr(void *); @@ -346,7 +355,7 @@ static void bwn_watchdog(void *); static void bwn_dma_stop(struct bwn_mac *); static void bwn_pio_stop(struct bwn_mac *); static void bwn_dma_ringstop(struct bwn_dma_ring **); -static void bwn_led_attach(struct bwn_mac *); +static int bwn_led_attach(struct bwn_mac *); static void bwn_led_newstate(struct bwn_mac *, enum ieee80211_state); static void bwn_led_event(struct bwn_mac *, int); static void bwn_led_blink_start(struct bwn_mac *, int, int); @@ -357,16 +366,6 @@ static void bwn_rf_turnon(struct bwn_mac *); static void bwn_rf_turnoff(struct bwn_mac *); static void bwn_sysctl_node(struct bwn_softc *); -static struct resource_spec bwn_res_spec_legacy[] = { - { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, - { -1, 0, 0 } -}; - -static struct resource_spec bwn_res_spec_msi[] = { - { SYS_RES_IRQ, 1, RF_ACTIVE }, - { -1, 0, 0 } -}; - static const struct bwn_channelinfo bwn_chantable_bg = { .channels = { { 2412, 1, 30 }, { 2417, 2, 30 }, { 2422, 3, 30 }, @@ -449,7 +448,7 @@ static const struct { uint16_t vid; uint8_t led_act[BWN_LED_MAX]; } bwn_vendor_led_act[] = { - VENDOR_LED_ACT(COMPAQ), + VENDOR_LED_ACT(HP_COMPAQ), VENDOR_LED_ACT(ASUSTEK) }; @@ -458,6 +457,13 @@ static const uint8_t bwn_default_led_act[BWN_LED_MAX] #undef VENDOR_LED_ACT +static const char *bwn_led_vars[] = { + BHND_NVAR_LEDBH0, + BHND_NVAR_LEDBH1, + BHND_NVAR_LEDBH2, + BHND_NVAR_LEDBH3 +}; + static const struct { int on_dur; int off_dur; @@ -484,89 +490,130 @@ static const uint16_t bwn_wme_shm_offsets[] = { [3] = BWN_WME_VIDEO, }; -static const struct siba_devid bwn_devs[] = { - SIBA_DEV(BROADCOM, 80211, 5, "Revision 5"), - SIBA_DEV(BROADCOM, 80211, 6, "Revision 6"), - SIBA_DEV(BROADCOM, 80211, 7, "Revision 7"), - SIBA_DEV(BROADCOM, 80211, 9, "Revision 9"), - SIBA_DEV(BROADCOM, 80211, 10, "Revision 10"), - SIBA_DEV(BROADCOM, 80211, 11, "Revision 11"), - SIBA_DEV(BROADCOM, 80211, 12, "Revision 12"), - SIBA_DEV(BROADCOM, 80211, 13, "Revision 13"), - SIBA_DEV(BROADCOM, 80211, 15, "Revision 15"), - SIBA_DEV(BROADCOM, 80211, 16, "Revision 16") +/* Supported D11 core revisions */ +#define BWN_DEV(_hwrev) {{ \ + BHND_MATCH_CORE(BHND_MFGID_BCM, BHND_COREID_D11), \ + BHND_MATCH_CORE_REV(_hwrev), \ +}} +static const struct bhnd_device bwn_devices[] = { + BWN_DEV(HWREV_RANGE(5, 16)), + BWN_DEV(HWREV_EQ(23)), + BHND_DEVICE_END }; -static const struct bwn_bus_ops * -bwn_get_bus_ops(device_t dev) -{ -#if BWN_USE_SIBA - return (NULL); -#else - devclass_t bus_cls; +/* D11 quirks when bridged via a PCI host bridge core */ +static const struct bhnd_device_quirk pci_bridge_quirks[] = { + BHND_CORE_QUIRK (HWREV_LTE(10), BWN_QUIRK_UCODE_SLOWCLOCK_WAR), + BHND_DEVICE_QUIRK_END +}; - bus_cls = device_get_devclass(device_get_parent(dev)); - if (bus_cls == devclass_find("bhnd")) - return (&bwn_bhnd_bus_ops); - else - return (&bwn_siba_bus_ops); -#endif -} +/* D11 quirks when bridged via a PCMCIA host bridge core */ +static const struct bhnd_device_quirk pcmcia_bridge_quirks[] = { + BHND_CORE_QUIRK (HWREV_ANY, BWN_QUIRK_NODMA), + BHND_DEVICE_QUIRK_END +}; +/* Host bridge cores for which D11 quirk flags should be applied */ +static const struct bhnd_device bridge_devices[] = { + BHND_DEVICE(BCM, PCI, NULL, pci_bridge_quirks), + BHND_DEVICE(BCM, PCMCIA, NULL, pcmcia_bridge_quirks), + BHND_DEVICE_END +}; + static int bwn_probe(device_t dev) { - struct bwn_softc *sc; - int i; + const struct bhnd_device *id; - sc = device_get_softc(dev); - sc->sc_bus_ops = bwn_get_bus_ops(dev); + id = bhnd_device_lookup(dev, bwn_devices, sizeof(bwn_devices[0])); + if (id == NULL) + return (ENXIO); - for (i = 0; i < nitems(bwn_devs); i++) { - if (siba_get_vendor(dev) == bwn_devs[i].sd_vendor && - siba_get_device(dev) == bwn_devs[i].sd_device && - siba_get_revid(dev) == bwn_devs[i].sd_rev) - return (BUS_PROBE_DEFAULT); - } - - return (ENXIO); + bhnd_set_default_core_desc(dev); + return (BUS_PROBE_DEFAULT); } -int +static int bwn_attach(device_t dev) { - struct bwn_mac *mac; - struct bwn_softc *sc = device_get_softc(dev); - int error, i, msic, reg; + struct bwn_mac *mac; + struct bwn_softc *sc; + device_t parent, hostb; + char chip_name[BHND_CHIPID_MAX_NAMELEN]; + int error; + sc = device_get_softc(dev); sc->sc_dev = dev; #ifdef BWN_DEBUG sc->sc_debug = bwn_debug; #endif - sc->sc_bus_ops = bwn_get_bus_ops(dev); - if ((error = BWN_BUS_OPS_ATTACH(dev))) { - device_printf(sc->sc_dev, - "bus-specific initialization failed (%d)\n", error); + mac = NULL; + + /* Determine the driver quirks applicable to this device, including any + * quirks specific to the bus host bridge core (if any) */ + sc->sc_quirks = bhnd_device_quirks(dev, bwn_devices, + sizeof(bwn_devices[0])); + + parent = device_get_parent(dev); + if ((hostb = bhnd_bus_find_hostb_device(parent)) != NULL) { + sc->sc_quirks |= bhnd_device_quirks(hostb, bridge_devices, + sizeof(bridge_devices[0])); + } + + /* DMA explicitly disabled? */ + if (!bwn_usedma) + sc->sc_quirks |= BWN_QUIRK_NODMA; + + /* Fetch our chip identification and board info */ + sc->sc_cid = *bhnd_get_chipid(dev); + if ((error = bhnd_read_board_info(dev, &sc->sc_board_info))) { + device_printf(sc->sc_dev, "couldn't read board info\n"); return (error); } + /* Allocate our D11 register block and PMU state */ + sc->sc_mem_rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_mem_rid, RF_ACTIVE); + if (sc->sc_mem_res == NULL) { + device_printf(sc->sc_dev, "couldn't allocate registers\n"); + return (error); + } + + if ((error = bhnd_alloc_pmu(sc->sc_dev))) { + bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, + sc->sc_mem_rid, sc->sc_mem_res); + return (error); + } + + /* Retain references to all required bus service providers */ + if ((error = bwn_retain_bus_providers(sc))) + goto fail; + + /* Fetch mask of available antennas */ + error = bhnd_nvram_getvar_uint8(sc->sc_dev, BHND_NVAR_AA2G, + &sc->sc_ant2g); + if (error) { + device_printf(sc->sc_dev, "error determining 2GHz antenna " + "availability from NVRAM: %d\n", error); + goto fail; + } + + error = bhnd_nvram_getvar_uint8(sc->sc_dev, BHND_NVAR_AA5G, + &sc->sc_ant5g); + if (error) { + device_printf(sc->sc_dev, "error determining 5GHz antenna " + "availability from NVRAM: %d\n", error); + goto fail; + } + if ((sc->sc_flags & BWN_FLAG_ATTACHED) == 0) { bwn_attach_pre(sc); bwn_sprom_bugfixes(dev); sc->sc_flags |= BWN_FLAG_ATTACHED; } - if (!TAILQ_EMPTY(&sc->sc_maclist)) { - if (siba_get_pci_device(dev) != 0x4313 && - siba_get_pci_device(dev) != 0x431a && - siba_get_pci_device(dev) != 0x4321) { - device_printf(sc->sc_dev, - "skip 802.11 cores\n"); - return (ENODEV); - } - } - mac = malloc(sizeof(*mac), M_DEVBUF, M_WAITOK | M_ZERO); mac->mac_sc = sc; mac->mac_status = BWN_MAC_STATUS_UNINIT; @@ -579,18 +626,19 @@ bwn_attach(device_t dev) error = bwn_attach_core(mac); if (error) - goto fail0; - bwn_led_attach(mac); + goto fail; + error = bwn_led_attach(mac); + if (error) + goto fail; - device_printf(sc->sc_dev, "WLAN (chipid %#x rev %u) " + bhnd_format_chip_id(chip_name, sizeof(chip_name), sc->sc_cid.chip_id); + device_printf(sc->sc_dev, "WLAN (%s rev %u) " "PHY (analog %d type %d rev %d) RADIO (manuf %#x ver %#x rev %d)\n", - siba_get_chipid(sc->sc_dev), siba_get_revid(sc->sc_dev), - mac->mac_phy.analog, mac->mac_phy.type, mac->mac_phy.rev, - mac->mac_phy.rf_manuf, mac->mac_phy.rf_ver, - mac->mac_phy.rf_rev); + chip_name, bhnd_get_hwrev(sc->sc_dev), mac->mac_phy.analog, + mac->mac_phy.type, mac->mac_phy.rev, mac->mac_phy.rf_manuf, + mac->mac_phy.rf_ver, mac->mac_phy.rf_rev); if (mac->mac_flags & BWN_MAC_FLAG_DMA) - device_printf(sc->sc_dev, "DMA (%d bits)\n", - mac->mac_method.dma.dmatype); + device_printf(sc->sc_dev, "DMA (%d bits)\n", mac->mac_dmatype); else device_printf(sc->sc_dev, "PIO\n"); @@ -599,51 +647,25 @@ bwn_attach(device_t dev) "Note: compiled with BWN_GPL_PHY; includes GPLv2 code\n"); #endif - /* - * setup PCI resources and interrupt. - */ - if (pci_find_cap(dev, PCIY_EXPRESS, ®) == 0) { - msic = pci_msi_count(dev); - if (bootverbose) - device_printf(sc->sc_dev, "MSI count : %d\n", msic); - } else - msic = 0; + mac->mac_rid_irq = 0; + mac->mac_res_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &mac->mac_rid_irq, RF_ACTIVE | RF_SHAREABLE); - mac->mac_intr_spec = bwn_res_spec_legacy; - if (msic == BWN_MSI_MESSAGES && bwn_msi_disable == 0) { - if (pci_alloc_msi(dev, &msic) == 0) { - device_printf(sc->sc_dev, - "Using %d MSI messages\n", msic); - mac->mac_intr_spec = bwn_res_spec_msi; - mac->mac_msi = 1; - } + if (mac->mac_res_irq == NULL) { + device_printf(sc->sc_dev, "couldn't allocate IRQ resource\n"); + error = ENXIO; + goto fail; } - error = bus_alloc_resources(dev, mac->mac_intr_spec, - mac->mac_res_irq); - if (error) { - device_printf(sc->sc_dev, - "couldn't allocate IRQ resources (%d)\n", error); - goto fail1; + error = bus_setup_intr(dev, mac->mac_res_irq, + INTR_TYPE_NET | INTR_MPSAFE, bwn_intr, NULL, mac, + &mac->mac_intrhand); + if (error != 0) { + device_printf(sc->sc_dev, "couldn't setup interrupt (%d)\n", + error); + goto fail; } - if (mac->mac_msi == 0) - error = bus_setup_intr(dev, mac->mac_res_irq[0], - INTR_TYPE_NET | INTR_MPSAFE, bwn_intr, NULL, mac, - &mac->mac_intrhand[0]); - else { - for (i = 0; i < BWN_MSI_MESSAGES; i++) { - error = bus_setup_intr(dev, mac->mac_res_irq[i], - INTR_TYPE_NET | INTR_MPSAFE, bwn_intr, NULL, mac, - &mac->mac_intrhand[i]); - if (error != 0) { - device_printf(sc->sc_dev, - "couldn't setup interrupt (%d)\n", error); - break; - } - } - } - TAILQ_INSERT_TAIL(&sc->sc_maclist, mac, mac_list); /* @@ -653,31 +675,86 @@ bwn_attach(device_t dev) bwn_attach_post(sc); return (0); -fail1: - if (msic == BWN_MSI_MESSAGES && bwn_msi_disable == 0) - pci_release_msi(dev); -fail0: - BWN_BUS_OPS_DETACH(dev); +fail: + if (mac != NULL && mac->mac_res_irq != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, mac->mac_rid_irq, + mac->mac_res_irq); + } + free(mac, M_DEVBUF); + bhnd_release_pmu(dev); + bwn_release_bus_providers(sc); + + if (sc->sc_mem_res != NULL) { + bus_release_resource(sc->sc_dev, SYS_RES_MEMORY, + sc->sc_mem_rid, sc->sc_mem_res); + } + return (error); } static int -bwn_is_valid_ether_addr(uint8_t *addr) +bwn_retain_bus_providers(struct bwn_softc *sc) { - char zero_addr[6] = { 0, 0, 0, 0, 0, 0 }; + struct chipc_caps *ccaps; - if ((addr[0] & 1) || (!bcmp(addr, zero_addr, ETHER_ADDR_LEN))) - return (FALSE); + sc->sc_chipc = bhnd_retain_provider(sc->sc_dev, BHND_SERVICE_CHIPC); + if (sc->sc_chipc == NULL) { + device_printf(sc->sc_dev, "ChipCommon device not found\n"); + goto failed; + } - return (TRUE); + ccaps = BHND_CHIPC_GET_CAPS(sc->sc_chipc); + + sc->sc_gpio = bhnd_retain_provider(sc->sc_dev, BHND_SERVICE_GPIO); + if (sc->sc_gpio == NULL) { + device_printf(sc->sc_dev, "GPIO device not found\n"); + goto failed; + } + + if (ccaps->pmu) { + sc->sc_pmu = bhnd_retain_provider(sc->sc_dev, BHND_SERVICE_PMU); + if (sc->sc_pmu == NULL) { + device_printf(sc->sc_dev, "PMU device not found\n"); + goto failed; + } + } + + return (0); + +failed: + bwn_release_bus_providers(sc); + return (ENXIO); } +static void +bwn_release_bus_providers(struct bwn_softc *sc) +{ +#define BWN_RELEASE_PROV(_sc, _prov, _service) do { \ + if ((_sc)-> _prov != NULL) { \ + bhnd_release_provider((_sc)->sc_dev, (_sc)-> _prov, \ + (_service)); \ + (_sc)-> _prov = NULL; \ + } \ +} while (0) + + BWN_RELEASE_PROV(sc, sc_chipc, BHND_SERVICE_CHIPC); + BWN_RELEASE_PROV(sc, sc_gpio, BHND_SERVICE_GPIO); + BWN_RELEASE_PROV(sc, sc_pmu, BHND_SERVICE_PMU); + +#undef BWN_RELEASE_PROV +} + static int bwn_attach_post(struct bwn_softc *sc) { - struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211com *ic; + const char *mac_varname; + u_int core_unit; + int error; + ic = &sc->sc_ic; + ic->ic_softc = sc; ic->ic_name = device_get_nameunit(sc->sc_dev); /* XXX not right but it's not used anywhere important */ @@ -699,11 +776,36 @@ bwn_attach_post(struct bwn_softc *sc) ic->ic_flags_ext |= IEEE80211_FEXT_SWBMISS; /* s/w bmiss */ - IEEE80211_ADDR_COPY(ic->ic_macaddr, - bwn_is_valid_ether_addr(siba_sprom_get_mac_80211a(sc->sc_dev)) ? - siba_sprom_get_mac_80211a(sc->sc_dev) : - siba_sprom_get_mac_80211bg(sc->sc_dev)); + /* Determine the NVRAM variable containing our MAC address */ + core_unit = bhnd_get_core_unit(sc->sc_dev); + mac_varname = NULL; + if (sc->sc_board_info.board_srom_rev <= 2) { + if (core_unit == 0) { + mac_varname = BHND_NVAR_IL0MACADDR; + } else if (core_unit == 1) { + mac_varname = BHND_NVAR_ET1MACADDR; + } + } else { + if (core_unit == 0) { + mac_varname = BHND_NVAR_MACADDR; + } + } + if (mac_varname == NULL) { + device_printf(sc->sc_dev, "missing MAC address variable for " + "D11 core %u", core_unit); + return (ENXIO); + } + + /* Read the MAC address from NVRAM */ + error = bhnd_nvram_getvar_array(sc->sc_dev, mac_varname, ic->ic_macaddr, + sizeof(ic->ic_macaddr), BHND_NVRAM_TYPE_UINT8_ARRAY); + if (error) { + device_printf(sc->sc_dev, "error reading %s: %d\n", mac_varname, + error); + return (error); + } + /* call MI attach routine. */ ieee80211_ifattach(ic); @@ -743,13 +845,12 @@ bwn_phy_detach(struct bwn_mac *mac) mac->mac_phy.detach(mac); } -int +static int bwn_detach(device_t dev) { struct bwn_softc *sc = device_get_softc(dev); struct bwn_mac *mac = sc->sc_curmac; struct ieee80211com *ic = &sc->sc_ic; - int i; sc->sc_flags |= BWN_FLAG_INVALID; @@ -770,20 +871,22 @@ bwn_detach(device_t dev) taskqueue_drain(sc->sc_tq, &mac->mac_intrtask); taskqueue_free(sc->sc_tq); - for (i = 0; i < BWN_MSI_MESSAGES; i++) { - if (mac->mac_intrhand[i] != NULL) { - bus_teardown_intr(dev, mac->mac_res_irq[i], - mac->mac_intrhand[i]); - mac->mac_intrhand[i] = NULL; - } + if (mac->mac_intrhand != NULL) { + bus_teardown_intr(dev, mac->mac_res_irq, mac->mac_intrhand); + mac->mac_intrhand = NULL; } - bus_release_resources(dev, mac->mac_intr_spec, mac->mac_res_irq); - if (mac->mac_msi != 0) - pci_release_msi(dev); + + bhnd_release_pmu(dev); + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, + sc->sc_mem_res); + bus_release_resource(dev, SYS_RES_IRQ, mac->mac_rid_irq, + mac->mac_res_irq); mbufq_drain(&sc->sc_snd); bwn_release_firmware(mac); BWN_LOCK_DESTROY(sc); - BWN_BUS_OPS_DETACH(dev); + + bwn_release_bus_providers(sc); + return (0); } @@ -806,32 +909,28 @@ bwn_attach_pre(struct bwn_softc *sc) static void bwn_sprom_bugfixes(device_t dev) { -#define BWN_ISDEV(_vendor, _device, _subvendor, _subdevice) \ - ((siba_get_pci_vendor(dev) == PCI_VENDOR_##_vendor) && \ - (siba_get_pci_device(dev) == _device) && \ - (siba_get_pci_subvendor(dev) == PCI_VENDOR_##_subvendor) && \ - (siba_get_pci_subdevice(dev) == _subdevice)) + struct bwn_softc *sc = device_get_softc(dev); - if (siba_get_pci_subvendor(dev) == PCI_VENDOR_APPLE && - siba_get_pci_subdevice(dev) == 0x4e && - siba_get_pci_revid(dev) > 0x40) - siba_sprom_set_bf_lo(dev, - siba_sprom_get_bf_lo(dev) | BWN_BFL_PACTRL); - if (siba_get_pci_subvendor(dev) == SIBA_BOARDVENDOR_DELL && - siba_get_chipid(dev) == 0x4301 && siba_get_pci_revid(dev) == 0x74) - siba_sprom_set_bf_lo(dev, - siba_sprom_get_bf_lo(dev) | BWN_BFL_BTCOEXIST); - if (siba_get_type(dev) == SIBA_TYPE_PCI) { - if (BWN_ISDEV(BROADCOM, 0x4318, ASUSTEK, 0x100f) || - BWN_ISDEV(BROADCOM, 0x4320, DELL, 0x0003) || - BWN_ISDEV(BROADCOM, 0x4320, HP, 0x12f8) || - BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0013) || - BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0014) || - BWN_ISDEV(BROADCOM, 0x4320, LINKSYS, 0x0015) || - BWN_ISDEV(BROADCOM, 0x4320, MOTOROLA, 0x7010)) - siba_sprom_set_bf_lo(dev, - siba_sprom_get_bf_lo(dev) & ~BWN_BFL_BTCOEXIST); - } +#define BWN_ISDEV(_device, _subvendor, _subdevice) \ + ((sc->sc_board_info.board_devid == PCI_DEVID_##_device) && \ + (sc->sc_board_info.board_vendor == PCI_VENDOR_##_subvendor) && \ + (sc->sc_board_info.board_type == _subdevice)) + + /* A subset of Apple Airport Extreme (BCM4306 rev 2) devices + * were programmed with a missing PACTRL boardflag */ + if (sc->sc_board_info.board_vendor == PCI_VENDOR_APPLE && + sc->sc_board_info.board_type == 0x4e && + sc->sc_board_info.board_rev > 0x40) + sc->sc_board_info.board_flags |= BHND_BFL_PACTRL; + + if (BWN_ISDEV(BCM4318_D11G, ASUSTEK, 0x100f) || + BWN_ISDEV(BCM4306_D11G, DELL, 0x0003) || + BWN_ISDEV(BCM4306_D11G, HP, 0x12f8) || + BWN_ISDEV(BCM4306_D11G, LINKSYS, 0x0013) || + BWN_ISDEV(BCM4306_D11G, LINKSYS, 0x0014) || + BWN_ISDEV(BCM4306_D11G, LINKSYS, 0x0015) || + BWN_ISDEV(BCM4306_D11G, MOTOROLA, 0x7010)) + sc->sc_board_info.board_flags &= ~BHND_BFL_BTCOEX; #undef BWN_ISDEV } @@ -1008,7 +1107,7 @@ bwn_pio_tx_start(struct bwn_mac *mac, struct ieee80211 tq->tq_used += roundup(m->m_pkthdr.len + BWN_HDRSIZE(mac), 4); tq->tq_free--; - if (siba_get_revid(sc->sc_dev) >= 8) { + if (bhnd_get_hwrev(sc->sc_dev) >= 8) { /* * XXX please removes m_defrag(9) */ @@ -1181,29 +1280,37 @@ bwn_attach_core(struct bwn_mac *mac) { struct bwn_softc *sc = mac->mac_sc; int error, have_bg = 0, have_a = 0; - uint32_t high; + uint16_t iost; - KASSERT(siba_get_revid(sc->sc_dev) >= 5, - ("unsupported revision %d", siba_get_revid(sc->sc_dev))); + KASSERT(bhnd_get_hwrev(sc->sc_dev) >= 5, + ("unsupported revision %d", bhnd_get_hwrev(sc->sc_dev))); - siba_powerup(sc->sc_dev, 0); - high = siba_read_4(sc->sc_dev, SIBA_TGSHIGH); - have_a = (high & BWN_TGSHIGH_HAVE_5GHZ) ? 1 : 0; - have_bg = (high & BWN_TGSHIGH_HAVE_2GHZ) ? 1 : 0; - if (high & BWN_TGSHIGH_DUALPHY) { + if ((error = bwn_core_forceclk(mac, true))) + return (error); + + if ((error = bhnd_read_iost(sc->sc_dev, &iost))) { + device_printf(sc->sc_dev, "error reading I/O status flags: " + "%d\n", error); + return (error); + } + + have_a = (iost & BWN_IOST_HAVE_5GHZ) ? 1 : 0; + have_bg = (iost & BWN_IOST_HAVE_2GHZ) ? 1 : 0; + if (iost & BWN_IOST_DUALPHY) { have_bg = 1; have_a = 1; } + #if 0 - device_printf(sc->sc_dev, "%s: high=0x%08x, have_a=%d, have_bg=%d," + device_printf(sc->sc_dev, "%s: iost=0x%04hx, have_a=%d, have_bg=%d," " deviceid=0x%04x, siba_deviceid=0x%04x\n", __func__, - high, + iost, have_a, have_bg, - siba_get_pci_device(sc->sc_dev), - siba_get_chipid(sc->sc_dev)); + sc->sc_board_info.board_devid, + sc->sc_cid.chip_id); #endif /* @@ -1211,9 +1318,31 @@ bwn_attach_core(struct bwn_mac *mac) * This is just used for resetting the core to probe things; * we will re-guess once it's all up and working. */ - bwn_reset_core(mac, have_bg); + error = bwn_reset_core(mac, have_bg); + if (error) + goto fail; /* + * Determine the DMA engine type + */ + if (iost & BHND_IOST_DMA64) { + mac->mac_dmatype = BHND_DMA_ADDR_64BIT; + } else { + uint32_t tmp; + uint16_t base; + + base = bwn_dma_base(0, 0); + BWN_WRITE_4(mac, base + BWN_DMA32_TXCTL, + BWN_DMA32_TXADDREXT_MASK); + tmp = BWN_READ_4(mac, base + BWN_DMA32_TXCTL); + if (tmp & BWN_DMA32_TXADDREXT_MASK) { + mac->mac_dmatype = BHND_DMA_ADDR_32BIT; + } else { + mac->mac_dmatype = BHND_DMA_ADDR_30BIT; + } + } + + /* * Get the PHY version. */ error = bwn_phy_getinfo(mac, have_bg); @@ -1224,12 +1353,12 @@ bwn_attach_core(struct bwn_mac *mac) * This is the whitelist of devices which we "believe" * the SPROM PHY config from. The rest are "guessed". */ - if (siba_get_pci_device(sc->sc_dev) != 0x4312 && - siba_get_pci_device(sc->sc_dev) != 0x4315 && - siba_get_pci_device(sc->sc_dev) != 0x4319 && - siba_get_pci_device(sc->sc_dev) != 0x4324 && - siba_get_pci_device(sc->sc_dev) != 0x4328 && - siba_get_pci_device(sc->sc_dev) != 0x432b) { + if (sc->sc_board_info.board_devid != PCI_DEVID_BCM4311_D11DUAL && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4328_D11G && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4318_D11DUAL && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4306_D11DUAL && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4321_D11N && + sc->sc_board_info.board_devid != PCI_DEVID_BCM4322_D11N) { have_a = have_bg = 0; if (mac->mac_phy.type == BWN_PHYTYPE_A) have_a = 1; @@ -1330,7 +1459,9 @@ bwn_attach_core(struct bwn_mac *mac) } } - bwn_reset_core(mac, have_bg); + error = bwn_reset_core(mac, have_bg); + if (error) + goto fail; error = bwn_chiptest(mac); if (error) @@ -1352,46 +1483,64 @@ bwn_attach_core(struct bwn_mac *mac) mac->mac_phy.switch_analog(mac, 0); - siba_dev_down(sc->sc_dev, 0); fail: - siba_powerdown(sc->sc_dev); + bhnd_suspend_hw(sc->sc_dev, 0); bwn_release_firmware(mac); return (error); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Feb 6 00:02:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A158AEDA07E; Tue, 6 Feb 2018 00:02:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53E4B68D92; Tue, 6 Feb 2018 00:02:31 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4EC071002F; Tue, 6 Feb 2018 00:02: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 w1602V0w070702; Tue, 6 Feb 2018 00:02:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1602VMP070699; Tue, 6 Feb 2018 00:02:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201802060002.w1602VMP070699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 6 Feb 2018 00:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328913 - in head/sys: conf i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: conf i386/i386 X-SVN-Commit-Revision: 328913 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.25 Precedence: list List-Id: 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, 06 Feb 2018 00:02:31 -0000 Author: kib Date: Tue Feb 6 00:02:30 2018 New Revision: 328913 URL: https://svnweb.freebsd.org/changeset/base/328913 Log: Move signal trampolines out of locore.s into separate source file. Similar to other arches, the move makes the subject of locore.s only the kernel startup. Sponsored by: The FreeBSD Foundation MFC after: 1 week Added: head/sys/i386/i386/sigtramp.s - copied, changed from r328903, head/sys/i386/i386/locore.s Modified: head/sys/conf/files.i386 head/sys/i386/i386/locore.s Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon Feb 5 23:38:15 2018 (r328912) +++ head/sys/conf/files.i386 Tue Feb 6 00:02:30 2018 (r328913) @@ -494,6 +494,7 @@ i386/i386/perfmon.c optional perfmon i386/i386/pmap.c standard i386/i386/prof_machdep.c optional profiling-routine i386/i386/ptrace_machdep.c standard +i386/i386/sigtramp.s standard i386/i386/support.s standard i386/i386/swtch.s standard i386/i386/sys_machdep.c standard Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Mon Feb 5 23:38:15 2018 (r328912) +++ head/sys/i386/i386/locore.s Tue Feb 6 00:02:30 2018 (r328913) @@ -44,7 +44,6 @@ #include "opt_nfsroot.h" #include "opt_pmap.h" -#include #include #include @@ -292,77 +291,6 @@ begin: call mi_startup /* autoconfiguration, mountroot etc */ /* NOTREACHED */ addl $0,%esp /* for db_numargs() again */ - -/* - * Signal trampoline, copied to top of user stack - */ -NON_GPROF_ENTRY(sigcode) - calll *SIGF_HANDLER(%esp) - leal SIGF_UC(%esp),%eax /* get ucontext */ - pushl %eax - testl $PSL_VM,UC_EFLAGS(%eax) - jne 1f - mov UC_GS(%eax),%gs /* restore %gs */ -1: - movl $SYS_sigreturn,%eax - pushl %eax /* junk to fake return addr. */ - int $0x80 /* enter kernel with args */ - /* on stack */ -1: - jmp 1b - -#ifdef COMPAT_FREEBSD4 - ALIGN_TEXT -freebsd4_sigcode: - calll *SIGF_HANDLER(%esp) - leal SIGF_UC4(%esp),%eax /* get ucontext */ - pushl %eax - testl $PSL_VM,UC4_EFLAGS(%eax) - jne 1f - mov UC4_GS(%eax),%gs /* restore %gs */ -1: - movl $344,%eax /* 4.x SYS_sigreturn */ - pushl %eax /* junk to fake return addr. */ - int $0x80 /* enter kernel with args */ - /* on stack */ -1: - jmp 1b -#endif - -#ifdef COMPAT_43 - ALIGN_TEXT -osigcode: - call *SIGF_HANDLER(%esp) /* call signal handler */ - lea SIGF_SC(%esp),%eax /* get sigcontext */ - pushl %eax - testl $PSL_VM,SC_PS(%eax) - jne 9f - mov SC_GS(%eax),%gs /* restore %gs */ -9: - movl $103,%eax /* 3.x SYS_sigreturn */ - pushl %eax /* junk to fake return addr. */ - int $0x80 /* enter kernel with args */ -0: jmp 0b -#endif /* COMPAT_43 */ - - ALIGN_TEXT -esigcode: - - .data - .globl szsigcode -szsigcode: - .long esigcode-sigcode -#ifdef COMPAT_FREEBSD4 - .globl szfreebsd4_sigcode -szfreebsd4_sigcode: - .long esigcode-freebsd4_sigcode -#endif -#ifdef COMPAT_43 - .globl szosigcode -szosigcode: - .long esigcode-osigcode -#endif - .text /********************************************************************** * Copied and modified: head/sys/i386/i386/sigtramp.s (from r328903, head/sys/i386/i386/locore.s) ============================================================================== --- head/sys/i386/i386/locore.s Mon Feb 5 22:21:51 2018 (r328903, copy source) +++ head/sys/i386/i386/sigtramp.s Tue Feb 6 00:02:30 2018 (r328913) @@ -39,261 +39,15 @@ * and many others. */ -#include "opt_bootp.h" #include "opt_compat.h" -#include "opt_nfsroot.h" -#include "opt_pmap.h" #include -#include - #include -#include #include -#include -#include #include "assym.s" /* - * XXX - * - * Note: This version greatly munged to avoid various assembler errors - * that may be fixed in newer versions of gas. Perhaps newer versions - * will have more pleasant appearance. - */ - -/* - * PTmap is recursive pagemap at top of virtual address space. - * Within PTmap, the page directory can be found (third indirection). - */ - .globl PTmap,PTD,PTDpde - .set PTmap,(PTDPTDI << PDRSHIFT) - .set PTD,PTmap + (PTDPTDI * PAGE_SIZE) - .set PTDpde,PTD + (PTDPTDI * PDESIZE) - -/* - * Compiled KERNBASE location and the kernel load address - */ - .globl kernbase - .set kernbase,KERNBASE - .globl kernload - .set kernload,KERNLOAD - -/* - * Globals - */ - .data - ALIGN_DATA /* just to be sure */ - - .space 0x2000 /* space for tmpstk - temporary stack */ -tmpstk: - - .globl bootinfo -bootinfo: .space BOOTINFO_SIZE /* bootinfo that we can handle */ - - .globl KERNend -KERNend: .long 0 /* phys addr end of kernel (just after bss) */ -physfree: .long 0 /* phys addr of next free page */ - - .globl IdlePTD -IdlePTD: .long 0 /* phys addr of kernel PTD */ - -#if defined(PAE) || defined(PAE_TABLES) - .globl IdlePDPT -IdlePDPT: .long 0 /* phys addr of kernel PDPT */ -#endif - - .globl KPTmap -KPTmap: .long 0 /* address of kernel page tables */ - - .globl KPTphys -KPTphys: .long 0 /* phys addr of kernel page tables */ - - .globl proc0kstack -proc0kstack: .long 0 /* address of proc 0 kstack space */ -p0kpa: .long 0 /* phys addr of proc0's STACK */ - -vm86phystk: .long 0 /* PA of vm86/bios stack */ - - .globl vm86paddr, vm86pa -vm86paddr: .long 0 /* address of vm86 region */ -vm86pa: .long 0 /* phys addr of vm86 region */ - -/********************************************************************** - * - * Some handy macros - * - */ - -#define R(foo) ((foo)-KERNBASE) - -#define ALLOCPAGES(foo) \ - movl R(physfree), %esi ; \ - movl $((foo)*PAGE_SIZE), %eax ; \ - addl %esi, %eax ; \ - movl %eax, R(physfree) ; \ - movl %esi, %edi ; \ - movl $((foo)*PAGE_SIZE),%ecx ; \ - xorl %eax,%eax ; \ - cld ; \ - rep ; \ - stosb - -/* - * fillkpt - * eax = page frame address - * ebx = index into page table - * ecx = how many pages to map - * base = base address of page dir/table - * prot = protection bits - */ -#define fillkpt(base, prot) \ - shll $PTESHIFT,%ebx ; \ - addl base,%ebx ; \ - orl $PG_V,%eax ; \ - orl prot,%eax ; \ -1: movl %eax,(%ebx) ; \ - addl $PAGE_SIZE,%eax ; /* increment physical address */ \ - addl $PTESIZE,%ebx ; /* next pte */ \ - loop 1b - -/* - * fillkptphys(prot) - * eax = physical address - * ecx = how many pages to map - * prot = protection bits - */ -#define fillkptphys(prot) \ - movl %eax, %ebx ; \ - shrl $PAGE_SHIFT, %ebx ; \ - fillkpt(R(KPTphys), prot) - - .text -/********************************************************************** - * - * This is where the bootblocks start us, set the ball rolling... - * - */ -NON_GPROF_ENTRY(btext) - -/* Tell the bios to warmboot next time */ - movw $0x1234,0x472 - -/* Set up a real frame in case the double return in newboot is executed. */ - pushl %ebp - movl %esp, %ebp - -/* Don't trust what the BIOS gives for eflags. */ - pushl $PSL_KERNEL - popfl - -/* - * Don't trust what the BIOS gives for %fs and %gs. Trust the bootstrap - * to set %cs, %ds, %es and %ss. - */ - mov %ds, %ax - mov %ax, %fs - mov %ax, %gs - -/* - * Clear the bss. Not all boot programs do it, and it is our job anyway. - * - * XXX we don't check that there is memory for our bss and page tables - * before using it. - * - * Note: we must be careful to not overwrite an active gdt or idt. They - * inactive from now until we switch to new ones, since we don't load any - * more segment registers or permit interrupts until after the switch. - */ - movl $R(end),%ecx - movl $R(edata),%edi - subl %edi,%ecx - xorl %eax,%eax - cld - rep - stosb - - call recover_bootinfo - -/* Get onto a stack that we can trust. */ -/* - * XXX this step is delayed in case recover_bootinfo needs to return via - * the old stack, but it need not be, since recover_bootinfo actually - * returns via the old frame. - */ - movl $R(tmpstk),%esp - - call identify_cpu - call create_pagetables - -/* - * If the CPU has support for VME, turn it on. - */ - testl $CPUID_VME, R(cpu_feature) - jz 1f - movl %cr4, %eax - orl $CR4_VME, %eax - movl %eax, %cr4 -1: - -/* Now enable paging */ -#if defined(PAE) || defined(PAE_TABLES) - movl R(IdlePDPT), %eax - movl %eax, %cr3 - movl %cr4, %edx - orl $CR4_PAE, %edx - movl %edx, %cr4 -#else - movl R(IdlePTD), %eax - movl %eax,%cr3 /* load ptd addr into mmu */ -#endif - movl %cr0,%edx /* get control word */ - orl $CR0_PE|CR0_PG,%edx /* enable paging */ - movl %edx,%cr0 /* and let's page NOW! */ - - pushl $begin /* jump to high virtualized address */ - ret - -begin: - /* - * Now running relocated at KERNBASE where the system is linked to run. - * - * Remove the lowest part of the double mapping of low memory to get - * some null pointer checks. - */ - movl $0,PTD - movl %eax,%cr3 /* invalidate TLB */ - - /* set up bootstrap stack */ - movl proc0kstack,%eax /* location of in-kernel stack */ - - /* - * Only use bottom page for init386(). init386() calculates the - * PCB + FPU save area size and returns the true top of stack. - */ - leal PAGE_SIZE(%eax),%esp - - xorl %ebp,%ebp /* mark end of frames */ - - pushl physfree /* value of first for init386(first) */ - call init386 /* wire 386 chip for unix operation */ - - /* - * Clean up the stack in a way that db_numargs() understands, so - * that backtraces in ddb don't underrun the stack. Traps for - * inaccessible memory are more fatal than usual this early. - */ - addl $4,%esp - - /* Switch to true top of stack. */ - movl %eax,%esp - - call mi_startup /* autoconfiguration, mountroot etc */ - /* NOTREACHED */ - addl $0,%esp /* for db_numargs() again */ - -/* * Signal trampoline, copied to top of user stack */ NON_GPROF_ENTRY(sigcode) @@ -361,500 +115,4 @@ szfreebsd4_sigcode: .globl szosigcode szosigcode: .long esigcode-osigcode -#endif - .text - -/********************************************************************** - * - * Recover the bootinfo passed to us from the boot program - * - */ -recover_bootinfo: - /* - * This code is called in different ways depending on what loaded - * and started the kernel. This is used to detect how we get the - * arguments from the other code and what we do with them. - * - * Old disk boot blocks: - * (*btext)(howto, bootdev, cyloffset, esym); - * [return address == 0, and can NOT be returned to] - * [cyloffset was not supported by the FreeBSD boot code - * and always passed in as 0] - * [esym is also known as total in the boot code, and - * was never properly supported by the FreeBSD boot code] - * - * Old diskless netboot code: - * (*btext)(0,0,0,0,&nfsdiskless,0,0,0); - * [return address != 0, and can NOT be returned to] - * If we are being booted by this code it will NOT work, - * so we are just going to halt if we find this case. - * - * New uniform boot code: - * (*btext)(howto, bootdev, 0, 0, 0, &bootinfo) - * [return address != 0, and can be returned to] - * - * There may seem to be a lot of wasted arguments in here, but - * that is so the newer boot code can still load very old kernels - * and old boot code can load new kernels. - */ - - /* - * The old style disk boot blocks fake a frame on the stack and - * did an lret to get here. The frame on the stack has a return - * address of 0. - */ - cmpl $0,4(%ebp) - je olddiskboot - - /* - * We have some form of return address, so this is either the - * old diskless netboot code, or the new uniform code. That can - * be detected by looking at the 5th argument, if it is 0 - * we are being booted by the new uniform boot code. - */ - cmpl $0,24(%ebp) - je newboot - - /* - * Seems we have been loaded by the old diskless boot code, we - * don't stand a chance of running as the diskless structure - * changed considerably between the two, so just halt. - */ - hlt - - /* - * We have been loaded by the new uniform boot code. - * Let's check the bootinfo version, and if we do not understand - * it we return to the loader with a status of 1 to indicate this error - */ -newboot: - movl 28(%ebp),%ebx /* &bootinfo.version */ - movl BI_VERSION(%ebx),%eax - cmpl $1,%eax /* We only understand version 1 */ - je 1f - movl $1,%eax /* Return status */ - leave - /* - * XXX this returns to our caller's caller (as is required) since - * we didn't set up a frame and our caller did. - */ - ret - -1: - /* - * If we have a kernelname copy it in - */ - movl BI_KERNELNAME(%ebx),%esi - cmpl $0,%esi - je 2f /* No kernelname */ - movl $MAXPATHLEN,%ecx /* Brute force!!! */ - movl $R(kernelname),%edi - cmpb $'/',(%esi) /* Make sure it starts with a slash */ - je 1f - movb $'/',(%edi) - incl %edi - decl %ecx -1: - cld - rep - movsb - -2: - /* - * Determine the size of the boot loader's copy of the bootinfo - * struct. This is impossible to do properly because old versions - * of the struct don't contain a size field and there are 2 old - * versions with the same version number. - */ - movl $BI_ENDCOMMON,%ecx /* prepare for sizeless version */ - testl $RB_BOOTINFO,8(%ebp) /* bi_size (and bootinfo) valid? */ - je got_bi_size /* no, sizeless version */ - movl BI_SIZE(%ebx),%ecx -got_bi_size: - - /* - * Copy the common part of the bootinfo struct - */ - movl %ebx,%esi - movl $R(bootinfo),%edi - cmpl $BOOTINFO_SIZE,%ecx - jbe got_common_bi_size - movl $BOOTINFO_SIZE,%ecx -got_common_bi_size: - cld - rep - movsb - -#ifdef NFS_ROOT -#ifndef BOOTP_NFSV3 - /* - * If we have a nfs_diskless structure copy it in - */ - movl BI_NFS_DISKLESS(%ebx),%esi - cmpl $0,%esi - je olddiskboot - movl $R(nfs_diskless),%edi - movl $NFSDISKLESS_SIZE,%ecx - cld - rep - movsb - movl $R(nfs_diskless_valid),%edi - movl $1,(%edi) -#endif -#endif - - /* - * The old style disk boot. - * (*btext)(howto, bootdev, cyloffset, esym); - * Note that the newer boot code just falls into here to pick - * up howto and bootdev, cyloffset and esym are no longer used - */ -olddiskboot: - movl 8(%ebp),%eax - movl %eax,R(boothowto) - movl 12(%ebp),%eax - movl %eax,R(bootdev) - - ret - - -/********************************************************************** - * - * Identify the CPU and initialize anything special about it - * - */ -identify_cpu: - - /* Try to toggle alignment check flag; does not exist on 386. */ - pushfl - popl %eax - movl %eax,%ecx - orl $PSL_AC,%eax - pushl %eax - popfl - pushfl - popl %eax - xorl %ecx,%eax - andl $PSL_AC,%eax - pushl %ecx - popfl - - testl %eax,%eax - jnz try486 - - /* NexGen CPU does not have aligment check flag. */ - pushfl - movl $0x5555, %eax - xorl %edx, %edx - movl $2, %ecx - clc - divl %ecx - jz trynexgen - popfl - movl $CPU_386,R(cpu) - jmp 3f - -trynexgen: - popfl - movl $CPU_NX586,R(cpu) - movl $0x4778654e,R(cpu_vendor) # store vendor string - movl $0x72446e65,R(cpu_vendor+4) - movl $0x6e657669,R(cpu_vendor+8) - movl $0,R(cpu_vendor+12) - jmp 3f - -try486: /* Try to toggle identification flag; does not exist on early 486s. */ - pushfl - popl %eax - movl %eax,%ecx - xorl $PSL_ID,%eax - pushl %eax - popfl - pushfl - popl %eax - xorl %ecx,%eax - andl $PSL_ID,%eax - pushl %ecx - popfl - - testl %eax,%eax - jnz trycpuid - movl $CPU_486,R(cpu) - - /* - * Check Cyrix CPU - * Cyrix CPUs do not change the undefined flags following - * execution of the divide instruction which divides 5 by 2. - * - * Note: CPUID is enabled on M2, so it passes another way. - */ - pushfl - movl $0x5555, %eax - xorl %edx, %edx - movl $2, %ecx - clc - divl %ecx - jnc trycyrix - popfl - jmp 3f /* You may use Intel CPU. */ - -trycyrix: - popfl - /* - * IBM Bluelighting CPU also doesn't change the undefined flags. - * Because IBM doesn't disclose the information for Bluelighting - * CPU, we couldn't distinguish it from Cyrix's (including IBM - * brand of Cyrix CPUs). - */ - movl $0x69727943,R(cpu_vendor) # store vendor string - movl $0x736e4978,R(cpu_vendor+4) - movl $0x64616574,R(cpu_vendor+8) - jmp 3f - -trycpuid: /* Use the `cpuid' instruction. */ - xorl %eax,%eax - cpuid # cpuid 0 - movl %eax,R(cpu_high) # highest capability - movl %ebx,R(cpu_vendor) # store vendor string - movl %edx,R(cpu_vendor+4) - movl %ecx,R(cpu_vendor+8) - movb $0,R(cpu_vendor+12) - - movl $1,%eax - cpuid # cpuid 1 - movl %eax,R(cpu_id) # store cpu_id - movl %ebx,R(cpu_procinfo) # store cpu_procinfo - movl %edx,R(cpu_feature) # store cpu_feature - movl %ecx,R(cpu_feature2) # store cpu_feature2 - rorl $8,%eax # extract family type - andl $15,%eax - cmpl $5,%eax - jae 1f - - /* less than Pentium; must be 486 */ - movl $CPU_486,R(cpu) - jmp 3f -1: - /* a Pentium? */ - cmpl $5,%eax - jne 2f - movl $CPU_586,R(cpu) - jmp 3f -2: - /* Greater than Pentium...call it a Pentium Pro */ - movl $CPU_686,R(cpu) -3: - ret - - -/********************************************************************** - * - * Create the first page directory and its page tables. - * - */ - -create_pagetables: - -/* Find end of kernel image (rounded up to a page boundary). */ - movl $R(_end),%esi - -/* Include symbols, if any. */ - movl R(bootinfo+BI_ESYMTAB),%edi - testl %edi,%edi - je over_symalloc - movl %edi,%esi - movl $KERNBASE,%edi - addl %edi,R(bootinfo+BI_SYMTAB) - addl %edi,R(bootinfo+BI_ESYMTAB) -over_symalloc: - -/* If we are told where the end of the kernel space is, believe it. */ - movl R(bootinfo+BI_KERNEND),%edi - testl %edi,%edi - je no_kernend - movl %edi,%esi -no_kernend: - - addl $PDRMASK,%esi /* Play conservative for now, and */ - andl $~PDRMASK,%esi /* ... round up to PDR boundary */ - movl %esi,R(KERNend) /* save end of kernel */ - movl %esi,R(physfree) /* next free page is at end of kernel */ - -/* Allocate Kernel Page Tables */ - ALLOCPAGES(NKPT) - movl %esi,R(KPTphys) - addl $(KERNBASE-(KPTDI<<(PDRSHIFT-PAGE_SHIFT+PTESHIFT))),%esi - movl %esi,R(KPTmap) - -/* Allocate Page Table Directory */ -#if defined(PAE) || defined(PAE_TABLES) - /* XXX only need 32 bytes (easier for now) */ - ALLOCPAGES(1) - movl %esi,R(IdlePDPT) -#endif - ALLOCPAGES(NPGPTD) - movl %esi,R(IdlePTD) - -/* Allocate KSTACK */ - ALLOCPAGES(TD0_KSTACK_PAGES) - movl %esi,R(p0kpa) - addl $KERNBASE, %esi - movl %esi, R(proc0kstack) - - ALLOCPAGES(1) /* vm86/bios stack */ - movl %esi,R(vm86phystk) - - ALLOCPAGES(3) /* pgtable + ext + IOPAGES */ - movl %esi,R(vm86pa) - addl $KERNBASE, %esi - movl %esi, R(vm86paddr) - -/* - * Enable PSE and PGE. - */ -#ifndef DISABLE_PSE - testl $CPUID_PSE, R(cpu_feature) - jz 1f - movl $PG_PS, R(pseflag) - movl %cr4, %eax - orl $CR4_PSE, %eax - movl %eax, %cr4 -1: -#endif -#ifndef DISABLE_PG_G - testl $CPUID_PGE, R(cpu_feature) - jz 2f - movl $PG_G, R(pgeflag) - movl %cr4, %eax - orl $CR4_PGE, %eax - movl %eax, %cr4 -2: -#endif - -/* - * Initialize page table pages mapping physical address zero through the - * (physical) end of the kernel. Many of these pages must be reserved, - * and we reserve them all and map them linearly for convenience. We do - * this even if we've enabled PSE above; we'll just switch the corresponding - * kernel PDEs before we turn on paging. - * - * XXX: We waste some pages here in the PSE case! - * - * This and all other page table entries allow read and write access for - * various reasons. Kernel mappings never have any access restrictions. - */ - xorl %eax, %eax - movl R(KERNend),%ecx - shrl $PAGE_SHIFT,%ecx - fillkptphys($PG_RW) - -/* Map page table pages. */ - movl R(KPTphys),%eax - movl $NKPT,%ecx - fillkptphys($PG_RW) - -/* Map page directory. */ -#if defined(PAE) || defined(PAE_TABLES) - movl R(IdlePDPT), %eax - movl $1, %ecx - fillkptphys($PG_RW) -#endif - - movl R(IdlePTD), %eax - movl $NPGPTD, %ecx - fillkptphys($PG_RW) - -/* Map proc0's KSTACK in the physical way ... */ - movl R(p0kpa), %eax - movl $(TD0_KSTACK_PAGES), %ecx - fillkptphys($PG_RW) - -/* Map ISA hole */ - movl $ISA_HOLE_START, %eax - movl $ISA_HOLE_LENGTH>>PAGE_SHIFT, %ecx - fillkptphys($PG_RW) - -/* Map space for the vm86 region */ - movl R(vm86phystk), %eax - movl $4, %ecx - fillkptphys($PG_RW) - -/* Map page 0 into the vm86 page table */ - movl $0, %eax - movl $0, %ebx - movl $1, %ecx - fillkpt(R(vm86pa), $PG_RW|PG_U) - -/* ...likewise for the ISA hole */ - movl $ISA_HOLE_START, %eax - movl $ISA_HOLE_START>>PAGE_SHIFT, %ebx - movl $ISA_HOLE_LENGTH>>PAGE_SHIFT, %ecx - fillkpt(R(vm86pa), $PG_RW|PG_U) - -/* - * Create an identity mapping for low physical memory, including the kernel. - * This is only used to map the 2 instructions for jumping to 'begin' in - * locore (we map everything to avoid having to determine where these - * instructions are). ACPI resume will transiently restore the first PDE in - * this mapping (and depend on this PDE's page table created here not being - * destroyed). See pmap_bootstrap() for more details. - * - * Note: There are errata concerning large pages and physical address zero, - * so a PG_PS mapping should not be used for PDE 0. Our double mapping - * avoids this automatically by not using PG_PS for PDE #KPDI so that PAT - * bits can be set at the page level for i/o pages below 1 MB. - */ - movl R(KPTphys), %eax - xorl %ebx, %ebx - movl $NKPT, %ecx - fillkpt(R(IdlePTD), $PG_RW) - -/* - * Install PDEs for PTs covering enough kva to bootstrap. Then for the PSE - * case, replace the PDEs whose coverage is strictly within the kernel - * (between KERNLOAD (rounded up) and KERNend) by large-page PDEs. - */ - movl R(KPTphys), %eax - movl $KPTDI, %ebx - movl $NKPT, %ecx - fillkpt(R(IdlePTD), $PG_RW) - cmpl $0,R(pseflag) - je done_pde - - movl R(KERNend), %ecx - movl $(KERNLOAD + PDRMASK) & ~PDRMASK, %eax - subl %eax, %ecx - shrl $PDRSHIFT, %ecx - movl $KPTDI + ((KERNLOAD + PDRMASK) >> PDRSHIFT), %ebx - shll $PDESHIFT, %ebx - addl R(IdlePTD), %ebx - orl $(PG_V|PG_RW|PG_PS), %eax -1: movl %eax, (%ebx) - addl $(1 << PDRSHIFT), %eax - addl $PDESIZE, %ebx - loop 1b - -done_pde: -/* install a pde recursively mapping page directory as a page table */ - movl R(IdlePTD), %eax - movl $PTDPTDI, %ebx - movl $NPGPTD,%ecx - fillkpt(R(IdlePTD), $PG_RW) - -#if defined(PAE) || defined(PAE_TABLES) - movl R(IdlePTD), %eax - xorl %ebx, %ebx - movl $NPGPTD, %ecx - fillkpt(R(IdlePDPT), $0x0) -#endif - - ret - -#ifdef XENHVM -/* Xen Hypercall page */ - .text -.p2align PAGE_SHIFT, 0x90 /* Hypercall_page needs to be PAGE aligned */ - -NON_GPROF_ENTRY(hypercall_page) - .skip 0x1000, 0x90 /* Fill with "nop"s */ #endif From owner-svn-src-head@freebsd.org Tue Feb 6 00:19:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D425DEDB462; Tue, 6 Feb 2018 00:19:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 883626962A; Tue, 6 Feb 2018 00:19:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6284B101C1; Tue, 6 Feb 2018 00:19:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w160Jlhb076254; Tue, 6 Feb 2018 00:19:47 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w160Jl1W076251; Tue, 6 Feb 2018 00:19:47 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802060019.w160Jl1W076251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 6 Feb 2018 00:19:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328914 - in head/sys: kern ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys: kern ufs/ffs X-SVN-Commit-Revision: 328914 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.25 Precedence: list List-Id: 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, 06 Feb 2018 00:19:48 -0000 Author: mckusick Date: Tue Feb 6 00:19:46 2018 New Revision: 328914 URL: https://svnweb.freebsd.org/changeset/base/328914 Log: Occasional cylinder-group check-hash errors were being reported on systems running with a heavy filesystem load. Tracking down this bug was elusive because there were actually two problems. Sometimes the in-memory check hash was wrong and sometimes the check hash computed when doing the read was wrong. The occurrence of either error caused a check-hash mismatch to be reported. The first error was that the check hash in the in-memory cylinder group was incorrect. This error was caused by the following sequence of events: - We read a cylinder-group buffer and the check hash is valid. - We update its cg_time and cg_old_time which makes the in-memory check-hash value invalid but we do not mark the cylinder group dirty. - We do not make any other changes to the cylinder group, so we never mark it dirty, thus do not write it out, and hence never update the incorrect check hash for the in-memory buffer. - Later, the buffer gets freed, but the page with the old incorrect check hash is still in the VM cache. - Later, we read the cylinder group again, and the first page with the old check hash is still in the VM cache, but some other pages are not, so we have to do a read. - The read does not actually get the first page from disk, but rather from the VM cache, resulting in the old check hash in the buffer. - The value computed after doing the read does not match causing the error to be printed. The fix for this problem is to only set cg_time and cg_old_time as the cylinder group is being written to disk. This keeps the in-memory check-hash valid unless the cylinder group has had other modifications which will require it to be written with a new check hash calculated. It also requires that the check hash be recalculated in the in-memory cylinder group when it is marked clean after doing a background write. The second problem was that the check hash computed at the end of the read was incorrect because the calculation of the check hash on completion of the read was being done too soon. - When a read completes we had the following sequence: - bufdone() -- b_ckhashcalc (calculates check hash) -- bufdone_finish() --- vfs_vmio_iodone() (replaces bogus pages with the cached ones) - When we are reading a buffer where one or more pages are already in memory (but not all pages, or we wouldn't be doing the read), the I/O is done with bogus_page mapped in for the pages that exist in the VM cache. This mapping is done to avoid corrupting the cached pages if there is any I/O overrun. The vfs_vmio_iodone() function is responsible for replacing the bogus_page(s) with the cached ones. But we were calculating the check hash before the bogus_page(s) were replaced. Hence, when we were calculating the check hash, we were partly reading from bogus_page, which means we calculated a bad check hash (e.g., because multiple pages have been mapped to bogus_page, so its contents are indeterminate). The second fix is to move the check-hash calculation from bufdone() to bufdone_finish() after the call to vfs_vmio_iodone() so that it computes the check hash over the correct set of pages. With these two changes, the occasional cylinder-group check-hash errors are gone. Submitted by: David Pfitzner Reviewed by: kib Tested by: David Pfitzner Modified: head/sys/kern/vfs_bio.c head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Feb 6 00:02:30 2018 (r328913) +++ head/sys/kern/vfs_bio.c Tue Feb 6 00:19:46 2018 (r328914) @@ -4075,10 +4075,6 @@ bufdone(struct buf *bp) runningbufwakeup(bp); if (bp->b_iocmd == BIO_WRITE) dropobj = bp->b_bufobj; - else if ((bp->b_flags & B_CKHASH) != 0) { - KASSERT(buf_mapped(bp), ("biodone: bp %p not mapped", bp)); - (*bp->b_ckhashcalc)(bp); - } /* call optional completion function if requested */ if (bp->b_iodone != NULL) { biodone = bp->b_iodone; @@ -4114,6 +4110,13 @@ bufdone_finish(struct buf *bp) !(bp->b_ioflags & BIO_ERROR)) bp->b_flags |= B_CACHE; vfs_vmio_iodone(bp); + } + if ((bp->b_flags & B_CKHASH) != 0) { + KASSERT(bp->b_iocmd == BIO_READ, + ("bufdone_finish: b_iocmd %d not BIO_READ", bp->b_iocmd)); + KASSERT(buf_mapped(bp), + ("bufdone_finish: bp %p not mapped", bp)); + (*bp->b_ckhashcalc)(bp); } /* Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Tue Feb 6 00:02:30 2018 (r328913) +++ head/sys/ufs/ffs/ffs_alloc.c Tue Feb 6 00:19:46 2018 (r328914) @@ -2667,9 +2667,18 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) } bp->b_flags &= ~B_CKHASH; bp->b_xflags |= BX_BKGRDWRITE; + /* + * If we are using check hashes on the cylinder group then we want + * to limit changing the cylinder group time to when we are actually + * going to write it to disk so that its check hash remains correct + * in memory. If the CK_CYLGRP flag is set the time is updated in + * ffs_bufwrite() as the buffer is queued for writing. Otherwise we + * update the time here as we have done historically. + */ if ((fs->fs_metackhash & CK_CYLGRP) != 0) bp->b_xflags |= BX_CYLGRP; - cgp->cg_old_time = cgp->cg_time = time_second; + else + cgp->cg_old_time = cgp->cg_time = time_second; *bpp = bp; *cgpp = cgp; return (0); Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Feb 6 00:02:30 2018 (r328913) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Feb 6 00:19:46 2018 (r328914) @@ -2082,6 +2082,7 @@ static int ffs_bufwrite(struct buf *bp) { struct buf *newbp; + struct cg *cgp; CTR3(KTR_BUF, "bufwrite(%p) vp %p flags %X", bp, bp->b_vp, bp->b_flags); if (bp->b_flags & B_INVAL) { @@ -2163,8 +2164,16 @@ ffs_bufwrite(struct buf *bp) /* * Initiate write on the copy, release the original. The * BKGRDINPROG flag prevents it from going away until - * the background write completes. + * the background write completes. We have to recalculate + * its check hash in case the buffer gets freed and then + * reconstituted from the buffer cache during a later read. */ + if ((bp->b_xflags & BX_CYLGRP) != 0) { + cgp = (struct cg *)bp->b_data; + cgp->cg_ckhash = 0; + cgp->cg_ckhash = + calculate_crc32c(~0L, bp->b_data, bp->b_bcount); + } bqrelse(bp); bp = newbp; } else @@ -2174,6 +2183,13 @@ ffs_bufwrite(struct buf *bp) /* Let the normal bufwrite do the rest for us */ normal_write: + /* + * If we are writing a cylinder group, update its time. + */ + if ((bp->b_xflags & BX_CYLGRP) != 0) { + cgp = (struct cg *)bp->b_data; + cgp->cg_old_time = cgp->cg_time = time_second; + } return (bufwrite(bp)); } From owner-svn-src-head@freebsd.org Tue Feb 6 04:16:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B04C1EF0FBE; Tue, 6 Feb 2018 04:16:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5379A73B18; Tue, 6 Feb 2018 04:16:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E56312CB6; Tue, 6 Feb 2018 04:16:01 +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 w164G15d096975; Tue, 6 Feb 2018 04:16:01 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w164G0va096970; Tue, 6 Feb 2018 04:16:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802060416.w164G0va096970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Feb 2018 04:16:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328916 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 328916 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.25 Precedence: list List-Id: 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, 06 Feb 2018 04:16:02 -0000 Author: glebius Date: Tue Feb 6 04:16:00 2018 New Revision: 328916 URL: https://svnweb.freebsd.org/changeset/base/328916 Log: Followup on r302393 by cperciva, improving calculation of boot pages required for UMA startup. o Introduce another stage of UMA startup, which is entered after vm_page_startup() finishes. After this stage we don't yet enable buckets, but we can ask VM for pages. Rename stages to meaningful names while here. New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, BOOT_RUNNING. Enabling page alloc earlier allows us to dramatically reduce number of boot pages required. What is more important number of zones becomes consistent across different machines, as no MD allocations are done before the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need to use startup_alloc(), however that may change, so vm_page_startup() provides its need for early zones as argument. o Introduce uma_startup_count() function, to avoid code duplication. The functions calculates sizes of zones zone and kegs zone, and calculates how many pages UMA will need to bootstrap. It counts not only of zone structures, but also of kegs, slabs and hashes. o Hide uma_startup_foo() declarations from public file. o Provide several DIAGNOSTIC printfs on boot_pages usage. o Bugfix: when calculating zone of zones size use (mp_maxid + 1) instead of mp_ncpus. Use resulting number not only in the size argument to zone_ctor() but also as args.size. Reviewed by: imp, gallatin (earlier version) Differential Revision: https://reviews.freebsd.org/D14054 Modified: head/sys/kern/kern_malloc.c head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_page.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/kern/kern_malloc.c Tue Feb 6 04:16:00 2018 (r328916) @@ -96,6 +96,8 @@ __FBSDID("$FreeBSD$"); dtrace_malloc_probe_func_t dtrace_malloc_probe; #endif +extern void uma_startup2(void); + #if defined(INVARIANTS) || defined(MALLOC_MAKE_FAILURES) || \ defined(DEBUG_MEMGUARD) || defined(DEBUG_REDZONE) #define MALLOC_DEBUG 1 Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/vm/uma.h Tue Feb 6 04:16:00 2018 (r328916) @@ -431,40 +431,6 @@ typedef void *(*uma_alloc)(uma_zone_t zone, vm_size_t typedef void (*uma_free)(void *item, vm_size_t size, uint8_t pflag); /* - * Sets up the uma allocator. (Called by vm_mem_init) - * - * Arguments: - * bootmem A pointer to memory used to bootstrap the system. - * - * Returns: - * Nothing - * - * Discussion: - * This memory is used for zones which allocate things before the - * backend page supplier can give us pages. It should be - * UMA_SLAB_SIZE * boot_pages bytes. (see uma_int.h) - * - */ - -void uma_startup(void *bootmem, int boot_pages); - -/* - * Finishes starting up the allocator. This should - * be called when kva is ready for normal allocs. - * - * Arguments: - * None - * - * Returns: - * Nothing - * - * Discussion: - * uma_startup2 is called by kmeminit() to enable us of uma for malloc. - */ - -void uma_startup2(void); - -/* * Reclaims unused memory for all zones * * Arguments: Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/vm/uma_core.c Tue Feb 6 04:16:00 2018 (r328916) @@ -149,9 +149,8 @@ static unsigned long uma_kmem_limit = LONG_MAX; static volatile unsigned long uma_kmem_total; /* Is the VM done starting up? */ -static int booted = 0; -#define UMA_STARTUP 1 -#define UMA_STARTUP2 2 +static enum { BOOT_COLD = 0, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, + BOOT_RUNNING } booted = BOOT_COLD; /* * This is the handle used to schedule events that need to happen @@ -226,6 +225,11 @@ enum zfreeskip { SKIP_NONE = 0, SKIP_DTOR, SKIP_FINI } /* Prototypes.. */ +int uma_startup_count(int); +void uma_startup(void *, int); +void uma_startup1(void); +void uma_startup2(void); + static void *noobj_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void *page_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); static void *startup_alloc(uma_zone_t, vm_size_t, int, uint8_t *, int); @@ -1084,6 +1088,11 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do * Check our small startup cache to see if it has pages remaining. */ mtx_lock(&uma_boot_pages_mtx); +#ifdef DIAGNOSTIC + if (booted < BOOT_PAGEALLOC) + printf("%s from \"%s\", %d boot pages left\n", __func__, + zone->uz_name, boot_pages); +#endif if (pages <= boot_pages) { mem = bootmem; boot_pages -= pages; @@ -1093,7 +1102,7 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do return (mem); } mtx_unlock(&uma_boot_pages_mtx); - if (booted < UMA_STARTUP2) + if (booted < BOOT_PAGEALLOC) panic("UMA: Increase vm.boot_pages"); /* * Now that we've booted reset these users to their real allocator. @@ -1472,7 +1481,7 @@ keg_ctor(void *mem, int size, void *udata, int flags) * If we haven't booted yet we need allocations to go through the * startup cache until the vm is ready. */ - if (booted < UMA_STARTUP2) + if (booted < BOOT_PAGEALLOC) keg->uk_allocf = startup_alloc; #ifdef UMA_MD_SMALL_ALLOC else if (keg->uk_ppera == 1) @@ -1770,25 +1779,63 @@ zone_foreach(void (*zfunc)(uma_zone_t)) rw_runlock(&uma_rwlock); } -/* Public functions */ -/* See uma.h */ +/* + * Count how many pages do we need to bootstrap. VM supplies + * its need in early zones in the argument, we add up our zones, + * which consist of: UMA Slabs, UMA Hash and 9 Bucket zones. The + * zone of zones and zone of kegs are accounted separately. + */ +#define UMA_BOOT_ZONES 11 +static int zsize, ksize; +int +uma_startup_count(int zones) +{ + int pages; + + ksize = sizeof(struct uma_keg) + + (sizeof(struct uma_domain) * vm_ndomains); + zsize = sizeof(struct uma_zone) + + (sizeof(struct uma_cache) * (mp_maxid + 1)) + + (sizeof(struct uma_zone_domain) * vm_ndomains); + + /* Memory for the zone of zones and zone of kegs. */ + pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + + zones += UMA_BOOT_ZONES; + + /* Memory for startup zones, UMA and VM, ... */ + if (zsize > UMA_SLAB_SIZE) + pages += zones * howmany(zsize, UMA_SLAB_SIZE); + else + pages += howmany(zones, UMA_SLAB_SIZE / zsize); + + /* ... and their kegs. */ + pages += howmany(ksize * zones, UMA_SLAB_SIZE); + + /* + * Take conservative approach that every zone + * is going to allocate hash. + */ + pages += howmany(sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT * + zones, UMA_SLAB_SIZE); + + return (pages); +} + void uma_startup(void *mem, int npages) { struct uma_zctor_args args; uma_keg_t masterkeg; uintptr_t m; - int zsize; - int ksize; +#ifdef DIAGNOSTIC + printf("Entering %s with %d boot pages configured\n", __func__, npages); +#endif + rw_init(&uma_rwlock, "UMA lock"); - ksize = sizeof(struct uma_keg) + - (sizeof(struct uma_domain) * vm_ndomains); - zsize = sizeof(struct uma_zone) + - (sizeof(struct uma_cache) * mp_ncpus) + - (sizeof(struct uma_zone_domain) * vm_ndomains); - /* Use bootpages memory for the zone of zones and zone of kegs. */ m = (uintptr_t)mem; zones = (uma_zone_t)m; @@ -1819,9 +1866,7 @@ uma_startup(void *mem, int npages) boot_pages = npages; args.name = "UMA Zones"; - args.size = sizeof(struct uma_zone) + - (sizeof(struct uma_cache) * (mp_maxid + 1)) + - (sizeof(struct uma_zone_domain) * vm_ndomains); + args.size = zsize; args.ctor = zone_ctor; args.dtor = zone_dtor; args.uminit = zero_init; @@ -1844,27 +1889,37 @@ uma_startup(void *mem, int npages) bucket_init(); - booted = UMA_STARTUP; + booted = BOOT_STRAPPED; } -/* see uma.h */ void +uma_startup1(void) +{ + +#ifdef DIAGNOSTIC + printf("Entering %s with %d boot pages left\n", __func__, boot_pages); +#endif + booted = BOOT_PAGEALLOC; +} + +void uma_startup2(void) { - booted = UMA_STARTUP2; - bucket_enable(); + + booted = BOOT_BUCKETS; sx_init(&uma_drain_lock, "umadrain"); + bucket_enable(); } /* * Initialize our callout handle * */ - static void uma_startup3(void) { + booted = BOOT_RUNNING; callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); } @@ -1884,6 +1939,7 @@ uma_kcreate(uma_zone_t zone, size_t size, uma_init umi return (zone_alloc_item(kegs, &args, UMA_ANYDOMAIN, M_WAITOK)); } +/* Public functions */ /* See uma.h */ void uma_set_align(int align) @@ -1932,7 +1988,7 @@ uma_zcreate(const char *name, size_t size, uma_ctor ct args.flags = flags; args.keg = NULL; - if (booted < UMA_STARTUP2) { + if (booted < BOOT_BUCKETS) { locked = false; } else { sx_slock(&uma_drain_lock); @@ -1966,7 +2022,7 @@ uma_zsecond_create(char *name, uma_ctor ctor, uma_dtor args.flags = keg->uk_flags | UMA_ZONE_SECONDARY; args.keg = keg; - if (booted < UMA_STARTUP2) { + if (booted < BOOT_BUCKETS) { locked = false; } else { sx_slock(&uma_drain_lock); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/vm/uma_int.h Tue Feb 6 04:16:00 2018 (r328916) @@ -134,10 +134,6 @@ #define UMA_SLAB_MASK (PAGE_SIZE - 1) /* Mask to get back to the page */ #define UMA_SLAB_SHIFT PAGE_SHIFT /* Number of bits PAGE_MASK */ -#define UMA_BOOT_PAGES 64 /* Pages allocated for startup */ -#define UMA_BOOT_PAGES_ZONES 32 /* Multiplier for pages to reserve */ - /* if uma_zone > PAGE_SIZE */ - /* Max waste percentage before going to off page slab management */ #define UMA_MAX_WASTE 10 Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Feb 6 02:13:44 2018 (r328915) +++ head/sys/vm/vm_page.c Tue Feb 6 04:16:00 2018 (r328916) @@ -125,6 +125,10 @@ __FBSDID("$FreeBSD$"); #include +extern int uma_startup_count(int); +extern void uma_startup(void *, int); +extern void uma_startup1(void); + /* * Associated with page of user-allocatable memory is a * page structure. @@ -145,7 +149,7 @@ vm_page_t vm_page_array; long vm_page_array_size; long first_page; -static int boot_pages = UMA_BOOT_PAGES; +static int boot_pages; SYSCTL_INT(_vm, OID_AUTO, boot_pages, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, &boot_pages, 0, "number of pages allocated for bootstrapping the VM system"); @@ -466,7 +470,7 @@ vm_page_startup(vm_offset_t vaddr) vm_paddr_t end, high_avail, low_avail, new_end, page_range, size; vm_paddr_t biggestsize, last_pa, pa; u_long pagecount; - int biggestone, i, pages_per_zone, segind; + int biggestone, i, segind; biggestsize = 0; biggestone = 0; @@ -496,26 +500,13 @@ vm_page_startup(vm_offset_t vaddr) vm_page_domain_init(&vm_dom[i]); /* - * Almost all of the pages needed for bootstrapping UMA are used - * for zone structures, so if the number of CPUs results in those - * structures taking more than one page each, we set aside more pages - * in proportion to the zone structure size. - */ - pages_per_zone = howmany(sizeof(struct uma_zone) + - sizeof(struct uma_cache) * (mp_maxid + 1) + - roundup2(sizeof(struct uma_slab), sizeof(void *)), UMA_SLAB_SIZE); - if (pages_per_zone > 1) { - /* Reserve more pages so that we don't run out. */ - boot_pages = UMA_BOOT_PAGES_ZONES * pages_per_zone; - } - - /* * Allocate memory for use when boot strapping the kernel memory * allocator. * * CTFLAG_RDTUN doesn't work during the early boot process, so we must * manually fetch the value. */ + boot_pages = uma_startup_count(0); TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); new_end = end - (boot_pages * UMA_SLAB_SIZE); new_end = trunc_page(new_end); @@ -748,6 +739,9 @@ vm_page_startup(vm_offset_t vaddr) * can work. */ domainset_zero(); + + /* Announce page availability to UMA. */ + uma_startup1(); return (vaddr); } From owner-svn-src-head@freebsd.org Tue Feb 6 04:28:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB31EF1F14; Tue, 6 Feb 2018 04:28:22 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6378C74460; Tue, 6 Feb 2018 04:28:22 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E1D612E67; Tue, 6 Feb 2018 04:28:22 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w164SMQt002359; Tue, 6 Feb 2018 04:28:22 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w164SMRj002358; Tue, 6 Feb 2018 04:28:22 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201802060428.w164SMRj002358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Tue, 6 Feb 2018 04:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328917 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 328917 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.25 Precedence: list List-Id: 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, 06 Feb 2018 04:28:22 -0000 Author: bryanv Date: Tue Feb 6 04:28:21 2018 New Revision: 328917 URL: https://svnweb.freebsd.org/changeset/base/328917 Log: Correct structure name used in bus_map_resource(9) example Reviewed by: jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14188 Modified: head/share/man/man9/bus_map_resource.9 Modified: head/share/man/man9/bus_map_resource.9 ============================================================================== --- head/share/man/man9/bus_map_resource.9 Tue Feb 6 04:16:00 2018 (r328916) +++ head/share/man/man9/bus_map_resource.9 Tue Feb 6 04:28:21 2018 (r328917) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2016 +.Dd February 5, 2018 .Dt BUS_MAP_RESOURCE 9 .Os .Sh NAME @@ -143,16 +143,16 @@ reads the first 32-bit word: .Bd -literal struct resource *r; struct resource_map map; - struct resource_map_args args; + struct resource_map_request req; uint32_t val; int rid; rid = PCIR_BAR(0); r = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_UNMAPPED); - resource_init_map_request(&args); - args.memattr = VM_MEMATTR_WRITE_COMBINING; - bus_map_resource(dev, SYS_RES_MEMORY, r, &args, &map); + resource_init_map_request(&req); + req.memattr = VM_MEMATTR_WRITE_COMBINING; + bus_map_resource(dev, SYS_RES_MEMORY, r, &req, &map); val = bus_read_4(&map, 0); .Ed .Sh SEE ALSO From owner-svn-src-head@freebsd.org Tue Feb 6 06:42:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DFDFED76BE; Tue, 6 Feb 2018 06:42:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 046B178FF2; Tue, 6 Feb 2018 06:42:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F37191456C; Tue, 6 Feb 2018 06:42:26 +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 w166gQYk071139; Tue, 6 Feb 2018 06:42:26 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w166gP3S071121; Tue, 6 Feb 2018 06:42:25 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201802060642.w166gP3S071121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 6 Feb 2018 06:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328918 - in head/sys/cam: . ata ctl mmc nvme scsi X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/cam: . ata ctl mmc nvme scsi X-SVN-Commit-Revision: 328918 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.25 Precedence: list List-Id: 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, 06 Feb 2018 06:42:27 -0000 Author: scottl Date: Tue Feb 6 06:42:25 2018 New Revision: 328918 URL: https://svnweb.freebsd.org/changeset/base/328918 Log: Return a C errno for cam_periph_acquire(). There's no compelling reason to return a cam_status type for this function and doing so only creates confusion with normal C coding practices. It's technically an API change, but the periph API isn't widely used. No efffective change to operation. Reviewed by: imp, mav, ken Sponsored by: Netflix Differential Revision: D14063 Modified: head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_pmp.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/ctl/scsi_ctl.c head/sys/cam/mmc/mmc_da.c head/sys/cam/mmc/mmc_xpt.c head/sys/cam/nvme/nvme_da.c head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_pass.c head/sys/cam/scsi/scsi_pt.c head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_sg.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/ata/ata_da.c Tue Feb 6 06:42:25 2018 (r328918) @@ -911,7 +911,7 @@ adaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return(ENXIO); } @@ -1328,7 +1328,7 @@ adaasync(void *callback_arg, u_int32_t code, softc->state = ADA_STATE_LOGDIR; else break; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) softc->state = ADA_STATE_NORMAL; else xpt_schedule(periph, CAM_PRIORITY_DEV); @@ -1841,7 +1841,7 @@ adaregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * adadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -1866,7 +1866,7 @@ adaregister(struct cam_periph *periph, void *arg) * Create our sysctl variables, now that we know * we have successfully attached. */ - if (cam_periph_acquire(periph) == CAM_REQ_CMP) + if (cam_periph_acquire(periph) == 0) taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); /* Modified: head/sys/cam/ata/ata_pmp.c ============================================================================== --- head/sys/cam/ata/ata_pmp.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/ata/ata_pmp.c Tue Feb 6 06:42:25 2018 (r328918) @@ -315,7 +315,7 @@ pmpasync(void *callback_arg, u_int32_t code, if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (cam_periph_acquire(periph) == 0) { if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) softc->state = PMP_STATE_PM_QUIRKS_1; @@ -343,7 +343,7 @@ pmpsysctlinit(void *context, int pending) char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return; softc = (struct pmp_softc *)periph->softc; Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/ata/ata_xpt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -280,7 +280,6 @@ static cam_status proberegister(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; probe_softc *softc; request_ccb = (union ccb *)arg; @@ -304,10 +303,9 @@ proberegister(struct cam_periph *periph, void *arg) periph->softc = softc; softc->periph = periph; softc->action = PROBE_INVALID; - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) { - return (status); - } + if (cam_periph_acquire(periph) != 0) + return (CAM_REQ_CMP_ERR); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); ata_device_transport(periph->path); probeschedule(periph); Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/cam_periph.c Tue Feb 6 06:42:25 2018 (r328918) @@ -403,19 +403,19 @@ retry: return (count); } -cam_status +int cam_periph_acquire(struct cam_periph *periph) { - cam_status status; + int status; - status = CAM_REQ_CMP_ERR; if (periph == NULL) - return (status); + return (EINVAL); + status = ENOENT; xpt_lock_buses(); if ((periph->flags & CAM_PERIPH_INVALID) == 0) { periph->refcount++; - status = CAM_REQ_CMP; + status = 0; } xpt_unlock_buses(); @@ -482,7 +482,7 @@ cam_periph_hold(struct cam_periph *periph, int priorit * from user us while we sleep. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); cam_periph_assert(periph, MA_OWNED); Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/cam_periph.h Tue Feb 6 06:42:25 2018 (r328918) @@ -159,7 +159,7 @@ cam_status cam_periph_alloc(periph_ctor_t *periph_ctor ac_callback_t *, ac_code, void *arg); struct cam_periph *cam_periph_find(struct cam_path *path, char *name); int cam_periph_list(struct cam_path *, struct sbuf *); -cam_status cam_periph_acquire(struct cam_periph *periph); +int cam_periph_acquire(struct cam_periph *periph); void cam_periph_doacquire(struct cam_periph *periph); void cam_periph_release(struct cam_periph *periph); void cam_periph_release_locked(struct cam_periph *periph); Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/ctl/scsi_ctl.c Tue Feb 6 06:42:25 2018 (r328918) @@ -459,7 +459,7 @@ ctlferegister(struct cam_periph *periph, void *arg) struct ctlfe_lun_softc *softc; union ccb ccb; cam_status status; - int i; + int i, acstatus; softc = (struct ctlfe_lun_softc *)arg; bus_softc = softc->parent_softc; @@ -539,11 +539,11 @@ ctlferegister(struct cam_periph *periph, void *arg) } } - status = cam_periph_acquire(periph); - if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + acstatus = cam_periph_acquire(periph); + if (acstatus != 0) { xpt_print(periph->path, "%s: could not acquire reference " - "count, status = %#x\n", __func__, status); - return (status); + "count, status = %#x\n", __func__, acstatus); + return (CAM_REQ_CMP_ERR); } if (i == 0) { Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/mmc/mmc_da.c Tue Feb 6 06:42:25 2018 (r328918) @@ -369,7 +369,7 @@ sddaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return(ENXIO); } @@ -744,7 +744,7 @@ sdda_hook_into_geom(struct cam_periph *periph) * We'll release this reference once GEOM calls us back (via * sddadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/mmc/mmc_xpt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -471,9 +471,9 @@ probe_periph_init() static cam_status mmcprobe_register(struct cam_periph *periph, void *arg) { - union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; mmcprobe_softc *softc; + union ccb *request_ccb; /* CCB representing the probe request */ + int status; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("mmcprobe_register\n")); @@ -501,10 +501,10 @@ mmcprobe_register(struct cam_periph *periph, void *arg status = cam_periph_acquire(periph); memset(&periph->path->device->mmc_ident_data, 0, sizeof(struct mmc_params)); - if (status != CAM_REQ_CMP) { + if (status != 0) { printf("proberegister: cam_periph_acquire failed (status=%d)\n", status); - return (status); + return (CAM_REQ_CMP_ERR); } CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/nvme/nvme_da.c Tue Feb 6 06:42:25 2018 (r328918) @@ -260,7 +260,7 @@ ndaopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return(ENXIO); } @@ -785,7 +785,7 @@ ndaregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * ndadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -807,7 +807,7 @@ ndaregister(struct cam_periph *periph, void *arg) * Create our sysctl variables, now that we know * we have successfully attached. */ - if (cam_periph_acquire(periph) == CAM_REQ_CMP) + if (cam_periph_acquire(periph) == 0) taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); /* Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/nvme/nvme_xpt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -198,7 +198,6 @@ static cam_status nvme_probe_register(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; nvme_probe_softc *softc; request_ccb = (union ccb *)arg; @@ -222,10 +221,9 @@ nvme_probe_register(struct cam_periph *periph, void *a periph->softc = softc; softc->periph = periph; softc->action = NVME_PROBE_INVALID; - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) { - return (status); - } + if (cam_periph_acquire(periph) != 0) + return (CAM_REQ_CMP_ERR); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); // nvme_device_transport(periph->path); Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_cd.c Tue Feb 6 06:42:25 2018 (r328918) @@ -445,7 +445,7 @@ cdasync(void *callback_arg, u_int32_t code, case AC_SCSI_AEN: softc = (struct cd_softc *)periph->softc; if (softc->state == CD_STATE_NORMAL && !softc->tur) { - if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (cam_periph_acquire(periph) == 0) { softc->tur = 1; xpt_schedule(periph, CAM_PRIORITY_NORMAL); } @@ -480,7 +480,7 @@ cdsysctlinit(void *context, int pending) char tmpstr[32], tmpstr2[16]; periph = (struct cam_periph *)context; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return; softc = (struct cd_softc *)periph->softc; @@ -676,7 +676,7 @@ cdregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * dadiskgonecb()) telling us that our provider has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -717,7 +717,7 @@ cdopen(struct disk *dp) periph = (struct cam_periph *)dp->d_drv1; softc = (struct cd_softc *)periph->softc; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return(ENXIO); cam_periph_lock(periph); @@ -2601,7 +2601,7 @@ cdmediapoll(void *arg) if (softc->state == CD_STATE_NORMAL && !softc->tur && softc->outstanding_cmds == 0) { - if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + if (cam_periph_acquire(periph) == 0) { softc->tur = 1; xpt_schedule(periph, CAM_PRIORITY_NORMAL); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_da.c Tue Feb 6 06:42:25 2018 (r328918) @@ -1565,7 +1565,7 @@ da_periph_acquire(struct cam_periph *periph, da_ref_to token_sanity(token); DA_PERIPH_PRINT(periph, "acquiring device %s (%d): %d\n", da_ref_text[token], token, err); - if (err == CAM_REQ_CMP) { + if (err == 0) { int cnt; struct da_softc *softc = periph->softc; @@ -1628,7 +1628,7 @@ daopen(struct disk *dp) int error; periph = (struct cam_periph *)dp->d_drv1; - if (da_periph_acquire(periph, DA_REF_OPEN) != CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_OPEN) != 0) { return (ENXIO); } @@ -2061,7 +2061,7 @@ daasync(void *callback_arg, u_int32_t code, case AC_SCSI_AEN: softc = (struct da_softc *)periph->softc; if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR)) { - if (da_periph_acquire(periph, DA_REF_TUR) == CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_TUR) == 0) { cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); daschedule(periph); } @@ -2732,7 +2732,7 @@ daregister(struct cam_periph *periph, void *arg) * We'll release this reference once GEOM calls us back (via * dadiskgonecb()) telling us that our provider has been freed. */ - if (da_periph_acquire(periph, DA_REF_GEOM) != CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_GEOM) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -4700,7 +4700,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) * we have successfully attached. */ /* increase the refcount */ - if (da_periph_acquire(periph, DA_REF_SYSCTL) == CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_SYSCTL) == 0) { taskqueue_enqueue(taskqueue_thread, &softc->sysctl_task); @@ -5558,7 +5558,7 @@ static void dareprobe(struct cam_periph *periph) { struct da_softc *softc; - cam_status status; + int status; softc = (struct da_softc *)periph->softc; @@ -5567,8 +5567,7 @@ dareprobe(struct cam_periph *periph) return; status = da_periph_acquire(periph, DA_REF_REPROBE); - KASSERT(status == CAM_REQ_CMP, - ("dareprobe: cam_periph_acquire failed")); + KASSERT(status == 0, ("dareprobe: cam_periph_acquire failed")); softc->state = DA_STATE_PROBE_WP; xpt_schedule(periph, CAM_PRIORITY_DEV); @@ -5666,7 +5665,7 @@ damediapoll(void *arg) if (!cam_iosched_has_work_flags(softc->cam_iosched, DA_WORK_TUR) && LIST_EMPTY(&softc->pending_ccbs)) { - if (da_periph_acquire(periph, DA_REF_TUR) == CAM_REQ_CMP) { + if (da_periph_acquire(periph, DA_REF_TUR) == 0) { cam_iosched_set_work_flags(softc->cam_iosched, DA_WORK_TUR); daschedule(periph); } Modified: head/sys/cam/scsi/scsi_enc.c ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_enc.c Tue Feb 6 06:42:25 2018 (r328918) @@ -267,7 +267,7 @@ enc_open(struct cdev *dev, int flags, int fmt, struct int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); cam_periph_lock(periph); @@ -859,7 +859,7 @@ enc_kproc_init(enc_softc_t *enc) callout_init_mtx(&enc->status_updater, cam_periph_mtx(enc->periph), 0); - if (cam_periph_acquire(enc->periph) != CAM_REQ_CMP) + if (cam_periph_acquire(enc->periph) != 0) return (ENXIO); result = kproc_create(enc_daemon, enc, &enc->enc_daemon, /*flags*/0, @@ -975,7 +975,7 @@ enc_ctor(struct cam_periph *periph, void *arg) * instance for it. We'll release this reference once the devfs * instance has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); Modified: head/sys/cam/scsi/scsi_pass.c ============================================================================== --- head/sys/cam/scsi/scsi_pass.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_pass.c Tue Feb 6 06:42:25 2018 (r328918) @@ -518,7 +518,6 @@ passasync(void *callback_arg, u_int32_t code, buftype = (uintptr_t)arg; if (buftype == CDAI_TYPE_PHYS_PATH) { struct pass_softc *softc; - cam_status status; softc = (struct pass_softc *)periph->softc; /* @@ -527,8 +526,7 @@ passasync(void *callback_arg, u_int32_t code, * a situation where the periph goes away before * the task queue has a chance to run. */ - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) break; taskqueue_enqueue(taskqueue_thread, @@ -626,7 +624,7 @@ passregister(struct cam_periph *periph, void *arg) * Acquire a reference to the periph that we can release once we've * cleaned up the kqueue. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -638,7 +636,7 @@ passregister(struct cam_periph *periph, void *arg) * instance for it. We'll release this reference once the devfs * instance has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -665,7 +663,7 @@ passregister(struct cam_periph *periph, void *arg) * Hold a reference to the periph before we create the physical * path alias so it can't go away. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -705,7 +703,7 @@ passopen(struct cdev *dev, int flags, int fmt, struct int error; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); cam_periph_lock(periph); Modified: head/sys/cam/scsi/scsi_pt.c ============================================================================== --- head/sys/cam/scsi/scsi_pt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_pt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -142,7 +142,7 @@ ptopen(struct cdev *dev, int flags, int fmt, struct th int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); softc = (struct pt_softc *)periph->softc; Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_sa.c Tue Feb 6 06:42:25 2018 (r328918) @@ -657,7 +657,7 @@ saopen(struct cdev *dev, int flags, int fmt, struct th int error; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { return (ENXIO); } @@ -2495,7 +2495,7 @@ saregister(struct cam_periph *periph, void *arg) * instances for it. We'll release this reference once the devfs * instances have been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); Modified: head/sys/cam/scsi/scsi_sg.c ============================================================================== --- head/sys/cam/scsi/scsi_sg.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_sg.c Tue Feb 6 06:42:25 2018 (r328918) @@ -353,7 +353,7 @@ sgregister(struct cam_periph *periph, void *arg) * instance for it. We'll release this reference once the devfs * instance has been freed. */ - if (cam_periph_acquire(periph) != CAM_REQ_CMP) { + if (cam_periph_acquire(periph) != 0) { xpt_print(periph->path, "%s: lost periph during " "registration!\n", __func__); cam_periph_lock(periph); @@ -439,7 +439,7 @@ sgopen(struct cdev *dev, int flags, int fmt, struct th int error = 0; periph = (struct cam_periph *)dev->si_drv1; - if (cam_periph_acquire(periph) != CAM_REQ_CMP) + if (cam_periph_acquire(periph) != 0) return (ENXIO); /* Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Tue Feb 6 04:28:21 2018 (r328917) +++ head/sys/cam/scsi/scsi_xpt.c Tue Feb 6 06:42:25 2018 (r328918) @@ -657,7 +657,6 @@ static cam_status proberegister(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ - cam_status status; probe_softc *softc; request_ccb = (union ccb *)arg; @@ -681,10 +680,9 @@ proberegister(struct cam_periph *periph, void *arg) periph->softc = softc; softc->periph = periph; softc->action = PROBE_INVALID; - status = cam_periph_acquire(periph); - if (status != CAM_REQ_CMP) { - return (status); - } + if (cam_periph_acquire(periph) != 0) + return (CAM_REQ_CMP_ERR); + CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); scsi_devise_transport(periph->path); From owner-svn-src-head@freebsd.org Tue Feb 6 06:55:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7442ED91A0; Tue, 6 Feb 2018 06:55:55 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E14E79635; Tue, 6 Feb 2018 06:55:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88DD71471C; Tue, 6 Feb 2018 06:55:55 +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 w166ttea076106; Tue, 6 Feb 2018 06:55:55 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w166ttPw076105; Tue, 6 Feb 2018 06:55:55 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201802060655.w166ttPw076105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 6 Feb 2018 06:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328919 - head/sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mps X-SVN-Commit-Revision: 328919 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.25 Precedence: list List-Id: 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, 06 Feb 2018 06:55:56 -0000 Author: scottl Date: Tue Feb 6 06:55:55 2018 New Revision: 328919 URL: https://svnweb.freebsd.org/changeset/base/328919 Log: Fix a case where a request frame can be composed that requires 2 or more SGList elements, but there's only enough space in the request frame for either 1 element or a chain frame pointer. Previously, the code would hit the wrong case, add the SGList element, but then fail to add the chain frame due to lack of space. Re-arrange the code to catch this case earlier and handle it. Sponsored by: Netflix Modified: head/sys/dev/mps/mps.c Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 6 06:42:25 2018 (r328918) +++ head/sys/dev/mps/mps.c Tue Feb 6 06:55:55 2018 (r328919) @@ -2609,6 +2609,17 @@ mps_push_sge(struct mps_command *cm, void *sgep, size_ if (cm->cm_sglsize < MPS_SGC_SIZE) panic("MPS: Need SGE Error Code\n"); + if (segsleft >= 1 && cm->cm_sglsize < len + MPS_SGC_SIZE) { + /* + * 1 or more segment, enough room for only a chain. + * Hope the previous element wasn't a Simple entry + * that needed to be marked with + * MPI2_SGE_FLAGS_LAST_ELEMENT. Case (4). + */ + if ((error = mps_add_chain(cm)) != 0) + return (error); + } + if (segsleft >= 2 && cm->cm_sglsize < len + MPS_SGC_SIZE + MPS_SGE64_SIZE) { /* @@ -2631,17 +2642,6 @@ mps_push_sge(struct mps_command *cm, void *sgep, size_ bcopy(sgep, cm->cm_sge, len); cm->cm_sge = (MPI2_SGE_IO_UNION *)((uintptr_t)cm->cm_sge + len); return (mps_add_chain(cm)); - } - - if (segsleft >= 1 && cm->cm_sglsize < len + MPS_SGC_SIZE) { - /* - * 1 or more segment, enough room for only a chain. - * Hope the previous element wasn't a Simple entry - * that needed to be marked with - * MPI2_SGE_FLAGS_LAST_ELEMENT. Case (4). - */ - if ((error = mps_add_chain(cm)) != 0) - return (error); } #ifdef INVARIANTS From owner-svn-src-head@freebsd.org Tue Feb 6 08:15:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D5DEE17A3; Tue, 6 Feb 2018 08:15:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (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 9950D7C694; Tue, 6 Feb 2018 08:15:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id x128so1497048ite.0; Tue, 06 Feb 2018 00:15: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=k9MRwf+VyRTYDtwfJUbsI+jyVKyAWOKthwYkJUTmcjM=; b=IxAsLhzL4g9Iz3RQWUWmwAOlCFp/8OsFwkbZ2jFfjrwWe/vO6GhvbWGrycBsgFkIeK gIghRojaA/pjL8D0TiT7G3RtB/+gv39tRyAJJa+l4D6Q6pM4oJTt24OS3g7pdBhDYvvV e1ow1dPmsasNfGvznjEQnDWxmJ383d9WORXGzGH0UPSxk9m+0xA/4ybljphSNXHT8hBm 91XDhoG6BmPd43ncHKOPeZYRpdojDoutoAEG6/SRgkQ/pL1r1WOagR1483jhUQoXpqjB /X400TmelAOAUn2tMIIVncyRHGqiK7JgubLrzhME5H4XazhkNqzPPxnh6AUNxDfSvlyR QN+w== X-Gm-Message-State: APf1xPA1mnDOm/Dt1AmgNdOOT+Fi9TRt/mnB77aWF4G1WmOkuPjV/DkC zEUyAqANWZD7aLjzIS99fTWBnWqc X-Google-Smtp-Source: AH8x227cLPcUjj4+ArjpnIpQmZlgO7f+8q1PhqgmzDwoBXmIC7Ti7LVKjxXnUZKB2DioGWGD7LJ+fA== X-Received: by 10.36.146.196 with SMTP id l187mr2036733itd.115.1517904544534; Tue, 06 Feb 2018 00:09:04 -0800 (PST) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com. [209.85.223.170]) by smtp.gmail.com with ESMTPSA id u128sm6598213itb.1.2018.02.06.00.09.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Feb 2018 00:09:04 -0800 (PST) Received: by mail-io0-f170.google.com with SMTP id p188so1549084ioe.12; Tue, 06 Feb 2018 00:09:04 -0800 (PST) X-Received: by 10.107.15.89 with SMTP id x86mr2049858ioi.38.1517904543916; Tue, 06 Feb 2018 00:09:03 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.141.86 with HTTP; Tue, 6 Feb 2018 00:09:03 -0800 (PST) In-Reply-To: <201802060019.w160Jl1W076251@repo.freebsd.org> References: <201802060019.w160Jl1W076251@repo.freebsd.org> From: Conrad Meyer Date: Tue, 6 Feb 2018 00:09:03 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328914 - in head/sys: kern ufs/ffs To: Kirk McKusick 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.25 Precedence: list List-Id: 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, 06 Feb 2018 08:15:05 -0000 Hi Kirk, On Mon, Feb 5, 2018 at 4:19 PM, Kirk McKusick wrote: > Author: mckusick > Date: Tue Feb 6 00:19:46 2018 > New Revision: 328914 > URL: https://svnweb.freebsd.org/changeset/base/328914 > > Log: > ... > The second problem was that the check hash computed at the end of the > read was incorrect because the calculation of the check hash on > completion of the read was being done too soon. > > - When a read completes we had the following sequence: > > - bufdone() > -- b_ckhashcalc (calculates check hash) > -- bufdone_finish() > --- vfs_vmio_iodone() (replaces bogus pages with the cached ones) > > - When we are reading a buffer where one or more pages are already > in memory (but not all pages, or we wouldn't be doing the read), > the I/O is done with bogus_page mapped in for the pages that exist > in the VM cache. This mapping is done to avoid corrupting the > cached pages if there is any I/O overrun. The vfs_vmio_iodone() > function is responsible for replacing the bogus_page(s) with the > cached ones. But we were calculating the check hash before the > bogus_page(s) were replaced. Hence, when we were calculating the > check hash, we were partly reading from bogus_page, which means > we calculated a bad check hash (e.g., because multiple pages have > been mapped to bogus_page, so its contents are indeterminate). > > The second fix is to move the check-hash calculation from bufdone() > to bufdone_finish() after the call to vfs_vmio_iodone() so that it > computes the check hash over the correct set of pages. Does the b_iodone callback have a very similar potential problem? It is invoked in bufdone(), before bufdone_finish() and vfs_vmio_iodone(). One example b_iodone is the bdone() callback. It seems that b_iodone -> bdone() can then wake bwait()ers before any VMIO cached content has been filled in. I don't know that any specific consumers of b_iodone are currently broken, but it seems like maybe the b_iodone callback should really be in the later location as well. Best, Conrad From owner-svn-src-head@freebsd.org Tue Feb 6 08:34:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7422EE33B2; Tue, 6 Feb 2018 08:34:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 692327D537; Tue, 6 Feb 2018 08:34:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63F8E15766; Tue, 6 Feb 2018 08:34:50 +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 w168YoKu025638; Tue, 6 Feb 2018 08:34:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w168YooN025637; Tue, 6 Feb 2018 08:34:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802060834.w168YooN025637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 6 Feb 2018 08:34:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328922 - head/sys/dev/etherswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch X-SVN-Commit-Revision: 328922 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.25 Precedence: list List-Id: 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, 06 Feb 2018 08:34:50 -0000 Author: adrian Date: Tue Feb 6 08:34:50 2018 New Revision: 328922 URL: https://svnweb.freebsd.org/changeset/base/328922 Log: [etherswitch] add initial support for potentially configuring and fetching the switch MAC address. Switches that originate their own frames (eg obvious ones like Pause frames) need a MAC address to use to send those frames from. This API will hopefully begin to allow that to be configurable. Modified: head/sys/dev/etherswitch/etherswitch.h Modified: head/sys/dev/etherswitch/etherswitch.h ============================================================================== --- head/sys/dev/etherswitch/etherswitch.h Tue Feb 6 07:50:30 2018 (r328921) +++ head/sys/dev/etherswitch/etherswitch.h Tue Feb 6 08:34:50 2018 (r328922) @@ -48,10 +48,12 @@ typedef struct etherswitch_info etherswitch_info_t; #define ETHERSWITCH_CONF_FLAGS (1 << 0) #define ETHERSWITCH_CONF_MIRROR (1 << 1) #define ETHERSWITCH_CONF_VLAN_MODE (1 << 2) +#define ETHERSWITCH_CONF_SWITCH_MACADDR (1 << 3) struct etherswitch_conf { uint32_t cmd; /* What to configure */ uint32_t vlan_mode; /* Switch VLAN mode */ + struct ether_addr switch_macaddr; /* Switch MAC address */ }; typedef struct etherswitch_conf etherswitch_conf_t; From owner-svn-src-head@freebsd.org Tue Feb 6 08:35:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1143BEE342B; Tue, 6 Feb 2018 08:35:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8FA97D664; Tue, 6 Feb 2018 08:35:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3EB215767; Tue, 6 Feb 2018 08:35:09 +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 w168Z9fX025707; Tue, 6 Feb 2018 08:35:09 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w168Z9dP025706; Tue, 6 Feb 2018 08:35:09 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802060835.w168Z9dP025706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 6 Feb 2018 08:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328923 - head/sbin/etherswitchcfg X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sbin/etherswitchcfg X-SVN-Commit-Revision: 328923 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.25 Precedence: list List-Id: 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, 06 Feb 2018 08:35:10 -0000 Author: adrian Date: Tue Feb 6 08:35:09 2018 New Revision: 328923 URL: https://svnweb.freebsd.org/changeset/base/328923 Log: [etherswitchcfg] print the switch MAC address if provided. Modified: head/sbin/etherswitchcfg/etherswitchcfg.c Modified: head/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- head/sbin/etherswitchcfg/etherswitchcfg.c Tue Feb 6 08:34:50 2018 (r328922) +++ head/sbin/etherswitchcfg/etherswitchcfg.c Tue Feb 6 08:35:09 2018 (r328923) @@ -556,6 +556,13 @@ print_config(struct cfg *cfg) printf("none\n"); } } + + /* Print switch MAC address. */ + if (cfg->conf.cmd & ETHERSWITCH_CONF_SWITCH_MACADDR) { + printf("%s: Switch MAC address: %s\n", + c, + ether_ntoa(&cfg->conf.switch_macaddr)); + } } static void From owner-svn-src-head@freebsd.org Tue Feb 6 08:35:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A83DEE355C; Tue, 6 Feb 2018 08:35:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1B3D7D7B6; Tue, 6 Feb 2018 08:35:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BCBE31576B; Tue, 6 Feb 2018 08:35:49 +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 w168Zndw025775; Tue, 6 Feb 2018 08:35:49 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w168ZnBa025771; Tue, 6 Feb 2018 08:35:49 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802060835.w168ZnBa025771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 6 Feb 2018 08:35:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328924 - head/sys/dev/etherswitch/arswitch X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/etherswitch/arswitch X-SVN-Commit-Revision: 328924 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.25 Precedence: list List-Id: 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, 06 Feb 2018 08:35:50 -0000 Author: adrian Date: Tue Feb 6 08:35:49 2018 New Revision: 328924 URL: https://svnweb.freebsd.org/changeset/base/328924 Log: [arswitch] Implement the switch MAC address fetch API. The placeholders are here for some future "set" MAC address API. Tested: * AR9340 switch * AR8327 switch Modified: head/sys/dev/etherswitch/arswitch/arswitch.c head/sys/dev/etherswitch/arswitch/arswitchreg.h head/sys/dev/etherswitch/arswitch/arswitchvar.h Modified: head/sys/dev/etherswitch/arswitch/arswitch.c ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitch.c Tue Feb 6 08:35:09 2018 (r328923) +++ head/sys/dev/etherswitch/arswitch/arswitch.c Tue Feb 6 08:35:49 2018 (r328924) @@ -484,6 +484,41 @@ ar8xxx_atu_learn_default(struct arswitch_softc *sc) */ /* + * Fetch the configured switch MAC address. + */ +static int +ar8xxx_hw_get_switch_macaddr(struct arswitch_softc *sc, struct ether_addr *ea) +{ + uint32_t ret0, ret1; + char *s; + + s = (void *) ea; + + ret0 = arswitch_readreg(sc->sc_dev, AR8X16_REG_SW_MAC_ADDR0); + ret1 = arswitch_readreg(sc->sc_dev, AR8X16_REG_SW_MAC_ADDR1); + + s[5] = MS(ret0, AR8X16_REG_SW_MAC_ADDR0_BYTE5); + s[4] = MS(ret0, AR8X16_REG_SW_MAC_ADDR0_BYTE4); + s[3] = MS(ret1, AR8X16_REG_SW_MAC_ADDR1_BYTE3); + s[2] = MS(ret1, AR8X16_REG_SW_MAC_ADDR1_BYTE2); + s[1] = MS(ret1, AR8X16_REG_SW_MAC_ADDR1_BYTE1); + s[0] = MS(ret1, AR8X16_REG_SW_MAC_ADDR1_BYTE0); + + return (0); +} + +/* + * Set the switch mac address. + */ +static int +ar8xxx_hw_set_switch_macaddr(struct arswitch_softc *sc, + const struct ether_addr *ea) +{ + + return (ENXIO); +} + +/* * XXX TODO: this attach routine does NOT free all memory, resources * upon failure! */ @@ -527,6 +562,8 @@ arswitch_attach(device_t dev) sc->hal.arswitch_port_vlan_setup = ar8xxx_port_vlan_setup; sc->hal.arswitch_port_vlan_get = ar8xxx_port_vlan_get; sc->hal.arswitch_vlan_init_hw = ar8xxx_reset_vlans; + sc->hal.arswitch_hw_get_switch_macaddr = ar8xxx_hw_get_switch_macaddr; + sc->hal.arswitch_hw_set_switch_macaddr = ar8xxx_hw_set_switch_macaddr; sc->hal.arswitch_vlan_getvgroup = ar8xxx_getvgroup; sc->hal.arswitch_vlan_setvgroup = ar8xxx_setvgroup; @@ -1115,6 +1152,7 @@ static int arswitch_getconf(device_t dev, etherswitch_conf_t *conf) { struct arswitch_softc *sc; + int ret; sc = device_get_softc(dev); @@ -1122,6 +1160,13 @@ arswitch_getconf(device_t dev, etherswitch_conf_t *con conf->cmd = ETHERSWITCH_CONF_VLAN_MODE; conf->vlan_mode = sc->vlan_mode; + /* Return the switch ethernet address. */ + ret = sc->hal.arswitch_hw_get_switch_macaddr(sc, + &conf->switch_macaddr); + if (ret == 0) { + conf->cmd |= ETHERSWITCH_CONF_SWITCH_MACADDR; + } + return (0); } @@ -1139,6 +1184,8 @@ arswitch_setconf(device_t dev, etherswitch_conf_t *con if (err != 0) return (err); } + + /* TODO: Set the switch ethernet address. */ return (0); } Modified: head/sys/dev/etherswitch/arswitch/arswitchreg.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchreg.h Tue Feb 6 08:35:09 2018 (r328923) +++ head/sys/dev/etherswitch/arswitch/arswitchreg.h Tue Feb 6 08:35:49 2018 (r328924) @@ -88,7 +88,20 @@ #define AR8X16_REG_IMR 0x0014 #define AR8X16_REG_SW_MAC_ADDR0 0x0020 +#define AR8X16_REG_SW_MAC_ADDR0_BYTE4 BITS(8, 8) +#define AR8X16_REG_SW_MAC_ADDR0_BYTE4_S 8 +#define AR8X16_REG_SW_MAC_ADDR0_BYTE5 BITS(0, 8) +#define AR8X16_REG_SW_MAC_ADDR0_BYTE5_S 0 + #define AR8X16_REG_SW_MAC_ADDR1 0x0024 +#define AR8X16_REG_SW_MAC_ADDR1_BYTE0 BITS(24, 8) +#define AR8X16_REG_SW_MAC_ADDR1_BYTE0_S 24 +#define AR8X16_REG_SW_MAC_ADDR1_BYTE1 BITS(16, 8) +#define AR8X16_REG_SW_MAC_ADDR1_BYTE1_S 16 +#define AR8X16_REG_SW_MAC_ADDR1_BYTE2 BITS(8, 8) +#define AR8X16_REG_SW_MAC_ADDR1_BYTE2_S 8 +#define AR8X16_REG_SW_MAC_ADDR1_BYTE3 BITS(0, 8) +#define AR8X16_REG_SW_MAC_ADDR1_BYTE3_S 0 #define AR8X16_REG_FLOOD_MASK 0x002c #define AR8X16_FLOOD_MASK_BCAST_TO_CPU (1 << 26) Modified: head/sys/dev/etherswitch/arswitch/arswitchvar.h ============================================================================== --- head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Feb 6 08:35:09 2018 (r328923) +++ head/sys/dev/etherswitch/arswitch/arswitchvar.h Tue Feb 6 08:35:49 2018 (r328924) @@ -99,6 +99,11 @@ struct arswitch_softc { int (* arswitch_hw_setup) (struct arswitch_softc *); int (* arswitch_hw_global_setup) (struct arswitch_softc *); + int (* arswitch_hw_get_switch_macaddr) (struct arswitch_softc *, + struct ether_addr *sa); + int (* arswitch_hw_set_switch_macaddr) (struct arswitch_softc *, + const struct ether_addr *sa); + /* Port functions */ void (* arswitch_port_init) (struct arswitch_softc *, int); From owner-svn-src-head@freebsd.org Tue Feb 6 10:54:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3526EEDF01; Tue, 6 Feb 2018 10:54:46 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 3FB7682830; Tue, 6 Feb 2018 10:54:45 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2a02:c7f:1e13:cf00:258a:a641:4133:b7aa] (unknown [IPv6:2a02:c7f:1e13:cf00:258a:a641:4133:b7aa]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id C0D434EBDB; Tue, 6 Feb 2018 10:54:06 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r328916 - in head/sys: kern vm From: Andrew Turner In-Reply-To: <201802060416.w164G0va096970@repo.freebsd.org> Date: Tue, 6 Feb 2018 10:54:05 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6675B0B0-A582-4D5A-832B-A0E0E13B9E6C@fubar.geek.nz> References: <201802060416.w164G0va096970@repo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 10:54:46 -0000 > On 6 Feb 2018, at 04:16, Gleb Smirnoff wrote: >=20 > Author: glebius > Date: Tue Feb 6 04:16:00 2018 > New Revision: 328916 > URL: https://svnweb.freebsd.org/changeset/base/328916 >=20 > Log: > Followup on r302393 by cperciva, improving calculation of boot pages = required > for UMA startup. >=20 > o Introduce another stage of UMA startup, which is entered after > vm_page_startup() finishes. After this stage we don't yet enable = buckets, > but we can ask VM for pages. Rename stages to meaningful names = while here. > New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, = BOOT_BUCKETS, > BOOT_RUNNING. > Enabling page alloc earlier allows us to dramatically reduce number = of > boot pages required. What is more important number of zones becomes > consistent across different machines, as no MD allocations are done = before > the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need = to use > startup_alloc(), however that may change, so vm_page_startup() = provides > its need for early zones as argument. > o Introduce uma_startup_count() function, to avoid code duplication. = The > functions calculates sizes of zones zone and kegs zone, and = calculates how > many pages UMA will need to bootstrap. > It counts not only of zone structures, but also of kegs, slabs and = hashes. > o Hide uma_startup_foo() declarations from public file. > o Provide several DIAGNOSTIC printfs on boot_pages usage. > o Bugfix: when calculating zone of zones size use (mp_maxid + 1) = instead of > mp_ncpus. Use resulting number not only in the size argument to = zone_ctor() > but also as args.size. With this I=E2=80=99m getting "panic: UMA: Increase vm.boot_pages=E2=80=9D= on an arm64 simulator with 4GB of memory. I can increase vm.boot_pages = manually, however this isn=E2=80=99t useful in the long term. Andrew From owner-svn-src-head@freebsd.org Tue Feb 6 11:30:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89220EF0942; Tue, 6 Feb 2018 11:30:21 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38F7783D9E; Tue, 6 Feb 2018 11:30:20 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id D1D57D010AD; Tue, 6 Feb 2018 06:30:19 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w16BUHPE026271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 12:30:17 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w16BUH9I026270; Tue, 6 Feb 2018 12:30:17 +0100 (CET) (envelope-from pho) Date: Tue, 6 Feb 2018 12:30:17 +0100 From: Peter Holm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206113017.GA25428@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201802060416.w164G0va096970@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 11:30:21 -0000 On Tue, Feb 06, 2018 at 04:16:00AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Feb 6 04:16:00 2018 > New Revision: 328916 > URL: https://svnweb.freebsd.org/changeset/base/328916 > > Log: > Followup on r302393 by cperciva, improving calculation of boot pages required > for UMA startup. > > o Introduce another stage of UMA startup, which is entered after > vm_page_startup() finishes. After this stage we don't yet enable buckets, > but we can ask VM for pages. Rename stages to meaningful names while here. > New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, > BOOT_RUNNING. > Enabling page alloc earlier allows us to dramatically reduce number of > boot pages required. What is more important number of zones becomes > consistent across different machines, as no MD allocations are done before > the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need to use > startup_alloc(), however that may change, so vm_page_startup() provides > its need for early zones as argument. > o Introduce uma_startup_count() function, to avoid code duplication. The > functions calculates sizes of zones zone and kegs zone, and calculates how > many pages UMA will need to bootstrap. > It counts not only of zone structures, but also of kegs, slabs and hashes. > o Hide uma_startup_foo() declarations from public file. > o Provide several DIAGNOSTIC printfs on boot_pages usage. > o Bugfix: when calculating zone of zones size use (mp_maxid + 1) instead of > mp_ncpus. Use resulting number not only in the size argument to zone_ctor() > but also as args.size. > > Reviewed by: imp, gallatin (earlier version) > Differential Revision: https://reviews.freebsd.org/D14054 > > Modified: > head/sys/kern/kern_malloc.c > head/sys/vm/uma.h > head/sys/vm/uma_core.c > head/sys/vm/uma_int.h > head/sys/vm/vm_page.c > > Modified: head/sys/kern/kern_malloc.c > ============================================================================== > --- head/sys/kern/kern_malloc.c Tue Feb 6 02:13:44 2018 (r328915) i386 also doesn't boot: FreeBSD 12.0-CURRENT #1 r328924: Tue Feb 6 11:51:17 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Entering uma_startup with 4 boot pages configured startup_alloc from "UMA Kegs", 3 boot pages left startup_alloc from "UMA Zones", 2 boot pages left startup_alloc from "UMA Hash", 1 boot pages left Entering uma_startup1 with 0 boot pages left kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x19c fault code = supervisor read, page not present instruction pointer = 0x20:0xc0cda3f8 stack pointer = 0x28:0xc2022aac frame pointer = 0x28:0xc2022adc code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = resume, IOPL = 0 current process = 0 () [ thread pid 0 tid 0 ] Stopped at vmem_alloc+0x88: cmpl %esi,0x19c(%edi) db> x/s version version: FreeBSD 12.0-CURRENT #1 r328924: Tue Feb 6 11:51:17 CET 2018\012 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO\012 db> show registers cs 0x20 ds 0x28 es 0x28 fs 0x8 gs 0x28 ss 0x28 eax 0xc2022af8 ecx 0xc2022af8 edx 0xc23b5000 ebx 0x2002 esp 0xc2022aac ebp 0xc2022adc esi 0x1000 edi 0 eip 0xc0cda3f8 vmem_alloc+0x88 efl 0x10002 vmem_alloc+0x88: cmpl %esi,0x19c(%edi) db> bt Tracing pid 0 tid 0 td 0xc1be3f40 vmem_alloc(0,1000,2102,c2022af8,450,...) at vmem_alloc+0x88/frame 0xc2022adc kmem_malloc_domain(0,1000,102,450,c23b5000,...) at kmem_malloc_domain+0x44/frame 0xc2022b08 startup_alloc(c23b4000,1000,0,c2022b63,102,...) at startup_alloc+0xeb/frame 0xc2022b30 keg_alloc_slab(0,2,c169eb10,984,c169eb10,...) at keg_alloc_slab+0xf6/frame 0xc2022b78 keg_fetch_slab(ffffffff,2,c169eb10,9e6,c23b4000,...) at keg_fetch_slab+0x10e/frame 0xc2022bd0 zone_fetch_slab(c23b4000,0,ffffffff,2,ef0,...) at zone_fetch_slab+0x61/frame 0xc2022bf4 zone_import(c23b4000,c2022c50,1,ffffffff,2,...) at zone_import+0x3b/frame 0xc2022c2c zone_alloc_item(ffffffff,2,c1655850,c2022c94,c165585f,...) at zone_alloc_item+0x3d/frame 0xc2022c60 uma_zcreate(c165585f,1c,0,0,0,...) at uma_zcreate+0xce/frame 0xc2022cbc vmem_startup(c2157000,c0cc49fb,c12afc4b,c2022d0c,c2022d0c,...) at vmem_startup+0xb7/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c18689c0,...) at vm_mem_init+0x24/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f db> r328915 boots OK. - Peter From owner-svn-src-head@freebsd.org Tue Feb 6 11:54:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F5EEEF282B; Tue, 6 Feb 2018 11:54:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3173684F0C; Tue, 6 Feb 2018 11:54:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 284F21784C; Tue, 6 Feb 2018 11:54:21 +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 w16BsKY2024235; Tue, 6 Feb 2018 11:54:20 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16BsK8k024231; Tue, 6 Feb 2018 11:54:20 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201802061154.w16BsK8k024231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Feb 2018 11:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328925 - in head: . gnu/usr.bin/gdb gnu/usr.bin/gdb/gdbtui targets/pseudo/userland/gnu tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: . gnu/usr.bin/gdb gnu/usr.bin/gdb/gdbtui targets/pseudo/userland/gnu tools/build/mk X-SVN-Commit-Revision: 328925 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.25 Precedence: list List-Id: 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, 06 Feb 2018 11:54:21 -0000 Author: bapt Date: Tue Feb 6 11:54:20 2018 New Revision: 328925 URL: https://svnweb.freebsd.org/changeset/base/328925 Log: Remove gdbtui, it was already not installed on every arches only installed on arm and sparc64. It is the only bits that keeps us having libreadline in base The rest of gdb can be switched to libedit and will be in another commit Deleted: head/gnu/usr.bin/gdb/gdbtui/ Modified: head/ObsoleteFiles.inc head/gnu/usr.bin/gdb/Makefile head/targets/pseudo/userland/gnu/Makefile.depend head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Feb 6 08:35:49 2018 (r328924) +++ head/ObsoleteFiles.inc Tue Feb 6 11:54:20 2018 (r328925) @@ -38,10 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20180206: remove gdbtui +OLD_FILES+=usr/bin/gdbtui # 20180201: Obsolete forth files OLD_FILES+=boot/efi.4th OLD_FILES+=boot/pcibios.4th - # 20180114: new clang import which bumps version from 5.0.1 to 6.0.0. OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/5.0.1/include/sanitizer/asan_interface.h Modified: head/gnu/usr.bin/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/Makefile Tue Feb 6 08:35:49 2018 (r328924) +++ head/gnu/usr.bin/gdb/Makefile Tue Feb 6 11:54:20 2018 (r328925) @@ -5,8 +5,6 @@ SUBDIR= libgdb gdb kgdb .if ${MK_GDB_LIBEXEC} == "no" -SUBDIR+= gdbtui - .if exists(${.CURDIR}/gdbserver/reg-${MACHINE_CPUARCH}.c) SUBDIR+=gdbserver .endif Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Tue Feb 6 08:35:49 2018 (r328924) +++ head/targets/pseudo/userland/gnu/Makefile.depend Tue Feb 6 11:54:20 2018 (r328925) @@ -32,7 +32,6 @@ DIRDEPS = \ gnu/usr.bin/gdb/doc \ gnu/usr.bin/gdb/gdb \ gnu/usr.bin/gdb/gdbserver \ - gnu/usr.bin/gdb/gdbtui \ gnu/usr.bin/gdb/kgdb \ gnu/usr.bin/gdb/libgdb \ gnu/usr.bin/gperf \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 6 08:35:49 2018 (r328924) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Feb 6 11:54:20 2018 (r328925) @@ -2460,7 +2460,6 @@ OLD_FILES+=usr/share/man/man1/gcov.1.gz .if ${MK_GDB} == no || ${MK_GDB_LIBEXEC} == yes OLD_FILES+=usr/bin/gdb OLD_FILES+=usr/bin/gdbserver -OLD_FILES+=usr/bin/gdbtui OLD_FILES+=usr/bin/kgdb OLD_FILES+=usr/share/man/man1/gdb.1.gz OLD_FILES+=usr/share/man/man1/gdbserver.1.gz From owner-svn-src-head@freebsd.org Tue Feb 6 12:12:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C3A7EF40B2; Tue, 6 Feb 2018 12:12:45 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28C8085D73; Tue, 6 Feb 2018 12:12:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 239A017B8B; Tue, 6 Feb 2018 12:12:45 +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 w16CCiH7033845; Tue, 6 Feb 2018 12:12:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16CCicW033842; Tue, 6 Feb 2018 12:12:44 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201802061212.w16CCicW033842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Feb 2018 12:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328926 - in head/gnu/usr.bin/gdb: . gdb kgdb X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head/gnu/usr.bin/gdb: . gdb kgdb X-SVN-Commit-Revision: 328926 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.25 Precedence: list List-Id: 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, 06 Feb 2018 12:12:45 -0000 Author: bapt Date: Tue Feb 6 12:12:44 2018 New Revision: 328926 URL: https://svnweb.freebsd.org/changeset/base/328926 Log: Switch to use libedit instead of readline Modified: head/gnu/usr.bin/gdb/Makefile.inc head/gnu/usr.bin/gdb/gdb/Makefile head/gnu/usr.bin/gdb/kgdb/Makefile Modified: head/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- head/gnu/usr.bin/gdb/Makefile.inc Tue Feb 6 11:54:20 2018 (r328925) +++ head/gnu/usr.bin/gdb/Makefile.inc Tue Feb 6 12:12:44 2018 (r328926) @@ -13,11 +13,9 @@ BMAKE_BU= ${BMAKE_ROOT}/binutils CNTRB_BU= ${SRCTOP}/contrib/binutils CNTRB_GDB= ${SRCTOP}/contrib/gdb -CNTRB_RL= ${SRCTOP}/contrib/libreadline OBJ_BU= ${OBJTOP}/gnu/usr.bin/binutils OBJ_GDB= ${OBJTOP}/gnu/usr.bin/gdb -OBJ_RL= ${OBJTOP}/gnu/lib/libreadline/readline # These assignments duplicate much of the functionality of # MACHINE_CPUARCH, but there's no easy way to export make functions... @@ -37,7 +35,7 @@ GDB_CROSS_DEBUGGER= .PATH: ${CNTRB_GDB}/gdb ${CNTRB_GDB}/gdb/cli ${CNTRB_GDB}/gdb/mi \ ${CNTRB_GDB}/gdb/signals ${CNTRB_GDB}/gdb/tui ${TARGET_SUBDIR} -CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 -DTUI=1 +CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" CFLAGS+= -I. CFLAGS+= -I${TARGET_SUBDIR} @@ -47,7 +45,7 @@ CFLAGS+= -I${CNTRB_GDB}/gdb/config CFLAGS+= -I${CNTRB_BU}/include CFLAGS+= -I${CNTRB_GDB}/include CFLAGS+= -I${CNTRB_BU}/bfd -CFLAGS+= -I${OBJ_RL:H} +CFLAGS+= -I${SRCTOP}/lib/libedit/edit GENSRCS+= nm.h tm.h Modified: head/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdb/Makefile Tue Feb 6 11:54:20 2018 (r328925) +++ head/gnu/usr.bin/gdb/gdb/Makefile Tue Feb 6 12:12:44 2018 (r328926) @@ -13,7 +13,7 @@ LDFLAGS+= -Wl,-E DPADD= ${GDBLIBS} ${BULIBS} LDADD= ${GDBLIBS} ${BULIBS} -LIBADD+= m readline ncursesw gnuregex +LIBADD+= m edit ncursesw gnuregex .include CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" Modified: head/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/Makefile Tue Feb 6 11:54:20 2018 (r328925) +++ head/gnu/usr.bin/gdb/kgdb/Makefile Tue Feb 6 12:12:44 2018 (r328926) @@ -10,6 +10,6 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a DPADD= ${GDBLIBS} ${BULIBS} LDADD= ${GDBLIBS} ${BULIBS} -LIBADD+= m readline ncursesw gnuregex kvm +LIBADD+= m edit ncursesw gnuregex kvm .include From owner-svn-src-head@freebsd.org Tue Feb 6 12:14:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 360B1EF42B9; Tue, 6 Feb 2018 12:14:41 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mx.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B1BA85F43; Tue, 6 Feb 2018 12:14:40 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id w16CEWkr030491; Tue, 6 Feb 2018 12:14:32 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id w16CEVHY030490; Tue, 6 Feb 2018 04:14:31 -0800 (PST) (envelope-from david) Date: Tue, 6 Feb 2018 04:14:31 -0800 From: David Wolfskill To: Jason Harmening Cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328489 - head/sys/conf Message-ID: <20180206121431.GX1178@albert.catwhisker.org> References: <201801272013.w0RKDaMU098200@repo.freebsd.org> <20180127214755.3c59661e@thor.intern.walstatt.dynvpn.de> <98501f75-1a1b-9221-c52d-24415230a886@gmail.com> <20180129130022.GT1125@albert.catwhisker.org> <20180204133337.3d03f01d@thor.intern.walstatt.dynvpn.de> <20180205222622.43f5d3e7@thor.intern.walstatt.dynvpn.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9YbheLRFzEnE0aGp" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 12:14:41 -0000 --9YbheLRFzEnE0aGp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 05, 2018 at 01:32:04PM -0800, Jason Harmening wrote: > .... > Can you try downloading the raw diff from > https://reviews.freebsd.org/D14143 and > applying that to src? > .... For this morning's update of head (from r328876 to r328924), I reverted an earlier patch to src/sys/conf/kern.post.mk and applied the above-cited D14143 -- both on my laptop (which has PORTS_MODULES=3Dx11/nvidia-driver-340 in /etc/src.conf) and my build machine (which runs mostly-headless, and has no ports modules). No issues; everything Just Worked. Peace, david --=20 David H. Wolfskill david@catwhisker.org The circus around that memo helps confirm that Mr. Trump is unfit for offic= e. See http://www.catwhisker.org/~david/publickey.gpg for my public key. --9YbheLRFzEnE0aGp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEEzLfO+ReoAfQwZNd7FTnMQKBJ7hcFAlp5nCdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEND QjdDRUY5MTdBODAxRjQzMDY0RDc3QjE1MzlDQzQwQTA0OUVFMTcACgkQFTnMQKBJ 7hexrwf/aQKm9j/aSJOa3JfTrb+WiAeg16gfR4m+NdLmvnSv0C7c3sdkUU3SKFB3 vHbfXKeCY5vT+VAIexXnNgBgbrMWPGy2L2YApyz+OCHfwaa3we8RXF7huZOjpht/ wKGrzmtA2sHLahrXcyjRKvRoJVYcQWseuBM4X9Z6dfDWZVwXdaXBh3XlYJwHeaoa +8LzLXt7MVEXHVA1WsfcvdpB7a7qBG0T2n4s49AOo6JCEkNdmVRKNGV0GeEEifT1 GQ5+eAybyBFlq1ul4yGK1R+542DJuB7bXk+3+h4fNTwKN8vhbKJiTTdqR/iub6Ba gCeBG/BPKGStRbf+qJP0tc2IleWueQ== =Rk+f -----END PGP SIGNATURE----- --9YbheLRFzEnE0aGp-- From owner-svn-src-head@freebsd.org Tue Feb 6 12:17:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4E75EF44FE; Tue, 6 Feb 2018 12:17:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CB5B8611E; Tue, 6 Feb 2018 12:17:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7305417B8D; Tue, 6 Feb 2018 12:17:03 +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 w16CH3uf034023; Tue, 6 Feb 2018 12:17:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16CH3wv034022; Tue, 6 Feb 2018 12:17:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201802061217.w16CH3wv034022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Feb 2018 12:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328927 - head/contrib/gdb/gdb/tui X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/contrib/gdb/gdb/tui X-SVN-Commit-Revision: 328927 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.25 Precedence: list List-Id: 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, 06 Feb 2018 12:17:03 -0000 Author: bapt Date: Tue Feb 6 12:17:03 2018 New Revision: 328927 URL: https://svnweb.freebsd.org/changeset/base/328927 Log: Commit forgotten change in gdb allowing to use libedit Modified: head/contrib/gdb/gdb/tui/tui-io.c Modified: head/contrib/gdb/gdb/tui/tui-io.c ============================================================================== --- head/contrib/gdb/gdb/tui/tui-io.c Tue Feb 6 12:12:44 2018 (r328926) +++ head/contrib/gdb/gdb/tui/tui-io.c Tue Feb 6 12:17:03 2018 (r328927) @@ -397,7 +397,7 @@ static void tui_rl_display_match_list (char **matches, int len, int max) { typedef int QSFUNC (const void *, const void *); - extern int _rl_qsort_string_compare (const void*, const void*); + extern int _rl_qsort_string_compare (char **, char **); extern int _rl_print_completions_horizontally; int count, limit, printed_len; From owner-svn-src-head@freebsd.org Tue Feb 6 12:22:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FAEAEF4CBE; Tue, 6 Feb 2018 12:22:43 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E19D866C2; Tue, 6 Feb 2018 12:22:43 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4906C17D24; Tue, 6 Feb 2018 12:22:43 +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 w16CMhgv039147; Tue, 6 Feb 2018 12:22:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16CMgvs039144; Tue, 6 Feb 2018 12:22:42 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201802061222.w16CMgvs039144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 6 Feb 2018 12:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328928 - in head: contrib/libreadline gnu/lib gnu/lib/libreadline share/mk targets/pseudo/userland/gnu X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: contrib/libreadline gnu/lib gnu/lib/libreadline share/mk targets/pseudo/userland/gnu X-SVN-Commit-Revision: 328928 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.25 Precedence: list List-Id: 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, 06 Feb 2018 12:22:43 -0000 Author: bapt Date: Tue Feb 6 12:22:42 2018 New Revision: 328928 URL: https://svnweb.freebsd.org/changeset/base/328928 Log: Remove libreadline from the source tree, all consumers but gdb has been switched to libedit long ago, libreadline was built as an internallib for a while and kept only for gdbtui which was broken using libreadline. Since gdb has been mostly deorbitted in all arches, gdbtui was only installed on arm and sparc64, given it has been removed, gdb has been switched to use libedit, no consumers are left for libreadline. Thus this removal Deleted: head/contrib/libreadline/ head/gnu/lib/libreadline/ Modified: head/gnu/lib/Makefile head/share/mk/src.libnames.mk head/targets/pseudo/userland/gnu/Makefile.depend Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Tue Feb 6 12:17:03 2018 (r328927) +++ head/gnu/lib/Makefile Tue Feb 6 12:22:42 2018 (r328928) @@ -7,7 +7,6 @@ SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_GCC}+= libgcov libgomp SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_TESTS}+= tests -SUBDIR.${MK_GDB}+= libreadline .if ${MK_GNU_GREP} != "no" || ${MK_GNU_GREP_COMPAT} != "no" || \ ${MK_GDB} != "no" Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Feb 6 12:17:03 2018 (r328927) +++ head/share/mk/src.libnames.mk Tue Feb 6 12:22:42 2018 (r328928) @@ -44,7 +44,6 @@ _INTERNALLIBS= \ parse \ pe \ pmcstat \ - readline \ sl \ sm \ smdb \ @@ -147,7 +146,6 @@ _LIBRARIES= \ procstat \ pthread \ radius \ - readline \ regex \ roken \ rpcsec_gss \ @@ -290,7 +288,6 @@ _DP_pam+= ssh .if ${MK_NIS} != "no" _DP_pam+= ypclnt .endif -_DP_readline= ncursesw _DP_roken= crypt _DP_kadm5clnt= com_err krb5 roken _DP_kadm5srv= com_err hdb krb5 roken @@ -413,9 +410,6 @@ LIBELFTC?= ${LIBELFTCDIR}/libelftc.a LIBPEDIR= ${OBJTOP}/lib/libpe LIBPE?= ${LIBPEDIR}/libpe.a - -LIBREADLINEDIR= ${OBJTOP}/gnu/lib/libreadline/readline -LIBREADLINE?= ${LIBREADLINEDIR}/libreadline.a LIBOPENBSDDIR= ${OBJTOP}/lib/libopenbsd LIBOPENBSD?= ${LIBOPENBSDDIR}/libopenbsd.a Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Tue Feb 6 12:17:03 2018 (r328927) +++ head/targets/pseudo/userland/gnu/Makefile.depend Tue Feb 6 12:22:42 2018 (r328928) @@ -11,8 +11,6 @@ DIRDEPS = \ gnu/lib/libdialog \ gnu/lib/libgcov \ gnu/lib/libgomp \ - gnu/lib/libreadline/history/doc \ - gnu/lib/libreadline/readline/doc \ gnu/lib/libregex/doc \ gnu/lib/libssp \ gnu/lib/libssp/libssp_nonshared \ From owner-svn-src-head@freebsd.org Tue Feb 6 14:57:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B96EDEDD9A3; Tue, 6 Feb 2018 14:57:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C3926D290; Tue, 6 Feb 2018 14:57:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63323195CF; Tue, 6 Feb 2018 14:57:03 +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 w16Ev37u015671; Tue, 6 Feb 2018 14:57:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16Ev3KM015670; Tue, 6 Feb 2018 14:57:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802061457.w16Ev3KM015670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 6 Feb 2018 14:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328930 - head/sys/modules/dtb/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/modules/dtb/allwinner X-SVN-Commit-Revision: 328930 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.25 Precedence: list List-Id: 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, 06 Feb 2018 14:57:03 -0000 Author: kevans Date: Tue Feb 6 14:57:03 2018 New Revision: 328930 URL: https://svnweb.freebsd.org/changeset/base/328930 Log: dtb/allwinner: Add sun7i-a20-lamobo-r1.dts (Banana Pi R1) FreeBSD boots on this board, but the ethernet switch is not currently supported, resulting in no ethernet. A U-Boot port will be added once the ethernet switch is at least basically supported, but we add its DTS to the build here to lower the barrier-to-boot while work is underway. Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Tue Feb 6 14:04:39 2018 (r328929) +++ head/sys/modules/dtb/allwinner/Makefile Tue Feb 6 14:57:03 2018 (r328930) @@ -8,6 +8,7 @@ DTS= \ sun5i-r8-chip.dts \ sun7i-a20-bananapi.dts \ sun7i-a20-cubieboard2.dts \ + sun7i-a20-lamobo-r1.dts \ sun7i-a20-olimex-som-evb.dts \ sun7i-a20-pcduino3.dts \ sun8i-a83t-bananapi-m3.dts \ From owner-svn-src-head@freebsd.org Tue Feb 6 14:58:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C71FDEDDBBA for ; Tue, 6 Feb 2018 14:58:13 +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 64E0D6D40D for ; Tue, 6 Feb 2018 14:58:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id b66so2814029itd.5 for ; Tue, 06 Feb 2018 06:58:13 -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=+CNBAoupRAy5xNRH3OC821/IO4NTadjStzTGyUHHiSU=; b=buVWSYaRt3SjNypr3zsx1WGtDjkjeOXT+Td0WK+yY7Ff7rFkL4GnGWNUN7M9BSZhpV ZDaPxGtM2WqgQqZ4Hmnexij8ZbFqubXEa7wq6hE3M6USqu0e6g5B8G3VRQ2zcrSgH2E6 GealFwPrpiDVszcdNHMG/TJdvO6w1+3HJcbCLNSX8DF5pWOwZ2b4YctwTRjhQkk+ar0y hqaFRYjgcxWABkgfCnz6hCphuB4F/tQe3B9yZlKfdhVsaMnTVrbKVtBd1neaFkPYTX8f g/hp0MVV6SyqOj7i6duotTja0Gm3/cODPbSMdaxG1uAOToY5xBWjFcT7NZ8DXD5An8wd wWDA== 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=+CNBAoupRAy5xNRH3OC821/IO4NTadjStzTGyUHHiSU=; b=mbSy6soZl4+/V1U33wDnZtWyFpeRexwP2+2Sq8TZQtYZdvWoz2gvodEssCHMZY9rkk 70gsQURNk5eAg23saMrlSWFeimrofe6kxBNVB+pDnlN3g57zQ8UEcDo4CwL27aea8la7 hHosOAkS3eWowioNl4xRQqNxwrIjsf2On3qHTOTFwPcprivIf1/CFohvysyRDatw/irc boTMs7hSa6FOdW8vpQ6q/I9+sf1fXVqNJF0IN4jk0q3otYLrfoeeX0B7WSHhakzULv39 VE7xCdYFjIP6wYYzqA5SD04ZVhiodSq0rAJFrh/4JI1urmb/g1JfExtA0a3irNuXn/Bz y1pQ== X-Gm-Message-State: APf1xPBJPJJRs8bwdOJePvawYoo++DCRfdCKFxw74/fnaHDv3O3Z5bZZ hCNWrDbpAfCaRbD0+oZnoVeHghcvRMOdEF+C7ZyzQw== X-Google-Smtp-Source: AH8x225Lztp4wY0RCxMFqy0Ctr5RSyIswMlmbiDWzBw3FVTHn6ywkHxx0hZqBBVvoDorHX6NT8pOdn9/MTfYxYSfAks= X-Received: by 10.36.74.200 with SMTP id k191mr3645141itb.69.1517929092627; Tue, 06 Feb 2018 06:58:12 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Tue, 6 Feb 2018 06:58:12 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201802060019.w160Jl1W076251@repo.freebsd.org> From: Warner Losh Date: Tue, 6 Feb 2018 07:58:12 -0700 X-Google-Sender-Auth: irW2HbRmWJ3hsj4jfrAf_GD1qzc Message-ID: Subject: Re: svn commit: r328914 - in head/sys: kern ufs/ffs To: "Conrad E. Meyer" Cc: Kirk McKusick , 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 14:58:14 -0000 On Tue, Feb 6, 2018 at 1:09 AM, Conrad Meyer wrote: > Hi Kirk, > > On Mon, Feb 5, 2018 at 4:19 PM, Kirk McKusick > wrote: > > Author: mckusick > > Date: Tue Feb 6 00:19:46 2018 > > New Revision: 328914 > > URL: https://svnweb.freebsd.org/changeset/base/328914 > > > > Log: > > ... > > The second problem was that the check hash computed at the end of the > > read was incorrect because the calculation of the check hash on > > completion of the read was being done too soon. > > > > - When a read completes we had the following sequence: > > > > - bufdone() > > -- b_ckhashcalc (calculates check hash) > > -- bufdone_finish() > > --- vfs_vmio_iodone() (replaces bogus pages with the cached ones) > > > > - When we are reading a buffer where one or more pages are already > > in memory (but not all pages, or we wouldn't be doing the read), > > the I/O is done with bogus_page mapped in for the pages that exist > > in the VM cache. This mapping is done to avoid corrupting the > > cached pages if there is any I/O overrun. The vfs_vmio_iodone() > > function is responsible for replacing the bogus_page(s) with the > > cached ones. But we were calculating the check hash before the > > bogus_page(s) were replaced. Hence, when we were calculating the > > check hash, we were partly reading from bogus_page, which means > > we calculated a bad check hash (e.g., because multiple pages have > > been mapped to bogus_page, so its contents are indeterminate). > > > > The second fix is to move the check-hash calculation from bufdone() > > to bufdone_finish() after the call to vfs_vmio_iodone() so that it > > computes the check hash over the correct set of pages. > > Does the b_iodone callback have a very similar potential problem? It > is invoked in bufdone(), before bufdone_finish() and > vfs_vmio_iodone(). > > One example b_iodone is the bdone() callback. It seems that b_iodone > -> bdone() can then wake bwait()ers before any VMIO cached content has > been filled in. > > I don't know that any specific consumers of b_iodone are currently > broken, but it seems like maybe the b_iodone callback should really be > in the later location as well. > It looks to me like this part of bufdone_finish() if (bp->b_flags & B_VMIO) { /* * Set B_CACHE if the op was a normal read and no error * occurred. B_CACHE is set for writes in the b*write() * routines. */ if (bp->b_iocmd == BIO_READ && !(bp->b_flags & (B_INVAL|B_NOCACHE)) && !(bp->b_ioflags & BIO_ERROR)) bp->b_flags |= B_CACHE; vfs_vmio_iodone(bp); } belongs before the callback to b_iodone() rather than in bufdone_finish(). It appears that bufdone_finish() isn't called elsewhere, despite being non-static. I'm curious why this is... Warner From owner-svn-src-head@freebsd.org Tue Feb 6 15:30:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAF44EE0D05; Tue, 6 Feb 2018 15:30:17 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E5D66F084; Tue, 6 Feb 2018 15:30:17 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 754CF19AD1; Tue, 6 Feb 2018 15:30:17 +0000 (UTC) (envelope-from amdmi3@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16FUHEn031750; Tue, 6 Feb 2018 15:30:17 GMT (envelope-from amdmi3@FreeBSD.org) Received: (from amdmi3@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FUHRM031749; Tue, 6 Feb 2018 15:30:17 GMT (envelope-from amdmi3@FreeBSD.org) Message-Id: <201802061530.w16FUHRM031749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: amdmi3 set sender to amdmi3@FreeBSD.org using -f From: Dmitry Marakasov Date: Tue, 6 Feb 2018 15:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328931 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: amdmi3 X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 328931 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.25 Precedence: list List-Id: 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, 06 Feb 2018 15:30:18 -0000 Author: amdmi3 (ports committer) Date: Tue Feb 6 15:30:17 2018 New Revision: 328931 URL: https://svnweb.freebsd.org/changeset/base/328931 Log: - Document new ${name}_limits rc.conf option Approved by: cy MFC after: 2 weeks (along with 328331 which introduced this option) Differential Revision: https://reviews.freebsd.org/D14028 Modified: head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Tue Feb 6 14:57:03 2018 (r328930) +++ head/share/man/man8/rc.subr.8 Tue Feb 6 15:30:17 2018 (r328931) @@ -551,7 +551,7 @@ is mounted. A list of environment variables to run .Va command with. -This will be passed as arguments to +This will be passed as arguments to the .Xr env 1 utility. .It Va ${name}_fib @@ -583,6 +583,13 @@ as. Only supported after .Pa /usr is mounted. +.It Va ${name}_limits +.Xr limits 1 +to apply to +.Va command . +This will be passed as arguments to the +.Xr limits 1 +utility. .It Va ${name}_oomprotect .Xr protect 1 .Va command From owner-svn-src-head@freebsd.org Tue Feb 6 15:41:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DB92EE1D85; Tue, 6 Feb 2018 15:41:16 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A69566F86D; Tue, 6 Feb 2018 15:41:15 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A17B819CC5; Tue, 6 Feb 2018 15:41:15 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16FfF5Y038496; Tue, 6 Feb 2018 15:41:15 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FfFsE038495; Tue, 6 Feb 2018 15:41:15 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802061541.w16FfFsE038495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 6 Feb 2018 15:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328932 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 328932 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.25 Precedence: list List-Id: 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, 06 Feb 2018 15:41:16 -0000 Author: arichardson Date: Tue Feb 6 15:41:15 2018 New Revision: 328932 URL: https://svnweb.freebsd.org/changeset/base/328932 Log: Make mips_postboot_fixup work when building the kernel with clang+lld The compiler/linker can align fake_preload anyway it would like. When building the kernel with gcc+bfd this always happened to be a multiple of 8. When I built the kernel with clang and linked with lld fake_preload happened to only be aligned to 4 bytes which caused a an ADDRS trap because the compiler will emit sd instructions to store to this buffer. Reviewed By: jhb, imp Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D14018 Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Tue Feb 6 15:30:17 2018 (r328931) +++ head/sys/mips/mips/machdep.c Tue Feb 6 15:41:15 2018 (r328932) @@ -383,7 +383,11 @@ mips_vector_init(void) void mips_postboot_fixup(void) { - static char fake_preload[256]; + /* + * We store u_long sized objects into the reload area, so the array + * must be so aligned. The standard allows any alignment for char data. + */ + static char fake_preload[256] _Alignas(_Alignof(u_long)); caddr_t preload_ptr = (caddr_t)&fake_preload[0]; size_t size = 0; From owner-svn-src-head@freebsd.org Tue Feb 6 15:41:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33804EE1DD8; Tue, 6 Feb 2018 15:41:27 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D958D6FA9E; Tue, 6 Feb 2018 15:41:26 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D426A19DDA; Tue, 6 Feb 2018 15:41:26 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16FfQea040376; Tue, 6 Feb 2018 15:41:26 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FfQ1x039394; Tue, 6 Feb 2018 15:41:26 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802061541.w16FfQ1x039394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 6 Feb 2018 15:41:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328933 - head/usr.bin/find X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.bin/find X-SVN-Commit-Revision: 328933 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.25 Precedence: list List-Id: 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, 06 Feb 2018 15:41:27 -0000 Author: arichardson Date: Tue Feb 6 15:41:26 2018 New Revision: 328933 URL: https://svnweb.freebsd.org/changeset/base/328933 Log: Allow compiling usr.bin/find on Linux and Mac When building FreeBSD the makefiles invoke find with various flags such as `-s` that aren't supported in the native /usr/bin/find. To fix this I build the FreeBSD version of find and use that when crossbuilding. Inserting lots if #ifdefs in the code is rather ugly but I don't see a better solution. Reviewed By: brooks (mentor) Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D13306 Modified: head/usr.bin/find/Makefile head/usr.bin/find/find.h head/usr.bin/find/function.c head/usr.bin/find/ls.c head/usr.bin/find/operator.c head/usr.bin/find/option.c Modified: head/usr.bin/find/Makefile ============================================================================== --- head/usr.bin/find/Makefile Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/Makefile Tue Feb 6 15:41:26 2018 (r328933) @@ -7,6 +7,7 @@ PROG= find SRCS= find.c function.c ls.c main.c misc.c operator.c option.c \ getdate.y YFLAGS= +CFLAGS.clang+= -Werror=undef NO_WMISSING_VARIABLE_DECLARATIONS= Modified: head/usr.bin/find/find.h ============================================================================== --- head/usr.bin/find/find.h Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/find.h Tue Feb 6 15:41:26 2018 (r328933) @@ -36,7 +36,32 @@ */ #include +#include +#include +/* + * We need to build find during the bootstrap stage when building on a + * non-FreeBSD system. Linux does not have the st_flags and st_birthtime + * members in struct stat so we need to omit support for tests that depend + * on these members. This works fine since none of these flags are used + * during the build of world and kernel. + */ +#ifdef UF_SETTABLE +#define HAVE_STRUCT_STAT_ST_FLAGS 1 +#else +#define HAVE_STRUCT_STAT_ST_FLAGS 0 +#endif +#if defined(st_birthtime) || defined(st_birthtimespec) +#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 +#else +#define HAVE_STRUCT_STAT_ST_BIRTHTIME 0 +#endif +#if defined(MFSNAMELEN) || defined(MFSTYPENAMELEN) +#define HAVE_STRUCT_STATFS_F_FSTYPENAME 1 +#else +#define HAVE_STRUCT_STATFS_F_FSTYPENAME 0 +#endif + /* forward declarations */ struct _plandata; struct _option; @@ -70,8 +95,10 @@ typedef struct _plandata *creat_f(struct _option *, ch #define F_IGNCASE 0x00010000 /* iname ipath iregex */ #define F_EXACTTIME F_IGNCASE /* -[acm]time units syntax */ #define F_EXECPLUS 0x00020000 /* -exec ... {} + */ +#if HAVE_STRUCT_STAT_ST_BIRTHTIME #define F_TIME_B 0x00040000 /* one of -Btime, -Bnewer, -newerB* */ #define F_TIME2_B 0x00080000 /* one of -newer?B */ +#endif #define F_LINK 0x00100000 /* lname or ilname */ /* node definition */ Modified: head/usr.bin/find/function.c ============================================================================== --- head/usr.bin/find/function.c Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/function.c Tue Feb 6 15:41:26 2018 (r328933) @@ -261,9 +261,11 @@ f_Xmin(PLAN *plan, FTSENT *entry) } else if (plan->flags & F_TIME_A) { COMPARE((now - entry->fts_statp->st_atime + 60 - 1) / 60, plan->t_data.tv_sec); +#if HAVE_STRUCT_STAT_ST_BIRTHTIME } else if (plan->flags & F_TIME_B) { COMPARE((now - entry->fts_statp->st_birthtime + 60 - 1) / 60, plan->t_data.tv_sec); +#endif } else { COMPARE((now - entry->fts_statp->st_mtime + 60 - 1) / 60, plan->t_data.tv_sec); @@ -304,8 +306,10 @@ f_Xtime(PLAN *plan, FTSENT *entry) if (plan->flags & F_TIME_A) xtime = entry->fts_statp->st_atime; +#if HAVE_STRUCT_STAT_ST_BIRTHTIME else if (plan->flags & F_TIME_B) xtime = entry->fts_statp->st_birthtime; +#endif else if (plan->flags & F_TIME_C) xtime = entry->fts_statp->st_ctime; else @@ -362,6 +366,7 @@ c_mXXdepth(OPTION *option, char ***argvp) return new; } +#ifdef ACL_TYPE_NFS4 /* * -acl function -- * @@ -412,6 +417,7 @@ f_acl(PLAN *plan __unused, FTSENT *entry) return (0); return (1); } +#endif PLAN * c_acl(OPTION *option, char ***argvp __unused) @@ -448,12 +454,14 @@ f_delete(PLAN *plan __unused, FTSENT *entry) errx(1, "-delete: %s: relative path potentially not safe", entry->fts_accpath); +#if HAVE_STRUCT_STAT_ST_FLAGS /* Turn off user immutable bits if running as root */ if ((entry->fts_statp->st_flags & (UF_APPEND|UF_IMMUTABLE)) && !(entry->fts_statp->st_flags & (SF_APPEND|SF_IMMUTABLE)) && geteuid() == 0) lchflags(entry->fts_accpath, entry->fts_statp->st_flags &= ~(UF_APPEND|UF_IMMUTABLE)); +#endif /* rmdir directories, unlink everything else */ if (S_ISDIR(entry->fts_statp->st_mode)) { @@ -806,6 +814,7 @@ finish_execplus(void) } } +#if HAVE_STRUCT_STAT_ST_FLAGS int f_flags(PLAN *plan, FTSENT *entry) { @@ -849,6 +858,7 @@ c_flags(OPTION *option, char ***argvp) new->fl_notflags = notflags; return new; } +#endif /* * -follow functions -- @@ -865,6 +875,7 @@ c_follow(OPTION *option, char ***argvp __unused) return palloc(option); } +#if HAVE_STRUCT_STATFS_F_FSTYPENAME /* * -fstype functions -- * @@ -967,6 +978,7 @@ c_fstype(OPTION *option, char ***argvp) new->c_data = fsname; return new; } +#endif /* * -group gname functions -- @@ -1189,10 +1201,12 @@ f_newer(PLAN *plan, FTSENT *entry) if (plan->flags & F_TIME_C) ft = entry->fts_statp->st_ctim; +#if HAVE_STRUCT_STAT_ST_BIRTHTIME else if (plan->flags & F_TIME_A) ft = entry->fts_statp->st_atim; else if (plan->flags & F_TIME_B) ft = entry->fts_statp->st_birthtim; +#endif else ft = entry->fts_statp->st_mtim; return (ft.tv_sec > plan->t_data.tv_sec || @@ -1230,8 +1244,10 @@ c_newer(OPTION *option, char ***argvp) new->t_data = sb.st_ctim; else if (option->flags & F_TIME2_A) new->t_data = sb.st_atim; +#if HAVE_STRUCT_STAT_ST_BIRTHTIME else if (option->flags & F_TIME2_B) new->t_data = sb.st_birthtim; +#endif else new->t_data = sb.st_mtim; } @@ -1615,7 +1631,7 @@ c_type(OPTION *option, char ***argvp) case 's': mask = S_IFSOCK; break; -#ifdef FTS_WHITEOUT +#if defined(FTS_WHITEOUT) && defined(S_IFWHT) case 'w': mask = S_IFWHT; ftsoptions |= FTS_WHITEOUT; Modified: head/usr.bin/find/ls.c ============================================================================== --- head/usr.bin/find/ls.c Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/ls.c Tue Feb 6 15:41:26 2018 (r328933) @@ -91,8 +91,10 @@ printtime(time_t ftime) const char *format; static int d_first = -1; +#ifdef D_MD_ORDER if (d_first < 0) d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); +#endif if (lnow == 0) lnow = time(NULL); Modified: head/usr.bin/find/operator.c ============================================================================== --- head/usr.bin/find/operator.c Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/operator.c Tue Feb 6 15:41:26 2018 (r328933) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "find.h" Modified: head/usr.bin/find/option.c ============================================================================== --- head/usr.bin/find/option.c Tue Feb 6 15:41:15 2018 (r328932) +++ head/usr.bin/find/option.c Tue Feb 6 15:41:26 2018 (r328933) @@ -61,11 +61,15 @@ static OPTION const options[] = { { "!", c_simple, f_not, 0 }, { "(", c_simple, f_openparen, 0 }, { ")", c_simple, f_closeparen, 0 }, +#if HAVE_STRUCT_STAT_ST_BIRTHTIME { "-Bmin", c_Xmin, f_Xmin, F_TIME_B }, { "-Bnewer", c_newer, f_newer, F_TIME_B }, { "-Btime", c_Xtime, f_Xtime, F_TIME_B }, +#endif { "-a", c_and, NULL, 0 }, +#ifdef ACL_TYPE_NFS4 { "-acl", c_acl, f_acl, 0 }, +#endif { "-amin", c_Xmin, f_Xmin, F_TIME_A }, { "-and", c_and, NULL, 0 }, { "-anewer", c_newer, f_newer, F_TIME_A }, @@ -81,13 +85,17 @@ static OPTION const options[] = { { "-exec", c_exec, f_exec, 0 }, { "-execdir", c_exec, f_exec, F_EXECDIR }, { "-false", c_simple, f_false, 0 }, +#if HAVE_STRUCT_STAT_ST_FLAGS { "-flags", c_flags, f_flags, 0 }, +#endif // -fls { "-follow", c_follow, f_always_true, 0 }, // -fprint // -fprint0 // -fprintf +#if HAVE_STRUCT_STATFS_F_FSTYPENAME { "-fstype", c_fstype, f_fstype, 0 }, +#endif { "-gid", c_group, f_group, 0 }, { "-group", c_group, f_group, 0 }, { "-ignore_readdir_race",c_ignore_readdir_race, f_always_true,0 }, @@ -108,22 +116,28 @@ static OPTION const options[] = { { "-mtime", c_Xtime, f_Xtime, 0 }, { "-name", c_name, f_name, 0 }, { "-newer", c_newer, f_newer, 0 }, +#if HAVE_STRUCT_STAT_ST_BIRTHTIME { "-newerBB", c_newer, f_newer, F_TIME_B | F_TIME2_B }, { "-newerBa", c_newer, f_newer, F_TIME_B | F_TIME2_A }, { "-newerBc", c_newer, f_newer, F_TIME_B | F_TIME2_C }, { "-newerBm", c_newer, f_newer, F_TIME_B }, { "-newerBt", c_newer, f_newer, F_TIME_B | F_TIME2_T }, { "-neweraB", c_newer, f_newer, F_TIME_A | F_TIME2_B }, +#endif { "-neweraa", c_newer, f_newer, F_TIME_A | F_TIME2_A }, { "-newerac", c_newer, f_newer, F_TIME_A | F_TIME2_C }, { "-neweram", c_newer, f_newer, F_TIME_A }, { "-newerat", c_newer, f_newer, F_TIME_A | F_TIME2_T }, +#if HAVE_STRUCT_STAT_ST_BIRTHTIME { "-newercB", c_newer, f_newer, F_TIME_C | F_TIME2_B }, +#endif { "-newerca", c_newer, f_newer, F_TIME_C | F_TIME2_A }, { "-newercc", c_newer, f_newer, F_TIME_C | F_TIME2_C }, { "-newercm", c_newer, f_newer, F_TIME_C }, { "-newerct", c_newer, f_newer, F_TIME_C | F_TIME2_T }, +#if HAVE_STRUCT_STAT_ST_BIRTHTIME { "-newermB", c_newer, f_newer, F_TIME2_B }, +#endif { "-newerma", c_newer, f_newer, F_TIME2_A }, { "-newermc", c_newer, f_newer, F_TIME2_C }, { "-newermm", c_newer, f_newer, 0 }, From owner-svn-src-head@freebsd.org Tue Feb 6 15:41:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADDEEEE1E68; Tue, 6 Feb 2018 15:41:36 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7736FBC4; Tue, 6 Feb 2018 15:41:36 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A86D19DEF; Tue, 6 Feb 2018 15:41:36 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16FfaCo041472; Tue, 6 Feb 2018 15:41:36 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FfadO041469; Tue, 6 Feb 2018 15:41:36 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802061541.w16FfadO041469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 6 Feb 2018 15:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328934 - in head: . bin/sh X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: . bin/sh X-SVN-Commit-Revision: 328934 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.25 Precedence: list List-Id: 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, 06 Feb 2018 15:41:36 -0000 Author: arichardson Date: Tue Feb 6 15:41:35 2018 New Revision: 328934 URL: https://svnweb.freebsd.org/changeset/base/328934 Log: Don't hardcode /usr/bin as the path for mktemp in build tools It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in /bin there. Reviewed By: bdrewery Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D13937 Modified: head/Makefile.inc1 head/bin/sh/mkbuiltins head/bin/sh/mktokens Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Feb 6 15:41:26 2018 (r328933) +++ head/Makefile.inc1 Tue Feb 6 15:41:35 2018 (r328934) @@ -463,7 +463,7 @@ TMPPATH= ${STRICTTMPPATH}:${PATH} # when in the middle of installing over this system. # .if make(distributeworld) || make(installworld) || make(stageworld) -INSTALLTMP!= /usr/bin/mktemp -d -u -t install +INSTALLTMP!= mktemp -d -u -t install .endif .if make(stagekernel) || make(distributekernel) Modified: head/bin/sh/mkbuiltins ============================================================================== --- head/bin/sh/mkbuiltins Tue Feb 6 15:41:26 2018 (r328933) +++ head/bin/sh/mkbuiltins Tue Feb 6 15:41:35 2018 (r328934) @@ -34,7 +34,7 @@ # @(#)mkbuiltins 8.2 (Berkeley) 5/4/95 # $FreeBSD$ -temp=`/usr/bin/mktemp -t ka` +temp=`mktemp -t ka` havehist=1 if [ "X$1" = "X-h" ]; then havehist=0 Modified: head/bin/sh/mktokens ============================================================================== --- head/bin/sh/mktokens Tue Feb 6 15:41:26 2018 (r328933) +++ head/bin/sh/mktokens Tue Feb 6 15:41:35 2018 (r328934) @@ -38,7 +38,7 @@ # token marks the end of a list. The third column is the name to print in # error messages. -temp=`/usr/bin/mktemp -t ka` +temp=`mktemp -t ka` cat > $temp <<\! TEOF 1 end of file TNL 0 newline From owner-svn-src-head@freebsd.org Tue Feb 6 15:41:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2140EE1FAA; Tue, 6 Feb 2018 15:41:45 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 668816FCF8; Tue, 6 Feb 2018 15:41:45 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6172019E08; Tue, 6 Feb 2018 15:41:45 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16Ffj3T041526; Tue, 6 Feb 2018 15:41:45 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FfjuJ041525; Tue, 6 Feb 2018 15:41:45 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802061541.w16FfjuJ041525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Tue, 6 Feb 2018 15:41:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328935 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 328935 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.25 Precedence: list List-Id: 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, 06 Feb 2018 15:41:45 -0000 Author: arichardson Date: Tue Feb 6 15:41:45 2018 New Revision: 328935 URL: https://svnweb.freebsd.org/changeset/base/328935 Log: crossbuild: Make the CHECK_TIME variable work on Linux Linux /usr/bin/find doesn't understand the -mtime -0s flag. Instead create a temporary file and compare that file's mtime to sys/sys/param.h to check whether the clock is correct. Reviewed By: jhb, imp Approved By: jhb (mentor) Differential Revision: https://reviews.freebsd.org/D14157 Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Feb 6 15:41:35 2018 (r328934) +++ head/Makefile Tue Feb 6 15:41:45 2018 (r328935) @@ -352,7 +352,7 @@ _guard: .PHONY @false STARTTIME!= LC_ALL=C date -CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s ; echo +CHECK_TIME!= cmp=`mktemp`; find ${.CURDIR}/sys/sys/param.h -newer "$$cmp" && rm "$$cmp"; echo .if !empty(CHECK_TIME) .error check your date/time: ${STARTTIME} .endif From owner-svn-src-head@freebsd.org Tue Feb 6 15:58:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7C8AEE3974; Tue, 6 Feb 2018 15:58:23 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BFBC7098B; Tue, 6 Feb 2018 15:58:23 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76CE219FF5; Tue, 6 Feb 2018 15:58:23 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16FwNnb046852; Tue, 6 Feb 2018 15:58:23 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16FwMcS046846; Tue, 6 Feb 2018 15:58:22 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201802061558.w16FwMcS046846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 6 Feb 2018 15:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328936 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: ken X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 328936 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.25 Precedence: list List-Id: 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, 06 Feb 2018 15:58:24 -0000 Author: ken Date: Tue Feb 6 15:58:22 2018 New Revision: 328936 URL: https://svnweb.freebsd.org/changeset/base/328936 Log: Diagnostic buffer fixes for the mps(4) and mpr(4) drivers. In mp{r,s}_diag_register(), which is used to register diagnostic buffers with the mp{r,s}(4) firmware, we allocate DMAable memory. There were several issues here: o No checking of the bus_dmamap_load() return value. If the load failed or got deferred, mp{r,s}_diag_register() continued on as if nothing had happened. We now check the return value and bail out if it fails. o No waiting for a deferred load callback. bus_dmamap_load() calls a supplied callback when the mapping is done. This is generally done immediately, but it can be deferred. mp{r,s}_diag_register() did not check to see whether the callback was already done before proceeding on. We now sleep until the callback is done if it is deferred. o No call to bus_dmamap_sync(... BUS_DMASYNC_PREREAD) after the memory is allocated and loaded. This is necessary on some platforms to synchronize host memory that is going to be updated by a device. Both drivers would also panic if the firmware was reinitialized while a diagnostic buffer operation was in progress. This fixes that problem as well. (The driver will reinitialize the firmware in various circumstances, but the problem I ran into was that the firmware would generate an IOC Fault due to a PCIe error.) mp{r,s}var.h: Add a new structure, struct mpr_busdma_context, that is used for deferred busdma load callbacks. Add a prototype for mp{r,s}_memaddr_wait_cb(). mp{r,s}.c: Add a new busdma callback function, mp{r,s}_memaddr_wait_cb(). This provides synchronization for callers that want to wait on a deferred bus_dmamap_load() callback. mp{r,s}_user.c: In bus_dmamap_register(), add a call to bus_dmamap_sync() with the BUS_DMASYNC_PREREAD flag set after an allocation is loaded. Also, check the return value of bus_dmamap_load(). If it fails, bail out. If it is EINPROGRESS, wait for the callback to happen. We use an interruptible sleep (msleep with PCATCH) and let the callback clean things up if we get interrupted. In mpr_diag_read_buffer() and mps_diag_read_buffer(), call bus_dmamap_sync(..., BUS_DMASYNC_POSTREAD) before copying the data out to make sure the data is in stable storage. In mp{r,s}_post_fw_diag_buffer() and mp{r,s}_release_fw_diag_buffer(), check the reply to see whether it is NULL. It can be NULL (and the command non-NULL) if the controller gets reinitialized while we're waiting for the command to complete but the driver structures aren't reallocated. The driver structures generally won't be reallocated unless there is a firmware upgrade that changes one of the IOCFacts. When freeing diagnostic buffers in mp{r,s}_diag_register() and mp{r,s}_diag_unregister(), zero/NULL out the buffer after freeing it. This will prevent a duplicate free in some situations. Sponsored by: Spectra Logic Reviewed by: mav, scottl MFC after: 1 week Differential Revision: D13453 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mpr/mpr.c Tue Feb 6 15:58:22 2018 (r328936) @@ -1183,6 +1183,42 @@ mpr_memaddr_cb(void *arg, bus_dma_segment_t *segs, int *addr = segs[0].ds_addr; } +void +mpr_memaddr_wait_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct mpr_busdma_context *ctx; + int need_unload, need_free; + + ctx = (struct mpr_busdma_context *)arg; + need_unload = 0; + need_free = 0; + + mpr_lock(ctx->softc); + ctx->error = error; + ctx->completed = 1; + if ((error == 0) && (ctx->abandoned == 0)) { + *ctx->addr = segs[0].ds_addr; + } else { + if (nsegs != 0) + need_unload = 1; + if (ctx->abandoned != 0) + need_free = 1; + } + if (need_free == 0) + wakeup(ctx); + + mpr_unlock(ctx->softc); + + if (need_unload != 0) { + bus_dmamap_unload(ctx->buffer_dmat, + ctx->buffer_dmamap); + *ctx->addr = 0; + } + + if (need_free != 0) + free(ctx, M_MPR); +} + static int mpr_alloc_queues(struct mpr_softc *sc) { Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mpr/mpr_user.c Tue Feb 6 15:58:22 2018 (r328936) @@ -1314,6 +1314,13 @@ mpr_post_fw_diag_buffer(struct mpr_softc *sc, * Process POST reply. */ reply = (MPI2_DIAG_BUFFER_POST_REPLY *)cm->cm_reply; + if (reply == NULL) { + mpr_printf(sc, "%s: reply is NULL, probably due to " + "reinitialization", __func__); + status = MPR_DIAG_FAILURE; + goto done; + } + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { status = MPR_DIAG_FAILURE; @@ -1401,6 +1408,12 @@ mpr_release_fw_diag_buffer(struct mpr_softc *sc, * Process RELEASE reply. */ reply = (MPI2_DIAG_RELEASE_REPLY *)cm->cm_reply; + if (reply == NULL) { + mpr_printf(sc, "%s: reply is NULL, probably due to " + "reinitialization", __func__); + status = MPR_DIAG_FAILURE; + goto done; + } if (((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) || pBuffer->owned_by_firmware) { status = MPR_DIAG_FAILURE; @@ -1436,15 +1449,19 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re uint32_t *return_code) { mpr_fw_diagnostic_buffer_t *pBuffer; + struct mpr_busdma_context *ctx; uint8_t extended_type, buffer_type, i; uint32_t buffer_size; uint32_t unique_id; int status; + int error; extended_type = diag_register->ExtendedType; buffer_type = diag_register->BufferType; buffer_size = diag_register->RequestedBufferSize; unique_id = diag_register->UniqueId; + ctx = NULL; + error = 0; /* * Check for valid buffer type @@ -1493,7 +1510,7 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; return (MPR_DIAG_FAILURE); } - if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ + if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1506,17 +1523,83 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re &sc->fw_diag_dmat)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate FW diag buffer DMA tag\n"); - return (ENOMEM); - } + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } if (bus_dmamem_alloc(sc->fw_diag_dmat, (void **)&sc->fw_diag_buffer, BUS_DMA_NOWAIT, &sc->fw_diag_map)) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate FW diag buffer memory\n"); - return (ENOMEM); - } - bzero(sc->fw_diag_buffer, buffer_size); - bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, sc->fw_diag_buffer, - buffer_size, mpr_memaddr_cb, &sc->fw_diag_busaddr, 0); + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } + bzero(sc->fw_diag_buffer, buffer_size); + + ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO); + if (ctx == NULL) { + device_printf(sc->mpr_dev, "%s: context malloc failed\n", + __func__); + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } + ctx->addr = &sc->fw_diag_busaddr; + ctx->buffer_dmat = sc->fw_diag_dmat; + ctx->buffer_dmamap = sc->fw_diag_map; + ctx->softc = sc; + error = bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, + sc->fw_diag_buffer, buffer_size, mpr_memaddr_wait_cb, + ctx, 0); + if (error == EINPROGRESS) { + + /* XXX KDM */ + device_printf(sc->mpr_dev, "%s: Deferred bus_dmamap_load\n", + __func__); + /* + * Wait for the load to complete. If we're interrupted, + * bail out. + */ + mpr_lock(sc); + if (ctx->completed == 0) { + error = msleep(ctx, &sc->mpr_mtx, PCATCH, "mprwait", 0); + if (error != 0) { + /* + * We got an error from msleep(9). This is + * most likely due to a signal. Tell + * mpr_memaddr_wait_cb() that we've abandoned + * the context, so it needs to clean up when + * it is called. + */ + ctx->abandoned = 1; + + /* The callback will free this memory */ + ctx = NULL; + mpr_unlock(sc); + + device_printf(sc->mpr_dev, "Cannot " + "bus_dmamap_load FW diag buffer, error = " + "%d returned from msleep\n", error); + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } + } + mpr_unlock(sc); + } + + if ((error != 0) || (ctx->error != 0)) { + device_printf(sc->mpr_dev, "Cannot bus_dmamap_load FW diag " + "buffer, %serror = %d\n", error ? "" : "callback ", + error ? error : ctx->error); + *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; + status = MPR_DIAG_FAILURE; + goto bailout; + } + + bus_dmamap_sync(sc->fw_diag_dmat, sc->fw_diag_map, BUS_DMASYNC_PREREAD); + pBuffer->size = buffer_size; /* @@ -1535,19 +1618,30 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re pBuffer->unique_id = unique_id; status = mpr_post_fw_diag_buffer(sc, pBuffer, return_code); +bailout: + /* * In case there was a failure, free the DMA buffer. */ if (status == MPR_DIAG_FAILURE) { - if (sc->fw_diag_busaddr != 0) + if (sc->fw_diag_busaddr != 0) { bus_dmamap_unload(sc->fw_diag_dmat, sc->fw_diag_map); - if (sc->fw_diag_buffer != NULL) + sc->fw_diag_busaddr = 0; + } + if (sc->fw_diag_buffer != NULL) { bus_dmamem_free(sc->fw_diag_dmat, sc->fw_diag_buffer, sc->fw_diag_map); - if (sc->fw_diag_dmat != NULL) + sc->fw_diag_buffer = NULL; + } + if (sc->fw_diag_dmat != NULL) { bus_dma_tag_destroy(sc->fw_diag_dmat); + sc->fw_diag_dmat = NULL; + } } + if (ctx != NULL) + free(ctx, M_MPR); + return (status); } @@ -1592,13 +1686,19 @@ mpr_diag_unregister(struct mpr_softc *sc, */ pBuffer->unique_id = MPR_FW_DIAG_INVALID_UID; if (status == MPR_DIAG_SUCCESS) { - if (sc->fw_diag_busaddr != 0) + if (sc->fw_diag_busaddr != 0) { bus_dmamap_unload(sc->fw_diag_dmat, sc->fw_diag_map); - if (sc->fw_diag_buffer != NULL) + sc->fw_diag_busaddr = 0; + } + if (sc->fw_diag_buffer != NULL) { bus_dmamem_free(sc->fw_diag_dmat, sc->fw_diag_buffer, sc->fw_diag_map); - if (sc->fw_diag_dmat != NULL) + sc->fw_diag_buffer = NULL; + } + if (sc->fw_diag_dmat != NULL) { bus_dma_tag_destroy(sc->fw_diag_dmat); + sc->fw_diag_dmat = NULL; + } } return (status); @@ -1707,6 +1807,10 @@ mpr_diag_read_buffer(struct mpr_softc *sc, *return_code = MPR_FW_DIAG_ERROR_INVALID_PARAMETER; return (MPR_DIAG_FAILURE); } + + /* Sync the DMA map before we copy to userland. */ + bus_dmamap_sync(sc->fw_diag_dmat, sc->fw_diag_map, + BUS_DMASYNC_POSTREAD); /* * Copy the requested data from DMA to the diag_read_buffer. The DMA Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mpr/mprvar.h Tue Feb 6 15:58:22 2018 (r328936) @@ -265,6 +265,16 @@ struct mpr_event_handle { uint8_t mask[16]; }; +struct mpr_busdma_context { + int completed; + int abandoned; + int error; + bus_addr_t *addr; + struct mpr_softc *softc; + bus_dmamap_t buffer_dmamap; + bus_dma_tag_t buffer_dmat; +}; + struct mpr_queue { struct mpr_softc *sc; int qnum; @@ -752,6 +762,7 @@ int mpr_detach_sas(struct mpr_softc *sc); int mpr_read_config_page(struct mpr_softc *, struct mpr_config_params *); int mpr_write_config_page(struct mpr_softc *, struct mpr_config_params *); void mpr_memaddr_cb(void *, bus_dma_segment_t *, int , int ); +void mpr_memaddr_wait_cb(void *, bus_dma_segment_t *, int , int ); void mpr_init_sge(struct mpr_command *cm, void *req, void *sge); int mpr_attach_user(struct mpr_softc *); void mpr_detach_user(struct mpr_softc *); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mps/mps.c Tue Feb 6 15:58:22 2018 (r328936) @@ -111,6 +111,7 @@ static void mps_parse_debug(struct mps_softc *sc, char SYSCTL_NODE(_hw, OID_AUTO, mps, CTLFLAG_RD, 0, "MPS Driver Parameters"); MALLOC_DEFINE(M_MPT2, "mps", "mpt2 driver memory"); +MALLOC_DECLARE(M_MPSUSER); /* * Do a "Diagnostic Reset" aka a hard reset. This should get the chip out of @@ -1158,6 +1159,42 @@ mps_memaddr_cb(void *arg, bus_dma_segment_t *segs, int addr = arg; *addr = segs[0].ds_addr; +} + +void +mps_memaddr_wait_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + struct mps_busdma_context *ctx; + int need_unload, need_free; + + ctx = (struct mps_busdma_context *)arg; + need_unload = 0; + need_free = 0; + + mps_lock(ctx->softc); + ctx->error = error; + ctx->completed = 1; + if ((error == 0) && (ctx->abandoned == 0)) { + *ctx->addr = segs[0].ds_addr; + } else { + if (nsegs != 0) + need_unload = 1; + if (ctx->abandoned != 0) + need_free = 1; + } + if (need_free == 0) + wakeup(ctx); + + mps_unlock(ctx->softc); + + if (need_unload != 0) { + bus_dmamap_unload(ctx->buffer_dmat, + ctx->buffer_dmamap); + *ctx->addr = 0; + } + + if (need_free != 0) + free(ctx, M_MPSUSER); } static int Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mps/mps_user.c Tue Feb 6 15:58:22 2018 (r328936) @@ -180,7 +180,7 @@ static int mps_user_event_report(struct mps_softc *sc, static int mps_user_reg_access(struct mps_softc *sc, mps_reg_access_t *data); static int mps_user_btdh(struct mps_softc *sc, mps_btdh_mapping_t *data); -static MALLOC_DEFINE(M_MPSUSER, "mps_user", "Buffers for mps(4) ioctls"); +MALLOC_DEFINE(M_MPSUSER, "mps_user", "Buffers for mps(4) ioctls"); /* Macros from compat/freebsd32/freebsd32.h */ #define PTRIN(v) (void *)(uintptr_t)(v) @@ -1222,6 +1222,12 @@ mps_post_fw_diag_buffer(struct mps_softc *sc, * Process POST reply. */ reply = (MPI2_DIAG_BUFFER_POST_REPLY *)cm->cm_reply; + if (reply == NULL) { + mps_printf(sc, "%s: reply is NULL, probably due to " + "reinitialization\n", __func__); + status = MPS_DIAG_FAILURE; + goto done; + } if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) { status = MPS_DIAG_FAILURE; @@ -1309,6 +1315,12 @@ mps_release_fw_diag_buffer(struct mps_softc *sc, * Process RELEASE reply. */ reply = (MPI2_DIAG_RELEASE_REPLY *)cm->cm_reply; + if (reply == NULL) { + mps_printf(sc, "%s: reply is NULL, probably due to " + "reinitialization\n", __func__); + status = MPS_DIAG_FAILURE; + goto done; + } if (((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_SUCCESS) || pBuffer->owned_by_firmware) { status = MPS_DIAG_FAILURE; @@ -1344,15 +1356,19 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re uint32_t *return_code) { mps_fw_diagnostic_buffer_t *pBuffer; + struct mps_busdma_context *ctx; uint8_t extended_type, buffer_type, i; uint32_t buffer_size; uint32_t unique_id; int status; + int error; extended_type = diag_register->ExtendedType; buffer_type = diag_register->BufferType; buffer_size = diag_register->RequestedBufferSize; unique_id = diag_register->UniqueId; + ctx = NULL; + error = 0; /* * Check for valid buffer type @@ -1401,7 +1417,7 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; return (MPS_DIAG_FAILURE); } - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ + if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -1414,17 +1430,84 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re &sc->fw_diag_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate FW diag buffer DMA tag\n"); - return (ENOMEM); - } - if (bus_dmamem_alloc(sc->fw_diag_dmat, (void **)&sc->fw_diag_buffer, + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; + } + if (bus_dmamem_alloc(sc->fw_diag_dmat, (void **)&sc->fw_diag_buffer, BUS_DMA_NOWAIT, &sc->fw_diag_map)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate FW diag buffer memory\n"); - return (ENOMEM); + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; } bzero(sc->fw_diag_buffer, buffer_size); - bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, sc->fw_diag_buffer, - buffer_size, mps_memaddr_cb, &sc->fw_diag_busaddr, 0); + + ctx = malloc(sizeof(*ctx), M_MPSUSER, M_WAITOK | M_ZERO); + if (ctx == NULL) { + device_printf(sc->mps_dev, "%s: context malloc failed\n", + __func__); + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; + } + ctx->addr = &sc->fw_diag_busaddr; + ctx->buffer_dmat = sc->fw_diag_dmat; + ctx->buffer_dmamap = sc->fw_diag_map; + ctx->softc = sc; + error = bus_dmamap_load(sc->fw_diag_dmat, sc->fw_diag_map, + sc->fw_diag_buffer, buffer_size, mps_memaddr_wait_cb, + ctx, 0); + + if (error == EINPROGRESS) { + + /* XXX KDM */ + device_printf(sc->mps_dev, "%s: Deferred bus_dmamap_load\n", + __func__); + /* + * Wait for the load to complete. If we're interrupted, + * bail out. + */ + mps_lock(sc); + if (ctx->completed == 0) { + error = msleep(ctx, &sc->mps_mtx, PCATCH, "mpswait", 0); + if (error != 0) { + /* + * We got an error from msleep(9). This is + * most likely due to a signal. Tell + * mpr_memaddr_wait_cb() that we've abandoned + * the context, so it needs to clean up when + * it is called. + */ + ctx->abandoned = 1; + + /* The callback will free this memory */ + ctx = NULL; + mps_unlock(sc); + + device_printf(sc->mps_dev, "Cannot " + "bus_dmamap_load FW diag buffer, error = " + "%d returned from msleep\n", error); + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; + } + } + mps_unlock(sc); + } + + if ((error != 0) || (ctx->error != 0)) { + device_printf(sc->mps_dev, "Cannot bus_dmamap_load FW diag " + "buffer, %serror = %d\n", error ? "" : "callback ", + error ? error : ctx->error); + *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; + status = MPS_DIAG_FAILURE; + goto bailout; + } + + bus_dmamap_sync(sc->fw_diag_dmat, sc->fw_diag_map, BUS_DMASYNC_PREREAD); + pBuffer->size = buffer_size; /* @@ -1443,19 +1526,29 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re pBuffer->unique_id = unique_id; status = mps_post_fw_diag_buffer(sc, pBuffer, return_code); +bailout: /* * In case there was a failure, free the DMA buffer. */ if (status == MPS_DIAG_FAILURE) { - if (sc->fw_diag_busaddr != 0) + if (sc->fw_diag_busaddr != 0) { bus_dmamap_unload(sc->fw_diag_dmat, sc->fw_diag_map); - if (sc->fw_diag_buffer != NULL) + sc->fw_diag_busaddr = 0; + } + if (sc->fw_diag_buffer != NULL) { bus_dmamem_free(sc->fw_diag_dmat, sc->fw_diag_buffer, sc->fw_diag_map); - if (sc->fw_diag_dmat != NULL) + sc->fw_diag_buffer = NULL; + } + if (sc->fw_diag_dmat != NULL) { bus_dma_tag_destroy(sc->fw_diag_dmat); + sc->fw_diag_dmat = NULL; + } } + if (ctx != NULL) + free(ctx, M_MPSUSER); + return (status); } @@ -1500,13 +1593,19 @@ mps_diag_unregister(struct mps_softc *sc, */ pBuffer->unique_id = MPS_FW_DIAG_INVALID_UID; if (status == MPS_DIAG_SUCCESS) { - if (sc->fw_diag_busaddr != 0) + if (sc->fw_diag_busaddr != 0) { bus_dmamap_unload(sc->fw_diag_dmat, sc->fw_diag_map); - if (sc->fw_diag_buffer != NULL) + sc->fw_diag_busaddr = 0; + } + if (sc->fw_diag_buffer != NULL) { bus_dmamem_free(sc->fw_diag_dmat, sc->fw_diag_buffer, sc->fw_diag_map); - if (sc->fw_diag_dmat != NULL) + sc->fw_diag_buffer = NULL; + } + if (sc->fw_diag_dmat != NULL) { bus_dma_tag_destroy(sc->fw_diag_dmat); + sc->fw_diag_dmat = NULL; + } } return (status); @@ -1615,6 +1714,10 @@ mps_diag_read_buffer(struct mps_softc *sc, *return_code = MPS_FW_DIAG_ERROR_INVALID_PARAMETER; return (MPS_DIAG_FAILURE); } + + /* Sync the DMA map before we copy to userland. */ + bus_dmamap_sync(sc->fw_diag_dmat, sc->fw_diag_map, + BUS_DMASYNC_POSTREAD); /* * Copy the requested data from DMA to the diag_read_buffer. The DMA Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Tue Feb 6 15:41:45 2018 (r328935) +++ head/sys/dev/mps/mpsvar.h Tue Feb 6 15:58:22 2018 (r328936) @@ -263,6 +263,16 @@ struct mps_event_handle { u32 mask[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS]; }; +struct mps_busdma_context { + int completed; + int abandoned; + int error; + bus_addr_t *addr; + struct mps_softc *softc; + bus_dmamap_t buffer_dmamap; + bus_dma_tag_t buffer_dmat; +}; + struct mps_queue { struct mps_softc *sc; int qnum; @@ -719,6 +729,7 @@ int mps_detach_sas(struct mps_softc *sc); int mps_read_config_page(struct mps_softc *, struct mps_config_params *); int mps_write_config_page(struct mps_softc *, struct mps_config_params *); void mps_memaddr_cb(void *, bus_dma_segment_t *, int , int ); +void mps_memaddr_wait_cb(void *, bus_dma_segment_t *, int , int ); void mpi_init_sge(struct mps_command *cm, void *req, void *sge); int mps_attach_user(struct mps_softc *); void mps_detach_user(struct mps_softc *); From owner-svn-src-head@freebsd.org Tue Feb 6 16:02:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34609EE40A9; Tue, 6 Feb 2018 16:02:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA7CB70E93; Tue, 6 Feb 2018 16:02:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D56D61A184; Tue, 6 Feb 2018 16:02:25 +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 w16G2PaL051431; Tue, 6 Feb 2018 16:02:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16G2PRV051425; Tue, 6 Feb 2018 16:02:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802061602.w16G2PRV051425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 6 Feb 2018 16:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328937 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 328937 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.25 Precedence: list List-Id: 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, 06 Feb 2018 16:02:26 -0000 Author: mav Date: Tue Feb 6 16:02:25 2018 New Revision: 328937 URL: https://svnweb.freebsd.org/changeset/base/328937 Log: Fix queue length reporting in mps(4) and mpr(4). Both drivers were found to report CAM bigger queue depth then they really can handle. It made them later under high load with many disks return some of submitted requests back with CAM_REQUEUE_REQ status for later resubmission. Reviewed by: scottl MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14215 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mpr/mpr.c Tue Feb 6 16:02:25 2018 (r328937) @@ -397,6 +397,7 @@ mpr_resize_queues(struct mpr_softc *sc) reqcr = MIN(reqcr, sc->facts->RequestCredit); sc->num_reqs = prireqcr + reqcr; + sc->num_prireqs = prireqcr; sc->num_replies = MIN(sc->max_replyframes + sc->max_evtframes, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; @@ -1507,7 +1508,7 @@ mpr_alloc_requests(struct mpr_softc *sc) /* XXX Is a failure here a critical problem? */ if (bus_dmamap_create(sc->buffer_dmat, 0, &cm->cm_dmamap) == 0) { - if (i <= sc->facts->HighPriorityCredit) + if (i <= sc->num_prireqs) mpr_free_high_priority_command(sc, cm); else mpr_free_command(sc, cm); Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mpr/mpr_sas.c Tue Feb 6 16:02:25 2018 (r328937) @@ -728,7 +728,7 @@ mpr_attach_sas(struct mpr_softc *sc) { struct mprsas_softc *sassc; cam_status status; - int unit, error = 0; + int unit, error = 0, reqs; MPR_FUNCTRACE(sc); mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); @@ -758,7 +758,8 @@ mpr_attach_sas(struct mpr_softc *sc) sc->sassc = sassc; sassc->sc = sc; - if ((sassc->devq = cam_simq_alloc(sc->num_reqs)) == NULL) { + reqs = sc->num_reqs - sc->num_prireqs - 1; + if ((sassc->devq = cam_simq_alloc(reqs)) == NULL) { mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Cannot allocate SIMQ\n"); error = ENOMEM; goto out; @@ -766,7 +767,7 @@ mpr_attach_sas(struct mpr_softc *sc) unit = device_get_unit(sc->mpr_dev); sassc->sim = cam_sim_alloc(mprsas_action, mprsas_poll, "mpr", sassc, - unit, &sc->mpr_mtx, sc->num_reqs, sc->num_reqs, sassc->devq); + unit, &sc->mpr_mtx, reqs, reqs, sassc->devq); if (sassc->sim == NULL) { mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Cannot allocate SIM\n"); error = EINVAL; Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mpr/mprvar.h Tue Feb 6 16:02:25 2018 (r328937) @@ -357,6 +357,7 @@ struct mpr_softc { MPI2_IOC_FACTS_REPLY *facts; int num_reqs; + int num_prireqs; int num_replies; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mps/mps.c Tue Feb 6 16:02:25 2018 (r328937) @@ -394,6 +394,7 @@ mps_resize_queues(struct mps_softc *sc) reqcr = MIN(reqcr, sc->facts->RequestCredit); sc->num_reqs = prireqcr + reqcr; + sc->num_prireqs = prireqcr; sc->num_replies = MIN(sc->max_replyframes + sc->max_evtframes, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; @@ -1453,7 +1454,7 @@ mps_alloc_requests(struct mps_softc *sc) /* XXX Is a failure here a critical problem? */ if (bus_dmamap_create(sc->buffer_dmat, 0, &cm->cm_dmamap) == 0) - if (i <= sc->facts->HighPriorityCredit) + if (i <= sc->num_prireqs) mps_free_high_priority_command(sc, cm); else mps_free_command(sc, cm); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mps/mps_sas.c Tue Feb 6 16:02:25 2018 (r328937) @@ -718,7 +718,7 @@ mps_attach_sas(struct mps_softc *sc) { struct mpssas_softc *sassc; cam_status status; - int unit, error = 0; + int unit, error = 0, reqs; MPS_FUNCTRACE(sc); mps_dprint(sc, MPS_INIT, "%s entered\n", __func__); @@ -748,7 +748,8 @@ mps_attach_sas(struct mps_softc *sc) sc->sassc = sassc; sassc->sc = sc; - if ((sassc->devq = cam_simq_alloc(sc->num_reqs)) == NULL) { + reqs = sc->num_reqs - sc->num_prireqs - 1; + if ((sassc->devq = cam_simq_alloc(reqs)) == NULL) { mps_dprint(sc, MPS_ERROR, "Cannot allocate SIMQ\n"); error = ENOMEM; goto out; @@ -756,7 +757,7 @@ mps_attach_sas(struct mps_softc *sc) unit = device_get_unit(sc->mps_dev); sassc->sim = cam_sim_alloc(mpssas_action, mpssas_poll, "mps", sassc, - unit, &sc->mps_mtx, sc->num_reqs, sc->num_reqs, sassc->devq); + unit, &sc->mps_mtx, reqs, reqs, sassc->devq); if (sassc->sim == NULL) { mps_dprint(sc, MPS_INIT|MPS_ERROR, "Cannot allocate SIM\n"); error = EINVAL; Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Tue Feb 6 15:58:22 2018 (r328936) +++ head/sys/dev/mps/mpsvar.h Tue Feb 6 16:02:25 2018 (r328937) @@ -345,6 +345,7 @@ struct mps_softc { MPI2_IOC_FACTS_REPLY *facts; int num_reqs; + int num_prireqs; int num_replies; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ From owner-svn-src-head@freebsd.org Tue Feb 6 16:02:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BCD3EE4129; Tue, 6 Feb 2018 16:02:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B212870F78; Tue, 6 Feb 2018 16:02:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91E441A18E; Tue, 6 Feb 2018 16:02:33 +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 w16G2XBA051481; Tue, 6 Feb 2018 16:02:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16G2XlZ051480; Tue, 6 Feb 2018 16:02:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802061602.w16G2XlZ051480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Feb 2018 16:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328938 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 328938 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.25 Precedence: list List-Id: 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, 06 Feb 2018 16:02:34 -0000 Author: markj Date: Tue Feb 6 16:02:33 2018 New Revision: 328938 URL: https://svnweb.freebsd.org/changeset/base/328938 Log: Simplify synchronization read error handling. Since synchronization reads are performed by submitting a request to the external mirror provider, we know that the request returns with an error only when gmirror was unable to read a copy of the block from any mirror. Thus, there is no need to retry the request from the synchronization error handler. Tested by: pho MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Tue Feb 6 16:02:25 2018 (r328937) +++ head/sys/geom/mirror/g_mirror.c Tue Feb 6 16:02:33 2018 (r328938) @@ -1336,9 +1336,7 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc */ switch (bp->bio_cmd) { case BIO_READ: { - struct g_mirror_disk *d; struct g_consumer *cp; - int readable; KFAIL_POINT_ERROR(DEBUG_FP, g_mirror_sync_request_read, bp->bio_error); @@ -1349,31 +1347,17 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc bp->bio_error); /* - * If there's at least one other disk from which we can - * read the block, retry the request. - */ - readable = 0; - LIST_FOREACH(d, &sc->sc_disks, d_next) - if (d->d_state == G_MIRROR_DISK_STATE_ACTIVE && - !(d->d_flags & G_MIRROR_DISK_FLAG_BROKEN)) - readable++; - - /* * The read error will trigger a syncid bump, so there's * no need to do that here. * - * If we can retry the read from another disk, do so. - * Otherwise, all we can do is kick out the new disk. + * The read error handling for regular requests will + * retry the read from all active mirrors before passing + * the error back up, so there's no need to retry here. */ - if (readable == 0) { - g_mirror_sync_request_free(disk, bp); - g_mirror_event_send(disk, - G_MIRROR_DISK_STATE_DISCONNECTED, - G_MIRROR_EVENT_DONTWAIT); - } else { - g_mirror_sync_reinit(disk, bp, bp->bio_offset); - goto retry_read; - } + g_mirror_sync_request_free(disk, bp); + g_mirror_event_send(disk, + G_MIRROR_DISK_STATE_DISCONNECTED, + G_MIRROR_EVENT_DONTWAIT); return; } G_MIRROR_LOGREQ(3, bp, @@ -1429,7 +1413,6 @@ g_mirror_sync_request(struct g_mirror_softc *sc, struc g_mirror_sync_reinit(disk, bp, sync->ds_offset); sync->ds_offset += bp->bio_length; -retry_read: G_MIRROR_LOGREQ(3, bp, "Sending synchronization request."); sync->ds_consumer->index++; From owner-svn-src-head@freebsd.org Tue Feb 6 16:17:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1773EE541A; Tue, 6 Feb 2018 16:17:03 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 5793B7194F; Tue, 6 Feb 2018 16:17:02 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 42B7B5646B; Tue, 6 Feb 2018 10:09:54 -0600 (CST) Subject: Re: svn commit: r328933 - head/usr.bin/find To: Alex Richardson , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802061541.w16FfQ1x039394@repo.freebsd.org> From: Eric van Gyzen Message-ID: <66d6d137-d89c-6f73-93eb-423721f99561@vangyzen.net> Date: Tue, 6 Feb 2018 10:09:51 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201802061541.w16FfQ1x039394@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.25 Precedence: list List-Id: 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, 06 Feb 2018 16:17:03 -0000 On 02/06/2018 09:41, Alex Richardson wrote: > +#if HAVE_STRUCT_STAT_ST_BIRTHTIME > else if (plan->flags & F_TIME_A) > ft = entry->fts_statp->st_atim; > else if (plan->flags & F_TIME_B) > ft = entry->fts_statp->st_birthtim; > +#endif Did you intend to put st_atim inside the #if? Eric From owner-svn-src-head@freebsd.org Tue Feb 6 17:01:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64881EE9068; Tue, 6 Feb 2018 17:01:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E012573BAD; Tue, 6 Feb 2018 17:01:10 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAFCA1AB23; Tue, 6 Feb 2018 17:01:10 +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 w16H1Aaj079604; Tue, 6 Feb 2018 17:01:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16H1Akh079603; Tue, 6 Feb 2018 17:01:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802061701.w16H1Akh079603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 6 Feb 2018 17:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328939 - head/contrib/gcc/config/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/contrib/gcc/config/mips X-SVN-Commit-Revision: 328939 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.25 Precedence: list List-Id: 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, 06 Feb 2018 17:01:11 -0000 Author: jhb Date: Tue Feb 6 17:01:10 2018 New Revision: 328939 URL: https://svnweb.freebsd.org/changeset/base/328939 Log: Use a workaround to compile the crt init functions correctly with clang. The MIPS assembly parser treats forward-declared local symbols as global symbols. This results in CALL16 relocations being used against local (private) symbols which then fail to resolve when linking binaries. Add .local to force the init and fini functions to be treated as local as a workaround. Submitted by: sbruno Sponsored by: DARPA / AFRL Modified: head/contrib/gcc/config/mips/mips.h Modified: head/contrib/gcc/config/mips/mips.h ============================================================================== --- head/contrib/gcc/config/mips/mips.h Tue Feb 6 16:02:33 2018 (r328938) +++ head/contrib/gcc/config/mips/mips.h Tue Feb 6 17:01:10 2018 (r328939) @@ -2721,6 +2721,7 @@ while (0) nop\n\ 1: .cpload $31\n\ .set reorder\n\ + .local " USER_LABEL_PREFIX #FUNC "\n\ jal " USER_LABEL_PREFIX #FUNC "\n\ " TEXT_SECTION_ASM_OP); #endif /* Switch to #elif when we're no longer limited by K&R C. */ @@ -2733,6 +2734,7 @@ while (0) nop\n\ 1: .set reorder\n\ .cpsetup $31, $2, 1b\n\ + .local " USER_LABEL_PREFIX #FUNC "\n\ jal " USER_LABEL_PREFIX #FUNC "\n\ " TEXT_SECTION_ASM_OP); #endif From owner-svn-src-head@freebsd.org Tue Feb 6 17:26:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8562EEB793; Tue, 6 Feb 2018 17:26:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DE6D7512F; Tue, 6 Feb 2018 17:26:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 785E51AEDD; Tue, 6 Feb 2018 17:26:11 +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 w16HQBsg092222; Tue, 6 Feb 2018 17:26:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16HQBsS092221; Tue, 6 Feb 2018 17:26:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802061726.w16HQBsS092221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Feb 2018 17:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328940 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 328940 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.25 Precedence: list List-Id: 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, 06 Feb 2018 17:26:11 -0000 Author: markj Date: Tue Feb 6 17:26:11 2018 New Revision: 328940 URL: https://svnweb.freebsd.org/changeset/base/328940 Log: Delete a declaration for a variable removed in r305362. Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Feb 6 17:01:10 2018 (r328939) +++ head/sys/vm/vm_page.h Tue Feb 6 17:26:11 2018 (r328940) @@ -379,8 +379,6 @@ extern struct mtx_padalign pa_lock[]; * */ -extern int vm_page_zero_count; - extern vm_page_t vm_page_array; /* First resident page in table */ extern long vm_page_array_size; /* number of vm_page_t's */ extern long first_page; /* first physical page number */ From owner-svn-src-head@freebsd.org Tue Feb 6 18:18:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8167EEF7C6; Tue, 6 Feb 2018 18:18:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 516AD7759F; Tue, 6 Feb 2018 18:18:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w16II2il001409 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 10:18:02 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16II13a001408; Tue, 6 Feb 2018 10:18:01 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 10:18:01 -0800 From: Gleb Smirnoff To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206181801.GA1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <6675B0B0-A582-4D5A-832B-A0E0E13B9E6C@fubar.geek.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6675B0B0-A582-4D5A-832B-A0E0E13B9E6C@fubar.geek.nz> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 18:18:11 -0000 On Tue, Feb 06, 2018 at 10:54:05AM +0000, Andrew Turner wrote: A> > Author: glebius A> > Date: Tue Feb 6 04:16:00 2018 A> > New Revision: 328916 A> > URL: https://svnweb.freebsd.org/changeset/base/328916 A> > A> > Log: A> > Followup on r302393 by cperciva, improving calculation of boot pages required A> > for UMA startup. A> > A> > o Introduce another stage of UMA startup, which is entered after A> > vm_page_startup() finishes. After this stage we don't yet enable buckets, A> > but we can ask VM for pages. Rename stages to meaningful names while here. A> > New list of stages: BOOT_COLD, BOOT_STRAPPED, BOOT_PAGEALLOC, BOOT_BUCKETS, A> > BOOT_RUNNING. A> > Enabling page alloc earlier allows us to dramatically reduce number of A> > boot pages required. What is more important number of zones becomes A> > consistent across different machines, as no MD allocations are done before A> > the BOOT_PAGEALLOC stage. Now only UMA internal zones actually need to use A> > startup_alloc(), however that may change, so vm_page_startup() provides A> > its need for early zones as argument. A> > o Introduce uma_startup_count() function, to avoid code duplication. The A> > functions calculates sizes of zones zone and kegs zone, and calculates how A> > many pages UMA will need to bootstrap. A> > It counts not only of zone structures, but also of kegs, slabs and hashes. A> > o Hide uma_startup_foo() declarations from public file. A> > o Provide several DIAGNOSTIC printfs on boot_pages usage. A> > o Bugfix: when calculating zone of zones size use (mp_maxid + 1) instead of A> > mp_ncpus. Use resulting number not only in the size argument to zone_ctor() A> > but also as args.size. A> A> With this I’m getting "panic: UMA: Increase vm.boot_pages†on an arm64 simulator with 4GB of memory. I can increase vm.boot_pages manually, however this isn’t useful in the long term. Sorry for problems. Can you please put DIAGNOSTIC into beginning of uma_core.c, and boot with vm.boot_pages bumped, and provide the dmesg to me? -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Tue Feb 6 18:28:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BFEBEF069A; Tue, 6 Feb 2018 18:28:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2621577EB3; Tue, 6 Feb 2018 18:28:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w16ISekg001455 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 10:28:40 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16ISdMf001454; Tue, 6 Feb 2018 10:28:39 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 10:28:39 -0800 From: Gleb Smirnoff To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206182839.GB1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206113017.GA25428@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 18:28:42 -0000 Peter, On Tue, Feb 06, 2018 at 12:30:17PM +0100, Peter Holm wrote: P> i386 also doesn't boot: P> P> FreeBSD 12.0-CURRENT #1 r328924: Tue Feb 6 11:51:17 CET 2018 P> pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 P> FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) P> WARNING: WITNESS option enabled, expect reduced performance. P> WARNING: DIAGNOSTIC option enabled, expect reduced performance. P> Entering uma_startup with 4 boot pages configured P> startup_alloc from "UMA Kegs", 3 boot pages left P> startup_alloc from "UMA Zones", 2 boot pages left P> startup_alloc from "UMA Hash", 1 boot pages left P> Entering uma_startup1 with 0 boot pages left P> kernel trap 12 with interrupts disabled Sorry for problems, I'm working on this. How do you think, is it a good idea to quickly add a one line change to subversion that would bump boot_pages value to arbitrary +100, to fixup the head while I'm working on a proper fix? -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Tue Feb 6 19:14:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B20A1EF42D8; Tue, 6 Feb 2018 19:14:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6809F7A768; Tue, 6 Feb 2018 19:14:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 630E51C180; Tue, 6 Feb 2018 19:14:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16JEFD8047616; Tue, 6 Feb 2018 19:14:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16JEFt6047615; Tue, 6 Feb 2018 19:14:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201802061914.w16JEFt6047615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 6 Feb 2018 19:14:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328945 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 328945 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.25 Precedence: list List-Id: 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, 06 Feb 2018 19:14:15 -0000 Author: bz Date: Tue Feb 6 19:14:15 2018 New Revision: 328945 URL: https://svnweb.freebsd.org/changeset/base/328945 Log: Remove a trailing whitspace. Modified: head/sys/sys/bus_dma.h Modified: head/sys/sys/bus_dma.h ============================================================================== --- head/sys/sys/bus_dma.h Tue Feb 6 19:13:44 2018 (r328944) +++ head/sys/sys/bus_dma.h Tue Feb 6 19:14:15 2018 (r328945) @@ -178,7 +178,7 @@ int bus_dma_tag_create(bus_dma_tag_t parent, bus_size_ /* * Set the memory domain to be used for allocations. - * + * * Automatic for PCI devices. Must be set prior to creating maps or * allocating memory. */ From owner-svn-src-head@freebsd.org Tue Feb 6 19:25:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B183EF5494; Tue, 6 Feb 2018 19:25:15 +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 0EC7A7BD2D; Tue, 6 Feb 2018 19:25: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 w16JP4n1017962; Tue, 6 Feb 2018 11:25:04 -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 w16JP4aq017961; Tue, 6 Feb 2018 11:25:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328934 - in head: . bin/sh In-Reply-To: <201802061541.w16FfadO041469@repo.freebsd.org> To: Alex Richardson Date: Tue, 6 Feb 2018 11:25:04 -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.25 Precedence: list List-Id: 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, 06 Feb 2018 19:25:15 -0000 > Author: arichardson > Date: Tue Feb 6 15:41:35 2018 > New Revision: 328934 > URL: https://svnweb.freebsd.org/changeset/base/328934 > > Log: > Don't hardcode /usr/bin as the path for mktemp in build tools > > It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in > /bin there. > > Reviewed By: bdrewery > Approved By: jhb (mentor) > Differential Revision: https://reviews.freebsd.org/D13937 Would it be better to create the variable MKTEMP to point at either /bin/mktemp or /usr/bin/mktemp dependent on platform, there are reasons we use full paths in Makefiles, mostly to stop /usr/local/bin/foo contimaton, which I believe this change now opens up, though very slight as I dont know of a third party mktemp binary. > Modified: > head/Makefile.inc1 > head/bin/sh/mkbuiltins > head/bin/sh/mktokens > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Tue Feb 6 15:41:26 2018 (r328933) > +++ head/Makefile.inc1 Tue Feb 6 15:41:35 2018 (r328934) > @@ -463,7 +463,7 @@ TMPPATH= ${STRICTTMPPATH}:${PATH} > # when in the middle of installing over this system. > # > .if make(distributeworld) || make(installworld) || make(stageworld) > -INSTALLTMP!= /usr/bin/mktemp -d -u -t install > +INSTALLTMP!= mktemp -d -u -t install > .endif > > .if make(stagekernel) || make(distributekernel) > > Modified: head/bin/sh/mkbuiltins > ============================================================================== > --- head/bin/sh/mkbuiltins Tue Feb 6 15:41:26 2018 (r328933) > +++ head/bin/sh/mkbuiltins Tue Feb 6 15:41:35 2018 (r328934) > @@ -34,7 +34,7 @@ > # @(#)mkbuiltins 8.2 (Berkeley) 5/4/95 > # $FreeBSD$ > > -temp=`/usr/bin/mktemp -t ka` > +temp=`mktemp -t ka` > havehist=1 > if [ "X$1" = "X-h" ]; then > havehist=0 > > Modified: head/bin/sh/mktokens > ============================================================================== > --- head/bin/sh/mktokens Tue Feb 6 15:41:26 2018 (r328933) > +++ head/bin/sh/mktokens Tue Feb 6 15:41:35 2018 (r328934) > @@ -38,7 +38,7 @@ > # token marks the end of a list. The third column is the name to print in > # error messages. > > -temp=`/usr/bin/mktemp -t ka` > +temp=`mktemp -t ka` > cat > $temp <<\! > TEOF 1 end of file > TNL 0 newline > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Feb 6 19:34:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44911EF645A; Tue, 6 Feb 2018 19:34:34 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D744F7C783; Tue, 6 Feb 2018 19:34:33 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 432B8D00B7D; Tue, 6 Feb 2018 14:34:32 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w16JYUC7036314 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 20:34:30 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w16JYUds036313; Tue, 6 Feb 2018 20:34:30 +0100 (CET) (envelope-from pho) Date: Tue, 6 Feb 2018 20:34:30 +0100 From: Peter Holm To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206193430.GA36054@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206182839.GB1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 19:34:34 -0000 On Tue, Feb 06, 2018 at 10:28:39AM -0800, Gleb Smirnoff wrote: > Peter, > > On Tue, Feb 06, 2018 at 12:30:17PM +0100, Peter Holm wrote: > P> i386 also doesn't boot: > P> > P> FreeBSD 12.0-CURRENT #1 r328924: Tue Feb 6 11:51:17 CET 2018 > P> pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 > P> FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) > P> WARNING: WITNESS option enabled, expect reduced performance. > P> WARNING: DIAGNOSTIC option enabled, expect reduced performance. > P> Entering uma_startup with 4 boot pages configured > P> startup_alloc from "UMA Kegs", 3 boot pages left > P> startup_alloc from "UMA Zones", 2 boot pages left > P> startup_alloc from "UMA Hash", 1 boot pages left > P> Entering uma_startup1 with 0 boot pages left > P> kernel trap 12 with interrupts disabled > > Sorry for problems, I'm working on this. > > How do you think, is it a good idea to quickly add a one line change > to subversion that would bump boot_pages value to arbitrary +100, > to fixup the head while I'm working on a proper fix? > Oh, this is not a problem for me. Increasing boot_pages does however not seem to change anything: OK set vm.boot_pages=164 OK boot /boot/kernel/kernel text=0x146eead data=0xf0da0+0x2aa460 syms=[0x4+0xf0420+0x4+0x1865f5] /boot/entropy size=0x1000 /boot/kernel/amdtemp.ko text=0x2154 data=0x164+0x4 syms=[0x4+0x600+0x4+0x6d9] loading required module 'amdsmn' /boot/kernel/amdsmn.ko text=0xe1c data=0x124+0x4 syms=[0x4+0x4a0+0x4+0x4fd] Booting... GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2018 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 #3 r328941: Tue Feb 6 20:20:12 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Entering uma_startup with 164 boot pages configured startup_alloc from "UMA Kegs", 163 boot pages left startup_alloc from "UMA Zones", 162 boot pages left startup_alloc from "UMA Hash", 161 boot pages left Entering uma_startup1 with 160 boot pages left kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x19c fault code = supervisor read, page not present instruction pointer = 0x20:0xc0cdac38 stack pointer = 0x28:0xc2022bd0 frame pointer = 0x28:0xc2022c00 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = resume, IOPL = 0 current process = 0 () [ thread pid 0 tid 0 ] Stopped at vmem_alloc+0x88: cmpl %esi,0x19c(%edi) db> bt Tracing pid 0 tid 0 td 0xc1be3a40 vmem_alloc(0,1000,2102,c2022c1c,c169f490,...) at vmem_alloc+0x88/frame 0xc2022c00 kmem_malloc_domain(0,1000,102) at kmem_malloc_domain+0x44/frame 0xc2022c2c page_alloc(c2318000,1000,0,c2022c77,102,...) at page_alloc+0x26/frame 0xc2022c44 keg_alloc_slab(0,2,c169f490,d19,c2315b70,...) at keg_alloc_slab+0xf6/frame 0xc2022c8c uma_prealloc(c2318000,4,0,0,0,...) at uma_prealloc+0x95/frame 0xc2022cbc vmem_startup(c2157000,c0cc523b,c12b048b,c2022d0c,c2022d0c,...) at vmem_startup+0xf5/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c1869340,...) at vm_mem_init+0x24/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f db> - Peter From owner-svn-src-head@freebsd.org Tue Feb 6 19:35:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3FCBEF654F for ; Tue, 6 Feb 2018 19:35:20 +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 74D827C8F1 for ; Tue, 6 Feb 2018 19:35:20 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: da42dac0-0b74-11e8-91c6-33ffc249f3e8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id da42dac0-0b74-11e8-91c6-33ffc249f3e8; Tue, 06 Feb 2018 19:35:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w16JZDeu019260; Tue, 6 Feb 2018 12:35:13 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1517945713.1366.108.camel@freebsd.org> Subject: Re: svn commit: r328934 - in head: . bin/sh From: Ian Lepore To: rgrimes@freebsd.org, Alex Richardson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 06 Feb 2018 12:35:13 -0700 In-Reply-To: <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> References: <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> 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.25 Precedence: list List-Id: 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, 06 Feb 2018 19:35:21 -0000 On Tue, 2018-02-06 at 11:25 -0800, Rodney W. Grimes wrote: > > > > Author: arichardson > > Date: Tue Feb  6 15:41:35 2018 > > New Revision: 328934 > > URL: https://svnweb.freebsd.org/changeset/base/328934 > > > > Log: > >   Don't hardcode /usr/bin as the path for mktemp in build tools > >    > >   It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp > > is in > >   /bin there. > >    > >   Reviewed By: bdrewery > >   Approved By: jhb (mentor) > >   Differential Revision: https://reviews.freebsd.org/D13937 > Would it be better to create the variable MKTEMP to point at > either /bin/mktemp or /usr/bin/mktemp dependent on platform, > there are reasons we use full paths in Makefiles, mostly to > stop /usr/local/bin/foo contimaton, which I believe this > change now opens up, though very slight as I dont know of > a third party mktemp binary. > I don't understand this idea of /usr/local "polluting" a system.  It seems to me exactly the opposite would be the case... if I have found some 3rd party version of mktemp that I like better, it would be installed in /usr/local.  If I went out of my way to install that, then naturally I WANT it to be used.  To me, it's insane that the /usr/local paths are not in front of the base system paths by default, and it's even more insane that the base system works so hard to NOT use the replacements I've installed (even if I've arranged PATH so that the right versions should be used) so that I have to track down why it's using the wrong thing and apply ad-hoc fixes. -- Ian From owner-svn-src-head@freebsd.org Tue Feb 6 20:12:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 930A7F020EE; Tue, 6 Feb 2018 20:12:06 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E34E7E4CF; Tue, 6 Feb 2018 20:12:06 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 313E61CBC5; Tue, 6 Feb 2018 20:12:06 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16KC62f074952; Tue, 6 Feb 2018 20:12:06 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16KC64l074951; Tue, 6 Feb 2018 20:12:06 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201802062012.w16KC64l074951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Tue, 6 Feb 2018 20:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328949 - head/etc X-SVN-Group: head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 328949 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.25 Precedence: list List-Id: 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, 06 Feb 2018 20:12:06 -0000 Author: feld (ports committer) Date: Tue Feb 6 20:12:05 2018 New Revision: 328949 URL: https://svnweb.freebsd.org/changeset/base/328949 Log: Fix firstboot fs mount logic The firstboot logic has an error which causes the filesystem to be mounted readonly even though root_rw_mount=YES. This fixes the error to ensure that the root filesystem is mounted rw as expected after the run of the firstboot scripts. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D14226 Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Tue Feb 6 19:17:40 2018 (r328948) +++ head/etc/rc Tue Feb 6 20:12:05 2018 (r328949) @@ -141,10 +141,10 @@ if [ -e ${firstboot_sentinel} ]; then if [ -e ${firstboot_sentinel}-reboot ]; then chflags -R 0 ${firstboot_sentinel}-reboot rm -rf ${firstboot_sentinel}-reboot - checkyesno root_rw_mount && mount -ur / + checkyesno root_rw_mount || mount -ur / kill -INT 1 fi - checkyesno root_rw_mount && mount -ur / + checkyesno root_rw_mount || mount -ur / fi echo '' From owner-svn-src-head@freebsd.org Tue Feb 6 21:01:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB747F0617F; Tue, 6 Feb 2018 21:01:39 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0ECA80FBC; Tue, 6 Feb 2018 21:01:39 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 818991D443; Tue, 6 Feb 2018 21:01:39 +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 w16L1dAf003735; Tue, 6 Feb 2018 21:01:39 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16L1cdR003728; Tue, 6 Feb 2018 21:01:38 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201802062101.w16L1cdR003728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 6 Feb 2018 21:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328950 - 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: 328950 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.25 Precedence: list List-Id: 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, 06 Feb 2018 21:01:40 -0000 Author: scottl Date: Tue Feb 6 21:01:38 2018 New Revision: 328950 URL: https://svnweb.freebsd.org/changeset/base/328950 Log: Cache the value of the request and reply frame size since it's used quite a bit in the normal operation of the driver. Covert it to represent bytes instead of 32bit words. Fix what I believe to be is a bug in this respect with the Tri-mode cards. Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mpr/mpr.c Tue Feb 6 21:01:38 2018 (r328950) @@ -1133,6 +1133,14 @@ mpr_send_iocinit(struct mpr_softc *sc) MPR_FUNCTRACE(sc); mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); + /* Do a quick sanity check on proper initialization */ + if ((sc->pqdepth == 0) || (sc->fqdepth == 0) || (sc->reqframesz == 0) + || (sc->replyframesz == 0)) { + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Driver not fully initialized for IOCInit\n"); + return (EINVAL); + } + req_sz = sizeof(MPI2_IOC_INIT_REQUEST); reply_sz = sizeof(MPI2_IOC_INIT_REPLY); bzero(&init, req_sz); @@ -1147,7 +1155,7 @@ mpr_send_iocinit(struct mpr_softc *sc) init.WhoInit = MPI2_WHOINIT_HOST_DRIVER; init.MsgVersion = htole16(MPI2_VERSION); init.HeaderVersion = htole16(MPI2_HEADER_VERSION); - init.SystemRequestFrameSize = htole16(sc->facts->IOCRequestFrameSize); + init.SystemRequestFrameSize = htole16((uint16_t)(sc->reqframesz / 4)); init.ReplyDescriptorPostQueueDepth = htole16(sc->pqdepth); init.ReplyFreeQueueDepth = htole16(sc->fqdepth); init.SenseBufferAddressHigh = 0; @@ -1303,6 +1311,9 @@ mpr_alloc_replies(struct mpr_softc *sc) { int rsize, num_replies; + /* Store the reply frame size in bytes rather than as 32bit words */ + sc->replyframesz = sc->facts->ReplyFrameSize * 4; + /* * sc->num_replies should be one less than sc->fqdepth. We need to * allocate space for sc->fqdepth replies, but only sc->num_replies @@ -1310,7 +1321,7 @@ mpr_alloc_replies(struct mpr_softc *sc) */ num_replies = max(sc->fqdepth, sc->num_replies); - rsize = sc->facts->ReplyFrameSize * num_replies * 4; + rsize = sc->replyframesz * num_replies; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1344,7 +1355,10 @@ mpr_alloc_requests(struct mpr_softc *sc) struct mpr_chain *chain; int i, rsize, nsegs; - rsize = sc->facts->IOCRequestFrameSize * sc->num_reqs * 4; + /* Store the request frame size in bytes rather than as 32bit words */ + sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; + + rsize = sc->reqframesz * sc->num_reqs; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1387,7 +1401,7 @@ mpr_alloc_requests(struct mpr_softc *sc) MPR_MAX_CHAIN_ELEMENT_SIZE; } } else { - sc->chain_frame_size = sc->facts->IOCRequestFrameSize * 4; + sc->chain_frame_size = sc->reqframesz; } rsize = sc->chain_frame_size * sc->max_chains; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ @@ -1493,10 +1507,8 @@ mpr_alloc_requests(struct mpr_softc *sc) } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; - cm->cm_req = sc->req_frames + - i * sc->facts->IOCRequestFrameSize * 4; - cm->cm_req_busaddr = sc->req_busaddr + - i * sc->facts->IOCRequestFrameSize * 4; + cm->cm_req = sc->req_frames + i * sc->reqframesz; + cm->cm_req_busaddr = sc->req_busaddr + i * sc->reqframesz; cm->cm_sense = &sc->sense_frames[i]; cm->cm_sense_busaddr = sc->sense_busaddr + i * MPR_SENSE_LEN; cm->cm_desc.Default.SMID = i; @@ -1621,8 +1633,7 @@ mpr_init_queues(struct mpr_softc *sc) * Initialize all of the free queue entries. */ for (i = 0; i < sc->fqdepth; i++) { - sc->free_queue[i] = sc->reply_busaddr + - (i * sc->facts->ReplyFrameSize * 4); + sc->free_queue[i] = sc->reply_busaddr + (i * sc->replyframesz); } sc->replyfreeindex = sc->num_replies; @@ -2419,13 +2430,13 @@ mpr_intr_locked(void *data) */ if ((reply < sc->reply_frames) || (reply > (sc->reply_frames + - (sc->fqdepth * sc->facts->ReplyFrameSize * 4)))) { + (sc->fqdepth * sc->replyframesz)))) { printf("%s: WARNING: reply %p out of range!\n", __func__, reply); printf("%s: reply_frames %p, fqdepth %d, " "frame size %d\n", __func__, sc->reply_frames, sc->fqdepth, - sc->facts->ReplyFrameSize * 4); + sc->replyframesz); printf("%s: baddr %#x,\n", __func__, baddr); /* LSI-TODO. See Linux Code for Graceful exit */ panic("Reply address out of range"); @@ -2963,7 +2974,7 @@ mpr_check_pcie_native_sgl(struct mpr_softc *sc, struct * put in the main message frame (H/W can only translate an SGL that * is contained entirely in the main message frame). */ - sges_in_segment = (sc->facts->IOCRequestFrameSize - + sges_in_segment = (sc->reqframesz - offsetof(Mpi25SCSIIORequest_t, SGL)) / sizeof(MPI25_SGE_IO_UNION); if (segs_left > sges_in_segment) build_native_sgl = 1; Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mpr/mpr_user.c Tue Feb 6 21:01:38 2018 (r328950) @@ -433,7 +433,7 @@ mpr_init_sge(struct mpr_command *cm, void *req, void * { int off, space; - space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4; + space = (int)cm->cm_sc->reqframesz; off = (uintptr_t)sge - (uintptr_t)req; KASSERT(off < space, ("bad pointers %p %p, off %d, space %d", @@ -673,7 +673,7 @@ mpr_user_command(struct mpr_softc *sc, struct mpr_usr_ mpr_dprint(sc, MPR_USER, "%s: req %p %d rpl %p %d\n", __func__, cmd->req, cmd->req_len, cmd->rpl, cmd->rpl_len); - if (cmd->req_len > (int)sc->facts->IOCRequestFrameSize * 4) { + if (cmd->req_len > (int)sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } @@ -809,7 +809,7 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru if (err != 0) goto RetFreeUnlocked; - if (data->RequestSize > (int)sc->facts->IOCRequestFrameSize * 4) { + if (data->RequestSize > (int)sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mpr/mprvar.h Tue Feb 6 21:01:38 2018 (r328950) @@ -309,6 +309,8 @@ struct mpr_softc { #define MPR_FLAGS_REALLOCATED (1 << 7) u_int mpr_debug; int msi_msgs; + u_int reqframesz; + u_int replyframesz; u_int atomic_desc_capable; int tm_cmds_active; int io_cmds_active; Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mps/mps.c Tue Feb 6 21:01:38 2018 (r328950) @@ -1114,6 +1114,14 @@ mps_send_iocinit(struct mps_softc *sc) MPS_FUNCTRACE(sc); mps_dprint(sc, MPS_INIT, "%s entered\n", __func__); + /* Do a quick sanity check on proper initialization */ + if ((sc->pqdepth == 0) || (sc->fqdepth == 0) || (sc->reqframesz == 0) + || (sc->replyframesz == 0)) { + mps_dprint(sc, MPS_INIT|MPS_ERROR, + "Driver not fully initialized for IOCInit\n"); + return (EINVAL); + } + req_sz = sizeof(MPI2_IOC_INIT_REQUEST); reply_sz = sizeof(MPI2_IOC_INIT_REPLY); bzero(&init, req_sz); @@ -1128,7 +1136,7 @@ mps_send_iocinit(struct mps_softc *sc) init.WhoInit = MPI2_WHOINIT_HOST_DRIVER; init.MsgVersion = htole16(MPI2_VERSION); init.HeaderVersion = htole16(MPI2_HEADER_VERSION); - init.SystemRequestFrameSize = htole16(sc->facts->IOCRequestFrameSize); + init.SystemRequestFrameSize = htole16((uint16_t)(sc->reqframesz / 4)); init.ReplyDescriptorPostQueueDepth = htole16(sc->pqdepth); init.ReplyFreeQueueDepth = htole16(sc->fqdepth); init.SenseBufferAddressHigh = 0; @@ -1282,6 +1290,9 @@ mps_alloc_replies(struct mps_softc *sc) { int rsize, num_replies; + /* Store the reply frame size in bytes rather than as 32bit words */ + sc->replyframesz = sc->facts->ReplyFrameSize * 4; + /* * sc->num_replies should be one less than sc->fqdepth. We need to * allocate space for sc->fqdepth replies, but only sc->num_replies @@ -1289,7 +1300,7 @@ mps_alloc_replies(struct mps_softc *sc) */ num_replies = max(sc->fqdepth, sc->num_replies); - rsize = sc->facts->ReplyFrameSize * num_replies * 4; + rsize = sc->replyframesz * num_replies; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 4, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1323,7 +1334,10 @@ mps_alloc_requests(struct mps_softc *sc) struct mps_chain *chain; int i, rsize, nsegs; - rsize = sc->facts->IOCRequestFrameSize * sc->num_reqs * 4; + /* Store the request frame size in bytes rather than as 32bit words */ + sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; + + rsize = sc->reqframesz * sc->num_reqs; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1347,7 +1361,7 @@ mps_alloc_requests(struct mps_softc *sc) bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mps_memaddr_cb, &sc->req_busaddr, 0); - rsize = sc->facts->IOCRequestFrameSize * sc->max_chains * 4; + rsize = sc->reqframesz * sc->max_chains; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1404,9 +1418,9 @@ mps_alloc_requests(struct mps_softc *sc) for (i = 0; i < sc->max_chains; i++) { chain = &sc->chains[i]; chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + - i * sc->facts->IOCRequestFrameSize * 4); + i * sc->reqframesz); chain->chain_busaddr = sc->chain_busaddr + - i * sc->facts->IOCRequestFrameSize * 4; + i * sc->reqframesz; mps_free_chain(sc, chain); sc->chain_free_lowwater++; } @@ -1441,10 +1455,8 @@ mps_alloc_requests(struct mps_softc *sc) } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; - cm->cm_req = sc->req_frames + - i * sc->facts->IOCRequestFrameSize * 4; - cm->cm_req_busaddr = sc->req_busaddr + - i * sc->facts->IOCRequestFrameSize * 4; + cm->cm_req = sc->req_frames + i * sc->reqframesz; + cm->cm_req_busaddr = sc->req_busaddr + i * sc->reqframesz; cm->cm_sense = &sc->sense_frames[i]; cm->cm_sense_busaddr = sc->sense_busaddr + i * MPS_SENSE_LEN; cm->cm_desc.Default.SMID = i; @@ -1487,7 +1499,7 @@ mps_init_queues(struct mps_softc *sc) * Initialize all of the free queue entries. */ for (i = 0; i < sc->fqdepth; i++) - sc->free_queue[i] = sc->reply_busaddr + (i * sc->facts->ReplyFrameSize * 4); + sc->free_queue[i] = sc->reply_busaddr + (i * sc->replyframesz); sc->replyfreeindex = sc->num_replies; return (0); @@ -2279,13 +2291,13 @@ mps_intr_locked(void *data) */ if ((reply < sc->reply_frames) || (reply > (sc->reply_frames + - (sc->fqdepth * sc->facts->ReplyFrameSize * 4)))) { + (sc->fqdepth * sc->replyframesz)))) { printf("%s: WARNING: reply %p out of range!\n", __func__, reply); printf("%s: reply_frames %p, fqdepth %d, " "frame size %d\n", __func__, sc->reply_frames, sc->fqdepth, - sc->facts->ReplyFrameSize * 4); + sc->replyframesz); printf("%s: baddr %#x,\n", __func__, baddr); /* LSI-TODO. See Linux Code. Need Graceful exit*/ panic("Reply address out of range"); @@ -2553,7 +2565,7 @@ mps_add_chain(struct mps_command *cm) { MPI2_SGE_CHAIN32 *sgc; struct mps_chain *chain; - int space; + u_int space; if (cm->cm_sglsize < MPS_SGC_SIZE) panic("MPS: Need SGE Error Code\n"); @@ -2562,7 +2574,7 @@ mps_add_chain(struct mps_command *cm) if (chain == NULL) return (ENOBUFS); - space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4; + space = cm->cm_sc->reqframesz; /* * Note: a double-linked list is used to make it easier to Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mps/mps_sas.c Tue Feb 6 21:01:38 2018 (r328950) @@ -997,7 +997,7 @@ mpssas_action(struct cam_sim *sim, union ccb *ccb) * user's value and the calculated value as long as the user's * value is larger than 0. The user's value is in pages. */ - sges_per_frame = ((sc->facts->IOCRequestFrameSize * 4) / + sges_per_frame = ((sc->reqframesz) / sizeof(MPI2_SGE_SIMPLE64)) - 1; cpi->maxio = (sges_per_frame * sc->facts->MaxChainDepth) + 1; cpi->maxio *= PAGE_SIZE; Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mps/mps_user.c Tue Feb 6 21:01:38 2018 (r328950) @@ -420,7 +420,7 @@ mpi_init_sge(struct mps_command *cm, void *req, void * { int off, space; - space = (int)cm->cm_sc->facts->IOCRequestFrameSize * 4; + space = (int)cm->cm_sc->reqframesz; off = (uintptr_t)sge - (uintptr_t)req; KASSERT(off < space, ("bad pointers %p %p, off %d, space %d", @@ -688,7 +688,7 @@ mps_user_command(struct mps_softc *sc, struct mps_usr_ mps_dprint(sc, MPS_USER, "%s: req %p %d rpl %p %d\n", __func__, cmd->req, cmd->req_len, cmd->rpl, cmd->rpl_len); - if (cmd->req_len > (int)sc->facts->IOCRequestFrameSize * 4) { + if (cmd->req_len > (int)sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } @@ -821,7 +821,7 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru if (err != 0) goto RetFreeUnlocked; - if (data->RequestSize > (int)sc->facts->IOCRequestFrameSize * 4) { + if (data->RequestSize > (int)sc->reqframesz) { err = EINVAL; goto RetFreeUnlocked; } Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Tue Feb 6 20:12:05 2018 (r328949) +++ head/sys/dev/mps/mpsvar.h Tue Feb 6 21:01:38 2018 (r328950) @@ -307,6 +307,8 @@ struct mps_softc { #define MPS_FLAGS_REALLOCATED (1 << 7) u_int mps_debug; u_int msi_msgs; + u_int reqframesz; + u_int replyframesz; int tm_cmds_active; int io_cmds_active; int io_cmds_highwater; From owner-svn-src-head@freebsd.org Tue Feb 6 21:35:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19963F08BD9; Tue, 6 Feb 2018 21:35:42 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC55C82BD6; Tue, 6 Feb 2018 21:35:41 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6B691D9A1; Tue, 6 Feb 2018 21:35:41 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16LZfSH020198; Tue, 6 Feb 2018 21:35:41 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16LZfLD020197; Tue, 6 Feb 2018 21:35:41 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201802062135.w16LZfLD020197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Tue, 6 Feb 2018 21:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328951 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 328951 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.25 Precedence: list List-Id: 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, 06 Feb 2018 21:35:42 -0000 Author: feld (ports committer) Date: Tue Feb 6 21:35:41 2018 New Revision: 328951 URL: https://svnweb.freebsd.org/changeset/base/328951 Log: Refactor cleanvar to remove shell expansion vulnerability If any process creates a directory named "-P" in /var/run or /var/spool/lock it will cause the purgedir function to start to rm -r /. Simplify a lot of complicated shell logic by leveraging find(1). Reviewed by: allanjude MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D13778 Modified: head/etc/rc.d/cleanvar Modified: head/etc/rc.d/cleanvar ============================================================================== --- head/etc/rc.d/cleanvar Tue Feb 6 21:01:38 2018 (r328950) +++ head/etc/rc.d/cleanvar Tue Feb 6 21:35:41 2018 (r328951) @@ -19,34 +19,6 @@ stop_cmd=":" extra_commands="reload" reload_cmd="${name}_start" -purgedir() -{ - local dir file - - if [ $# -eq 0 ]; then - purgedir . - else - for dir - do - ( - cd "$dir" && for file in .* * - do - # Skip over logging sockets - [ -S "$file" -a "$file" = "log" ] && continue - [ -S "$file" -a "$file" = "logpriv" ] && continue - [ ."$file" = .. -o ."$file" = ... ] && continue - if [ -d "$file" -a ! -L "$file" ] - then - purgedir "$file" - else - rm -f -- "$file" - fi - done - ) - done - fi -} - cleanvar_prestart() { # These files must be removed only the first time this script is run @@ -58,14 +30,17 @@ cleanvar_prestart() cleanvar_start() { if [ -d /var/run -a ! -f /var/run/clean_var ]; then - purgedir /var/run + # Skip over logging sockets + find /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then - purgedir /var/spool/lock + find /var/spool/lock -type f -delete >/var/spool/lock/clean_var fi - rm -rf /var/spool/uucp/.Temp/* + if [ -d /var/spool/uucp/.Temp ]; then + find /var/spool/uucp/.Temp -delete + fi } load_rc_config $name From owner-svn-src-head@freebsd.org Tue Feb 6 22:07:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36FFEF0B815; Tue, 6 Feb 2018 22:07:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E16548495A; Tue, 6 Feb 2018 22:06:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC2AE1DEE8; Tue, 6 Feb 2018 22:06:59 +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 w16M6xre035199; Tue, 6 Feb 2018 22:06:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16M6xCS035195; Tue, 6 Feb 2018 22:06:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802062206.w16M6xCS035195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Feb 2018 22:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328952 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 328952 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.25 Precedence: list List-Id: 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, 06 Feb 2018 22:07:00 -0000 Author: glebius Date: Tue Feb 6 22:06:59 2018 New Revision: 328952 URL: https://svnweb.freebsd.org/changeset/base/328952 Log: Fix boot_pages calculation for machines that don't have UMA_MD_SMALL_ALLOC. o Call uma_startup1() after initializing kmem, vmem and domains. o Include 8 eight VM startup pages into uma_startup_count() calculation. o Account for vmem_startup() and vm_map_startup() preallocating pages. o Account for extra two allocations done by kmem_init() and vmem_create(). o Hardcode the place of execution of vm_radix_reserve_kva(). Using SYSINIT allowed several other SYSINITs to sneak in before it, thus bumping requirement for amount of boot pages. Modified: head/sys/kern/subr_vmem.c head/sys/vm/vm_init.c head/sys/vm/vm_page.c head/sys/vm/vm_radix.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Tue Feb 6 21:35:41 2018 (r328951) +++ head/sys/kern/subr_vmem.c Tue Feb 6 22:06:59 2018 (r328952) @@ -72,7 +72,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +int vmem_startup_count(void); + #define VMEM_OPTORDER 5 #define VMEM_OPTVALUE (1 << VMEM_OPTORDER) #define VMEM_MAXORDER \ @@ -652,6 +655,16 @@ vmem_bt_alloc(uma_zone_t zone, vm_size_t bytes, int do pause("btalloc", 1); return (NULL); +} + +/* + * How many pages do we need to startup_alloc. + */ +int +vmem_startup_count(void) +{ + + return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); } #endif Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Tue Feb 6 21:35:41 2018 (r328951) +++ head/sys/vm/vm_init.c Tue Feb 6 22:06:59 2018 (r328952) @@ -93,6 +93,8 @@ __FBSDID("$FreeBSD$"); #include #include +extern void uma_startup1(void); +extern void vm_radix_reserve_kva(void); #if VM_NRESERVLEVEL > 0 #define KVA_QUANTUM (1 << (VM_LEVEL_0_ORDER + PAGE_SHIFT)) @@ -150,7 +152,11 @@ vm_mem_init(dummy) */ vm_set_page_size(); virtual_avail = vm_page_startup(virtual_avail); - + +#ifdef UMA_MD_SMALL_ALLOC + /* Announce page availability to UMA. */ + uma_startup1(); +#endif /* * Initialize other VM packages */ @@ -173,6 +179,12 @@ vm_mem_init(dummy) KVA_QUANTUM); } +#ifndef UMA_MD_SMALL_ALLOC + /* Set up radix zone to use noobj_alloc. */ + vm_radix_reserve_kva(); + /* Announce page availability to UMA. */ + uma_startup1(); +#endif kmem_init_zero_region(); pmap_init(); vm_pager_init(); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Feb 6 21:35:41 2018 (r328951) +++ head/sys/vm/vm_page.c Tue Feb 6 22:06:59 2018 (r328952) @@ -112,6 +112,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -127,7 +128,7 @@ __FBSDID("$FreeBSD$"); extern int uma_startup_count(int); extern void uma_startup(void *, int); -extern void uma_startup1(void); +extern int vmem_startup_count(void); /* * Associated with page of user-allocatable memory is a @@ -501,12 +502,33 @@ vm_page_startup(vm_offset_t vaddr) /* * Allocate memory for use when boot strapping the kernel memory - * allocator. - * + * allocator. Tell UMA how many zones we are going to create + * before going fully functional. UMA will add its zones. + */ +#ifdef UMA_MD_SMALL_ALLOC + boot_pages = uma_startup_count(0); +#else + /* + * VM startup zones: vmem, vmem_btag, VM OBJECT, RADIX NODE, MAP, + * KMAP ENTRY, MAP ENTRY, VMSPACE. + */ + boot_pages = uma_startup_count(8); + + /* vmem_startup() calls uma_prealloc(). */ + boot_pages += vmem_startup_count(); + /* vm_map_startup() calls uma_prealloc(). */ + boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + + /* + * Before going fully functional kmem_init() does allocation + * from "KMAP ENTRY" and vmem_create() does allocation from "vmem". + */ + boot_pages += 2; +#endif + /* * CTFLAG_RDTUN doesn't work during the early boot process, so we must * manually fetch the value. */ - boot_pages = uma_startup_count(0); TUNABLE_INT_FETCH("vm.boot_pages", &boot_pages); new_end = end - (boot_pages * UMA_SLAB_SIZE); new_end = trunc_page(new_end); @@ -739,9 +761,6 @@ vm_page_startup(vm_offset_t vaddr) * can work. */ domainset_zero(); - - /* Announce page availability to UMA. */ - uma_startup1(); return (vaddr); } Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Tue Feb 6 21:35:41 2018 (r328951) +++ head/sys/vm/vm_radix.c Tue Feb 6 22:06:59 2018 (r328952) @@ -284,6 +284,7 @@ vm_radix_node_zone_dtor(void *mem, int size __unused, #endif #ifndef UMA_MD_SMALL_ALLOC +void vm_radix_reserve_kva(void); /* * Reserve the KVA necessary to satisfy the node allocation. * This is mandatory in architectures not supporting direct @@ -291,8 +292,8 @@ vm_radix_node_zone_dtor(void *mem, int size __unused, * every node allocation, resulting into deadlocks for consumers already * working with kernel maps. */ -static void -vm_radix_reserve_kva(void *arg __unused) +void +vm_radix_reserve_kva(void) { /* @@ -304,8 +305,6 @@ vm_radix_reserve_kva(void *arg __unused) sizeof(struct vm_radix_node)))) panic("%s: unable to reserve KVA", __func__); } -SYSINIT(vm_radix_reserve_kva, SI_SUB_KMEM, SI_ORDER_THIRD, - vm_radix_reserve_kva, NULL); #endif /* From owner-svn-src-head@freebsd.org Tue Feb 6 22:08:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95C55F0BACC; Tue, 6 Feb 2018 22:08:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4677D84B94; Tue, 6 Feb 2018 22:08:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40D461DEEC; Tue, 6 Feb 2018 22:08:44 +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 w16M8iaK035316; Tue, 6 Feb 2018 22:08:44 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16M8iTe035315; Tue, 6 Feb 2018 22:08:44 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802062208.w16M8iTe035315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Feb 2018 22:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328953 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 328953 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.25 Precedence: list List-Id: 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, 06 Feb 2018 22:08:44 -0000 Author: glebius Date: Tue Feb 6 22:08:43 2018 New Revision: 328953 URL: https://svnweb.freebsd.org/changeset/base/328953 Log: Improve DIAGNOSTIC printf. Report using a boot page every time regardless of booted status. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 6 22:06:59 2018 (r328952) +++ head/sys/vm/uma_core.c Tue Feb 6 22:08:43 2018 (r328953) @@ -1088,12 +1088,11 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do * Check our small startup cache to see if it has pages remaining. */ mtx_lock(&uma_boot_pages_mtx); + if (pages <= boot_pages) { #ifdef DIAGNOSTIC - if (booted < BOOT_PAGEALLOC) printf("%s from \"%s\", %d boot pages left\n", __func__, zone->uz_name, boot_pages); #endif - if (pages <= boot_pages) { mem = bootmem; boot_pages -= pages; bootmem += pages * PAGE_SIZE; From owner-svn-src-head@freebsd.org Tue Feb 6 22:10:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2596FF0BC5D; Tue, 6 Feb 2018 22:10:11 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD1E684D4F; Tue, 6 Feb 2018 22:10:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C45F71DEF3; Tue, 6 Feb 2018 22:10:10 +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 w16MAAaY035477; Tue, 6 Feb 2018 22:10:10 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16MA8fn035448; Tue, 6 Feb 2018 22:10:08 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201802062210.w16MA8fn035448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Tue, 6 Feb 2018 22:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328954 - in head/sys: amd64/amd64 arm/arm cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/linprocfs fs/tmpfs i386/i386 kern mips/mips powerpc/booke powerp... X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/linprocfs fs/tmpfs i386/i386 kern mips/mips powerpc/booke powerpc/powerpc sparc64/sparc64... X-SVN-Commit-Revision: 328954 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.25 Precedence: list List-Id: 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, 06 Feb 2018 22:10:11 -0000 Author: jeff Date: Tue Feb 6 22:10:07 2018 New Revision: 328954 URL: https://svnweb.freebsd.org/changeset/base/328954 Log: Use per-domain locks for vm page queue free. Move paging control from global to per-domain state. Protect reservations with the free lock from the domain that they belong to. Refactor to make vm domains more of a first class object. Reviewed by: markj, kib, gallatin Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon Differential Revision: https://reviews.freebsd.org/D14000 Added: head/sys/vm/vm_pagequeue.h (contents, props changed) Modified: head/sys/amd64/amd64/machdep.c head/sys/arm/arm/machdep.c head/sys/arm/arm/pmap-v4.c head/sys/cddl/compat/opensolaris/sys/kmem.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/compat/linprocfs/linprocfs.c head/sys/fs/tmpfs/tmpfs_subr.c head/sys/i386/i386/machdep.c head/sys/kern/init_main.c head/sys/kern/subr_vmem.c head/sys/kern/subr_witness.c head/sys/mips/mips/machdep.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/powerpc/machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/sys/vmmeter.h head/sys/vm/swap_pager.c head/sys/vm/uma_core.c head/sys/vm/vm_extern.h head/sys/vm/vm_glue.c head/sys/vm/vm_init.c head/sys/vm/vm_kern.c head/sys/vm/vm_map.c head/sys/vm/vm_meter.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_pageout.h head/sys/vm/vm_phys.c head/sys/vm/vm_phys.h head/sys/vm/vm_reserv.c head/sys/vm/vm_reserv.h head/sys/vm/vm_swapout.c head/sys/vm/vnode_pager.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/amd64/amd64/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -282,7 +282,7 @@ cpu_startup(dummy) memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; freeenv(sysenv); } - if (memsize < ptoa((uintmax_t)vm_cnt.v_free_count)) + if (memsize < ptoa((uintmax_t)vm_free_count())) memsize = ptoa((uintmax_t)Maxmem); printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); realmem = atop(memsize); @@ -309,8 +309,8 @@ cpu_startup(dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)vm_cnt.v_free_count), - ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/arm/arm/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -228,8 +228,8 @@ cpu_startup(void *dummy) (uintmax_t)arm32_ptob(realmem), (uintmax_t)arm32_ptob(realmem) / mbyte); printf("avail memory = %ju (%ju MB)\n", - (uintmax_t)arm32_ptob(vm_cnt.v_free_count), - (uintmax_t)arm32_ptob(vm_cnt.v_free_count) / mbyte); + (uintmax_t)arm32_ptob(vm_free_count()), + (uintmax_t)arm32_ptob(vm_free_count()) / mbyte); if (bootverbose) { arm_physmem_print_tables(); devmap_print_table(); Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/arm/arm/pmap-v4.c Tue Feb 6 22:10:07 2018 (r328954) @@ -3817,7 +3817,7 @@ pmap_get_pv_entry(void) pv_entry_count++; if (pv_entry_count > pv_entry_high_water) - pagedaemon_wakeup(); + pagedaemon_wakeup(0); /* XXX ARM NUMA */ ret_value = uma_zalloc(pvzone, M_NOWAIT); return ret_value; } Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kmem.h Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Tue Feb 6 22:10:07 2018 (r328954) @@ -78,7 +78,7 @@ void kmem_reap(void); int kmem_debugging(void); void *calloc(size_t n, size_t s); -#define freemem vm_cnt.v_free_count +#define freemem vm_free_count() #define minfree vm_cnt.v_free_min #define heap_arena kernel_arena #define zio_arena NULL Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 6 22:10:07 2018 (r328954) @@ -379,7 +379,7 @@ static void arc_free_target_init(void *unused __unused) { - zfs_arc_free_target = vm_pageout_wakeup_thresh; + zfs_arc_free_target = (vm_cnt.v_free_min / 10) * 11; } SYSINIT(arc_free_target_init, SI_SUB_KTHREAD_PAGE, SI_ORDER_ANY, arc_free_target_init, NULL); Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/compat/linprocfs/linprocfs.c Tue Feb 6 22:10:07 2018 (r328954) @@ -156,7 +156,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) /* * The correct thing here would be: * - memfree = vm_cnt.v_free_count * PAGE_SIZE; + memfree = vm_free_count() * PAGE_SIZE; memused = memtotal - memfree; * * but it might mislead linux binaries into thinking there @@ -178,7 +178,7 @@ linprocfs_domeminfo(PFS_FILL_ARGS) * like unstaticizing it just for linprocfs's sake. */ buffers = 0; - cached = vm_cnt.v_inactive_count * PAGE_SIZE; + cached = vm_inactive_count() * PAGE_SIZE; sbuf_printf(sb, "MemTotal: %9lu kB\n" Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Feb 6 22:10:07 2018 (r328954) @@ -106,7 +106,7 @@ tmpfs_mem_avail(void) { vm_ooffset_t avail; - avail = swap_pager_avail + vm_cnt.v_free_count - tmpfs_pages_reserved; + avail = swap_pager_avail + vm_free_count() - tmpfs_pages_reserved; if (__predict_false(avail < 0)) avail = 0; return (avail); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/i386/i386/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -271,7 +271,7 @@ cpu_startup(dummy) memsize = (uintmax_t)strtoul(sysenv, (char **)NULL, 10) << 10; freeenv(sysenv); } - if (memsize < ptoa((uintmax_t)vm_cnt.v_free_count)) + if (memsize < ptoa((uintmax_t)vm_free_count())) memsize = ptoa((uintmax_t)Maxmem); printf("real memory = %ju (%ju MB)\n", memsize, memsize >> 20); realmem = atop(memsize); @@ -298,8 +298,8 @@ cpu_startup(dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)vm_cnt.v_free_count), - ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/kern/init_main.c Tue Feb 6 22:10:07 2018 (r328954) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -555,7 +556,7 @@ proc0_init(void *dummy __unused) p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_cur = dflssiz; p->p_limit->pl_rlimit[RLIMIT_STACK].rlim_max = maxssiz; /* Cast to avoid overflow on i386/PAE. */ - pageablemem = ptoa((vm_paddr_t)vm_cnt.v_free_count); + pageablemem = ptoa((vm_paddr_t)vm_free_count()); p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_cur = p->p_limit->pl_rlimit[RLIMIT_RSS].rlim_max = pageablemem; p->p_limit->pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = pageablemem / 3; Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/kern/subr_vmem.c Tue Feb 6 22:10:07 2018 (r328954) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "opt_vm.h" @@ -72,6 +73,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include int vmem_startup_count(void); @@ -644,7 +647,7 @@ vmem_bt_alloc(uma_zone_t zone, vm_size_t bytes, int do * possible due to M_USE_RESERVE page allocation. */ if (wait & M_WAITOK) - VM_WAIT; + vm_wait_domain(domain); return (NULL); } mtx_unlock(&vmem_bt_lock); Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/kern/subr_witness.c Tue Feb 6 22:10:07 2018 (r328954) @@ -139,7 +139,7 @@ __FBSDID("$FreeBSD$"); #define WITNESS_COUNT 1536 #endif #define WITNESS_HASH_SIZE 251 /* Prime, gives load factor < 2 */ -#define WITNESS_PENDLIST (2048 + MAXCPU) +#define WITNESS_PENDLIST (2048 + (MAXCPU * 4)) /* Allocate 256 KB of stack data space */ #define WITNESS_LO_DATA_COUNT 2048 Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/mips/mips/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -210,8 +210,8 @@ cpu_startup(void *dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%juMB)\n", - ptoa((uintmax_t)vm_cnt.v_free_count), - ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1048576); cpu_init_interrupts(); /* Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/powerpc/booke/pmap.c Tue Feb 6 22:10:07 2018 (r328954) @@ -1190,7 +1190,7 @@ pv_alloc(void) pv_entry_count++; if (pv_entry_count > pv_entry_high_water) - pagedaemon_wakeup(); + pagedaemon_wakeup(0); /* XXX powerpc NUMA */ pv = uma_zalloc(pvzone, M_NOWAIT); return (pv); Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/powerpc/powerpc/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -221,8 +221,8 @@ cpu_startup(void *dummy) vm_ksubmap_init(&kmi); printf("avail memory = %ju (%ju MB)\n", - ptoa((uintmax_t)vm_cnt.v_free_count), - ptoa((uintmax_t)vm_cnt.v_free_count) / 1048576); + ptoa((uintmax_t)vm_free_count()), + ptoa((uintmax_t)vm_free_count()) / 1048576); /* * Set up buffers, so they can be used to read disk labels. Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/sparc64/sparc64/machdep.c Tue Feb 6 22:10:07 2018 (r328954) @@ -190,8 +190,8 @@ cpu_startup(void *arg) EVENTHANDLER_REGISTER(shutdown_final, sparc64_shutdown_final, NULL, SHUTDOWN_PRI_LAST); - printf("avail memory = %lu (%lu MB)\n", vm_cnt.v_free_count * PAGE_SIZE, - vm_cnt.v_free_count / ((1024 * 1024) / PAGE_SIZE)); + printf("avail memory = %lu (%lu MB)\n", vm_free_count() * PAGE_SIZE, + vm_free_count() / ((1024 * 1024) / PAGE_SIZE)); if (bootverbose) printf("machine: %s\n", sparc64_model); Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/sys/vmmeter.h Tue Feb 6 22:10:07 2018 (r328954) @@ -140,23 +140,23 @@ struct vmmeter { u_int v_interrupt_free_min; /* (c) reserved pages for int code */ u_int v_free_severe; /* (c) severe page depletion point */ u_int v_wire_count VMMETER_ALIGNED; /* (a) pages wired down */ - u_int v_active_count VMMETER_ALIGNED; /* (a) pages active */ - u_int v_inactive_count VMMETER_ALIGNED; /* (a) pages inactive */ - u_int v_laundry_count VMMETER_ALIGNED; /* (a) pages eligible for - laundering */ - u_int v_free_count VMMETER_ALIGNED; /* (f) pages free */ }; #endif /* _KERNEL || _WANT_VMMETER */ #ifdef _KERNEL +#include + extern struct vmmeter vm_cnt; -extern u_int vm_pageout_wakeup_thresh; +extern domainset_t vm_min_domains; +extern domainset_t vm_severe_domains; #define VM_CNT_ADD(var, x) counter_u64_add(vm_cnt.var, x) #define VM_CNT_INC(var) VM_CNT_ADD(var, 1) #define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) +u_int vm_free_count(void); + /* * Return TRUE if we are under our severe low-free-pages threshold * @@ -167,7 +167,7 @@ static inline int vm_page_count_severe(void) { - return (vm_cnt.v_free_severe > vm_cnt.v_free_count); + return (!DOMAINSET_EMPTY(&vm_severe_domains)); } /* @@ -183,50 +183,8 @@ static inline int vm_page_count_min(void) { - return (vm_cnt.v_free_min > vm_cnt.v_free_count); + return (!DOMAINSET_EMPTY(&vm_min_domains)); } -/* - * Return TRUE if we have not reached our free page target during - * free page recovery operations. - */ -static inline int -vm_page_count_target(void) -{ - - return (vm_cnt.v_free_target > vm_cnt.v_free_count); -} - -/* - * Return the number of pages we need to free-up or cache - * A positive number indicates that we do not have enough free pages. - */ -static inline int -vm_paging_target(void) -{ - - return (vm_cnt.v_free_target - vm_cnt.v_free_count); -} - -/* - * Returns TRUE if the pagedaemon needs to be woken up. - */ -static inline int -vm_paging_needed(u_int free_count) -{ - - return (free_count < vm_pageout_wakeup_thresh); -} - -/* - * Return the number of pages we need to launder. - * A positive number indicates that we have a shortfall of clean pages. - */ -static inline int -vm_laundry_target(void) -{ - - return (vm_paging_target()); -} #endif /* _KERNEL */ #endif /* _SYS_VMMETER_H_ */ Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/swap_pager.c Tue Feb 6 22:10:07 2018 (r328954) @@ -2327,7 +2327,7 @@ swapoff_one(struct swdevt *sp, struct ucred *cred) * of data we will have to page back in, plus an epsilon so * the system doesn't become critically low on swap space. */ - if (vm_cnt.v_free_count + swap_pager_avail < nblks + nswap_lowat) + if (vm_free_count() + swap_pager_avail < nblks + nswap_lowat) return (ENOMEM); /* Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/uma_core.c Tue Feb 6 22:10:07 2018 (r328954) @@ -3464,7 +3464,7 @@ uma_large_malloc_domain(vm_size_t size, int domain, in slab->us_data = (void *)addr; slab->us_flags = UMA_SLAB_KERNEL | UMA_SLAB_MALLOC; slab->us_size = size; - slab->us_domain = vm_phys_domidx(PHYS_TO_VM_PAGE( + slab->us_domain = vm_phys_domain(PHYS_TO_VM_PAGE( pmap_kextract(addr))); uma_total_inc(size); } else { Modified: head/sys/vm/vm_extern.h ============================================================================== --- head/sys/vm/vm_extern.h Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_extern.h Tue Feb 6 22:10:07 2018 (r328954) @@ -122,5 +122,9 @@ struct sf_buf *vm_imgact_map_page(vm_object_t object, void vm_imgact_unmap_page(struct sf_buf *sf); void vm_thread_dispose(struct thread *td); int vm_thread_new(struct thread *td, int pages); +u_int vm_active_count(void); +u_int vm_inactive_count(void); +u_int vm_laundry_count(void); +u_int vm_wait_count(void); #endif /* _KERNEL */ #endif /* !_VM_EXTERN_H_ */ Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_glue.c Tue Feb 6 22:10:07 2018 (r328954) @@ -552,7 +552,7 @@ vm_forkproc(struct thread *td, struct proc *p2, struct } while (vm_page_count_severe()) { - VM_WAIT; + vm_wait_severe(); } if ((flags & RFMEM) == 0) { Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_init.c Tue Feb 6 22:10:07 2018 (r328954) @@ -89,6 +89,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_kern.c Tue Feb 6 22:10:07 2018 (r328954) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -196,7 +197,7 @@ retry: if (!vm_page_reclaim_contig_domain(domain, pflags, 1, low, high, PAGE_SIZE, 0) && (flags & M_WAITOK) != 0) - VM_WAIT; + vm_wait_domain(domain); VM_OBJECT_WLOCK(object); tries++; goto retry; @@ -205,9 +206,9 @@ retry: vmem_free(vmem, addr, size); return (0); } - KASSERT(vm_phys_domidx(m) == domain, + KASSERT(vm_phys_domain(m) == domain, ("kmem_alloc_attr_domain: Domain mismatch %d != %d", - vm_phys_domidx(m), domain)); + vm_phys_domain(m), domain)); if ((flags & M_ZERO) && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); m->valid = VM_PAGE_BITS_ALL; @@ -280,7 +281,7 @@ retry: if (!vm_page_reclaim_contig_domain(domain, pflags, npages, low, high, alignment, boundary) && (flags & M_WAITOK) != 0) - VM_WAIT; + vm_wait_domain(domain); VM_OBJECT_WLOCK(object); tries++; goto retry; @@ -288,9 +289,9 @@ retry: vmem_free(vmem, addr, size); return (0); } - KASSERT(vm_phys_domidx(m) == domain, + KASSERT(vm_phys_domain(m) == domain, ("kmem_alloc_contig_domain: Domain mismatch %d != %d", - vm_phys_domidx(m), domain)); + vm_phys_domain(m), domain)); end_m = m + npages; tmp = addr; for (; m < end_m; m++) { @@ -452,9 +453,9 @@ retry: kmem_unback(object, addr, i); return (KERN_NO_SPACE); } - KASSERT(vm_phys_domidx(m) == domain, + KASSERT(vm_phys_domain(m) == domain, ("kmem_back_domain: Domain mismatch %d != %d", - vm_phys_domidx(m), domain)); + vm_phys_domain(m), domain)); if (flags & M_ZERO && (m->flags & PG_ZERO) == 0) pmap_zero_page(m); KASSERT((m->oflags & VPO_UNMANAGED) != 0, @@ -514,7 +515,7 @@ _kmem_unback(vm_object_t object, vm_offset_t addr, vm_ end = offset + size; VM_OBJECT_WLOCK(object); m = vm_page_lookup(object, atop(offset)); - domain = vm_phys_domidx(m); + domain = vm_phys_domain(m); for (; offset < end; offset += PAGE_SIZE, m = next) { next = vm_page_next(m); vm_page_unwire(m, PQ_NONE); Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_map.c Tue Feb 6 22:10:07 2018 (r328954) @@ -2011,7 +2011,7 @@ vm_map_pmap_enter(vm_map_t map, vm_offset_t addr, vm_p * free pages allocating pv entries. */ if (((flags & MAP_PREFAULT_MADVISE) != 0 && - vm_cnt.v_free_count < vm_cnt.v_free_reserved) || + vm_page_count_severe()) || ((flags & MAP_PREFAULT_PARTIAL) != 0 && tmpidx >= threshold)) { psize = tmpidx; Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_meter.c Tue Feb 6 22:10:07 2018 (r328954) @@ -53,6 +53,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include @@ -213,9 +215,6 @@ vmtotal(SYSCTL_HANDLER_ARGS) total.t_dw++; else total.t_sl++; - if (td->td_wchan == - &vm_cnt.v_free_count) - total.t_pw++; } break; case TDS_CAN_RUN: @@ -283,7 +282,8 @@ vmtotal(SYSCTL_HANDLER_ARGS) } } mtx_unlock(&vm_object_list_mtx); - total.t_free = vm_cnt.v_free_count; + total.t_pw = vm_wait_count(); + total.t_free = vm_free_count(); #if defined(COMPAT_FREEBSD11) /* sysctl(8) allocates twice as much memory as reported by sysctl(3) */ if (curproc->p_osrel < P_OSREL_VMTOTAL64 && (req->oldlen == @@ -339,7 +339,7 @@ sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) #define VM_STATS(parent, var, descr) \ SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ - CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr) #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) @@ -379,19 +379,36 @@ VM_STATS_VM(v_vforkpages, "VM pages affected by vfork( VM_STATS_VM(v_rforkpages, "VM pages affected by rfork()"); VM_STATS_VM(v_kthreadpages, "VM pages affected by fork() by kernel"); +static int +sysctl_handle_vmstat_proc(SYSCTL_HANDLER_ARGS) +{ + u_int (*fn)(void); + uint32_t val; + + fn = arg1; + val = fn(); + return (SYSCTL_OUT(req, &val, sizeof(val))); +} + +#define VM_STATS_PROC(var, descr, fn) \ + SYSCTL_OID(_vm_stats_vm, OID_AUTO, var, CTLTYPE_U32 | CTLFLAG_MPSAFE | \ + CTLFLAG_RD, fn, 0, sysctl_handle_vmstat_proc, "IU", descr) + #define VM_STATS_UINT(var, descr) \ SYSCTL_UINT(_vm_stats_vm, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, 0, descr) + VM_STATS_UINT(v_page_size, "Page size in bytes"); VM_STATS_UINT(v_page_count, "Total number of pages in system"); VM_STATS_UINT(v_free_reserved, "Pages reserved for deadlock"); VM_STATS_UINT(v_free_target, "Pages desired free"); VM_STATS_UINT(v_free_min, "Minimum low-free-pages threshold"); -VM_STATS_UINT(v_free_count, "Free pages"); +VM_STATS_PROC(v_free_count, "Free pages", vm_free_count); VM_STATS_UINT(v_wire_count, "Wired pages"); -VM_STATS_UINT(v_active_count, "Active pages"); +VM_STATS_PROC(v_active_count, "Active pages", vm_active_count); VM_STATS_UINT(v_inactive_target, "Desired inactive pages"); -VM_STATS_UINT(v_inactive_count, "Inactive pages"); -VM_STATS_UINT(v_laundry_count, "Pages eligible for laundering"); +VM_STATS_PROC(v_inactive_count, "Inactive pages", vm_inactive_count); +VM_STATS_PROC(v_laundry_count, "Pages eligible for laundering", + vm_laundry_count); VM_STATS_UINT(v_pageout_free_min, "Min pages reserved for kernel"); VM_STATS_UINT(v_interrupt_free_min, "Reserved pages for interrupt code"); VM_STATS_UINT(v_free_severe, "Severe page depletion point"); @@ -406,3 +423,52 @@ SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_cache_count, CTL SYSCTL_UINT(_vm_stats_vm, OID_AUTO, v_tcached, CTLFLAG_RD, SYSCTL_NULL_UINT_PTR, 0, "Dummy for compatibility"); #endif + +u_int +vm_free_count(void) +{ + u_int v; + int i; + + v = 0; + for (i = 0; i < vm_ndomains; i++) + v += vm_dom[i].vmd_free_count; + + return (v); +} + +static +u_int +vm_pagequeue_count(int pq) +{ + u_int v; + int i; + + v = 0; + for (i = 0; i < vm_ndomains; i++) + v += vm_dom[i].vmd_pagequeues[pq].pq_cnt; + + return (v); +} + +u_int +vm_active_count(void) +{ + + return vm_pagequeue_count(PQ_ACTIVE); +} + +u_int +vm_inactive_count(void) +{ + + return vm_pagequeue_count(PQ_INACTIVE); +} + +u_int +vm_laundry_count(void) +{ + + return vm_pagequeue_count(PQ_LAUNDRY); +} + Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_object.c Tue Feb 6 22:10:07 2018 (r328954) @@ -96,6 +96,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_object.h Tue Feb 6 22:10:07 2018 (r328954) @@ -297,6 +297,17 @@ vm_object_color(vm_object_t object, u_short color) } } +static __inline bool +vm_object_reserv(vm_object_t object) +{ + + if (object != NULL && + (object->flags & (OBJ_COLORED | OBJ_FICTITIOUS)) == OBJ_COLORED) { + return (true); + } + return (false); +} + void vm_object_clear_flag(vm_object_t object, u_short bits); void vm_object_pip_add(vm_object_t object, short i); void vm_object_pip_subtract(vm_object_t object, short i); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Feb 6 22:08:43 2018 (r328953) +++ head/sys/vm/vm_page.c Tue Feb 6 22:10:07 2018 (r328954) @@ -116,8 +116,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include +#include #include #include #include @@ -136,10 +137,16 @@ extern int vmem_startup_count(void); */ struct vm_domain vm_dom[MAXMEMDOM]; -struct mtx_padalign __exclusive_cache_line vm_page_queue_free_mtx; struct mtx_padalign __exclusive_cache_line pa_lock[PA_LOCK_COUNT]; +struct mtx_padalign __exclusive_cache_line vm_domainset_lock; +domainset_t __exclusive_cache_line vm_min_domains; +domainset_t __exclusive_cache_line vm_severe_domains; +static int vm_min_waiters; +static int vm_severe_waiters; +static int vm_pageproc_waiters; + /* * bogus page -- for I/O to/from partially complete buffers, * or for paging into sparsely invalid regions. @@ -164,24 +171,22 @@ static int sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARG SYSCTL_PROC(_vm, OID_AUTO, page_blacklist, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_vm_page_blacklist, "A", "Blacklist pages"); -/* Is the page daemon waiting for free pages? */ -static int vm_pageout_pages_needed; - static uma_zone_t fakepg_zone; static void vm_page_alloc_check(vm_page_t m); static void vm_page_clear_dirty_mask(vm_page_t m, vm_page_bits_t pagebits); static void vm_page_enqueue(uint8_t queue, vm_page_t m); -static void vm_page_free_phys(vm_page_t m); -static void vm_page_free_wakeup(void); +static void vm_page_free_phys(struct vm_domain *vmd, vm_page_t m); static void vm_page_init(void *dummy); static int vm_page_insert_after(vm_page_t m, vm_object_t object, vm_pindex_t pindex, vm_page_t mpred); static void vm_page_insert_radixdone(vm_page_t m, vm_object_t object, 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); +static int vm_page_reclaim_run(int req_class, int domain, u_long npages, + vm_page_t m_run, vm_paddr_t high); +static void vm_domain_free_wakeup(struct vm_domain *); +static int vm_domain_alloc_fail(struct vm_domain *vmd, vm_object_t object, + int req); SYSINIT(vm_page, SI_SUB_VM, SI_ORDER_SECOND, vm_page_init, NULL); @@ -318,6 +323,7 @@ vm_page_blacklist_next(char **list, char *end) static void vm_page_blacklist_check(char *list, char *end) { + struct vm_domain *vmd; vm_paddr_t pa; vm_page_t m; char *next; @@ -330,9 +336,10 @@ vm_page_blacklist_check(char *list, char *end) m = vm_phys_paddr_to_vm_page(pa); if (m == NULL) continue; - mtx_lock(&vm_page_queue_free_mtx); + vmd = vm_pagequeue_domain(m); + vm_domain_free_lock(vmd); ret = vm_phys_unfree_page(m); - mtx_unlock(&vm_page_queue_free_mtx); + vm_domain_free_unlock(vmd); if (ret == TRUE) { TAILQ_INSERT_TAIL(&blacklist_head, m, listq); if (bootverbose) @@ -395,28 +402,23 @@ sysctl_vm_page_blacklist(SYSCTL_HANDLER_ARGS) } static void -vm_page_domain_init(struct vm_domain *vmd) +vm_page_domain_init(int domain) { + struct vm_domain *vmd; struct vm_pagequeue *pq; int i; + vmd = VM_DOMAIN(domain); + bzero(vmd, sizeof(*vmd)); *__DECONST(char **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_name) = "vm inactive pagequeue"; - *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_INACTIVE].pq_vcnt) = - &vm_cnt.v_inactive_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_name) = "vm active pagequeue"; - *__DECONST(u_int **, &vmd->vmd_pagequeues[PQ_ACTIVE].pq_vcnt) = - &vm_cnt.v_active_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_name) = "vm laundry pagequeue"; - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_LAUNDRY].pq_vcnt) = - &vm_cnt.v_laundry_count; *__DECONST(char **, &vmd->vmd_pagequeues[PQ_UNSWAPPABLE].pq_name) = "vm unswappable pagequeue"; - /* Unswappable dirty pages are counted as being in the laundry. */ - *__DECONST(int **, &vmd->vmd_pagequeues[PQ_UNSWAPPABLE].pq_vcnt) = - &vm_cnt.v_laundry_count; + vmd->vmd_domain = domain; vmd->vmd_page_count = 0; vmd->vmd_free_count = 0; vmd->vmd_segs = 0; @@ -427,6 +429,7 @@ vm_page_domain_init(struct vm_domain *vmd) mtx_init(&pq->pq_mutex, pq->pq_name, "vm pagequeue", MTX_DEF | MTX_DUPOK); } + mtx_init(&vmd->vmd_free_mtx, "vm page free queue", NULL, MTX_DEF); } /* @@ -463,7 +466,6 @@ vm_page_init_page(vm_page_t m, vm_paddr_t pa, int segi vm_offset_t vm_page_startup(vm_offset_t vaddr) { - struct vm_domain *vmd; struct vm_phys_seg *seg; vm_page_t m; char *list, *listend; @@ -494,11 +496,11 @@ vm_page_startup(vm_offset_t vaddr) /* * Initialize the page and queue locks. */ - mtx_init(&vm_page_queue_free_mtx, "vm page free queue", NULL, MTX_DEF); + mtx_init(&vm_domainset_lock, "vm domainset lock", NULL, MTX_DEF); for (i = 0; i < PA_LOCK_COUNT; i++) mtx_init(&pa_lock[i], "vm page", NULL, MTX_DEF); for (i = 0; i < vm_ndomains; i++) - vm_page_domain_init(&vm_dom[i]); + vm_page_domain_init(i); /* * Allocate memory for use when boot strapping the kernel memory @@ -704,7 +706,6 @@ vm_page_startup(vm_offset_t vaddr) * physical memory allocator's free lists. */ vm_cnt.v_page_count = 0; - vm_cnt.v_free_count = 0; for (segind = 0; segind < vm_phys_nsegs; segind++) { seg = &vm_phys_segs[segind]; for (m = seg->first_page, pa = seg->start; pa < seg->end; @@ -719,6 +720,8 @@ vm_page_startup(vm_offset_t vaddr) * or doesn't overlap any of them. */ for (i = 0; phys_avail[i + 1] != 0; i += 2) { + struct vm_domain *vmd; + if (seg->start < phys_avail[i] || seg->end > phys_avail[i + 1]) continue; @@ -726,13 +729,14 @@ vm_page_startup(vm_offset_t vaddr) m = seg->first_page; pagecount = (u_long)atop(seg->end - seg->start); - mtx_lock(&vm_page_queue_free_mtx); + vmd = VM_DOMAIN(seg->domain); + vm_domain_free_lock(vmd); vm_phys_free_contig(m, pagecount); - vm_phys_freecnt_adj(m, (int)pagecount); - mtx_unlock(&vm_page_queue_free_mtx); + vm_domain_freecnt_adj(vmd, (int)pagecount); + vm_domain_free_unlock(vmd); vm_cnt.v_page_count += (u_int)pagecount; - vmd = &vm_dom[seg->domain]; + vmd = VM_DOMAIN(seg->domain); vmd->vmd_page_count += (u_int)pagecount; vmd->vmd_segs |= 1UL << m->segind; break; @@ -1657,12 +1661,40 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi return (m); } +/* + * Returns true if the number of free pages exceeds the minimum + * for the request class and false otherwise. + */ +int +vm_domain_available(struct vm_domain *vmd, int req, int npages) +{ + + vm_domain_free_assert_locked(vmd); + req = req & VM_ALLOC_CLASS_MASK; + + /* + * The page daemon is allowed to dig deeper into the free page list. + */ + if (curproc == pageproc && req != VM_ALLOC_INTERRUPT) + req = VM_ALLOC_SYSTEM; + + if (vmd->vmd_free_count >= npages + vmd->vmd_free_reserved || + (req == VM_ALLOC_SYSTEM && + vmd->vmd_free_count >= npages + vmd->vmd_interrupt_free_min) || + (req == VM_ALLOC_INTERRUPT && + vmd->vmd_free_count >= npages)) + return (1); + + return (0); +} + vm_page_t vm_page_alloc_domain_after(vm_object_t object, vm_pindex_t pindex, int domain, int req, vm_page_t mpred) { + struct vm_domain *vmd; vm_page_t m; - int flags, req_class; + int flags; u_int free_count; KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && @@ -1678,34 +1710,27 @@ vm_page_alloc_domain_after(vm_object_t object, vm_pind if (object != NULL) VM_OBJECT_ASSERT_WLOCKED(object); - req_class = req & VM_ALLOC_CLASS_MASK; - - /* - * The page daemon is allowed to dig deeper into the free page list. - */ - if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) - req_class = VM_ALLOC_SYSTEM; - - /* - * Allocate a page if the number of free pages exceeds the minimum - * for the request class. - */ again: m = NULL; - 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)) { +#if VM_NRESERVLEVEL > 0 + if (vm_object_reserv(object) && + (m = vm_reserv_extend(req, object, pindex, domain, mpred)) + != NULL) { + domain = vm_phys_domain(m); + vmd = VM_DOMAIN(domain); + goto found; + } +#endif + vmd = VM_DOMAIN(domain); + vm_domain_free_lock(vmd); + if (vm_domain_available(vmd, req, 1)) { /* * Can we allocate the page from a reservation? */ #if VM_NRESERVLEVEL > 0 - if (object == NULL || (object->flags & (OBJ_COLORED | - OBJ_FICTITIOUS)) != OBJ_COLORED || (m = - vm_reserv_alloc_page(object, pindex, domain, - mpred)) == NULL) + if (!vm_object_reserv(object) || + (m = vm_reserv_alloc_page(object, pindex, + domain, mpred)) == NULL) #endif { /* @@ -1727,7 +1752,7 @@ again: /* * Not allocatable, give up. */ - if (vm_page_alloc_fail(object, req)) + if (vm_domain_alloc_fail(vmd, object, req)) goto again; return (NULL); } @@ -1736,8 +1761,18 @@ again: * At this point we had better have found a good page. */ KASSERT(m != NULL, ("missing page")); - free_count = vm_phys_freecnt_adj(m, -1); - mtx_unlock(&vm_page_queue_free_mtx); + free_count = vm_domain_freecnt_adj(vmd, -1); + vm_domain_free_unlock(vmd); + + /* + * Don't wakeup too often - wakeup the pageout daemon when + * we would be nearly out of memory. + */ + if (vm_paging_needed(vmd, free_count)) + pagedaemon_wakeup(vmd->vmd_domain); +#if VM_NRESERVLEVEL > 0 +found: +#endif vm_page_alloc_check(m); /* @@ -1770,7 +1805,7 @@ again: if (object != NULL) { if (vm_page_insert_after(m, object, pindex, mpred)) { - pagedaemon_wakeup(); + pagedaemon_wakeup(domain); if (req & VM_ALLOC_WIRED) { atomic_subtract_int(&vm_cnt.v_wire_count, 1); m->wire_count = 0; @@ -1795,13 +1830,6 @@ again: } else m->pindex = pindex; - /* - * Don't wakeup too often - wakeup the pageout daemon when - * we would be nearly out of memory. - */ - if (vm_paging_needed(free_count)) - pagedaemon_wakeup(); - return (m); } @@ -1869,9 +1897,9 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pin int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr) { + struct vm_domain *vmd; vm_page_t m, m_ret, mpred; u_int busy_lock, flags, oflags; - int req_class; mpred = NULL; /* XXX: pacify gcc */ KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && @@ -1889,14 +1917,7 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pin object)); } KASSERT(npages > 0, ("vm_page_alloc_contig: npages is zero")); - req_class = req & VM_ALLOC_CLASS_MASK; - /* - * The page daemon is allowed to dig deeper into the free page list. - */ - if (curproc == pageproc && req_class != VM_ALLOC_INTERRUPT) - req_class = VM_ALLOC_SYSTEM; - if (object != NULL) { mpred = vm_radix_lookup_le(&object->rtree, pindex); KASSERT(mpred == NULL || mpred->pindex != pindex, @@ -1908,19 +1929,25 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pin * below the lower bound for the allocation class? */ again: +#if VM_NRESERVLEVEL > 0 + if (vm_object_reserv(object) && + (m_ret = vm_reserv_extend_contig(req, object, pindex, domain, + npages, low, high, alignment, boundary, mpred)) != NULL) { + domain = vm_phys_domain(m_ret); + vmd = VM_DOMAIN(domain); + goto found; + } +#endif m_ret = NULL; - mtx_lock(&vm_page_queue_free_mtx); - if (vm_cnt.v_free_count >= npages + vm_cnt.v_free_reserved || - (req_class == VM_ALLOC_SYSTEM && - vm_cnt.v_free_count >= npages + vm_cnt.v_interrupt_free_min) || - (req_class == VM_ALLOC_INTERRUPT && - vm_cnt.v_free_count >= npages)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Feb 6 22:13:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8923AF0C187; Tue, 6 Feb 2018 22:13:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 372D685282; Tue, 6 Feb 2018 22:13:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 320B91E083; Tue, 6 Feb 2018 22:13:41 +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 w16MDfNY040216; Tue, 6 Feb 2018 22:13:41 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16MDfAp040215; Tue, 6 Feb 2018 22:13:41 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802062213.w16MDfAp040215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 6 Feb 2018 22:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328955 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 328955 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.25 Precedence: list List-Id: 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, 06 Feb 2018 22:13:41 -0000 Author: glebius Date: Tue Feb 6 22:13:40 2018 New Revision: 328955 URL: https://svnweb.freebsd.org/changeset/base/328955 Log: Use correct arithmetic to calculate how many pages we need for kegs and hashes. There is no functional change with current sizes. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Feb 6 22:10:07 2018 (r328954) +++ head/sys/vm/uma_core.c Tue Feb 6 22:13:40 2018 (r328955) @@ -1810,14 +1810,14 @@ uma_startup_count(int zones) pages += howmany(zones, UMA_SLAB_SIZE / zsize); /* ... and their kegs. */ - pages += howmany(ksize * zones, UMA_SLAB_SIZE); + pages += howmany(zones, UMA_SLAB_SIZE / ksize); /* * Take conservative approach that every zone * is going to allocate hash. */ - pages += howmany(sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT * - zones, UMA_SLAB_SIZE); + pages += howmany(zones, UMA_SLAB_SIZE / + (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); return (pages); } From owner-svn-src-head@freebsd.org Tue Feb 6 22:15:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4595DF0C47B; Tue, 6 Feb 2018 22:15:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AB01E854A3; Tue, 6 Feb 2018 22:15:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w16MFuZ5002306 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 14:15:56 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16MFtle002305; Tue, 6 Feb 2018 14:15:55 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 14:15:55 -0800 From: Gleb Smirnoff To: Peter Holm Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206221555.GC1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206193430.GA36054@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 22:15:59 -0000 Peter, can you please check post r328952 kernel? -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Tue Feb 6 22:17:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D3E2F0C5D5; Tue, 6 Feb 2018 22:17:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54C11857FC; Tue, 6 Feb 2018 22:17:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F8C61E092; Tue, 6 Feb 2018 22:17:02 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16MH2HL040378; Tue, 6 Feb 2018 22:17:02 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16MH1CS040375; Tue, 6 Feb 2018 22:17:01 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201802062217.w16MH1CS040375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 6 Feb 2018 22:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328956 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 328956 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.25 Precedence: list List-Id: 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, 06 Feb 2018 22:17:02 -0000 Author: ian Date: Tue Feb 6 22:17:01 2018 New Revision: 328956 URL: https://svnweb.freebsd.org/changeset/base/328956 Log: Use const pointers for input data not modified by clock utility functions. Modified: head/sys/kern/subr_clock.c head/sys/kern/subr_fattime.c head/sys/sys/clock.h Modified: head/sys/kern/subr_clock.c ============================================================================== --- head/sys/kern/subr_clock.c Tue Feb 6 22:13:40 2018 (r328955) +++ head/sys/kern/subr_clock.c Tue Feb 6 22:17:01 2018 (r328956) @@ -132,7 +132,7 @@ leapyear(int year) } static void -print_ct(struct clocktime *ct) +print_ct(const struct clocktime *ct) { printf("[%04d-%02d-%02d %02d:%02d:%02d]", ct->year, ct->mon, ct->day, @@ -140,7 +140,7 @@ print_ct(struct clocktime *ct) } int -clock_ct_to_ts(struct clocktime *ct, struct timespec *ts) +clock_ct_to_ts(const struct clocktime *ct, struct timespec *ts) { int i, year, days; @@ -200,7 +200,7 @@ clock_ct_to_ts(struct clocktime *ct, struct timespec * } int -clock_bcd_to_ts(struct bcd_clocktime *bct, struct timespec *ts, bool ampm) +clock_bcd_to_ts(const struct bcd_clocktime *bct, struct timespec *ts, bool ampm) { struct clocktime ct; int bcent, byear; @@ -249,7 +249,7 @@ clock_bcd_to_ts(struct bcd_clocktime *bct, struct time } void -clock_ts_to_ct(struct timespec *ts, struct clocktime *ct) +clock_ts_to_ct(const struct timespec *ts, struct clocktime *ct) { time_t i, year, days; time_t rsec; /* remainder seconds */ @@ -310,7 +310,7 @@ clock_ts_to_ct(struct timespec *ts, struct clocktime * } void -clock_ts_to_bcd(struct timespec *ts, struct bcd_clocktime *bct, bool ampm) +clock_ts_to_bcd(const struct timespec *ts, struct bcd_clocktime *bct, bool ampm) { struct clocktime ct; Modified: head/sys/kern/subr_fattime.c ============================================================================== --- head/sys/kern/subr_fattime.c Tue Feb 6 22:13:40 2018 (r328955) +++ head/sys/kern/subr_fattime.c Tue Feb 6 22:17:01 2018 (r328956) @@ -137,7 +137,8 @@ static const struct { void -timespec2fattime(struct timespec *tsp, int utc, uint16_t *ddp, uint16_t *dtp, uint8_t *dhp) +timespec2fattime(const struct timespec *tsp, int utc, uint16_t *ddp, + uint16_t *dtp, uint8_t *dhp) { time_t t1; unsigned t2, l, m; @@ -217,7 +218,8 @@ static const uint16_t daytab[64] = { }; void -fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, struct timespec *tsp) +fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, + struct timespec *tsp) { unsigned day; Modified: head/sys/sys/clock.h ============================================================================== --- head/sys/sys/clock.h Tue Feb 6 22:13:40 2018 (r328955) +++ head/sys/sys/clock.h Tue Feb 6 22:17:01 2018 (r328956) @@ -88,8 +88,8 @@ struct clocktime { long nsec; /* nano seconds */ }; -int clock_ct_to_ts(struct clocktime *, struct timespec *); -void clock_ts_to_ct(struct timespec *, struct clocktime *); +int clock_ct_to_ts(const struct clocktime *, struct timespec *); +void clock_ts_to_ct(const struct timespec *, struct clocktime *); /* * Structure to hold the values typically reported by time-of-day clocks, @@ -125,8 +125,8 @@ struct bcd_clocktime { bool ispm; /* true if hour represents pm time */ }; -int clock_bcd_to_ts(struct bcd_clocktime *, struct timespec *, bool ampm); -void clock_ts_to_bcd(struct timespec *, struct bcd_clocktime *, bool ampm); +int clock_bcd_to_ts(const struct bcd_clocktime *, struct timespec *, bool ampm); +void clock_ts_to_bcd(const struct timespec *, struct bcd_clocktime *, bool ampm); /* * Time-of-day clock functions and flags. These functions might sleep. @@ -177,8 +177,10 @@ void clock_unregister(device_t _clockdev); /* Traditional POSIX base year */ #define POSIX_BASE_YEAR 1970 -void timespec2fattime(struct timespec *tsp, int utc, u_int16_t *ddp, u_int16_t *dtp, u_int8_t *dhp); -void fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, struct timespec *tsp); +void timespec2fattime(const struct timespec *tsp, int utc, u_int16_t *ddp, + u_int16_t *dtp, u_int8_t *dhp); +void fattime2timespec(unsigned dd, unsigned dt, unsigned dh, int utc, + struct timespec *tsp); #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Tue Feb 6 22:38:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90585F0E24D; Tue, 6 Feb 2018 22:38:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36E3C86895; Tue, 6 Feb 2018 22:38:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 302CD1E3FD; Tue, 6 Feb 2018 22:38:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w16McKES050437; Tue, 6 Feb 2018 22:38:20 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16McJCM050435; Tue, 6 Feb 2018 22:38:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802062238.w16McJCM050435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 6 Feb 2018 22:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328957 - in head/sys: fs/ext2fs ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys: fs/ext2fs ufs/ufs X-SVN-Commit-Revision: 328957 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.25 Precedence: list List-Id: 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, 06 Feb 2018 22:38:20 -0000 Author: pfg Date: Tue Feb 6 22:38:19 2018 New Revision: 328957 URL: https://svnweb.freebsd.org/changeset/base/328957 Log: {ext2|ufs}_readdir: Avoid setting negative ncookies. ncookies cannot be negative or the allocator will fail. This should only happen if a caller is very broken but we can still try to survive the event. We should probably also verify for uio_resid > MAXPHYS but in that case it is not clear that just clipping the ncookies value is an adequate response. MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_lookup.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 6 22:17:01 2018 (r328956) +++ head/sys/fs/ext2fs/ext2_lookup.c Tue Feb 6 22:38:19 2018 (r328957) @@ -153,7 +153,10 @@ ext2_readdir(struct vop_readdir_args *ap) return (EINVAL); ip = VTOI(vp); if (ap->a_ncookies != NULL) { - ncookies = uio->uio_resid; + if (uio->uio_resid < 0) + ncookies = 0; + else + ncookies = uio->uio_resid; if (uio->uio_offset >= ip->i_size) ncookies = 0; else if (ip->i_size - uio->uio_offset < ncookies) Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Feb 6 22:17:01 2018 (r328956) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Feb 6 22:38:19 2018 (r328957) @@ -2179,7 +2179,10 @@ ufs_readdir(ap) if (ip->i_effnlink == 0) return (0); if (ap->a_ncookies != NULL) { - ncookies = uio->uio_resid; + if (uio->uio_resid < 0) + ncookies = 0; + else + ncookies = uio->uio_resid; if (uio->uio_offset >= ip->i_size) ncookies = 0; else if (ip->i_size - uio->uio_offset < ncookies) From owner-svn-src-head@freebsd.org Tue Feb 6 22:52:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA36EF0F671; Tue, 6 Feb 2018 22:52:47 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5532B87694; Tue, 6 Feb 2018 22:52:47 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id E165FD01267; Tue, 6 Feb 2018 17:52:45 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w16Mqiaj040626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 23:52:44 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w16Mqi15040625; Tue, 6 Feb 2018 23:52:44 +0100 (CET) (envelope-from pho) Date: Tue, 6 Feb 2018 23:52:44 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206225244.GA40529@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206221555.GC1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 22:52:47 -0000 On Tue, Feb 06, 2018 at 02:15:55PM -0800, Gleb Smirnoff wrote: > Peter, > > can you please check post r328952 kernel? > Sure. FreeBSD 12.0-CURRENT #0 r328956: Tue Feb 6 23:26:58 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Entering uma_startup with 9 boot pages configured startup_alloc from "UMA Kegs", 8 boot pages left startup_alloc from "UMA Zones", 7 boot pages left startup_alloc from "UMA Hash", 6 boot pages left startup_alloc from "UMA Zones", 5 boot pages left startup_alloc from "vmem btag", 4 boot pages left startup_alloc from "MAP", 3 boot pages left startup_alloc from "UMA Kegs", 2 boot pages left startup_alloc from "KMAP ENTRY", 1 boot pages left panic: UMA: Increase vm.boot_pages cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper(c1654440,c23af290,c1be5bc0,8,c1bbec20,...) at db_trace_self_wrapper+0x2a/frame 0xc2022a70 kdb_backtrace(c164e477,1,0,c2022b30,0,...) at kdb_backtrace+0x2d/frame 0xc2022ad8 vpanic(c16a125d,c2022b30,c2022b30,c2022b48,c0fb7933,...) at vpanic+0x133/frame 0xc2022b10 panic(c16a125d,0,c16a0cb0,44f,c23b0a80,...) at panic+0x1b/frame 0xc2022b24 startup_alloc(c23b1dc0,1000,0,c2022b7b,102,...) at startup_alloc+0x143/frame 0xc2022b48 keg_alloc_slab(0,2,c16a0cb0,983,c23b7000,...) at keg_alloc_slab+0xf6/frame 0xc2022b90 keg_fetch_slab(ffffffff,2,c16a0cb0,9e5,c23b1dc0,...) at keg_fetch_slab+0x10e/frame 0xc2022be8 zone_fetch_slab(c23b1dc0,0,ffffffff,2,c23b5000,...) at zone_fetch_slab+0x61/frame 0xc2022c0c zone_import(c23b1dc0,c2022c68,1,ffffffff,2,...) at zone_import+0x3b/frame 0xc2022c44 zone_alloc_item(ffffffff,2,c16a0cc7,c16357bd,c1b5d050,...) at zone_alloc_item+0x3d/frame 0xc2022c78 uma_zalloc_arg(c23b1dc0,0,2,c1b5d050,0,...) at uma_zalloc_arg+0x66c/frame 0xc2022cb4 vmem_create(c16a1c9a,0,0,1000,0,...) at vmem_create+0x2a/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c186a9d4,...) at vm_mem_init+0xf4/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f KDB: enter: panic [ thread pid 0 tid 0 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> Setting vm.boot_pages in the loader to 128 fixes this. - Peter From owner-svn-src-head@freebsd.org Tue Feb 6 23:06:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E721F10574; Tue, 6 Feb 2018 23:06:38 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0657D87FE8; Tue, 6 Feb 2018 23:06:37 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w16N6alN002508 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 15:06:36 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w16N6aW7002507; Tue, 6 Feb 2018 15:06:36 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 15:06:35 -0800 From: Gleb Smirnoff To: Peter Holm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206230635.GE1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="sdtB3X0nJg68CQEu" Content-Disposition: inline In-Reply-To: <20180206225244.GA40529@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 23:06:38 -0000 --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 06, 2018 at 11:52:44PM +0100, Peter Holm wrote: P> On Tue, Feb 06, 2018 at 02:15:55PM -0800, Gleb Smirnoff wrote: P> > Peter, P> > P> > can you please check post r328952 kernel? P> > P> P> Sure. P> P> FreeBSD 12.0-CURRENT #0 r328956: Tue Feb 6 23:26:58 CET 2018 P> pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 P> FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) P> WARNING: WITNESS option enabled, expect reduced performance. P> WARNING: DIAGNOSTIC option enabled, expect reduced performance. P> Entering uma_startup with 9 boot pages configured P> startup_alloc from "UMA Kegs", 8 boot pages left P> startup_alloc from "UMA Zones", 7 boot pages left P> startup_alloc from "UMA Hash", 6 boot pages left P> startup_alloc from "UMA Zones", 5 boot pages left P> startup_alloc from "vmem btag", 4 boot pages left P> startup_alloc from "MAP", 3 boot pages left P> startup_alloc from "UMA Kegs", 2 boot pages left P> startup_alloc from "KMAP ENTRY", 1 boot pages left P> panic: UMA: Increase vm.boot_pages Off by one :( Can you please boot with this patch and show dmesg? -- Gleb Smirnoff --sdtB3X0nJg68CQEu Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages_verbose.diff" Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c (revision 328955) +++ sys/vm/uma_core.c (working copy) @@ -1800,6 +1800,7 @@ uma_startup_count(int zones) /* Memory for the zone of zones and zone of kegs. */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; @@ -1808,9 +1809,11 @@ uma_startup_count(int zones) pages += zones * howmany(zsize, UMA_SLAB_SIZE); else pages += howmany(zones, UMA_SLAB_SIZE / zsize); + printf("boot_pages zones %d\n", pages); /* ... and their kegs. */ pages += howmany(zones, UMA_SLAB_SIZE / ksize); + printf("boot_pages kegs %d\n", pages); /* * Take conservative approach that every zone @@ -1818,6 +1821,7 @@ uma_startup_count(int zones) */ pages += howmany(zones, UMA_SLAB_SIZE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c (revision 328955) +++ sys/vm/vm_page.c (working copy) @@ -518,8 +518,10 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %s\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + printf("boot_pages kmap %s\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --sdtB3X0nJg68CQEu-- From owner-svn-src-head@freebsd.org Tue Feb 6 23:12:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86625F10C49; Tue, 6 Feb 2018 23:12:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DC8F6878B; Tue, 6 Feb 2018 23:12:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38E3C1EAA0; Tue, 6 Feb 2018 23:12:17 +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 w16NCHgI070031; Tue, 6 Feb 2018 23:12:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16NCHTO070030; Tue, 6 Feb 2018 23:12:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802062312.w16NCHTO070030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 6 Feb 2018 23:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328958 - head/share/zoneinfo X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/zoneinfo X-SVN-Commit-Revision: 328958 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.25 Precedence: list List-Id: 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, 06 Feb 2018 23:12:17 -0000 Author: imp Date: Tue Feb 6 23:12:16 2018 New Revision: 328958 URL: https://svnweb.freebsd.org/changeset/base/328958 Log: Avoid find -s, use find | sort instead. find -s was introduced to make the metalog more deterministic. However, find -s is not portable. find | sort is portable and accomplishes the same goals, even if it isn't pedantically the same. TZS is the same before / after the change so any fussy differences between the two are moot and there won't be METALOG churn across this change. Differential Revision: https://reviews.freebsd.org/D14231 Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Tue Feb 6 22:38:19 2018 (r328957) +++ head/share/zoneinfo/Makefile Tue Feb 6 23:12:16 2018 (r328958) @@ -95,8 +95,13 @@ zoneinfo: yearistype ${TDATA} zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \ ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES} +# +# Sort TZS to ensure they are the same every build. find -s might +# be a shorter way to express this, but it's non-portable. Any +# differences between the two don't matter for this purpose. +# .if make(*install*) -TZS!= cd ${TZBUILDDIR} && find -s * -type f +TZS!= cd ${TZBUILDDIR} && find * -type f | env LC_ALL=C sort .endif beforeinstall: install-zoneinfo From owner-svn-src-head@freebsd.org Tue Feb 6 23:12:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF999F10E23; Tue, 6 Feb 2018 23:12:47 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A685D688EE; Tue, 6 Feb 2018 23:12:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A17E01EABB; Tue, 6 Feb 2018 23:12:47 +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 w16NClki070091; Tue, 6 Feb 2018 23:12:47 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16NCltK070090; Tue, 6 Feb 2018 23:12:47 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802062312.w16NCltK070090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 6 Feb 2018 23:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328959 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 328959 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.25 Precedence: list List-Id: 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, 06 Feb 2018 23:12:48 -0000 Author: cem Date: Tue Feb 6 23:12:47 2018 New Revision: 328959 URL: https://svnweb.freebsd.org/changeset/base/328959 Log: fsync.2: Cross-reference fsync(1) Reported by: rpokala Sponsored by: Dell EMC Isilon Modified: head/lib/libc/sys/fsync.2 Modified: head/lib/libc/sys/fsync.2 ============================================================================== --- head/lib/libc/sys/fsync.2 Tue Feb 6 23:12:16 2018 (r328958) +++ head/lib/libc/sys/fsync.2 Tue Feb 6 23:12:47 2018 (r328959) @@ -34,7 +34,7 @@ .\" @(#)fsync.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 24, 2017 +.Dd February 6, 2018 .Dt FSYNC 2 .Os .Sh NAME @@ -108,6 +108,7 @@ refers to a socket, not to a file. An I/O error occurred while reading from or writing to the file system. .El .Sh SEE ALSO +.Xr fsync 1 , .Xr sync 2 , .Xr syncer 4 , .Xr sync 8 From owner-svn-src-head@freebsd.org Tue Feb 6 23:18:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF323F11576 for ; Tue, 6 Feb 2018 23:18:51 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) Received: from sonic307-4.consmr.mail.bf2.yahoo.com (sonic307-4.consmr.mail.bf2.yahoo.com [74.6.134.43]) (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 98EBC68EF6 for ; Tue, 6 Feb 2018 23:18:51 +0000 (UTC) (envelope-from marklmi26-fbsd@yahoo.com) X-YMail-OSG: 7Jx5b7QVM1mPNDJIaovyDCty4FjxYvGcBA8LG7H02Rkf6RoqKk4QTElElFLHtg2 USouqEFVowVdfsHNcSBxRY8fMFcG2gnjTCZJWnLxBOgF.ZWaJnmOn83GeL1np1MljJdUFNVc7H4G olxFxyWRHDAIpMn99Sd7eUkotR9msETEdAtBom9iMKzr5JZ9w8mai7EnzeCIPhj36dUrV1IQwbm1 BBBu5NWXwQfRkyg7rDhmYkg9gs8yqwjRse5dlgf7ukNXPjODPc3iQrZlaCHTPgLGthgKCC9tjcUJ pWni7AVRVXYvKexuiloyZxt_ubf2ax3IJMFSY9qf8FEEIr75NQjYefm0GwJPmojeZKWkW8EWulLB 6YsNPPGsAuaDZ3J6WFNjh5X_3geAkyjeIUsI5JSU6K1e4Gx3DRsCjOt6QuMZU_JNrExCKkHQEKb0 nC9NTb7xPglWjHuhl5rjfmedtrM2dTTqcDL86XyywK.p11ovs8qwKH3rUft4ZZN1WREMY Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.bf2.yahoo.com with HTTP; Tue, 6 Feb 2018 23:18:45 +0000 Received: from smtpgate101.mail.bf1.yahoo.com (EHLO [192.168.1.25]) ([72.30.28.45]) by smtp413.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 192053ffaa254a502feef3930eb7078e; Tue, 06 Feb 2018 23:18:44 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r328934 - in head: . bin/sh Message-Id: Date: Tue, 6 Feb 2018 15:18:42 -0800 To: Ian Lepore , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 23:18:52 -0000 Ian Lepore ian at freebsd.org wrote on Tue Feb 6 19:35:21 UTC 2018 : > I don't understand this idea of /usr/local "polluting" a system. It > seems to me exactly the opposite would be the case... if I have found > some 3rd party version of mktemp that I like better, it would be > installed in /usr/local. If I went out of my way to install that, then > naturally I WANT it to be used. To me, it's insane that the /usr/local > paths are not in front of the base system paths by default, and it's > even more insane that the base system works so hard to NOT use the > replacements I've installed (even if I've arranged PATH so that the > right versions should be used) so that I have to track down why it's > using the wrong thing and apply ad-hoc fixes. I've had mixed results over the years. I've had ports install files for other 'internal' purposes (not my overall goals) that in turned broke buildworld for powerpc(64) for some alternative compiler/tool chains that induced /usr/local/ header file usage if a file name accidentally matched. There was a period of time where I'd rename some specific header files as I switched activities in order to avoid systematic problems. (It seemed easier than than other alternatives that I considered at the time.) [But I've been doing odd "target powerpc64 and powerpc without gcc 4.2.1" experiments for a few years. Not exactly a typical context.] As the build system for buildworld has progressed, I've not had such problems for some time: it became easier to avoid /usr/local/include/ getting involved, at least for what I've been doing. Also, I do external toolchain activity less often these days. === Mark Millard marklmi at yahoo.com ( markmi at dsl-only.net is going away in 2018-Feb, late) From owner-svn-src-head@freebsd.org Tue Feb 6 23:21:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BA85F117B1; Tue, 6 Feb 2018 23:21:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 528E069129; Tue, 6 Feb 2018 23:21:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D85F1EAFC; Tue, 6 Feb 2018 23:21:08 +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 w16NL84F071352; Tue, 6 Feb 2018 23:21:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w16NL8ca071351; Tue, 6 Feb 2018 23:21:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802062321.w16NL8ca071351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 6 Feb 2018 23:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328960 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 328960 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.25 Precedence: list List-Id: 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, 06 Feb 2018 23:21:08 -0000 Author: imp Date: Tue Feb 6 23:21:08 2018 New Revision: 328960 URL: https://svnweb.freebsd.org/changeset/base/328960 Log: Keep a counter for number of requests completed with an error. Sponsored by: Netflix Modified: head/sys/cam/cam_iosched.c Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Tue Feb 6 23:12:47 2018 (r328959) +++ head/sys/cam/cam_iosched.c Tue Feb 6 23:21:08 2018 (r328960) @@ -223,6 +223,7 @@ struct iop_stats { int total; /* Total for all time -- wraps */ int in; /* number queued all time -- wraps */ int out; /* number completed all time -- wraps */ + int errs; /* Number of I/Os completed with error -- wraps */ /* * Statistics on different bits of the process. @@ -781,6 +782,7 @@ cam_iosched_iop_stats_init(struct cam_iosched_softc *i ios->max = ios->current = 300000; ios->min = 1; ios->out = 0; + ios->errs = 0; ios->pending = 0; ios->queued = 0; ios->total = 0; @@ -971,7 +973,11 @@ cam_iosched_iop_stats_sysctl_init(struct cam_iosched_s SYSCTL_ADD_INT(ctx, n, OID_AUTO, "out", CTLFLAG_RD, &ios->out, 0, - "# of transactions completed"); + "# of transactions completed (including with error)"); + SYSCTL_ADD_INT(ctx, n, + OID_AUTO, "errs", CTLFLAG_RD, + &ios->errs, 0, + "# of transactions completed with an error"); SYSCTL_ADD_PROC(ctx, n, OID_AUTO, "limiter", CTLTYPE_STRING | CTLFLAG_RW, @@ -1463,13 +1469,19 @@ cam_iosched_bio_complete(struct cam_iosched_softc *isc printf("done: %p %#x\n", bp, bp->bio_cmd); if (bp->bio_cmd == BIO_WRITE) { retval = cam_iosched_limiter_iodone(&isc->write_stats, bp); + if (!(bp->bio_flags & BIO_ERROR)) + isc->write_stats.errs++; isc->write_stats.out++; isc->write_stats.pending--; } else if (bp->bio_cmd == BIO_READ) { retval = cam_iosched_limiter_iodone(&isc->read_stats, bp); + if (!(bp->bio_flags & BIO_ERROR)) + isc->read_stats.errs++; isc->read_stats.out++; isc->read_stats.pending--; } else if (bp->bio_cmd == BIO_DELETE) { + if (!(bp->bio_flags & BIO_ERROR)) + isc->trim_stats.errs++; isc->trim_stats.out++; isc->trim_stats.pending--; } else if (bp->bio_cmd != BIO_FLUSH) { From owner-svn-src-head@freebsd.org Tue Feb 6 23:25:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FF47F11DE1; Tue, 6 Feb 2018 23:25:25 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4BA56968D; Tue, 6 Feb 2018 23:25:24 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 8254BD010F0; Tue, 6 Feb 2018 18:25:23 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w16NPLvG041432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 00:25:22 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w16NPL0K041431; Wed, 7 Feb 2018 00:25:21 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 00:25:21 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180206232521.GA41396@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180206230635.GE1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 06 Feb 2018 23:25:25 -0000 On Tue, Feb 06, 2018 at 03:06:35PM -0800, Gleb Smirnoff wrote: > On Tue, Feb 06, 2018 at 11:52:44PM +0100, Peter Holm wrote: > P> On Tue, Feb 06, 2018 at 02:15:55PM -0800, Gleb Smirnoff wrote: > P> > Peter, > P> > > P> > can you please check post r328952 kernel? > P> > > P> > P> Sure. > P> > P> FreeBSD 12.0-CURRENT #0 r328956: Tue Feb 6 23:26:58 CET 2018 > P> pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 > P> FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) > P> WARNING: WITNESS option enabled, expect reduced performance. > P> WARNING: DIAGNOSTIC option enabled, expect reduced performance. > P> Entering uma_startup with 9 boot pages configured > P> startup_alloc from "UMA Kegs", 8 boot pages left > P> startup_alloc from "UMA Zones", 7 boot pages left > P> startup_alloc from "UMA Hash", 6 boot pages left > P> startup_alloc from "UMA Zones", 5 boot pages left > P> startup_alloc from "vmem btag", 4 boot pages left > P> startup_alloc from "MAP", 3 boot pages left > P> startup_alloc from "UMA Kegs", 2 boot pages left > P> startup_alloc from "KMAP ENTRY", 1 boot pages left > P> panic: UMA: Increase vm.boot_pages > > Off by one :( Can you please boot with this patch and show dmesg? > FreeBSD 12.0-CURRENT #2 r328956M: Wed Feb 7 00:20:47 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. boot_pages master 1 boot_pages zones 3 boot_pages kegs 4 boot_pages hash 5 boot_pages vmem 6 boot_pages kmap 7 Entering uma_startup with 9 boot pages configured startup_alloc from "UMA Kegs", 8 boot pages left startup_alloc from "UMA Zones", 7 boot pages left startup_alloc from "UMA Hash", 6 boot pages left startup_alloc from "UMA Zones", 5 boot pages left startup_alloc from "vmem btag", 4 boot pages left startup_alloc from "MAP", 3 boot pages left startup_alloc from "UMA Kegs", 2 boot pages left startup_alloc from "KMAP ENTRY", 1 boot pages left panic: UMA: Increase vm.boot_pages cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper(c16544c0,c23af290,c1be5bc0,8,c1bbec20,...) at db_trace_self_wrapper+0x2a/frame 0xc2022a70 kdb_backtrace(c164e4f7,1,0,c2022b30,0,...) at kdb_backtrace+0x2d/frame 0xc2022ad8 vpanic(c16a1330,c2022b30,c2022b30,c2022b48,c0fb7983,...) at vpanic+0x133/frame 0xc2022b10 panic(c16a1330,0,c16a0d83,44f,c23b0a80,...) at panic+0x1b/frame 0xc2022b24 startup_alloc(c23b1dc0,1000,0,c2022b7b,102,...) at startup_alloc+0x143/frame 0xc2022b48 keg_alloc_slab(0,2,c16a0d83,987,c23b7000,...) at keg_alloc_slab+0xf6/frame 0xc2022b90 keg_fetch_slab(ffffffff,2,c16a0d83,9e9,c23b1dc0,...) at keg_fetch_slab+0x10e/frame 0xc2022be8 zone_fetch_slab(c23b1dc0,0,ffffffff,2,c23b5000,...) at zone_fetch_slab+0x61/frame 0xc2022c0c zone_import(c23b1dc0,c2022c68,1,ffffffff,2,...) at zone_import+0x3b/frame 0xc2022c44 zone_alloc_item(ffffffff,2,c16a0d9a,c163583d,c1b5d050,...) at zone_alloc_item+0x3d/frame 0xc2022c78 uma_zalloc_arg(c23b1dc0,0,2,c1b5d050,0,...) at uma_zalloc_arg+0x66c/frame 0xc2022cb4 vmem_create(c16a1d6e,0,0,1000,0,...) at vmem_create+0x2a/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c186aab4,...) at vm_mem_init+0xf4/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f KDB: enter: panic [ thread pid 0 tid 0 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> - Peter From owner-svn-src-head@freebsd.org Wed Feb 7 00:19:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 021BAF15EC6; Wed, 7 Feb 2018 00:19: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 643716BF63; Wed, 7 Feb 2018 00:19:11 +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 w170J86M018889; Tue, 6 Feb 2018 16:19:08 -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 w170J8os018888; Tue, 6 Feb 2018 16:19:08 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802070019.w170J8os018888@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328951 - head/etc/rc.d In-Reply-To: <201802062135.w16LZfLD020197@repo.freebsd.org> To: Mark Felder Date: Tue, 6 Feb 2018 16:19:08 -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.25 Precedence: list List-Id: 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, 07 Feb 2018 00:19:13 -0000 > Author: feld (ports committer) > Date: Tue Feb 6 21:35:41 2018 > New Revision: 328951 > URL: https://svnweb.freebsd.org/changeset/base/328951 > > Log: > Refactor cleanvar to remove shell expansion vulnerability > > If any process creates a directory named "-P" in /var/run or > /var/spool/lock it will cause the purgedir function to start to rm -r /. > > Simplify a lot of complicated shell logic by leveraging find(1). > > Reviewed by: allanjude > MFC after: 3 days > Differential Revision: https://reviews.freebsd.org/D13778 Please be careful about use of binaries from /usr/bin in /etc/rc.d, though in this case it is probably ok as /usr has been mounted by the time cleanvar runs, that is not always the case. > Modified: > head/etc/rc.d/cleanvar > > Modified: head/etc/rc.d/cleanvar > ============================================================================== > --- head/etc/rc.d/cleanvar Tue Feb 6 21:01:38 2018 (r328950) > +++ head/etc/rc.d/cleanvar Tue Feb 6 21:35:41 2018 (r328951) > @@ -19,34 +19,6 @@ stop_cmd=":" > extra_commands="reload" > reload_cmd="${name}_start" > > -purgedir() > -{ > - local dir file > - > - if [ $# -eq 0 ]; then > - purgedir . > - else > - for dir > - do > - ( > - cd "$dir" && for file in .* * > - do > - # Skip over logging sockets > - [ -S "$file" -a "$file" = "log" ] && continue > - [ -S "$file" -a "$file" = "logpriv" ] && continue > - [ ."$file" = .. -o ."$file" = ... ] && continue > - if [ -d "$file" -a ! -L "$file" ] > - then > - purgedir "$file" > - else > - rm -f -- "$file" > - fi > - done > - ) > - done > - fi > -} > - > cleanvar_prestart() > { > # These files must be removed only the first time this script is run > @@ -58,14 +30,17 @@ cleanvar_prestart() > cleanvar_start() > { > if [ -d /var/run -a ! -f /var/run/clean_var ]; then > - purgedir /var/run > + # Skip over logging sockets > + find /var/run \( -type f -or -type s ! -name log -and ! -name logpriv \) -delete > >/var/run/clean_var > fi > if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then > - purgedir /var/spool/lock > + find /var/spool/lock -type f -delete > >/var/spool/lock/clean_var > fi > - rm -rf /var/spool/uucp/.Temp/* > + if [ -d /var/spool/uucp/.Temp ]; then > + find /var/spool/uucp/.Temp -delete > + fi > } > > load_rc_config $name > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Feb 7 00:29:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 745C5F16B86; Wed, 7 Feb 2018 00:29:43 +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 D792D6C6BB; Wed, 7 Feb 2018 00:29:42 +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 w170Tee0018960; Tue, 6 Feb 2018 16:29:40 -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 w170TebA018959; Tue, 6 Feb 2018 16:29:40 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802070029.w170TebA018959@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328934 - in head: . bin/sh In-Reply-To: <1517945713.1366.108.camel@freebsd.org> To: Ian Lepore Date: Tue, 6 Feb 2018 16:29:40 -0800 (PST) CC: rgrimes@freebsd.org, Alex Richardson , 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.25 Precedence: list List-Id: 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, 07 Feb 2018 00:29:43 -0000 [ Charset ISO-8859-1 unsupported, converting... ] > On Tue, 2018-02-06 at 11:25 -0800, Rodney W. Grimes wrote: > > > > > > Author: arichardson > > > Date: Tue Feb??6 15:41:35 2018 > > > New Revision: 328934 > > > URL: https://svnweb.freebsd.org/changeset/base/328934 > > > > > > Log: > > > ? Don't hardcode /usr/bin as the path for mktemp in build tools > > > ?? > > > ? It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp > > > is in > > > ? /bin there. > > > ?? > > > ? Reviewed By: bdrewery > > > ? Approved By: jhb (mentor) > > > ? Differential Revision: https://reviews.freebsd.org/D13937 > > Would it be better to create the variable MKTEMP to point at > > either /bin/mktemp or /usr/bin/mktemp dependent on platform, > > there are reasons we use full paths in Makefiles, mostly to > > stop /usr/local/bin/foo contimaton, which I believe this > > change now opens up, though very slight as I dont know of > > a third party mktemp binary. > > > > I don't understand this idea of /usr/local "polluting" a system. ?It > seems to me exactly the opposite would be the case... if I have found > some 3rd party version of mktemp that I like better, it would be > installed in /usr/local. ?If I went out of my way to install that, then > naturally I WANT it to be used. ?To me, it's insane that the /usr/local > paths are not in front of the base system paths by default, and it's > even more insane that the base system works so hard to NOT use the > replacements I've installed (even if I've arranged PATH so that the > right versions should be used) so that I have to track down why it's > using the wrong thing and apply ad-hoc fixes. Your welcome to wonder down that twisty maze of passages, I however shall not be following you. If you start to accept what ever the users path is for building the freebsd /usr/src tree the rate of failed builds and complaints, and hours spent chasing after oh crap it picked up foo from /usr/local is not a game I care to par take in. You personally, could probably get away with this and be fine, our user base would probably not be very lucky.w Oh, and reproducibility goes totally out the window if you fool with that. > -- Ian -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Feb 7 00:42:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CB9FF17881; Wed, 7 Feb 2018 00:42:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A8C706CFCB; Wed, 7 Feb 2018 00:42:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w170gDpV002850 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 16:42:13 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w170gDgn002849; Tue, 6 Feb 2018 16:42:13 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 16:42:13 -0800 From: Gleb Smirnoff To: Peter Holm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207004213.GG1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="i9LlY+UWpKt15+FH" Content-Disposition: inline In-Reply-To: <20180206232521.GA41396@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 00:42:16 -0000 --i9LlY+UWpKt15+FH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Peter, can you please try this patch? In either case success or not, please provide me with dmesg. Thanks a lot! -- Gleb Smirnoff --i9LlY+UWpKt15+FH Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages.diff" Index: uma_core.c =================================================================== --- uma_core.c (revision 328955) +++ uma_core.c (working copy) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG_MEMGUARD #include #endif +#define DIAGNOSTIC /* * This is the zone and keg from which all zones are spawned. @@ -1800,6 +1801,7 @@ uma_startup_count(int zones) /* Memory for the zone of zones and zone of kegs. */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; @@ -1807,17 +1809,20 @@ uma_startup_count(int zones) if (zsize > UMA_SLAB_SIZE) pages += zones * howmany(zsize, UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, UMA_SLAB_SPACE / zsize); + printf("boot_pages zones %d\n", pages); /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + pages += howmany(zones, UMA_SLAB_SPACE / ksize); + printf("boot_pages kegs %d\n", pages); /* * Take conservative approach that every zone * is going to allocate hash. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } Index: uma_int.h =================================================================== --- uma_int.h (revision 328955) +++ uma_int.h (working copy) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Index: vm_page.c =================================================================== --- vm_page.c (revision 328955) +++ vm_page.c (working copy) @@ -518,8 +518,11 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %d\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); + printf("boot_pages kmap %d\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --i9LlY+UWpKt15+FH-- From owner-svn-src-head@freebsd.org Wed Feb 7 00:45:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12B7DF17BBC; Wed, 7 Feb 2018 00:45:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F2316D229; Wed, 7 Feb 2018 00:45:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w170jn0o002886 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Feb 2018 16:45:50 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w170jnNG002885; Tue, 6 Feb 2018 16:45:49 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 6 Feb 2018 16:45:49 -0800 From: Gleb Smirnoff To: Peter Holm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207004549.GH1063@FreeBSD.org> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="69pVuxX8awAiJ7fD" Content-Disposition: inline In-Reply-To: <20180207004213.GG1063@FreeBSD.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 00:45:52 -0000 --69pVuxX8awAiJ7fD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: T> Hi Peter, T> T> can you please try this patch? In either case success T> or not, please provide me with dmesg. Thanks a lot! Sorry, patch was missing one file. 99.9% this is a no-op, but better use full patch. -- Gleb Smirnoff --69pVuxX8awAiJ7fD Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages.diff" Index: sys/kern/subr_vmem.c =================================================================== --- sys/kern/subr_vmem.c (revision 328955) +++ sys/kern/subr_vmem.c (working copy) @@ -667,7 +667,8 @@ int vmem_startup_count(void) { - return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); + return (howmany(BT_MAXALLOC, + UMA_SLAB_SPACE / sizeof(struct vmem_btag))); } #endif Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c (revision 328955) +++ sys/vm/uma_core.c (working copy) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG_MEMGUARD #include #endif +#define DIAGNOSTIC /* * This is the zone and keg from which all zones are spawned. @@ -1800,6 +1801,7 @@ uma_startup_count(int zones) /* Memory for the zone of zones and zone of kegs. */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; @@ -1807,17 +1809,20 @@ uma_startup_count(int zones) if (zsize > UMA_SLAB_SIZE) pages += zones * howmany(zsize, UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, UMA_SLAB_SPACE / zsize); + printf("boot_pages zones %d\n", pages); /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + pages += howmany(zones, UMA_SLAB_SPACE / ksize); + printf("boot_pages kegs %d\n", pages); /* * Take conservative approach that every zone * is going to allocate hash. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } Index: sys/vm/uma_int.h =================================================================== --- sys/vm/uma_int.h (revision 328955) +++ sys/vm/uma_int.h (working copy) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c (revision 328955) +++ sys/vm/vm_page.c (working copy) @@ -518,8 +518,11 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %d\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); + printf("boot_pages kmap %d\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --69pVuxX8awAiJ7fD-- From owner-svn-src-head@freebsd.org Wed Feb 7 01:54:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E071F1C6DD; Wed, 7 Feb 2018 01:54:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FAC66FD60; Wed, 7 Feb 2018 01:54:14 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A8F420552; Wed, 7 Feb 2018 01:54:14 +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 w171sDqC049907; Wed, 7 Feb 2018 01:54:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w171sD4P049906; Wed, 7 Feb 2018 01:54:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802070154.w171sD4P049906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Feb 2018 01:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328964 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 328964 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.25 Precedence: list List-Id: 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, 07 Feb 2018 01:54:14 -0000 Author: kevans Date: Wed Feb 7 01:54:13 2018 New Revision: 328964 URL: https://svnweb.freebsd.org/changeset/base/328964 Log: if_awg: Skip emac reset if configured for internal PHY On the OrangePi One at least, emac reset when an ethernet cable is not plugged in seems to break ethernet. Soft reset will fail, even with increasing the delay and retries to wait for up to 20 seconds. This can be reproduced across at least two different OrangePi One's by simply leaving ethernet cable unplugged when awg attaches. Whether it's plugged in or not through u-boot process makes no difference. Skipping the reset in this configuration doesn't seem to cause any problems, tried across many many reboots with and without ethernet cable plugged in. Tested on: OrangePi One Tested on: Other boards (manu) Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D13974 Modified: head/sys/arm/allwinner/if_awg.c Modified: head/sys/arm/allwinner/if_awg.c ============================================================================== --- head/sys/arm/allwinner/if_awg.c Wed Feb 7 01:24:49 2018 (r328963) +++ head/sys/arm/allwinner/if_awg.c Wed Feb 7 01:54:13 2018 (r328964) @@ -1834,9 +1834,11 @@ awg_attach(device_t dev) awg_get_eaddr(dev, eaddr); /* Soft reset EMAC core */ - error = awg_reset(dev); - if (error != 0) - return (error); + if (!awg_has_internal_phy(dev)) { + error = awg_reset(dev); + if (error != 0) + return (error); + } /* Setup DMA descriptors */ error = awg_setup_dma(dev); From owner-svn-src-head@freebsd.org Wed Feb 7 06:54:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BBD7EE26F0; Wed, 7 Feb 2018 06:54:26 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC9EC79840; Wed, 7 Feb 2018 06:54:25 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id EFE4CD010D0; Wed, 7 Feb 2018 01:46:18 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w176kH6q049813 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 07:46:17 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w176kHPx049812; Wed, 7 Feb 2018 07:46:17 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 07:46:17 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207064617.GA49792@x2.osted.lan> References: <201802060416.w164G0va096970@repo.freebsd.org> <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207004549.GH1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 06:54:26 -0000 On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: > T> Hi Peter, > T> > T> can you please try this patch? In either case success > T> or not, please provide me with dmesg. Thanks a lot! > > Sorry, patch was missing one file. 99.9% this is a no-op, > but better use full patch. > GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2018 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 #2 r328956M: Wed Feb 7 00:20:47 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. boot_pages master 1 boot_pages zones 3 boot_pages kegs 4 boot_pages hash 5 boot_pages vmem 6 boot_pages kmap 7 Entering uma_startup with 9 boot pages configured startup_alloc from "UMA Kegs", 8 boot pages left startup_alloc from "UMA Zones", 7 boot pages left startup_alloc from "UMA Hash", 6 boot pages left startup_alloc from "UMA Zones", 5 boot pages left startup_alloc from "vmem btag", 4 boot pages left startup_alloc from "MAP", 3 boot pages left startup_alloc from "UMA Kegs", 2 boot pages left startup_alloc from "KMAP ENTRY", 1 boot pages left panic: UMA: Increase vm.boot_pages cpuid = 0 time = 1 KDB: stack backtrace: db_trace_self_wrapper(c16544c0,c23af290,c1be5bc0,8,c1bbec20,...) at db_trace_self_wrapper+0x2a/frame 0xc2022a70 kdb_backtrace(c164e4f7,1,0,c2022b30,0,...) at kdb_backtrace+0x2d/frame 0xc2022ad8 vpanic(c16a1330,c2022b30,c2022b30,c2022b48,c0fb7983,...) at vpanic+0x133/frame 0xc2022b10 panic(c16a1330,0,c16a0d83,44f,c23b0a80,...) at panic+0x1b/frame 0xc2022b24 startup_alloc(c23b1dc0,1000,0,c2022b7b,102,...) at startup_alloc+0x143/frame 0xc2022b48 keg_alloc_slab(0,2,c16a0d83,987,c23b7000,...) at keg_alloc_slab+0xf6/frame 0xc2022b90 keg_fetch_slab(ffffffff,2,c16a0d83,9e9,c23b1dc0,...) at keg_fetch_slab+0x10e/frame 0xc2022be8 zone_fetch_slab(c23b1dc0,0,ffffffff,2,c23b5000,...) at zone_fetch_slab+0x61/frame 0xc2022c0c zone_import(c23b1dc0,c2022c68,1,ffffffff,2,...) at zone_import+0x3b/frame 0xc2022c44 zone_alloc_item(ffffffff,2,c16a0d9a,c163583d,c1b5d050,...) at zone_alloc_item+0x3d/frame 0xc2022c78 uma_zalloc_arg(c23b1dc0,0,2,c1b5d050,0,...) at uma_zalloc_arg+0x66c/frame 0xc2022cb4 vmem_create(c16a1d6e,0,0,1000,0,...) at vmem_create+0x2a/frame 0xc2022ce4 vm_mem_init(0,0,0,0,c186aab4,...) at vm_mem_init+0xf4/frame 0xc2022d10 mi_startup() at mi_startup+0xf7/frame 0xc2022d38 begin() at begin+0x2f KDB: enter: panic [ thread pid 0 tid 0 ] Stopped at kdb_enter+0x3a: movl $0,kdb_why db> - Peter From owner-svn-src-head@freebsd.org Wed Feb 7 07:25:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4DB5EE446B; Wed, 7 Feb 2018 07:25:40 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 567F17A814; Wed, 7 Feb 2018 07:25:40 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id 51498D010C5; Wed, 7 Feb 2018 02:25:34 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w177PWLD050565 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 08:25:32 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w177PVX2050564; Wed, 7 Feb 2018 08:25:31 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 08:25:31 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207072531.GA50530@x2.osted.lan> References: <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207064617.GA49792@x2.osted.lan> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 07:25:40 -0000 On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: > On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: > > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: > > T> Hi Peter, > > T> > > T> can you please try this patch? In either case success > > T> or not, please provide me with dmesg. Thanks a lot! > > > > Sorry, patch was missing one file. 99.9% this is a no-op, > > but better use full patch. > > > Here the output with vm.boot_pages=128 https://people.freebsd.org/~pho/gleb011.txt - Peter From owner-svn-src-head@freebsd.org Wed Feb 7 09:35:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 027ABEED7CE; Wed, 7 Feb 2018 09:35:28 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-qt0-f173.google.com (mail-qt0-f173.google.com [209.85.216.173]) (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 9B2297F693; Wed, 7 Feb 2018 09:35:27 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-qt0-f173.google.com with SMTP id r13so251823qtm.8; Wed, 07 Feb 2018 01:35:27 -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:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=aL9CPJlzN0932/2dEozEt1tCll16j1F/1KxYuWDyyXo=; b=e5cLz3sueH+sqeleZjMfglR0okNqa8NLDutVq2eZ7zgzugcICtlJB8Kw941+TI2ovX LOeLGXR60BaNrOeL5JujJIOtKYc9JFgGp2albpAT/os88O6oMKLme/LxSvag7qD2dFIq iqHWQeC20ZIajkN779TaWQRc74+TkQ2HG03cta6EsyngVaBGq5Hj6KVaN0KCx8YU1eBu Ie6mHDoPMk0eLSihrRBH5FoKeU3OEn3I2GiShfuBvGe3hv3wfx/bjId8nYIC80ozJdgb ogI73KCm5hi6LXNMMujuJDxoJ4CYNYW77pWaqdp3SiEnOvQVkHO5Y9nX0lawez/F/16C rfrA== X-Gm-Message-State: APf1xPBcYKczQ/RvjoBMCsl2+NLwp+OtTniyLCAD+XcYVavn+ysg4ltn y1EX8LbB/e+SdmtgBHBuKZyfTdOl/c4= X-Google-Smtp-Source: AH8x224AdmEr0RfBGhCNuFregDidU40CHZ5mSchxJAwsiUjWChlPAXIlKRQC2Dc8CVgQ13AfkIv6Fw== X-Received: by 10.200.13.193 with SMTP id t1mr623373qti.287.1517996120918; Wed, 07 Feb 2018 01:35:20 -0800 (PST) Received: from mail-qt0-f181.google.com (mail-qt0-f181.google.com. [209.85.216.181]) by smtp.gmail.com with ESMTPSA id r62sm699121qkc.52.2018.02.07.01.35.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 01:35:20 -0800 (PST) Received: by mail-qt0-f181.google.com with SMTP id t25so265603qtg.3; Wed, 07 Feb 2018 01:35:20 -0800 (PST) X-Received: by 10.237.51.161 with SMTP id v30mr8582547qtd.27.1517996120443; Wed, 07 Feb 2018 01:35:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.85.47 with HTTP; Wed, 7 Feb 2018 01:34:59 -0800 (PST) In-Reply-To: <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> References: <201802061541.w16FfadO041469@repo.freebsd.org> <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> From: Alexander Richardson Date: Wed, 7 Feb 2018 09:34:59 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r328934 - in head: . bin/sh To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 09:35:28 -0000 On 6 February 2018 at 19:25, Rodney W. Grimes wrote: >> Author: arichardson >> Date: Tue Feb 6 15:41:35 2018 >> New Revision: 328934 >> URL: https://svnweb.freebsd.org/changeset/base/328934 >> >> Log: >> Don't hardcode /usr/bin as the path for mktemp in build tools >> >> It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is i= n >> /bin there. >> >> Reviewed By: bdrewery >> Approved By: jhb (mentor) >> Differential Revision: https://reviews.freebsd.org/D13937 > > Would it be better to create the variable MKTEMP to point at > either /bin/mktemp or /usr/bin/mktemp dependent on platform, > there are reasons we use full paths in Makefiles, mostly to > stop /usr/local/bin/foo contimaton, which I believe this > change now opens up, though very slight as I dont know of > a third party mktemp binary. > I'm happy to have a mktemp variable instead, but I don't believe files in /usr/local/bin are a problem. When in add an echo $PATH to the mktokens.sh file I get the following output: PATH=3D/home/alr48/obj/build/freebsd-mips-build/exports/users/alr48/sources= /freebsd-mips/mips.mips64/tmp/legacy/usr/sbin:/home/alr48/obj/build/freebsd= -mips-build/exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/legacy= /usr/bin:/home/alr48/obj/build/freebsd-mips-build/exports/users/alr48/sourc= es/freebsd-mips/mips.mips64/tmp/legacy/bin:/home/alr48/obj/build/freebsd-mi= ps-build/exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/usr/sbin:= /home/alr48/obj/build/freebsd-mips-build/exports/users/alr48/sources/freebs= d-mips/mips.mips64/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin This only contains WORLDTMP and /sbin:/bin:/usr/sbin:/usr/bin since the toplevel makefile already sets PATH to /sbin:/bin:/usr/sbin:/usr/bin. From owner-svn-src-head@freebsd.org Wed Feb 7 09:35:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6297CEED81C; Wed, 7 Feb 2018 09:35:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18CD57F7AF; Wed, 7 Feb 2018 09:35:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13A52250AA; Wed, 7 Feb 2018 09:35:48 +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 w179Zl30077890; Wed, 7 Feb 2018 09:35:47 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w179Zlif077889; Wed, 7 Feb 2018 09:35:47 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802070935.w179Zlif077889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 7 Feb 2018 09:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328969 - head/sys/mips/conf X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/conf X-SVN-Commit-Revision: 328969 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.25 Precedence: list List-Id: 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, 07 Feb 2018 09:35:48 -0000 Author: adrian Date: Wed Feb 7 09:35:47 2018 New Revision: 328969 URL: https://svnweb.freebsd.org/changeset/base/328969 Log: [ar71xx] Fix the TL-wdr3600/tl-wdr4300 hints in the new world order. Tested: * tl-wdr4300 Modified: head/sys/mips/conf/TL-WDR4300.hints Modified: head/sys/mips/conf/TL-WDR4300.hints ============================================================================== --- head/sys/mips/conf/TL-WDR4300.hints Wed Feb 7 09:28:23 2018 (r328968) +++ head/sys/mips/conf/TL-WDR4300.hints Wed Feb 7 09:35:47 2018 (r328969) @@ -114,9 +114,15 @@ hint.arge.1.miimode=1 # GMII # MAC for arge1 is the second 6 bytes of the ART # hint.arge.1.eeprommac=0x1f7f0006 -# ath0: Where the ART is - last 64k in the flash -hint.ath.0.eepromaddr=0x1fff0000 -hint.ath.0.eepromsize=16384 +# ART calibration data mapping - for the AR934x AHB device +hint.ar71xx_caldata.0.at="nexus0" +hint.ar71xx_caldata.0.order=0 +# Where the ART is - last 64k in the first 8MB of flash +hint.ar71xx_caldata.0.map.0.ath_fixup_addr=0x1fff0000 +hint.ar71xx_caldata.0.map.0.ath_fixup_size=16384 + +# And now tell the ath(4) driver where to look! +hint.ath.0.eeprom_firmware="ar71xx_caldata.0.map.0.eeprom_firmware" # ath1: it's different; it's a PCIe attached device, so # we instead need to teach the PCIe bridge code about it From owner-svn-src-head@freebsd.org Wed Feb 7 09:37:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1561EEDA79; Wed, 7 Feb 2018 09:37:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 73D2A7F9CF; Wed, 7 Feb 2018 09:37:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EB61250B0; Wed, 7 Feb 2018 09:37:22 +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 w179bMlP077981; Wed, 7 Feb 2018 09:37:22 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w179bMpI077980; Wed, 7 Feb 2018 09:37:22 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201802070937.w179bMpI077980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 7 Feb 2018 09:37:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328970 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 328970 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.25 Precedence: list List-Id: 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, 07 Feb 2018 09:37:22 -0000 Author: adrian Date: Wed Feb 7 09:37:22 2018 New Revision: 328970 URL: https://svnweb.freebsd.org/changeset/base/328970 Log: [ath] Use the BSSID address logic for STA VAPs too. For DWDS VAPs on ath(4) we need to ensure that the STA vap and hostap VAP have different MAC addresses. If the STA code path doesn't utilise the address assign / reclaim path then it doesn't update the bitmap with which address was allocated. This should fix a bunch of corner issues I've been seeing with DWDS STA + AP VAPs that I was working around with manual MAC address assignment. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Feb 7 09:35:47 2018 (r328969) +++ head/sys/dev/ath/if_ath.c Wed Feb 7 09:37:22 2018 (r328970) @@ -1624,7 +1624,7 @@ ath_vap_create(struct ieee80211com *ic, const char nam } /* STA, AHDEMO? */ - if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_MBSS) { + if (opmode == IEEE80211_M_HOSTAP || opmode == IEEE80211_M_MBSS || opmode == IEEE80211_M_STA) { assign_address(sc, mac, flags & IEEE80211_CLONE_BSSID); ath_hal_setbssidmask(sc->sc_ah, sc->sc_hwbssidmask); } @@ -1858,6 +1858,7 @@ ath_vap_delete(struct ieee80211vap *vap) if (sc->sc_nstavaps == 0 && sc->sc_swbmiss) sc->sc_swbmiss = 0; } else if (vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_STA || vap->iv_opmode == IEEE80211_M_MBSS) { reclaim_address(sc, vap->iv_myaddr); ath_hal_setbssidmask(ah, sc->sc_hwbssidmask); From owner-svn-src-head@freebsd.org Wed Feb 7 10:47:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66660EF2581 for ; Wed, 7 Feb 2018 10:47:23 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::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 EC1C182A2E for ; Wed, 7 Feb 2018 10:47:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x244.google.com with SMTP id h129so1708383ita.2 for ; Wed, 07 Feb 2018 02:47:22 -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=8faVEyg3ZViy8wi4MlH5WwATEPObQksVh6aPOiuQ09M=; b=FRslOI6AxXcjf/cWIF+2b8mSrOXkL+rHUAitoX90ht1zum1mbTu+IfsPfUjPtWr5FR Q1nj53dQJv7uCHUW8W9OhNAQxQSans41Hw978O8t5QPvumRdl73Lqhs7xm2rNldQ+VDj jb7xqTwOQvQWOygbZi3B5SeNH9rQXYohg135cDLNwdlPB2wvlSSrWYEWgyxL675gc+2c 0hOGF1aAKAE6Mk6OuAOqS5nHmDrlD0BHuuFFuHfuBDxnD+ITyiwcPEHjek6BJxpJj67O jBdaamqSMhdqXFoW4Wesm0ByKe0CQhGA3hft9lXYXpRsxqpM4+s4pmvvkXnL1pQshCqs u5zA== 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=8faVEyg3ZViy8wi4MlH5WwATEPObQksVh6aPOiuQ09M=; b=h92A4uONmpy09Q674jq9TXqLaDVSr8wiUpg9GEsEzMbl/lxM0Sn6I0UO/8WmBPcgUV R1wOFHcxHgVYKdB8xmBSzuLbLQiOtr2qSKPZg/dr+WUp+zTTJtg32kPJCXBjMNCR++de jBip0VGxRCRnVR13IAJf1zHJdN+TTmLoH+4objeqYqegaCPFxKXwP7TU/VWU7ehr2hC+ H5zIJnqDiBmsXa9aJ3GwH1IeWSI0QV+FGSZyO6N4JkecVQCvs+nFeHdYGDtGjZFqWlAQ FcV1MTxcQS9hzo8jej4+7l6p4o9BiQneLN+o82VqRnmcrTEM08sibWpotSVWbg9l6FWA SV9g== X-Gm-Message-State: APf1xPBh+sERv1IZ9QoYakXOjtVAR+Id2iIJWHyJkSYHlGVer+hnajSt RrW2IhMs0MaK6k0waX1GxUpCl4GZiKcKD4LGhIu+Ww== X-Google-Smtp-Source: AH8x226DF42b3GFq4H5psOt5dZ/5E5KSDpgb/0rlvA4rcmPESJOAwOzTaGci/ZrW+xWlKKFhIkH12d2XJhj3DkgX1Ug= X-Received: by 10.36.68.206 with SMTP id o197mr7357358ita.97.1518000442098; Wed, 07 Feb 2018 02:47:22 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Wed, 7 Feb 2018 02:47:21 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c81d:c97b:c7cd:ac64] Received: by 10.79.201.67 with HTTP; Wed, 7 Feb 2018 02:47:21 -0800 (PST) In-Reply-To: References: <201802061541.w16FfadO041469@repo.freebsd.org> <201802061925.w16JP4aq017961@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 7 Feb 2018 03:47:21 -0700 X-Google-Sender-Auth: -GbJn6uikVwKMBkqVnjt3kzs964 Message-ID: Subject: Re: svn commit: r328934 - in head: . bin/sh To: Alex Richardson Cc: "Rodney W. Grimes" , 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 10:47:23 -0000 On Feb 7, 2018 2:35 AM, "Alexander Richardson" wrote: On 6 February 2018 at 19:25, Rodney W. Grimes wrote: >> Author: arichardson >> Date: Tue Feb 6 15:41:35 2018 >> New Revision: 328934 >> URL: https://svnweb.freebsd.org/changeset/base/328934 >> >> Log: >> Don't hardcode /usr/bin as the path for mktemp in build tools >> >> It won't work e.g. when crossbuilding from Ubuntu Linux as mktemp is in >> /bin there. >> >> Reviewed By: bdrewery >> Approved By: jhb (mentor) >> Differential Revision: https://reviews.freebsd.org/D13937 > > Would it be better to create the variable MKTEMP to point at > either /bin/mktemp or /usr/bin/mktemp dependent on platform, > there are reasons we use full paths in Makefiles, mostly to > stop /usr/local/bin/foo contimaton, which I believe this > change now opens up, though very slight as I dont know of > a third party mktemp binary. > I'm happy to have a mktemp variable instead, but I don't believe files in /usr/local/bin are a problem. When in add an echo $PATH to the mktokens.sh file I get the following output: PATH=/home/alr48/obj/build/freebsd-mips-build/exports/ users/alr48/sources/freebsd-mips/mips.mips64/tmp/legacy/ usr/sbin:/home/alr48/obj/build/freebsd-mips-build/ exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/ legacy/usr/bin:/home/alr48/obj/build/freebsd-mips-build/ exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/ legacy/bin:/home/alr48/obj/build/freebsd-mips-build/ exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/ usr/sbin:/home/alr48/obj/build/freebsd-mips-build/ exports/users/alr48/sources/freebsd-mips/mips.mips64/tmp/ usr/bin:/sbin:/bin:/usr/sbin:/usr/bin This only contains WORLDTMP and /sbin:/bin:/usr/sbin:/usr/bin since the toplevel makefile already sets PATH to /sbin:/bin:/usr/sbin:/usr/bin. I honestly wouldn't add a variable. It makes it more complicated for zero benefit. Unless a reasonable use case can be shown, it just flutters up the build for no benefit. Warner From owner-svn-src-head@freebsd.org Wed Feb 7 12:12:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85333F00D45; Wed, 7 Feb 2018 12:12:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32C8D862A0; Wed, 7 Feb 2018 12:12: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DC7D26ABB; Wed, 7 Feb 2018 12:12:07 +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 w17CC659058164; Wed, 7 Feb 2018 12:12:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17CC6lt058156; Wed, 7 Feb 2018 12:12:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071212.w17CC6lt058156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 12:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328971 - 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: 328971 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.25 Precedence: list List-Id: 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, 07 Feb 2018 12:12:07 -0000 Author: hselasky Date: Wed Feb 7 12:12:06 2018 New Revision: 328971 URL: https://svnweb.freebsd.org/changeset/base/328971 Log: Fix implementation of ktime_add_ns() and ktime_sub_ns() in the LinuxKPI to actually return the computed result instead of the input value. This is a regression issue after r289572. Found by: gcc6 MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h Modified: head/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Feb 7 09:37:22 2018 (r328970) +++ head/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Feb 7 12:12:06 2018 (r328971) @@ -88,18 +88,14 @@ ktime_to_timeval(ktime_t kt) static inline ktime_t ktime_add_ns(ktime_t kt, int64_t ns) { - ktime_t res; - - res.tv64 = kt.tv64 + ns; + kt.tv64 += ns; return kt; } static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { - ktime_t res; - - res.tv64 = kt.tv64 - ns; + kt.tv64 -= ns; return kt; } From owner-svn-src-head@freebsd.org Wed Feb 7 14:50:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1EE8F0B786; Wed, 7 Feb 2018 14:50:06 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 875BA6C72B; Wed, 7 Feb 2018 14:50:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8226B372; Wed, 7 Feb 2018 14:50:06 +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 w17Eo6xI033429; Wed, 7 Feb 2018 14:50:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Eo6sc033426; Wed, 7 Feb 2018 14:50:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802071450.w17Eo6sc033426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 7 Feb 2018 14:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328972 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 328972 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.25 Precedence: list List-Id: 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, 07 Feb 2018 14:50:07 -0000 Author: emaste Date: Wed Feb 7 14:50:06 2018 New Revision: 328972 URL: https://svnweb.freebsd.org/changeset/base/328972 Log: add retpoline compiler and linker feature flags These features indicate that the compiler and linker support the retpoline speculative execution vulnerability (CVE-2017-5715) mitigation. Reviewed by: dim, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14228 Modified: head/Makefile.inc1 head/share/mk/bsd.compiler.mk head/share/mk/bsd.linker.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Feb 7 12:12:06 2018 (r328971) +++ head/Makefile.inc1 Wed Feb 7 14:50:06 2018 (r328972) @@ -165,11 +165,11 @@ test-system-compiler: .PHONY .if !defined(X_COMPILER_TYPE) CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ COMPILER_TYPE=${COMPILER_TYPE} \ - COMPILER_FEATURES=${COMPILER_FEATURES} \ + COMPILER_FEATURES="${COMPILER_FEATURES}" \ COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} .else CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \ - COMPILER_FEATURES=${X_COMPILER_FEATURES} \ + COMPILER_FEATURES="${X_COMPILER_FEATURES}" \ COMPILER_TYPE=${X_COMPILER_TYPE} \ COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} .endif Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Feb 7 12:12:06 2018 (r328971) +++ head/share/mk/bsd.compiler.mk Wed Feb 7 14:50:06 2018 (r328972) @@ -19,7 +19,9 @@ # COMPILER_FEATURES will contain one or more of the following, based on # compiler support for that feature: # -# - c++11 : supports full (or nearly full) C++11 programming environment. +# - c++11: supports full (or nearly full) C++11 programming environment. +# - retpoline: supports the retpoline speculative execution vulnerability +# mitigation. # # These variables with an X_ prefix will also be provided if XCC is set. # @@ -178,11 +180,13 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown .endif .endif +${X_}COMPILER_FEATURES= .if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) -${X_}COMPILER_FEATURES= c++11 -.else -${X_}COMPILER_FEATURES= +${X_}COMPILER_FEATURES+= c++11 +.endif +.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 +${X_}COMPILER_FEATURES+= retpoline .endif .else Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Wed Feb 7 12:12:06 2018 (r328971) +++ head/share/mk/bsd.linker.mk Wed Feb 7 14:50:06 2018 (r328972) @@ -12,7 +12,9 @@ # LINKER_FEATURES may contain one or more of the following, based on # linker support for that feature: # -# - build-id : support for generating a Build-ID note +# - build-id: support for generating a Build-ID note +# - retpoline: support for generating PLT with retpoline speculative +# execution vulnerability mitigation # # These variables with an X_ prefix will also be provided if XLD is set. # @@ -72,6 +74,9 @@ ${X_}LINKER_FEATURES+= build-id .endif .if ${${X_}LINKER_TYPE} != "lld" || ${${X_}LINKER_VERSION} >= 50000 ${X_}LINKER_FEATURES+= filter +.endif +.if ${${X_}LINKER_TYPE} == "lld" && ${${X_}LINKER_VERSION} >= 60000 +${X_}LINKER_FEATURES+= retpoline .endif .endif .else From owner-svn-src-head@freebsd.org Wed Feb 7 16:28:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EC28F12BEB; Wed, 7 Feb 2018 16:28:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DBBF70EAA; Wed, 7 Feb 2018 16:28: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 340DF13C4; Wed, 7 Feb 2018 16:28:27 +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 w17GSR58082979; Wed, 7 Feb 2018 16:28:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17GSQsD082977; Wed, 7 Feb 2018 16:28:26 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802071628.w17GSQsD082977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 16:28:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328975 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 328975 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.25 Precedence: list List-Id: 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, 07 Feb 2018 16:28:27 -0000 Author: imp Date: Wed Feb 7 16:28:26 2018 New Revision: 328975 URL: https://svnweb.freebsd.org/changeset/base/328975 Log: Add a note about why we have the conditional before including bsd.compiler.mk. It's so fmake from older 9.x systems still works (still a supported build config, and having the note here will let us know when we can cull it more easily). Also pull in a related change from include to sinclude from arichardson@'s cross building work, as well as it's companion in Makefile.inc1 with a note about why we do the odd thing there. Submitted by: archardson Differential Revision: https://reviews.freebsd.org/D14241 Modified: head/Makefile head/Makefile.inc1 Modified: head/Makefile ============================================================================== --- head/Makefile Wed Feb 7 15:32:31 2018 (r328974) +++ head/Makefile Wed Feb 7 16:28:26 2018 (r328975) @@ -106,9 +106,13 @@ # # This is included so CC is set to ccache for -V, and COMPILER_TYPE/VERSION -# can be cached for sub-makes. +# can be cached for sub-makes. We can't do this while still running on the +# old fmake from FreeBSD 9.x or older, so avoid including it then to avoid +# heartburn upgrading from older systems. The need for CC is done with new +# make later in the build, and caching COMPILER_TYPE/VERSION is only an +# optimization. Also sinclude it to be friendlier to foreign OS hosted builds. .if ${MAKE_VERSION} >= 20140620 && defined(.PARSEDIR) -.include +.sinclude .endif # Note: we use this awkward construct to be compatible with FreeBSD's Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Feb 7 15:32:31 2018 (r328974) +++ head/Makefile.inc1 Wed Feb 7 16:28:26 2018 (r328975) @@ -85,8 +85,10 @@ MK_GCC_BOOTSTRAP= no .-include "${OBJTOP}/compiler-metadata.mk" .endif -# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. -.include +# Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the +# tree to be friendlier to foreign OS builds. It's safe to do so unconditionally +# here since we will always have the right make, unlike in src/Makefile +.include "share/mk/bsd.compiler.mk" .include "share/mk/src.opts.mk" # Check if there is a local compiler that can satisfy as an external compiler. From owner-svn-src-head@freebsd.org Wed Feb 7 16:46:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4CAAF1404C; Wed, 7 Feb 2018 16:46:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BCCF72126; Wed, 7 Feb 2018 16:46:21 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w17GkKt1013064 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 08:46:20 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w17GkJVn013063; Wed, 7 Feb 2018 08:46:19 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Feb 2018 08:46:19 -0800 From: Gleb Smirnoff To: Peter Holm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207164619.GK1063@FreeBSD.org> References: <20180206113017.GA25428@x2.osted.lan> <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5gxpn/Q6ypwruk0T" Content-Disposition: inline In-Reply-To: <20180207064617.GA49792@x2.osted.lan> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 16:46:23 -0000 --5gxpn/Q6ypwruk0T Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: P> On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: P> > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: P> > T> Hi Peter, P> > T> P> > T> can you please try this patch? In either case success P> > T> or not, please provide me with dmesg. Thanks a lot! P> > P> > Sorry, patch was missing one file. 99.9% this is a no-op, P> > but better use full patch. Let's do one more attempt. I found where I miss one keg. -- Gleb Smirnoff --5gxpn/Q6ypwruk0T Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages.diff" Index: sys/kern/subr_vmem.c =================================================================== --- sys/kern/subr_vmem.c (revision 328955) +++ sys/kern/subr_vmem.c (working copy) @@ -667,7 +667,8 @@ int vmem_startup_count(void) { - return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); + return (howmany(BT_MAXALLOC, + UMA_SLAB_SPACE / sizeof(struct vmem_btag))); } #endif Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c (revision 328955) +++ sys/vm/uma_core.c (working copy) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG_MEMGUARD #include #endif +#define DIAGNOSTIC /* * This is the zone and keg from which all zones are spawned. @@ -1796,28 +1797,40 @@ uma_startup_count(int zones) zsize = sizeof(struct uma_zone) + (sizeof(struct uma_cache) * (mp_maxid + 1)) + (sizeof(struct uma_zone_domain) * vm_ndomains); + printf("ksize %d zsize %d slab %lu\n", ksize, zsize, sizeof(struct uma_slab)); - /* Memory for the zone of zones and zone of kegs. */ + /* + * Memory for the zone of kegs and its keg, + * and for zone of zones. + */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; - /* Memory for startup zones, UMA and VM, ... */ + /* Memory for the rest of startup zones, UMA and VM, ... */ if (zsize > UMA_SLAB_SIZE) pages += zones * howmany(zsize, UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, UMA_SLAB_SPACE / zsize); + printf("boot_pages zones %d\n", pages); - /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + /* ... and their kegs. Note that zone of zones allocates a keg! */ + pages += howmany(zones + 1, UMA_SLAB_SPACE / ksize); + printf("boot_pages kegs %d\n", pages); /* - * Take conservative approach that every zone - * is going to allocate hash. + * Most of startup zones are not going to be offpages, that's + * why we use UMA_SLAB_SPACE instead of UMA_SLAB_SIZE in all + * calculations. Some large bucket zones will be offpage, and + * thus will allocate hashes. We take conservative approach + * and assume that all zones may allocate hash. This may give + * us some positive imprecision, usually an extra single page. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } Index: sys/vm/uma_int.h =================================================================== --- sys/vm/uma_int.h (revision 328955) +++ sys/vm/uma_int.h (working copy) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c (revision 328955) +++ sys/vm/vm_page.c (working copy) @@ -518,8 +518,11 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %d\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); + printf("boot_pages kmap %d\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --5gxpn/Q6ypwruk0T-- From owner-svn-src-head@freebsd.org Wed Feb 7 16:57:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B9F9F14C63; Wed, 7 Feb 2018 16:57:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09738728DE; Wed, 7 Feb 2018 16:57:11 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F39A218B2; Wed, 7 Feb 2018 16:57:10 +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 w17GvAmg098219; Wed, 7 Feb 2018 16:57:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17GvA43098211; Wed, 7 Feb 2018 16:57:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802071657.w17GvA43098211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Feb 2018 16:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328977 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 328977 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.25 Precedence: list List-Id: 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, 07 Feb 2018 16:57:11 -0000 Author: markj Date: Wed Feb 7 16:57:10 2018 New Revision: 328977 URL: https://svnweb.freebsd.org/changeset/base/328977 Log: Dequeue wired pages lazily. Previously, wiring a page would cause it to be removed from its page queue. In the common case, unwiring causes it to be enqueued at the tail of that page queue. This change modifies vm_page_wire() to not dequeue the page, thus avoiding the highly contended page queue locks. Instead, vm_page_unwire() takes care of requeuing the page as a single operation, and the page daemon dequeues wired pages as they are encountered during a queue scan to avoid needlessly revisiting them later. For pages in PQ_ACTIVE we do even better, since a requeue is unnecessary. The change improves scalability for some common workloads. For instance, threads wiring pages into the buffer cache no longer need to modify global page queues, and unwiring is usually done by the bufspace thread, so concurrency is not as much of an issue. As another example, many sysctl handlers wire the output buffer to avoid faults on copyout, and since the buffer is likely to be in PQ_ACTIVE, we now entirely avoid modifying the page queue in this case. The change also adds a block comment describing some properties of struct vm_page's reference counters, and the busy lock. Reviewed by: jeff Discussed with: alc, kib MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D11943 Modified: head/sys/kern/kern_sendfile.c head/sys/kern/vfs_bio.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vm_swapout.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/kern/kern_sendfile.c Wed Feb 7 16:57:10 2018 (r328977) @@ -128,6 +128,7 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, CTLTYPE_OPAQU static void sendfile_free_page(vm_page_t pg, bool nocache) { + bool freed; vm_page_lock(pg); /* @@ -136,15 +137,15 @@ sendfile_free_page(vm_page_t pg, bool nocache) * responsible for freeing the page. In 'noncache' case try to free * the page, but only if it is cheap to. */ - if (vm_page_unwire(pg, nocache ? PQ_NONE : PQ_INACTIVE)) { + if (vm_page_unwire_noq(pg)) { vm_object_t obj; if ((obj = pg->object) == NULL) vm_page_free(pg); - else if (nocache) { - if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) { - bool freed; - + else { + freed = false; + if (nocache && !vm_page_xbusied(pg) && + VM_OBJECT_TRYWLOCK(obj)) { /* Only free unmapped pages. */ if (obj->ref_count == 0 || !pmap_page_is_mapped(pg)) @@ -153,13 +154,24 @@ sendfile_free_page(vm_page_t pg, bool nocache) * locked cannot be relied upon. */ freed = vm_page_try_to_free(pg); - else - freed = false; VM_OBJECT_WUNLOCK(obj); - if (!freed) + } + if (!freed) { + /* + * If we were asked to not cache the page, place + * it near the head of the inactive queue so + * that it is reclaimed sooner. Otherwise, + * maintain LRU. + */ + if (nocache) vm_page_deactivate_noreuse(pg); - } else - vm_page_deactivate_noreuse(pg); + else if (pg->queue == PQ_ACTIVE) + vm_page_reference(pg); + else if (pg->queue != PQ_INACTIVE) + vm_page_deactivate(pg); + else + vm_page_requeue(pg); + } } } vm_page_unlock(pg); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/kern/vfs_bio.c Wed Feb 7 16:57:10 2018 (r328977) @@ -2621,7 +2621,7 @@ vfs_vmio_unwire(struct buf *bp, vm_page_t m) bool freed; vm_page_lock(m); - if (vm_page_unwire(m, PQ_NONE)) { + if (vm_page_unwire_noq(m)) { /* * Determine if the page should be freed before adding * it to the inactive queue. @@ -2637,14 +2637,16 @@ vfs_vmio_unwire(struct buf *bp, vm_page_t m) if (!freed) { /* * If the page is unlikely to be reused, let the - * VM know. Otherwise, maintain LRU page - * ordering and put the page at the tail of the - * inactive queue. + * VM know. Otherwise, maintain LRU. */ if ((bp->b_flags & B_NOREUSE) != 0) vm_page_deactivate_noreuse(m); - else + else if (m->queue == PQ_ACTIVE) + vm_page_reference(m); + else if (m->queue != PQ_INACTIVE) vm_page_deactivate(m); + else + vm_page_requeue(m); } } vm_page_unlock(m); Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_object.c Wed Feb 7 16:57:10 2018 (r328977) @@ -1275,7 +1275,7 @@ next_page: if (tm->valid != VM_PAGE_BITS_ALL) goto next_pindex; vm_page_lock(tm); - if (tm->hold_count != 0 || tm->wire_count != 0) { + if (vm_page_held(tm)) { vm_page_unlock(tm); goto next_pindex; } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_page.c Wed Feb 7 16:57:10 2018 (r328977) @@ -2053,8 +2053,7 @@ vm_page_alloc_check(vm_page_t m) KASSERT(m->object == NULL, ("page %p has object", m)); KASSERT(m->queue == PQ_NONE, ("page %p has unexpected queue %d", m, m->queue)); - KASSERT(m->wire_count == 0, ("page %p is wired", m)); - KASSERT(m->hold_count == 0, ("page %p is held", m)); + KASSERT(!vm_page_held(m), ("page %p is held", m)); KASSERT(!vm_page_busied(m), ("page %p is busy", m)); KASSERT(m->dirty == 0, ("page %p is dirty", m)); KASSERT(pmap_page_get_memattr(m) == VM_MEMATTR_DEFAULT, @@ -2220,7 +2219,7 @@ vm_page_scan_contig(u_long npages, vm_page_t m_start, vm_page_change_lock(m, &m_mtx); m_inc = 1; retry: - if (m->wire_count != 0 || m->hold_count != 0) + if (vm_page_held(m)) run_ext = 0; #if VM_NRESERVLEVEL > 0 else if ((level = vm_reserv_level(m)) >= 0 && @@ -2248,8 +2247,7 @@ retry: */ VM_OBJECT_RUNLOCK(object); goto retry; - } else if (m->wire_count != 0 || - m->hold_count != 0) { + } else if (vm_page_held(m)) { run_ext = 0; goto unlock; } @@ -2391,7 +2389,7 @@ vm_page_reclaim_run(int req_class, int domain, u_long */ vm_page_change_lock(m, &m_mtx); retry: - if (m->wire_count != 0 || m->hold_count != 0) + if (vm_page_held(m)) error = EBUSY; else if ((object = m->object) != NULL) { /* @@ -2408,8 +2406,7 @@ retry: */ VM_OBJECT_WUNLOCK(object); goto retry; - } else if (m->wire_count != 0 || - m->hold_count != 0) { + } else if (vm_page_held(m)) { error = EBUSY; goto unlock; } @@ -3042,9 +3039,7 @@ vm_page_activate(vm_page_t m) if (queue != PQ_NONE) vm_page_dequeue(m); vm_page_enqueue(PQ_ACTIVE, m); - } else - KASSERT(queue == PQ_NONE, - ("vm_page_activate: wired page %p is queued", m)); + } } else { if (m->act_count < ACT_INIT) m->act_count = ACT_INIT; @@ -3241,26 +3236,18 @@ vm_page_free_toq(vm_page_t m) } /* - * vm_page_wire: + * vm_page_wire: * - * Mark this page as wired down by yet - * another map, removing it from paging queues - * as necessary. + * Mark this page as wired down. If the page is fictitious, then + * its wire count must remain one. * - * If the page is fictitious, then its wire count must remain one. - * - * The page must be locked. + * The page must be locked. */ void vm_page_wire(vm_page_t m) { - /* - * Only bump the wire statistics if the page is not already wired, - * and only unqueue the page if it is on some queue (if it is unmanaged - * it is already off the queues). - */ - vm_page_lock_assert(m, MA_OWNED); + vm_page_assert_locked(m); if ((m->flags & PG_FICTITIOUS) != 0) { KASSERT(m->wire_count == 1, ("vm_page_wire: fictitious page %p's wire count isn't one", @@ -3271,7 +3258,6 @@ vm_page_wire(vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0 || m->queue == PQ_NONE, ("vm_page_wire: unmanaged page %p is queued", m)); - vm_page_remque(m); atomic_add_int(&vm_cnt.v_wire_count, 1); } m->wire_count++; @@ -3288,38 +3274,69 @@ vm_page_wire(vm_page_t m) * Only managed pages belonging to an object can be paged out. If the number * of wirings transitions to zero and the page is eligible for page out, then * the page is added to the specified paging queue (unless PQ_NONE is - * specified). + * specified, in which case the page is dequeued if it belongs to a paging + * queue). * * If a page is fictitious, then its wire count must always be one. * * A managed page must be locked. */ -boolean_t +bool vm_page_unwire(vm_page_t m, uint8_t queue) { + bool unwired; KASSERT(queue < PQ_COUNT || queue == PQ_NONE, ("vm_page_unwire: invalid queue %u request for page %p", queue, m)); + + unwired = vm_page_unwire_noq(m); + if (unwired && (m->oflags & VPO_UNMANAGED) == 0 && m->object != NULL) { + if (m->queue == queue) { + if (queue == PQ_ACTIVE) + vm_page_reference(m); + else if (queue != PQ_NONE) + vm_page_requeue(m); + } else { + vm_page_remque(m); + if (queue != PQ_NONE) { + vm_page_enqueue(queue, m); + if (queue == PQ_ACTIVE) + /* Initialize act_count. */ + vm_page_activate(m); + } + } + } + return (unwired); +} + +/* + * + * vm_page_unwire_noq: + * + * Unwire a page without (re-)inserting it into a page queue. It is up + * to the caller to enqueue, requeue, or free the page as appropriate. + * In most cases, vm_page_unwire() should be used instead. + */ +bool +vm_page_unwire_noq(vm_page_t m) +{ + if ((m->oflags & VPO_UNMANAGED) == 0) vm_page_assert_locked(m); if ((m->flags & PG_FICTITIOUS) != 0) { KASSERT(m->wire_count == 1, ("vm_page_unwire: fictitious page %p's wire count isn't one", m)); - return (FALSE); + return (false); } - if (m->wire_count > 0) { - m->wire_count--; - if (m->wire_count == 0) { - atomic_subtract_int(&vm_cnt.v_wire_count, 1); - if ((m->oflags & VPO_UNMANAGED) == 0 && - m->object != NULL && queue != PQ_NONE) - vm_page_enqueue(queue, m); - return (TRUE); - } else - return (FALSE); - } else + if (m->wire_count == 0) panic("vm_page_unwire: page %p's wire count is zero", m); + m->wire_count--; + if (m->wire_count == 0) { + atomic_subtract_int(&vm_cnt.v_wire_count, 1); + return (true); + } else + return (false); } /* @@ -3448,8 +3465,7 @@ vm_page_try_to_free(vm_page_t m) vm_page_assert_locked(m); VM_OBJECT_ASSERT_WLOCKED(m->object); KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("page %p is unmanaged", m)); - if (m->dirty != 0 || m->hold_count != 0 || m->wire_count != 0 || - vm_page_busied(m)) + if (m->dirty != 0 || vm_page_held(m) || vm_page_busied(m)) return (false); if (m->object->ref_count != 0) { pmap_remove_all(m); Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_page.h Wed Feb 7 16:57:10 2018 (r328977) @@ -97,7 +97,7 @@ * or the lock for either the free or paging queue (Q). If a field is * annotated below with two of these locks, then holding either lock is * sufficient for read access, but both locks are required for write - * access. + * access. An annotation of (C) indicates that the field is immutable. * * In contrast, the synchronization of accesses to the page's * dirty field is machine dependent (M). In the @@ -111,6 +111,38 @@ * contains the dirty field. In the machine-independent layer, * the implementation of read-modify-write operations on the * field is encapsulated in vm_page_clear_dirty_mask(). + * + * The page structure contains two counters which prevent page reuse. + * Both counters are protected by the page lock (P). The hold + * counter counts transient references obtained via a pmap lookup, and + * is also used to prevent page reclamation in situations where it is + * undesirable to block other accesses to the page. The wire counter + * is used to implement mlock(2) and is non-zero for pages containing + * kernel memory. Pages that are wired or held will not be reclaimed + * or laundered by the page daemon, but are treated differently during + * a page queue scan: held pages remain at their position in the queue, + * while wired pages are removed from the queue and must later be + * re-enqueued appropriately by the unwiring thread. It is legal to + * call vm_page_free() on a held page; doing so causes it to be removed + * from its object and page queue, and the page is released to the + * allocator once the last hold reference is dropped. In contrast, + * wired pages may not be freed. + * + * In some pmap implementations, the wire count of a page table page is + * used to track the number of populated entries. + * + * The busy lock is an embedded reader-writer lock which protects the + * page's contents and identity (i.e., its tuple) and + * interlocks with the object lock (O). In particular, a page may be + * busied or unbusied only with the object write lock held. To avoid + * bloating the page structure, the busy lock lacks some of the + * features available to the kernel's general-purpose synchronization + * primitives. As a result, busy lock ordering rules are not verified, + * lock recursion is not detected, and an attempt to xbusy a busy page + * or sbusy an xbusy page results will trigger a panic rather than + * causing the thread to block. vm_page_sleep_if_busy() can be used to + * sleep until the page's busy state changes, after which the caller + * must re-lookup the page and re-evaluate its state. */ #if PAGE_SIZE == 4096 @@ -152,9 +184,9 @@ struct vm_page { uint8_t oflags; /* page VPO_* flags (O) */ uint8_t queue; /* page queue index (P,Q) */ int8_t psind; /* pagesizes[] index (O) */ - int8_t segind; + int8_t segind; /* vm_phys segment index (C) */ uint8_t order; /* index of the buddy queue */ - uint8_t pool; + uint8_t pool; /* vm_phys freepool index (Q) */ u_char act_count; /* page usage count (P) */ /* NOTE that these must support one bit per DEV_BSIZE in a page */ /* so, on normal X86 kernels, they must be at least 8 bits wide */ @@ -489,7 +521,8 @@ bool vm_page_try_to_free(vm_page_t m); int vm_page_trysbusy(vm_page_t m); void vm_page_unhold_pages(vm_page_t *ma, int count); void vm_page_unswappable(vm_page_t m); -boolean_t vm_page_unwire(vm_page_t m, uint8_t queue); +bool vm_page_unwire(vm_page_t m, uint8_t queue); +bool vm_page_unwire_noq(vm_page_t m); void vm_page_updatefake(vm_page_t m, vm_paddr_t paddr, vm_memattr_t memattr); void vm_page_wire (vm_page_t); void vm_page_xunbusy_hard(vm_page_t m); @@ -714,6 +747,18 @@ vm_page_in_laundry(vm_page_t m) { return (m->queue == PQ_LAUNDRY || m->queue == PQ_UNSWAPPABLE); +} + +/* + * vm_page_held: + * + * Return true if a reference prevents the page from being reclaimable. + */ +static inline bool +vm_page_held(vm_page_t m) +{ + + return (m->hold_count > 0 || m->wire_count > 0); } #endif /* _KERNEL */ Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_pageout.c Wed Feb 7 16:57:10 2018 (r328977) @@ -335,11 +335,8 @@ vm_pageout_cluster(vm_page_t m) VM_OBJECT_ASSERT_WLOCKED(object); pindex = m->pindex; - /* - * We can't clean the page if it is busy or held. - */ vm_page_assert_unbusied(m); - KASSERT(m->hold_count == 0, ("page %p is held", m)); + KASSERT(!vm_page_held(m), ("page %p is held", m)); pmap_remove_write(m); vm_page_unlock(m); @@ -378,8 +375,7 @@ more: break; } vm_page_lock(p); - if (!vm_page_in_laundry(p) || - p->hold_count != 0) { /* may be undergoing I/O */ + if (!vm_page_in_laundry(p) || vm_page_held(p)) { vm_page_unlock(p); ib = 0; break; @@ -405,8 +401,7 @@ more: if (p->dirty == 0) break; vm_page_lock(p); - if (!vm_page_in_laundry(p) || - p->hold_count != 0) { /* may be undergoing I/O */ + if (!vm_page_in_laundry(p) || vm_page_held(p)) { vm_page_unlock(p); break; } @@ -655,10 +650,10 @@ vm_pageout_clean(vm_page_t m, int *numpagedout) } /* - * The page may have been busied or held while the object + * The page may have been busied or referenced while the object * and page locks were released. */ - if (vm_page_busied(m) || m->hold_count != 0) { + if (vm_page_busied(m) || vm_page_held(m)) { vm_page_unlock(m); error = EBUSY; goto unlock_all; @@ -747,11 +742,18 @@ scan: vm_page_unlock(m); continue; } + if (m->wire_count != 0) { + vm_page_dequeue_locked(m); + vm_page_unlock(m); + continue; + } object = m->object; if ((!VM_OBJECT_TRYWLOCK(object) && (!vm_pageout_fallback_object_lock(m, &next) || - m->hold_count != 0)) || vm_page_busied(m)) { + vm_page_held(m))) || vm_page_busied(m)) { VM_OBJECT_WUNLOCK(object); + if (m->wire_count != 0 && vm_page_pagequeue(m) == pq) + vm_page_dequeue_locked(m); vm_page_unlock(m); continue; } @@ -1190,8 +1192,17 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) */ if (!vm_pageout_page_lock(m, &next)) goto unlock_page; - else if (m->hold_count != 0) { + else if (m->wire_count != 0) { /* + * Wired pages may not be freed, and unwiring a queued + * page will cause it to be requeued. Thus, remove them + * from the queue now to avoid unnecessary revisits. + */ + vm_page_dequeue_locked(m); + addl_page_shortage++; + goto unlock_page; + } else if (m->hold_count != 0) { + /* * Held pages are essentially stuck in the * queue. So, they ought to be discounted * from the inactive count. See the @@ -1205,9 +1216,13 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) if (!VM_OBJECT_TRYWLOCK(object)) { if (!vm_pageout_fallback_object_lock(m, &next)) goto unlock_object; - else if (m->hold_count != 0) { + else if (m->wire_count != 0) { + vm_page_dequeue_locked(m); addl_page_shortage++; goto unlock_object; + } else if (m->hold_count != 0) { + addl_page_shortage++; + goto unlock_object; } } if (vm_page_busied(m)) { @@ -1226,7 +1241,7 @@ unlock_page: vm_page_unlock(m); continue; } - KASSERT(m->hold_count == 0, ("Held page %p", m)); + KASSERT(!vm_page_held(m), ("Held page %p", m)); /* * Dequeue the inactive page and unlock the inactive page @@ -1431,6 +1446,15 @@ drop_page: * the page for eligibility. */ VM_CNT_INC(v_pdpages); + + /* + * Wired pages are dequeued lazily. + */ + if (m->wire_count != 0) { + vm_page_dequeue_locked(m); + vm_page_unlock(m); + continue; + } /* * Check to see "how much" the page has been used. Modified: head/sys/vm/vm_swapout.c ============================================================================== --- head/sys/vm/vm_swapout.c Wed Feb 7 16:45:38 2018 (r328976) +++ head/sys/vm/vm_swapout.c Wed Feb 7 16:57:10 2018 (r328977) @@ -209,7 +209,7 @@ vm_swapout_object_deactivate_pages(pmap_t pmap, vm_obj continue; VM_CNT_INC(v_pdpages); vm_page_lock(p); - if (p->wire_count != 0 || p->hold_count != 0 || + if (vm_page_held(p) || !pmap_page_exists_quick(pmap, p)) { vm_page_unlock(p); continue; From owner-svn-src-head@freebsd.org Wed Feb 7 16:58:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2362F14DDE; Wed, 7 Feb 2018 16:58:01 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A820572A52; Wed, 7 Feb 2018 16:58:01 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A31EF18BB; Wed, 7 Feb 2018 16:58:01 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17Gw1Ux098292; Wed, 7 Feb 2018 16:58:01 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Gw18a098291; Wed, 7 Feb 2018 16:58:01 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802071658.w17Gw18a098291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 7 Feb 2018 16:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328978 - head/sys/mips/mips X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/sys/mips/mips X-SVN-Commit-Revision: 328978 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.25 Precedence: list List-Id: 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, 07 Feb 2018 16:58:02 -0000 Author: arichardson Date: Wed Feb 7 16:58:01 2018 New Revision: 328978 URL: https://svnweb.freebsd.org/changeset/base/328978 Log: Fix compilation of mips_postboot_fixup() with a C11 compiler The _Alignas specifier must come before the declaration and not after. It works if _Alignas() expands to __attribute__(aligned(x)) which was the only case I tested before. Approved By: jhb (mentor) Modified: head/sys/mips/mips/machdep.c Modified: head/sys/mips/mips/machdep.c ============================================================================== --- head/sys/mips/mips/machdep.c Wed Feb 7 16:57:10 2018 (r328977) +++ head/sys/mips/mips/machdep.c Wed Feb 7 16:58:01 2018 (r328978) @@ -387,7 +387,7 @@ mips_postboot_fixup(void) * We store u_long sized objects into the reload area, so the array * must be so aligned. The standard allows any alignment for char data. */ - static char fake_preload[256] _Alignas(_Alignof(u_long)); + _Alignas(_Alignof(u_long)) static char fake_preload[256]; caddr_t preload_ptr = (caddr_t)&fake_preload[0]; size_t size = 0; From owner-svn-src-head@freebsd.org Wed Feb 7 17:09:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0487F15BF2; Wed, 7 Feb 2018 17:09:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A27D473387; Wed, 7 Feb 2018 17:09:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D3D11A64; Wed, 7 Feb 2018 17:09:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17H9C5w003265; Wed, 7 Feb 2018 17:09:12 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17H9Ccu003264; Wed, 7 Feb 2018 17:09:12 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <201802071709.w17H9Ccu003264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 7 Feb 2018 17:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328979 - head/usr.bin/lex X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.bin/lex X-SVN-Commit-Revision: 328979 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.25 Precedence: list List-Id: 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, 07 Feb 2018 17:09:13 -0000 Author: arichardson Date: Wed Feb 7 17:09:12 2018 New Revision: 328979 URL: https://svnweb.freebsd.org/changeset/base/328979 Log: Fix broken SPDX comment in usr.bin/lex/initparse.c Approved By: jhb (mentor) Modified: head/usr.bin/lex/initparse.c Modified: head/usr.bin/lex/initparse.c ============================================================================== --- head/usr.bin/lex/initparse.c Wed Feb 7 16:58:01 2018 (r328978) +++ head/usr.bin/lex/initparse.c Wed Feb 7 17:09:12 2018 (r328979) @@ -17,7 +17,7 @@ static const char yysccsid[] = "@(#)yaccpar 1.9 (Berke #define YYPURE 0 #line 35 "parse.y" -/ * SPDX-License-Identifier: BSD-2-Clause */ +/* SPDX-License-Identifier: BSD-2-Clause */ /* Copyright (c) 1990 The Regents of the University of California. */ /* All rights reserved. */ From owner-svn-src-head@freebsd.org Wed Feb 7 17:44:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B55EBF17FF1; Wed, 7 Feb 2018 17:44:33 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 642BB74A76; Wed, 7 Feb 2018 17:44:33 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id CF728D00350; Wed, 7 Feb 2018 12:44:31 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w17HiTpx063163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 18:44:29 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w17HiTwi063162; Wed, 7 Feb 2018 18:44:29 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 18:44:29 +0100 From: Peter Holm To: Gleb Smirnoff Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207174429.GA63039@x2.osted.lan> References: <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> <20180207164619.GK1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207164619.GK1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 17:44:34 -0000 On Wed, Feb 07, 2018 at 08:46:19AM -0800, Gleb Smirnoff wrote: > On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: > P> On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: > P> > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: > P> > T> Hi Peter, > P> > T> > P> > T> can you please try this patch? In either case success > P> > T> or not, please provide me with dmesg. Thanks a lot! > P> > > P> > Sorry, patch was missing one file. 99.9% this is a no-op, > P> > but better use full patch. > > Let's do one more attempt. I found where I miss one keg. > Yes, that boots after two tweaks to the patch: #define DIAGNOSTIC (already defined in my build) printf("ksize %d zsize %d slab %lu\n", ksize, zsize, sizeof(struct uma_slab)); (lu -> u) GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2018 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 #4 r328956M: Wed Feb 7 18:28:57 CET 2018 pho@x4.osted.lan:/usr/src/sys/i386/compile/PHO i386 FreeBSD clang version 6.0.0 (branches/release_60 321788) (based on LLVM 6.0.0) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. ksize 204 zsize 292 slab 88 boot_pages master 1 boot_pages zones 3 boot_pages kegs 5 boot_pages hash 6 boot_pages vmem 7 boot_pages kmap 8 Entering uma_startup with 10 boot pages configured startup_alloc from "UMA Kegs", 9 boot pages left startup_alloc from "UMA Zones", 8 boot pages left startup_alloc from "UMA Hash", 7 boot pages left startup_alloc from "UMA Zones", 6 boot pages left startup_alloc from "vmem btag", 5 boot pages left startup_alloc from "MAP", 4 boot pages left startup_alloc from "UMA Kegs", 3 boot pages left startup_alloc from "KMAP ENTRY", 2 boot pages left startup_alloc from "vmem", 1 boot pages left Entering uma_startup1 with 0 boot pages left VT(vga): resolution 640x480 CPU: AMD Phenom(tm) 9150e Quad-Core Processor (1800.02-MHz 686-class CPU) Origin="AuthenticAMD" Id=0x100f23 Family=0x10 Model=0x2 Stepping=3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x7ff SVM: NP,NAsids=64 TSC: P-state invariant real memory = 8589934592 (8192 MB) avail memory = 3525746688 (3362 MB) Event timer "LAPIC" quality 100 ACPI APIC Table: <060508 APIC1048> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) random: unblocking device. ioapic0 irqs 0-23 on motherboard SMP: AP CPU #1 Launched! SMP: AP CPU #3 Launched! SMP: AP CPU #2 Launched! Timecounter "TSC" frequency 1800017912 Hz quality 800 random: entropy device external interface kbd1 at kbdmux0 [ath_hal] loaded module_register_init: MOD_LOAD (vesa, 0xc11af130, 0) error 19 nexus0 vtvga0: on motherboard cryptosoft0: on motherboard acpi0: <060508 RSDT1048> on motherboard acpi0: Power Button (fixed) cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 attimer0: port 0x40-0x43 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 atrtc0: port 0x70-0x71 irq 8 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 pcib1: at device 1.0 on pci0 pci1: on pcib1 vgapci0: port 0xc000-0xc0ff mem 0xf0000000-0xf7ffffff,0xfe9f0000-0xfe9fffff,0xfe800000-0xfe8fffff irq 18 at device 5.0 on pci1 vgapci0: Boot video device hdac0: mem 0xfe9e8000-0xfe9ebfff irq 19 at device 5.2 on pci1 pcib2: at device 7.0 on pci0 pci2: on pcib2 re0: port 0xd800-0xd8ff mem 0xfeaff000-0xfeafffff irq 19 at device 0.0 on pci2 re0: Using 1 MSI message re0: Chip rev. 0x38000000 re0: MAC rev. 0x00000000 miibus0: on re0 rgephy0: PHY 1 on miibus0 rgephy0: none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow re0: Using defaults for TSO: 65518/35/2048 re0: Ethernet address: 00:21:85:15:33:7d ahci0: port 0xb000-0xb007,0xa000-0xa003,0x9000-0x9007,0x8000-0x8003,0x7000-0x700f mem 0xfe7ff800-0xfe7ffbff irq 22 at device 18.0 on pci0 ahci0: AHCI v1.10 with 4 3Gbps ports, Port Multiplier supported ahci0: quirks=0x7000 ahcich0: at channel 0 on ahci0 ahcich1: at channel 1 on ahci0 ahcich2: at channel 2 on ahci0 ahcich3: at channel 3 on ahci0 ohci0: mem 0xfe7fe000-0xfe7fefff irq 16 at device 19.0 on pci0 usbus0 on ohci0 usbus0: 12Mbps Full Speed USB v1.0 ohci1: mem 0xfe7fd000-0xfe7fdfff irq 17 at device 19.1 on pci0 usbus1 on ohci1 usbus1: 12Mbps Full Speed USB v1.0 ohci2: mem 0xfe7fc000-0xfe7fcfff irq 18 at device 19.2 on pci0 usbus2 on ohci2 usbus2: 12Mbps Full Speed USB v1.0 ohci3: mem 0xfe7fb000-0xfe7fbfff irq 17 at device 19.3 on pci0 usbus3 on ohci3 usbus3: 12Mbps Full Speed USB v1.0 ohci4: mem 0xfe7fa000-0xfe7fafff irq 18 at device 19.4 on pci0 usbus4 on ohci4 usbus4: 12Mbps Full Speed USB v1.0 ehci0: mem 0xfe7ff000-0xfe7ff0ff irq 19 at device 19.5 on pci0 ehci0: AMD SB600/700 quirk applied usbus5: EHCI version 1.0 usbus5 on ehci0 usbus5: 480Mbps High Speed USB v2.0 atapci0: port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xff00-0xff0f at device 20.1 on pci0 ata0: at channel 0 on atapci0 hdac1: mem 0xfe7f4000-0xfe7f7fff irq 16 at device 20.2 on pci0 isab0: at device 20.3 on pci0 isa0: on isab0 pcib3: at device 20.4 on pci0 pci3: on pcib3 pci3: at device 6.0 (no driver attached) amdtemp0: on hostb4 amdtemp0: Erratum 319: temperature measurement may be inaccurate acpi_button0: on acpi0 uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 uart0: console (115200,n,8,1) fdc0: port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 atkbdc0: at port 0x60,0x64 on isa0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] ppc0: parallel port not found. hwpstate0: on cpu0 NULL mp in getnewvnode(9), tag crossmp Timecounters tick every 1.000 msec hdacc0: at cad 0 on hdac0 hdaa0: at nid 1 on hdacc0 pcm0: at nid 3 on hdaa0 hdacc1: at cad 3 on hdac1 hdaa1: at nid 1 on hdacc1 pcm1: at nid 20,22,21,23 and 24,26 on hdaa1 pcm2: at nid 27 and 25 on hdaa1 pcm3: at nid 30 on hdaa1 ugen1.1: at usbus1 ugen0.1: at usbus0 uhub0: ugen2.1: at usbus2 ugen5.1: at usbus5 on usbus1 uhub2: on usbus0 uhub3: on usbus2 uhub1: on usbus5 ugen4.1: at usbus4 ugen3.1: at usbus3 uhub4: Expensive timeout(9) function: 0xc05fdc10(0xd5ff9000) 0.009115125 s (aprobe0:ahcich0:0:15:0): NOP FLUSHQUEUE. ACB: 00 00 00 00 00 00 00 00 00 00 00 00 on usbus4 (aprobe0:ahcich0:0:15:0): CAM status: Command timeout uhub5: (aprobe0:ahcich0:0:15:0): Error 5, Retries exhausted on usbus3 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA8-ACS SATA 2.x device ada0: Serial Number 9VMJ99G5 ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 476940MB (976773168 512 byte sectors) cd0 at ata0 bus 0 scbus4 target 1 lun 0 cd0: <_NEC DVD_RW ND-4550A 1.06> Removable CD-ROM SCSI device cd0: 33.300MB/s transfers (UDMA2, ATAPI 12bytes, PIO 65534bytes) cd0: Att WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Trying to mount root from ufs:/dev/ada0s1a [rw]... uhub3: 2 ports with 2 removable, self powered uhub0: 2 ports with 2 removable, self powered uhub2: 2 ports with 2 removable, self powered uhub5: 2 ports with 2 removable, self powered uhub4: 2 ports with 2 removable, self powered Setting hostuuid: 00000000-0000-0000-0000-00218515337d. Setting hostid: 0x6b64ac17. Starting ddb. eval: limits: not found /etc/rc: WARNING: failed to start ddb warning: total configured swap (4194304 pages) exceeds maximum recommended amount (1725680 pages). warning: increase kern.maxswzone or reduce amount of swap. Starting file system checks: /dev/ada0s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ada0s1a: clean, 491799 free (2239 frags, 61195 blocks, 0.2% fragmentation) /dev/ada0s1f: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ada0s1f: clean, 849938 free (11154 frags, 104848 blocks, 1.1% fragmentation) /dev/label/tmp: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/label/tmp: clean, 46221764 free (41964 frags, 5772475 blocks, 0.0% fragmentation) /dev/ada0s1d: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ada0s1d: clean, 1924117 free (393013 frags, 191388 blocks, 3.9% fragmentation) /dev/ada0s1e: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ada0s1e: clean, 5609067 free (232203 frags, 672108 blocks, 0.9% fragmentation) Mounting local filesystems:. ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg /usr/local/arduino/lib /usr/local/lib/compat /usr/local/lib/compat/pkg /usr/local/lib/gcc49 /usr/local/lib/mysql /usr/local/lib/nss /usr/local/lib/perl5/5.24/mach/CORE /usr/local/lib/pth /usr/local/lib/qt4 /usr/local/llvm37/lib /usr/local/llvm39/lib a.out ldconfig path: /usr/lib/aout /usr/lib/compat/aout Setting hostname: x4.osted.lan. Setting up harvesting: [UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED Feeding entropy: . uhub1: 10 ports with 10 removable, self powered re0: link state changed to DOWN Starting Network: lo0 re0. lo0: flags=8049 metric 0 mtu 16384 options=600003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 inet 127.0.0.1 netmask 0xff000000 nd6 options=21 groups: lo re0: flags=8843 metric 0 mtu 1500 options=8209b ether 00:21:85:15:33:7d inet 192.168.1.101 netmask 0xffffff00 broadcast 192.168.1.255 nd6 options=29 media: Ethernet autoselect (none) status: no carrier Starting devd. add host 127.0.0.1: gateway lo0 fib 0: route already in table add net default: gateway 192.168.1.1 add host ::1: gateway lo0 fib 0: route already in table add net fe80::: gateway ::1 add net ff02::: gateway ::1 add net ::ffff:0.0.0.0: gateway ::1 add net ::0.0.0.0: gateway ::1 Creating and/or trimming log files. Starting syslogd. Starting rpcbind. NFS access cache time=60 Starting watchdogd. No core dumps found. Additional ABI support: linux. lock order reversal: 1st 0xcb1dc088 bufwait (bufwait) @ kern/vfs_bio.c:3564 2nd 0xd86c4600 dirhash (dirhash) @ ufs/ufs/ufs_dirhash.c:289 stack backtrace: #0 0xc0cdf5e1 at witness_debugger+0x81 #1 0xc0cdf4a8 at witness_checkorder+0xcd8 #2 0xc0c80b34 at _sx_xlock+0x64 #3 0xc0f9b273 at ufsdirhash_add+0x53 #4 0xc0f9fddf at ufs_direnter+0x4df #5 0xc0fa8f52 at ufs_mkdir+0x852 #6 0xc1285b86 at VOP_MKDIR_APV+0xf6 #7 0xc0d5c5de at kern_mkdirat+0x21e #8 0xc0d5c3b1 at sys_mkdir+0x31 #9 0xc1251a1e at syscall+0x6ee #10 0xc123b0eb at Xint0x80_syscall+0x2b Clearing /tmp (X related). Starting nfsuserd. Starting mountd. Starting nfsd. Starting statd. Starting lockd. Recovering vi editor sessions:. Updating motd:. Mounting late filesystems:. Starting ntpd. Starting powerd. Starting smartd. Feb 7 18:32:31 x4 smartd[639]: Device: /dev/ada0, WARNING: A firmware update for this drive may be available, Feb 7 18:32:31 x4 smartd[639]: see the following Seagate web pages: Feb 7 18:32:31 x4 smartd[639]: http://knowledge.seagate.com/articles/en_US/FAQ/207931en Feb 7 18:32:31 x4 smartd[639]: http://knowledge.seagate.com/articles/en_US/FAQ/213891en Configuring vt: keymap blanktime. Performing sanity check on sshd configuration. Starting sshd. Starting sendmail_submit. Starting sendmail_msp_queue. Starting cron. Local package initialization: backuplock order reversal: 1st 0xd87d3a0c ufs (ufs) @ kern/vfs_subr.c:2607 2nd 0xcb1dc088 bufwait (bufwait) @ ufs/ffs/ffs_vnops.c:282 3rd 0xdbe55cdc ufs (ufs) @ kern/vfs_subr.c:2607 stack backtrace: #0 0xc0cdf5e1 at witness_debugger+0x81 #1 0xc0cdf4a8 at witness_checkorder+0xcd8 #2 0xc0c4b3e6 at __lockmgr_args+0x796 #3 0xc0f95837 at ffs_lock+0xa7 #4 0xc128698a at VOP_LOCK1_APV+0xda #5 0xc0d5fb91 at _vn_lock+0x61 #6 0xc0d4ba81 at vget+0xc1 #7 0xc0d3ccf2 at vfs_hash_get+0xd2 #8 0xc0f90534 at ffs_vgetf+0x44 #9 0xc0f854d7 at softdep_sync_buf+0x357 #10 0xc0f966df at ffs_syncvnode+0x2df #11 0xc0f939a8 at ffs_sync+0x248 #12 0xc0d61324 at vfs_write_suspend+0x1c4 #13 0xc0d61555 at vfs_write_suspend_umnt+0x45 #14 0xc0f93084 at ffs_unmount+0xb4 #15 0xc0d43413 at dounmount+0x583 #16 0xc0d42d85 at sys_unmount+0x315 #17 0xc1251a1e at syscall+0x6ee lock order reversal: 1st 0xd87d419c ufs (ufs) @ kern/vfs_mount.c:1280 2nd 0xd85b946c devfs (devfs) @ ufs/ffs/ffs_softdep.c:1912 stack backtrace: #0 0xc0cdf5e1 at witness_debugger+0x81 #1 0xc0cdf4a8 at witness_checkorder+0xcd8 #2 0xc0c4ab87 at lockmgr_lock_fast_path+0x1c7 #3 0xc0d38e2b at vop_stdlock+0x3b #4 0xc128698a at VOP_LOCK1_APV+0xda #5 0xc0d5fb91 at _vn_lock+0x61 #6 0xc0f729f5 at softdep_flushworklist+0x65 #7 0xc0f93c1a at ffs_sync+0x4ba #8 0xc0d61324 at vfs_write_suspend+0x1c4 #9 0xc0d61555 at vfs_write_suspend_umnt+0x45 #10 0xc0f93084 at ffs_unmount+0xb4 #11 0xc0d43413 at dounmount+0x583 #12 0xc0d42d85 at sys_unmount+0x315 #13 0xc1251a1e at syscall+0x6ee #14 0xc123b0eb at Xint0x80_syscall+0x2b ** /dev/label/tmp ** Last Mounted on /tmp ** Phase 1 - Check Blocks and Sizes ** Phase 2 - Check Pathnames - Peter From owner-svn-src-head@freebsd.org Wed Feb 7 17:45:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 139B0F1808B; Wed, 7 Feb 2018 17:45:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 973BF74B9C; Wed, 7 Feb 2018 17:45:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w17HixlN013368 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 09:44:59 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w17HixPS013367; Wed, 7 Feb 2018 09:44:59 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 7 Feb 2018 09:44:59 -0800 From: Gleb Smirnoff To: Peter Holm , jtl@FreeBSD.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207174459.GL1063@FreeBSD.org> References: <20180206182839.GB1063@FreeBSD.org> <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> <20180207164619.GK1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ILuaRSyQpoVaJ1HG" Content-Disposition: inline In-Reply-To: <20180207164619.GK1063@FreeBSD.org> User-Agent: Mutt/1.9.3 (2018-01-21) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 17:45:02 -0000 --ILuaRSyQpoVaJ1HG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 07, 2018 at 08:46:19AM -0800, Gleb Smirnoff wrote: T> On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: T> P> On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: T> P> > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: T> P> > T> Hi Peter, T> P> > T> T> P> > T> can you please try this patch? In either case success T> P> > T> or not, please provide me with dmesg. Thanks a lot! T> P> > T> P> > Sorry, patch was missing one file. 99.9% this is a no-op, T> P> > but better use full patch. T> T> Let's do one more attempt. I found where I miss one keg. The previous patch will probably work for Peter, but not for Jonathan. Here is an updated one. -- Gleb Smirnoff --ILuaRSyQpoVaJ1HG Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="boot_pages.diff" Index: sys/kern/subr_vmem.c =================================================================== --- sys/kern/subr_vmem.c (revision 328955) +++ sys/kern/subr_vmem.c (working copy) @@ -667,7 +667,8 @@ int vmem_startup_count(void) { - return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); + return (howmany(BT_MAXALLOC, + UMA_SLAB_SPACE / sizeof(struct vmem_btag))); } #endif Index: sys/vm/uma_core.c =================================================================== --- sys/vm/uma_core.c (revision 328955) +++ sys/vm/uma_core.c (working copy) @@ -96,6 +96,7 @@ __FBSDID("$FreeBSD$"); #ifdef DEBUG_MEMGUARD #include #endif +#define DIAGNOSTIC /* * This is the zone and keg from which all zones are spawned. @@ -1102,7 +1103,7 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, in } mtx_unlock(&uma_boot_pages_mtx); if (booted < BOOT_PAGEALLOC) - panic("UMA: Increase vm.boot_pages"); + panic("UMA zone \"%s\": Increase vm.boot_pages", zone->uz_name); /* * Now that we've booted reset these users to their real allocator. */ @@ -1785,6 +1786,8 @@ zone_foreach(void (*zfunc)(uma_zone_t)) * zone of zones and zone of kegs are accounted separately. */ #define UMA_BOOT_ZONES 11 +/* Zone of zones and zone of kegs have arbitrary alignemnt. */ +#define UMA_BOOT_ALIGN 32 static int zsize, ksize; int uma_startup_count(int zones) @@ -1796,28 +1799,43 @@ uma_startup_count(int zones) zsize = sizeof(struct uma_zone) + (sizeof(struct uma_cache) * (mp_maxid + 1)) + (sizeof(struct uma_zone_domain) * vm_ndomains); + printf("ksize %d zsize %d slab %lu\n", ksize, zsize, sizeof(struct uma_slab)); - /* Memory for the zone of zones and zone of kegs. */ + /* + * Memory for the zone of kegs and its keg, + * and for zone of zones. + */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); + printf("boot_pages master %d\n", pages); zones += UMA_BOOT_ZONES; - /* Memory for startup zones, UMA and VM, ... */ + /* Memory for the rest of startup zones, UMA and VM, ... */ if (zsize > UMA_SLAB_SIZE) - pages += zones * howmany(zsize, UMA_SLAB_SIZE); + pages += zones * howmany(roundup2(zsize, UMA_BOOT_ALIGN), + UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, + UMA_SLAB_SPACE / roundup2(zsize, UMA_BOOT_ALIGN)); + printf("boot_pages zones %d\n", pages); - /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + /* ... and their kegs. Note that zone of zones allocates a keg! */ + pages += howmany(zones + 1, + UMA_SLAB_SPACE / roundup2(ksize, UMA_BOOT_ALIGN)); + printf("boot_pages kegs %d\n", pages); /* - * Take conservative approach that every zone - * is going to allocate hash. + * Most of startup zones are not going to be offpages, that's + * why we use UMA_SLAB_SPACE instead of UMA_SLAB_SIZE in all + * calculations. Some large bucket zones will be offpage, and + * thus will allocate hashes. We take conservative approach + * and assume that all zones may allocate hash. This may give + * us some positive imprecision, usually an extra single page. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); + printf("boot_pages hash %d\n", pages); return (pages); } @@ -1856,7 +1874,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = masterkeg; - args.align = 32 - 1; + args.align = UMA_BOOT_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(kegs, zsize, &args, M_WAITOK); @@ -1871,7 +1889,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = NULL; - args.align = 32 - 1; + args.align = UMA_BOOT_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(zones, zsize, &args, M_WAITOK); Index: sys/vm/uma_int.h =================================================================== --- sys/vm/uma_int.h (revision 328955) +++ sys/vm/uma_int.h (working copy) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Index: sys/vm/vm_page.c =================================================================== --- sys/vm/vm_page.c (revision 328955) +++ sys/vm/vm_page.c (working copy) @@ -518,8 +518,11 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); + printf("boot_pages vmem %d\n", boot_pages); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); + printf("boot_pages kmap %d\n", boot_pages); /* * Before going fully functional kmem_init() does allocation --ILuaRSyQpoVaJ1HG-- From owner-svn-src-head@freebsd.org Wed Feb 7 18:25:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 389A7F1AF08; Wed, 7 Feb 2018 18:25:07 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDE3B76D68; Wed, 7 Feb 2018 18:25:06 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id B0633D00AD8; Wed, 7 Feb 2018 13:25:05 -0500 (EST) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.14.9/8.14.9) with ESMTP id w17IP3B7063975 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 7 Feb 2018 19:25:04 +0100 (CET) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.14.9/8.14.9/Submit) id w17IP31c063974; Wed, 7 Feb 2018 19:25:03 +0100 (CET) (envelope-from pho) Date: Wed, 7 Feb 2018 19:25:03 +0100 From: Peter Holm To: Gleb Smirnoff Cc: jtl@FreeBSD.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r328916 - in head/sys: kern vm Message-ID: <20180207182503.GA63930@x2.osted.lan> References: <20180206193430.GA36054@x2.osted.lan> <20180206221555.GC1063@FreeBSD.org> <20180206225244.GA40529@x2.osted.lan> <20180206230635.GE1063@FreeBSD.org> <20180206232521.GA41396@x2.osted.lan> <20180207004213.GG1063@FreeBSD.org> <20180207004549.GH1063@FreeBSD.org> <20180207064617.GA49792@x2.osted.lan> <20180207164619.GK1063@FreeBSD.org> <20180207174459.GL1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180207174459.GL1063@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 18:25:07 -0000 On Wed, Feb 07, 2018 at 09:44:59AM -0800, Gleb Smirnoff wrote: > On Wed, Feb 07, 2018 at 08:46:19AM -0800, Gleb Smirnoff wrote: > T> On Wed, Feb 07, 2018 at 07:46:17AM +0100, Peter Holm wrote: > T> P> On Tue, Feb 06, 2018 at 04:45:49PM -0800, Gleb Smirnoff wrote: > T> P> > On Tue, Feb 06, 2018 at 04:42:13PM -0800, Gleb Smirnoff wrote: > T> P> > T> Hi Peter, > T> P> > T> > T> P> > T> can you please try this patch? In either case success > T> P> > T> or not, please provide me with dmesg. Thanks a lot! > T> P> > > T> P> > Sorry, patch was missing one file. 99.9% this is a no-op, > T> P> > but better use full patch. > T> > T> Let's do one more attempt. I found where I miss one keg. > > The previous patch will probably work for Peter, but not for > Jonathan. Here is an updated one. > Yes, it boots on i386. - Peter From owner-svn-src-head@freebsd.org Wed Feb 7 18:32:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B67F1B868; Wed, 7 Feb 2018 18:32:52 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84D437763D; Wed, 7 Feb 2018 18:32:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FAAE28E8; Wed, 7 Feb 2018 18:32:52 +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 w17IWqkG049684; Wed, 7 Feb 2018 18:32:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IWqQp049679; Wed, 7 Feb 2018 18:32:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802071832.w17IWqQp049679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 7 Feb 2018 18:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328982 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 328982 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.25 Precedence: list List-Id: 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, 07 Feb 2018 18:32:53 -0000 Author: glebius Date: Wed Feb 7 18:32:51 2018 New Revision: 328982 URL: https://svnweb.freebsd.org/changeset/base/328982 Log: Fix three miscalculations in amount of boot pages: o Most of startup zones have struct uma_slab embedded into the slab, so provide macro UMA_SLAB_SPACE and use it instead of UMA_SLAB_SIZE, when calculating how many pages would certain kind of allocations require. Some zones are offpage, so we might have a positive inaccuracy. o The keg for the zone of zones is allocated "dynamically", so we need +1 when calculating amount of pages for kegs. [1] o The zones of zones and zones of kegs have arbitrary alignment of 32, and this also needs to be accounted for. [2] While here, spread more comments and improve diagnostic messages. Reported by: pho [1], jtl [2] Modified: head/sys/kern/subr_vmem.c head/sys/vm/uma_core.c head/sys/vm/uma_int.h head/sys/vm/vm_page.c Modified: head/sys/kern/subr_vmem.c ============================================================================== --- head/sys/kern/subr_vmem.c Wed Feb 7 18:18:33 2018 (r328981) +++ head/sys/kern/subr_vmem.c Wed Feb 7 18:32:51 2018 (r328982) @@ -667,7 +667,8 @@ int vmem_startup_count(void) { - return (howmany(BT_MAXALLOC, UMA_SLAB_SIZE / sizeof(struct vmem_btag))); + return (howmany(BT_MAXALLOC, + UMA_SLAB_SPACE / sizeof(struct vmem_btag))); } #endif Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Feb 7 18:18:33 2018 (r328981) +++ head/sys/vm/uma_core.c Wed Feb 7 18:32:51 2018 (r328982) @@ -1102,7 +1102,7 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do } mtx_unlock(&uma_boot_pages_mtx); if (booted < BOOT_PAGEALLOC) - panic("UMA: Increase vm.boot_pages"); + panic("UMA zone \"%s\": Increase vm.boot_pages", zone->uz_name); /* * Now that we've booted reset these users to their real allocator. */ @@ -1785,6 +1785,8 @@ zone_foreach(void (*zfunc)(uma_zone_t)) * zone of zones and zone of kegs are accounted separately. */ #define UMA_BOOT_ZONES 11 +/* Zone of zones and zone of kegs have arbitrary alignment. */ +#define UMA_BOOT_ALIGN 32 static int zsize, ksize; int uma_startup_count(int zones) @@ -1797,26 +1799,36 @@ uma_startup_count(int zones) (sizeof(struct uma_cache) * (mp_maxid + 1)) + (sizeof(struct uma_zone_domain) * vm_ndomains); - /* Memory for the zone of zones and zone of kegs. */ + /* + * Memory for the zone of kegs and its keg, + * and for zone of zones. + */ pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); zones += UMA_BOOT_ZONES; - /* Memory for startup zones, UMA and VM, ... */ + /* Memory for the rest of startup zones, UMA and VM, ... */ if (zsize > UMA_SLAB_SIZE) - pages += zones * howmany(zsize, UMA_SLAB_SIZE); + pages += zones * howmany(roundup2(zsize, UMA_BOOT_ALIGN), + UMA_SLAB_SIZE); else - pages += howmany(zones, UMA_SLAB_SIZE / zsize); + pages += howmany(zones, + UMA_SLAB_SPACE / roundup2(zsize, UMA_BOOT_ALIGN)); - /* ... and their kegs. */ - pages += howmany(zones, UMA_SLAB_SIZE / ksize); + /* ... and their kegs. Note that zone of zones allocates a keg! */ + pages += howmany(zones + 1, + UMA_SLAB_SPACE / roundup2(ksize, UMA_BOOT_ALIGN)); /* - * Take conservative approach that every zone - * is going to allocate hash. + * Most of startup zones are not going to be offpages, that's + * why we use UMA_SLAB_SPACE instead of UMA_SLAB_SIZE in all + * calculations. Some large bucket zones will be offpage, and + * thus will allocate hashes. We take conservative approach + * and assume that all zones may allocate hash. This may give + * us some positive inaccuracy, usually an extra single page. */ - pages += howmany(zones, UMA_SLAB_SIZE / + pages += howmany(zones, UMA_SLAB_SPACE / (sizeof(struct slabhead *) * UMA_HASH_SIZE_INIT)); return (pages); @@ -1856,7 +1868,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = masterkeg; - args.align = 32 - 1; + args.align = UMA_BOOT_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(kegs, zsize, &args, M_WAITOK); @@ -1871,7 +1883,7 @@ uma_startup(void *mem, int npages) args.uminit = zero_init; args.fini = NULL; args.keg = NULL; - args.align = 32 - 1; + args.align = UMA_BOOT_ALIGN - 1; args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(zones, zsize, &args, M_WAITOK); Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Wed Feb 7 18:18:33 2018 (r328981) +++ head/sys/vm/uma_int.h Wed Feb 7 18:32:51 2018 (r328982) @@ -138,6 +138,11 @@ #define UMA_MAX_WASTE 10 /* + * Size of memory in a not offpage slab available for actual items. + */ +#define UMA_SLAB_SPACE (UMA_SLAB_SIZE - sizeof(struct uma_slab)) + +/* * I doubt there will be many cases where this is exceeded. This is the initial * size of the hash table for uma_slabs that are managed off page. This hash * does expand by powers of two. Currently it doesn't get smaller. Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Feb 7 18:18:33 2018 (r328981) +++ head/sys/vm/vm_page.c Wed Feb 7 18:32:51 2018 (r328982) @@ -519,7 +519,8 @@ vm_page_startup(vm_offset_t vaddr) /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); /* vm_map_startup() calls uma_prealloc(). */ - boot_pages += howmany(MAX_KMAP, UMA_SLAB_SIZE / sizeof(struct vm_map)); + boot_pages += howmany(MAX_KMAP, + UMA_SLAB_SPACE / sizeof(struct vm_map)); /* * Before going fully functional kmem_init() does allocation From owner-svn-src-head@freebsd.org Wed Feb 7 18:33:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF79DF1B9A7; Wed, 7 Feb 2018 18:33:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 736D07786A; Wed, 7 Feb 2018 18:33: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E39928EA; Wed, 7 Feb 2018 18:33: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 w17IXkwa049903; Wed, 7 Feb 2018 18:33:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IXkDe049902; Wed, 7 Feb 2018 18:33:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802071833.w17IXkDe049902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 18:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328983 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 328983 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.25 Precedence: list List-Id: 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, 07 Feb 2018 18:33:46 -0000 Author: imp Date: Wed Feb 7 18:33:46 2018 New Revision: 328983 URL: https://svnweb.freebsd.org/changeset/base/328983 Log: Fix cut and pasted comments to reflect differences in code from the original source. Sponsored by: Netflix Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Wed Feb 7 18:32:51 2018 (r328982) +++ head/sys/cam/nvme/nvme_da.c Wed Feb 7 18:33:46 2018 (r328983) @@ -1094,19 +1094,25 @@ ndaflush(void) CAM_PERIPH_FOREACH(periph, &ndadriver) { softc = (struct nda_softc *)periph->softc; + if (SCHEDULER_STOPPED()) { - /* If we paniced with the lock held, do not recurse. */ + /* + * If we paniced with the lock held or the periph is not + * open, do not recurse. Otherwise, call ndadump since + * that avoids the sleeping cam_periph_getccb does if no + * CCBs are available. + */ if (!cam_periph_owned(periph) && (softc->flags & NDA_FLAG_OPEN)) { ndadump(softc->disk, NULL, 0, 0, 0); } continue; } - cam_periph_lock(periph); + /* - * We only sync the cache if the drive is still open, and - * if the drive is capable of it.. + * We only sync the cache if the drive is still open */ + cam_periph_lock(periph); if ((softc->flags & NDA_FLAG_OPEN) == 0) { cam_periph_unlock(periph); continue; From owner-svn-src-head@freebsd.org Wed Feb 7 18:33:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F6CBF1B9F0; Wed, 7 Feb 2018 18:33:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05E8877954; Wed, 7 Feb 2018 18:33:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00E0F28EB; Wed, 7 Feb 2018 18:33: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 w17IXr6D049956; Wed, 7 Feb 2018 18:33:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IXrTU049955; Wed, 7 Feb 2018 18:33:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802071833.w17IXrTU049955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 18:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328984 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 328984 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.25 Precedence: list List-Id: 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, 07 Feb 2018 18:33:54 -0000 Author: imp Date: Wed Feb 7 18:33:53 2018 New Revision: 328984 URL: https://svnweb.freebsd.org/changeset/base/328984 Log: Cull Atmel board configs no longer relevant. Remove most of the Atmel at91 boards. Most of them are no longer relevant or used by people. Kept ATMEL since it should work on all the boards that still work (I've not confirmed this, since I don't have all these boards). Also kept SAM9G20EK, since I have several boards that it is used on. If I've deleted a kernel in error, please let me know. Deleted: head/sys/arm/conf/BWCT head/sys/arm/conf/BWCT.hints head/sys/arm/conf/EB9200 head/sys/arm/conf/EB9200.hints head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/ETHERNUT5.hints head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/HL201.hints head/sys/arm/conf/KB920X head/sys/arm/conf/KB920X.hints head/sys/arm/conf/QILA9G20 head/sys/arm/conf/QILA9G20.hints head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9260EK.hints head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SAM9X25EK.hints head/sys/arm/conf/SN9G45 From owner-svn-src-head@freebsd.org Wed Feb 7 18:46:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E04E1F1C7EA; Wed, 7 Feb 2018 18:46:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F20E78652; Wed, 7 Feb 2018 18:46:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 860832ABC; Wed, 7 Feb 2018 18:46: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 w17Ik9kj055501; Wed, 7 Feb 2018 18:46:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Ik894055491; Wed, 7 Feb 2018 18:46:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071846.w17Ik894055491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 18:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328985 - head/sys/dev/usb/template X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb/template X-SVN-Commit-Revision: 328985 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.25 Precedence: list List-Id: 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, 07 Feb 2018 18:46:10 -0000 Author: hselasky Date: Wed Feb 7 18:46:08 2018 New Revision: 328985 URL: https://svnweb.freebsd.org/changeset/base/328985 Log: Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision when building stand/usb. Regression after r328194. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/template/usb_template_audio.c head/sys/dev/usb/template/usb_template_cdce.c head/sys/dev/usb/template/usb_template_kbd.c head/sys/dev/usb/template/usb_template_midi.c head/sys/dev/usb/template/usb_template_modem.c head/sys/dev/usb/template/usb_template_mouse.c head/sys/dev/usb/template/usb_template_msc.c head/sys/dev/usb/template/usb_template_mtp.c head/sys/dev/usb/template/usb_template_phone.c head/sys/dev/usb/template/usb_template_serialnet.c Modified: head/sys/dev/usb/template/usb_template_audio.c ============================================================================== --- head/sys/dev/usb/template/usb_template_audio.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_audio.c Wed Feb 7 18:46:08 2018 (r328985) @@ -475,4 +475,4 @@ audio_uninit(void *arg __unused) } SYSINIT(audio_init, SI_SUB_LOCK, SI_ORDER_FIRST, audio_init, NULL); -SYSUNINIT(audio_init, SI_SUB_LOCK, SI_ORDER_FIRST, audio_uninit, NULL); +SYSUNINIT(audio_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, audio_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_cdce.c ============================================================================== --- head/sys/dev/usb/template/usb_template_cdce.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_cdce.c Wed Feb 7 18:46:08 2018 (r328985) @@ -348,4 +348,4 @@ eth_uninit(void *arg __unused) } SYSINIT(eth_init, SI_SUB_LOCK, SI_ORDER_FIRST, eth_init, NULL); -SYSUNINIT(eth_init, SI_SUB_LOCK, SI_ORDER_FIRST, eth_uninit, NULL); +SYSUNINIT(eth_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, eth_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_kbd.c ============================================================================== --- head/sys/dev/usb/template/usb_template_kbd.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_kbd.c Wed Feb 7 18:46:08 2018 (r328985) @@ -289,4 +289,4 @@ kbd_uninit(void *arg __unused) } SYSINIT(kbd_init, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_init, NULL); -SYSUNINIT(kbd_init, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_uninit, NULL); +SYSUNINIT(kbd_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, kbd_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_midi.c ============================================================================== --- head/sys/dev/usb/template/usb_template_midi.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_midi.c Wed Feb 7 18:46:08 2018 (r328985) @@ -309,4 +309,4 @@ midi_uninit(void *arg __unused) } SYSINIT(midi_init, SI_SUB_LOCK, SI_ORDER_FIRST, midi_init, NULL); -SYSUNINIT(midi_init, SI_SUB_LOCK, SI_ORDER_FIRST, midi_uninit, NULL); +SYSUNINIT(midi_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, midi_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_modem.c ============================================================================== --- head/sys/dev/usb/template/usb_template_modem.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_modem.c Wed Feb 7 18:46:08 2018 (r328985) @@ -317,4 +317,4 @@ modem_uninit(void *arg __unused) } SYSINIT(modem_init, SI_SUB_LOCK, SI_ORDER_FIRST, modem_init, NULL); -SYSUNINIT(modem_init, SI_SUB_LOCK, SI_ORDER_FIRST, modem_uninit, NULL); +SYSUNINIT(modem_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, modem_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_mouse.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mouse.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_mouse.c Wed Feb 7 18:46:08 2018 (r328985) @@ -287,4 +287,4 @@ mouse_uninit(void *arg __unused) } SYSINIT(mouse_init, SI_SUB_LOCK, SI_ORDER_FIRST, mouse_init, NULL); -SYSUNINIT(mouse_init, SI_SUB_LOCK, SI_ORDER_FIRST, mouse_uninit, NULL); +SYSUNINIT(mouse_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, mouse_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_msc.c ============================================================================== --- head/sys/dev/usb/template/usb_template_msc.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_msc.c Wed Feb 7 18:46:08 2018 (r328985) @@ -257,4 +257,4 @@ msc_uninit(void *arg __unused) } SYSINIT(msc_init, SI_SUB_LOCK, SI_ORDER_FIRST, msc_init, NULL); -SYSUNINIT(msc_init, SI_SUB_LOCK, SI_ORDER_FIRST, msc_uninit, NULL); +SYSUNINIT(msc_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, msc_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_mtp.c ============================================================================== --- head/sys/dev/usb/template/usb_template_mtp.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_mtp.c Wed Feb 7 18:46:08 2018 (r328985) @@ -324,4 +324,4 @@ mtp_uninit(void *arg __unused) } SYSINIT(mtp_init, SI_SUB_LOCK, SI_ORDER_FIRST, mtp_init, NULL); -SYSUNINIT(mtp_init, SI_SUB_LOCK, SI_ORDER_FIRST, mtp_uninit, NULL); +SYSUNINIT(mtp_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, mtp_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_phone.c ============================================================================== --- head/sys/dev/usb/template/usb_template_phone.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_phone.c Wed Feb 7 18:46:08 2018 (r328985) @@ -500,4 +500,4 @@ phone_uninit(void *arg __unused) } SYSINIT(phone_init, SI_SUB_LOCK, SI_ORDER_FIRST, phone_init, NULL); -SYSUNINIT(phone_init, SI_SUB_LOCK, SI_ORDER_FIRST, phone_uninit, NULL); +SYSUNINIT(phone_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, phone_uninit, NULL); Modified: head/sys/dev/usb/template/usb_template_serialnet.c ============================================================================== --- head/sys/dev/usb/template/usb_template_serialnet.c Wed Feb 7 18:33:53 2018 (r328984) +++ head/sys/dev/usb/template/usb_template_serialnet.c Wed Feb 7 18:46:08 2018 (r328985) @@ -456,4 +456,4 @@ serialnet_uninit(void *arg __unused) } SYSINIT(serialnet_init, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_init, NULL); -SYSUNINIT(serialnet_init, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_uninit, NULL); +SYSUNINIT(serialnet_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, serialnet_uninit, NULL); From owner-svn-src-head@freebsd.org Wed Feb 7 18:49:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3F74F1CA9F; Wed, 7 Feb 2018 18:49:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3EE37886E; Wed, 7 Feb 2018 18:49:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A6742ACD; Wed, 7 Feb 2018 18:49: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 w17In6BU055637; Wed, 7 Feb 2018 18:49:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17In6Gq055636; Wed, 7 Feb 2018 18:49:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071849.w17In6Gq055636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 18:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328986 - head/stand/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/stand/usb X-SVN-Commit-Revision: 328986 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.25 Precedence: list List-Id: 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, 07 Feb 2018 18:49:07 -0000 Author: hselasky Date: Wed Feb 7 18:49:06 2018 New Revision: 328986 URL: https://svnweb.freebsd.org/changeset/base/328986 Log: Fix relative location of USB sources after recent move. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/stand/usb/usbcore.mk Modified: head/stand/usb/usbcore.mk ============================================================================== --- head/stand/usb/usbcore.mk Wed Feb 7 18:46:08 2018 (r328985) +++ head/stand/usb/usbcore.mk Wed Feb 7 18:49:06 2018 (r328986) @@ -32,7 +32,7 @@ # USBCOREDIR:= ${.PARSEDIR} -S=${USBCOREDIR}/../.. +S=${USBCOREDIR}/../../sys MACHDEP_DIRS= From owner-svn-src-head@freebsd.org Wed Feb 7 18:50:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4336CF1CC48; Wed, 7 Feb 2018 18:50:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E36A778A15; Wed, 7 Feb 2018 18:50:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE5762AD7; Wed, 7 Feb 2018 18:50:36 +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 w17IoaHk055762; Wed, 7 Feb 2018 18:50:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Ioa2a055761; Wed, 7 Feb 2018 18:50:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071850.w17Ioa2a055761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 18:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328987 - head/stand/kshim X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/stand/kshim X-SVN-Commit-Revision: 328987 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.25 Precedence: list List-Id: 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, 07 Feb 2018 18:50:37 -0000 Author: hselasky Date: Wed Feb 7 18:50:36 2018 New Revision: 328987 URL: https://svnweb.freebsd.org/changeset/base/328987 Log: A more definitions to kernel emulation shim in order to build stand/usb. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/stand/kshim/bsd_kernel.h Modified: head/stand/kshim/bsd_kernel.h ============================================================================== --- head/stand/kshim/bsd_kernel.h Wed Feb 7 18:49:06 2018 (r328986) +++ head/stand/kshim/bsd_kernel.h Wed Feb 7 18:50:36 2018 (r328987) @@ -50,6 +50,8 @@ #define USB_BUS_EXPLORE_PROC(bus) (usb_process + 0) #define USB_BUS_CONTROL_XFER_PROC(bus) (usb_process + 1) #define SYSCTL_DECL(...) +struct sysctl_ctx_list { +}; struct sysctl_req { void *newptr; }; @@ -59,6 +61,13 @@ struct sysctl_req { #define SYSCTL_INT(...) #define SYSCTL_UINT(...) #define SYSCTL_PROC(...) +#define SYSCTL_ADD_NODE(...) NULL +#define SYSCTL_ADD_U16(...) NULL +#define SYSCTL_ADD_PROC(...) NULL +#define sysctl_handle_int(...) EOPNOTSUPP +#define sysctl_handle_string(...) EOPNOTSUPP +#define sysctl_ctx_init(ctx) do { (void)(ctx); } while (0) +#define sysctl_ctx_free(ctx) do { (void)(ctx); } while (0) #define TUNABLE_INT(...) #define MALLOC_DECLARE(...) #define MALLOC_DEFINE(...) @@ -177,6 +186,10 @@ struct uio; struct thread; struct malloc_type; struct usb_process; + +#ifndef INT32_MAX +#define INT32_MAX 0x7fffffff +#endif #ifndef HAVE_STANDARD_DEFS #define _UINT8_T_DECLARED From owner-svn-src-head@freebsd.org Wed Feb 7 18:59:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C47F1D520; Wed, 7 Feb 2018 18:59:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA5547906F; Wed, 7 Feb 2018 18:59:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0B552C66; Wed, 7 Feb 2018 18:59:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17IxtHx060810; Wed, 7 Feb 2018 18:59:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IxtxX060804; Wed, 7 Feb 2018 18:59:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802071859.w17IxtxX060804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 7 Feb 2018 18:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328988 - in head/sys: conf modules/ipfw netinet netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: conf modules/ipfw netinet netpfil/ipfw X-SVN-Commit-Revision: 328988 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.25 Precedence: list List-Id: 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, 07 Feb 2018 18:59:56 -0000 Author: ae Date: Wed Feb 7 18:59:54 2018 New Revision: 328988 URL: https://svnweb.freebsd.org/changeset/base/328988 Log: Rework ipfw dynamic states implementation to be lockless on fast path. o added struct ipfw_dyn_info that keeps all needed for ipfw_chk and for dynamic states implementation information; o added DYN_LOOKUP_NEEDED() macro that can be used to determine the need of new lookup of dynamic states; o ipfw_dyn_rule now becomes obsolete. Currently it used to pass information from kernel to userland only. o IPv4 and IPv6 states now described by different structures dyn_ipv4_state and dyn_ipv6_state; o IPv6 scope zones support is added; o ipfw(4) now depends from Concurrency Kit; o states are linked with "entry" field using CK_SLIST. This allows lockless lookup and protected by mutex modifications. o the "expired" SLIST field is used for states expiring. o struct dyn_data is used to keep generic information for both IPv4 and IPv6; o struct dyn_parent is used to keep O_LIMIT_PARENT information; o IPv4 and IPv6 states are stored in different hash tables; o O_LIMIT_PARENT states now are kept separately from O_LIMIT and O_KEEP_STATE states; o per-cpu dyn_hp pointers are used to implement hazard pointers and they prevent freeing states that are locklessly used by lookup threads; o mutexes to protect modification of lists in hash tables now kept in separate arrays. 65535 limit to maximum number of hash buckets now removed. o Separate lookup and install functions added for IPv4 and IPv6 states and for parent states. o By default now is used Jenkinks hash function. Obtained from: Yandex LLC MFC after: 42 days Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D12685 Modified: head/sys/conf/files head/sys/modules/ipfw/Makefile head/sys/netinet/ip_fw.h head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/conf/files Wed Feb 7 18:59:54 2018 (r328988) @@ -4374,7 +4374,8 @@ netpfil/ipfw/ip_dn_io.c optional inet dummynet netpfil/ipfw/ip_dn_glue.c optional inet dummynet netpfil/ipfw/ip_fw2.c optional inet ipfirewall netpfil/ipfw/ip_fw_bpf.c optional inet ipfirewall -netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall +netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall \ + compile-with "${NORMAL_C} -I$S/contrib/ck/include" netpfil/ipfw/ip_fw_eaction.c optional inet ipfirewall netpfil/ipfw/ip_fw_log.c optional inet ipfirewall netpfil/ipfw/ip_fw_pfil.c optional inet ipfirewall Modified: head/sys/modules/ipfw/Makefile ============================================================================== --- head/sys/modules/ipfw/Makefile Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/modules/ipfw/Makefile Wed Feb 7 18:59:54 2018 (r328988) @@ -9,7 +9,7 @@ SRCS+= ip_fw_sockopt.c ip_fw_table.c ip_fw_table_algo. SRCS+= ip_fw_table_value.c SRCS+= opt_inet.h opt_inet6.h opt_ipdivert.h opt_ipfw.h -CFLAGS+= -DIPFIREWALL +CFLAGS+= -DIPFIREWALL -I${SRCTOP}/sys/contrib/ck/include # #If you want it verbose #CFLAGS+= -DIPFIREWALL_VERBOSE Modified: head/sys/netinet/ip_fw.h ============================================================================== --- head/sys/netinet/ip_fw.h Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/netinet/ip_fw.h Wed Feb 7 18:59:54 2018 (r328988) @@ -671,7 +671,7 @@ struct ipfw_flow_id { uint32_t src_ip; uint16_t dst_port; uint16_t src_port; - uint8_t fib; + uint8_t fib; /* XXX: must be uint16_t */ uint8_t proto; uint8_t _flags; /* protocol-specific flags */ uint8_t addr_type; /* 4=ip4, 6=ip6, 1=ether ? */ @@ -682,6 +682,7 @@ struct ipfw_flow_id { }; #endif +#define IS_IP4_FLOW_ID(id) ((id)->addr_type == 4) #define IS_IP6_FLOW_ID(id) ((id)->addr_type == 6) /* Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/netpfil/ipfw/ip_fw2.c Wed Feb 7 18:59:54 2018 (r328988) @@ -1387,8 +1387,7 @@ ipfw_chk(struct ip_fw_args *args) * MATCH_NONE when checked and not matched (q = NULL), * MATCH_FORWARD or MATCH_REVERSE otherwise (q != NULL) */ - int dyn_dir = MATCH_UNKNOWN; - uint16_t dyn_name = 0; + struct ipfw_dyn_info dyn_info; struct ip_fw *q = NULL; struct ip_fw_chain *chain = &V_layer3_chain; @@ -1420,6 +1419,7 @@ ipfw_chk(struct ip_fw_args *args) proto = args->f_id.proto = 0; /* mark f_id invalid */ /* XXX 0 is a valid proto: IP/IPv6 Hop-by-Hop Option */ + DYN_INFO_INIT(&dyn_info); /* * PULLUP_TO(len, p, T) makes sure that len + sizeof(T) is contiguous, * then it sets p to point at the offset "len" in the mbuf. WARNING: the @@ -2605,7 +2605,8 @@ do { \ case O_LIMIT: case O_KEEP_STATE: if (ipfw_dyn_install_state(chain, f, - (ipfw_insn_limit *)cmd, args, tablearg)) { + (ipfw_insn_limit *)cmd, args, ulp, + pktlen, &dyn_info, tablearg)) { /* error or limit violation */ retval = IP_FW_DENY; l = 0; /* exit inner loop */ @@ -2619,34 +2620,15 @@ do { \ /* * dynamic rules are checked at the first * keep-state or check-state occurrence, - * with the result being stored in dyn_dir - * and dyn_name. + * with the result being stored in dyn_info. * The compiler introduces a PROBE_STATE * instruction for us when we have a * KEEP_STATE (because PROBE_STATE needs * to be run first). - * - * (dyn_dir == MATCH_UNKNOWN) means this is - * first lookup for such f_id. Do lookup. - * - * (dyn_dir != MATCH_UNKNOWN && - * dyn_name != 0 && dyn_name != cmd->arg1) - * means previous lookup didn't find dynamic - * rule for specific state name and current - * lookup will search rule with another state - * name. Redo lookup. - * - * (dyn_dir != MATCH_UNKNOWN && dyn_name == 0) - * means previous lookup was for `any' name - * and it didn't find rule. No need to do - * lookup again. */ - if ((dyn_dir == MATCH_UNKNOWN || - (dyn_name != 0 && - dyn_name != cmd->arg1)) && - (q = ipfw_dyn_lookup_state(&args->f_id, - ulp, pktlen, &dyn_dir, - (dyn_name = cmd->arg1))) != NULL) { + if (DYN_LOOKUP_NEEDED(&dyn_info, cmd) && + (q = ipfw_dyn_lookup_state(args, ulp, + pktlen, cmd, &dyn_info)) != NULL) { /* * Found dynamic entry, jump to the * 'action' part of the parent rule @@ -2654,13 +2636,7 @@ do { \ * cmdlen. */ f = q; - /* XXX we would like to have f_pos - * readily accessible in the dynamic - * rule, instead of having to - * lookup q->rule. - */ - f_pos = ipfw_find_rule(chain, - f->rulenum, f->id); + f_pos = dyn_info.f_pos; cmd = ACTION_PTR(f); l = f->cmd_len - f->act_ofs; cmdlen = 0; @@ -2877,7 +2853,8 @@ do { \ case O_FORWARD_IP: if (args->eh) /* not valid on layer2 pkts */ break; - if (q != f || dyn_dir == MATCH_FORWARD) { + if (q != f || + dyn_info.direction == MATCH_FORWARD) { struct sockaddr_in *sa; sa = &(((ipfw_insn_sa *)cmd)->sa); @@ -2937,7 +2914,8 @@ do { \ case O_FORWARD_IP6: if (args->eh) /* not valid on layer2 pkts */ break; - if (q != f || dyn_dir == MATCH_FORWARD) { + if (q != f || + dyn_info.direction == MATCH_FORWARD) { struct sockaddr_in6 *sin6; sin6 = &(((ipfw_insn_sa6 *)cmd)->sa); @@ -3089,7 +3067,7 @@ do { \ * @args content, and it may be * used for new state lookup later. */ - dyn_dir = MATCH_UNKNOWN; + DYN_INFO_INIT(&dyn_info); } break; Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 7 18:50:36 2018 (r328987) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 7 18:59:54 2018 (r328988) @@ -1,6 +1,8 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * + * Copyright (c) 2017-2018 Yandex LLC + * Copyright (c) 2017-2018 Andrey V. Elsukov * Copyright (c) 2002 Luigi Rizzo, Universita` di Pisa * * Redistribution and use in source and binary forms, with or without @@ -28,32 +30,27 @@ #include __FBSDID("$FreeBSD$"); -#define DEB(x) -#define DDB(x) x - -/* - * Dynamic rule support for ipfw - */ - -#include "opt_ipfw.h" #include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_ipfw.h" #ifndef INET #error IPFIREWALL requires INET. #endif /* INET */ -#include "opt_inet6.h" #include #include -#include +#include #include #include -#include #include +#include +#include #include +#include #include #include #include -#include /* for ETHERTYPE_IP */ +#include #include #include #include @@ -61,8 +58,9 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* ip_defttl */ +#include #include +#include #include #include @@ -70,6 +68,7 @@ __FBSDID("$FreeBSD$"); #ifdef INET6 #include #include +#include #endif #include @@ -79,86 +78,261 @@ __FBSDID("$FreeBSD$"); #ifdef MAC #include #endif +#include /* - * Description of dynamic rules. + * Description of dynamic states. * - * Dynamic rules are stored in lists accessed through a hash table - * (ipfw_dyn_v) whose size is curr_dyn_buckets. This value can - * be modified through the sysctl variable dyn_buckets which is - * updated when the table becomes empty. + * Dynamic states are stored in lists accessed through a hash tables + * whose size is curr_dyn_buckets. This value can be modified through + * the sysctl variable dyn_buckets. * - * XXX currently there is only one list, ipfw_dyn. + * Currently there are four tables: dyn_ipv4, dyn_ipv6, dyn_ipv4_parent, + * and dyn_ipv6_parent. * - * When a packet is received, its address fields are first masked - * with the mask defined for the rule, then hashed, then matched - * against the entries in the corresponding list. - * Dynamic rules can be used for different purposes: + * When a packet is received, its address fields hashed, then matched + * against the entries in the corresponding list by addr_type. + * Dynamic states can be used for different purposes: * + stateful rules; * + enforcing limits on the number of sessions; * + in-kernel NAT (not implemented yet) * - * The lifetime of dynamic rules is regulated by dyn_*_lifetime, + * The lifetime of dynamic states is regulated by dyn_*_lifetime, * measured in seconds and depending on the flags. * - * The total number of dynamic rules is equal to UMA zone items count. - * The max number of dynamic rules is dyn_max. When we reach + * The total number of dynamic states is equal to UMA zone items count. + * The max number of dynamic states is dyn_max. When we reach * the maximum number of rules we do not create anymore. This is * done to avoid consuming too much memory, but also too much * time when searching on each packet (ideally, we should try instead * to put a limit on the length of the list on each bucket...). * - * Each dynamic rule holds a pointer to the parent ipfw rule so - * we know what action to perform. Dynamic rules are removed when - * the parent rule is deleted. This can be changed by dyn_keep_states - * sysctl. + * Each state holds a pointer to the parent ipfw rule so we know what + * action to perform. Dynamic rules are removed when the parent rule is + * deleted. * * There are some limitations with dynamic rules -- we do not * obey the 'randomized match', and we do not do multiple * passes through the firewall. XXX check the latter!!! */ -struct ipfw_dyn_bucket { - struct mtx mtx; /* Bucket protecting lock */ - ipfw_dyn_rule *head; /* Pointer to first rule */ +/* By default use jenkins hash function */ +#define IPFIREWALL_JENKINSHASH + +#define DYN_COUNTER_INC(d, dir, pktlen) do { \ + (d)->pcnt_ ## dir++; \ + (d)->bcnt_ ## dir += pktlen; \ + } while (0) + +struct dyn_data { + void *parent; /* pointer to parent rule */ + uint32_t chain_id; /* cached ruleset id */ + uint32_t f_pos; /* cached rule index */ + + uint32_t hashval; /* hash value used for hash resize */ + uint16_t fibnum; /* fib used to send keepalives */ + uint8_t _pad[3]; + uint8_t set; /* parent rule set number */ + uint16_t rulenum; /* parent rule number */ + uint32_t ruleid; /* parent rule id */ + + uint32_t state; /* TCP session state and flags */ + uint32_t ack_fwd; /* most recent ACKs in forward */ + uint32_t ack_rev; /* and reverse direction (used */ + /* to generate keepalives) */ + uint32_t sync; /* synchronization time */ + uint32_t expire; /* expire time */ + + uint64_t pcnt_fwd; /* bytes counter in forward */ + uint64_t bcnt_fwd; /* packets counter in forward */ + uint64_t pcnt_rev; /* bytes counter in reverse */ + uint64_t bcnt_rev; /* packets counter in reverse */ }; +#define DPARENT_COUNT_DEC(p) do { \ + MPASS(p->count > 0); \ + ck_pr_dec_32(&(p)->count); \ +} while (0) +#define DPARENT_COUNT_INC(p) ck_pr_inc_32(&(p)->count) +#define DPARENT_COUNT(p) ck_pr_load_32(&(p)->count) +struct dyn_parent { + void *parent; /* pointer to parent rule */ + uint32_t count; /* number of linked states */ + uint8_t _pad; + uint8_t set; /* parent rule set number */ + uint16_t rulenum; /* parent rule number */ + uint32_t ruleid; /* parent rule id */ + uint32_t hashval; /* hash value used for hash resize */ + uint32_t expire; /* expire time */ +}; + +struct dyn_ipv4_state { + uint8_t type; /* State type */ + uint8_t proto; /* UL Protocol */ + uint16_t kidx; /* named object index */ + uint16_t sport, dport; /* ULP source and destination ports */ + in_addr_t src, dst; /* IPv4 source and destination */ + + union { + struct dyn_data *data; + struct dyn_parent *limit; + }; + CK_SLIST_ENTRY(dyn_ipv4_state) entry; + SLIST_ENTRY(dyn_ipv4_state) expired; +}; +CK_SLIST_HEAD(dyn_ipv4ck_slist, dyn_ipv4_state); +static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4); +static VNET_DEFINE(struct dyn_ipv4ck_slist *, dyn_ipv4_parent); + +SLIST_HEAD(dyn_ipv4_slist, dyn_ipv4_state); +static VNET_DEFINE(struct dyn_ipv4_slist, dyn_expired_ipv4); +#define V_dyn_ipv4 VNET(dyn_ipv4) +#define V_dyn_ipv4_parent VNET(dyn_ipv4_parent) +#define V_dyn_expired_ipv4 VNET(dyn_expired_ipv4) + +#ifdef INET6 +struct dyn_ipv6_state { + uint8_t type; /* State type */ + uint8_t proto; /* UL Protocol */ + uint16_t kidx; /* named object index */ + uint16_t sport, dport; /* ULP source and destination ports */ + struct in6_addr src, dst; /* IPv6 source and destination */ + uint32_t zoneid; /* IPv6 scope zone id */ + union { + struct dyn_data *data; + struct dyn_parent *limit; + }; + CK_SLIST_ENTRY(dyn_ipv6_state) entry; + SLIST_ENTRY(dyn_ipv6_state) expired; +}; +CK_SLIST_HEAD(dyn_ipv6ck_slist, dyn_ipv6_state); +static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6); +static VNET_DEFINE(struct dyn_ipv6ck_slist *, dyn_ipv6_parent); + +SLIST_HEAD(dyn_ipv6_slist, dyn_ipv6_state); +static VNET_DEFINE(struct dyn_ipv6_slist, dyn_expired_ipv6); +#define V_dyn_ipv6 VNET(dyn_ipv6) +#define V_dyn_ipv6_parent VNET(dyn_ipv6_parent) +#define V_dyn_expired_ipv6 VNET(dyn_expired_ipv6) +#endif /* INET6 */ + /* - * Static variables followed by global ones + * Per-CPU pointer indicates that specified state is currently in use + * and must not be reclaimed by expiration callout. */ -static VNET_DEFINE(struct ipfw_dyn_bucket *, ipfw_dyn_v); -static VNET_DEFINE(u_int32_t, dyn_buckets_max); -static VNET_DEFINE(u_int32_t, curr_dyn_buckets); -static VNET_DEFINE(struct callout, ipfw_timeout); -#define V_ipfw_dyn_v VNET(ipfw_dyn_v) -#define V_dyn_buckets_max VNET(dyn_buckets_max) -#define V_curr_dyn_buckets VNET(curr_dyn_buckets) -#define V_ipfw_timeout VNET(ipfw_timeout) +static void **dyn_hp_cache; +static DPCPU_DEFINE(void *, dyn_hp); +#define DYNSTATE_GET(cpu) ck_pr_load_ptr(DPCPU_ID_PTR((cpu), dyn_hp)) +#define DYNSTATE_PROTECT(v) ck_pr_store_ptr(DPCPU_PTR(dyn_hp), (v)) +#define DYNSTATE_RELEASE() DYNSTATE_PROTECT(NULL) +#define DYNSTATE_CRITICAL_ENTER() critical_enter() +#define DYNSTATE_CRITICAL_EXIT() do { \ + DYNSTATE_RELEASE(); \ + critical_exit(); \ +} while (0); -static VNET_DEFINE(uma_zone_t, ipfw_dyn_rule_zone); -#define V_ipfw_dyn_rule_zone VNET(ipfw_dyn_rule_zone) +/* + * We keep two version numbers, one is updated when new entry added to + * the list. Second is updated when an entry deleted from the list. + * Versions are updated under bucket lock. + * + * Bucket "add" version number is used to know, that in the time between + * state lookup (i.e. ipfw_dyn_lookup_state()) and the followed state + * creation (i.e. ipfw_dyn_install_state()) another concurrent thread did + * not install some state in this bucket. Using this info we can avoid + * additional state lookup, because we are sure that we will not install + * the state twice. + * + * Also doing the tracking of bucket "del" version during lookup we can + * be sure, that state entry was not unlinked and freed in time between + * we read the state pointer and protect it with hazard pointer. + * + * An entry unlinked from CK list keeps unchanged until it is freed. + * Unlinked entries are linked into expired lists using "expired" field. + */ -#define IPFW_BUCK_LOCK_INIT(b) \ - mtx_init(&(b)->mtx, "IPFW dynamic bucket", NULL, MTX_DEF) -#define IPFW_BUCK_LOCK_DESTROY(b) \ - mtx_destroy(&(b)->mtx) -#define IPFW_BUCK_LOCK(i) mtx_lock(&V_ipfw_dyn_v[(i)].mtx) -#define IPFW_BUCK_UNLOCK(i) mtx_unlock(&V_ipfw_dyn_v[(i)].mtx) -#define IPFW_BUCK_ASSERT(i) mtx_assert(&V_ipfw_dyn_v[(i)].mtx, MA_OWNED) +/* + * dyn_expire_lock is used to protect access to dyn_expired_xxx lists. + * dyn_bucket_lock is used to get write access to lists in specific bucket. + * Currently one dyn_bucket_lock is used for all ipv4, ipv4_parent, ipv6, + * and ipv6_parent lists. + */ +static VNET_DEFINE(struct mtx, dyn_expire_lock); +static VNET_DEFINE(struct mtx *, dyn_bucket_lock); +#define V_dyn_expire_lock VNET(dyn_expire_lock) +#define V_dyn_bucket_lock VNET(dyn_bucket_lock) +/* + * Bucket's add/delete generation versions. + */ +static VNET_DEFINE(uint32_t *, dyn_ipv4_add); +static VNET_DEFINE(uint32_t *, dyn_ipv4_del); +static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_add); +static VNET_DEFINE(uint32_t *, dyn_ipv4_parent_del); +#define V_dyn_ipv4_add VNET(dyn_ipv4_add) +#define V_dyn_ipv4_del VNET(dyn_ipv4_del) +#define V_dyn_ipv4_parent_add VNET(dyn_ipv4_parent_add) +#define V_dyn_ipv4_parent_del VNET(dyn_ipv4_parent_del) -static VNET_DEFINE(int, dyn_keep_states); -#define V_dyn_keep_states VNET(dyn_keep_states) +#ifdef INET6 +static VNET_DEFINE(uint32_t *, dyn_ipv6_add); +static VNET_DEFINE(uint32_t *, dyn_ipv6_del); +static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_add); +static VNET_DEFINE(uint32_t *, dyn_ipv6_parent_del); +#define V_dyn_ipv6_add VNET(dyn_ipv6_add) +#define V_dyn_ipv6_del VNET(dyn_ipv6_del) +#define V_dyn_ipv6_parent_add VNET(dyn_ipv6_parent_add) +#define V_dyn_ipv6_parent_del VNET(dyn_ipv6_parent_del) +#endif /* INET6 */ +#define DYN_BUCKET(h, b) ((h) & (b - 1)) +#define DYN_BUCKET_VERSION(b, v) ck_pr_load_32(&V_dyn_ ## v[(b)]) +#define DYN_BUCKET_VERSION_BUMP(b, v) ck_pr_inc_32(&V_dyn_ ## v[(b)]) + +#define DYN_BUCKET_LOCK_INIT(lock, b) \ + mtx_init(&lock[(b)], "IPFW dynamic bucket", NULL, MTX_DEF) +#define DYN_BUCKET_LOCK_DESTROY(lock, b) mtx_destroy(&lock[(b)]) +#define DYN_BUCKET_LOCK(b) mtx_lock(&V_dyn_bucket_lock[(b)]) +#define DYN_BUCKET_UNLOCK(b) mtx_unlock(&V_dyn_bucket_lock[(b)]) +#define DYN_BUCKET_ASSERT(b) mtx_assert(&V_dyn_bucket_lock[(b)], MA_OWNED) + +#define DYN_EXPIRED_LOCK_INIT() \ + mtx_init(&V_dyn_expire_lock, "IPFW expired states list", NULL, MTX_DEF) +#define DYN_EXPIRED_LOCK_DESTROY() mtx_destroy(&V_dyn_expire_lock) +#define DYN_EXPIRED_LOCK() mtx_lock(&V_dyn_expire_lock) +#define DYN_EXPIRED_UNLOCK() mtx_unlock(&V_dyn_expire_lock) + +static VNET_DEFINE(uint32_t, dyn_buckets_max); +static VNET_DEFINE(uint32_t, curr_dyn_buckets); +static VNET_DEFINE(struct callout, dyn_timeout); +#define V_dyn_buckets_max VNET(dyn_buckets_max) +#define V_curr_dyn_buckets VNET(curr_dyn_buckets) +#define V_dyn_timeout VNET(dyn_timeout) + +/* Maximum length of states chain in a bucket */ +static VNET_DEFINE(uint32_t, curr_max_length); +#define V_curr_max_length VNET(curr_max_length) + +static VNET_DEFINE(uma_zone_t, dyn_data_zone); +static VNET_DEFINE(uma_zone_t, dyn_parent_zone); +static VNET_DEFINE(uma_zone_t, dyn_ipv4_zone); +#ifdef INET6 +static VNET_DEFINE(uma_zone_t, dyn_ipv6_zone); +#define V_dyn_ipv6_zone VNET(dyn_ipv6_zone) +#endif /* INET6 */ +#define V_dyn_data_zone VNET(dyn_data_zone) +#define V_dyn_parent_zone VNET(dyn_parent_zone) +#define V_dyn_ipv4_zone VNET(dyn_ipv4_zone) + /* * Timeouts for various events in handing dynamic rules. */ -static VNET_DEFINE(u_int32_t, dyn_ack_lifetime); -static VNET_DEFINE(u_int32_t, dyn_syn_lifetime); -static VNET_DEFINE(u_int32_t, dyn_fin_lifetime); -static VNET_DEFINE(u_int32_t, dyn_rst_lifetime); -static VNET_DEFINE(u_int32_t, dyn_udp_lifetime); -static VNET_DEFINE(u_int32_t, dyn_short_lifetime); +static VNET_DEFINE(uint32_t, dyn_ack_lifetime); +static VNET_DEFINE(uint32_t, dyn_syn_lifetime); +static VNET_DEFINE(uint32_t, dyn_fin_lifetime); +static VNET_DEFINE(uint32_t, dyn_rst_lifetime); +static VNET_DEFINE(uint32_t, dyn_udp_lifetime); +static VNET_DEFINE(uint32_t, dyn_short_lifetime); #define V_dyn_ack_lifetime VNET(dyn_ack_lifetime) #define V_dyn_syn_lifetime VNET(dyn_syn_lifetime) @@ -174,10 +348,10 @@ static VNET_DEFINE(u_int32_t, dyn_short_lifetime); * dyn_rst_lifetime and dyn_fin_lifetime should be strictly lower * than dyn_keepalive_period. */ - -static VNET_DEFINE(u_int32_t, dyn_keepalive_interval); -static VNET_DEFINE(u_int32_t, dyn_keepalive_period); -static VNET_DEFINE(u_int32_t, dyn_keepalive); +#define DYN_KEEPALIVE_MAXQ 512 +static VNET_DEFINE(uint32_t, dyn_keepalive_interval); +static VNET_DEFINE(uint32_t, dyn_keepalive_period); +static VNET_DEFINE(uint32_t, dyn_keepalive); static VNET_DEFINE(time_t, dyn_keepalive_last); #define V_dyn_keepalive_interval VNET(dyn_keepalive_interval) @@ -185,113 +359,208 @@ static VNET_DEFINE(time_t, dyn_keepalive_last); #define V_dyn_keepalive VNET(dyn_keepalive) #define V_dyn_keepalive_last VNET(dyn_keepalive_last) -static VNET_DEFINE(u_int32_t, dyn_max); /* max # of dynamic rules */ - -#define DYN_COUNT uma_zone_get_cur(V_ipfw_dyn_rule_zone) +static VNET_DEFINE(uint32_t, dyn_max); /* max # of dynamic states */ +static VNET_DEFINE(uint32_t, dyn_count); /* number of states */ +static VNET_DEFINE(uint32_t, dyn_parent_max); /* max # of parent states */ +static VNET_DEFINE(uint32_t, dyn_parent_count); /* number of parent states */ #define V_dyn_max VNET(dyn_max) +#define V_dyn_count VNET(dyn_count) +#define V_dyn_parent_max VNET(dyn_parent_max) +#define V_dyn_parent_count VNET(dyn_parent_count) -/* for userspace, we emulate the uma_zone_counter with ipfw_dyn_count */ -static int ipfw_dyn_count; /* number of objects */ +#define DYN_COUNT_DEC(name) do { \ + MPASS((V_ ## name) > 0); \ + ck_pr_dec_32(&(V_ ## name)); \ +} while (0) +#define DYN_COUNT_INC(name) ck_pr_inc_32(&(V_ ## name)) +#define DYN_COUNT(name) ck_pr_load_32(&(V_ ## name)) -#ifdef USERSPACE /* emulation of UMA object counters for userspace */ -#define uma_zone_get_cur(x) ipfw_dyn_count -#endif /* USERSPACE */ +static time_t last_log; /* Log ratelimiting */ -static int last_log; /* Log ratelimiting */ +/* + * Get/set maximum number of dynamic states in given VNET instance. + */ +static int +sysctl_dyn_max(SYSCTL_HANDLER_ARGS) +{ + uint32_t nstates; + int error; -static void ipfw_dyn_tick(void *vnetx); -static void check_dyn_rules(struct ip_fw_chain *, ipfw_range_tlv *, int, int); -#ifdef SYSCTL_NODE + nstates = V_dyn_max; + error = sysctl_handle_32(oidp, &nstates, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); -static int sysctl_ipfw_dyn_count(SYSCTL_HANDLER_ARGS); -static int sysctl_ipfw_dyn_max(SYSCTL_HANDLER_ARGS); + V_dyn_max = nstates; + uma_zone_set_max(V_dyn_data_zone, V_dyn_max); + return (0); +} -SYSBEGIN(f2) +static int +sysctl_dyn_parent_max(SYSCTL_HANDLER_ARGS) +{ + uint32_t nstates; + int error; + nstates = V_dyn_parent_max; + error = sysctl_handle_32(oidp, &nstates, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + + V_dyn_parent_max = nstates; + uma_zone_set_max(V_dyn_parent_zone, V_dyn_parent_max); + return (0); +} + +static int +sysctl_dyn_buckets(SYSCTL_HANDLER_ARGS) +{ + uint32_t nbuckets; + int error; + + nbuckets = V_dyn_buckets_max; + error = sysctl_handle_32(oidp, &nbuckets, 0, req); + /* Read operation or some error */ + if ((error != 0) || (req->newptr == NULL)) + return (error); + + if (nbuckets > 256) + V_dyn_buckets_max = 1 << fls(nbuckets - 1); + else + return (EINVAL); + return (0); +} + SYSCTL_DECL(_net_inet_ip_fw); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_buckets, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_buckets_max), 0, - "Max number of dyn. buckets"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, + +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_count, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(dyn_count), 0, + "Current number of dynamic states."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_parent_count, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(dyn_parent_count), 0, + "Current number of parent states. "); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, curr_dyn_buckets, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(curr_dyn_buckets), 0, - "Current Number of dyn. buckets"); -SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_count, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RD, 0, 0, sysctl_ipfw_dyn_count, "IU", - "Number of dyn. rules"); + "Current number of buckets for states hash table."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, curr_max_length, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(curr_max_length), 0, + "Current maximum length of states chains in hash buckets."); +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_buckets, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_buckets, + "IU", "Max number of buckets for dynamic states hash table."); SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_max, - CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, 0, 0, sysctl_ipfw_dyn_max, "IU", - "Max number of dyn. rules"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_max, + "IU", "Max number of dynamic states."); +SYSCTL_PROC(_net_inet_ip_fw, OID_AUTO, dyn_parent_max, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RW, 0, 0, sysctl_dyn_parent_max, + "IU", "Max number of parent dynamic states."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_ack_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_ack_lifetime), 0, - "Lifetime of dyn. rules for acks"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, + "Lifetime of dynamic states for TCP ACK."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_syn_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_syn_lifetime), 0, - "Lifetime of dyn. rules for syn"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, + "Lifetime of dynamic states for TCP SYN."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_fin_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_fin_lifetime), 0, - "Lifetime of dyn. rules for fin"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, + "Lifetime of dynamic states for TCP FIN."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_rst_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_rst_lifetime), 0, - "Lifetime of dyn. rules for rst"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, + "Lifetime of dynamic states for TCP RST."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_udp_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_udp_lifetime), 0, - "Lifetime of dyn. rules for UDP"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, + "Lifetime of dynamic states for UDP."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_short_lifetime, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_short_lifetime), 0, - "Lifetime of dyn. rules for other situations"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, + "Lifetime of dynamic states for other situations."); +SYSCTL_U32(_net_inet_ip_fw, OID_AUTO, dyn_keepalive, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_keepalive), 0, - "Enable keepalives for dyn. rules"); -SYSCTL_UINT(_net_inet_ip_fw, OID_AUTO, dyn_keep_states, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(dyn_keep_states), 0, - "Do not flush dynamic states on rule deletion"); + "Enable keepalives for dynamic states."); -SYSEND +#ifdef IPFIREWALL_DYNDEBUG +#define DYN_DEBUG(fmt, ...) do { \ + printf("%s: " fmt "\n", __func__, __VA_ARGS__); \ +} while (0) +#else +#define DYN_DEBUG(fmt, ...) +#endif /* !IPFIREWALL_DYNDEBUG */ -#endif /* SYSCTL_NODE */ - - #ifdef INET6 -static __inline int -hash_packet6(const struct ipfw_flow_id *id) -{ - u_int32_t i; - i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ - (id->src_ip6.__u6_addr.__u6_addr32[3]); - return ntohl(i); -} -#endif +/* Functions to work with IPv6 states */ +static struct dyn_ipv6_state *dyn_lookup_ipv6_state( + const struct ipfw_flow_id *, uint32_t, const void *, + struct ipfw_dyn_info *, int); +static int dyn_lookup_ipv6_state_locked(const struct ipfw_flow_id *, + uint32_t, const void *, int, const void *, uint32_t, uint16_t, uint32_t, + uint16_t); +static struct dyn_ipv6_state *dyn_alloc_ipv6_state( + const struct ipfw_flow_id *, uint32_t, uint16_t, uint8_t); +static int dyn_add_ipv6_state(void *, uint32_t, uint16_t, uint8_t, + const struct ipfw_flow_id *, uint32_t, const void *, int, uint32_t, + struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); +static void dyn_export_ipv6_state(const struct dyn_ipv6_state *, + ipfw_dyn_rule *); -/* - * IMPORTANT: the hash function for dynamic rules must be commutative - * in source and destination (ip,port), because rules are bidirectional - * and we want to find both in the same bucket. - */ -static __inline int -hash_packet(const struct ipfw_flow_id *id, int buckets) -{ - u_int32_t i; +static uint32_t dyn_getscopeid(const struct ip_fw_args *); +static void dyn_make_keepalive_ipv6(struct mbuf *, const struct in6_addr *, + const struct in6_addr *, uint32_t, uint32_t, uint32_t, uint16_t, + uint16_t); +static void dyn_enqueue_keepalive_ipv6(struct mbufq *, + const struct dyn_ipv6_state *); +static void dyn_send_keepalive_ipv6(struct ip_fw_chain *); -#ifdef INET6 - if (IS_IP6_FLOW_ID(id)) - i = hash_packet6(id); - else +static struct dyn_ipv6_state *dyn_lookup_ipv6_parent( + const struct ipfw_flow_id *, uint32_t, const void *, uint32_t, uint16_t, + uint32_t); +static struct dyn_ipv6_state *dyn_lookup_ipv6_parent_locked( + const struct ipfw_flow_id *, uint32_t, const void *, uint32_t, uint16_t, + uint32_t); +static struct dyn_ipv6_state *dyn_add_ipv6_parent(void *, uint32_t, uint16_t, + uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint32_t, + uint16_t); #endif /* INET6 */ - i = (id->dst_ip) ^ (id->src_ip); - i ^= (id->dst_port) ^ (id->src_port); - return (i & (buckets - 1)); -} -#if 0 -#define DYN_DEBUG(fmt, ...) do { \ - printf("%s: " fmt "\n", __func__, __VA_ARGS__); \ -} while (0) -#else -#define DYN_DEBUG(fmt, ...) -#endif +/* Functions to work with limit states */ +static void *dyn_get_parent_state(const struct ipfw_flow_id *, uint32_t, + struct ip_fw *, uint32_t, uint32_t, uint16_t); +static struct dyn_ipv4_state *dyn_lookup_ipv4_parent( + const struct ipfw_flow_id *, const void *, uint32_t, uint16_t, uint32_t); +static struct dyn_ipv4_state *dyn_lookup_ipv4_parent_locked( + const struct ipfw_flow_id *, const void *, uint32_t, uint16_t, uint32_t); +static struct dyn_parent *dyn_alloc_parent(void *, uint32_t, uint16_t, + uint8_t, uint32_t); +static struct dyn_ipv4_state *dyn_add_ipv4_parent(void *, uint32_t, uint16_t, + uint8_t, const struct ipfw_flow_id *, uint32_t, uint32_t, uint16_t); +static void dyn_tick(void *); +static void dyn_expire_states(struct ip_fw_chain *, ipfw_range_tlv *); +static void dyn_free_states(struct ip_fw_chain *); +static void dyn_export_parent(const struct dyn_parent *, uint16_t, + ipfw_dyn_rule *); +static void dyn_export_data(const struct dyn_data *, uint16_t, uint8_t, + ipfw_dyn_rule *); +static uint32_t dyn_update_tcp_state(struct dyn_data *, + const struct ipfw_flow_id *, const struct tcphdr *, int); +static void dyn_update_proto_state(struct dyn_data *, + const struct ipfw_flow_id *, const void *, int, int); + +/* Functions to work with IPv4 states */ +struct dyn_ipv4_state *dyn_lookup_ipv4_state(const struct ipfw_flow_id *, + const void *, struct ipfw_dyn_info *, int); +static int dyn_lookup_ipv4_state_locked(const struct ipfw_flow_id *, + const void *, int, const void *, uint32_t, uint16_t, uint32_t, uint16_t); +static struct dyn_ipv4_state *dyn_alloc_ipv4_state( + const struct ipfw_flow_id *, uint16_t, uint8_t); +static int dyn_add_ipv4_state(void *, uint32_t, uint16_t, uint8_t, + const struct ipfw_flow_id *, const void *, int, uint32_t, + struct ipfw_dyn_info *, uint16_t, uint16_t, uint8_t); +static void dyn_export_ipv4_state(const struct dyn_ipv4_state *, + ipfw_dyn_rule *); + +/* + * Named states support. + */ static char *default_state_name = "default"; struct dyn_state_obj { struct named_object no; @@ -438,7 +707,6 @@ dyn_destroy(struct ip_fw_chain *ch, struct named_objec KASSERT(no->refcnt == 1, ("Destroying object '%s' (type %u, idx %u) with refcnt %u", no->name, no->etlv, no->kidx, no->refcnt)); - DYN_DEBUG("kidx %d", no->kidx); obj = SRV_OBJECT(ch, no->kidx); SRV_OBJECT(ch, no->kidx) = NULL; @@ -474,7 +742,137 @@ static struct opcode_obj_rewrite dyn_opcodes[] = { dyn_create, dyn_destroy }, }; -/** + +/* + * IMPORTANT: the hash function for dynamic rules must be commutative + * in source and destination (ip,port), because rules are bidirectional + * and we want to find both in the same bucket. + */ +#ifndef IPFIREWALL_JENKINSHASH +static __inline uint32_t +hash_packet(const struct ipfw_flow_id *id) +{ + uint32_t i; + +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) + i = ntohl((id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ + (id->dst_ip6.__u6_addr.__u6_addr32[3]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[2]) ^ + (id->src_ip6.__u6_addr.__u6_addr32[3])); + else +#endif /* INET6 */ + i = (id->dst_ip) ^ (id->src_ip); + i ^= (id->dst_port) ^ (id->src_port); + return (i); +} + +static __inline uint32_t +hash_parent(const struct ipfw_flow_id *id, const void *rule) +{ + + return (hash_packet(id) ^ ((uintptr_t)rule)); +} + +#else /* IPFIREWALL_JENKINSHASH */ + +static VNET_DEFINE(uint32_t, dyn_hashseed); +#define V_dyn_hashseed VNET(dyn_hashseed) + +static __inline int +addrcmp4(const struct ipfw_flow_id *id) +{ + + if (id->src_ip < id->dst_ip) + return (0); + if (id->src_ip > id->dst_ip) + return (1); + if (id->src_port <= id->dst_port) + return (0); + return (1); +} + +#ifdef INET6 +static __inline int +addrcmp6(const struct ipfw_flow_id *id) +{ + int ret; + + ret = memcmp(&id->src_ip6, &id->dst_ip6, sizeof(struct in6_addr)); + if (ret < 0) + return (0); + if (ret > 0) + return (1); + if (id->src_port <= id->dst_port) + return (0); + return (1); +} + +static __inline uint32_t +hash_packet6(const struct ipfw_flow_id *id) +{ + struct tuple6 { + struct in6_addr addr[2]; + uint16_t port[2]; + } t6; + + if (addrcmp6(id) == 0) { + t6.addr[0] = id->src_ip6; + t6.addr[1] = id->dst_ip6; + t6.port[0] = id->src_port; + t6.port[1] = id->dst_port; + } else { + t6.addr[0] = id->dst_ip6; + t6.addr[1] = id->src_ip6; + t6.port[0] = id->dst_port; + t6.port[1] = id->src_port; + } + return (jenkins_hash32((const uint32_t *)&t6, + sizeof(t6) / sizeof(uint32_t), V_dyn_hashseed)); +} +#endif + +static __inline uint32_t +hash_packet(const struct ipfw_flow_id *id) +{ + struct tuple4 { + in_addr_t addr[2]; + uint16_t port[2]; + } t4; + + if (IS_IP4_FLOW_ID(id)) { + /* All fields are in host byte order */ + if (addrcmp4(id) == 0) { + t4.addr[0] = id->src_ip; + t4.addr[1] = id->dst_ip; + t4.port[0] = id->src_port; + t4.port[1] = id->dst_port; + } else { + t4.addr[0] = id->dst_ip; + t4.addr[1] = id->src_ip; + t4.port[0] = id->dst_port; + t4.port[1] = id->src_port; + } + return (jenkins_hash32((const uint32_t *)&t4, + sizeof(t4) / sizeof(uint32_t), V_dyn_hashseed)); + } else +#ifdef INET6 + if (IS_IP6_FLOW_ID(id)) + return (hash_packet6(id)); +#endif + return (0); +} + +static __inline uint32_t +hash_parent(const struct ipfw_flow_id *id, const void *rule) +{ + + return (jenkins_hash32((const uint32_t *)&rule, + sizeof(rule) / sizeof(uint32_t), hash_packet(id))); +} +#endif /* IPFIREWALL_JENKINSHASH */ + +/* * Print customizable flow id description via log(9) facility. */ static void @@ -502,903 +900,1809 @@ print_dyn_rule_flags(const struct ipfw_flow_id *id, in } log(log_flags, "ipfw: %s type %d %s %d -> %s %d, %d %s\n", prefix, dyn_type, src, id->src_port, dst, - id->dst_port, DYN_COUNT, postfix); + id->dst_port, V_dyn_count, postfix); } #define print_dyn_rule(id, dtype, prefix, postfix) \ print_dyn_rule_flags(id, dtype, LOG_DEBUG, prefix, postfix) -#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) -#define TIME_LE(a,b) ((int)((a)-(b)) < 0) +#define TIME_LEQ(a,b) ((int)((a)-(b)) <= 0) +#define TIME_LE(a,b) ((int)((a)-(b)) < 0) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Feb 7 19:12:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC993F1E208; Wed, 7 Feb 2018 19:12:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 838FB79C99; Wed, 7 Feb 2018 19:12:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 793C22F91; Wed, 7 Feb 2018 19:12:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17JC54B068459; Wed, 7 Feb 2018 19:12:05 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17JC5rt068458; Wed, 7 Feb 2018 19:12:05 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802071912.w17JC5rt068458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 7 Feb 2018 19:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328989 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 328989 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.25 Precedence: list List-Id: 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, 07 Feb 2018 19:12:06 -0000 Author: ae Date: Wed Feb 7 19:12:05 2018 New Revision: 328989 URL: https://svnweb.freebsd.org/changeset/base/328989 Log: Remove duplicate #include . Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 7 18:59:54 2018 (r328988) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 7 19:12:05 2018 (r328989) @@ -60,7 +60,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include From owner-svn-src-head@freebsd.org Wed Feb 7 19:21:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E27F4F1EB9C; Wed, 7 Feb 2018 19:20:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94ABE7A097; Wed, 7 Feb 2018 19:20:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F9722FDB; Wed, 7 Feb 2018 19:20:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17JKxjC071171; Wed, 7 Feb 2018 19:20:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17JKx8m071168; Wed, 7 Feb 2018 19:20:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802071920.w17JKx8m071168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 7 Feb 2018 19:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328990 - in head/stand/usb: . test X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/stand/usb: . test X-SVN-Commit-Revision: 328990 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.25 Precedence: list List-Id: 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, 07 Feb 2018 19:21:00 -0000 Author: hselasky Date: Wed Feb 7 19:20:59 2018 New Revision: 328990 URL: https://svnweb.freebsd.org/changeset/base/328990 Log: Move the stand/usb test loader into its own directory. Fix its Makefile to build correctly. MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/stand/usb/test/ head/stand/usb/test/Makefile - copied, changed from r328989, head/stand/usb/Makefile.test head/stand/usb/test/bsd_usbloader_test.c - copied unchanged from r328989, head/stand/usb/bsd_usbloader_test.c Deleted: head/stand/usb/Makefile.test head/stand/usb/bsd_usbloader_test.c Copied and modified: head/stand/usb/test/Makefile (from r328989, head/stand/usb/Makefile.test) ============================================================================== --- head/stand/usb/Makefile.test Wed Feb 7 19:12:05 2018 (r328989, copy source) +++ head/stand/usb/test/Makefile Wed Feb 7 19:20:59 2018 (r328990) @@ -30,6 +30,7 @@ # .PATH: ${.CURDIR} +.SUFFIXES: .a PROG= usbloader SRCS= @@ -45,12 +46,15 @@ LDFLAGS+= -Wl,--gc-sections SRCS+= bsd_usbloader_test.c -LDADD+= libusbboot.a -DPADD+= libusbboot.a +USBLIB?= ${.OBJDIR}/../libusbboot.a +LDADD+= ${USBLIB} +DPADD+= ${USBLIB} + +MAN= + .include -${PROG}: libusbboot.a +${USBLIB}: + make -C ${.CURDIR}/.. USBCOREDIR=${.CURDIR}/.. -libusbboot.a: - make -f Makefile Copied: head/stand/usb/test/bsd_usbloader_test.c (from r328989, head/stand/usb/bsd_usbloader_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/usb/test/bsd_usbloader_test.c Wed Feb 7 19:20:59 2018 (r328990, copy of r328989, head/stand/usb/bsd_usbloader_test.c) @@ -0,0 +1,101 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2013 Hans Petter Selasky. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include + +extern int usleep(int); +extern void callout_process(int); +extern void usb_idle(void); +extern void usb_init(void); +extern void usb_uninit(void); + +#define hz 1000 + +#ifdef HAVE_MALLOC +void * +usb_malloc(size_t size) +{ + return (malloc(size)); +} + +void +usb_free(void *ptr) +{ + free(ptr); +} +#endif + +void +DELAY(unsigned int delay) +{ + usleep(delay); +} + +void +delay(unsigned int delay) +{ + usleep(delay); +} + +int +pause(const char *what, int timeout) +{ + if (timeout == 0) + timeout = 1; + + usleep((1000000 / hz) * timeout); + + return (0); +} + +int +main(int argc, char **argv) +{ + uint32_t time; + + usb_init(); + + time = 0; + + while (1) { + + usb_idle(); + + usleep(1000); + + if (++time >= (1000 / hz)) { + time = 0; + callout_process(1); + } + } + + usb_uninit(); + + return (0); +} From owner-svn-src-head@freebsd.org Wed Feb 7 20:13:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DBC9EC9D7F; Wed, 7 Feb 2018 20:13:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C37A17D056; Wed, 7 Feb 2018 20:13:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE54F3D91; Wed, 7 Feb 2018 20:13:08 +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 w17KD8jG002509; Wed, 7 Feb 2018 20:13:08 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17KD8a0002508; Wed, 7 Feb 2018 20:13:08 GMT (envelope-from np@FreeBSD.org) Message-Id: <201802072013.w17KD8a0002508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 7 Feb 2018 20:13:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328994 - head/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/iw_cxgbe X-SVN-Commit-Revision: 328994 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.25 Precedence: list List-Id: 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, 07 Feb 2018 20:13:09 -0000 Author: np Date: Wed Feb 7 20:13:08 2018 New Revision: 328994 URL: https://svnweb.freebsd.org/changeset/base/328994 Log: iw_cxgbe: Remove declaration of a function that no longer exists. Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Modified: head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Feb 7 19:53:14 2018 (r328993) +++ head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Wed Feb 7 20:13:08 2018 (r328994) @@ -964,7 +964,6 @@ void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 add int c4iw_ofld_send(struct c4iw_rdev *rdev, struct mbuf *m); void c4iw_flush_hw_cq(struct c4iw_cq *cq); void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count); -void c4iw_count_scqes(struct t4_cq *cq, struct t4_wq *wq, int *count); int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); int __c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp); int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count); From owner-svn-src-head@freebsd.org Wed Feb 7 20:36:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 683D9ED6CF1; Wed, 7 Feb 2018 20:36:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17F467DE30; Wed, 7 Feb 2018 20:36:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E464412D; Wed, 7 Feb 2018 20:36:38 +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 w17KabUS012261; Wed, 7 Feb 2018 20:36:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17KabqK012260; Wed, 7 Feb 2018 20:36:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802072036.w17KabqK012260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 7 Feb 2018 20:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328995 - head/usr.bin/sort X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/usr.bin/sort X-SVN-Commit-Revision: 328995 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.25 Precedence: list List-Id: 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, 07 Feb 2018 20:36:38 -0000 Author: markj Date: Wed Feb 7 20:36:37 2018 New Revision: 328995 URL: https://svnweb.freebsd.org/changeset/base/328995 Log: Fix the WITH_SORT_THREADS build. PR: 201664 MFC after: 1 week Modified: head/usr.bin/sort/radixsort.c Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Wed Feb 7 20:13:08 2018 (r328994) +++ head/usr.bin/sort/radixsort.c Wed Feb 7 20:36:37 2018 (r328995) @@ -129,6 +129,14 @@ have_sort_left(void) #endif /* SORT_THREADS */ +static void +_push_ls(struct level_stack *ls) +{ + + ls->next = g_ls; + g_ls = ls; +} + /* * Push sort level to the stack */ @@ -141,22 +149,14 @@ push_ls(struct sort_level *sl) new_ls->sl = sl; #if defined(SORT_THREADS) - if (nthreads > 1) + if (nthreads > 1) { pthread_mutex_lock(&g_ls_mutex); -#endif - - new_ls->next = g_ls; - g_ls = new_ls; - -#if defined(SORT_THREADS) - if (nthreads > 1) + _push_ls(new_ls); pthread_cond_signal(&g_ls_cond); -#endif - -#if defined(SORT_THREADS) - if (nthreads > 1) pthread_mutex_unlock(&g_ls_mutex); + } else #endif + _push_ls(new_ls); } /* From owner-svn-src-head@freebsd.org Wed Feb 7 21:52:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE2A8EDCCA3; Wed, 7 Feb 2018 21:52:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6479880E20; Wed, 7 Feb 2018 21:52:00 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F6084DCF; Wed, 7 Feb 2018 21:52:00 +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 w17Lq0PB048729; Wed, 7 Feb 2018 21:52:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Lq0gd048728; Wed, 7 Feb 2018 21:52:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802072152.w17Lq0gd048728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 7 Feb 2018 21:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328996 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 328996 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.25 Precedence: list List-Id: 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, 07 Feb 2018 21:52:00 -0000 Author: avg Date: Wed Feb 7 21:51:59 2018 New Revision: 328996 URL: https://svnweb.freebsd.org/changeset/base/328996 Log: exec_map_first_page: fix an inverse condition introduced in r254138 While the bug itself was serious, as we could either pass a non-busied page to vm_pager_get_pages() or leak a busy page, it could only be triggered under a very rare condition where the page is already inserted into the object, but it is not valid yet. Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Wed Feb 7 20:36:37 2018 (r328995) +++ head/sys/kern/kern_exec.c Wed Feb 7 21:51:59 2018 (r328996) @@ -1009,7 +1009,7 @@ exec_map_first_page(imgp) if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { if (ma[i]->valid) break; - if (vm_page_tryxbusy(ma[i])) + if (!vm_page_tryxbusy(ma[i])) break; } else { ma[i] = vm_page_alloc(object, i, From owner-svn-src-head@freebsd.org Wed Feb 7 22:26:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA606EDF143; Wed, 7 Feb 2018 22:26:31 +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 666568213A; Wed, 7 Feb 2018 22:26:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id E6B5B10A7DB; Wed, 7 Feb 2018 17:26:29 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328985 - head/sys/dev/usb/template Date: Wed, 07 Feb 2018 14:25:14 -0800 Message-ID: <2147494.gDNdGGi869@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802071846.w17Ik894055491@repo.freebsd.org> References: <201802071846.w17Ik894055491@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); Wed, 07 Feb 2018 17:26:30 -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.25 Precedence: list List-Id: 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, 07 Feb 2018 22:26:31 -0000 On Wednesday, February 07, 2018 06:46:08 PM Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Feb 7 18:46:08 2018 > New Revision: 328985 > URL: https://svnweb.freebsd.org/changeset/base/328985 > > Log: > Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision > when building stand/usb. Regression after r328194. This seems like a bug in the USB bits in stand instead. In the kernel SYSINIT and SYSUNINIT use separate namespace by appending different suffixes to the first parameter: DATA_SET(sysinit_set,uniquifier ## _sys_init) vs. DATA_SET(sysuninit_set,uniquifier ## _sys_uninit) The bug is in stand/kshim/bsd_kernel.h: #define SYSINIT(uniq, subs, order, _func, _data) \ const struct sysinit UNIQ_NAME(sysinit_##uniq) = { \ .func = (_func), \ .data = __DECONST(void *, _data) \ }; \ SYSINIT_ENTRY(uniq##_entry, "sysinit", (subs), \ (order), "const struct sysinit", \ UNIQ_NAME_STR(sysinit_##uniq), "SYSINIT") #define SYSUNINIT(uniq, subs, order, _func, _data) \ const struct sysinit UNIQ_NAME(sysuninit_##uniq) = { \ .func = (_func), \ .data = __DECONST(void *, _data) \ }; \ SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs), \ (order), "const struct sysuninit", \ UNIQ_NAME_STR(sysuninit_##uniq), "SYSUNINIT") This should be using uniq##_uninit_entry or some such for the first argument to SYSINIT_ENTRY(). -- John Baldwin From owner-svn-src-head@freebsd.org Wed Feb 7 22:41:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE025EE02C3 for ; Wed, 7 Feb 2018 22:41:33 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 43BC982B6F for ; Wed, 7 Feb 2018 22:41:33 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22a.google.com with SMTP id v123so6332312wmd.5 for ; Wed, 07 Feb 2018 14:41:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=Vd6FHw8IOpwL0ej68WA3M77rvMOZ7UbiOYuJYbWiSMU=; b=HS2JwDE6OflnyvrLgc39Tv5j5d9d6mb9YGplBcX1Y6QnsZxMZ7wHiszOG4IL9yYzJL b+Gv5Nn6axh8pt151WF+yN92TmZQEuwk0yLVwMBJcbkcXgnf1A+NnMkO9DSgIQ48a6aI ivzfT3AEzC62FXSmlgNw1lQ7AqOibiplJfD3cn9HRme/e4l26U/RBj3v3aZTSE0Ckn5f 5dLVdmqYgSQX+JfSVGfRPI8BwJLGv6gevjdWMYHhX59A1l79rHQvQ7fwMjEQ7K+3DH8b aPkzkOIyjSS3GCcHFj98k+0jWXBxfb3f49IaO4amCUPK3K5LicqQ9PAlebpxvLgghJtL TTHw== 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; bh=Vd6FHw8IOpwL0ej68WA3M77rvMOZ7UbiOYuJYbWiSMU=; b=iga/tEmGPPh6RVZDG8C+FqgZGry97IoLbil8f+sfAHlkRJ8kV06FcX1uYzdWdSwHnZ 9Z/vRrpANxnZEudOzUv5N0NPwus1we4KA2Lzm/hU0xJZxWWTsKlHsfrpOc4lXZC7MhK0 35nE6aEt6gbqMBGhdfaWEhveLs/eyH8FuKXaEb7/Hwjgnnhtaniaq0heOvZ5h0dF+iwx Rc0HNztWIIattr2TtUWpjR0Rw4MxL+X4GeCe7qGzbFVSm5QmcmftWASPojz1WFf3IvNg xzff/3QLqkh4zU4HrEDj/pVV8dUiNmGKJ1n68wEm4aJbYXsozZOHmVkiqmgDcHMoGgRy Twkg== X-Gm-Message-State: APf1xPBC6Omh0aWEiFuu6T9T4HoyFobkNYD89va0rwv0lqqSa953+dR6 VrSWg+4aOoW6hz4DBMAJiSXgj8pdQiU= X-Google-Smtp-Source: AH8x224liSkiGBr9YGwDK5SlkGbkpKE8ghuhWBqBnuUEUN1+qyW72itVA2qS88EDrO9VsM/n//6C9g== X-Received: by 10.28.186.132 with SMTP id k126mr5669452wmf.159.1518043291875; Wed, 07 Feb 2018 14:41:31 -0800 (PST) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id y52sm5541891wrb.52.2018.02.07.14.41.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 14:41:30 -0800 (PST) Subject: Re: svn commit: r328996 - head/sys/kern To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802072152.w17Lq0gd048728@repo.freebsd.org> From: Steven Hartland Message-ID: <1076365a-db07-0b28-9f97-3a7cc2a73dd6@multiplay.co.uk> Date: Wed, 7 Feb 2018 22:41:32 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201802072152.w17Lq0gd048728@repo.freebsd.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 07 Feb 2018 22:41:34 -0000 What would be the expected behavior if this was triggered, app crash or kernel panic...? On 07/02/2018 21:52, Andriy Gapon wrote: > Author: avg > Date: Wed Feb 7 21:51:59 2018 > New Revision: 328996 > URL: https://svnweb.freebsd.org/changeset/base/328996 > > Log: > exec_map_first_page: fix an inverse condition introduced in r254138 > > While the bug itself was serious, as we could either pass a non-busied > page to vm_pager_get_pages() or leak a busy page, it could only be > triggered under a very rare condition where the page is already inserted > into the object, but it is not valid yet. > > Reviewed by: kib > MFC after: 2 weeks > > Modified: > head/sys/kern/kern_exec.c > > Modified: head/sys/kern/kern_exec.c > ============================================================================== > --- head/sys/kern/kern_exec.c Wed Feb 7 20:36:37 2018 (r328995) > +++ head/sys/kern/kern_exec.c Wed Feb 7 21:51:59 2018 (r328996) > @@ -1009,7 +1009,7 @@ exec_map_first_page(imgp) > if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { > if (ma[i]->valid) > break; > - if (vm_page_tryxbusy(ma[i])) > + if (!vm_page_tryxbusy(ma[i])) > break; > } else { > ma[i] = vm_page_alloc(object, i, > From owner-svn-src-head@freebsd.org Wed Feb 7 22:54:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA856EE14B5; Wed, 7 Feb 2018 22:54:31 +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 7A60683721; Wed, 7 Feb 2018 22:54:31 +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 899B52600EC; Wed, 7 Feb 2018 23:54:29 +0100 (CET) Subject: Re: svn commit: r328985 - head/sys/dev/usb/template To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802071846.w17Ik894055491@repo.freebsd.org> <2147494.gDNdGGi869@ralph.baldwin.cx> From: Hans Petter Selasky Message-ID: <43ece2af-5259-554e-c5f1-6fd947b587eb@selasky.org> Date: Wed, 7 Feb 2018 23:51:33 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <2147494.gDNdGGi869@ralph.baldwin.cx> 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.25 Precedence: list List-Id: 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, 07 Feb 2018 22:54:32 -0000 On 02/07/18 23:25, John Baldwin wrote: > On Wednesday, February 07, 2018 06:46:08 PM Hans Petter Selasky wrote: >> Author: hselasky >> Date: Wed Feb 7 18:46:08 2018 >> New Revision: 328985 >> URL: https://svnweb.freebsd.org/changeset/base/328985 >> >> Log: >> Give USB template SYSUNINIT()'s a uniq name to avoid symbol name collision >> when building stand/usb. Regression after r328194. > > This seems like a bug in the USB bits in stand instead. In the kernel > SYSINIT and SYSUNINIT use separate namespace by appending different suffixes > to the first parameter: > > DATA_SET(sysinit_set,uniquifier ## _sys_init) > > vs. > > DATA_SET(sysuninit_set,uniquifier ## _sys_uninit) > > The bug is in stand/kshim/bsd_kernel.h: > > #define SYSINIT(uniq, subs, order, _func, _data) \ > const struct sysinit UNIQ_NAME(sysinit_##uniq) = { \ > .func = (_func), \ > .data = __DECONST(void *, _data) \ > }; \ > SYSINIT_ENTRY(uniq##_entry, "sysinit", (subs), \ > (order), "const struct sysinit", \ > UNIQ_NAME_STR(sysinit_##uniq), "SYSINIT") > > #define SYSUNINIT(uniq, subs, order, _func, _data) \ > const struct sysinit UNIQ_NAME(sysuninit_##uniq) = { \ > .func = (_func), \ > .data = __DECONST(void *, _data) \ > }; \ > SYSINIT_ENTRY(uniq##_entry, "sysuninit", (subs), \ > (order), "const struct sysuninit", \ > UNIQ_NAME_STR(sysuninit_##uniq), "SYSUNINIT") > > This should be using uniq##_uninit_entry or some such for the first argument > to SYSINIT_ENTRY(). > It can be fixed either way. Feel free to fix the SYSINIT KSHIM macros. You can test by running make in stand/usb/test . --HPS From owner-svn-src-head@freebsd.org Wed Feb 7 23:27:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52F75EE3B64; Wed, 7 Feb 2018 23:27:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 012DA84A8E; Wed, 7 Feb 2018 23:27: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E64E35CB0; Wed, 7 Feb 2018 23:27:25 +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 w17NRPgb096735; Wed, 7 Feb 2018 23:27:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17NRPDG096732; Wed, 7 Feb 2018 23:27:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802072327.w17NRPDG096732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 23:27:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328999 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 328999 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.25 Precedence: list List-Id: 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, 07 Feb 2018 23:27:26 -0000 Author: imp Date: Wed Feb 7 23:27:25 2018 New Revision: 328999 URL: https://svnweb.freebsd.org/changeset/base/328999 Log: Fix indentation to FreeBSD standard for interp files Modified: head/stand/common/interp.c head/stand/common/interp_forth.c head/stand/common/interp_simple.c Modified: head/stand/common/interp.c ============================================================================== --- head/stand/common/interp.c Wed Feb 7 22:53:53 2018 (r328998) +++ head/stand/common/interp.c Wed Feb 7 23:27:25 2018 (r328999) @@ -45,32 +45,32 @@ __FBSDID("$FreeBSD$"); void interact(void) { - static char input[256]; /* big enough? */ + static char input[256]; /* big enough? */ - interp_init(); + interp_init(); - printf("\n"); + printf("\n"); - /* - * Before interacting, we might want to autoboot. - */ - autoboot_maybe(); + /* + * Before interacting, we might want to autoboot. + */ + autoboot_maybe(); - /* - * Not autobooting, go manual - */ - printf("\nType '?' for a list of commands, 'help' for more detailed help.\n"); - if (getenv("prompt") == NULL) - setenv("prompt", "${interpret}", 1); - if (getenv("interpret") == NULL) - setenv("interpret", "OK", 1); + /* + * Not autobooting, go manual + */ + printf("\nType '?' for a list of commands, 'help' for more detailed help.\n"); + if (getenv("prompt") == NULL) + setenv("prompt", "${interpret}", 1); + if (getenv("interpret") == NULL) + setenv("interpret", "OK", 1); - for (;;) { - input[0] = '\0'; - interp_emit_prompt(); - ngets(input, sizeof(input)); - interp_run(input); - } + for (;;) { + input[0] = '\0'; + interp_emit_prompt(); + ngets(input, sizeof(input)); + interp_run(input); + } } /* @@ -87,26 +87,26 @@ COMMAND_SET(include, "include", "read commands from a static int command_include(int argc, char *argv[]) { - int i; - int res; - char **argvbuf; + int i; + int res; + char **argvbuf; - /* - * Since argv is static, we need to save it here. - */ - argvbuf = (char**) calloc((u_int)argc, sizeof(char*)); - for (i = 0; i < argc; i++) - argvbuf[i] = strdup(argv[i]); + /* + * Since argv is static, we need to save it here. + */ + argvbuf = (char**) calloc((u_int)argc, sizeof(char*)); + for (i = 0; i < argc; i++) + argvbuf[i] = strdup(argv[i]); - res=CMD_OK; - for (i = 1; (i < argc) && (res == CMD_OK); i++) - res = interp_include(argvbuf[i]); + res=CMD_OK; + for (i = 1; (i < argc) && (res == CMD_OK); i++) + res = interp_include(argvbuf[i]); - for (i = 0; i < argc; i++) - free(argvbuf[i]); - free(argvbuf); + for (i = 0; i < argc; i++) + free(argvbuf[i]); + free(argvbuf); - return(res); + return(res); } /* @@ -116,26 +116,26 @@ command_include(int argc, char *argv[]) void interp_emit_prompt(void) { - char *pr, *p, *cp, *ev; + char *pr, *p, *cp, *ev; - if ((cp = getenv("prompt")) == NULL) - cp = ">"; - pr = p = strdup(cp); + if ((cp = getenv("prompt")) == NULL) + cp = ">"; + pr = p = strdup(cp); - while (*p != 0) { - if ((*p == '$') && (*(p+1) == '{')) { - for (cp = p + 2; (*cp != 0) && (*cp != '}'); cp++) - ; - *cp = 0; - ev = getenv(p + 2); + while (*p != 0) { + if ((*p == '$') && (*(p+1) == '{')) { + for (cp = p + 2; (*cp != 0) && (*cp != '}'); cp++) + ; + *cp = 0; + ev = getenv(p + 2); - if (ev != NULL) - printf("%s", ev); - p = cp + 1; - continue; + if (ev != NULL) + printf("%s", ev); + p = cp + 1; + continue; + } + putchar(*p++); } - putchar(*p++); - } - putchar(' '); - free(pr); + putchar(' '); + free(pr); } Modified: head/stand/common/interp_forth.c ============================================================================== --- head/stand/common/interp_forth.c Wed Feb 7 22:53:53 2018 (r328998) +++ head/stand/common/interp_forth.c Wed Feb 7 23:27:25 2018 (r328999) @@ -71,91 +71,91 @@ FICL_VM *bf_vm; static void bf_command(FICL_VM *vm) { - char *name, *line, *tail, *cp; - size_t len; - struct bootblk_command **cmdp; - bootblk_cmd_t *cmd; - int nstrings, i; - int argc, result; - char **argv; + char *name, *line, *tail, *cp; + size_t len; + struct bootblk_command **cmdp; + bootblk_cmd_t *cmd; + int nstrings, i; + int argc, result; + char **argv; - /* Get the name of the current word */ - name = vm->runningWord->name; + /* Get the name of the current word */ + name = vm->runningWord->name; - /* Find our command structure */ - cmd = NULL; - SET_FOREACH(cmdp, Xcommand_set) { - if (((*cmdp)->c_name != NULL) && !strcmp(name, (*cmdp)->c_name)) - cmd = (*cmdp)->c_fn; - } - if (cmd == NULL) - panic("callout for unknown command '%s'", name); + /* Find our command structure */ + cmd = NULL; + SET_FOREACH(cmdp, Xcommand_set) { + if (((*cmdp)->c_name != NULL) && !strcmp(name, (*cmdp)->c_name)) + cmd = (*cmdp)->c_fn; + } + if (cmd == NULL) + panic("callout for unknown command '%s'", name); - /* Check whether we have been compiled or are being interpreted */ - if (stackPopINT(vm->pStack)) { - /* - * Get parameters from stack, in the format: - * an un ... a2 u2 a1 u1 n -- - * Where n is the number of strings, a/u are pairs of - * address/size for strings, and they will be concatenated - * in LIFO order. - */ - nstrings = stackPopINT(vm->pStack); - for (i = 0, len = 0; i < nstrings; i++) - len += stackFetch(vm->pStack, i * 2).i + 1; - line = malloc(strlen(name) + len + 1); - strcpy(line, name); + /* Check whether we have been compiled or are being interpreted */ + if (stackPopINT(vm->pStack)) { + /* + * Get parameters from stack, in the format: + * an un ... a2 u2 a1 u1 n -- + * Where n is the number of strings, a/u are pairs of + * address/size for strings, and they will be concatenated + * in LIFO order. + */ + nstrings = stackPopINT(vm->pStack); + for (i = 0, len = 0; i < nstrings; i++) + len += stackFetch(vm->pStack, i * 2).i + 1; + line = malloc(strlen(name) + len + 1); + strcpy(line, name); - if (nstrings) - for (i = 0; i < nstrings; i++) { - len = stackPopINT(vm->pStack); - cp = stackPopPtr(vm->pStack); - strcat(line, " "); - strncat(line, cp, len); - } - } else { - /* Get remainder of invocation */ - tail = vmGetInBuf(vm); - for (cp = tail, len = 0; cp != vm->tib.end && *cp != 0 && *cp != '\n'; cp++, len++) - ; + if (nstrings) + for (i = 0; i < nstrings; i++) { + len = stackPopINT(vm->pStack); + cp = stackPopPtr(vm->pStack); + strcat(line, " "); + strncat(line, cp, len); + } + } else { + /* Get remainder of invocation */ + tail = vmGetInBuf(vm); + for (cp = tail, len = 0; cp != vm->tib.end && *cp != 0 && *cp != '\n'; cp++, len++) + ; - line = malloc(strlen(name) + len + 2); - strcpy(line, name); - if (len > 0) { - strcat(line, " "); - strncat(line, tail, len); - vmUpdateTib(vm, tail + len); + line = malloc(strlen(name) + len + 2); + strcpy(line, name); + if (len > 0) { + strcat(line, " "); + strncat(line, tail, len); + vmUpdateTib(vm, tail + len); + } } - } - DEBUG("cmd '%s'", line); + DEBUG("cmd '%s'", line); - command_errmsg = command_errbuf; - command_errbuf[0] = 0; - if (!parse(&argc, &argv, line)) { - result = (cmd)(argc, argv); - free(argv); - } else { - result=BF_PARSE; - } + command_errmsg = command_errbuf; + command_errbuf[0] = 0; + if (!parse(&argc, &argv, line)) { + result = (cmd)(argc, argv); + free(argv); + } else { + result=BF_PARSE; + } - switch (result) { - case CMD_CRIT: - printf("%s\n", command_errmsg); - break; - case CMD_FATAL: - panic("%s\n", command_errmsg); - } + switch (result) { + case CMD_CRIT: + printf("%s\n", command_errmsg); + break; + case CMD_FATAL: + panic("%s\n", command_errmsg); + } - free(line); - /* - * If there was error during nested ficlExec(), we may no longer have - * valid environment to return. Throw all exceptions from here. - */ - if (result != CMD_OK) - vmThrow(vm, result); + free(line); + /* + * If there was error during nested ficlExec(), we may no longer have + * valid environment to return. Throw all exceptions from here. + */ + if (result != CMD_OK) + vmThrow(vm, result); - /* This is going to be thrown!!! */ - stackPushINT(vm->pStack,result); + /* This is going to be thrown!!! */ + stackPushINT(vm->pStack,result); } /* @@ -226,25 +226,25 @@ bf_command(FICL_VM *vm) * (if you edit this definition, pay attention to trailing spaces after * each word -- I warned you! :-) ) */ -#define BUILTIN_CONSTRUCTOR \ -": builtin: " \ - ">in @ " /* save the tib index pointer */ \ - "' " /* get next word's xt */ \ - "swap >in ! " /* point again to next word */ \ - "create " /* create a new definition of the next word */ \ - ", " /* save previous definition's xt */ \ - "immediate " /* make the new definition an immediate word */ \ - \ - "does> " /* Now, the *new* definition will: */ \ - "state @ if " /* if in compiling state: */ \ - "1 postpone literal " /* pass 1 flag to indicate compile */ \ - "@ compile, " /* compile in previous definition */ \ - "postpone throw " /* throw stack-returned result */ \ - "else " /* if in interpreting state: */ \ - "0 swap " /* pass 0 flag to indicate interpret */ \ - "@ execute " /* call previous definition */ \ - "throw " /* throw stack-returned result */ \ - "then ; " +#define BUILTIN_CONSTRUCTOR \ + ": builtin: " \ + ">in @ " /* save the tib index pointer */ \ + "' " /* get next word's xt */ \ + "swap >in ! " /* point again to next word */ \ + "create " /* create a new definition of the next word */ \ + ", " /* save previous definition's xt */ \ + "immediate " /* make the new definition an immediate word */ \ + \ + "does> " /* Now, the *new* definition will: */ \ + "state @ if " /* if in compiling state: */ \ + "1 postpone literal " /* pass 1 flag to indicate compile */ \ + "@ compile, " /* compile in previous definition */ \ + "postpone throw " /* throw stack-returned result */ \ + "else " /* if in interpreting state: */ \ + "0 swap " /* pass 0 flag to indicate interpret */ \ + "@ execute " /* call previous definition */ \ + "throw " /* throw stack-returned result */ \ + "then ; " /* * Initialise the Forth interpreter, create all our commands as words. @@ -252,38 +252,38 @@ bf_command(FICL_VM *vm) void bf_init(void) { - struct bootblk_command **cmdp; - char create_buf[41]; /* 31 characters-long builtins */ - int fd; + struct bootblk_command **cmdp; + char create_buf[41]; /* 31 characters-long builtins */ + int fd; - bf_sys = ficlInitSystem(BF_DICTSIZE); - bf_vm = ficlNewVM(bf_sys); + bf_sys = ficlInitSystem(BF_DICTSIZE); + bf_vm = ficlNewVM(bf_sys); - /* Put all private definitions in a "builtins" vocabulary */ - ficlExec(bf_vm, "vocabulary builtins also builtins definitions"); + /* Put all private definitions in a "builtins" vocabulary */ + ficlExec(bf_vm, "vocabulary builtins also builtins definitions"); - /* Builtin constructor word */ - ficlExec(bf_vm, BUILTIN_CONSTRUCTOR); + /* Builtin constructor word */ + ficlExec(bf_vm, BUILTIN_CONSTRUCTOR); - /* make all commands appear as Forth words */ - SET_FOREACH(cmdp, Xcommand_set) { - ficlBuild(bf_sys, (char *)(*cmdp)->c_name, bf_command, FW_DEFAULT); - ficlExec(bf_vm, "forth definitions builtins"); - sprintf(create_buf, "builtin: %s", (*cmdp)->c_name); - ficlExec(bf_vm, create_buf); - ficlExec(bf_vm, "builtins definitions"); - } - ficlExec(bf_vm, "only forth definitions"); + /* make all commands appear as Forth words */ + SET_FOREACH(cmdp, Xcommand_set) { + ficlBuild(bf_sys, (char *)(*cmdp)->c_name, bf_command, FW_DEFAULT); + ficlExec(bf_vm, "forth definitions builtins"); + sprintf(create_buf, "builtin: %s", (*cmdp)->c_name); + ficlExec(bf_vm, create_buf); + ficlExec(bf_vm, "builtins definitions"); + } + ficlExec(bf_vm, "only forth definitions"); - /* Export some version numbers so that code can detect the loader/host version */ - ficlSetEnv(bf_sys, "FreeBSD_version", __FreeBSD_version); - ficlSetEnv(bf_sys, "loader_version", bootprog_rev); + /* Export some version numbers so that code can detect the loader/host version */ + ficlSetEnv(bf_sys, "FreeBSD_version", __FreeBSD_version); + ficlSetEnv(bf_sys, "loader_version", bootprog_rev); - /* try to load and run init file if present */ - if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) { - (void)ficlExecFD(bf_vm, fd); - close(fd); - } + /* try to load and run init file if present */ + if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) { + (void)ficlExecFD(bf_vm, fd); + close(fd); + } } /* @@ -292,45 +292,45 @@ bf_init(void) static int bf_run(const char *line) { - int result; + int result; - /* - * ficl would require extensive changes to accept a const char * - * interface. Instead, cast it away here and hope for the best. - * We know at the present time the caller for us in the boot - * forth loader can tolerate the string being modified because - * the string is passed in here and then not touched again. - */ - result = ficlExec(bf_vm, __DECONST(char *, line)); + /* + * ficl would require extensive changes to accept a const char * + * interface. Instead, cast it away here and hope for the best. + * We know at the present time the caller for us in the boot + * forth loader can tolerate the string being modified because + * the string is passed in here and then not touched again. + */ + result = ficlExec(bf_vm, __DECONST(char *, line)); - DEBUG("ficlExec '%s' = %d", line, result); - switch (result) { - case VM_OUTOFTEXT: - case VM_ABORTQ: - case VM_QUIT: - case VM_ERREXIT: - break; - case VM_USEREXIT: - printf("No where to leave to!\n"); - break; - case VM_ABORT: - printf("Aborted!\n"); - break; - case BF_PARSE: - printf("Parse error!\n"); - break; - default: - if (command_errmsg != NULL) { - printf("%s\n", command_errmsg); - command_errmsg = NULL; + DEBUG("ficlExec '%s' = %d", line, result); + switch (result) { + case VM_OUTOFTEXT: + case VM_ABORTQ: + case VM_QUIT: + case VM_ERREXIT: + break; + case VM_USEREXIT: + printf("No where to leave to!\n"); + break; + case VM_ABORT: + printf("Aborted!\n"); + break; + case BF_PARSE: + printf("Parse error!\n"); + break; + default: + if (command_errmsg != NULL) { + printf("%s\n", command_errmsg); + command_errmsg = NULL; + } } - } - if (result == VM_USEREXIT) - panic("interpreter exit"); - setenv("interpret", bf_vm->state ? "" : "OK", 1); + if (result == VM_USEREXIT) + panic("interpreter exit"); + setenv("interpret", bf_vm->state ? "" : "OK", 1); - return (result); + return (result); } void @@ -357,87 +357,86 @@ interp_run(const char *input) */ struct includeline { - struct includeline *next; - char text[0]; + struct includeline *next; + char text[0]; }; int interp_include(const char *filename) { - struct includeline *script, *se, *sp; - char input[256]; /* big enough? */ - int res; - char *cp; - int prevsrcid, fd, line; + struct includeline *script, *se, *sp; + char input[256]; /* big enough? */ + int res; + char *cp; + int prevsrcid, fd, line; - if (((fd = open(filename, O_RDONLY)) == -1)) { - snprintf(command_errbuf, sizeof(command_errbuf), - "can't open '%s': %s", filename, strerror(errno)); - return(CMD_ERROR); - } + if (((fd = open(filename, O_RDONLY)) == -1)) { + snprintf(command_errbuf, sizeof(command_errbuf), + "can't open '%s': %s", filename, strerror(errno)); + return(CMD_ERROR); + } - /* - * Read the script into memory. - */ - script = se = NULL; - line = 0; - - while (fgetstr(input, sizeof(input), fd) >= 0) { - line++; - cp = input; - /* Allocate script line structure and copy line, flags */ - if (*cp == '\0') - continue; /* ignore empty line, save memory */ - sp = malloc(sizeof(struct includeline) + strlen(cp) + 1); - /* On malloc failure (it happens!), free as much as possible and exit */ - if (sp == NULL) { - while (script != NULL) { - se = script; - script = script->next; - free(se); + /* + * Read the script into memory. + */ + script = se = NULL; + line = 0; + + while (fgetstr(input, sizeof(input), fd) >= 0) { + line++; + cp = input; + /* Allocate script line structure and copy line, flags */ + if (*cp == '\0') + continue; /* ignore empty line, save memory */ + sp = malloc(sizeof(struct includeline) + strlen(cp) + 1); + /* On malloc failure (it happens!), free as much as possible and exit */ + if (sp == NULL) { + while (script != NULL) { + se = script; + script = script->next; + free(se); + } + snprintf(command_errbuf, sizeof(command_errbuf), + "file '%s' line %d: memory allocation failure - aborting", + filename, line); + close(fd); + return (CMD_ERROR); } - snprintf(command_errbuf, sizeof(command_errbuf), - "file '%s' line %d: memory allocation failure - aborting", - filename, line); - close(fd); - return (CMD_ERROR); + strcpy(sp->text, cp); + sp->next = NULL; + + if (script == NULL) { + script = sp; + } else { + se->next = sp; + } + se = sp; } - strcpy(sp->text, cp); - sp->next = NULL; + close(fd); - if (script == NULL) { - script = sp; - } else { - se->next = sp; + /* + * Execute the script + */ + prevsrcid = bf_vm->sourceID.i; + bf_vm->sourceID.i = fd; + res = CMD_OK; + for (sp = script; sp != NULL; sp = sp->next) { + res = bf_run(sp->text); + if (res != VM_OUTOFTEXT) { + snprintf(command_errbuf, sizeof(command_errbuf), + "Error while including %s, in the line:\n%s", + filename, sp->text); + res = CMD_ERROR; + break; + } else + res = CMD_OK; } - se = sp; - } - close(fd); + bf_vm->sourceID.i = prevsrcid; - /* - * Execute the script - */ - prevsrcid = bf_vm->sourceID.i; - bf_vm->sourceID.i = fd; - res = CMD_OK; - for (sp = script; sp != NULL; sp = sp->next) { - - res = bf_run(sp->text); - if (res != VM_OUTOFTEXT) { - snprintf(command_errbuf, sizeof(command_errbuf), - "Error while including %s, in the line:\n%s", - filename, sp->text); - res = CMD_ERROR; - break; - } else - res = CMD_OK; - } - bf_vm->sourceID.i = prevsrcid; - - while (script != NULL) { - se = script; - script = script->next; - free(se); - } - return(res); + while (script != NULL) { + se = script; + script = script->next; + free(se); + } + return(res); } Modified: head/stand/common/interp_simple.c ============================================================================== --- head/stand/common/interp_simple.c Wed Feb 7 22:53:53 2018 (r328998) +++ head/stand/common/interp_simple.c Wed Feb 7 23:27:25 2018 (r328999) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); static int perform(int argc, char *argv[]) { - int result; + int result; struct bootblk_command **cmdp; bootblk_cmd_t *cmd; @@ -78,8 +78,8 @@ interp_init(void) int interp_run(const char *input) { - int argc; - char **argv; + int argc; + char **argv; if (parse(&argc, &argv, input)) { printf("parse error\n"); From owner-svn-src-head@freebsd.org Wed Feb 7 23:27:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C9C7EE3BDC; Wed, 7 Feb 2018 23:27:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20B4484B89; Wed, 7 Feb 2018 23:27: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B94E5CB1; Wed, 7 Feb 2018 23:27:39 +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 w17NRcPd096795; Wed, 7 Feb 2018 23:27:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17NRc5T096792; Wed, 7 Feb 2018 23:27:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802072327.w17NRc5T096792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 23:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329000 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329000 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.25 Precedence: list List-Id: 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, 07 Feb 2018 23:27:39 -0000 Author: imp Date: Wed Feb 7 23:27:38 2018 New Revision: 329000 URL: https://svnweb.freebsd.org/changeset/base/329000 Log: Move simple interpreter 'perform' into interp.c and call it interp_builtin_cmd(). Modified: head/stand/common/bootstrap.h head/stand/common/interp.c head/stand/common/interp_simple.c Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Wed Feb 7 23:27:25 2018 (r328999) +++ head/stand/common/bootstrap.h Wed Feb 7 23:27:38 2018 (r329000) @@ -47,6 +47,8 @@ extern char command_errbuf[COMMAND_ERRBUFSZ]; /* interp.c */ void interact(void); void interp_emit_prompt(void); +int interp_builtin_cmd(int argc, char *argv[]); + /* Called by interp.c for interp_*.c embedded interpreters */ int interp_include(const char *filename); /* Execute commands from filename */ void interp_init(void); /* Initialize interpreater */ Modified: head/stand/common/interp.c ============================================================================== --- head/stand/common/interp.c Wed Feb 7 23:27:25 2018 (r328999) +++ head/stand/common/interp.c Wed Feb 7 23:27:38 2018 (r329000) @@ -139,3 +139,35 @@ interp_emit_prompt(void) putchar(' '); free(pr); } + +/* + * Perform a builtin command + */ +int +interp_builtin_cmd(int argc, char *argv[]) +{ + int result; + struct bootblk_command **cmdp; + bootblk_cmd_t *cmd; + + if (argc < 1) + return(CMD_OK); + + /* set return defaults; a successful command will override these */ + command_errmsg = command_errbuf; + strcpy(command_errbuf, "no error message"); + cmd = NULL; + result = CMD_ERROR; + + /* search the command set for the command */ + SET_FOREACH(cmdp, Xcommand_set) { + if (((*cmdp)->c_name != NULL) && !strcmp(argv[0], (*cmdp)->c_name)) + cmd = (*cmdp)->c_fn; + } + if (cmd != NULL) { + result = (cmd)(argc, argv); + } else { + command_errmsg = "unknown command"; + } + return(result); +} Modified: head/stand/common/interp_simple.c ============================================================================== --- head/stand/common/interp_simple.c Wed Feb 7 23:27:25 2018 (r328999) +++ head/stand/common/interp_simple.c Wed Feb 7 23:27:38 2018 (r329000) @@ -35,38 +35,6 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" -/* - * Perform the command - */ -static int -perform(int argc, char *argv[]) -{ - int result; - struct bootblk_command **cmdp; - bootblk_cmd_t *cmd; - - if (argc < 1) - return(CMD_OK); - - /* set return defaults; a successful command will override these */ - command_errmsg = command_errbuf; - strcpy(command_errbuf, "no error message"); - cmd = NULL; - result = CMD_ERROR; - - /* search the command set for the command */ - SET_FOREACH(cmdp, Xcommand_set) { - if (((*cmdp)->c_name != NULL) && !strcmp(argv[0], (*cmdp)->c_name)) - cmd = (*cmdp)->c_fn; - } - if (cmd != NULL) { - result = (cmd)(argc, argv); - } else { - command_errmsg = "unknown command"; - } - return(result); -} - void interp_init(void) { @@ -86,7 +54,7 @@ interp_run(const char *input) return CMD_ERROR; } - if (perform(argc, argv)) { + if (interp_builtin_cmd(argc, argv)) { printf("%s: %s\n", argv[0], command_errmsg); free(argv); return CMD_ERROR; @@ -195,7 +163,7 @@ interp_include(const char *filename) /* Parse the command */ if (!parse(&argc, &argv, sp->text)) { - if ((argc > 0) && (perform(argc, argv) != 0)) { + if ((argc > 0) && (interp_builtin_cmd(argc, argv) != 0)) { /* normal command */ printf("%s: %s\n", argv[0], command_errmsg); if (!(sp->flags & SL_IGNOREERR)) { From owner-svn-src-head@freebsd.org Wed Feb 7 23:45:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D6B7EE4EDC; Wed, 7 Feb 2018 23:45:14 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3F6B8598C; Wed, 7 Feb 2018 23:45:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A723E5FE3; Wed, 7 Feb 2018 23:45:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17NjDrU006584; Wed, 7 Feb 2018 23:45:13 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17NjDmD006583; Wed, 7 Feb 2018 23:45:13 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802072345.w17NjDmD006583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 7 Feb 2018 23:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329001 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 329001 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.25 Precedence: list List-Id: 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, 07 Feb 2018 23:45:14 -0000 Author: brooks Date: Wed Feb 7 23:45:13 2018 New Revision: 329001 URL: https://svnweb.freebsd.org/changeset/base/329001 Log: Remove part of a comment reverting to nonexistant struct members. Modified: head/sys/sys/msg.h Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Wed Feb 7 23:27:38 2018 (r329000) +++ head/sys/sys/msg.h Wed Feb 7 23:45:13 2018 (r329001) @@ -81,7 +81,7 @@ struct msqid_ds_old { /* * XXX there seems to be no prefix reserved for this header, so the name * "msg" in "struct msg" and the names of all of the nonstandard members - * (mainly "msg_pad*) are namespace pollution. + * are namespace pollution. */ struct msqid_ds { From owner-svn-src-head@freebsd.org Wed Feb 7 23:58:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76B18EE5E83; Wed, 7 Feb 2018 23:58:01 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A09A860F2; Wed, 7 Feb 2018 23:58:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A8116172; Wed, 7 Feb 2018 23:58:01 +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 w17Nw0UB011854; Wed, 7 Feb 2018 23:58:00 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17Nw0e1011853; Wed, 7 Feb 2018 23:58:00 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802072358.w17Nw0e1011853@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 7 Feb 2018 23:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329002 - head/usr.bin/clang/lld X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/clang/lld X-SVN-Commit-Revision: 329002 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.25 Precedence: list List-Id: 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, 07 Feb 2018 23:58:01 -0000 Author: emaste Date: Wed Feb 7 23:58:00 2018 New Revision: 329002 URL: https://svnweb.freebsd.org/changeset/base/329002 Log: Update ld.lld.1 based on the version committed upstream Modified: head/usr.bin/clang/lld/ld.lld.1 Modified: head/usr.bin/clang/lld/ld.lld.1 ============================================================================== --- head/usr.bin/clang/lld/ld.lld.1 Wed Feb 7 23:45:13 2018 (r329001) +++ head/usr.bin/clang/lld/ld.lld.1 Wed Feb 7 23:58:00 2018 (r329002) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 10, 2018 +.Dd February 7, 2018 .Dt LD.LLD 1 .Os .Sh NAME @@ -50,7 +50,8 @@ as GNU linkers. These options are available: .Bl -tag -width indent .It Fl -allow-multiple-definition -Allow multiple definitions. +Do not error if a symbol is defined multiple times. +The first definition will be used. .It Fl -as-needed Only set .Dv DT_NEEDED @@ -69,18 +70,56 @@ Bind defined function symbols locally. Bind defined symbols locally. .It Fl -build-id= Ns Ar value Generate a build ID note. +.Ar value +may be one of +.Cm md5 , +.Cm sha1 , +.Cm tree , +.Cm uuid , +.Cm 0x Ns Ar hex-string , +and +.Cm none . +.Cm tree +is an alias for +.Cm sha1 . +Build-IDs of type +.Cm md5 , +.Cm sha1 , +and +.Cm tree +are calculated from the object contents. .It Fl -build-id Generate a build ID note. .It Fl -color-diagnostics= Ns Ar value Use colors in diagnostics. +.Ar value +may be one of +.Cm always , +.Cm auto , +and +.Cm never . +.Cm auto +enables color if and only if output is to a terminal. .It Fl -color-diagnostics -Use colors in diagnostics. +Alias for +.Fl -color-diagnostics= Ns Cm auto . .It Fl -compress-debug-sections= Ns Ar value Compress DWARF debug sections. +.Ar value +may be +.Cm none +or +.Cm zlib . .It Fl -define-common Assign space to common symbols. -.It Fl -defsym= Ns Ar value +.It Fl -defsym= Ns Ar symbol= Ns Ar expression Define a symbol alias. +.Ar expression +may be another symbol or a linker script expression. +For example, +.Fl -defsym= Ns Cm foo= Ns Cm bar +or +.Fl -defsym= Ns Cm foo= Ns Cm bar+0x100 . .It Fl -demangle Demangle symbol names. .It Fl -disable-new-dtags @@ -95,8 +134,9 @@ Keep all symbols in the symbol table. Specify the dynamic linker to be used for a dynamically linked executable. This is recorded in an ELF segment of type .Dv PT_INTERP . -.It Fl -dynamic-list Ar value -Read a list of dynamic symbols. +.It Fl -dynamic-list Ar file +Read a list of dynamic symbols from +.Ar file . .It Fl -eh-frame-hdr Request creation of .Li .eh_frame_hdr @@ -119,8 +159,10 @@ A value of zero indicates that there is no limit. Report unresolved symbols as errors. .It Fl -exclude-libs Ar value Exclude static libraries from automatic export. -.It Fl -export-dynamic-symbol Ar value -Put a symbol in the dynamic symbol table. +.It Fl -export-dynamic-symbol Ar symbol +Include +.Ar symbol +in the dynamic symbol table. .It Fl -export-dynamic Put symbols in the dynamic symbol table. .It Fl -fatal-warnings @@ -132,10 +174,16 @@ field to the specified value. .It Fl -fini Ar symbol Specify a finalizer function. .It Fl -format= Ns Ar input-format -Change the input format of the inputs following this option. -.It Fl -full-shutdown -Perform a full shutdown instead of calling -.Fn _exit . +Specify the format of the inputs following this option. +.Ar input-format +may be one of +.Cm binary , +.Cm elf , +and +.Cm default . +.Cm default +is a synonym for +.Cm elf . .It Fl -gc-sections Enable garbage collection of unused sections. .It Fl -gdb-index @@ -143,7 +191,15 @@ Generate .Li .gdb_index section. .It Fl -hash-style Ar value -Specify hash style (sysv, gnu or both). +Specify hash style. +.Ar value +may be +.Cm sysv , +.Cm gnu , +or +.Cm both . +.Cm both +is the default. .It Fl -help Print a usage message. .It Fl -icf=all @@ -169,8 +225,9 @@ Number of LTO codegen partitions. Add a directory to the library search path. .It Fl l Ar libName Root name of library to use. -.It Fl -Map Ar value -Print a link map to the specified file. +.It Fl -Map Ar file +Print a link map to +.Ar file . .It Fl m Ar value Set target emulation. .It Fl -no-as-needed @@ -203,20 +260,38 @@ Report unresolved symbols even if the linker is creati Restores the default behavior of loading archive members. .It Fl -noinhibit-exec Retain the executable output file whenever it is still usable. -.It Fl -nopie +.It Fl -no-pie Do not create a position independent executable. .It Fl -nostdlib Only search directories specified on the command line. .It Fl -oformat Ar format -Specify the binary format for the output object file. +Specify the format for the output object file. +The only supported +.Ar format +is +.Cm binary , +which produces output with no ELF header. .It Fl -omagic Set the text and data sections to be readable and writable. -.It Fl -opt-remarks-filename Ar value -YAML output file for optimization remarks. +.It Fl -opt-remarks-filename Ar file +Write optimization remarks in YAML format to +.Ar file . .It Fl -opt-remarks-with-hotness Include hotness information in the optimization remarks file. .It Fl O Ar value Optimize output file size. +.Ar value +may be: +.Bl -tag -width indent +.It Cm O0 +Disable string merging. +.It Cm O1 +Enable string merging. +.It Cm O2 +Enable string tail merging. +.El +.Cm O1 +is the default. .It Fl o Ar path Write the output executable, library, or object to .Ar path . @@ -245,9 +320,9 @@ The supported values are .Ar windows and .Ar posix . -.It Fl -script Ar value -Read linker script from the path -.Ar value . +.It Fl -script Ar file +Read linker script from +.Ar file . .It Fl -section-start Ar address Set address of section. .It Fl -shared @@ -266,8 +341,9 @@ in an archive. Strip all symbols. .It Fl -strip-debug Strip debugging information. -.It Fl -symbol-ordering-file Ar value -Lay out sections in the order specified by the symbol file. +.It Fl -symbol-ordering-file Ar file +Lay out sections in the order specified by +.Ar file . .It Fl -sysroot= Ns Ar value Set the system root. .It Fl -target1-abs @@ -312,8 +388,10 @@ Pruning policy for the ThinLTO cache. Number of ThinLTO jobs. .It Fl -threads Run the linker multi-threaded. -.It Fl -trace-symbol Ar value -Trace references to symbols. +This option is enabled by default. +.It Fl -trace-symbol Ar symbol +Trace references to +.Ar symbol . .It Fl -trace Print the names of the input files. .It Fl -Ttext Ar value @@ -322,14 +400,17 @@ Same as with .Li .text as the sectionname. -.It Fl -undefined Ar value -Force undefined symbol during linking. +.It Fl -undefined Ar symbol +Force +.Ar symbol +to be an undefined symbol during linking. .It Fl -unresolved-symbols= Ns Ar value Determine how to handle unresolved symbols. .It Fl -verbose Verbose mode. -.It Fl -version-script Ar value -Read a version script. +.It Fl -version-script Ar file +Read version script from +.Ar file . .It Fl V , Fl -version Display the version number and exit. .It Fl v @@ -346,19 +427,75 @@ Use wrapper functions for symbol. .It Fl z Ar option Linker option extensions. .Bl -tag -width indent +.It Cm execstack +Make the main stack executable. +Stack permissions are recorded in the +.Dv PT_GNU_STACK +segment. +.It Cm muldefs +Do not error if a symbol is defined multiple times. +The first definition will be used. +This is a synonym for +.Fl -allow-multiple-definition. +.It Cm nocombreloc +Disable combining and sorting multiple relocation sections. +.It Cm nocopyreloc +Disable the creation of copy relocations. +.It Cm nodelete +Set the +.Dv DF_1_NODELETE +flag to indicate that the object cannot be unloaded from a process. +.It Cm nodlopen +Set the +.Dv DF_1_NOOPEN +flag to indcate that the object may not be opened by +.Xr dlopen 3 . +.It Cm norelro +Do not indicate that portions of the object shold be mapped read-only +after initial relocation processing. +The object will omit the +.Dv PT_GNU_RELRO +segment. .It Cm notext Allow relocations against read-only segments. Sets the .Dv DT_TEXTREL flag in the .Dv DYNAMIC section. +.It Cm now +Set the +.Dv DF_BIND_NOW +flag to indicate that the run-time loader should perform all relocation +processing as part of object initialization. +By default relocations may be performed on demand. +.It Cm origin +Set the +.Dv DF_ORIGIN +flag to indicate that the object requires +$ORIGIN +processing. +.It Cm retpolineplt +Emit retpoline format PLT entries as a mitigation for CVE-2017-5715. +.It Cm rodynamic +Make the +.Li .dynamic +section read-only. +The +.Dv DT_DEBUG +tag will not be emitted. +.It Cm stack-size= Ns Ar size +Set the main thread's stack size to +.Ar size . +The stack size is recorded as the size of the +.Ar size . +.Dv PT_GNU_STACK +program segment. .It Cm text Do not allow relocations against read-only segments. This is the default. +.It Cm wxneeded +Create a +.Dv PT_OPENBSD_WXNEEDED +segment. .El .El -.Sh IMPLEMENTATION NOTES -The targets supported by -.Nm -are: -elf32-i386 elf32-iamcu elf32-littlearm elf32-ntradbigmips elf32-ntradlittlemips elf32-powerpc elf32-tradbigmips elf32-tradlittlemips elf32-x86-64 elf64-amdgpu elf64-littleaarch64 elf64-powerpc elf64-tradbigmips elf64-tradlittlemips elf64-x86-64 From owner-svn-src-head@freebsd.org Thu Feb 8 00:09:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63AECEE6BC0; Thu, 8 Feb 2018 00:09:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11D4786771; Thu, 8 Feb 2018 00:09:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 024E6631D; Thu, 8 Feb 2018 00:09:18 +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 w1809HcO016638; Thu, 8 Feb 2018 00:09:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1809Hjb016637; Thu, 8 Feb 2018 00:09:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802080009.w1809Hjb016637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 8 Feb 2018 00:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329003 - head/usr.bin/clang/lld X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/clang/lld X-SVN-Commit-Revision: 329003 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.25 Precedence: list List-Id: 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, 08 Feb 2018 00:09:18 -0000 Author: emaste Date: Thu Feb 8 00:09:17 2018 New Revision: 329003 URL: https://svnweb.freebsd.org/changeset/base/329003 Log: ld.lld.1: explain long options may use one or two dashes Modified: head/usr.bin/clang/lld/ld.lld.1 Modified: head/usr.bin/clang/lld/ld.lld.1 ============================================================================== --- head/usr.bin/clang/lld/ld.lld.1 Wed Feb 7 23:58:00 2018 (r329002) +++ head/usr.bin/clang/lld/ld.lld.1 Thu Feb 8 00:09:17 2018 (r329003) @@ -47,6 +47,17 @@ is a drop-in replacement for the GNU BFD and gold link It accepts most of the same command line arguments and linker scripts as GNU linkers. .Pp +Many options have both a single-letter and long form. +When using the long form options other than those beginning with the +letter +.Cm o +may be specified using either one or two dashes preceeding the option name. +Long options beginning with +.Cm o +require two dashes to avoid confusion with the +.Fl o Ar path +option. +.Pp These options are available: .Bl -tag -width indent .It Fl -allow-multiple-definition From owner-svn-src-head@freebsd.org Thu Feb 8 00:14:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97D0FEE71CE; Thu, 8 Feb 2018 00:14:21 +0000 (UTC) (envelope-from jeb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46A3686C7C; Thu, 8 Feb 2018 00:14:21 +0000 (UTC) (envelope-from jeb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D23E64AC; Thu, 8 Feb 2018 00:14:21 +0000 (UTC) (envelope-from jeb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w180ELpv021336; Thu, 8 Feb 2018 00:14:21 GMT (envelope-from jeb@FreeBSD.org) Received: (from jeb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w180ELRH021335; Thu, 8 Feb 2018 00:14:21 GMT (envelope-from jeb@FreeBSD.org) Message-Id: <201802080014.w180ELRH021335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeb set sender to jeb@FreeBSD.org using -f From: Jeb Cramer Date: Thu, 8 Feb 2018 00:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329004 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: jeb X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 329004 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.25 Precedence: list List-Id: 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, 08 Feb 2018 00:14:21 -0000 Author: jeb Date: Thu Feb 8 00:14:20 2018 New Revision: 329004 URL: https://svnweb.freebsd.org/changeset/base/329004 Log: Add myself to committers-src.dot Reviewed by: erj (mentor) Approved by: erj (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Feb 8 00:09:17 2018 (r329003) +++ head/share/misc/committers-src.dot Thu Feb 8 00:14:20 2018 (r329004) @@ -197,6 +197,7 @@ jasone [label="Jason Evans\njasone@FreeBSD.org\n1999/0 jceel [label="Jakub Klama\njceel@FreeBSD.org\n2011/09/25"] jch [label="Julien Charbon\njch@FreeBSD.org\n2014/09/24"] jchandra [label="Jayachandran C.\njchandra@FreeBSD.org\n2010/05/19"] +jeb [label="Jeb Cramer\njeb@FreeBSD.org\n2018/01/25"] jeff [label="Jeff Roberson\njeff@FreeBSD.org\n2002/02/21"] jh [label="Jaakko Heinonen\njh@FreeBSD.org\n2009/10/02"] jhb [label="John Baldwin\njhb@FreeBSD.org\n1999/08/23"] @@ -485,6 +486,8 @@ emaste -> rstone emax -> markus +erj -> jeb + fjoe -> versus gallatin -> ticso @@ -773,6 +776,7 @@ sam -> benjsc sam -> sephe sbruno -> hiren +sbruno -> jeb sbruno -> jimharris sbruno -> shurd From owner-svn-src-head@freebsd.org Thu Feb 8 00:42:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 392A5EE9039; Thu, 8 Feb 2018 00:42:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E03D787D99; Thu, 8 Feb 2018 00:42:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C17F06976; Thu, 8 Feb 2018 00:42:28 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w180gS29036151; Thu, 8 Feb 2018 00:42:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w180gSTk036148; Thu, 8 Feb 2018 00:42:28 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802080042.w180gSTk036148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 8 Feb 2018 00:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329007 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 329007 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.25 Precedence: list List-Id: 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, 08 Feb 2018 00:42:29 -0000 Author: brooks Date: Thu Feb 8 00:42:28 2018 New Revision: 329007 URL: https://svnweb.freebsd.org/changeset/base/329007 Log: style(9): use a type for each member in struct defintions. Shorten a comment to fit in 80 columns. Modified: head/sys/sys/msg.h head/sys/sys/sem.h Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Thu Feb 8 00:42:02 2018 (r329006) +++ head/sys/sys/msg.h Thu Feb 8 00:42:28 2018 (r329007) @@ -138,12 +138,12 @@ struct msg { * two between 8 and 1024 inclusive (and panic's if it isn't). */ struct msginfo { - int msgmax, /* max chars in a message */ - msgmni, /* max message queue identifiers */ - msgmnb, /* max chars in a queue */ - msgtql, /* max messages in system */ - msgssz, /* size of a message segment (see notes above) */ - msgseg; /* number of message segments */ + int msgmax; /* max chars in a message */ + int msgmni; /* max message queue identifiers */ + int msgmnb; /* max chars in a queue */ + int msgtql; /* max messages in system */ + int msgssz; /* size of a message segment (see note) */ + int msgseg; /* number of message segments */ }; extern struct msginfo msginfo; Modified: head/sys/sys/sem.h ============================================================================== --- head/sys/sys/sem.h Thu Feb 8 00:42:02 2018 (r329006) +++ head/sys/sys/sem.h Thu Feb 8 00:42:28 2018 (r329007) @@ -107,15 +107,15 @@ union semun { * semaphore info struct */ struct seminfo { - int semmni, /* # of semaphore identifiers */ - semmns, /* # of semaphores in system */ - semmnu, /* # of undo structures in system */ - semmsl, /* max # of semaphores per id */ - semopm, /* max # of operations per semop call */ - semume, /* max # of undo entries per process */ - semusz, /* size in bytes of undo structure */ - semvmx, /* semaphore maximum value */ - semaem; /* adjust on exit max value */ + int semmni; /* # of semaphore identifiers */ + int semmns; /* # of semaphores in system */ + int semmnu; /* # of undo structures in system */ + int semmsl; /* max # of semaphores per id */ + int semopm; /* max # of operations per semop call */ + int semume; /* max # of undo entries per process */ + int semusz; /* size in bytes of undo structure */ + int semvmx; /* semaphore maximum value */ + int semaem; /* adjust on exit max value */ }; extern struct seminfo seminfo; From owner-svn-src-head@freebsd.org Thu Feb 8 01:34:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB40EEC9F4; Thu, 8 Feb 2018 01:34:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F42326A2BC; Thu, 8 Feb 2018 01:34:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB82726E; Thu, 8 Feb 2018 01:34:35 +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 w181YZ8R062345; Thu, 8 Feb 2018 01:34:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w181YZ2O062344; Thu, 8 Feb 2018 01:34:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802080134.w181YZ2O062344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Feb 2018 01:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329009 - head/usr.sbin/mountd X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/mountd X-SVN-Commit-Revision: 329009 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.25 Precedence: list List-Id: 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, 08 Feb 2018 01:34:36 -0000 Author: cem Date: Thu Feb 8 01:34:35 2018 New Revision: 329009 URL: https://svnweb.freebsd.org/changeset/base/329009 Log: mountd(8): Produce vaguely meaningful error messages Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/mountd/mountd.c Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Thu Feb 8 00:59:56 2018 (r329008) +++ head/usr.sbin/mountd/mountd.c Thu Feb 8 01:34:35 2018 (r329009) @@ -201,7 +201,7 @@ static struct hostlist *get_ht(void); static int get_line(void); static void get_mountlist(void); static int get_net(char *, struct netmsk *, int); -static void getexp_err(struct exportlist *, struct grouplist *); +static void getexp_err(struct exportlist *, struct grouplist *, const char *); static struct grouplist *get_grp(void); static void hang_dirp(struct dirlist *, struct grouplist *, struct exportlist *, int); @@ -1450,12 +1450,13 @@ get_exportlist_one(void) tgrp = grp = get_grp(); while (len > 0) { if (len > MNTNAMLEN) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "mountpoint too long"); goto nextline; } if (*cp == '-') { if (ep == (struct exportlist *)NULL) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "flag before export path definition"); goto nextline; } if (debug) @@ -1463,7 +1464,7 @@ get_exportlist_one(void) got_nondir = 1; if (do_opt(&cp, &endcp, ep, grp, &has_host, &exflags, &anon)) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } } else if (*cp == '/') { @@ -1471,8 +1472,7 @@ get_exportlist_one(void) *endcp = '\0'; if (v4root_phase > 1) { if (dirp != NULL) { - syslog(LOG_ERR, "Multiple V4 dirs"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "Multiple V4 dirs"); goto nextline; } } @@ -1482,14 +1482,12 @@ get_exportlist_one(void) syslog(LOG_ERR, "Warning: exporting of " "automounted fs %s not supported", cp); if (got_nondir) { - syslog(LOG_ERR, "dirs must be first"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "dirs must be first"); goto nextline; } if (v4root_phase == 1) { if (dirp != NULL) { - syslog(LOG_ERR, "Multiple V4 dirs"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "Multiple V4 dirs"); goto nextline; } if (strlen(v4root_dirpath) == 0) { @@ -1499,7 +1497,7 @@ get_exportlist_one(void) != 0) { syslog(LOG_ERR, "different V4 dirpath %s", cp); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } dirp = cp; @@ -1512,7 +1510,8 @@ get_exportlist_one(void) fsb.f_fsid.val[0] || ep->ex_fs.val[1] != fsb.f_fsid.val[1]) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "fsid mismatch"); goto nextline; } } else { @@ -1545,7 +1544,8 @@ get_exportlist_one(void) dirplen = len; } } else { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "symbolic link in export path or statfs failed"); goto nextline; } *endcp = savedc; @@ -1554,7 +1554,8 @@ get_exportlist_one(void) *endcp = '\0'; got_nondir = 1; if (ep == (struct exportlist *)NULL) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, + "host(s) before export path definition"); goto nextline; } @@ -1592,7 +1593,7 @@ get_exportlist_one(void) len = endcp - cp; } if (check_options(dirhead)) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } if (!has_host) { @@ -1605,8 +1606,7 @@ get_exportlist_one(void) * host(s) on the same line. */ } else if ((opt_flags & OP_NET) && tgrp->gr_next) { - syslog(LOG_ERR, "network/host conflict"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "network/host conflict"); goto nextline; /* @@ -1618,14 +1618,13 @@ get_exportlist_one(void) while (grp && grp->gr_type == GT_IGNORE) grp = grp->gr_next; if (! grp) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "no valid entries"); goto nextline; } } if (v4root_phase == 1) { - syslog(LOG_ERR, "V4:root, no dirp, ignored"); - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, "V4:root, no dirp, ignored"); goto nextline; } @@ -1638,7 +1637,7 @@ get_exportlist_one(void) do { if (do_mount(ep, grp, exflags, &anon, dirp, dirplen, &fsb)) { - getexp_err(ep, tgrp); + getexp_err(ep, tgrp, NULL); goto nextline; } } while (grp->gr_next && (grp = grp->gr_next)); @@ -1880,12 +1879,17 @@ get_grp(void) * Clean up upon an error in get_exportlist(). */ static void -getexp_err(struct exportlist *ep, struct grouplist *grp) +getexp_err(struct exportlist *ep, struct grouplist *grp, const char *reason) { struct grouplist *tgrp; - if (!(opt_flags & OP_QUIET)) - syslog(LOG_ERR, "bad exports list line %s", line); + if (!(opt_flags & OP_QUIET)) { + if (reason != NULL) + syslog(LOG_ERR, "bad exports list line '%s': %s", line, + reason); + else + syslog(LOG_ERR, "bad exports list line '%s'", line); + } if (ep && (ep->ex_flag & EX_LINKED) == 0) free_exp(ep); while (grp) { From owner-svn-src-head@freebsd.org Thu Feb 8 05:18:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFA09F03980; Thu, 8 Feb 2018 05:18:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8600A73773; Thu, 8 Feb 2018 05:18:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 810A01191D; Thu, 8 Feb 2018 05:18:30 +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 w185IUiw071677; Thu, 8 Feb 2018 05:18:30 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w185IUxl071676; Thu, 8 Feb 2018 05:18:30 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802080518.w185IUxl071676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 8 Feb 2018 05:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329013 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 329013 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.25 Precedence: list List-Id: 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, 08 Feb 2018 05:18:31 -0000 Author: jhibbits Date: Thu Feb 8 05:18:30 2018 New Revision: 329013 URL: https://svnweb.freebsd.org/changeset/base/329013 Log: Temporarily widen count for interrupt rate calculations on 32-bit archs If the interrupt count is very high (greater than ~42M), notably on one-shot execution on long running systems, the intermediate multiplication step in the rate calculation will overflow the width of a 32-bit architecture long (32 bits), causing the rest of the calculation to calculate with a truncated value, and report very low rates (sometimes 0). MFC after: 2 weeks Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Thu Feb 8 03:12:25 2018 (r329012) +++ head/usr.bin/vmstat/vmstat.c Thu Feb 8 05:18:30 2018 (r329013) @@ -1304,7 +1304,7 @@ print_intrcnts(unsigned long *intrcnts, unsigned long for (i = 0, intrcnt=intrcnts, old_intrcnt=old_intrcnts; i < nintr; i++) { if (intrname[0] != '\0' && (*intrcnt != 0 || aflag)) { count = *intrcnt - *old_intrcnt; - rate = (count * 1000 + period_ms / 2) / period_ms; + rate = ((uint64_t)count * 1000 + period_ms / 2) / period_ms; xo_open_instance("interrupt"); xo_emit("{d:name/%-*s}{ket:name/%s} " "{:total/%20lu} {:rate/%10lu}\n", From owner-svn-src-head@freebsd.org Thu Feb 8 07:02:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E68CF08659; Thu, 8 Feb 2018 07:02:39 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (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 DDE5076D92; Thu, 8 Feb 2018 07:02:38 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f67.google.com with SMTP id f137so4916475lfe.4; Wed, 07 Feb 2018 23:02:38 -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:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fE66gdnEto4YEQZDvxg/dWstwreQv9Kmtzo9FlPe9K4=; b=I1pBtbhhSGo12kQLqXL8zxZLiD/cXxPEcOy2XSpiB4SAWmrlcZxBK1aGBCOgKgS4ig MgFc+YNTRd0V3iU883IhJdCwPKX6dk45wIbHLHDQSJS6/1RB3TatHuE0hKnNf64g60mw y5EViprv+ZjhXmZ9jcHkbuOfQbUm0ptIbmr3XlRCNUXxUuIsirnRmsZUIOu/NRmdtAOT m7mtmjWEwaAvyYfWblXarLFwxO5s6XM2Xg0swktQg/8FpiFp8URvG4IrqhhFcwx5R1QP YwraQVydanCYWMN1EaUSd1+ZllCeKs1kIVCGWf8un2we6N2Ffb24W+rFbAWR+eNtIx1T HjlA== X-Gm-Message-State: APf1xPCNU7Te87p1g5k2WJPanw2EB6LZneW/WMYUmNhn4KFf22uvI0/f xI/ZtuP858s1scy2wwqJqCxPnZBO X-Google-Smtp-Source: AH8x226VS5iO8yClbUDh+lbQcUw55pBS2QtF0AtHUJ4zI9ykkf8ZbBiND3NHGV8uN+xRnuKFNUd9WA== X-Received: by 10.25.22.234 with SMTP id 103mr6339828lfw.70.1518071800190; Wed, 07 Feb 2018 22:36:40 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id a197sm685542lfe.88.2018.02.07.22.36.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Feb 2018 22:36:39 -0800 (PST) Subject: Re: svn commit: r328996 - head/sys/kern To: Steven Hartland , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201802072152.w17Lq0gd048728@repo.freebsd.org> <1076365a-db07-0b28-9f97-3a7cc2a73dd6@multiplay.co.uk> From: Andriy Gapon Message-ID: <4b73bfc1-9b08-11e6-85a6-2b8e4d689a81@FreeBSD.org> Date: Thu, 8 Feb 2018 08:36:38 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1076365a-db07-0b28-9f97-3a7cc2a73dd6@multiplay.co.uk> 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.25 Precedence: list List-Id: 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, 08 Feb 2018 07:02:39 -0000 On 08/02/2018 00:41, Steven Hartland wrote: > What would be the expected behavior if this was triggered, app crash or kernel > panic...? To be honest, I haven't analyzed it much. I would expect either a crash when trying to unbusy a page that is not busy or hanging while forever waiting for a leaked page to get unbusied or hitting some KASSERT. > On 07/02/2018 21:52, Andriy Gapon wrote: >> Author: avg >> Date: Wed Feb 7 21:51:59 2018 >> New Revision: 328996 >> URL: https://svnweb.freebsd.org/changeset/base/328996 >> >> Log: >> exec_map_first_page: fix an inverse condition introduced in r254138 >> >> While the bug itself was serious, as we could either pass a non-busied >> page to vm_pager_get_pages() or leak a busy page, it could only be >> triggered under a very rare condition where the page is already inserted >> into the object, but it is not valid yet. >> >> Reviewed by: kib >> MFC after: 2 weeks >> >> Modified: >> head/sys/kern/kern_exec.c >> >> Modified: head/sys/kern/kern_exec.c >> ============================================================================== >> --- head/sys/kern/kern_exec.c Wed Feb 7 20:36:37 2018 (r328995) >> +++ head/sys/kern/kern_exec.c Wed Feb 7 21:51:59 2018 (r328996) >> @@ -1009,7 +1009,7 @@ exec_map_first_page(imgp) >> if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { >> if (ma[i]->valid) >> break; >> - if (vm_page_tryxbusy(ma[i])) >> + if (!vm_page_tryxbusy(ma[i])) >> break; >> } else { >> ma[i] = vm_page_alloc(object, i, >> > -- Andriy Gapon From owner-svn-src-head@freebsd.org Thu Feb 8 13:22:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FDBFF035F2; Thu, 8 Feb 2018 13:22:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1440387D3D; Thu, 8 Feb 2018 13:22:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F021168EF; Thu, 8 Feb 2018 13:22:41 +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 w18DMeWC017480; Thu, 8 Feb 2018 13:22:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18DMeQt017479; Thu, 8 Feb 2018 13:22:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802081322.w18DMeQt017479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 8 Feb 2018 13:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329016 - 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: 329016 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.25 Precedence: list List-Id: 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, 08 Feb 2018 13:22:41 -0000 Author: avg Date: Thu Feb 8 13:22:40 2018 New Revision: 329016 URL: https://svnweb.freebsd.org/changeset/base/329016 Log: remove a duplicate assignment There should be no functional change. MFC after: 1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Feb 8 09:24:23 2018 (r329015) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Feb 8 13:22:40 2018 (r329016) @@ -4700,7 +4700,6 @@ zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t l } if (zp->z_blksz < PAGE_SIZE) { - i = 0; for (i = 0; len > 0; off += tocopy, len -= tocopy, i++) { tocopy = len > PAGE_SIZE ? PAGE_SIZE : len; va = zfs_map_page(ma[i], &sf); From owner-svn-src-head@freebsd.org Thu Feb 8 14:53:35 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D1CCF09FAC; Thu, 8 Feb 2018 14:53:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F76D6BBAE; Thu, 8 Feb 2018 14:53:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A6E617798; Thu, 8 Feb 2018 14:53:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18ErY4m062230; Thu, 8 Feb 2018 14:53:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18ErYam062228; Thu, 8 Feb 2018 14:53:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802081453.w18ErYam062228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 8 Feb 2018 14:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329018 - in head: lib/libc/rpc usr.sbin/ypserv X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: lib/libc/rpc usr.sbin/ypserv X-SVN-Commit-Revision: 329018 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.25 Precedence: list List-Id: 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, 08 Feb 2018 14:53:35 -0000 Author: pfg Date: Thu Feb 8 14:53:34 2018 New Revision: 329018 URL: https://svnweb.freebsd.org/changeset/base/329018 Log: su_data: correct macro expansion. Protect su_data() users from strange macro expansion. Obtained from: linux libtirpc Modified: head/lib/libc/rpc/svc_dg.c head/usr.sbin/ypserv/yp_svc_udp.c Modified: head/lib/libc/rpc/svc_dg.c ============================================================================== --- head/lib/libc/rpc/svc_dg.c Thu Feb 8 14:39:07 2018 (r329017) +++ head/lib/libc/rpc/svc_dg.c Thu Feb 8 14:53:34 2018 (r329018) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include "rpc_com.h" #include "mt_misc.h" -#define su_data(xprt) ((struct svc_dg_data *)(xprt->xp_p2)) +#define su_data(xprt) ((struct svc_dg_data *)((xprt)->xp_p2)) #define rpc_buffer(xprt) ((xprt)->xp_p1) #ifndef MAX Modified: head/usr.sbin/ypserv/yp_svc_udp.c ============================================================================== --- head/usr.sbin/ypserv/yp_svc_udp.c Thu Feb 8 14:39:07 2018 (r329017) +++ head/usr.sbin/ypserv/yp_svc_udp.c Thu Feb 8 14:53:34 2018 (r329018) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include "yp_extern.h" -#define su_data(xprt) ((struct svc_dg_data *)(xprt->xp_p2)) +#define su_data(xprt) ((struct svc_dg_data *)((xprt)->xp_p2)) /* * We need to be able to manually set the transaction ID in the From owner-svn-src-head@freebsd.org Thu Feb 8 16:07:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51525F0F676; Thu, 8 Feb 2018 16:07:03 +0000 (UTC) (envelope-from royger@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::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 A9DFF6EC78; Thu, 8 Feb 2018 16:07:02 +0000 (UTC) (envelope-from royger@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id v123so10955078wmd.5; Thu, 08 Feb 2018 08:07:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=xJAmm1c4l0VIlgSn2nb7lpyAGQP6xPkvZQTsgWk9jzM=; b=vYzQ7eqJXzKEaXyEjD2tFrBCeZ44DghKfnnihjlO+NN4wqGgpAsw63XjaLH88QIRRC YqV1hwyx9jUzyLYIBYF8KYjhFiGF4vd5DT/449LA/3j9CiMqU7JHKnCOPMobAj2bm5aD +pcMVhPV7Di9uK65DCGHF2imdrblOmK820HuqKJ9DXpqJ9Bw3w0U7mjWV6RSUiw7cxyz cxSKZ8gsZoiLHJgxSXSZsmOmBWrDy6Y67xHwbF8hgNr7mBJPVilvW0ZUcfHEX0Wh26/O GJWZRZPUhzonaCjwf6ZWJ/czLQb6kMYrysQ9f079O2thgQAx/RsmgJ7j4s3zzm0Bu/ZZ +0rQ== 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:cc:subject:message-id :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=xJAmm1c4l0VIlgSn2nb7lpyAGQP6xPkvZQTsgWk9jzM=; b=cHZj0We4TYsZbA7jYOQ8Nz7MD8tLBUgQGRZtTWpsB2BtiL9p0PmdqXaZW/pXeKnxlM 8MhsYB0nafBLKmQUp77+LsCkJjge9lKGcxa2tZkEq9y6A6QCGzUqSr7/2Vo0xGIDGQe0 Q2SoJw2PaQHf3eEiqH86SfmuKRk5F4qdS6L09hdbaG1Rtuq04VYwUW1xB0xtGDJKVSm1 0k02E5gP9mgT0g61G1+qQ1tS7J3KOkHLbyF2pn2gar4jzD2EfN3HN33Ld1Kw9ZU1E0/O QrqdXlr7UiuBcoiDlqFZbl4G6NcnvBqVcLzD3uopmwxYM5qhY+dovx9v/w64g7s45ZyA 5O6w== X-Gm-Message-State: APf1xPBlXrnf8OyW6lJJ+PpoONO8C7KMuOS+zm3q+MlQMTsKaKw8DEig 6y8YcDiXQnLa0417MRGWOfOONw== X-Google-Smtp-Source: AH8x225GNT6KCpZEsWtzTL8m0/MTGCHu8pgsYWfHFtv0BQf/zYgu7rqy+BUC0+dUhKOMb6LzVvFmww== X-Received: by 10.80.186.5 with SMTP id g5mr2224719edc.12.1518106021295; Thu, 08 Feb 2018 08:07:01 -0800 (PST) Received: from localhost (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id p32sm122038eda.69.2018.02.08.08.06.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 08:06:59 -0800 (PST) Sender: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= Date: Thu, 8 Feb 2018 16:06:49 +0000 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Wojciech Macek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328536 - in head/stand: common powerpc/kboot Message-ID: <20180208160649.pmkg42i63eipdgiv@MacBook-Pro-de-Roger.local> References: <20180131151823.fwigjbd5uubhshpj@MacBook-Pro-de-Roger.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180131151823.fwigjbd5uubhshpj@MacBook-Pro-de-Roger.local> User-Agent: NeoMutt/20171208 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 08 Feb 2018 16:07:03 -0000 Ping? Ed committed a band-aid, but we need to get this fixed. On Wed, Jan 31, 2018 at 03:20:46PM +0000, Roger Pau Monné wrote: > On Mon, Jan 29, 2018 at 09:24:28AM +0000, Wojciech Macek wrote: > > Modified: head/stand/common/load_elf.c > > ============================================================================== > > --- head/stand/common/load_elf.c Mon Jan 29 09:21:08 2018 (r328535) > > +++ head/stand/common/load_elf.c Mon Jan 29 09:24:28 2018 (r328536) > > @@ -29,6 +29,7 @@ > > __FBSDID("$FreeBSD$"); > > > > #include > > +#include > > #include > > #include > > #include > > @@ -118,15 +119,72 @@ __elfN(load_elf_header)(char *filename, elf_file_t ef) > > err = EFTYPE; > > goto error; > > } > > + > > if (ehdr->e_ident[EI_CLASS] != ELF_TARG_CLASS || /* Layout ? */ > > ehdr->e_ident[EI_DATA] != ELF_TARG_DATA || > > So here you force EI_DATA == ELF_TARG_DATA in order to continue... > > > - ehdr->e_ident[EI_VERSION] != EV_CURRENT || /* Version ? */ > > - ehdr->e_version != EV_CURRENT || > > - ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */ > > + ehdr->e_ident[EI_VERSION] != EV_CURRENT) /* Version ? */ { > > err = EFTYPE; > > goto error; > > } > > > > + /* > > + * Fixup ELF endianness. > > + * > > + * The Xhdr structure was loaded using block read call to > > + * optimize file accesses. It might happen, that the endianness > > + * of the system memory is different that endianness of > > + * the ELF header. > > + * Swap fields here to guarantee that Xhdr always contain > > + * valid data regardless of architecture. > > + */ > > + if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) { > > + ehdr->e_type = be16toh(ehdr->e_type); > > ... yet here you check for EI_DATA == ELFDATA2MSB which AFAICT it's not > possible given the check above, so the following if branch is dead > code. > > > + ehdr->e_machine = be16toh(ehdr->e_machine); > > + ehdr->e_version = be32toh(ehdr->e_version); > > + if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { > > + ehdr->e_entry = be64toh(ehdr->e_entry); > > + ehdr->e_phoff = be64toh(ehdr->e_phoff); > > + ehdr->e_shoff = be64toh(ehdr->e_shoff); > > + } else { > > + ehdr->e_entry = be32toh(ehdr->e_entry); > > + ehdr->e_phoff = be32toh(ehdr->e_phoff); > > + ehdr->e_shoff = be32toh(ehdr->e_shoff); > > + } > > + ehdr->e_flags = be32toh(ehdr->e_flags); > > + ehdr->e_ehsize = be16toh(ehdr->e_ehsize); > > + ehdr->e_phentsize = be16toh(ehdr->e_phentsize); > > + ehdr->e_phnum = be16toh(ehdr->e_phnum); > > + ehdr->e_shentsize = be16toh(ehdr->e_shentsize); > > + ehdr->e_shnum = be16toh(ehdr->e_shnum); > > + ehdr->e_shstrndx = be16toh(ehdr->e_shstrndx); > > + > > + } else { > > + ehdr->e_type = le16toh(ehdr->e_type); > > + ehdr->e_machine = le16toh(ehdr->e_machine); > > + ehdr->e_version = le32toh(ehdr->e_version); > > + if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { > > + ehdr->e_entry = le64toh(ehdr->e_entry); > > + ehdr->e_phoff = le64toh(ehdr->e_phoff); > > + ehdr->e_shoff = le64toh(ehdr->e_shoff); > > + } else { > > + ehdr->e_entry = le32toh(ehdr->e_entry); > > + ehdr->e_phoff = le32toh(ehdr->e_phoff); > > + ehdr->e_shoff = le32toh(ehdr->e_shoff); > > + } > > + ehdr->e_flags = le32toh(ehdr->e_flags); > > + ehdr->e_ehsize = le16toh(ehdr->e_ehsize); > > + ehdr->e_phentsize = le16toh(ehdr->e_phentsize); > > + ehdr->e_phnum = le16toh(ehdr->e_phnum); > > + ehdr->e_shentsize = le16toh(ehdr->e_shentsize); > > + ehdr->e_shnum = le16toh(ehdr->e_shnum); > > + ehdr->e_shstrndx = le16toh(ehdr->e_shstrndx); > > + } > > I think this chunk (and all the similar ones below) should be put on a > macro in order to avoid such big chunks of code repetition. It's also > fairly easy to forget to change one of the branches in the future. > > Roger. > From owner-svn-src-head@freebsd.org Thu Feb 8 17:07:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 249E3F13C88; Thu, 8 Feb 2018 17:07:28 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD1307157C; Thu, 8 Feb 2018 17:07: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7CF418D23; Thu, 8 Feb 2018 17:07:27 +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 w18H7RLs027412; Thu, 8 Feb 2018 17:07:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18H7Rnv027408; Thu, 8 Feb 2018 17:07:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802081707.w18H7Rnv027408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Feb 2018 17:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329019 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329019 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.25 Precedence: list List-Id: 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, 08 Feb 2018 17:07:28 -0000 Author: imp Date: Thu Feb 8 17:07:27 2018 New Revision: 329019 URL: https://svnweb.freebsd.org/changeset/base/329019 Log: Move to tabs for indentation and to 8-space notches, per style(9). 4 space indentation with a mix of tabs and spaces is a hassle. Update to project-standard hard-tabs with 8-space indentation in these files. This matches the new code coming in better as well. Modified: head/stand/common/boot.c head/stand/common/interp_backslash.c head/stand/common/interp_parse.c Modified: head/stand/common/boot.c ============================================================================== --- head/stand/common/boot.c Thu Feb 8 14:53:34 2018 (r329018) +++ head/stand/common/boot.c Thu Feb 8 17:07:27 2018 (r329019) @@ -52,60 +52,60 @@ COMMAND_SET(boot, "boot", "boot a file or loaded kerne static int command_boot(int argc, char *argv[]) { - struct preloaded_file *fp; + struct preloaded_file *fp; - /* - * See if the user has specified an explicit kernel to boot. - */ - if ((argc > 1) && (argv[1][0] != '-')) { + /* + * See if the user has specified an explicit kernel to boot. + */ + if ((argc > 1) && (argv[1][0] != '-')) { - /* XXX maybe we should discard everything and start again? */ - if (file_findfile(NULL, NULL) != NULL) { - snprintf(command_errbuf, sizeof(command_errbuf), - "can't boot '%s', kernel module already loaded", argv[1]); - return(CMD_ERROR); + /* XXX maybe we should discard everything and start again? */ + if (file_findfile(NULL, NULL) != NULL) { + snprintf(command_errbuf, sizeof(command_errbuf), + "can't boot '%s', kernel module already loaded", argv[1]); + return(CMD_ERROR); + } + + /* find/load the kernel module */ + if (mod_loadkld(argv[1], argc - 2, argv + 2) != 0) + return(CMD_ERROR); + /* we have consumed all arguments */ + argc = 1; } - /* find/load the kernel module */ - if (mod_loadkld(argv[1], argc - 2, argv + 2) != 0) - return(CMD_ERROR); - /* we have consumed all arguments */ - argc = 1; - } + /* + * See if there is a kernel module already loaded + */ + if (file_findfile(NULL, NULL) == NULL) + if (loadakernel(0, argc - 1, argv + 1)) + /* we have consumed all arguments */ + argc = 1; - /* - * See if there is a kernel module already loaded - */ - if (file_findfile(NULL, NULL) == NULL) - if (loadakernel(0, argc - 1, argv + 1)) - /* we have consumed all arguments */ - argc = 1; + /* + * Loaded anything yet? + */ + if ((fp = file_findfile(NULL, NULL)) == NULL) { + command_errmsg = "no bootable kernel"; + return(CMD_ERROR); + } - /* - * Loaded anything yet? - */ - if ((fp = file_findfile(NULL, NULL)) == NULL) { - command_errmsg = "no bootable kernel"; - return(CMD_ERROR); - } + /* + * If we were given arguments, discard any previous. + * XXX should we merge arguments? Hard to DWIM. + */ + if (argc > 1) { + if (fp->f_args != NULL) + free(fp->f_args); + fp->f_args = unargv(argc - 1, argv + 1); + } - /* - * If we were given arguments, discard any previous. - * XXX should we merge arguments? Hard to DWIM. - */ - if (argc > 1) { - if (fp->f_args != NULL) - free(fp->f_args); - fp->f_args = unargv(argc - 1, argv + 1); - } + /* Hook for platform-specific autoloading of modules */ + if (archsw.arch_autoload() != 0) + return(CMD_ERROR); - /* Hook for platform-specific autoloading of modules */ - if (archsw.arch_autoload() != 0) + /* Call the exec handler from the loader matching the kernel */ + file_formats[fp->f_loader]->l_exec(fp); return(CMD_ERROR); - - /* Call the exec handler from the loader matching the kernel */ - file_formats[fp->f_loader]->l_exec(fp); - return(CMD_ERROR); } @@ -118,29 +118,29 @@ COMMAND_SET(autoboot, "autoboot", "boot automatically static int command_autoboot(int argc, char *argv[]) { - int howlong; - char *cp, *prompt; + int howlong; + char *cp, *prompt; - prompt = NULL; - howlong = -1; - switch(argc) { - case 3: - prompt = argv[2]; - /* FALLTHROUGH */ - case 2: - howlong = strtol(argv[1], &cp, 0); - if (*cp != 0) { - snprintf(command_errbuf, sizeof(command_errbuf), - "bad delay '%s'", argv[1]); - return(CMD_ERROR); + prompt = NULL; + howlong = -1; + switch(argc) { + case 3: + prompt = argv[2]; + /* FALLTHROUGH */ + case 2: + howlong = strtol(argv[1], &cp, 0); + if (*cp != 0) { + snprintf(command_errbuf, sizeof(command_errbuf), + "bad delay '%s'", argv[1]); + return(CMD_ERROR); + } + /* FALLTHROUGH */ + case 1: + return(autoboot(howlong, prompt)); } - /* FALLTHROUGH */ - case 1: - return(autoboot(howlong, prompt)); - } - command_errmsg = "too many arguments"; - return(CMD_ERROR); + command_errmsg = "too many arguments"; + return(CMD_ERROR); } /* @@ -150,103 +150,103 @@ command_autoboot(int argc, char *argv[]) void autoboot_maybe() { - char *cp; + char *cp; - cp = getenv("autoboot_delay"); - if ((autoboot_tried == 0) && ((cp == NULL) || strcasecmp(cp, "NO"))) - autoboot(-1, NULL); /* try to boot automatically */ + cp = getenv("autoboot_delay"); + if ((autoboot_tried == 0) && ((cp == NULL) || strcasecmp(cp, "NO"))) + autoboot(-1, NULL); /* try to boot automatically */ } int autoboot(int timeout, char *prompt) { - time_t when, otime, ntime; - int c, yes; - char *argv[2], *cp, *ep; - char *kernelname; + time_t when, otime, ntime; + int c, yes; + char *argv[2], *cp, *ep; + char *kernelname; #ifdef BOOT_PROMPT_123 - const char *seq = "123", *p = seq; + const char *seq = "123", *p = seq; #endif - autoboot_tried = 1; + autoboot_tried = 1; - if (timeout == -1) { - timeout = 10; - /* try to get a delay from the environment */ - if ((cp = getenv("autoboot_delay"))) { - timeout = strtol(cp, &ep, 0); - if (cp == ep) - timeout = 10; /* Unparseable? Set default! */ + if (timeout == -1) { + timeout = 10; + /* try to get a delay from the environment */ + if ((cp = getenv("autoboot_delay"))) { + timeout = strtol(cp, &ep, 0); + if (cp == ep) + timeout = 10; /* Unparseable? Set default! */ + } } - } - kernelname = getenv("kernelname"); - if (kernelname == NULL) { - argv[0] = NULL; - loadakernel(0, 0, argv); kernelname = getenv("kernelname"); if (kernelname == NULL) { - command_errmsg = "no valid kernel found"; - return(CMD_ERROR); + argv[0] = NULL; + loadakernel(0, 0, argv); + kernelname = getenv("kernelname"); + if (kernelname == NULL) { + command_errmsg = "no valid kernel found"; + return(CMD_ERROR); + } } - } - if (timeout >= 0) { - otime = time(NULL); - when = otime + timeout; /* when to boot */ + if (timeout >= 0) { + otime = time(NULL); + when = otime + timeout; /* when to boot */ - yes = 0; + yes = 0; #ifdef BOOT_PROMPT_123 - printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or " - "1 2 3 sequence for command prompt." : prompt); + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or " + "1 2 3 sequence for command prompt." : prompt); #else - printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); + printf("%s\n", (prompt == NULL) ? "Hit [Enter] to boot immediately, or any other key for command prompt." : prompt); #endif - for (;;) { - if (ischar()) { - c = getchar(); + for (;;) { + if (ischar()) { + c = getchar(); #ifdef BOOT_PROMPT_123 - if ((c == '\r') || (c == '\n')) { - yes = 1; - break; - } else if (c != *p++) - p = seq; - if (*p == 0) - break; + if ((c == '\r') || (c == '\n')) { + yes = 1; + break; + } else if (c != *p++) + p = seq; + if (*p == 0) + break; #else - if ((c == '\r') || (c == '\n')) - yes = 1; - break; + if ((c == '\r') || (c == '\n')) + yes = 1; + break; #endif - } - ntime = time(NULL); - if (ntime >= when) { - yes = 1; - break; - } + } + ntime = time(NULL); + if (ntime >= when) { + yes = 1; + break; + } - if (ntime != otime) { - printf("\rBooting [%s] in %d second%s... ", - kernelname, (int)(when - ntime), - (when-ntime)==1?"":"s"); - otime = ntime; - } - } - } else { - yes = 1; - } + if (ntime != otime) { + printf("\rBooting [%s] in %d second%s... ", + kernelname, (int)(when - ntime), + (when-ntime)==1?"":"s"); + otime = ntime; + } + } + } else { + yes = 1; + } - if (yes) - printf("\rBooting [%s]... ", kernelname); - putchar('\n'); - if (yes) { - argv[0] = "boot"; - argv[1] = NULL; - return(command_boot(1, argv)); - } - return(CMD_OK); + if (yes) + printf("\rBooting [%s]... ", kernelname); + putchar('\n'); + if (yes) { + argv[0] = "boot"; + argv[1] = NULL; + return(command_boot(1, argv)); + } + return(CMD_OK); } /* @@ -255,43 +255,43 @@ autoboot(int timeout, char *prompt) static char * getbootfile(int try) { - static char *name = NULL; - const char *spec, *ep; - size_t len; + static char *name = NULL; + const char *spec, *ep; + size_t len; - /* we use dynamic storage */ - if (name != NULL) { - free(name); - name = NULL; - } + /* we use dynamic storage */ + if (name != NULL) { + free(name); + name = NULL; + } - /* - * Try $bootfile, then try our builtin default - */ - if ((spec = getenv("bootfile")) == NULL) - spec = default_bootfiles; + /* + * Try $bootfile, then try our builtin default + */ + if ((spec = getenv("bootfile")) == NULL) + spec = default_bootfiles; - while ((try > 0) && (spec != NULL)) { - spec = strchr(spec, ';'); - if (spec) - spec++; /* skip over the leading ';' */ - try--; - } - if (spec != NULL) { - if ((ep = strchr(spec, ';')) != NULL) { - len = ep - spec; - } else { - len = strlen(spec); + while ((try > 0) && (spec != NULL)) { + spec = strchr(spec, ';'); + if (spec) + spec++; /* skip over the leading ';' */ + try--; } - name = malloc(len + 1); - strncpy(name, spec, len); - name[len] = 0; - } - if (name && name[0] == 0) { - free(name); - name = NULL; - } - return(name); + if (spec != NULL) { + if ((ep = strchr(spec, ';')) != NULL) { + len = ep - spec; + } else { + len = strlen(spec); + } + name = malloc(len + 1); + strncpy(name, spec, len); + name[len] = 0; + } + if (name && name[0] == 0) { + free(name); + name = NULL; + } + return(name); } /* @@ -307,109 +307,109 @@ getbootfile(int try) int getrootmount(char *rootdev) { - char lbuf[128], *cp, *ep, *dev, *fstyp, *options; - int fd, error; + char lbuf[128], *cp, *ep, *dev, *fstyp, *options; + int fd, error; - if (getenv("vfs.root.mountfrom") != NULL) - return(0); + if (getenv("vfs.root.mountfrom") != NULL) + return(0); - error = 1; - sprintf(lbuf, "%s/etc/fstab", rootdev); - if ((fd = open(lbuf, O_RDONLY)) < 0) - goto notfound; + error = 1; + sprintf(lbuf, "%s/etc/fstab", rootdev); + if ((fd = open(lbuf, O_RDONLY)) < 0) + goto notfound; - /* loop reading lines from /etc/fstab What was that about sscanf again? */ - fstyp = NULL; - dev = NULL; - while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) { - if ((lbuf[0] == 0) || (lbuf[0] == '#')) - continue; + /* loop reading lines from /etc/fstab What was that about sscanf again? */ + fstyp = NULL; + dev = NULL; + while (fgetstr(lbuf, sizeof(lbuf), fd) >= 0) { + if ((lbuf[0] == 0) || (lbuf[0] == '#')) + continue; - /* skip device name */ - for (cp = lbuf; (*cp != 0) && !isspace(*cp); cp++) - ; - if (*cp == 0) /* misformatted */ - continue; - /* delimit and save */ - *cp++ = 0; - free(dev); - dev = strdup(lbuf); + /* skip device name */ + for (cp = lbuf; (*cp != 0) && !isspace(*cp); cp++) + ; + if (*cp == 0) /* misformatted */ + continue; + /* delimit and save */ + *cp++ = 0; + free(dev); + dev = strdup(lbuf); - /* skip whitespace up to mountpoint */ - while ((*cp != 0) && isspace(*cp)) - cp++; - /* must have / to be root */ - if ((*cp == 0) || (*cp != '/') || !isspace(*(cp + 1))) - continue; - /* skip whitespace up to fstype */ - cp += 2; - while ((*cp != 0) && isspace(*cp)) - cp++; - if (*cp == 0) /* misformatted */ - continue; - /* skip text to end of fstype and delimit */ - ep = cp; - while ((*cp != 0) && !isspace(*cp)) - cp++; - *cp = 0; - free(fstyp); - fstyp = strdup(ep); + /* skip whitespace up to mountpoint */ + while ((*cp != 0) && isspace(*cp)) + cp++; + /* must have / to be root */ + if ((*cp == 0) || (*cp != '/') || !isspace(*(cp + 1))) + continue; + /* skip whitespace up to fstype */ + cp += 2; + while ((*cp != 0) && isspace(*cp)) + cp++; + if (*cp == 0) /* misformatted */ + continue; + /* skip text to end of fstype and delimit */ + ep = cp; + while ((*cp != 0) && !isspace(*cp)) + cp++; + *cp = 0; + free(fstyp); + fstyp = strdup(ep); - /* skip whitespace up to mount options */ - cp += 1; - while ((*cp != 0) && isspace(*cp)) - cp++; - if (*cp == 0) /* misformatted */ - continue; - /* skip text to end of mount options and delimit */ - ep = cp; - while ((*cp != 0) && !isspace(*cp)) - cp++; - *cp = 0; - options = strdup(ep); - /* Build the : and save it in vfs.root.mountfrom */ - sprintf(lbuf, "%s:%s", fstyp, dev); - setenv("vfs.root.mountfrom", lbuf, 0); + /* skip whitespace up to mount options */ + cp += 1; + while ((*cp != 0) && isspace(*cp)) + cp++; + if (*cp == 0) /* misformatted */ + continue; + /* skip text to end of mount options and delimit */ + ep = cp; + while ((*cp != 0) && !isspace(*cp)) + cp++; + *cp = 0; + options = strdup(ep); + /* Build the : and save it in vfs.root.mountfrom */ + sprintf(lbuf, "%s:%s", fstyp, dev); + setenv("vfs.root.mountfrom", lbuf, 0); - /* Don't override vfs.root.mountfrom.options if it is already set */ - if (getenv("vfs.root.mountfrom.options") == NULL) { - /* save mount options */ - setenv("vfs.root.mountfrom.options", options, 0); + /* Don't override vfs.root.mountfrom.options if it is already set */ + if (getenv("vfs.root.mountfrom.options") == NULL) { + /* save mount options */ + setenv("vfs.root.mountfrom.options", options, 0); + } + free(options); + error = 0; + break; } - free(options); - error = 0; - break; - } - close(fd); - free(dev); - free(fstyp); + close(fd); + free(dev); + free(fstyp); notfound: - if (error) { - const char *currdev; + if (error) { + const char *currdev; - currdev = getenv("currdev"); - if (currdev != NULL && strncmp("zfs:", currdev, 4) == 0) { - cp = strdup(currdev); - cp[strlen(cp) - 1] = '\0'; - setenv("vfs.root.mountfrom", cp, 0); - error = 0; - free(cp); + currdev = getenv("currdev"); + if (currdev != NULL && strncmp("zfs:", currdev, 4) == 0) { + cp = strdup(currdev); + cp[strlen(cp) - 1] = '\0'; + setenv("vfs.root.mountfrom", cp, 0); + error = 0; + free(cp); + } } - } - return(error); + return(error); } static int loadakernel(int try, int argc, char* argv[]) { - char *cp; + char *cp; for (try = 0; (cp = getbootfile(try)) != NULL; try++) - if (mod_loadkld(cp, argc - 1, argv + 1) != 0) - printf("can't load '%s'\n", cp); - else - return 1; + if (mod_loadkld(cp, argc - 1, argv + 1) != 0) + printf("can't load '%s'\n", cp); + else + return 1; return 0; } Modified: head/stand/common/interp_backslash.c ============================================================================== --- head/stand/common/interp_backslash.c Thu Feb 8 14:53:34 2018 (r329018) +++ head/stand/common/interp_backslash.c Thu Feb 8 17:07:27 2018 (r329019) @@ -30,138 +30,138 @@ __FBSDID("$FreeBSD$"); char * backslash(const char *str) { - /* - * Remove backslashes from the strings. Turn \040 etc. into a single - * character (we allow eight bit values). Currently NUL is not - * allowed. - * - * Turn "\n" and "\t" into '\n' and '\t' characters. Etc. - * - */ - char *new_str; - int seenbs = 0; - int i = 0; + /* + * Remove backslashes from the strings. Turn \040 etc. into a single + * character (we allow eight bit values). Currently NUL is not + * allowed. + * + * Turn "\n" and "\t" into '\n' and '\t' characters. Etc. + * + */ + char *new_str; + int seenbs = 0; + int i = 0; - if ((new_str = strdup(str)) == NULL) - return NULL; + if ((new_str = strdup(str)) == NULL) + return NULL; - while (*str) { - if (seenbs) { - seenbs = 0; - switch (*str) { - case '\\': - new_str[i++] = '\\'; - str++; - break; + while (*str) { + if (seenbs) { + seenbs = 0; + switch (*str) { + case '\\': + new_str[i++] = '\\'; + str++; + break; - /* preserve backslashed quotes, dollar signs */ - case '\'': - case '"': - case '$': - new_str[i++] = '\\'; - new_str[i++] = *str++; - break; + /* preserve backslashed quotes, dollar signs */ + case '\'': + case '"': + case '$': + new_str[i++] = '\\'; + new_str[i++] = *str++; + break; - case 'b': - new_str[i++] = '\b'; - str++; - break; + case 'b': + new_str[i++] = '\b'; + str++; + break; - case 'f': - new_str[i++] = '\f'; - str++; - break; + case 'f': + new_str[i++] = '\f'; + str++; + break; - case 'r': - new_str[i++] = '\r'; - str++; - break; + case 'r': + new_str[i++] = '\r'; + str++; + break; - case 'n': - new_str[i++] = '\n'; - str++; - break; + case 'n': + new_str[i++] = '\n'; + str++; + break; - case 's': - new_str[i++] = ' '; - str++; - break; + case 's': + new_str[i++] = ' '; + str++; + break; - case 't': - new_str[i++] = '\t'; - str++; - break; + case 't': + new_str[i++] = '\t'; + str++; + break; - case 'v': - new_str[i++] = '\13'; - str++; - break; + case 'v': + new_str[i++] = '\13'; + str++; + break; - case 'z': - str++; - break; + case 'z': + str++; + break; - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': { - char val; + case '0': case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': { + char val; - /* Three digit octal constant? */ - if (*str >= '0' && *str <= '3' && - *(str + 1) >= '0' && *(str + 1) <= '7' && - *(str + 2) >= '0' && *(str + 2) <= '7') { + /* Three digit octal constant? */ + if (*str >= '0' && *str <= '3' && + *(str + 1) >= '0' && *(str + 1) <= '7' && + *(str + 2) >= '0' && *(str + 2) <= '7') { - val = (DIGIT(*str) << 6) + (DIGIT(*(str + 1)) << 3) + - DIGIT(*(str + 2)); + val = (DIGIT(*str) << 6) + (DIGIT(*(str + 1)) << 3) + + DIGIT(*(str + 2)); - /* Allow null value if user really wants to shoot - at feet, but beware! */ - new_str[i++] = val; - str += 3; - break; - } + /* Allow null value if user really wants to shoot + at feet, but beware! */ + new_str[i++] = val; + str += 3; + break; + } - /* One or two digit hex constant? - * If two are there they will both be taken. - * Use \z to split them up if this is not wanted. - */ - if (*str == '0' && - (*(str + 1) == 'x' || *(str + 1) == 'X') && - isxdigit(*(str + 2))) { - val = DIGIT(*(str + 2)); - if (isxdigit(*(str + 3))) { - val = (val << 4) + DIGIT(*(str + 3)); - str += 4; - } - else - str += 3; - /* Yep, allow null value here too */ - new_str[i++] = val; - break; - } - } - break; + /* One or two digit hex constant? + * If two are there they will both be taken. + * Use \z to split them up if this is not wanted. + */ + if (*str == '0' && + (*(str + 1) == 'x' || *(str + 1) == 'X') && + isxdigit(*(str + 2))) { + val = DIGIT(*(str + 2)); + if (isxdigit(*(str + 3))) { + val = (val << 4) + DIGIT(*(str + 3)); + str += 4; + } + else + str += 3; + /* Yep, allow null value here too */ + new_str[i++] = val; + break; + } + } + break; - default: - new_str[i++] = *str++; - break; - } + default: + new_str[i++] = *str++; + break; + } + } + else { + if (*str == '\\') { + seenbs = 1; + str++; + } + else + new_str[i++] = *str++; + } } - else { - if (*str == '\\') { - seenbs = 1; - str++; - } - else - new_str[i++] = *str++; - } - } - if (seenbs) { - /* - * The final character was a '\'. Put it in as a single backslash. - */ - new_str[i++] = '\\'; - } - new_str[i] = '\0'; - return new_str; + if (seenbs) { + /* + * The final character was a '\'. Put it in as a single backslash. + */ + new_str[i++] = '\\'; + } + new_str[i] = '\0'; + return new_str; } Modified: head/stand/common/interp_parse.c ============================================================================== --- head/stand/common/interp_parse.c Thu Feb 8 14:53:34 2018 (r329018) +++ head/stand/common/interp_parse.c Thu Feb 8 17:07:27 2018 (r329019) @@ -50,143 +50,146 @@ static char *args[MAXARGS]; */ #define PARSE_FAIL(expr) \ -if (expr) { \ - printf("fail at line %d\n", __LINE__); \ - clean(); \ - free(copy); \ - free(buf); \ - return 1; \ -} + if (expr) { \ + printf("fail at line %d\n", __LINE__); \ + clean(); \ + free(copy); \ + free(buf); \ + return 1; \ + } /* Accept the usual delimiters for a variable, returning counterpart */ static char isdelim(int ch) { - if (ch == '{') - return '}'; - else if (ch == '(') - return ')'; - return '\0'; + + if (ch == '{') + return '}'; + else if (ch == '(') + return ')'; + return '\0'; } static int isquote(int ch) { - return (ch == '\''); + + return (ch == '\''); } static int isdquote(int ch) { - return (ch == '"'); + + return (ch == '"'); } int parse(int *argc, char ***argv, const char *str) { - int ac; - char *val, *p, *q, *copy = NULL; - size_t i = 0; - char token, tmp, quote, dquote, *buf; - enum { STR, VAR, WHITE } state; + int ac; + char *val, *p, *q, *copy = NULL; + size_t i = 0; + char token, tmp, quote, dquote, *buf; + enum { STR, VAR, WHITE } state; - ac = *argc = 0; - dquote = quote = 0; - if (!str || (p = copy = backslash(str)) == NULL) - return 1; + ac = *argc = 0; + dquote = quote = 0; + if (!str || (p = copy = backslash(str)) == NULL) + return 1; - /* Initialize vector and state */ - clean(); - state = STR; - buf = (char *)malloc(PARSE_BUFSIZE); - token = 0; + /* Initialize vector and state */ + clean(); + state = STR; + buf = (char *)malloc(PARSE_BUFSIZE); + token = 0; - /* And awaaaaaaaaay we go! */ - while (*p) { - switch (state) { - case STR: - if ((*p == '\\') && p[1]) { - p++; - PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); - buf[i++] = *p++; - } else if (isquote(*p)) { - quote = quote ? 0 : *p; - if (dquote) { /* keep quote */ - PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); - buf[i++] = *p++; - } else - ++p; - } else if (isdquote(*p)) { - dquote = dquote ? 0 : *p; - if (quote) { /* keep dquote */ - PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); - buf[i++] = *p++; - } else - ++p; - } else if (isspace(*p) && !quote && !dquote) { - state = WHITE; - if (i) { - buf[i] = '\0'; - PARSE_FAIL(insert(&ac, buf)); - i = 0; - } - ++p; - } else if (*p == '$' && !quote) { - token = isdelim(*(p + 1)); - if (token) - p += 2; - else - ++p; - state = VAR; - } else { - PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); - buf[i++] = *p++; - } - break; + /* And awaaaaaaaaay we go! */ + while (*p) { + switch (state) { + case STR: + if ((*p == '\\') && p[1]) { + p++; + PARSE_FAIL(i == (PARSE_BUFSIZE - 1)); + buf[i++] = *p++; + } else if (isquote(*p)) { + quote = quote ? 0 : *p; + if (dquote) { /* keep quote */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Feb 8 19:26:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DD60F1DF60; Thu, 8 Feb 2018 19:26:53 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E819077F0E; Thu, 8 Feb 2018 19:26:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA5811A4A3; Thu, 8 Feb 2018 19:26:52 +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 w18JQq3e098466; Thu, 8 Feb 2018 19:26:52 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18JQq41098465; Thu, 8 Feb 2018 19:26:52 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802081926.w18JQq41098465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 8 Feb 2018 19:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329022 - head/crypto/openssl/doc/man3 X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/crypto/openssl/doc/man3 X-SVN-Commit-Revision: 329022 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.25 Precedence: list List-Id: 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, 08 Feb 2018 19:26:53 -0000 Author: jkim Date: Thu Feb 8 19:26:52 2018 New Revision: 329022 URL: https://svnweb.freebsd.org/changeset/base/329022 Log: MFV: r329021 Belatedly remove an empty directory. Deleted: head/crypto/openssl/doc/man3/ Modified: Directory Properties: head/crypto/openssl/ (props changed) From owner-svn-src-head@freebsd.org Thu Feb 8 19:28:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83F30F1E1BF; Thu, 8 Feb 2018 19:28:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 363DC780E2; Thu, 8 Feb 2018 19:28:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 311271A4A6; Thu, 8 Feb 2018 19:28:53 +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 w18JSrvl098592; Thu, 8 Feb 2018 19:28:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18JSq0a098582; Thu, 8 Feb 2018 19:28:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802081928.w18JSq0a098582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 8 Feb 2018 19:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329023 - in head/sys: amd64/amd64 arm64/arm64 i386/i386 mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 i386/i386 mips/mips powerpc/powerpc riscv/riscv sparc64/sparc64 X-SVN-Commit-Revision: 329023 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.25 Precedence: list List-Id: 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, 08 Feb 2018 19:28:53 -0000 Author: markj Date: Thu Feb 8 19:28:51 2018 New Revision: 329023 URL: https://svnweb.freebsd.org/changeset/base/329023 Log: Use vm_page_unwire_noq() instead of directly modifying page wire counts. No functional change intended. Reviewed by: alc, kib (previous revision) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14266 Modified: head/sys/amd64/amd64/pmap.c head/sys/amd64/amd64/uma_machdep.c head/sys/arm64/arm64/pmap.c head/sys/arm64/arm64/uma_machdep.c head/sys/i386/i386/pmap.c head/sys/mips/mips/pmap.c head/sys/mips/mips/uma_machdep.c head/sys/powerpc/powerpc/uma_machdep.c head/sys/riscv/riscv/pmap.c head/sys/sparc64/sparc64/vm_machdep.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/amd64/amd64/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -2723,8 +2723,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* Have to allocate a new pdp, recurse */ if (_pmap_allocpte(pmap, NUPDE + NUPDPE + pml4index, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -2756,8 +2755,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -2770,9 +2768,7 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str /* Have to allocate a new pd, recurse */ if (_pmap_allocpte(pmap, NUPDE + pdpindex, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, - 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -2904,18 +2900,16 @@ pmap_release(pmap_t pmap) pmap->pm_pml4[DMPML4I + i] = 0; pmap->pm_pml4[PML4PML4I] = 0; /* Recursive Mapping */ - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); if (pmap->pm_pml4u != NULL) { m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_pml4u)); - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free(m); } } - + static int kvm_size(SYSCTL_HANDLER_ARGS) { @@ -7711,10 +7705,8 @@ pmap_pti_free_page(vm_page_t m) { KASSERT(m->wire_count > 0, ("page %p not wired", m)); - m->wire_count--; - if (m->wire_count != 0) + if (!vm_page_unwire_noq(m)) return (false); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); return (true); } Modified: head/sys/amd64/amd64/uma_machdep.c ============================================================================== --- head/sys/amd64/amd64/uma_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/amd64/amd64/uma_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -74,7 +74,6 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pa = DMAP_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/arm64/arm64/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -1362,12 +1362,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } pmap_invalidate_page(pmap, va); - /* - * This is a release store so that the ordinary store unmapping - * the page table page is globally performed before TLB shoot- - * down is begun. - */ - atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); /* * Put page on a list so that it is released after @@ -1493,9 +1488,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + NUL1E + l0index, lockp) == NULL) { - --m->wire_count; - /* XXX: release mem barrier? */ - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1521,8 +1514,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + l1index, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1537,10 +1529,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUL2E + l1index, lockp) == NULL) { - --m->wire_count; - /* XXX: release mem barrier? */ - atomic_subtract_int( - &vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1648,8 +1637,7 @@ pmap_release(pmap_t pmap) m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l0)); - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); } Modified: head/sys/arm64/arm64/uma_machdep.c ============================================================================== --- head/sys/arm64/arm64/uma_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/arm64/arm64/uma_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -72,7 +72,6 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pa = DMAP_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/i386/i386/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -2057,10 +2057,9 @@ pmap_release(pmap_t pmap) KASSERT(VM_PAGE_TO_PHYS(m) == (pmap->pm_pdpt[i] & PG_FRAME), ("pmap_release: got wrong ptd page")); #endif - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free_zero(m); } - atomic_subtract_int(&vm_cnt.v_wire_count, NPGPTD); } static int Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/mips/mips/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -1159,8 +1159,7 @@ _pmap_allocpte(pmap_t pmap, unsigned ptepindex, u_int if (_pmap_allocpte(pmap, NUPDE + segindex, flags) == NULL) { /* alloc failed, release current */ - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1238,8 +1237,7 @@ pmap_release(pmap_t pmap) ptdva = (vm_offset_t)pmap->pm_segtab; ptdpg = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(ptdva)); - ptdpg->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(ptdpg); vm_page_free_zero(ptdpg); } Modified: head/sys/mips/mips/uma_machdep.c ============================================================================== --- head/sys/mips/mips/uma_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/mips/mips/uma_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -94,7 +94,6 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pa = MIPS_DIRECT_TO_PHYS((vm_offset_t)mem); dump_drop_page(pa); m = PHYS_TO_VM_PAGE(pa); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/powerpc/powerpc/uma_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -95,8 +95,7 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla (vm_offset_t)mem + PAGE_SIZE); m = PHYS_TO_VM_PAGE((vm_offset_t)mem); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); atomic_subtract_int(&hw_uma_mdpages, 1); } Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/riscv/riscv/pmap.c Thu Feb 8 19:28:51 2018 (r329023) @@ -1153,12 +1153,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t } pmap_invalidate_page(pmap, va); - /* - * This is a release store so that the ordinary store unmapping - * the page table page is globally performed before TLB shoot- - * down is begun. - */ - atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); + atomic_subtract_int(&vm_cnt.v_wire_count, 1); /* * Put page on a list so that it is released after @@ -1302,8 +1297,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str /* recurse for allocating page dir */ if (_pmap_alloc_l3(pmap, NUPDE + l1index, lockp) == NULL) { - --m->wire_count; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); return (NULL); } @@ -1388,8 +1382,7 @@ pmap_release(pmap_t pmap) pmap->pm_stats.resident_count)); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); - m->wire_count--; - atomic_subtract_int(&vm_cnt.v_wire_count, 1); + vm_page_unwire_noq(m); vm_page_free_zero(m); /* Remove pmap from the allpmaps list */ Modified: head/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c Thu Feb 8 19:26:52 2018 (r329022) +++ head/sys/sparc64/sparc64/vm_machdep.c Thu Feb 8 19:28:51 2018 (r329023) @@ -429,9 +429,8 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla PMAP_STATS_INC(uma_nsmall_free); m = PHYS_TO_VM_PAGE(TLB_DIRECT_TO_PHYS((vm_offset_t)mem)); - m->wire_count--; + vm_page_unwire_noq(m); vm_page_free(m); - atomic_subtract_int(&vm_cnt.v_wire_count, 1); } void From owner-svn-src-head@freebsd.org Thu Feb 8 19:55:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB7AFF2007A; Thu, 8 Feb 2018 19:55:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD5D79883; Thu, 8 Feb 2018 19:55:03 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FC761A9B0; Thu, 8 Feb 2018 19:55:03 +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 w18Jt3wf013604; Thu, 8 Feb 2018 19:55:03 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18Jt34c013601; Thu, 8 Feb 2018 19:55:03 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802081955.w18Jt34c013601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 8 Feb 2018 19:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329024 - in head: . secure/lib/libcrypto secure/usr.bin/openssl secure/usr.bin/openssl/man X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: . secure/lib/libcrypto secure/usr.bin/openssl secure/usr.bin/openssl/man X-SVN-Commit-Revision: 329024 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.25 Precedence: list List-Id: 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, 08 Feb 2018 19:55:04 -0000 Author: jkim Date: Thu Feb 8 19:55:03 2018 New Revision: 329024 URL: https://svnweb.freebsd.org/changeset/base/329024 Log: Remove c_rehash(1) to not confuse users. We do not install the Perl script. MFC after: 3 days Deleted: head/secure/usr.bin/openssl/man/c_rehash.1 Modified: head/ObsoleteFiles.inc head/secure/lib/libcrypto/Makefile.inc head/secure/usr.bin/openssl/Makefile.man Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Feb 8 19:28:51 2018 (r329023) +++ head/ObsoleteFiles.inc Thu Feb 8 19:55:03 2018 (r329024) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20180208: remove c_rehash(1) +OLD_FILES+=usr/share/openssl/man/man1/c_rehash.1.gz # 20180206: remove gdbtui OLD_FILES+=usr/bin/gdbtui # 20180201: Obsolete forth files Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Thu Feb 8 19:28:51 2018 (r329023) +++ head/secure/lib/libcrypto/Makefile.inc Thu Feb 8 19:55:03 2018 (r329024) @@ -64,14 +64,11 @@ MANDIR= ${SHAREDIR}/openssl/man/man .if defined(LIB) _docs= ${LIB} -.if ${LIB} == ssl -_docs+= man3 -.endif _skip= SSLeay_version des_modes _sec= 3 .else _docs= apps -_skip= config +_skip= c_rehash config _sec= 1 .endif Modified: head/secure/usr.bin/openssl/Makefile.man ============================================================================== --- head/secure/usr.bin/openssl/Makefile.man Thu Feb 8 19:28:51 2018 (r329023) +++ head/secure/usr.bin/openssl/Makefile.man Thu Feb 8 19:55:03 2018 (r329024) @@ -2,7 +2,6 @@ # DO NOT EDIT: generated from man-makefile-update target MAN+= CA.pl.1 MAN+= asn1parse.1 -MAN+= c_rehash.1 MAN+= ca.1 MAN+= ciphers.1 MAN+= cms.1 From owner-svn-src-head@freebsd.org Thu Feb 8 20:09:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E648CF003FF; Thu, 8 Feb 2018 20:09:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B52D7A850; Thu, 8 Feb 2018 20:09:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 862D91AB81; Thu, 8 Feb 2018 20:09:42 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18K9gQW018966; Thu, 8 Feb 2018 20:09:42 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18K9g0k018965; Thu, 8 Feb 2018 20:09:42 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802082009.w18K9g0k018965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 8 Feb 2018 20:09:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329025 - head/sys/nfs X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/nfs X-SVN-Commit-Revision: 329025 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.25 Precedence: list List-Id: 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, 08 Feb 2018 20:09:43 -0000 Author: brooks Date: Thu Feb 8 20:09:42 2018 New Revision: 329025 URL: https://svnweb.freebsd.org/changeset/base/329025 Log: Modernize nfssvc(2) registartion. Use syscall_helper_register() to register syscalls and do it through the module interface rather than sysinit. This pattern is more common and easier to understand. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14232 Modified: head/sys/nfs/nfs_nfssvc.c Modified: head/sys/nfs/nfs_nfssvc.c ============================================================================== --- head/sys/nfs/nfs_nfssvc.c Thu Feb 8 19:55:03 2018 (r329024) +++ head/sys/nfs/nfs_nfssvc.c Thu Feb 8 20:09:42 2018 (r329025) @@ -56,9 +56,10 @@ __FBSDID("$FreeBSD$"); #include -static int nfssvc_offset = SYS_nfssvc; -static struct sysent nfssvc_prev_sysent; -MAKE_SYSENT(nfssvc); +static struct syscall_helper_data nfssvc_syscalls[] = { + SYSCALL_INIT_HELPER(nfssvc), + SYSCALL_INIT_LAST +}; /* * This tiny module simply handles the nfssvc() system call. The other @@ -119,16 +120,12 @@ sys_nfssvc(struct thread *td, struct nfssvc_args *uap) static int nfssvc_modevent(module_t mod, int type, void *data) { - static int registered; int error = 0; switch (type) { case MOD_LOAD: - error = syscall_register(&nfssvc_offset, &nfssvc_sysent, - &nfssvc_prev_sysent, SY_THR_STATIC_KLD); - if (error) - break; - registered = 1; + error = syscall_helper_register(nfssvc_syscalls, + SY_THR_STATIC_KLD); break; case MOD_UNLOAD: @@ -137,9 +134,7 @@ nfssvc_modevent(module_t mod, int type, void *data) error = EBUSY; break; } - if (registered) - syscall_deregister(&nfssvc_offset, &nfssvc_prev_sysent); - registered = 0; + syscall_helper_unregister(nfssvc_syscalls); break; default: error = EOPNOTSUPP; From owner-svn-src-head@freebsd.org Thu Feb 8 21:11:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49AFCF0506D; Thu, 8 Feb 2018 21:11:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F27317DEBC; Thu, 8 Feb 2018 21:11:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4D321B73A; Thu, 8 Feb 2018 21:11:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18LBmvg061103; Thu, 8 Feb 2018 21:11:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18LBmJt061100; Thu, 8 Feb 2018 21:11:48 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201802082111.w18LBmJt061100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 8 Feb 2018 21:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329033 - in head: contrib/llvm/tools/clang/lib/CodeGen sys/sys X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/tools/clang/lib/CodeGen sys/sys X-SVN-Commit-Revision: 329033 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.25 Precedence: list List-Id: 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, 08 Feb 2018 21:11:49 -0000 Author: dim Date: Thu Feb 8 21:11:48 2018 New Revision: 329033 URL: https://svnweb.freebsd.org/changeset/base/329033 Log: Pull in r324594 from upstream clang trunk (by Alexander Ivchenko): Fix for #31362 - ms_abi is implemented incorrectly for values >=16 bytes. Summary: This patch is a fix for following issue: https://bugs.llvm.org/show_bug.cgi?id=31362 The problem was caused by front end lowering C calling conventions without taking into account calling conventions enforced by attribute. In this case win64cc was no correctly lowered on targets other than Windows. Reviewed By: rnk (Reid Kleckner) Differential Revision: https://reviews.llvm.org/D43016 Author: belickim This fixes clang 6.0.0 assertions when building the emulators/wine and emulators/wine-devel ports, and should also make it use the correct Windows calling conventions. Bump __FreeBSD_version to make the fix easy to detect. PR: 224863 MFC after: 3 months X-MFC-With: r327952 Modified: head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/sys/sys/param.h Modified: head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Thu Feb 8 21:06:30 2018 (r329032) +++ head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp Thu Feb 8 21:11:48 2018 (r329033) @@ -3543,7 +3543,17 @@ ABIArgInfo X86_64ABIInfo::classifyRegCallStructType(Qu void X86_64ABIInfo::computeInfo(CGFunctionInfo &FI) const { - bool IsRegCall = FI.getCallingConvention() == llvm::CallingConv::X86_RegCall; + const unsigned CallingConv = FI.getCallingConvention(); + // It is possible to force Win64 calling convention on any x86_64 target by + // using __attribute__((ms_abi)). In such case to correctly emit Win64 + // compatible code delegate this call to WinX86_64ABIInfo::computeInfo. + if (CallingConv == llvm::CallingConv::Win64) { + WinX86_64ABIInfo Win64ABIInfo(CGT); + Win64ABIInfo.computeInfo(FI); + return; + } + + bool IsRegCall = CallingConv == llvm::CallingConv::X86_RegCall; // Keep track of the number of assigned registers. unsigned FreeIntRegs = IsRegCall ? 11 : 6; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Feb 8 21:06:30 2018 (r329032) +++ head/sys/sys/param.h Thu Feb 8 21:11:48 2018 (r329033) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200056 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200057 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Feb 8 22:59:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37C2DF0D0F0; Thu, 8 Feb 2018 22:59:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDF5683DDC; Thu, 8 Feb 2018 22:59:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8C8B1C851; Thu, 8 Feb 2018 22:59:51 +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 w18MxpuQ015225; Thu, 8 Feb 2018 22:59:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18MxpwL015223; Thu, 8 Feb 2018 22:59:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802082259.w18MxpwL015223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 8 Feb 2018 22:59:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329050 - in head/stand: . userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . userboot/userboot X-SVN-Commit-Revision: 329050 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.25 Precedence: list List-Id: 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, 08 Feb 2018 22:59:52 -0000 Author: imp Date: Thu Feb 8 22:59:51 2018 New Revision: 329050 URL: https://svnweb.freebsd.org/changeset/base/329050 Log: Fix build of userboot.so Since it's not possible to unset a variable easily, create a new variable 'PIC' to signal that we are creating a shared object that we want to install. defs.mk refains from defining NO_PIC and ITNERALLIB when PIC is defined. This unbreaks userboot.so building. Modified: head/stand/defs.mk head/stand/userboot/userboot/Makefile Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Thu Feb 8 22:38:39 2018 (r329049) +++ head/stand/defs.mk Thu Feb 8 22:59:51 2018 (r329050) @@ -10,9 +10,11 @@ __BOOT_DEFS_MK__=${MFILE} MK_CTF= no MK_SSP= no MK_PROFILE= no -NO_PIC= MAN= +.if !defined(PIC) +NO_PIC= INTERNALLIB= +.endif BOOTSRC= ${SRCTOP}/stand EFISRC= ${BOOTSRC}/efi Modified: head/stand/userboot/userboot/Makefile ============================================================================== --- head/stand/userboot/userboot/Makefile Thu Feb 8 22:38:39 2018 (r329049) +++ head/stand/userboot/userboot/Makefile Thu Feb 8 22:59:51 2018 (r329050) @@ -4,6 +4,7 @@ LOADER_MSDOS_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no +PIC=yes .include From owner-svn-src-head@freebsd.org Thu Feb 8 23:06:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4930F0D868; Thu, 8 Feb 2018 23:06:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 749F6843A0; Thu, 8 Feb 2018 23:06:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6F8121C9E6; Thu, 8 Feb 2018 23:06:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18N6xLM020361; Thu, 8 Feb 2018 23:06:59 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18N6wGT020355; Thu, 8 Feb 2018 23:06:58 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802082306.w18N6wGT020355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 8 Feb 2018 23:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329051 - in head: sbin/dumpfs sbin/fsck_ffs sbin/newfs sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head: sbin/dumpfs sbin/fsck_ffs sbin/newfs sys/ufs/ffs X-SVN-Commit-Revision: 329051 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.25 Precedence: list List-Id: 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, 08 Feb 2018 23:07:00 -0000 Author: mckusick Date: Thu Feb 8 23:06:58 2018 New Revision: 329051 URL: https://svnweb.freebsd.org/changeset/base/329051 Log: The goal of this change is to prevent accidental foot shooting by folks running filesystems created on check-hash enabled kernels (which I will call "new") on a non-check-hash enabled kernels (which I will call "old). The idea here is to detect when a filesystem is run on an old kernel and flag the filesystem so that when it gets moved back to a new kernel, it will not start getting a slew of check-hash errors. Back when the UFS version 2 filesystem was created, it added a file flag FS_INDEXDIRS that was to be set on any filesystem that kept some sort of on-disk indexing for directories. The idea was precisely to solve the issue we have today. Specifically that a newer kernel that supported indexing would be able to tell that the filesystem had been run on an older non-indexing kernel and that the indexes should not be used until they had been rebuilt. Since we have never implemented on-disk directory indicies, the FS_INDEXDIRS flag is cleared every time any UFS version 2 filesystem ever created is mounted for writing. This commit repurposes the FS_INDEXDIRS flag as the FS_METACKHASH flag. Thus, the FS_METACKHASH is definitively known to have always been cleared. The FS_INDEXDIRS flag has been moved to a new block of flags that will always be cleared starting with this commit (until they get used to implement some future feature which needs to detect that the filesystem was mounted on a kernel that predates the new feature). If a filesystem with check-hashes enabled is mounted on an old kernel the FS_METACKHASH flag is cleared. When that filesystem is mounted on a new kernel it will see that the FS_METACKHASH has been cleared and clears all of the fs_metackhash flags. To get them re-enabled the user must run fsck (in interactive mode without the -y flag) which will ask for each supported check hash whether it should be rebuilt and enabled. When fsck is run in its default preen mode, it will just ignore the check hashes so they will remain disabled. The kernel has always disabled any check hash functions that it does not support, so as more types of check hashes are added, we will get a non-surprising result. Specifically if filesystems get moved to kernels supporting fewer of the check hashes, those that are not supported will be disabled. If the filesystem is moved back to a kernel with more of the check-hashes available and fsck is run interactively to rebuild them, then their checking will resume. Otherwise just the smaller subset will be checked. A side effect of this commit is that filesystems running with cylinder-group check hashes will stop having them checked until fsck is run to re-enable them (since none of them currently have the FS_METACKHASH flag set). So, if you want check hashes enabled on your filesystems after booting a kernel with these changes, you need to run fsck to enable them. Any newly created filesystems will have check hashes enabled. If in doubt as to whether you have check hashes emabled, run dumpfs and look at the list of enabled flags at the end of the superblock details. Modified: head/sbin/dumpfs/dumpfs.c head/sbin/fsck_ffs/pass5.c head/sbin/newfs/mkfs.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/fs.h Modified: head/sbin/dumpfs/dumpfs.c ============================================================================== --- head/sbin/dumpfs/dumpfs.c Thu Feb 8 22:59:51 2018 (r329050) +++ head/sbin/dumpfs/dumpfs.c Thu Feb 8 23:06:58 2018 (r329051) @@ -257,9 +257,9 @@ dumpfs(const char *name) if (fsflags & FS_DOSOFTDEP) printf("soft-updates%s ", (fsflags & FS_SUJ) ? "+journal" : ""); if (fsflags & FS_NEEDSFSCK) - printf("needs fsck run "); + printf("needs-fsck-run "); if (fsflags & FS_INDEXDIRS) - printf("indexed directories "); + printf("indexed-directories "); if (fsflags & FS_ACLS) printf("acls "); if (fsflags & FS_MULTILABEL) @@ -267,31 +267,33 @@ dumpfs(const char *name) if (fsflags & FS_GJOURNAL) printf("gjournal "); if (fsflags & FS_FLAGS_UPDATED) - printf("fs_flags expanded "); + printf("fs_flags-expanded "); if (fsflags & FS_NFS4ACLS) printf("nfsv4acls "); if (fsflags & FS_TRIM) printf("trim "); - fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_INDEXDIRS | + fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_METACKHASH | FS_ACLS | FS_MULTILABEL | FS_GJOURNAL | FS_FLAGS_UPDATED | - FS_NFS4ACLS | FS_SUJ | FS_TRIM); + FS_NFS4ACLS | FS_SUJ | FS_TRIM | FS_INDEXDIRS); if (fsflags != 0) - printf("unknown flags (%#x)", fsflags); + printf("unknown-flags (%#x)", fsflags); putchar('\n'); - printf("check hashes\t"); - fsflags = afs.fs_metackhash; - if (fsflags == 0) - printf("none"); - if (fsflags & CK_SUPERBLOCK) - printf("superblock "); - if (fsflags & CK_CYLGRP) - printf("cylinder-groups "); - if (fsflags & CK_INODE) - printf("inodes "); - if (fsflags & CK_INDIR) - printf("indirect-blocks "); - if (fsflags & CK_DIR) - printf("directories "); + if (afs.fs_flags & FS_METACKHASH) { + printf("check hashes\t"); + fsflags = afs.fs_metackhash; + if (fsflags == 0) + printf("none"); + if (fsflags & CK_SUPERBLOCK) + printf("superblock "); + if (fsflags & CK_CYLGRP) + printf("cylinder-groups "); + if (fsflags & CK_INODE) + printf("inodes "); + if (fsflags & CK_INDIR) + printf("indirect-blocks "); + if (fsflags & CK_DIR) + printf("directories "); + } fsflags &= ~(CK_SUPERBLOCK | CK_CYLGRP | CK_INODE | CK_INDIR | CK_DIR); if (fsflags != 0) printf("unknown flags (%#x)", fsflags); Modified: head/sbin/fsck_ffs/pass5.c ============================================================================== --- head/sbin/fsck_ffs/pass5.c Thu Feb 8 22:59:51 2018 (r329050) +++ head/sbin/fsck_ffs/pass5.c Thu Feb 8 23:06:58 2018 (r329051) @@ -37,7 +37,6 @@ static const char sccsid[] = "@(#)pass5.c 8.9 (Berkele #include __FBSDID("$FreeBSD$"); -#define IN_RTLD /* So we pickup the P_OSREL defines */ #include #include @@ -63,7 +62,7 @@ pass5(void) int inomapsize, blkmapsize; struct fs *fs = &sblock; ufs2_daddr_t d, dbase, dmax, start; - int rewritecg = 0, cgckadd = 0; + int rewritecg = 0; struct csum *cs; struct csum_total cstotal; struct inodesc idesc[3]; @@ -74,13 +73,10 @@ pass5(void) inoinfo(UFS_WINO)->ino_state = USTATE; memset(newcg, 0, (size_t)fs->fs_cgsize); newcg->cg_niblk = fs->fs_ipg; - if (preen == 0 && yflag == 0 && fs->fs_magic == FS_UFS2_MAGIC && - fswritefd != -1 && (fs->fs_metackhash & CK_CYLGRP) == 0 && - getosreldate() >= P_OSREL_CK_CYLGRP && - reply("ADD CYLINDER GROUP CHECKSUM PROTECTION") != 0) { + /* check to see if we are to add a cylinder group check hash */ + if ((ckhashadd & CK_CYLGRP) != 0) { fs->fs_metackhash |= CK_CYLGRP; rewritecg = 1; - cgckadd = 1; sbdirty(); } if (cvtlevel >= 3) { @@ -178,14 +174,20 @@ pass5(void) cg = cgbp->b_un.b_cg; if (!cg_chkmagic(cg)) pfatal("CG %d: BAD MAGIC NUMBER\n", c); - if ((fs->fs_metackhash & CK_CYLGRP) != 0 && cgckadd == 0) { + /* + * If we have a cylinder group check hash and are not adding + * it for the first time, verify that it is good. + */ + if ((fs->fs_metackhash & CK_CYLGRP) != 0 && + (ckhashadd & CK_CYLGRP) == 0) { uint32_t ckhash, thishash; ckhash = cg->cg_ckhash; cg->cg_ckhash = 0; thishash = calculate_crc32c(~0L, cg, fs->fs_cgsize); if (ckhash != thishash) - pwarn("CG %d: BAD CHECKSUM %#x vs %#x", c, ckhash, thishash); + pwarn("CG %d: BAD CHECK-HASH %#x vs %#x", + c, ckhash, thishash); cg->cg_ckhash = ckhash; } newcg->cg_time = cg->cg_time; Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Thu Feb 8 22:59:51 2018 (r329050) +++ head/sbin/newfs/mkfs.c Thu Feb 8 23:06:58 2018 (r329051) @@ -489,9 +489,15 @@ restart: } /* * Set flags for metadata that is being check-hashed. + * + * Metadata check hashes are not supported in the UFS version 1 + * filesystem to keep it as small and simple as possible. */ - if (Oflag > 1 && getosreldate() >= P_OSREL_CK_CYLGRP) - sblock.fs_metackhash = CK_CYLGRP; + if (Oflag > 1) { + sblock.fs_flags |= FS_METACKHASH; + if (getosreldate() >= P_OSREL_CK_CYLGRP) + sblock.fs_metackhash = CK_CYLGRP; + } /* * Dump out summary information about file system. Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Thu Feb 8 22:59:51 2018 (r329050) +++ head/sys/ufs/ffs/ffs_vfsops.c Thu Feb 8 23:06:58 2018 (r329051) @@ -809,10 +809,12 @@ ffs_mountfs(devvp, mp, td) if ((error = ffs_sbget(devvp, &fs, -1, M_UFSMNT, ffs_use_bread)) != 0) goto out; fs->fs_fmod = 0; - /* none of these types of check-hashes are maintained */ + /* if we ran on a kernel without metadata check hashes, disable them */ + if ((fs->fs_flags & FS_METACKHASH) == 0) + fs->fs_metackhash = 0; + /* none of these types of check-hashes are maintained by this kernel */ fs->fs_metackhash &= ~(CK_SUPERBLOCK | CK_INODE | CK_INDIR | CK_DIR); - /* no support for directory indices or any other undefined flags */ - fs->fs_flags &= ~FS_INDEXDIRS; + /* no support for any undefined flags */ fs->fs_flags &= FS_SUPPORTED; fs->fs_flags &= ~FS_UNCLEAN; if (fs->fs_clean == 0) { Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Thu Feb 8 22:59:51 2018 (r329050) +++ head/sys/ufs/ffs/fs.h Thu Feb 8 23:06:58 2018 (r329051) @@ -433,18 +433,31 @@ CTASSERT(sizeof(struct fs) == 1376); * labels into extended attributes on the file system rather than maintain * a single mount label for all objects. */ -#define FS_UNCLEAN 0x0001 /* filesystem not clean at mount */ -#define FS_DOSOFTDEP 0x0002 /* filesystem using soft dependencies */ -#define FS_NEEDSFSCK 0x0004 /* filesystem needs sync fsck before mount */ -#define FS_SUJ 0x0008 /* Filesystem using softupdate journal */ -#define FS_ACLS 0x0010 /* file system has POSIX.1e ACLs enabled */ -#define FS_MULTILABEL 0x0020 /* file system is MAC multi-label */ -#define FS_GJOURNAL 0x0040 /* gjournaled file system */ -#define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ -#define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ -#define FS_INDEXDIRS 0x0200 /* kernel supports indexed directories */ -#define FS_TRIM 0x0400 /* issue BIO_DELETE for deleted blocks */ -#define FS_SUPPORTED 0xFFFF /* supported flags, others cleared at mount */ +#define FS_UNCLEAN 0x00000001 /* filesystem not clean at mount */ +#define FS_DOSOFTDEP 0x00000002 /* filesystem using soft dependencies */ +#define FS_NEEDSFSCK 0x00000004 /* filesystem needs sync fsck before mount */ +#define FS_SUJ 0x00000008 /* Filesystem using softupdate journal */ +#define FS_ACLS 0x00000010 /* file system has POSIX.1e ACLs enabled */ +#define FS_MULTILABEL 0x00000020 /* file system is MAC multi-label */ +#define FS_GJOURNAL 0x00000040 /* gjournaled file system */ +#define FS_FLAGS_UPDATED 0x0000080 /* flags have been moved to new location */ +#define FS_NFS4ACLS 0x00000100 /* file system has NFSv4 ACLs enabled */ +#define FS_METACKHASH 0x00000200 /* kernel supports metadata check hashes */ +#define FS_TRIM 0x00000400 /* issue BIO_DELETE for deleted blocks */ +#define FS_SUPPORTED 0x00FFFFFF /* supported flags, others cleared at mount*/ +/* + * Things that we may someday support, but currently do not. + * These flags are all cleared so we know if we ran on a kernel + * that does not support them. + */ +#define FS_INDEXDIRS 0x01000000 /* kernel supports indexed directories */ +#define FS_VARBLKSIZE 0x02000000 /* kernel supports variable block sizes */ +#define FS_COOLOPT1 0x04000000 /* kernel supports cool option 1 */ +#define FS_COOLOPT2 0x08000000 /* kernel supports cool option 2 */ +#define FS_COOLOPT3 0x10000000 /* kernel supports cool option 3 */ +#define FS_COOLOPT4 0x20000000 /* kernel supports cool option 4 */ +#define FS_COOLOPT5 0x40000000 /* kernel supports cool option 5 */ +#define FS_COOLOPT6 0x80000000 /* kernel supports cool option 6 */ /* * The fs_metackhash field indicates the types of metadata check-hash From owner-svn-src-head@freebsd.org Thu Feb 8 23:14:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6095F0E0C5; Thu, 8 Feb 2018 23:14:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB388497E; Thu, 8 Feb 2018 23:14:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 879271CB9C; Thu, 8 Feb 2018 23:14:25 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w18NEPV0025219; Thu, 8 Feb 2018 23:14:25 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w18NEP8F025216; Thu, 8 Feb 2018 23:14:25 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802082314.w18NEP8F025216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 8 Feb 2018 23:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329052 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 329052 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.25 Precedence: list List-Id: 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, 08 Feb 2018 23:14:26 -0000 Author: mckusick Date: Thu Feb 8 23:14:24 2018 New Revision: 329052 URL: https://svnweb.freebsd.org/changeset/base/329052 Log: Include files missed in 329051. Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/globs.c head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Thu Feb 8 23:06:58 2018 (r329051) +++ head/sbin/fsck_ffs/fsck.h Thu Feb 8 23:14:24 2018 (r329052) @@ -315,6 +315,7 @@ extern int Zflag; /* zero empty data blocks */ extern int inoopt; /* trim out unused inodes */ extern char ckclean; /* only do work if not cleanly unmounted */ extern int cvtlevel; /* convert to newer file system format */ +extern int ckhashadd; /* check hashes to be added */ extern int bkgrdcheck; /* determine if background check is possible */ extern int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ extern char usedsoftdep; /* just fix soft dependency inconsistencies */ Modified: head/sbin/fsck_ffs/globs.c ============================================================================== --- head/sbin/fsck_ffs/globs.c Thu Feb 8 23:06:58 2018 (r329051) +++ head/sbin/fsck_ffs/globs.c Thu Feb 8 23:14:24 2018 (r329052) @@ -87,6 +87,7 @@ int Zflag; /* zero empty data blocks */ int inoopt; /* trim out unused inodes */ char ckclean; /* only do work if not cleanly unmounted */ int cvtlevel; /* convert to newer file system format */ +int ckhashadd; /* check hashes to be added */ int bkgrdcheck; /* determine if background check is possible */ int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ char usedsoftdep; /* just fix soft dependency inconsistencies */ Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Thu Feb 8 23:06:58 2018 (r329051) +++ head/sbin/fsck_ffs/main.c Thu Feb 8 23:14:24 2018 (r329052) @@ -43,6 +43,7 @@ static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/14 #include __FBSDID("$FreeBSD$"); +#define IN_RTLD /* So we pickup the P_OSREL defines */ #include #include #include @@ -440,7 +441,46 @@ checkfilesys(char *filesys) flush(fswritefd, &sblk); fsmodified = ofsmodified; } - + /* + * If the filesystem was run on an old kernel that did not + * support check hashes, clear the check-hash flags so that + * we do not try to verify them. + */ + if ((sblock.fs_flags & FS_METACKHASH) == 0) + sblock.fs_metackhash = 0; + /* + * If we are running on a kernel that can provide check hashes + * that are not yet enabled for the filesystem and we are + * running manually without the -y flag, offer to add any + * supported check hashes that are not already enabled. + */ + ckhashadd = 0; + if (preen == 0 && yflag == 0 && sblock.fs_magic != FS_UFS1_MAGIC && + fswritefd != -1 && getosreldate() >= P_OSREL_CK_CYLGRP) { + if ((sblock.fs_metackhash & CK_CYLGRP) == 0 && + reply("ADD CYLINDER GROUP CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_CYLGRP; +#ifdef notyet + if ((sblock.fs_metackhash & CK_SUPERBLOCK) == 0 && + getosreldate() >= P_OSREL_CK_SUPERBLOCK && + reply("ADD SUPERBLOCK CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_SUPERBLOCK; + if ((sblock.fs_metackhash & CK_INODE) == 0 && + getosreldate() >= P_OSREL_CK_INODE && + reply("ADD INODE CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_INODE; + if ((sblock.fs_metackhash & CK_INDIR) == 0 && + getosreldate() >= P_OSREL_CK_INDIR && + reply("ADD INDIRECT BLOCK CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_INDIR; + if ((sblock.fs_metackhash & CK_DIR) == 0 && + getosreldate() >= P_OSREL_CK_DIR && + reply("ADD DIRECTORY CHECK-HASH PROTECTION") != 0) + ckhashadd |= CK_DIR; +#endif /* notyet */ + if (ckhashadd != 0) + sblock.fs_flags |= FS_METACKHASH; + } /* * Cleared if any questions answered no. Used to decide if * the superblock should be marked clean. From owner-svn-src-head@freebsd.org Fri Feb 9 00:13:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162CAF12557; Fri, 9 Feb 2018 00:13:06 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7649086FA9; Fri, 9 Feb 2018 00:13:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 716581D558; Fri, 9 Feb 2018 00:13:05 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w190D5UI054471; Fri, 9 Feb 2018 00:13:05 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w190D5lm054470; Fri, 9 Feb 2018 00:13:05 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201802090013.w190D5lm054470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Fri, 9 Feb 2018 00:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329053 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 329053 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.25 Precedence: list List-Id: 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, 09 Feb 2018 00:13:06 -0000 Author: vangyzen Date: Fri Feb 9 00:13:05 2018 New Revision: 329053 URL: https://svnweb.freebsd.org/changeset/base/329053 Log: Fix ICMPv6 redirects icmp6_redirect_input() validates that a redirect packet came from the current gateway for the respective destination. To do this, it compares the source address, which has an embedded scope zone id, to the next-hop address, which does not. If the address is link-local, which should be the case, the comparison fails and the redirect is ignored. Insert the scope zone id into the next-hop address so the comparison is accurate. Unsurprisingly, this fixes 35 UNH IPv6 conformance test cases. Submitted by: Farrell Woods (initial revision) Reviewed by: ae melifaro dab MFC after: 1 week Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D14254 Modified: head/sys/netinet6/icmp6.c Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Thu Feb 8 23:14:24 2018 (r329052) +++ head/sys/netinet6/icmp6.c Fri Feb 9 00:13:05 2018 (r329053) @@ -2305,6 +2305,14 @@ icmp6_redirect_input(struct mbuf *m, int off) goto bad; } + /* + * Embed scope zone id into next hop address, since + * fib6_lookup_nh_basic() returns address without embedded + * scope zone id. + */ + if (in6_setscope(&nh6.nh_addr, m->m_pkthdr.rcvif, NULL)) + goto freeit; + if (IN6_ARE_ADDR_EQUAL(&src6, &nh6.nh_addr) == 0) { nd6log((LOG_ERR, "ICMP6 redirect rejected; " From owner-svn-src-head@freebsd.org Fri Feb 9 00:36:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22D8FF13C02; Fri, 9 Feb 2018 00:36:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE86787C46; Fri, 9 Feb 2018 00:36:55 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C947B1D8A7; Fri, 9 Feb 2018 00:36:55 +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 w190atmv064447; Fri, 9 Feb 2018 00:36:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w190atVK064445; Fri, 9 Feb 2018 00:36:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802090036.w190atVK064445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Feb 2018 00:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329054 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329054 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.25 Precedence: list List-Id: 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, 09 Feb 2018 00:36:56 -0000 Author: imp Date: Fri Feb 9 00:36:55 2018 New Revision: 329054 URL: https://svnweb.freebsd.org/changeset/base/329054 Log: Set script.lang in the environment to either 'forth' or 'simple' to reflect what scripting language was compiled into the loader. I anticipate that being able to find this out quickly from the OK prompt will be useful in troubleshooting in the future. Modified: head/stand/common/interp_forth.c head/stand/common/interp_simple.c Modified: head/stand/common/interp_forth.c ============================================================================== --- head/stand/common/interp_forth.c Fri Feb 9 00:13:05 2018 (r329053) +++ head/stand/common/interp_forth.c Fri Feb 9 00:36:55 2018 (r329054) @@ -337,6 +337,7 @@ void interp_init(void) { + setenv("script.lang", "forth", 1); bf_init(); /* Read our default configuration. */ interp_include("/boot/loader.rc"); Modified: head/stand/common/interp_simple.c ============================================================================== --- head/stand/common/interp_simple.c Fri Feb 9 00:13:05 2018 (r329053) +++ head/stand/common/interp_simple.c Fri Feb 9 00:36:55 2018 (r329054) @@ -39,6 +39,7 @@ void interp_init(void) { + setenv("script.lang", "simple", 1); /* Read our default configuration. */ interp_include("/boot/loader.rc"); } From owner-svn-src-head@freebsd.org Fri Feb 9 04:45:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9594AF03382; Fri, 9 Feb 2018 04:45:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46317710D6; Fri, 9 Feb 2018 04:45:40 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40A1F20292; Fri, 9 Feb 2018 04:45:40 +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 w194jenF089413; Fri, 9 Feb 2018 04:45:40 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w194jduj089409; Fri, 9 Feb 2018 04:45:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201802090445.w194jduj089409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 9 Feb 2018 04:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329058 - in head/sys: kern vm X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern vm X-SVN-Commit-Revision: 329058 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.25 Precedence: list List-Id: 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, 09 Feb 2018 04:45:40 -0000 Author: glebius Date: Fri Feb 9 04:45:39 2018 New Revision: 329058 URL: https://svnweb.freebsd.org/changeset/base/329058 Log: Fix boot_pages exhaustion on machines with many domains and cores, where size of UMA zone allocation is greater than page size. In this case zone of zones can not use UMA_MD_SMALL_ALLOC, and we need to postpone switch off of this zone from startup_alloc() until full launch of VM. o Always supply number of VM zones to uma_startup_count(). On machines with UMA_MD_SMALL_ALLOC ignore it completely, unless zsize goes over a page. In the latter case account VM zones for number of allocations from the zone of zones. o Rewrite startup_alloc() so that it will immediately switch off from itself any zone that is already capable of running real alloc. In worst case scenario we may leak a single page here. See comment in uma_startup_count(). o Hardcode call to uma_startup2() into vm_mem_init(). Otherwise some extra SYSINITs, e.g. vm_page_init() may sneak in before. o While here, remove uma_boot_pages_mtx. With recent changes to boot pages calculation, we are guaranteed to use all of the boot_pages in the early single threaded stage. Reported & tested by: mav Modified: head/sys/kern/kern_malloc.c head/sys/vm/uma_core.c head/sys/vm/vm_init.c head/sys/vm/vm_page.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Fri Feb 9 03:07:12 2018 (r329057) +++ head/sys/kern/kern_malloc.c Fri Feb 9 04:45:39 2018 (r329058) @@ -96,8 +96,6 @@ __FBSDID("$FreeBSD$"); dtrace_malloc_probe_func_t dtrace_malloc_probe; #endif -extern void uma_startup2(void); - #if defined(INVARIANTS) || defined(MALLOC_MAKE_FAILURES) || \ defined(DEBUG_MEMGUARD) || defined(DEBUG_REDZONE) #define MALLOC_DEBUG 1 @@ -928,8 +926,6 @@ mallocinit(void *dummy) mtx_init(&malloc_mtx, "malloc", NULL, MTX_DEF); kmeminit(); - - uma_startup2(); if (kmem_zmax < PAGE_SIZE || kmem_zmax > KMEM_ZMAX) kmem_zmax = KMEM_ZMAX; Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Feb 9 03:07:12 2018 (r329057) +++ head/sys/vm/uma_core.c Fri Feb 9 04:45:39 2018 (r329058) @@ -134,13 +134,10 @@ static struct rwlock_padalign __exclusive_cache_line u /* * Pointer and counter to pool of pages, that is preallocated at - * startup to bootstrap UMA. Early zones continue to use the pool - * until it is depleted, so allocations may happen after boot, thus - * we need a mutex to protect it. + * startup to bootstrap UMA. */ static char *bootmem; static int boot_pages; -static struct mtx uma_boot_pages_mtx; static struct sx uma_drain_lock; @@ -1081,37 +1078,46 @@ startup_alloc(uma_zone_t zone, vm_size_t bytes, int do int pages; keg = zone_first_keg(zone); - pages = howmany(bytes, PAGE_SIZE); - KASSERT(pages > 0, ("startup_alloc can't reserve 0 pages\n")); /* - * Check our small startup cache to see if it has pages remaining. + * If we are in BOOT_BUCKETS or higher, than switch to real + * allocator. Zones with page sized slabs switch at BOOT_PAGEALLOC. */ - mtx_lock(&uma_boot_pages_mtx); - if (pages <= boot_pages) { -#ifdef DIAGNOSTIC - printf("%s from \"%s\", %d boot pages left\n", __func__, - zone->uz_name, boot_pages); + switch (booted) { + case BOOT_COLD: + case BOOT_STRAPPED: + break; + case BOOT_PAGEALLOC: + if (keg->uk_ppera > 1) + break; + case BOOT_BUCKETS: + case BOOT_RUNNING: +#ifdef UMA_MD_SMALL_ALLOC + keg->uk_allocf = (keg->uk_ppera > 1) ? + page_alloc : uma_small_alloc; +#else + keg->uk_allocf = page_alloc; #endif - mem = bootmem; - boot_pages -= pages; - bootmem += pages * PAGE_SIZE; - mtx_unlock(&uma_boot_pages_mtx); - *pflag = UMA_SLAB_BOOT; - return (mem); + return keg->uk_allocf(zone, bytes, domain, pflag, wait); } - mtx_unlock(&uma_boot_pages_mtx); - if (booted < BOOT_PAGEALLOC) - panic("UMA zone \"%s\": Increase vm.boot_pages", zone->uz_name); + /* - * Now that we've booted reset these users to their real allocator. + * Check our small startup cache to see if it has pages remaining. */ -#ifdef UMA_MD_SMALL_ALLOC - keg->uk_allocf = (keg->uk_ppera > 1) ? page_alloc : uma_small_alloc; -#else - keg->uk_allocf = page_alloc; + pages = howmany(bytes, PAGE_SIZE); + KASSERT(pages > 0, ("%s can't reserve 0 pages", __func__)); + if (pages > boot_pages) + panic("UMA zone \"%s\": Increase vm.boot_pages", zone->uz_name); +#ifdef DIAGNOSTIC + printf("%s from \"%s\", %d boot pages left\n", __func__, zone->uz_name, + boot_pages); #endif - return keg->uk_allocf(zone, bytes, domain, pflag, wait); + mem = bootmem; + boot_pages -= pages; + bootmem += pages * PAGE_SIZE; + *pflag = UMA_SLAB_BOOT; + + return (mem); } /* @@ -1789,9 +1795,9 @@ zone_foreach(void (*zfunc)(uma_zone_t)) #define UMA_BOOT_ALIGN 32 static int zsize, ksize; int -uma_startup_count(int zones) +uma_startup_count(int vm_zones) { - int pages; + int zones, pages; ksize = sizeof(struct uma_keg) + (sizeof(struct uma_domain) * vm_ndomains); @@ -1806,12 +1812,17 @@ uma_startup_count(int zones) pages = howmany(roundup(zsize, CACHE_LINE_SIZE) * 2 + roundup(ksize, CACHE_LINE_SIZE), PAGE_SIZE); - zones += UMA_BOOT_ZONES; +#ifdef UMA_MD_SMALL_ALLOC + zones = UMA_BOOT_ZONES; +#else + zones = UMA_BOOT_ZONES + vm_zones; + vm_zones = 0; +#endif /* Memory for the rest of startup zones, UMA and VM, ... */ if (zsize > UMA_SLAB_SIZE) - pages += zones * howmany(roundup2(zsize, UMA_BOOT_ALIGN), - UMA_SLAB_SIZE); + pages += (zones + vm_zones) * + howmany(roundup2(zsize, UMA_BOOT_ALIGN), UMA_SLAB_SIZE); else pages += howmany(zones, UMA_SLAB_SPACE / roundup2(zsize, UMA_BOOT_ALIGN)); @@ -1872,7 +1883,6 @@ uma_startup(void *mem, int npages) args.flags = UMA_ZFLAG_INTERNAL; zone_ctor(kegs, zsize, &args, M_WAITOK); - mtx_init(&uma_boot_pages_mtx, "UMA boot pages", NULL, MTX_DEF); bootmem = mem; boot_pages = npages; @@ -1917,6 +1927,9 @@ void uma_startup2(void) { +#ifdef DIAGNOSTIC + printf("Entering %s with %d boot pages left\n", __func__, boot_pages); +#endif booted = BOOT_BUCKETS; sx_init(&uma_drain_lock, "umadrain"); bucket_enable(); Modified: head/sys/vm/vm_init.c ============================================================================== --- head/sys/vm/vm_init.c Fri Feb 9 03:07:12 2018 (r329057) +++ head/sys/vm/vm_init.c Fri Feb 9 04:45:39 2018 (r329058) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include extern void uma_startup1(void); +extern void uma_startup2(void); extern void vm_radix_reserve_kva(void); #if VM_NRESERVLEVEL > 0 @@ -183,9 +184,9 @@ vm_mem_init(dummy) #ifndef UMA_MD_SMALL_ALLOC /* Set up radix zone to use noobj_alloc. */ vm_radix_reserve_kva(); - /* Announce page availability to UMA. */ - uma_startup1(); #endif + /* Announce full page availability to UMA. */ + uma_startup2(); kmem_init_zero_region(); pmap_init(); vm_pager_init(); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Feb 9 03:07:12 2018 (r329057) +++ head/sys/vm/vm_page.c Fri Feb 9 04:45:39 2018 (r329058) @@ -506,16 +506,13 @@ vm_page_startup(vm_offset_t vaddr) * Allocate memory for use when boot strapping the kernel memory * allocator. Tell UMA how many zones we are going to create * before going fully functional. UMA will add its zones. - */ -#ifdef UMA_MD_SMALL_ALLOC - boot_pages = uma_startup_count(0); -#else - /* + * * VM startup zones: vmem, vmem_btag, VM OBJECT, RADIX NODE, MAP, * KMAP ENTRY, MAP ENTRY, VMSPACE. */ boot_pages = uma_startup_count(8); +#ifndef UMA_MD_SMALL_ALLOC /* vmem_startup() calls uma_prealloc(). */ boot_pages += vmem_startup_count(); /* vm_map_startup() calls uma_prealloc(). */ From owner-svn-src-head@freebsd.org Fri Feb 9 10:20:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F40EF16FC2; Fri, 9 Feb 2018 10:20:17 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F6497BDA0; Fri, 9 Feb 2018 10:20:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 461592380C; Fri, 9 Feb 2018 10:20:17 +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 w19AKHsh052579; Fri, 9 Feb 2018 10:20:17 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19AKHJ8052578; Fri, 9 Feb 2018 10:20:17 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201802091020.w19AKHJ8052578@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: Fri, 9 Feb 2018 10:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329060 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 329060 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.25 Precedence: list List-Id: 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, 09 Feb 2018 10:20:17 -0000 Author: royger Date: Fri Feb 9 10:20:16 2018 New Revision: 329060 URL: https://svnweb.freebsd.org/changeset/base/329060 Log: loader: fix endianness conversion r328536 broke symbol loading on amd64 at least (and probably other arches). r328826 contained the problem to ppc only by adding pre-processors guards. Fix this properly by moving the endianness conversion to separate helper functions, and make the conversion more robust by using sizeof instead of having to manually code the size of each field. Finally list the fields in each structure in a macro in order to avoid code repetition. Sponsored by: Citrix Systems R&D Reviewed by: kib emaste wma Differential revision: https://reviews.freebsd.org/D14267 Modified: head/stand/common/load_elf.c Modified: head/stand/common/load_elf.c ============================================================================== --- head/stand/common/load_elf.c Fri Feb 9 09:15:43 2018 (r329059) +++ head/stand/common/load_elf.c Fri Feb 9 10:20:16 2018 (r329060) @@ -87,6 +87,112 @@ const char *__elfN(moduletype) = "elf module"; u_int64_t __elfN(relocation_offset) = 0; +extern void elf_wrong_field_size(void); +#define CONVERT_FIELD(b, f, e) \ + switch (sizeof((b)->f)) { \ + case 2: \ + (b)->f = e ## 16toh((b)->f); \ + break; \ + case 4: \ + (b)->f = e ## 32toh((b)->f); \ + break; \ + case 8: \ + (b)->f = e ## 64toh((b)->f); \ + break; \ + default: \ + /* Force a link time error. */ \ + elf_wrong_field_size(); \ + break; \ + } + +#define CONVERT_SWITCH(h, d, f) \ + switch ((h)->e_ident[EI_DATA]) { \ + case ELFDATA2MSB: \ + f(d, be); \ + break; \ + case ELFDATA2LSB: \ + f(d, le); \ + break; \ + default: \ + return (EINVAL); \ + } + + +static int elf_header_convert(Elf_Ehdr *ehdr) +{ + /* + * Fixup ELF header endianness. + * + * The Xhdr structure was loaded using block read call to optimize file + * accesses. It might happen, that the endianness of the system memory + * is different that endianness of the ELF header. Swap fields here to + * guarantee that Xhdr always contain valid data regardless of + * architecture. + */ +#define HEADER_FIELDS(b, e) \ + CONVERT_FIELD(b, e_type, e); \ + CONVERT_FIELD(b, e_machine, e); \ + CONVERT_FIELD(b, e_version, e); \ + CONVERT_FIELD(b, e_entry, e); \ + CONVERT_FIELD(b, e_phoff, e); \ + CONVERT_FIELD(b, e_shoff, e); \ + CONVERT_FIELD(b, e_flags, e); \ + CONVERT_FIELD(b, e_ehsize, e); \ + CONVERT_FIELD(b, e_phentsize, e); \ + CONVERT_FIELD(b, e_phnum, e); \ + CONVERT_FIELD(b, e_shentsize, e); \ + CONVERT_FIELD(b, e_shnum, e); \ + CONVERT_FIELD(b, e_shstrndx, e) + + CONVERT_SWITCH(ehdr, ehdr, HEADER_FIELDS); + +#undef HEADER_FIELDS + + return (0); +} + +static int elf_program_header_convert(const Elf_Ehdr *ehdr, Elf_Phdr *phdr) +{ +#define PROGRAM_HEADER_FIELDS(b, e) \ + CONVERT_FIELD(b, p_type, e); \ + CONVERT_FIELD(b, p_flags, e); \ + CONVERT_FIELD(b, p_offset, e); \ + CONVERT_FIELD(b, p_vaddr, e); \ + CONVERT_FIELD(b, p_paddr, e); \ + CONVERT_FIELD(b, p_filesz, e); \ + CONVERT_FIELD(b, p_memsz, e); \ + CONVERT_FIELD(b, p_align, e) + + CONVERT_SWITCH(ehdr, phdr, PROGRAM_HEADER_FIELDS); + +#undef PROGRAM_HEADER_FIELDS + + return (0); +} + +static int elf_section_header_convert(const Elf_Ehdr *ehdr, Elf_Shdr *shdr) +{ +#define SECTION_HEADER_FIELDS(b, e) \ + CONVERT_FIELD(b, sh_name, e); \ + CONVERT_FIELD(b, sh_type, e); \ + CONVERT_FIELD(b, sh_link, e); \ + CONVERT_FIELD(b, sh_info, e); \ + CONVERT_FIELD(b, sh_flags, e); \ + CONVERT_FIELD(b, sh_addr, e); \ + CONVERT_FIELD(b, sh_offset, e); \ + CONVERT_FIELD(b, sh_size, e); \ + CONVERT_FIELD(b, sh_addralign, e); \ + CONVERT_FIELD(b, sh_entsize, e) + + CONVERT_SWITCH(ehdr, shdr, SECTION_HEADER_FIELDS); + +#undef SECTION_HEADER_FIELDS + + return (0); +} +#undef CONVERT_SWITCH +#undef CONVERT_FIELD + static int __elfN(load_elf_header)(char *filename, elf_file_t ef) { @@ -127,63 +233,10 @@ __elfN(load_elf_header)(char *filename, elf_file_t ef) goto error; } -#ifdef __powerpc__ - /* - * XXX: should be in a separate helper. - * - * Fixup ELF endianness. - * - * The Xhdr structure was loaded using block read call to - * optimize file accesses. It might happen, that the endianness - * of the system memory is different that endianness of - * the ELF header. - * Swap fields here to guarantee that Xhdr always contain - * valid data regardless of architecture. - */ - if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) { - ehdr->e_type = be16toh(ehdr->e_type); - ehdr->e_machine = be16toh(ehdr->e_machine); - ehdr->e_version = be32toh(ehdr->e_version); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - ehdr->e_entry = be64toh(ehdr->e_entry); - ehdr->e_phoff = be64toh(ehdr->e_phoff); - ehdr->e_shoff = be64toh(ehdr->e_shoff); - } else { - ehdr->e_entry = be32toh(ehdr->e_entry); - ehdr->e_phoff = be32toh(ehdr->e_phoff); - ehdr->e_shoff = be32toh(ehdr->e_shoff); - } - ehdr->e_flags = be32toh(ehdr->e_flags); - ehdr->e_ehsize = be16toh(ehdr->e_ehsize); - ehdr->e_phentsize = be16toh(ehdr->e_phentsize); - ehdr->e_phnum = be16toh(ehdr->e_phnum); - ehdr->e_shentsize = be16toh(ehdr->e_shentsize); - ehdr->e_shnum = be16toh(ehdr->e_shnum); - ehdr->e_shstrndx = be16toh(ehdr->e_shstrndx); + err = elf_header_convert(ehdr); + if (err) + goto error; - } else { - ehdr->e_type = le16toh(ehdr->e_type); - ehdr->e_machine = le16toh(ehdr->e_machine); - ehdr->e_version = le32toh(ehdr->e_version); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - ehdr->e_entry = le64toh(ehdr->e_entry); - ehdr->e_phoff = le64toh(ehdr->e_phoff); - ehdr->e_shoff = le64toh(ehdr->e_shoff); - } else { - ehdr->e_entry = le32toh(ehdr->e_entry); - ehdr->e_phoff = le32toh(ehdr->e_phoff); - ehdr->e_shoff = le32toh(ehdr->e_shoff); - } - ehdr->e_flags = le32toh(ehdr->e_flags); - ehdr->e_ehsize = le16toh(ehdr->e_ehsize); - ehdr->e_phentsize = le16toh(ehdr->e_phentsize); - ehdr->e_phnum = le16toh(ehdr->e_phnum); - ehdr->e_shentsize = le16toh(ehdr->e_shentsize); - ehdr->e_shnum = le16toh(ehdr->e_shnum); - ehdr->e_shstrndx = le16toh(ehdr->e_shstrndx); - } -#endif - if (ehdr->e_version != EV_CURRENT || ehdr->e_machine != ELF_TARG_MACH) { /* Machine ? */ err = EFTYPE; goto error; @@ -453,57 +506,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ phdr = (Elf_Phdr *)(ef->firstpage + ehdr->e_phoff); for (i = 0; i < ehdr->e_phnum; i++) { -#ifdef __powerpc__ - /* - * XXX: should be in a seprate helper. - * - * Fixup ELF endianness. - * - * The Xhdr structure was loaded using block read call to - * optimize file accesses. It might happen, that the endianness - * of the system memory is different that endianness of - * the ELF header. - * Swap fields here to guarantee that Xhdr always contain - * valid data regardless of architecture. - */ - if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) { - phdr[i].p_type = be32toh(phdr[i].p_type); - phdr[i].p_flags = be32toh(phdr[i].p_flags); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - phdr[i].p_offset = be64toh(phdr[i].p_offset); - phdr[i].p_vaddr = be64toh(phdr[i].p_vaddr); - phdr[i].p_paddr = be64toh(phdr[i].p_paddr); - phdr[i].p_filesz = be64toh(phdr[i].p_filesz); - phdr[i].p_memsz = be64toh(phdr[i].p_memsz); - phdr[i].p_align = be64toh(phdr[i].p_align); - } else { - phdr[i].p_offset = be32toh(phdr[i].p_offset); - phdr[i].p_vaddr = be32toh(phdr[i].p_vaddr); - phdr[i].p_paddr = be32toh(phdr[i].p_paddr); - phdr[i].p_filesz = be32toh(phdr[i].p_filesz); - phdr[i].p_memsz = be32toh(phdr[i].p_memsz); - phdr[i].p_align = be32toh(phdr[i].p_align); - } - } else { - phdr[i].p_type = le32toh(phdr[i].p_type); - phdr[i].p_flags = le32toh(phdr[i].p_flags); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - phdr[i].p_offset = le64toh(phdr[i].p_offset); - phdr[i].p_vaddr = le64toh(phdr[i].p_vaddr); - phdr[i].p_paddr = le64toh(phdr[i].p_paddr); - phdr[i].p_filesz = le64toh(phdr[i].p_filesz); - phdr[i].p_memsz = le64toh(phdr[i].p_memsz); - phdr[i].p_align = le64toh(phdr[i].p_align); - } else { - phdr[i].p_offset = le32toh(phdr[i].p_offset); - phdr[i].p_vaddr = le32toh(phdr[i].p_vaddr); - phdr[i].p_paddr = le32toh(phdr[i].p_paddr); - phdr[i].p_filesz = le32toh(phdr[i].p_filesz); - phdr[i].p_memsz = le32toh(phdr[i].p_memsz); - phdr[i].p_align = le32toh(phdr[i].p_align); - } - } -#endif + if (elf_program_header_convert(ehdr, phdr)) + continue; /* We want to load PT_LOAD segments only.. */ if (phdr[i].p_type != PT_LOAD) @@ -580,63 +584,8 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ goto nosyms; } -#ifdef __powerpc__ - /* - * XXX: should be in a seprate helper. - * - * Fixup ELF endianness. - * - * The Xhdr structure was loaded using block read call to - * optimize file accesses. It might happen, that the endianness - * of the system memory is different that endianness of - * the ELF header. - * Swap fields here to guarantee that Xhdr always contain - * valid data regardless of architecture. - */ - for (i = 0; i < ehdr->e_shnum; i++) { - if (ehdr->e_ident[EI_DATA] == ELFDATA2MSB) { - shdr[i].sh_name = be32toh(shdr[i].sh_name); - shdr[i].sh_type = be32toh(shdr[i].sh_type); - shdr[i].sh_link = be32toh(shdr[i].sh_link); - shdr[i].sh_info = be32toh(shdr[i].sh_info); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - shdr[i].sh_flags = be64toh(shdr[i].sh_flags); - shdr[i].sh_addr = be64toh(shdr[i].sh_addr); - shdr[i].sh_offset = be64toh(shdr[i].sh_offset); - shdr[i].sh_size = be64toh(shdr[i].sh_size); - shdr[i].sh_addralign = be64toh(shdr[i].sh_addralign); - shdr[i].sh_entsize = be64toh(shdr[i].sh_entsize); - } else { - shdr[i].sh_flags = be32toh(shdr[i].sh_flags); - shdr[i].sh_addr = be32toh(shdr[i].sh_addr); - shdr[i].sh_offset = be32toh(shdr[i].sh_offset); - shdr[i].sh_size = be32toh(shdr[i].sh_size); - shdr[i].sh_addralign = be32toh(shdr[i].sh_addralign); - shdr[i].sh_entsize = be32toh(shdr[i].sh_entsize); - } - } else { - shdr[i].sh_name = le32toh(shdr[i].sh_name); - shdr[i].sh_type = le32toh(shdr[i].sh_type); - shdr[i].sh_link = le32toh(shdr[i].sh_link); - shdr[i].sh_info = le32toh(shdr[i].sh_info); - if (ehdr->e_ident[EI_CLASS] == ELFCLASS64) { - shdr[i].sh_flags = le64toh(shdr[i].sh_flags); - shdr[i].sh_addr = le64toh(shdr[i].sh_addr); - shdr[i].sh_offset = le64toh(shdr[i].sh_offset); - shdr[i].sh_size = le64toh(shdr[i].sh_size); - shdr[i].sh_addralign = le64toh(shdr[i].sh_addralign); - shdr[i].sh_entsize = le64toh(shdr[i].sh_entsize); - } else { - shdr[i].sh_flags = le32toh(shdr[i].sh_flags); - shdr[i].sh_addr = le32toh(shdr[i].sh_addr); - shdr[i].sh_offset = le32toh(shdr[i].sh_offset); - shdr[i].sh_size = le32toh(shdr[i].sh_size); - shdr[i].sh_addralign = le32toh(shdr[i].sh_addralign); - shdr[i].sh_entsize = le32toh(shdr[i].sh_entsize); - } - } - } -#endif + for (i = 0; i < ehdr->e_shnum; i++) + elf_section_header_convert(ehdr, &shdr[i]); file_addmetadata(fp, MODINFOMD_SHDR, chunk, shdr); From owner-svn-src-head@freebsd.org Fri Feb 9 14:31:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53130F08429; Fri, 9 Feb 2018 14:31:13 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05E7A86C58; Fri, 9 Feb 2018 14:31:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00B7E26127; Fri, 9 Feb 2018 14:31:13 +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 w19EVCvb081274; Fri, 9 Feb 2018 14:31:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19EVCb9081265; Fri, 9 Feb 2018 14:31:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802091431.w19EVCb9081265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 9 Feb 2018 14:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329061 - head/tools/tools/nanobsd/embedded X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/tools/nanobsd/embedded X-SVN-Commit-Revision: 329061 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.25 Precedence: list List-Id: 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, 09 Feb 2018 14:31:13 -0000 Author: kevans Date: Fri Feb 9 14:31:11 2018 New Revision: 329061 URL: https://svnweb.freebsd.org/changeset/base/329061 Log: Teach nanobsd about armv7, add -m to qemu invocations qemu defaults to 128 MiB of RAM, which has been found to not necessarily be enough for booting the system, at least on amd64 and armv7 Add a sensible -m 512 to the examples so that they'll work out of the box in the general case. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14234 Modified: head/tools/tools/nanobsd/embedded/beaglebone.cfg head/tools/tools/nanobsd/embedded/common head/tools/tools/nanobsd/embedded/pandaboard.cfg head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg head/tools/tools/nanobsd/embedded/qemu-amd64.cfg head/tools/tools/nanobsd/embedded/qemu-armv7.cfg head/tools/tools/nanobsd/embedded/rpi2.cfg Modified: head/tools/tools/nanobsd/embedded/beaglebone.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/beaglebone.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/beaglebone.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -26,7 +26,7 @@ # SUCH DAMAGE. # -NANO_ARCH=armv6 +NANO_ARCH=armv7 NANO_KERNEL=BEAGLEBONE NANO_DRIVE=mmcsd0 NANO_NAME=beaglebone Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/common Fri Feb 9 14:31:11 2018 (r329061) @@ -535,6 +535,9 @@ std_armeb ( ) { std_armv6 ( ) { } +std_armv7 ( ) { +} + std_i386 ( ) { # Default values, if not overridden in .cfg file : ${NANO_KERNEL:=GENERIC} Modified: head/tools/tools/nanobsd/embedded/pandaboard.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/pandaboard.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/pandaboard.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -26,7 +26,7 @@ # SUCH DAMAGE. # -NANO_ARCH=armv6 +NANO_ARCH=armv7 NANO_KERNEL=PANDABOARD NANO_DRIVE=mmcsd0 NANO_NAME=pandaboard Modified: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi-bios.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -36,7 +36,7 @@ qemu_env # # Run with -# qemu-system-x86_64 -serial stdio -bios OVMF.fd \ +# qemu-system-x86_64 -m 512 -serial stdio -bios OVMF.fd \ # -hda _.disk.image.qemu-amd64-uefi.qcow2 # OVMF.fd is from # http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip Modified: head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/qemu-amd64-uefi.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -36,7 +36,7 @@ qemu_env # # Run with -# qemu-system-x86_64 -serial stdio -bios OVMF.fd \ +# qemu-system-x86_64 -m 512 -serial stdio -bios OVMF.fd \ # -hda _.disk.image.qemu-amd64-uefi.qcow2 # OVMF.fd is from # http://sourceforge.net/projects/edk2/files/OVMF/OVMF-X64-r15214.zip Modified: head/tools/tools/nanobsd/embedded/qemu-amd64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -34,6 +34,6 @@ NANO_NAME=qemu-amd64 qemu_env # Run with: -# qemu-system-x86_64 -hdd $file -serial telnet::4444,server -nographic +# qemu-system-x86_64 -m 512 -hdd $file -serial telnet::4444,server -nographic # To get some breathing room on the image: # qemu-img resize $file +2G Modified: head/tools/tools/nanobsd/embedded/qemu-armv7.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/qemu-armv7.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -27,7 +27,7 @@ # SUCH DAMAGE. # -NANO_ARCH=armv6 +NANO_ARCH=armv7 NANO_DRIVE=vtbd0 NANO_KERNEL=GENERIC NANO_NAME=qemu-armv7 @@ -40,7 +40,7 @@ qemu_env # # Run with -# qemu-system-arm -M virt -serial stdio -bios QEMU_EFI.fd \ +# qemu-system-arm -m 512 -M virt -serial stdio -bios QEMU_EFI.fd \ # -drive if=none,file=_.disk.image.qemu-armv7.qcow2,id=hd0 \ # -device virtio-blk-device,drive=hd0 # QEMU_EFI.fd is from Modified: head/tools/tools/nanobsd/embedded/rpi2.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/rpi2.cfg Fri Feb 9 10:20:16 2018 (r329060) +++ head/tools/tools/nanobsd/embedded/rpi2.cfg Fri Feb 9 14:31:11 2018 (r329061) @@ -26,7 +26,7 @@ # SUCH DAMAGE. # -NANO_ARCH=armv6 +NANO_ARCH=armv7 NANO_KERNEL=RPI2 NANO_DRIVE=mmcsd0 NANO_NAME=rpi2 From owner-svn-src-head@freebsd.org Fri Feb 9 15:50:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EE03F0D85A; Fri, 9 Feb 2018 15:50:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F44E69A2C; Fri, 9 Feb 2018 15:50:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A4E426CB3; Fri, 9 Feb 2018 15:50: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 w19FoXQc018182; Fri, 9 Feb 2018 15:50:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19FoXEb018181; Fri, 9 Feb 2018 15:50:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802091550.w19FoXEb018181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Feb 2018 15:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329064 - head/share/zoneinfo X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/zoneinfo X-SVN-Commit-Revision: 329064 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.25 Precedence: list List-Id: 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, 09 Feb 2018 15:50:33 -0000 Author: imp Date: Fri Feb 9 15:50:32 2018 New Revision: 329064 URL: https://svnweb.freebsd.org/changeset/base/329064 Log: We don't actually need env here, so drop it. All shells allow setting of shell variables for the next command like this. Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Fri Feb 9 15:49:56 2018 (r329063) +++ head/share/zoneinfo/Makefile Fri Feb 9 15:50:32 2018 (r329064) @@ -101,7 +101,7 @@ zoneinfo: yearistype ${TDATA} # differences between the two don't matter for this purpose. # .if make(*install*) -TZS!= cd ${TZBUILDDIR} && find * -type f | env LC_ALL=C sort +TZS!= cd ${TZBUILDDIR} && find * -type f | LC_ALL=C sort .endif beforeinstall: install-zoneinfo From owner-svn-src-head@freebsd.org Fri Feb 9 16:08:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39BECF0F0A8; Fri, 9 Feb 2018 16:08:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E18426A8F6; Fri, 9 Feb 2018 16:08:57 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7D1A26FD3; Fri, 9 Feb 2018 16:08:57 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19G8vVi027874; Fri, 9 Feb 2018 16:08:57 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19G8vbe027873; Fri, 9 Feb 2018 16:08:57 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802091608.w19G8vbe027873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 9 Feb 2018 16:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329067 - head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zpool X-SVN-Commit-Revision: 329067 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.25 Precedence: list List-Id: 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, 09 Feb 2018 16:08:58 -0000 Author: asomers Date: Fri Feb 9 16:08:57 2018 New Revision: 329067 URL: https://svnweb.freebsd.org/changeset/base/329067 Log: Fix "zpool add" crash when a replacing vdev has a spare child Fix an assertion in zpool that causes a crash when running any "zpool add" command on a spare that contains a replacing vdev with a spare child. This likely affects Illumos, too. PR: 225546 MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D14138 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Fri Feb 9 15:58:33 2018 (r329066) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c Fri Feb 9 16:08:57 2018 (r329067) @@ -688,6 +688,21 @@ get_replication(nvlist_t *nvroot, boolean_t fatal) verify(nvlist_lookup_string(cnv, ZPOOL_CONFIG_TYPE, &childtype) == 0); + if (strcmp(childtype, + VDEV_TYPE_SPARE) == 0) { + /* We have a replacing vdev with + * a spare child. Get the first + * real child of the spare + */ + verify( + nvlist_lookup_nvlist_array( + cnv, + ZPOOL_CONFIG_CHILDREN, + &rchild, + &rchildren) == 0); + assert(rchildren >= 2); + cnv = rchild[0]; + } } verify(nvlist_lookup_string(cnv, From owner-svn-src-head@freebsd.org Fri Feb 9 16:19:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DE34F0FC90; Fri, 9 Feb 2018 16:19:09 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22a.google.com (mail-lf0-x22a.google.com [IPv6:2a00:1450:4010:c07::22a]) (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 0CC886B227; Fri, 9 Feb 2018 16:19:09 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22a.google.com with SMTP id f136so11939555lff.8; Fri, 09 Feb 2018 08:19:08 -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=4uxOnYfw6BF2IZ467ZYGJ3a5Z8Wc+G/mEpYCdktS3r0=; b=CeV7UGlsdLpi2pMMB8iydWKilA9zp4ZLTjbm4+DfWWVhAY4kyXTNQYlEJ9ZBMVjT62 mC0/HHikmE3e9pDJM6LQsxgTfTsAD0Z5ziAaYqPt8o5KjHH2Ru8Qp789gAGFJHXkwU7O VOApVsp9DVZeJPDXcfE1lVlUY4150nq1AZ9dvdX36nwiH2PlHJ9PdT+/Zek5r1Sw4i7s lbH57O6DlFcXxpW/oIjvK9eBmroc8+dqIcjPFfKrLO0v5RLH1t3yNhrBjSsaoPpYYeW/ /byxm/+fJ0KXV51fZDujpIvQ1kJRpWOXQbaa5OXeNlhaFGO2onh1lW7ZS8UhOFcHLe8n 7+eg== 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=4uxOnYfw6BF2IZ467ZYGJ3a5Z8Wc+G/mEpYCdktS3r0=; b=HBMupySTDuRgWQ6NMC+DUE9txbWLzc7FW9DnThreGEmMVbtdoVbsRJ3baUs1a5idpn RniMB7fWZQFBB41wO6Kq4GC0jRrIFL2sCuRC9xwRGGeeasEiUQtMq4V9zu9PAaAYvAv8 SKtDBkoIO76jBp03sLjqkghx2KxNIItQu+uqUSnhN83x71uajTRjjEJcDJnqPXMtXmyQ xjGXoF8PKCjUz9G7ZXWMfjjFUBSCzIx6bqJ9QCuNqu/O4AdFglo3wL1ujL3R7NGTVOtw 3O2wZ/RXl2dk7gXrWX0bt1XxVAFltCSAQy8nbigVUKXLYJf25AXWlZ+LbBR1EAlXAtae NMmw== X-Gm-Message-State: APf1xPCl77b4LdbLA1T33QVX5CUQ4CGZRlUKX56cZrZowIAWAHGpB4qf CFzVgnhDGQo1az976piYyX05W3vdRAlB2/VpDqg= X-Google-Smtp-Source: AH8x2260J6u1cEcclt6ZyUNUGmDqmcZxUXRgVunQnJ3hTjfYQKAYhv/JMnn0lARlQnhg8JwBdPXmD9BWk08HuQX05K8= X-Received: by 10.25.229.129 with SMTP id i1mr2463891lfk.66.1518193146239; Fri, 09 Feb 2018 08:19:06 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.87.131 with HTTP; Fri, 9 Feb 2018 08:19:05 -0800 (PST) In-Reply-To: <201802091550.w19FoXEb018181@repo.freebsd.org> References: <201802091550.w19FoXEb018181@repo.freebsd.org> From: Alan Somers Date: Fri, 9 Feb 2018 09:19:05 -0700 X-Google-Sender-Auth: _0DFQXrqOgayRAGfrU7J4J_0Nto Message-ID: Subject: Re: svn commit: r329064 - head/share/zoneinfo To: Warner Losh Cc: src-committers@freebsd.org, 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 09 Feb 2018 16:19:09 -0000 On Fri, Feb 9, 2018 at 8:50 AM, Warner Losh wrote: > Author: imp > Date: Fri Feb 9 15:50:32 2018 > New Revision: 329064 > URL: https://svnweb.freebsd.org/changeset/base/329064 > > Log: > We don't actually need env here, so drop it. All shells allow setting > of shell variables for the next command like this. > > Modified: > head/share/zoneinfo/Makefile > As a matter of fact, shells/fish doesn't allow that. But don't go reverting your commit; fish doesn't support "&&" either. Only a weirdo would invoke fish from a Makefile. -Alan From owner-svn-src-head@freebsd.org Fri Feb 9 16:41:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F4B2F1186C for ; Fri, 9 Feb 2018 16:41:40 +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 921C46C3B5 for ; Fri, 9 Feb 2018 16:41:39 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id z6so10258030iob.11 for ; Fri, 09 Feb 2018 08:41: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=JdJUxm6uPNho7XHBTXpxnLFkNTTd17HP3I9ahwC2uDc=; b=MWgbXHX2eqWdIMNsWHl5vHQCWjr1plOk0lreFrda1HD1pEczNTWWpxHFqlhP1NX1+s xwV/66qfjGoIjHV4xKHq5wH5G3yooxpyXWc9lZnlq3f3NO1lhSMxLGar3GtPBTA1Efrz QzPQKJOyq1+PusYYkKKyNhawAt7l55X4qperMf8eMmLeapficsu4e5vWYelicXjbSy6E jW1CqRWFhXuBS82vm9x3iumfrORYvoHUHqc1GAIeU4Kyci2xyCRuU2tDpBqTuag0a8NA 9x6u64cyQnjJlRMDAKez13VL7FeY5Hzt2T87ETplIt+hlUQejgekvZIDW04EotIrnUVy LhYA== 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=JdJUxm6uPNho7XHBTXpxnLFkNTTd17HP3I9ahwC2uDc=; b=Pc/Uci1OD7MtzI1L3xmVZ8BZGIiWbhDbfT3lvRz5ArK6ZrKiLDiELnPDXdtgiHnzM0 ZIo2/ZD86u8mP/jiZcSX6+DqPcrwzQiJGAah0rga1UF5yVn/Mj8u4AYKRkf8TfkgzRxF sr4Ys5ut7GJsMd4h/tkoQNkrdrSKoURCY3ZopQ/uvi1w7cwSxEAzgFJ6WCCC1DbP8H4x P6eQoowyxQFfTrRSqzb1J0aC8tZHJFHZGKtNIQmDDCVLF7sJGQKeQ5rEuGaaWC9/DkV3 sfC8G5eYSD5m6rEpE+/+8M9x3IA2o4Ksp0d/HKEseDoF1aEreWnOOJaE/xim6bKjFFVp hXaA== X-Gm-Message-State: APf1xPC2MwukkVs/E42nN7Qkj3NbzHh5KvMSilY8RPBe/JgcVEYLvnBT aT69DuHmrNX8/r3zrsZKJ0WHH/DonHvPczu7Nft2gA== X-Google-Smtp-Source: AH8x224VLVItrj/S22frfsKbxhmIK6gSxdrXDvk8FwEFY5F9yvt5J9FsYULW9YGCweOi5PdTNn8eONO0vvZ45q7PjbI= X-Received: by 10.107.136.76 with SMTP id k73mr4032602iod.301.1518194498788; Fri, 09 Feb 2018 08:41:38 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 9 Feb 2018 08:41:37 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201802091550.w19FoXEb018181@repo.freebsd.org> From: Warner Losh Date: Fri, 9 Feb 2018 09:41:37 -0700 X-Google-Sender-Auth: p_YlxVciDWxOG6dsbliF0SHAqHw Message-ID: Subject: Re: svn commit: r329064 - head/share/zoneinfo To: Alan Somers 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 09 Feb 2018 16:41:40 -0000 On Fri, Feb 9, 2018 at 9:19 AM, Alan Somers wrote: > On Fri, Feb 9, 2018 at 8:50 AM, Warner Losh wrote: > >> Author: imp >> Date: Fri Feb 9 15:50:32 2018 >> New Revision: 329064 >> URL: https://svnweb.freebsd.org/changeset/base/329064 >> >> Log: >> We don't actually need env here, so drop it. All shells allow setting >> of shell variables for the next command like this. >> >> Modified: >> head/share/zoneinfo/Makefile >> > > As a matter of fact, shells/fish doesn't allow that. But don't go > reverting your commit; fish doesn't support "&&" either. Only a weirdo > would invoke fish from a Makefile. > All Bourne-like shells have to. Warner From owner-svn-src-head@freebsd.org Fri Feb 9 17:46:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DCBDF169E1; Fri, 9 Feb 2018 17:46:34 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED24E6F9D3; Fri, 9 Feb 2018 17:46:33 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E38FA27FD6; Fri, 9 Feb 2018 17:46:33 +0000 (UTC) (envelope-from jtl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19HkX8f078038; Fri, 9 Feb 2018 17:46:33 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19HkXAD078037; Fri, 9 Feb 2018 17:46:33 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201802091746.w19HkXAD078037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Fri, 9 Feb 2018 17:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329071 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 329071 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.25 Precedence: list List-Id: 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, 09 Feb 2018 17:46:34 -0000 Author: jtl Date: Fri Feb 9 17:46:33 2018 New Revision: 329071 URL: https://svnweb.freebsd.org/changeset/base/329071 Log: On bootup, the amd64 pmap initialization code creates page-table mappings for the pages used for the kernel and some initial allocations used for the page table. It maps the kernel and the blocks used for these initial allocations using 2MB pages. However, if the kernel does not end on a 2MB boundary, it still maps the last portion using a 2MB page, but reports that the unused 4K blocks within this 2MB allocation are free physical blocks. This means that these same physical blocks could also be mapped elsewhere - for example, into a user process. Given the proximity to the kernel text and data area, it seems wise to avoid allowing someone to write data to physical blocks also mapped into these virtual addresses. (Note that this isn't a security vulnerability: the direct map makes most/all memory on the system mapped into kernel space. And, nothing in the kernel should be trying to access these pages, as the virtual addresses are unused. It simply seems wise to avoid reusing these physical blocks while they are mapped to virtual addresses so close to the kernel text and data area.) Consequently, let's reserve the physical blocks covered by the page-table mappings for these initial allocations. Reviewed by: kib, markj MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14268 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Fri Feb 9 17:25:34 2018 (r329070) +++ head/sys/amd64/amd64/pmap.c Fri Feb 9 17:46:33 2018 (r329071) @@ -957,6 +957,13 @@ create_pagetables(vm_paddr_t *firstaddr) pd_p[i] = (i << PDRSHIFT) | X86_PG_RW | X86_PG_V | PG_PS | pg_g; + /* + * Because we map the physical blocks in 2M pages, adjust firstaddr + * to record the physical blocks we've actually mapped into kernel + * virtual address space. + */ + *firstaddr = round_2mpage(*firstaddr); + /* And connect up the PD to the PDP (leaving room for L4 pages) */ pdp_p = (pdp_entry_t *)(KPDPphys + ptoa(KPML4I - KPML4BASE)); for (i = 0; i < nkpdpe; i++) From owner-svn-src-head@freebsd.org Fri Feb 9 17:52:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61874F16FC5; Fri, 9 Feb 2018 17:52: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 0D40F6FE95; Fri, 9 Feb 2018 17:52:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 799AA10A7DB; Fri, 9 Feb 2018 12:52:01 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329064 - head/share/zoneinfo Date: Fri, 09 Feb 2018 09:49:33 -0800 Message-ID: <14002093.zLdzgIqnsv@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201802091550.w19FoXEb018181@repo.freebsd.org> References: <201802091550.w19FoXEb018181@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, 09 Feb 2018 12:52:01 -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.25 Precedence: list List-Id: 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, 09 Feb 2018 17:52:03 -0000 On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > Author: imp > Date: Fri Feb 9 15:50:32 2018 > New Revision: 329064 > URL: https://svnweb.freebsd.org/changeset/base/329064 > > Log: > We don't actually need env here, so drop it. All shells allow setting > of shell variables for the next command like this. Eh: % LC_ALL=C env LC_ALL=C: Command not found. csh and tcsh don't let you set environment variables as a prefix. That said, if you try to use csh as the SHELL for make I bet many things would break. -- John Baldwin From owner-svn-src-head@freebsd.org Fri Feb 9 18:47:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78D8CF1ABF6; Fri, 9 Feb 2018 18:47:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F244725C2; Fri, 9 Feb 2018 18:47:01 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25F28A45; Fri, 9 Feb 2018 18:47:01 +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 w19Il0Vj008012; Fri, 9 Feb 2018 18:47:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19Il0GX008011; Fri, 9 Feb 2018 18:47:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802091847.w19Il0GX008011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Feb 2018 18:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329075 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 329075 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.25 Precedence: list List-Id: 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, 09 Feb 2018 18:47:01 -0000 Author: imp Date: Fri Feb 9 18:47:00 2018 New Revision: 329075 URL: https://svnweb.freebsd.org/changeset/base/329075 Log: sort needs to be in ITOOLS since find -s was changed to find | sort. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Feb 9 18:42:34 2018 (r329074) +++ head/Makefile.inc1 Fri Feb 9 18:47:00 2018 (r329075) @@ -1109,7 +1109,7 @@ _zoneinfo= zic tzsetup ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \ date echo egrep find grep id install ${_install-info} \ ln make mkdir mtree mv pwd_mkdb \ - rm sed services_mkdb sh strip sysctl test true uname wc ${_zoneinfo} \ + rm sed services_mkdb sh sort strip sysctl test true uname wc ${_zoneinfo} \ ${LOCAL_ITOOLS} # Needed for share/man From owner-svn-src-head@freebsd.org Fri Feb 9 18:50:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 937E8F1AFFE for ; Fri, 9 Feb 2018 18:50:37 +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 22B95728CF for ; Fri, 9 Feb 2018 18:50:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id x188so4158498iod.1 for ; Fri, 09 Feb 2018 10:50:37 -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=gRh5+MCgUeG8RIaJAH7Zy1sazI9ahv6y0gmNKNOJ5hg=; b=Zakc6KMRczcF73gj7on5SmgpvWLUowPcZFsjtmlWiNFpcGXCOVp1USNo//tJJa23P8 jbP/yHtymQC+xKPdehffKj2T82heVeO3/1ZV6bEUOJrMAHmsahKlSSBKrDkRU9Qil3yT 82L2NsU2wfsNmINY3ah7FW6PQ0ygWpP7g0QTV4FHsLbMDYneZzatBagLoZOgW5ZqhYY6 umK9aa7IrZRfABefbsQXbhyCOTHqMnggL1Efw2v8zpzQYWFnkMwqXFdq2ClZVhkA5pVQ 21wyGfogKUM1ULMVItF5NlG1al/c/8rLBHBjAA96rg/R0ppL3jZAuUpo0+uL74mIsa/0 cmZQ== 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=gRh5+MCgUeG8RIaJAH7Zy1sazI9ahv6y0gmNKNOJ5hg=; b=qk/BBMQqddF0Gb+rjmhtiF9g6w3VR49J94og8d+rsGSGfpvVldk5gH8Fw/0WVaxYH7 Rx3Br/9aZfd5IN+AAuw5sRwenHsjqH4zhwXOg99tD5woTIpNv3JJ72luw+7tq2KoKzQL Ji3W9mCT2NidhT/GcjGJH2LoXd1eFO6suEpRDN4qm4LwcBmFssXnRcXTLCk1eTf6DiL+ 3zWL8pbqGduocl3EFas4S2O10Am4+Erqd69T6LJdOC9EBRA5LeOp5I4ZOxEs9b3TL/jo AhOTFXazRLU0z1GbtfivRmzpsfbQsU649Eggm/nbvYa0mJHyp5Vqle2JO+U8wU55/K+o d9tQ== X-Gm-Message-State: APf1xPDnM6OU+R+1XnstTxJ+cQcJCVjH9il1WO4RMBItUj8aPGp4F6py m8GQZH05tBaTzvNGWPmaE1Zi9Lh6pNr8d3FxN7bxoQ== X-Google-Smtp-Source: AH8x224fm/TWIuZNZJ1CKFi3nqxu13mH2YeGqClDF/AzoUnxY/dCNxP3qN65kAfAo2xo4sNsKxGX2K43g2L6YLv945I= X-Received: by 10.107.30.146 with SMTP id e140mr3593160ioe.291.1518202236430; Fri, 09 Feb 2018 10:50:36 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 9 Feb 2018 10:50:35 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <14002093.zLdzgIqnsv@ralph.baldwin.cx> References: <201802091550.w19FoXEb018181@repo.freebsd.org> <14002093.zLdzgIqnsv@ralph.baldwin.cx> From: Warner Losh Date: Fri, 9 Feb 2018 11:50:35 -0700 X-Google-Sender-Auth: hGUKYQkCEMDUWpTM4pgwDl3Pr4s Message-ID: Subject: Re: svn commit: r329064 - head/share/zoneinfo To: John Baldwin 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 09 Feb 2018 18:50:37 -0000 On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin wrote: > On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > > Author: imp > > Date: Fri Feb 9 15:50:32 2018 > > New Revision: 329064 > > URL: https://svnweb.freebsd.org/changeset/base/329064 > > > > Log: > > We don't actually need env here, so drop it. All shells allow setting > > of shell variables for the next command like this. > > Eh: > > % LC_ALL=C env > LC_ALL=C: Command not found. > > csh and tcsh don't let you set environment variables as a prefix. > > That said, if you try to use csh as the SHELL for make I bet many things > would break. > Right, all shells supported as SHELL for make. csh isn't on the list of supported shells. Your bet is right: a lot of things do break. Warner From owner-svn-src-head@freebsd.org Fri Feb 9 19:04:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03D69F1BF7F; Fri, 9 Feb 2018 19:04:51 +0000 (UTC) (envelope-from danfe@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 A37987367F; Fri, 9 Feb 2018 19:04:50 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 9CB155CAC; Fri, 9 Feb 2018 19:04:50 +0000 (UTC) Date: Fri, 9 Feb 2018 19:04:50 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: John Baldwin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Subject: Re: svn commit: r329064 - head/share/zoneinfo Message-ID: <20180209190450.GA85711@FreeBSD.org> References: <201802091550.w19FoXEb018181@repo.freebsd.org> <14002093.zLdzgIqnsv@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 09 Feb 2018 19:04:51 -0000 On Fri, Feb 09, 2018 at 11:50:35AM -0700, Warner Losh wrote: > On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin wrote: > > On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > > > New Revision: 329064 > > > URL: https://svnweb.freebsd.org/changeset/base/329064 > > > > > > Log: > > > We don't actually need env here, so drop it. All shells allow setting > > > of shell variables for the next command like this. > > > > Eh: > > > > % LC_ALL=C env > > LC_ALL=C: Command not found. > > > > csh and tcsh don't let you set environment variables as a prefix. > > > > That said, if you try to use csh as the SHELL for make I bet many things > > would break. > > Right, all shells supported as SHELL for make. csh isn't on the list of > supported shells. Your bet is right: a lot of things do break. I don't really understand why we're discussing it: (t)csh, fish, whatever are for interactive use *only*. Scripts (and makefiles) should only be written for standard plain POSIX shell. ./danfe From owner-svn-src-head@freebsd.org Fri Feb 9 19:10:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B65DF1C47E; Fri, 9 Feb 2018 19:10:47 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFFEB73A1E; Fri, 9 Feb 2018 19:10:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB044D9C; Fri, 9 Feb 2018 19:10:46 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19JAkkE018428; Fri, 9 Feb 2018 19:10:46 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19JAksQ018424; Fri, 9 Feb 2018 19:10:46 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802091910.w19JAksQ018424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 9 Feb 2018 19:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329076 - in head/tools/diag: . prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/tools/diag: . prtblknos X-SVN-Commit-Revision: 329076 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.25 Precedence: list List-Id: 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, 09 Feb 2018 19:10:47 -0000 Author: mckusick Date: Fri Feb 9 19:10:46 2018 New Revision: 329076 URL: https://svnweb.freebsd.org/changeset/base/329076 Log: This is a little C-program that can be used to print out the list of blocks used by a requested list of inodes. For example, to list the blocks referenced by your kernel: guest_12 % df / Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/gpt/rootfs 20307196 10707336 7975288 57% / guest_12 % ls -i /boot/kernel/kernel 160603 /boot/kernel/kernel guest_12 % ./prtblknos /dev/gpt/rootfs 160603 160603: lbn 0-7 blkno 3217584-3217647 lbn 8-11 blkno 3217864-3217895 distance 216 First-level indirect, blkno 3217896-3217903 distance 0 lbn 12-19 blkno 3217904-3217967 distance 8 lbn 20-75 blkno 3251816-3252263 distance 33848 lbn 76-83 blkno 3252368-3252431 distance 104 lbn 84-91 blkno 3252464-3252527 distance 32 lbn 92-852 blkno 3252896-3258983 distance 368 Each contiguous range of blocks is printed on a line. The distance metric is the size of the gap from the end of the previous set of blocks to the beginning of the next set of blocks. Short distances are desirable. Added: head/tools/diag/prtblknos/ head/tools/diag/prtblknos/Makefile (contents, props changed) head/tools/diag/prtblknos/README (contents, props changed) head/tools/diag/prtblknos/prtblknos.c (contents, props changed) Modified: head/tools/diag/README Modified: head/tools/diag/README ============================================================================== --- head/tools/diag/README Fri Feb 9 18:47:00 2018 (r329075) +++ head/tools/diag/README Fri Feb 9 19:10:46 2018 (r329076) @@ -11,4 +11,4 @@ Please make a subdir per program, and add a brief desc dumpvfscache program that can be used to examine the contents of the vfs name cache. localeck check for invalid/incomplete locales - +prtblknos Print out the blocks used by each inode in the list Added: head/tools/diag/prtblknos/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/Makefile Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PROG= prtblknos + +MAN= + +test: ${PROG} + ./${PROG} > a + +.include Added: head/tools/diag/prtblknos/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/README Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +This is a little C-program that can be used to print out the list +of blocks used by a requested list of inodes. + +For example, to list the blocks referenced by your kernel: + +guest_12 % df / +Filesystem 1K-blocks Used Avail Capacity Mounted on +/dev/gpt/rootfs 20307196 10707336 7975288 57% / + +guest_12 % ls -i /boot/kernel/kernel +160603 /boot/kernel/kernel + +guest_12 % ./prtblknos /dev/gpt/rootfs 160603 +160603: lbn 0-7 blkno 3217584-3217647 + lbn 8-11 blkno 3217864-3217895 distance 216 +First-level indirect, blkno 3217896-3217903 distance 0 + lbn 12-19 blkno 3217904-3217967 distance 8 + lbn 20-75 blkno 3251816-3252263 distance 33848 + lbn 76-83 blkno 3252368-3252431 distance 104 + lbn 84-91 blkno 3252464-3252527 distance 32 + lbn 92-852 blkno 3252896-3258983 distance 368 + +Each contiguous range of blocks is printed on a line. +The distance metric is the size of the gap from the end of the +previous set of blocks to the beginning of the next set of blocks. +Short distances are desirable. + + Marshall Kirk McKusick + January 19, 2018 Added: head/tools/diag/prtblknos/prtblknos.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/prtblknos.c Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,314 @@ +/* + * Copyright (c) 1998, 2003, 2013, 2018 Marshall Kirk McKusick. + * 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 MARSHALL KIRK MCKUSICK ``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 MARSHALL KIRK MCKUSICK 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 +#include +#include +#include +#include +#include +#include +#include + +union dinode { + struct ufs1_dinode *dp1; + struct ufs2_dinode *dp2; +}; +struct fs *sbp; +char *fsname; +int fd; + +void indirprt(int level, int blksperindir, int lbn, ufs2_daddr_t blkno, + int lastlbn); +void printblk(int lbn, ufs2_daddr_t blkno, int numblks, int lastlbn); + +/* + * Possible superblock locations ordered from most to least likely. + */ +static int sblock_try[] = SBLOCKSEARCH; + +int +main(argc, argv) + int argc; + char *argv[]; +{ + int i, len, lbn, frags, inonum, numblks, blksperindir; + char sblock[SBLOCKSIZE], ibuf[MAXBSIZE]; + ufs2_daddr_t blkno; + off_t size, offset; + union dinode dp; + + if (argc < 3) { + (void)fprintf(stderr,"usage: prtblknos filesystem inode ...\n"); + exit(1); + } + + fsname = *++argv; + + /* get the superblock. */ + if ((fd = open(fsname, O_RDONLY, 0)) < 0) + err(1, "%s", fsname); + for (i = 0; sblock_try[i] != -1; i++) { + if (lseek(fd, sblock_try[i], SEEK_SET) < 0) + err(1, "lseek: %s", fsname); + if (read(fd, sblock, (long)SBLOCKSIZE) != SBLOCKSIZE) + err(1, "can't read superblock: %s", fsname); + sbp = (struct fs *)sblock; + if ((sbp->fs_magic == FS_UFS1_MAGIC || + (sbp->fs_magic == FS_UFS2_MAGIC && + sbp->fs_sblockloc == sblock_try[i])) && + sbp->fs_bsize <= MAXBSIZE && + sbp->fs_bsize >= sizeof(struct fs)) + break; + } + if (sblock_try[i] == -1) + errx(1, "Cannot find file system superblock\n"); + + /* remaining arguments are inode numbers. */ + while (*++argv) { + /* get the inode number. */ + if ((inonum = atoi(*argv)) <= 0) + errx(1, "%s is not a valid inode number", *argv); + (void)printf("%d:", inonum); + + /* read in the appropriate block. */ + offset = ino_to_fsba(sbp, inonum); /* inode to fs blk */ + offset = fsbtodb(sbp, offset); /* fs blk disk blk */ + offset *= DEV_BSIZE; /* disk blk to bytes */ + + /* seek and read the block */ + if (lseek(fd, offset, SEEK_SET) < 0) + err(1, "%s", fsname); + if (read(fd, ibuf, sbp->fs_bsize) != sbp->fs_bsize) + err(1, "%s", fsname); + + /* get the inode within the block. */ + if (sbp->fs_magic == FS_UFS1_MAGIC) { + dp.dp1 = &((struct ufs1_dinode *)(ibuf)) + [ino_to_fsbo(sbp, inonum)]; + size = dp.dp1->di_size; + } else { + dp.dp2 = &((struct ufs2_dinode *)(ibuf)) + [ino_to_fsbo(sbp, inonum)]; + size = dp.dp2->di_size; + } + + numblks = howmany(size, sbp->fs_bsize); + if (numblks == 0) { + printf(" empty file\n"); + continue; + } + len = numblks < UFS_NDADDR ? numblks : UFS_NDADDR; + for (i = 0; i < len; i++) { + if (i < numblks - 1) + frags = sbp->fs_frag; + else + frags = howmany(size % sbp->fs_bsize, + sbp->fs_fsize); + if (sbp->fs_magic == FS_UFS1_MAGIC) + blkno = dp.dp1->di_db[i]; + else + blkno = dp.dp2->di_db[i]; + printblk(i, blkno, frags, numblks); + } + + blksperindir = 1; + len = numblks - UFS_NDADDR; + lbn = UFS_NDADDR; + for (i = 0; len > 0 && i < UFS_NIADDR; i++) { + if (sbp->fs_magic == FS_UFS1_MAGIC) + blkno = dp.dp1->di_ib[i]; + else + blkno = dp.dp2->di_ib[i]; + indirprt(i, blksperindir, lbn, blkno, numblks); + blksperindir *= NINDIR(sbp); + lbn += blksperindir; + len -= blksperindir; + } + + /* dummy print to flush out last extent */ + printblk(numblks, 0, frags, 0); + } + (void)close(fd); + exit(0); +} + +void +indirprt(level, blksperindir, lbn, blkno, lastlbn) + int level; + int blksperindir; + int lbn; + ufs2_daddr_t blkno; + int lastlbn; +{ + char indir[MAXBSIZE]; + off_t offset; + int i, last; + + printblk(lbn, blkno, sbp->fs_frag, -level); + /* read in the indirect block. */ + offset = fsbtodb(sbp, blkno); /* fs blk disk blk */ + offset *= DEV_BSIZE; /* disk blk to bytes */ + if (lseek(fd, offset, SEEK_SET) < 0) + err(1, "%s", fsname); + if (read(fd, indir, sbp->fs_bsize) != sbp->fs_bsize) + err(1, "%s", fsname); + last = howmany(lastlbn - lbn, blksperindir) < NINDIR(sbp) ? + howmany(lastlbn - lbn, blksperindir) : NINDIR(sbp); + if (blksperindir == 1) { + for (i = 0; i < last; i++) { + if (sbp->fs_magic == FS_UFS1_MAGIC) + blkno = ((ufs1_daddr_t *)indir)[i]; + else + blkno = ((ufs2_daddr_t *)indir)[i]; + printblk(lbn + i, blkno, sbp->fs_frag, lastlbn); + } + return; + } + for (i = 0; i < last; i++) { + if (sbp->fs_magic == FS_UFS1_MAGIC) + blkno = ((ufs1_daddr_t *)indir)[i]; + else + blkno = ((ufs2_daddr_t *)indir)[i]; + indirprt(level - 1, blksperindir / NINDIR(sbp), + lbn + blksperindir * i, blkno, lastlbn); + } +} + +char * +distance(lastblk, firstblk) + daddr_t lastblk; + daddr_t firstblk; +{ + daddr_t delta; + int firstcg, lastcg; + static char buf[100]; + + if (lastblk == 0) + return (""); + delta = firstblk - lastblk - 1; + firstcg = dtog(sbp, firstblk); + lastcg = dtog(sbp, lastblk); + if (firstcg == lastcg) { + snprintf(buf, 100, " distance %jd", (intmax_t)delta); + return (&buf[0]); + } + snprintf(buf, 100, " cg %d blk %jd to cg %d blk %jd", + lastcg, dtogd(sbp, lastblk), firstcg, dtogd(sbp, firstblk)); + return (&buf[0]); +} + + +char *indirname[UFS_NIADDR] = { "First", "Second", "Third" }; + +void +printblk(lbn, blkno, numblks, lastlbn) + int lbn; + ufs2_daddr_t blkno; + int numblks; + int lastlbn; +{ + static int seq; + static daddr_t lastindirblk, lastblk, firstblk; + + if (lastlbn <= 0) + goto flush; + if (seq == 0) { + seq = 1; + firstblk = blkno; + return; + } + if (lbn == 0) { + seq = 1; + lastblk = 0; + firstblk = blkno; + lastindirblk = 0; + return; + } + if (lbn < lastlbn && ((firstblk == 0 && blkno == 0) || + (firstblk == BLK_NOCOPY && blkno == BLK_NOCOPY) || + (firstblk == BLK_SNAP && blkno == BLK_SNAP) || + blkno == firstblk + seq * numblks)) { + seq++; + return; + } +flush: + if (seq == 0) + goto prtindir; + if (firstblk <= BLK_SNAP) { + if (seq == 1) + printf("\tlbn %d %s\n", lbn - seq, + firstblk == 0 ? "hole" : + firstblk == BLK_NOCOPY ? "nocopy" : + "snapblk"); + else + printf("\tlbn %d-%d %s\n", + lbn - seq, lbn - 1, + firstblk == 0 ? "hole" : + firstblk == BLK_NOCOPY ? "nocopy" : + "snapblk"); + } else if (seq == 1) { + if (numblks == 1) + printf("\tlbn %d blkno %jd%s\n", lbn - seq, + (intmax_t)firstblk, distance(lastblk, firstblk)); + else + printf("\tlbn %d blkno %jd-%jd%s\n", lbn - seq, + (intmax_t)firstblk, + (intmax_t)(firstblk + numblks - 1), + distance(lastblk, firstblk)); + lastblk = firstblk + numblks - 1; + } else { + printf("\tlbn %d-%d blkno %jd-%jd%s\n", lbn - seq, lbn - 1, + (intmax_t)firstblk, (intmax_t)(firstblk + + (seq - 1) * sbp->fs_frag + numblks - 1), + distance(lastblk, firstblk)); + lastblk = firstblk + (seq - 1) * sbp->fs_frag + numblks - 1; + } + if (lastlbn > 0 || blkno == 0) { + seq = 1; + firstblk = blkno; + return; + } +prtindir: + if (seq != 0 && (sbp->fs_metaspace == 0 || lastindirblk == 0)) + lastindirblk = lastblk; + printf("%s-level indirect, blkno %jd-%jd%s\n", indirname[-lastlbn], + (intmax_t)blkno, (intmax_t)(blkno + numblks - 1), + distance(lastindirblk, blkno)); + lastindirblk = blkno + numblks - 1; + if (sbp->fs_metaspace == 0) + lastblk = lastindirblk; + seq = 0; +} From owner-svn-src-head@freebsd.org Fri Feb 9 19:25:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D76F1F1D48E; Fri, 9 Feb 2018 19:25:25 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (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 777A674566; Fri, 9 Feb 2018 19:25:25 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp003.me.com by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P3W00A00DAAYS00@mr11p00im-asmtp003.me.com>; Fri, 09 Feb 2018 19:25:07 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1518204307; bh=CZHY82/TcgVJFuqKQa4LVQhHhr9QyypElUI+8unqiTc=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=p6885I1sY3En2AaEhMnzxoKRof71K7eGRm7dVfc6xKVOwjTJ8ZwBjb1aYW7ngQDCn SupMwUdJ9OJSvOYxPvTtFZyAGleNLe+lR+TYoSCZ9o8aasFg616bRNh1bCxaHGy7u1 wrez1iVKDBU7tMKhBMEtTxsCTOrpGme2uYkL8jYYVt7iDRyq1D7htiWvh6L1ukh43l L+RdDR5iazf/U7xq3rRav2Nc5mnHSRcbfdREDyVpHYXDHUqqfXUrO9KqDm4L0V2iMZ meq2V489zWfyqzYGRkXrYtWgDwo8NhnppnTFjcAuOgtcgBa+WRt0kuNL3ltsVK9rXk H/ybc4GciC0ow== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P3W003F7DXS6610@mr11p00im-asmtp003.me.com>; Fri, 09 Feb 2018 19:25:06 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-09_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1802090245 User-Agent: Microsoft-MacOutlook/10.9.0.180116 Date: Fri, 09 Feb 2018 11:25:03 -0800 Subject: Re: svn commit: r329076 - in head/tools/diag: . prtblknos From: Ravi Pokala To: Kirk McKusick , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <338960AC-4E8D-455D-A622-937D6D4FAB9B@mac.com> Thread-topic: svn commit: r329076 - in head/tools/diag: . prtblknos References: <201802091910.w19JAksQ018424@repo.freebsd.org> In-reply-to: <201802091910.w19JAksQ018424@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 09 Feb 2018 19:25:26 -0000 Neat! But, please define "block". Are you talking about a filesystem block = (i.e. default 32KB on UFS2), are you talking about a disk block (which may v= ary based on the Logical Sector Size of the underlying media)? Thanks, Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Kirk McKusick Date: 2018-02-09, Friday at 11:10 To: , , Subject: svn commit: r329076 - in head/tools/diag: . prtblknos Author: mckusick Date: Fri Feb 9 19:10:46 2018 New Revision: 329076 URL: https://svnweb.freebsd.org/changeset/base/329076 Log: This is a little C-program that can be used to print out the list of blocks used by a requested list of inodes. =20 For example, to list the blocks referenced by your kernel: =20 guest_12 % df / Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/gpt/rootfs 20307196 10707336 7975288 57% / =20 guest_12 % ls -i /boot/kernel/kernel 160603 /boot/kernel/kernel =20 guest_12 % ./prtblknos /dev/gpt/rootfs 160603 160603: lbn 0-7 blkno 3217584-3217647 lbn 8-11 blkno 3217864-3217895 distance 216 First-level indirect, blkno 3217896-3217903 distance 0 lbn 12-19 blkno 3217904-3217967 distance 8 lbn 20-75 blkno 3251816-3252263 distance 33848 lbn 76-83 blkno 3252368-3252431 distance 104 lbn 84-91 blkno 3252464-3252527 distance 32 lbn 92-852 blkno 3252896-3258983 distance 368 =20 Each contiguous range of blocks is printed on a line. The distance metric is the size of the gap from the end of the previous set of blocks to the beginning of the next set of blocks. Short distances are desirable. Added: head/tools/diag/prtblknos/ head/tools/diag/prtblknos/Makefile (contents, props changed) head/tools/diag/prtblknos/README (contents, props changed) head/tools/diag/prtblknos/prtblknos.c (contents, props changed) Modified: head/tools/diag/README Modified: head/tools/diag/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/tools/diag/README Fri Feb 9 18:47:00 2018 (r329075) +++ head/tools/diag/README Fri Feb 9 19:10:46 2018 (r329076) @@ -11,4 +11,4 @@ Please make a subdir per program, and add a brief desc dumpvfscache program that can be used to examine the contents of the vfs name cache. localeck check for invalid/incomplete locales=20 - +prtblknos Print out the blocks used by each inode in the list Added: head/tools/diag/prtblknos/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 --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/Makefile Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +PROG=3D prtblknos + +MAN=3D + +test: ${PROG} + ./${PROG} > a + +.include Added: head/tools/diag/prtblknos/README =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/README Fri Feb 9 19:10:46 2018 (r329076) @@ -0,0 +1,31 @@ +# $FreeBSD$ + +This is a little C-program that can be used to print out the list +of blocks used by a requested list of inodes. + +For example, to list the blocks referenced by your kernel: + +guest_12 % df / +Filesystem 1K-blocks Used Avail Capacity Mounted on +/dev/gpt/rootfs 20307196 10707336 7975288 57% / + +guest_12 % ls -i /boot/kernel/kernel +160603 /boot/kernel/kernel + +guest_12 % ./prtblknos /dev/gpt/rootfs 160603 +160603: lbn 0-7 blkno 3217584-3217647 + lbn 8-11 blkno 3217864-3217895 distance 216 +First-level indirect, blkno 3217896-3217903 distance 0 + lbn 12-19 blkno 3217904-3217967 distance 8 + lbn 20-75 blkno 3251816-3252263 distance 33848 + lbn 76-83 blkno 3252368-3252431 distance 104 + lbn 84-91 blkno 3252464-3252527 distance 32 + lbn 92-852 blkno 3252896-3258983 distance 368 + +Each contiguous range of blocks is printed on a line. +The distance metric is the size of the gap from the end of the +previous set of blocks to the beginning of the next set of blocks. +Short distances are desirable. + + Marshall Kirk McKusick + January 19, 2018 Added: head/tools/diag/prtblknos/prtblknos.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 --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/diag/prtblknos/prtblknos.c Fri Feb 9 19:10:46 2018 (r329076= ) @@ -0,0 +1,314 @@ +/* + * Copyright (c) 1998, 2003, 2013, 2018 Marshall Kirk McKusick. + * 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 MARSHALL KIRK MCKUSICK ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP= OSE + * ARE DISCLAIMED. IN NO EVENT SHALL MARSHALL KIRK MCKUSICK BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENT= IAL + * 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, STR= ICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY W= AY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +union dinode { + struct ufs1_dinode *dp1; + struct ufs2_dinode *dp2; +}; +struct fs *sbp; +char *fsname; +int fd; + +void indirprt(int level, int blksperindir, int lbn, ufs2_daddr_t blkno, + int lastlbn); +void printblk(int lbn, ufs2_daddr_t blkno, int numblks, int lastlbn); + +/*=20 + * Possible superblock locations ordered from most to least likely. + */ +static int sblock_try[] =3D SBLOCKSEARCH; + +int +main(argc, argv) + int argc; + char *argv[]; +{ + int i, len, lbn, frags, inonum, numblks, blksperindir; + char sblock[SBLOCKSIZE], ibuf[MAXBSIZE]; + ufs2_daddr_t blkno; + off_t size, offset; + union dinode dp; + + if (argc < 3) { + (void)fprintf(stderr,"usage: prtblknos filesystem inode ...\n"); + exit(1); + } + + fsname =3D *++argv; + + /* get the superblock. */ + if ((fd =3D open(fsname, O_RDONLY, 0)) < 0) + err(1, "%s", fsname); + for (i =3D 0; sblock_try[i] !=3D -1; i++) { + if (lseek(fd, sblock_try[i], SEEK_SET) < 0) + err(1, "lseek: %s", fsname); + if (read(fd, sblock, (long)SBLOCKSIZE) !=3D SBLOCKSIZE) + err(1, "can't read superblock: %s", fsname); + sbp =3D (struct fs *)sblock; + if ((sbp->fs_magic =3D=3D FS_UFS1_MAGIC || + (sbp->fs_magic =3D=3D FS_UFS2_MAGIC && + sbp->fs_sblockloc =3D=3D sblock_try[i])) && + sbp->fs_bsize <=3D MAXBSIZE && + sbp->fs_bsize >=3D sizeof(struct fs)) + break; + } + if (sblock_try[i] =3D=3D -1) + errx(1, "Cannot find file system superblock\n"); + + /* remaining arguments are inode numbers. */ + while (*++argv) { + /* get the inode number. */ + if ((inonum =3D atoi(*argv)) <=3D 0) + errx(1, "%s is not a valid inode number", *argv); + (void)printf("%d:", inonum); + + /* read in the appropriate block. */ + offset =3D ino_to_fsba(sbp, inonum); /* inode to fs blk */ + offset =3D fsbtodb(sbp, offset); /* fs blk disk blk */ + offset *=3D DEV_BSIZE; /* disk blk to bytes */ + + /* seek and read the block */ + if (lseek(fd, offset, SEEK_SET) < 0) + err(1, "%s", fsname); + if (read(fd, ibuf, sbp->fs_bsize) !=3D sbp->fs_bsize) + err(1, "%s", fsname); + + /* get the inode within the block. */ + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) { + dp.dp1 =3D &((struct ufs1_dinode *)(ibuf)) + [ino_to_fsbo(sbp, inonum)]; + size =3D dp.dp1->di_size; + } else { + dp.dp2 =3D &((struct ufs2_dinode *)(ibuf)) + [ino_to_fsbo(sbp, inonum)]; + size =3D dp.dp2->di_size; + } + + numblks =3D howmany(size, sbp->fs_bsize); + if (numblks =3D=3D 0) { + printf(" empty file\n"); + continue; + } + len =3D numblks < UFS_NDADDR ? numblks : UFS_NDADDR; + for (i =3D 0; i < len; i++) { + if (i < numblks - 1) + frags =3D sbp->fs_frag; + else + frags =3D howmany(size % sbp->fs_bsize, + sbp->fs_fsize); + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) + blkno =3D dp.dp1->di_db[i]; + else + blkno =3D dp.dp2->di_db[i]; + printblk(i, blkno, frags, numblks); + } + + blksperindir =3D 1; + len =3D numblks - UFS_NDADDR; + lbn =3D UFS_NDADDR; + for (i =3D 0; len > 0 && i < UFS_NIADDR; i++) { + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) + blkno =3D dp.dp1->di_ib[i]; + else + blkno =3D dp.dp2->di_ib[i]; + indirprt(i, blksperindir, lbn, blkno, numblks); + blksperindir *=3D NINDIR(sbp); + lbn +=3D blksperindir; + len -=3D blksperindir; + } + + /* dummy print to flush out last extent */ + printblk(numblks, 0, frags, 0); + } + (void)close(fd); + exit(0); +} + +void +indirprt(level, blksperindir, lbn, blkno, lastlbn) + int level; + int blksperindir; + int lbn; + ufs2_daddr_t blkno; + int lastlbn; +{ + char indir[MAXBSIZE]; + off_t offset; + int i, last; + + printblk(lbn, blkno, sbp->fs_frag, -level); + /* read in the indirect block. */ + offset =3D fsbtodb(sbp, blkno); /* fs blk disk blk */ + offset *=3D DEV_BSIZE; /* disk blk to bytes */ + if (lseek(fd, offset, SEEK_SET) < 0) + err(1, "%s", fsname); + if (read(fd, indir, sbp->fs_bsize) !=3D sbp->fs_bsize) + err(1, "%s", fsname); + last =3D howmany(lastlbn - lbn, blksperindir) < NINDIR(sbp) ? + howmany(lastlbn - lbn, blksperindir) : NINDIR(sbp); + if (blksperindir =3D=3D 1) { + for (i =3D 0; i < last; i++) { + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) + blkno =3D ((ufs1_daddr_t *)indir)[i]; + else + blkno =3D ((ufs2_daddr_t *)indir)[i]; + printblk(lbn + i, blkno, sbp->fs_frag, lastlbn); + } + return; + } + for (i =3D 0; i < last; i++) { + if (sbp->fs_magic =3D=3D FS_UFS1_MAGIC) + blkno =3D ((ufs1_daddr_t *)indir)[i]; + else + blkno =3D ((ufs2_daddr_t *)indir)[i]; + indirprt(level - 1, blksperindir / NINDIR(sbp), + lbn + blksperindir * i, blkno, lastlbn); + } +} + +char * +distance(lastblk, firstblk) + daddr_t lastblk; + daddr_t firstblk; +{ + daddr_t delta; + int firstcg, lastcg; + static char buf[100]; + + if (lastblk =3D=3D 0) + return (""); + delta =3D firstblk - lastblk - 1; + firstcg =3D dtog(sbp, firstblk); + lastcg =3D dtog(sbp, lastblk); + if (firstcg =3D=3D lastcg) { + snprintf(buf, 100, " distance %jd", (intmax_t)delta); + return (&buf[0]); + } + snprintf(buf, 100, " cg %d blk %jd to cg %d blk %jd", + lastcg, dtogd(sbp, lastblk), firstcg, dtogd(sbp, firstblk)); + return (&buf[0]); +} + + +char *indirname[UFS_NIADDR] =3D { "First", "Second", "Third" }; + +void +printblk(lbn, blkno, numblks, lastlbn) + int lbn; + ufs2_daddr_t blkno; + int numblks; + int lastlbn; +{ + static int seq; + static daddr_t lastindirblk, lastblk, firstblk; + + if (lastlbn <=3D 0) + goto flush; + if (seq =3D=3D 0) { + seq =3D 1; + firstblk =3D blkno; + return; + } + if (lbn =3D=3D 0) { + seq =3D 1; + lastblk =3D 0; + firstblk =3D blkno; + lastindirblk =3D 0; + return; + } + if (lbn < lastlbn && ((firstblk =3D=3D 0 && blkno =3D=3D 0) || + (firstblk =3D=3D BLK_NOCOPY && blkno =3D=3D BLK_NOCOPY) || + (firstblk =3D=3D BLK_SNAP && blkno =3D=3D BLK_SNAP) || + blkno =3D=3D firstblk + seq * numblks)) { + seq++; + return; + } +flush: + if (seq =3D=3D 0) + goto prtindir; + if (firstblk <=3D BLK_SNAP) { + if (seq =3D=3D 1) + printf("\tlbn %d %s\n", lbn - seq, + firstblk =3D=3D 0 ? "hole" : + firstblk =3D=3D BLK_NOCOPY ? "nocopy" : + "snapblk"); + else + printf("\tlbn %d-%d %s\n", + lbn - seq, lbn - 1, + firstblk =3D=3D 0 ? "hole" : + firstblk =3D=3D BLK_NOCOPY ? "nocopy" : + "snapblk"); + } else if (seq =3D=3D 1) { + if (numblks =3D=3D 1) + printf("\tlbn %d blkno %jd%s\n", lbn - seq, + (intmax_t)firstblk, distance(lastblk, firstblk)); + else + printf("\tlbn %d blkno %jd-%jd%s\n", lbn - seq, + (intmax_t)firstblk, + (intmax_t)(firstblk + numblks - 1), + distance(lastblk, firstblk)); + lastblk =3D firstblk + numblks - 1; + } else { + printf("\tlbn %d-%d blkno %jd-%jd%s\n", lbn - seq, lbn - 1, + (intmax_t)firstblk, (intmax_t)(firstblk + + (seq - 1) * sbp->fs_frag + numblks - 1), + distance(lastblk, firstblk)); + lastblk =3D firstblk + (seq - 1) * sbp->fs_frag + numblks - 1; + } + if (lastlbn > 0 || blkno =3D=3D 0) { + seq =3D 1; + firstblk =3D blkno; + return; + } +prtindir: + if (seq !=3D 0 && (sbp->fs_metaspace =3D=3D 0 || lastindirblk =3D=3D 0)) + lastindirblk =3D lastblk; + printf("%s-level indirect, blkno %jd-%jd%s\n", indirname[-lastlbn], + (intmax_t)blkno, (intmax_t)(blkno + numblks - 1), + distance(lastindirblk, blkno)); + lastindirblk =3D blkno + numblks - 1; + if (sbp->fs_metaspace =3D=3D 0) + lastblk =3D lastindirblk; + seq =3D 0; +} From owner-svn-src-head@freebsd.org Fri Feb 9 19:46:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B106F1EC71; Fri, 9 Feb 2018 19:46:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48B69754A3; Fri, 9 Feb 2018 19:46:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F9A71416; Fri, 9 Feb 2018 19:46:52 +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 w19JkqSC038865; Fri, 9 Feb 2018 19:46:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19Jkqb3038864; Fri, 9 Feb 2018 19:46:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802091946.w19Jkqb3038864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 9 Feb 2018 19:46:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329077 - head/usr.bin/tftp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/tftp X-SVN-Commit-Revision: 329077 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.25 Precedence: list List-Id: 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, 09 Feb 2018 19:46:53 -0000 Author: cem Date: Fri Feb 9 19:46:51 2018 New Revision: 329077 URL: https://svnweb.freebsd.org/changeset/base/329077 Log: tftp(1): Fix libedit state corruption involving signals This bug was first reported 14 years ago. The problem was understood 8.5 years ago. A patch that is functionally identical to this one was proposed almost 8 years ago and languished in the PR system / Bugzilla. PR: 63197 Submitted by: lxv AT omut.org, fernando.apesteguia AT gmail.com Reported by: freebsd AT nbritton.org Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Fri Feb 9 19:10:46 2018 (r329076) +++ head/usr.bin/tftp/main.c Fri Feb 9 19:46:51 2018 (r329077) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -114,7 +115,7 @@ static void setoptions(int, char **); static void setrollover(int, char **); static void setpacketdrop(int, char **); -static void command(void) __dead2; +static void command(bool, EditLine *, History *, HistEvent *) __dead2; static const char *command_prompt(void); static void urihandling(char *URI); @@ -176,11 +177,28 @@ static struct modes { int main(int argc, char *argv[]) { + HistEvent he; + EditLine *el; + History *hist; + bool interactive; acting_as_client = 1; peer = -1; strcpy(mode, "netascii"); signal(SIGINT, intr); + + interactive = isatty(STDIN_FILENO); + if (interactive) { + el = el_init("tftp", stdin, stdout, stderr); + hist = history_init(); + history(hist, &he, H_SETSIZE, 100); + el_set(el, EL_HIST, history, hist); + el_set(el, EL_EDITOR, "emacs"); + el_set(el, EL_PROMPT, command_prompt); + el_set(el, EL_SIGNAL, 1); + el_source(el, NULL); + } + if (argc > 1) { if (setjmp(toplevel) != 0) exit(txrx_error); @@ -192,11 +210,15 @@ main(int argc, char *argv[]) setpeer(argc, argv); } - if (setjmp(toplevel) != 0) + + if (setjmp(toplevel) != 0) { + if (interactive) + el_reset(el); (void)putchar('\n'); + } init_options(); - command(); + command(interactive, el, hist, &he); } /* @@ -703,36 +725,22 @@ command_prompt(void) * Command parser. */ static void -command(void) +command(bool interactive, EditLine *el, History *hist, HistEvent *hep) { - HistEvent he; struct cmd *c; - static EditLine *el; - static History *hist; const char *bp; char *cp; - int len, num, vrbose; + int len, num; char line[MAXLINE]; - vrbose = isatty(0); - if (vrbose) { - el = el_init("tftp", stdin, stdout, stderr); - hist = history_init(); - history(hist, &he, H_SETSIZE, 100); - el_set(el, EL_HIST, history, hist); - el_set(el, EL_EDITOR, "emacs"); - el_set(el, EL_PROMPT, command_prompt); - el_set(el, EL_SIGNAL, 1); - el_source(el, NULL); - } for (;;) { - if (vrbose) { + if (interactive) { if ((bp = el_gets(el, &num)) == NULL || num == 0) exit(0); len = MIN(MAXLINE, num); memcpy(line, bp, len); line[len] = '\0'; - history(hist, &he, H_ENTER, bp); + history(hist, hep, H_ENTER, bp); } else { line[0] = 0; if (fgets(line, sizeof line , stdin) == NULL) { From owner-svn-src-head@freebsd.org Fri Feb 9 19:50:48 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59900F1F105; Fri, 9 Feb 2018 19:50:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F09875852; Fri, 9 Feb 2018 19:50:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A0911439; Fri, 9 Feb 2018 19:50:48 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19JolE8041245; Fri, 9 Feb 2018 19:50:47 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19Joljx041243; Fri, 9 Feb 2018 19:50:47 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802091950.w19Joljx041243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 9 Feb 2018 19:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329078 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 329078 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.25 Precedence: list List-Id: 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, 09 Feb 2018 19:50:48 -0000 Author: mckusick Date: Fri Feb 9 19:50:47 2018 New Revision: 329078 URL: https://svnweb.freebsd.org/changeset/base/329078 Log: Merge biodone_finish() back into biodone(). The primary purpose is to make the order of operations clearer to avoid the race condition that was fixed in r328914. In particular, this commit corrects a similar race that existed in the soft updates callback. Doing some sleuthing through the SVN repository, it appears that bufdone_finish() was added to support XFS: ------------------------------------------------------------------------ r153192 | rodrigc | 2005-12-06 19:39:08 -0800 (Tue, 06 Dec 2005) | 13 lines Changes imported from XFS for FreeBSD project: - add fields to struct buf (needed by XFS) - 3 private fields: b_fsprivate1, b_fsprivate2, b_fsprivate3 - b_pin_count, count of pinned buffer - add new B_MANAGED flag - add breada() function to initiate asynchronous I/O on read-ahead blocks. - add bufdone_finish(), bpin(), bunpin_wait() functions Patches provided by: kan Reviewed by: phk Silence on: arch@ ------------------------------------------------------------------------ It does not appear to ever have been used for anything else. XFS was disconnected in r241607: ------------------------------------------------------------------------ r241607 | attilio | 2012-10-16 03:04:00 -0700 (Tue, 16 Oct 2012) | 5 lines Disconnect non-MPSAFE XFS from the build in preparation for dropping GIANT from VFS. This is not targeted for MFC. ------------------------------------------------------------------------ and removed entirely in r247631: ------------------------------------------------------------------------ r247631 | attilio | 2013-03-02 07:33:54 -0800 (Sat, 02 Mar 2013) | 5 lines Garbage collect XFS bits which are now already completely disconnected from the tree since few months. This is not targeted for MFC. ------------------------------------------------------------------------ Since XFS support is gone, there is no reason to retain biodone_finish(). Suggested by: Warner Losh (imp) Discussed with: cem, kib Tested by: Peter Holm (pho) Modified: head/sys/kern/vfs_bio.c head/sys/sys/buf.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Feb 9 19:46:51 2018 (r329077) +++ head/sys/kern/vfs_bio.c Fri Feb 9 19:50:47 2018 (r329078) @@ -4086,21 +4086,6 @@ bufdone(struct buf *bp) bufobj_wdrop(dropobj); return; } - - bufdone_finish(bp); - - if (dropobj) - bufobj_wdrop(dropobj); -} - -void -bufdone_finish(struct buf *bp) -{ - BUF_ASSERT_HELD(bp); - - if (!LIST_EMPTY(&bp->b_dep)) - buf_complete(bp); - if (bp->b_flags & B_VMIO) { /* * Set B_CACHE if the op was a normal read and no error @@ -4113,14 +4098,14 @@ bufdone_finish(struct buf *bp) bp->b_flags |= B_CACHE; vfs_vmio_iodone(bp); } + if (!LIST_EMPTY(&bp->b_dep)) + buf_complete(bp); if ((bp->b_flags & B_CKHASH) != 0) { KASSERT(bp->b_iocmd == BIO_READ, - ("bufdone_finish: b_iocmd %d not BIO_READ", bp->b_iocmd)); - KASSERT(buf_mapped(bp), - ("bufdone_finish: bp %p not mapped", bp)); + ("bufdone: b_iocmd %d not BIO_READ", bp->b_iocmd)); + KASSERT(buf_mapped(bp), ("bufdone: bp %p not mapped", bp)); (*bp->b_ckhashcalc)(bp); } - /* * For asynchronous completions, release the buffer now. The brelse * will do a wakeup there if necessary - so no need to do a wakeup @@ -4134,6 +4119,8 @@ bufdone_finish(struct buf *bp) bqrelse(bp); } else bdone(bp); + if (dropobj) + bufobj_wdrop(dropobj); } /* Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri Feb 9 19:46:51 2018 (r329077) +++ head/sys/sys/buf.h Fri Feb 9 19:50:47 2018 (r329078) @@ -542,7 +542,6 @@ struct buf *geteblk(int, int); int bufwait(struct buf *); int bufwrite(struct buf *); void bufdone(struct buf *); -void bufdone_finish(struct buf *); void bd_speedup(void); int cluster_read(struct vnode *, u_quad_t, daddr_t, long, From owner-svn-src-head@freebsd.org Fri Feb 9 20:00:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90D1AF1FB9A; Fri, 9 Feb 2018 20:00:52 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 404307605E; Fri, 9 Feb 2018 20:00:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B49715EE; Fri, 9 Feb 2018 20:00:52 +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 w19K0qjf044073; Fri, 9 Feb 2018 20:00:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19K0qdb044072; Fri, 9 Feb 2018 20:00:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802092000.w19K0qdb044072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 9 Feb 2018 20:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329079 - head/usr.bin/tftp X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.bin/tftp X-SVN-Commit-Revision: 329079 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.25 Precedence: list List-Id: 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, 09 Feb 2018 20:00:52 -0000 Author: cem Date: Fri Feb 9 20:00:51 2018 New Revision: 329079 URL: https://svnweb.freebsd.org/changeset/base/329079 Log: tftp(1): Clean up leading and trailing whitespace Whitespace-only change. Sponsored by: Dell EMC Isilon Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Fri Feb 9 19:50:47 2018 (r329078) +++ head/usr.bin/tftp/main.c Fri Feb 9 20:00:51 2018 (r329079) @@ -475,7 +475,7 @@ put(int argc, char *argv[]) lcp[strlen(lcp) - 1] = '\0'; lcp++; } - setpeer0(lcp, NULL); + setpeer0(lcp, NULL); } if (!connected) { printf("No target machine specified.\n"); @@ -735,11 +735,11 @@ command(bool interactive, EditLine *el, History *hist, for (;;) { if (interactive) { - if ((bp = el_gets(el, &num)) == NULL || num == 0) - exit(0); - len = MIN(MAXLINE, num); - memcpy(line, bp, len); - line[len] = '\0'; + if ((bp = el_gets(el, &num)) == NULL || num == 0) + exit(0); + len = MIN(MAXLINE, num); + memcpy(line, bp, len); + line[len] = '\0'; history(hist, hep, H_ENTER, bp); } else { line[0] = 0; From owner-svn-src-head@freebsd.org Fri Feb 9 20:05:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A9B9F20229; Fri, 9 Feb 2018 20:05:41 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (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 969E8767BA; Fri, 9 Feb 2018 20:05:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id b66so12390780itd.5; Fri, 09 Feb 2018 12:05:40 -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=UFEKVGasYZPxwbSElxH44Xqo9Q8Il+ub180Q2NTcDCk=; b=LAz8cbA8RwKRQ5rKmxAc7nZqqHTHobwonVAiwAfVPA5TWcsl9ge14NzCSwmL+CIrcq BUqCIjWHn8cFQZZc2WgxNKNY6c+FAEt8Y9ooV5cAHPKQDu+JXUGfVhGDTlQ79DWJNQQ3 VJe/OxgUBbrbik7dhZrSlpIutX/OkB9xTrDyVMQKWRic/4vyKUX0/u/ZMV13Ukcmo3e1 NcRPiqAmgJAKEvlC5yaGcZL/m1NPC1u3FVcBy0PSXY4vbUKyI/zja0MSrjGWVe6Axvyj 9OKu+9Xwgt3sSSTAwV7XjecpXcwtwr5nUuJVlim5kzT/VZ/D7OS5Vg186uyEflYAHdLl xFXg== X-Gm-Message-State: APf1xPB9A8txxzKD0WvrmVRzBcMHicuTnb8waGO0ibdUN3svljp+Yv1l Z9qVoq4fauGB8aAnn9j05csAjeCE X-Google-Smtp-Source: AH8x227rf7mSm/G2XbY/6Ajk62LU8JiOVMg2FaGiVe8VlTImVV/YUMdbWXPVAFnbijvLbI6dUHsjWw== X-Received: by 10.36.57.74 with SMTP id l71mr5386878ita.40.1518206733977; Fri, 09 Feb 2018 12:05:33 -0800 (PST) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com. [209.85.223.179]) by smtp.gmail.com with ESMTPSA id p2sm3848353ite.1.2018.02.09.12.05.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2018 12:05:33 -0800 (PST) Received: by mail-io0-f179.google.com with SMTP id d13so10931997iog.5; Fri, 09 Feb 2018 12:05:33 -0800 (PST) X-Received: by 10.107.131.210 with SMTP id n79mr4347091ioi.215.1518206733569; Fri, 09 Feb 2018 12:05:33 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.152.123 with HTTP; Fri, 9 Feb 2018 12:05:33 -0800 (PST) In-Reply-To: <201802091950.w19Joljx041243@repo.freebsd.org> References: <201802091950.w19Joljx041243@repo.freebsd.org> From: Conrad Meyer Date: Fri, 9 Feb 2018 12:05:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329078 - in head/sys: kern sys To: Kirk McKusick 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.25 Precedence: list List-Id: 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, 09 Feb 2018 20:05:41 -0000 On Fri, Feb 9, 2018 at 11:50 AM, Kirk McKusick wrote: > Author: mckusick > Date: Fri Feb 9 19:50:47 2018 > New Revision: 329078 > URL: https://svnweb.freebsd.org/changeset/base/329078 > > Log: > Merge biodone_finish() back into biodone(). The primary purpose is > to make the order of operations clearer to avoid the race condition > that was fixed in r328914. In particular, this commit corrects a > similar race that existed in the soft updates callback. Thanks! From owner-svn-src-head@freebsd.org Fri Feb 9 20:09:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B5B0F205A4; Fri, 9 Feb 2018 20:09:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F4C076A62; Fri, 9 Feb 2018 20:09:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A4AD1777; Fri, 9 Feb 2018 20:09:33 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19K9Xsk049277; Fri, 9 Feb 2018 20:09:33 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19K9Xxa049276; Fri, 9 Feb 2018 20:09:33 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201802092009.w19K9Xxa049276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 9 Feb 2018 20:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329080 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 329080 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.25 Precedence: list List-Id: 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, 09 Feb 2018 20:09:33 -0000 Author: nwhitehorn Date: Fri Feb 9 20:09:32 2018 New Revision: 329080 URL: https://svnweb.freebsd.org/changeset/base/329080 Log: Fix PowerMac G5 thermal management, plus likely other bugs, introduced in r328113 and affecting SMP systems. The way the time is set on PowerMacs is racy and relies on all the CPUs in the system setting a register simultaneously in a rendezvous. A few-cycle delay can result in out-of-sync times, which can break the scheduler and result in calls like mtx_sleep() and pause() never timing out if the thread is migrated while sleeping. r328113 added a call to a no-op function between the beginning of the rendezvous and setting the time that was only called on APs and added enough cycles to cause a problematic offset. For some reason, the fan-management code was the first place this appeared. Clue from: andreast Reported by: many Modified: head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Fri Feb 9 20:00:51 2018 (r329079) +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Feb 9 20:09:32 2018 (r329080) @@ -81,11 +81,20 @@ machdep_ap_bootstrap(void) __asm __volatile("or 27,27,27"); __asm __volatile("or 6,6,6"); - /* Give platform code a chance to do anything necessary */ + /* + * Set timebase as soon as possible to meet an implicit rendezvous + * from cpu_mp_unleash(), which sets ap_letgo and then immediately + * sets timebase. + * + * Note that this is instrinsically racy and is only relevant on + * platforms that do not support better mechanisms. + */ + platform_smp_timebase_sync(ap_timebase, 1); + + /* Give platform code a chance to do anything else necessary */ platform_smp_ap_init(); - /* Initialize DEC and TB, sync with the BSP values */ - platform_smp_timebase_sync(ap_timebase, 1); + /* Initialize decrementer */ decr_ap_init(); /* Serialize console output and AP count increment */ From owner-svn-src-head@freebsd.org Fri Feb 9 20:22:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8459BF21236 for ; Fri, 9 Feb 2018 20:22:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F294F7745B for ; Fri, 9 Feb 2018 20:22:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id b198so10982632iof.6 for ; Fri, 09 Feb 2018 12:22:09 -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=y0hJxBEVXWk/CiZbvLQ4DIzlaEm6F6NeX7acrDG9C1c=; b=hZvUzvg698f1DrU5Z6QwTZCe9vv8voiR97/oU8rRnWVQMY84soy3GKTqmrjkO97xUE Ef1jGI8ROzh96LxEBG+qHZ4Qnckm6dul5p8PXvoBadMtm++qhphGPGjMEF5qJeJWU9Bx b7G6/RjWE5RndL7rECRKuO5rje9I0+7+r65U3E/ODeziYhOodG/808n4YvXYhP+v1DB+ Vhk14uSfl/jFN6b0zAUdnhJ4XR8/FnSjOpvySiQBe0kbFgGUGVjj6fSDhzJSa+bI2i78 nRggdNLyfBKl7k98JJI14ehmF54JoebXEr63EJRl9NnuPTK/ZyIqXPNRZeaI2YuhtZRo Qb0g== 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=y0hJxBEVXWk/CiZbvLQ4DIzlaEm6F6NeX7acrDG9C1c=; b=OxhZXHd20SpaiMs0/p6iPB8fLaeMpxAK/mDNxY97heWEI/5MBiWnWfi61/l8aUh5QD gf+gAERGWc+kDGn80m5pLJ356AG0Blrx0fZIQEaq1xXbUXuJBxlsnsUQBCrrF319Aihy wJJ+ze/VcO1mxOrJgLlm12tIrmDqQn/rjxwkTpRJBNDnQFC9Xagu06VbVM4HVCVq/khV upIN3IpD/UIMfXsspzmqXp/mbQeJiZ8F9+bMooqfNKOMbV1B5jqkz0iY8xMVB2Sw9D9z b0QUGEKr4Tb3tE7lBOS4tprdU8djomO/q0lbBQgAVd919yVIVXXFAstcHjcezO0Kyu6O AGdQ== X-Gm-Message-State: APf1xPDWYQCyZ+xcMSakPfrVx86lZDuFArDD0GS6gA8Uws4OjIocPQTK ZjCPZ3hYcf8MHPAXGOapMQ4x0A06IsPetGRfPTCujg== X-Google-Smtp-Source: AH8x227sCgxSU01heFZ/th7sIxF4vadysrNX3iMWRqTcMK35IMS5jT9JSGXL3t+cwRaEDJXDtZeXn4vO53TEcGnDFWk= X-Received: by 10.107.167.69 with SMTP id q66mr4346675ioe.130.1518207729305; Fri, 09 Feb 2018 12:22:09 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.201.67 with HTTP; Fri, 9 Feb 2018 12:22:08 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: <20180209190450.GA85711@FreeBSD.org> References: <201802091550.w19FoXEb018181@repo.freebsd.org> <14002093.zLdzgIqnsv@ralph.baldwin.cx> <20180209190450.GA85711@FreeBSD.org> From: Warner Losh Date: Fri, 9 Feb 2018 13:22:08 -0700 X-Google-Sender-Auth: mKPOLH1qF1GBY9ZikDCnWCYcTHw Message-ID: Subject: Re: svn commit: r329064 - head/share/zoneinfo To: Alexey Dokuchaev Cc: John Baldwin , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 09 Feb 2018 20:22:10 -0000 On Fri, Feb 9, 2018 at 12:04 PM, Alexey Dokuchaev wrote: > On Fri, Feb 09, 2018 at 11:50:35AM -0700, Warner Losh wrote: > > On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin wrote: > > > On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: > > > > New Revision: 329064 > > > > URL: https://svnweb.freebsd.org/changeset/base/329064 > > > > > > > > Log: > > > > We don't actually need env here, so drop it. All shells allow > setting > > > > of shell variables for the next command like this. > > > > > > Eh: > > > > > > % LC_ALL=C env > > > LC_ALL=C: Command not found. > > > > > > csh and tcsh don't let you set environment variables as a prefix. > > > > > > That said, if you try to use csh as the SHELL for make I bet many > things > > > would break. > > > > Right, all shells supported as SHELL for make. csh isn't on the list of > > supported shells. Your bet is right: a lot of things do break. > > I don't really understand why we're discussing it: (t)csh, fish, whatever > are for interactive use *only*. Scripts (and makefiles) should only be > written for standard plain POSIX shell. > Right. 'all shells' in my original simply meant that this has been a feature of /bin/sh for long enough that we won't have anything to worry about if we build on a foreign OS using something weird like bash. Warner From owner-svn-src-head@freebsd.org Fri Feb 9 20:49:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DBB2F00F56; Fri, 9 Feb 2018 20:49:10 +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 78CB6787D9; Fri, 9 Feb 2018 20:49:09 +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 w19Kn1FO032219; Fri, 9 Feb 2018 12:49:01 -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 w19Kn152032218; Fri, 9 Feb 2018 12:49:01 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201802092049.w19Kn152032218@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r329076 - in head/tools/diag: . prtblknos In-Reply-To: <201802091910.w19JAksQ018424@repo.freebsd.org> To: Kirk McKusick Date: Fri, 9 Feb 2018 12:49:01 -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.25 Precedence: list List-Id: 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, 09 Feb 2018 20:49:10 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: mckusick > Date: Fri Feb 9 19:10:46 2018 > New Revision: 329076 > URL: https://svnweb.freebsd.org/changeset/base/329076 > > Log: > This is a little C-program that can be used to print out the list > of blocks used by a requested list of inodes. > > For example, to list the blocks referenced by your kernel: > > guest_12 % df / > Filesystem 1K-blocks Used Avail Capacity Mounted on > /dev/gpt/rootfs 20307196 10707336 7975288 57% / > > guest_12 % ls -i /boot/kernel/kernel > 160603 /boot/kernel/kernel > > guest_12 % ./prtblknos /dev/gpt/rootfs 160603 > 160603: lbn 0-7 blkno 3217584-3217647 > lbn 8-11 blkno 3217864-3217895 distance 216 > First-level indirect, blkno 3217896-3217903 distance 0 > lbn 12-19 blkno 3217904-3217967 distance 8 > lbn 20-75 blkno 3251816-3252263 distance 33848 > lbn 76-83 blkno 3252368-3252431 distance 104 > lbn 84-91 blkno 3252464-3252527 distance 32 > lbn 92-852 blkno 3252896-3258983 distance 368 > > Each contiguous range of blocks is printed on a line. > The distance metric is the size of the gap from the end of the > previous set of blocks to the beginning of the next set of blocks. > Short distances are desirable. Cant this be done with fsdb blocks command? > > Added: > head/tools/diag/prtblknos/ > head/tools/diag/prtblknos/Makefile (contents, props changed) > head/tools/diag/prtblknos/README (contents, props changed) > head/tools/diag/prtblknos/prtblknos.c (contents, props changed) > Modified: > head/tools/diag/README > > Modified: head/tools/diag/README > ============================================================================== > --- head/tools/diag/README Fri Feb 9 18:47:00 2018 (r329075) > +++ head/tools/diag/README Fri Feb 9 19:10:46 2018 (r329076) > @@ -11,4 +11,4 @@ Please make a subdir per program, and add a brief desc > dumpvfscache program that can be used to examine the contents of the vfs > name cache. > localeck check for invalid/incomplete locales > - > +prtblknos Print out the blocks used by each inode in the list > > Added: head/tools/diag/prtblknos/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/diag/prtblknos/Makefile Fri Feb 9 19:10:46 2018 (r329076) > @@ -0,0 +1,10 @@ > +# $FreeBSD$ > + > +PROG= prtblknos > + > +MAN= > + > +test: ${PROG} > + ./${PROG} > a > + > +.include > > Added: head/tools/diag/prtblknos/README > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/diag/prtblknos/README Fri Feb 9 19:10:46 2018 (r329076) > @@ -0,0 +1,31 @@ > +# $FreeBSD$ > + > +This is a little C-program that can be used to print out the list > +of blocks used by a requested list of inodes. > + > +For example, to list the blocks referenced by your kernel: > + > +guest_12 % df / > +Filesystem 1K-blocks Used Avail Capacity Mounted on > +/dev/gpt/rootfs 20307196 10707336 7975288 57% / > + > +guest_12 % ls -i /boot/kernel/kernel > +160603 /boot/kernel/kernel > + > +guest_12 % ./prtblknos /dev/gpt/rootfs 160603 > +160603: lbn 0-7 blkno 3217584-3217647 > + lbn 8-11 blkno 3217864-3217895 distance 216 > +First-level indirect, blkno 3217896-3217903 distance 0 > + lbn 12-19 blkno 3217904-3217967 distance 8 > + lbn 20-75 blkno 3251816-3252263 distance 33848 > + lbn 76-83 blkno 3252368-3252431 distance 104 > + lbn 84-91 blkno 3252464-3252527 distance 32 > + lbn 92-852 blkno 3252896-3258983 distance 368 > + > +Each contiguous range of blocks is printed on a line. > +The distance metric is the size of the gap from the end of the > +previous set of blocks to the beginning of the next set of blocks. > +Short distances are desirable. > + > + Marshall Kirk McKusick > + January 19, 2018 > > Added: head/tools/diag/prtblknos/prtblknos.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/diag/prtblknos/prtblknos.c Fri Feb 9 19:10:46 2018 (r329076) > @@ -0,0 +1,314 @@ > +/* > + * Copyright (c) 1998, 2003, 2013, 2018 Marshall Kirk McKusick. > + * 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 MARSHALL KIRK MCKUSICK ``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 MARSHALL KIRK MCKUSICK 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 > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +union dinode { > + struct ufs1_dinode *dp1; > + struct ufs2_dinode *dp2; > +}; > +struct fs *sbp; > +char *fsname; > +int fd; > + > +void indirprt(int level, int blksperindir, int lbn, ufs2_daddr_t blkno, > + int lastlbn); > +void printblk(int lbn, ufs2_daddr_t blkno, int numblks, int lastlbn); > + > +/* > + * Possible superblock locations ordered from most to least likely. > + */ > +static int sblock_try[] = SBLOCKSEARCH; > + > +int > +main(argc, argv) > + int argc; > + char *argv[]; > +{ > + int i, len, lbn, frags, inonum, numblks, blksperindir; > + char sblock[SBLOCKSIZE], ibuf[MAXBSIZE]; > + ufs2_daddr_t blkno; > + off_t size, offset; > + union dinode dp; > + > + if (argc < 3) { > + (void)fprintf(stderr,"usage: prtblknos filesystem inode ...\n"); > + exit(1); > + } > + > + fsname = *++argv; > + > + /* get the superblock. */ > + if ((fd = open(fsname, O_RDONLY, 0)) < 0) > + err(1, "%s", fsname); > + for (i = 0; sblock_try[i] != -1; i++) { > + if (lseek(fd, sblock_try[i], SEEK_SET) < 0) > + err(1, "lseek: %s", fsname); > + if (read(fd, sblock, (long)SBLOCKSIZE) != SBLOCKSIZE) > + err(1, "can't read superblock: %s", fsname); > + sbp = (struct fs *)sblock; > + if ((sbp->fs_magic == FS_UFS1_MAGIC || > + (sbp->fs_magic == FS_UFS2_MAGIC && > + sbp->fs_sblockloc == sblock_try[i])) && > + sbp->fs_bsize <= MAXBSIZE && > + sbp->fs_bsize >= sizeof(struct fs)) > + break; > + } > + if (sblock_try[i] == -1) > + errx(1, "Cannot find file system superblock\n"); > + > + /* remaining arguments are inode numbers. */ > + while (*++argv) { > + /* get the inode number. */ > + if ((inonum = atoi(*argv)) <= 0) > + errx(1, "%s is not a valid inode number", *argv); > + (void)printf("%d:", inonum); > + > + /* read in the appropriate block. */ > + offset = ino_to_fsba(sbp, inonum); /* inode to fs blk */ > + offset = fsbtodb(sbp, offset); /* fs blk disk blk */ > + offset *= DEV_BSIZE; /* disk blk to bytes */ > + > + /* seek and read the block */ > + if (lseek(fd, offset, SEEK_SET) < 0) > + err(1, "%s", fsname); > + if (read(fd, ibuf, sbp->fs_bsize) != sbp->fs_bsize) > + err(1, "%s", fsname); > + > + /* get the inode within the block. */ > + if (sbp->fs_magic == FS_UFS1_MAGIC) { > + dp.dp1 = &((struct ufs1_dinode *)(ibuf)) > + [ino_to_fsbo(sbp, inonum)]; > + size = dp.dp1->di_size; > + } else { > + dp.dp2 = &((struct ufs2_dinode *)(ibuf)) > + [ino_to_fsbo(sbp, inonum)]; > + size = dp.dp2->di_size; > + } > + > + numblks = howmany(size, sbp->fs_bsize); > + if (numblks == 0) { > + printf(" empty file\n"); > + continue; > + } > + len = numblks < UFS_NDADDR ? numblks : UFS_NDADDR; > + for (i = 0; i < len; i++) { > + if (i < numblks - 1) > + frags = sbp->fs_frag; > + else > + frags = howmany(size % sbp->fs_bsize, > + sbp->fs_fsize); > + if (sbp->fs_magic == FS_UFS1_MAGIC) > + blkno = dp.dp1->di_db[i]; > + else > + blkno = dp.dp2->di_db[i]; > + printblk(i, blkno, frags, numblks); > + } > + > + blksperindir = 1; > + len = numblks - UFS_NDADDR; > + lbn = UFS_NDADDR; > + for (i = 0; len > 0 && i < UFS_NIADDR; i++) { > + if (sbp->fs_magic == FS_UFS1_MAGIC) > + blkno = dp.dp1->di_ib[i]; > + else > + blkno = dp.dp2->di_ib[i]; > + indirprt(i, blksperindir, lbn, blkno, numblks); > + blksperindir *= NINDIR(sbp); > + lbn += blksperindir; > + len -= blksperindir; > + } > + > + /* dummy print to flush out last extent */ > + printblk(numblks, 0, frags, 0); > + } > + (void)close(fd); > + exit(0); > +} > + > +void > +indirprt(level, blksperindir, lbn, blkno, lastlbn) > + int level; > + int blksperindir; > + int lbn; > + ufs2_daddr_t blkno; > + int lastlbn; > +{ > + char indir[MAXBSIZE]; > + off_t offset; > + int i, last; > + > + printblk(lbn, blkno, sbp->fs_frag, -level); > + /* read in the indirect block. */ > + offset = fsbtodb(sbp, blkno); /* fs blk disk blk */ > + offset *= DEV_BSIZE; /* disk blk to bytes */ > + if (lseek(fd, offset, SEEK_SET) < 0) > + err(1, "%s", fsname); > + if (read(fd, indir, sbp->fs_bsize) != sbp->fs_bsize) > + err(1, "%s", fsname); > + last = howmany(lastlbn - lbn, blksperindir) < NINDIR(sbp) ? > + howmany(lastlbn - lbn, blksperindir) : NINDIR(sbp); > + if (blksperindir == 1) { > + for (i = 0; i < last; i++) { > + if (sbp->fs_magic == FS_UFS1_MAGIC) > + blkno = ((ufs1_daddr_t *)indir)[i]; > + else > + blkno = ((ufs2_daddr_t *)indir)[i]; > + printblk(lbn + i, blkno, sbp->fs_frag, lastlbn); > + } > + return; > + } > + for (i = 0; i < last; i++) { > + if (sbp->fs_magic == FS_UFS1_MAGIC) > + blkno = ((ufs1_daddr_t *)indir)[i]; > + else > + blkno = ((ufs2_daddr_t *)indir)[i]; > + indirprt(level - 1, blksperindir / NINDIR(sbp), > + lbn + blksperindir * i, blkno, lastlbn); > + } > +} > + > +char * > +distance(lastblk, firstblk) > + daddr_t lastblk; > + daddr_t firstblk; > +{ > + daddr_t delta; > + int firstcg, lastcg; > + static char buf[100]; > + > + if (lastblk == 0) > + return (""); > + delta = firstblk - lastblk - 1; > + firstcg = dtog(sbp, firstblk); > + lastcg = dtog(sbp, lastblk); > + if (firstcg == lastcg) { > + snprintf(buf, 100, " distance %jd", (intmax_t)delta); > + return (&buf[0]); > + } > + snprintf(buf, 100, " cg %d blk %jd to cg %d blk %jd", > + lastcg, dtogd(sbp, lastblk), firstcg, dtogd(sbp, firstblk)); > + return (&buf[0]); > +} > + > + > +char *indirname[UFS_NIADDR] = { "First", "Second", "Third" }; > + > +void > +printblk(lbn, blkno, numblks, lastlbn) > + int lbn; > + ufs2_daddr_t blkno; > + int numblks; > + int lastlbn; > +{ > + static int seq; > + static daddr_t lastindirblk, lastblk, firstblk; > + > + if (lastlbn <= 0) > + goto flush; > + if (seq == 0) { > + seq = 1; > + firstblk = blkno; > + return; > + } > + if (lbn == 0) { > + seq = 1; > + lastblk = 0; > + firstblk = blkno; > + lastindirblk = 0; > + return; > + } > + if (lbn < lastlbn && ((firstblk == 0 && blkno == 0) || > + (firstblk == BLK_NOCOPY && blkno == BLK_NOCOPY) || > + (firstblk == BLK_SNAP && blkno == BLK_SNAP) || > + blkno == firstblk + seq * numblks)) { > + seq++; > + return; > + } > +flush: > + if (seq == 0) > + goto prtindir; > + if (firstblk <= BLK_SNAP) { > + if (seq == 1) > + printf("\tlbn %d %s\n", lbn - seq, > + firstblk == 0 ? "hole" : > + firstblk == BLK_NOCOPY ? "nocopy" : > + "snapblk"); > + else > + printf("\tlbn %d-%d %s\n", > + lbn - seq, lbn - 1, > + firstblk == 0 ? "hole" : > + firstblk == BLK_NOCOPY ? "nocopy" : > + "snapblk"); > + } else if (seq == 1) { > + if (numblks == 1) > + printf("\tlbn %d blkno %jd%s\n", lbn - seq, > + (intmax_t)firstblk, distance(lastblk, firstblk)); > + else > + printf("\tlbn %d blkno %jd-%jd%s\n", lbn - seq, > + (intmax_t)firstblk, > + (intmax_t)(firstblk + numblks - 1), > + distance(lastblk, firstblk)); > + lastblk = firstblk + numblks - 1; > + } else { > + printf("\tlbn %d-%d blkno %jd-%jd%s\n", lbn - seq, lbn - 1, > + (intmax_t)firstblk, (intmax_t)(firstblk + > + (seq - 1) * sbp->fs_frag + numblks - 1), > + distance(lastblk, firstblk)); > + lastblk = firstblk + (seq - 1) * sbp->fs_frag + numblks - 1; > + } > + if (lastlbn > 0 || blkno == 0) { > + seq = 1; > + firstblk = blkno; > + return; > + } > +prtindir: > + if (seq != 0 && (sbp->fs_metaspace == 0 || lastindirblk == 0)) > + lastindirblk = lastblk; > + printf("%s-level indirect, blkno %jd-%jd%s\n", indirname[-lastlbn], > + (intmax_t)blkno, (intmax_t)(blkno + numblks - 1), > + distance(lastindirblk, blkno)); > + lastindirblk = blkno + numblks - 1; > + if (sbp->fs_metaspace == 0) > + lastblk = lastindirblk; > + seq = 0; > +} > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Feb 9 21:49:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DDF3F050AC; Fri, 9 Feb 2018 21:49:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADC867B23F; Fri, 9 Feb 2018 21:49:38 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3D7227DE; Fri, 9 Feb 2018 21:49:38 +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 w19LncPU001323; Fri, 9 Feb 2018 21:49:38 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19Lnc3g001320; Fri, 9 Feb 2018 21:49:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201802092149.w19Lnc3g001320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Fri, 9 Feb 2018 21:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329085 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/ex... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/executer sys/contrib/dev/ac... X-SVN-Commit-Revision: 329085 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.25 Precedence: list List-Id: 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, 09 Feb 2018 21:49:39 -0000 Author: jkim Date: Fri Feb 9 21:49:38 2018 New Revision: 329085 URL: https://svnweb.freebsd.org/changeset/base/329085 Log: MFV: r329072 Merge ACPICA 20180209. Added: head/sys/contrib/dev/acpica/common/dmtbdump1.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbdump1.c head/sys/contrib/dev/acpica/common/dmtbdump2.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbdump2.c head/sys/contrib/dev/acpica/common/dmtbdump3.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbdump3.c head/sys/contrib/dev/acpica/common/dmtbinfo1.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbinfo1.c head/sys/contrib/dev/acpica/common/dmtbinfo2.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbinfo2.c head/sys/contrib/dev/acpica/common/dmtbinfo3.c - copied, changed from r329072, vendor-sys/acpica/dist/source/common/dmtbinfo3.c Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtparser.l head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/executer/exresop.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/pstree.c head/sys/contrib/dev/acpica/components/utilities/utcache.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/include/acopcode.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/actbl3.h head/sys/contrib/dev/acpica/include/amlcode.h head/usr.sbin/acpi/iasl/Makefile 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 Feb 9 21:33:47 2018 (r329084) +++ head/sys/contrib/dev/acpica/changes.txt Fri Feb 9 21:49:38 2018 (r329085) @@ -1,4 +1,72 @@ ---------------------------------------- +09 February 2018. Summary of changes for version 20180209: + + +1) ACPICA kernel-resident subsystem: + +Completed the final integration of the recent changes to Package Object +handling and the module-level AML code support. This allows forward +references from individual package elements when the package object is +declared from within module-level code blocks. Provides compatibility +with other ACPI implementations. + +The new architecture for the AML module-level code has been completed and +is now the default for the ACPICA code. This new architecture executes +the module-level code in-line as the ACPI table is loaded/parsed instead +of the previous architecture which deferred this code until after the +table was fully loaded. This solves some ASL code ordering issues and +provides compatibility with other ACPI implementations. At this time, +there is an option to fallback to the earlier architecture, but this +support is deprecated and is planned to be completely removed later this +year. + +Added a compile-time option to ignore AE_NOT_FOUND exceptions during +resolution of named reference elements within Package objects. Although +this is potentially a serious problem, it can generate a lot of +noise/errors on platforms whose firmware carries around a bunch of unused +Package objects. To disable these errors, define +ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS in the OS-specific header. All +errors are always reported for ACPICA applications such as AcpiExec. + +Fixed a regression related to the explicit type-conversion AML operators +(ToXXXX). The regression was introduced early in 2017 but was not seen +until recently because these operators are not fully supported by other +ACPI implementations and are thus rarely used by firmware developers. The +operators are defined by the ACPI specification to not implement the +"implicit result object conversion". The regression incorrectly +introduced this object conversion for the following explicit conversion +operators: + ToInteger + ToString + ToBuffer + ToDecimalString + ToHexString + ToBCD + FromBCD + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed a problem with the compiler constant folding feature as +related to the ToXXXX explicit conversion operators. These operators do +not support the "implicit result object conversion" by definition. Thus, +ASL expressions that use these operators cannot be folded to a simple +Store operator because Store implements the implicit conversion. This +change uses the CopyObject operator for the ToXXXX operator folding +instead. CopyObject is defined to not implement implicit result +conversions and is thus appropriate for folding the ToXXXX operators. + +iASL: Changed the severity of an error condition to a simple warning for +the case where a symbol is declared both locally and as an external +symbol. This accommodates existing ASL code. + +AcpiExec: The -ep option to enable the new architecture for module-level +code has been removed. It is replaced by the -dp option which instead has +the opposite effect: it disables the new architecture (the default) and +enables the legacy architecture. When the legacy code is removed in the +future, the -dp option will be removed also. + +---------------------------------------- 05 January 2018. Summary of changes for version 20180105: Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Fri Feb 9 21:33:47 2018 (r329084) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Fri Feb 9 21:49:38 2018 (r329085) @@ -603,3832 +603,3 @@ AcpiDmValidateFadtLength ( "found %X expected %X\n", Revision, Length, ExpectedLength); } - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpAsf - * - * PARAMETERS: Table - A ASF table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a ASF table - * - ******************************************************************************/ - -void -AcpiDmDumpAsf ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - UINT32 Offset = sizeof (ACPI_TABLE_HEADER); - ACPI_ASF_INFO *Subtable; - ACPI_DMTABLE_INFO *InfoTable; - ACPI_DMTABLE_INFO *DataInfoTable = NULL; - UINT8 *DataTable = NULL; - UINT32 DataCount = 0; - UINT32 DataLength = 0; - UINT32 DataOffset = 0; - UINT32 i; - UINT8 Type; - - - /* No main table, only subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - Subtable->Header.Length, AcpiDmTableInfoAsfHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* The actual type is the lower 7 bits of Type */ - - Type = (UINT8) (Subtable->Header.Type & 0x7F); - - switch (Type) - { - case ACPI_ASF_TYPE_INFO: - - InfoTable = AcpiDmTableInfoAsf0; - break; - - case ACPI_ASF_TYPE_ALERT: - - InfoTable = AcpiDmTableInfoAsf1; - DataInfoTable = AcpiDmTableInfoAsf1a; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts; - DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength; - DataOffset = Offset + sizeof (ACPI_ASF_ALERT); - break; - - case ACPI_ASF_TYPE_CONTROL: - - InfoTable = AcpiDmTableInfoAsf2; - DataInfoTable = AcpiDmTableInfoAsf2a; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls; - DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength; - DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); - break; - - case ACPI_ASF_TYPE_BOOT: - - InfoTable = AcpiDmTableInfoAsf3; - break; - - case ACPI_ASF_TYPE_ADDRESS: - - InfoTable = AcpiDmTableInfoAsf4; - DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS)); - DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices; - DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); - break; - - default: - - AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", - Subtable->Header.Type); - return; - } - - Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, - Subtable->Header.Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump variable-length extra data */ - - switch (Type) - { - case ACPI_ASF_TYPE_ALERT: - case ACPI_ASF_TYPE_CONTROL: - - for (i = 0; i < DataCount; i++) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, DataOffset, - DataTable, DataLength, DataInfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - - DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength); - DataOffset += DataLength; - } - break; - - case ACPI_ASF_TYPE_ADDRESS: - - for (i = 0; i < DataLength; i++) - { - if (!(i % 16)) - { - AcpiDmLineHeader (DataOffset, 1, "Addresses"); - } - - AcpiOsPrintf ("%2.2X ", *DataTable); - DataTable++; - DataOffset++; - - if (DataOffset > Table->Length) - { - AcpiOsPrintf ( - "**** ACPI table terminates in the middle of a " - "data structure! (ASF! table)\n"); - return; - } - } - - AcpiOsPrintf ("\n"); - break; - - default: - - break; - } - - AcpiOsPrintf ("\n"); - - /* Point to next subtable */ - - if (!Subtable->Header.Length) - { - AcpiOsPrintf ("Invalid zero subtable header length\n"); - return; - } - - Offset += Subtable->Header.Length; - Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable, - Subtable->Header.Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpCpep - * - * PARAMETERS: Table - A CPEP table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a CPEP. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpCpep ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_CPEP_POLLING *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_CPEP); - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Header.Length, AcpiDmTableInfoCpep0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable */ - - Offset += Subtable->Header.Length; - Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable, - Subtable->Header.Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpCsrt - * - * PARAMETERS: Table - A CSRT table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a CSRT. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpCsrt ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_CSRT_GROUP *Subtable; - ACPI_CSRT_SHARED_INFO *SharedInfoTable; - ACPI_CSRT_DESCRIPTOR *SubSubtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_CSRT); - UINT32 SubOffset; - UINT32 SubSubOffset; - UINT32 InfoLength; - - - /* The main table only contains the ACPI header, thus already handled */ - - /* Subtables (Resource Groups) */ - - Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); - while (Offset < Table->Length) - { - /* Resource group subtable */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoCsrt0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Shared info subtable (One per resource group) */ - - SubOffset = sizeof (ACPI_CSRT_GROUP); - SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table, - Offset + SubOffset); - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable, - sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1); - if (ACPI_FAILURE (Status)) - { - return; - } - - SubOffset += Subtable->SharedInfoLength; - - /* Sub-Subtables (Resource Descriptors) */ - - SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, - Offset + SubOffset); - - while ((SubOffset < Subtable->Length) && - ((Offset + SubOffset) < Table->Length)) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable, - SubSubtable->Length, AcpiDmTableInfoCsrt2); - if (ACPI_FAILURE (Status)) - { - return; - } - - SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR); - - /* Resource-specific info buffer */ - - InfoLength = SubSubtable->Length - SubSubOffset; - if (InfoLength) - { - Status = AcpiDmDumpTable (Length, - Offset + SubOffset + SubSubOffset, Table, - InfoLength, AcpiDmTableInfoCsrt2a); - if (ACPI_FAILURE (Status)) - { - return; - } - SubSubOffset += InfoLength; - } - - /* Point to next sub-subtable */ - - SubOffset += SubSubtable->Length; - SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable, - SubSubtable->Length); - } - - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpDbg2 - * - * PARAMETERS: Table - A DBG2 table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a DBG2. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpDbg2 ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_DBG2_DEVICE *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_DBG2); - UINT32 i; - UINT32 ArrayOffset; - UINT32 AbsoluteOffset; - UINT8 *Array; - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoDbg2Device); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump the BaseAddress array */ - - for (i = 0; i < Subtable->RegisterCount; i++) - { - ArrayOffset = Subtable->BaseAddressOffset + - (sizeof (ACPI_GENERIC_ADDRESS) * i); - AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; - - Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Addr); - if (ACPI_FAILURE (Status)) - { - return; - } - } - - /* Dump the AddressSize array */ - - for (i = 0; i < Subtable->RegisterCount; i++) - { - ArrayOffset = Subtable->AddressSizeOffset + - (sizeof (UINT32) * i); - AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; - - Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Size); - if (ACPI_FAILURE (Status)) - { - return; - } - } - - /* Dump the Namestring (required) */ - - AcpiOsPrintf ("\n"); - ArrayOffset = Subtable->NamepathOffset; - AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) Subtable + ArrayOffset; - - Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - Subtable->Length, AcpiDmTableInfoDbg2Name); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Dump the OemData (optional) */ - - if (Subtable->OemDataOffset) - { - Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset, - Table, Subtable->OemDataLength, - AcpiDmTableInfoDbg2OemData); - if (ACPI_FAILURE (Status)) - { - return; - } - } - - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpDmar - * - * PARAMETERS: Table - A DMAR table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a DMAR. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpDmar ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_DMAR_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_DMAR); - ACPI_DMTABLE_INFO *InfoTable; - ACPI_DMAR_DEVICE_SCOPE *ScopeTable; - UINT32 ScopeOffset; - UINT8 *PciPath; - UINT32 PathOffset; - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoDmarHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - AcpiOsPrintf ("\n"); - - switch (Subtable->Type) - { - case ACPI_DMAR_TYPE_HARDWARE_UNIT: - - InfoTable = AcpiDmTableInfoDmar0; - ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT); - break; - - case ACPI_DMAR_TYPE_RESERVED_MEMORY: - - InfoTable = AcpiDmTableInfoDmar1; - ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY); - break; - - case ACPI_DMAR_TYPE_ROOT_ATS: - - InfoTable = AcpiDmTableInfoDmar2; - ScopeOffset = sizeof (ACPI_DMAR_ATSR); - break; - - case ACPI_DMAR_TYPE_HARDWARE_AFFINITY: - - InfoTable = AcpiDmTableInfoDmar3; - ScopeOffset = sizeof (ACPI_DMAR_RHSA); - break; - - case ACPI_DMAR_TYPE_NAMESPACE: - - InfoTable = AcpiDmTableInfoDmar4; - ScopeOffset = sizeof (ACPI_DMAR_ANDD); - break; - - default: - - AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", - Subtable->Type); - return; - } - - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* - * Dump the optional device scope entries - */ - if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || - (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE)) - { - /* These types do not support device scopes */ - - goto NextSubtable; - } - - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset); - while (ScopeOffset < Subtable->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, - ScopeTable->Length, AcpiDmTableInfoDmarScope); - if (ACPI_FAILURE (Status)) - { - return; - } - AcpiOsPrintf ("\n"); - - /* Dump the PCI Path entries for this device scope */ - - PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */ - - PciPath = ACPI_ADD_PTR (UINT8, ScopeTable, - sizeof (ACPI_DMAR_DEVICE_SCOPE)); - - while (PathOffset < ScopeTable->Length) - { - AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, - "PCI Path"); - AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]); - - /* Point to next PCI Path entry */ - - PathOffset += 2; - PciPath += 2; - AcpiOsPrintf ("\n"); - } - - /* Point to next device scope entry */ - - ScopeOffset += ScopeTable->Length; - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, - ScopeTable, ScopeTable->Length); - } - -NextSubtable: - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpDrtm - * - * PARAMETERS: Table - A DRTM table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a DRTM. - * - ******************************************************************************/ - -void -AcpiDmDumpDrtm ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - UINT32 Offset; - ACPI_DRTM_VTABLE_LIST *DrtmVtl; - ACPI_DRTM_RESOURCE_LIST *DrtmRl; - ACPI_DRTM_DPS_ID *DrtmDps; - UINT32 Count; - - - /* Main table */ - - Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, - AcpiDmTableInfoDrtm); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset = sizeof (ACPI_TABLE_DRTM); - - /* Sub-tables */ - - /* Dump ValidatedTable length */ - - DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset); - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, - DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables), - AcpiDmTableInfoDrtm0); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables); - - /* Dump Validated table addresses */ - - Count = 0; - while ((Offset < Table->Length) && - (DrtmVtl->ValidatedTableCount > Count)) - { - Status = AcpiDmDumpTable (Table->Length, Offset, - ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64), - AcpiDmTableInfoDrtm0a); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += sizeof (UINT64); - Count++; - } - - /* Dump ResourceList length */ - - DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset); - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Table->Length, Offset, - DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources), - AcpiDmTableInfoDrtm1); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources); - - /* Dump the Resource List */ - - Count = 0; - while ((Offset < Table->Length) && - (DrtmRl->ResourceCount > Count)) - { - Status = AcpiDmDumpTable (Table->Length, Offset, - ACPI_ADD_PTR (void, Table, Offset), - sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a); - if (ACPI_FAILURE (Status)) - { - return; - } - - Offset += sizeof (ACPI_DRTM_RESOURCE); - Count++; - } - - /* Dump DPS */ - - DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset); - AcpiOsPrintf ("\n"); - (void) AcpiDmDumpTable (Table->Length, Offset, - DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpEinj - * - * PARAMETERS: Table - A EINJ table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a EINJ. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpEinj ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_WHEA_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_EINJ); - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable (each subtable is of fixed length) */ - - Offset += sizeof (ACPI_WHEA_HEADER); - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, - sizeof (ACPI_WHEA_HEADER)); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpErst - * - * PARAMETERS: Table - A ERST table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a ERST. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpErst ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_WHEA_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_ERST); - - - /* Main table */ - - Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); - while (Offset < Table->Length) - { - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Point to next subtable (each subtable is of fixed length) */ - - Offset += sizeof (ACPI_WHEA_HEADER); - Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, - sizeof (ACPI_WHEA_HEADER)); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpFpdt - * - * PARAMETERS: Table - A FPDT table - * - * RETURN: None - * - * DESCRIPTION: Format the contents of a FPDT. This table type consists - * of an open-ended number of subtables. - * - ******************************************************************************/ - -void -AcpiDmDumpFpdt ( - ACPI_TABLE_HEADER *Table) -{ - ACPI_STATUS Status; - ACPI_FPDT_HEADER *Subtable; - UINT32 Length = Table->Length; - UINT32 Offset = sizeof (ACPI_TABLE_FPDT); - ACPI_DMTABLE_INFO *InfoTable; - - - /* There is no main table (other than the standard ACPI header) */ - - /* Subtables */ - - Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); - while (Offset < Table->Length) - { - /* Common subtable header */ - - AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, AcpiDmTableInfoFpdtHdr); - if (ACPI_FAILURE (Status)) - { - return; - } - - switch (Subtable->Type) - { - case ACPI_FPDT_TYPE_BOOT: - - InfoTable = AcpiDmTableInfoFpdt0; - break; - - case ACPI_FPDT_TYPE_S3PERF: - - InfoTable = AcpiDmTableInfoFpdt1; - break; - - default: - - AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", - Subtable->Type); - - /* Attempt to continue */ - - if (!Subtable->Length) - { - AcpiOsPrintf ("Invalid zero length subtable\n"); - return; - } - goto NextSubtable; - } - - Status = AcpiDmDumpTable (Length, Offset, Subtable, - Subtable->Length, InfoTable); - if (ACPI_FAILURE (Status)) - { - return; - } - -NextSubtable: - /* Point to next subtable */ - - Offset += Subtable->Length; - Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, - Subtable->Length); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiDmDumpGtdt - * - * PARAMETERS: Table - A GTDT table - * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Feb 9 22:23:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AC92F07110; Fri, 9 Feb 2018 22:23:11 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E48BB7C5A7; Fri, 9 Feb 2018 22:23:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB0722E32; Fri, 9 Feb 2018 22:23:10 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w19MNAl4021794; Fri, 9 Feb 2018 22:23:10 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19MNAr1021793; Fri, 9 Feb 2018 22:23:10 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201802092223.w19MNAr1021793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 9 Feb 2018 22:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329087 - head/tools/diag/prtblknos X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/tools/diag/prtblknos X-SVN-Commit-Revision: 329087 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.25 Precedence: list List-Id: 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, 09 Feb 2018 22:23:11 -0000 Author: mckusick Date: Fri Feb 9 22:23:10 2018 New Revision: 329087 URL: https://svnweb.freebsd.org/changeset/base/329087 Log: Add an explanation of the block size units output by prtblknos. Suggested by: Ravi Pokala (rpokala@) Modified: head/tools/diag/prtblknos/README Modified: head/tools/diag/prtblknos/README ============================================================================== --- head/tools/diag/prtblknos/README Fri Feb 9 21:51:08 2018 (r329086) +++ head/tools/diag/prtblknos/README Fri Feb 9 22:23:10 2018 (r329087) @@ -27,5 +27,22 @@ The distance metric is the size of the gap from the en previous set of blocks to the beginning of the next set of blocks. Short distances are desirable. +The logical block numbers (lbn above) describe filesystem-block +size blocks which by today's default is 32Kb. + +The physical block numbers (blkno above) describe the smallest piece +of disk space that an inode can reference which is a filesystem +fragment. Since the default size for fragments today is 4Kb, the +physical block numbers reference 4Kb blocks. The distances listed +above are also in physical block size units. Thus a distance of 8 +means a separation of just one 32Kb block. For example lbn 11, ends +at 3217895, the 32Kb first level indirect immediately follows it at +3217896-3217903, and lbn 12 starts distance 8 after lbn 11 immediately +after the indirect block at 3217904. + +If you were to create a filesystem with the fragment size equal to +half the block size (say 32Kb blocks with 16Kb fragments) then the +physical block numbers listed would be 16Kb in size. + Marshall Kirk McKusick January 19, 2018 From owner-svn-src-head@freebsd.org Fri Feb 9 23:29:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7135F0B5A7; Fri, 9 Feb 2018 23:29:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DEDD7F0B5; Fri, 9 Feb 2018 23:29:50 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6450A3C3F; Fri, 9 Feb 2018 23:29:50 +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 w19NToST052781; Fri, 9 Feb 2018 23:29:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w19NToNh052780; Fri, 9 Feb 2018 23:29:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802092329.w19NToNh052780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 9 Feb 2018 23:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329091 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 329091 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.25 Precedence: list List-Id: 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, 09 Feb 2018 23:29:50 -0000 Author: mav Date: Fri Feb 9 23:29:50 2018 New Revision: 329091 URL: https://svnweb.freebsd.org/changeset/base/329091 Log: Add sysctls for dnode block and indirect block shifts. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Feb 9 22:34:57 2018 (r329090) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Feb 9 23:29:50 2018 (r329091) @@ -59,6 +59,12 @@ static dnode_phys_t dnode_phys_zero; int zfs_default_bs = SPA_MINBLOCKSHIFT; int zfs_default_ibs = DN_MAX_INDBLKSHIFT; +SYSCTL_DECL(_vfs_zfs); +SYSCTL_INT(_vfs_zfs, OID_AUTO, default_bs, CTLFLAG_RWTUN, + &zfs_default_bs, 0, "Default dnode block shift"); +SYSCTL_INT(_vfs_zfs, OID_AUTO, default_ibs, CTLFLAG_RWTUN, + &zfs_default_ibs, 0, "Default dnode indirect block shift"); + #ifdef illumos static kmem_cbrc_t dnode_move(void *, void *, size_t, void *); #endif From owner-svn-src-head@freebsd.org Sat Feb 10 00:22:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A66BF0F209; Sat, 10 Feb 2018 00:22:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20457812D0; Sat, 10 Feb 2018 00:22:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B4474635; Sat, 10 Feb 2018 00:22:26 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1A0MPsG082454; Sat, 10 Feb 2018 00:22:25 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A0MP7h082453; Sat, 10 Feb 2018 00:22:25 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802100022.w1A0MP7h082453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 10 Feb 2018 00:22:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329092 - head/bin/df X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/bin/df X-SVN-Commit-Revision: 329092 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.25 Precedence: list List-Id: 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, 10 Feb 2018 00:22:26 -0000 Author: brooks Date: Sat Feb 10 00:22:25 2018 New Revision: 329092 URL: https://svnweb.freebsd.org/changeset/base/329092 Log: Add a deprecation warning when using the feature which mounts devices to see how much space it on them. Adjust MOUNT_CHAR_DEVS to allow the free space of already mounted devices to be displayed and report an appropriate error if the device isn't mounted. Reviewed by: cem MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8801 Modified: head/bin/df/df.c Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Fri Feb 9 23:29:50 2018 (r329091) +++ head/bin/df/df.c Sat Feb 10 00:22:25 2018 (r329092) @@ -254,9 +254,11 @@ main(int argc, char *argv[]) rv = 1; continue; } -#ifdef MOUNT_CHAR_DEVS } else if (S_ISCHR(stbuf.st_mode)) { if ((mntpt = getmntpt(*argv)) == NULL) { +#ifdef MOUNT_CHAR_DEVS + xo_warnx( + "df on unmounted devices is deprecated"); mdev.fspec = *argv; mntpath = strdup("/tmp/df.XXXXXX"); if (mntpath == NULL) { @@ -305,8 +307,12 @@ main(int argc, char *argv[]) (void)rmdir(mntpt); free(mntpath); continue; - } +#else + xo_warnx("%s: not mounted", *argv); + rv = 1; + continue; #endif + } } else mntpt = *argv; From owner-svn-src-head@freebsd.org Sat Feb 10 00:22:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 038E8F0F25E; Sat, 10 Feb 2018 00:22:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7957B813D7; Sat, 10 Feb 2018 00:22:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73D47463E; Sat, 10 Feb 2018 00:22:36 +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 w1A0MaGQ082508; Sat, 10 Feb 2018 00:22:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A0MZCB082503; Sat, 10 Feb 2018 00:22:35 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802100022.w1A0MZCB082503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 10 Feb 2018 00:22:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329093 - in head: lib/clang/libllvm share/mk tools/build/options usr.bin/clang X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/clang/libllvm share/mk tools/build/options usr.bin/clang X-SVN-Commit-Revision: 329093 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.25 Precedence: list List-Id: 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, 10 Feb 2018 00:22:37 -0000 Author: emaste Date: Sat Feb 10 00:22:35 2018 New Revision: 329093 URL: https://svnweb.freebsd.org/changeset/base/329093 Log: Promote llvm-cov to a standalone option Introduce WITH_/WITHOUT_LLVM_COV to match GCC's WITH_/WITHOUT_GCOV. It is intended to provide a superset of the interface and functionality of gcov. It is enabled by default when building Clang, similarly to gcov and GCC. This change moves one file in libllvm to be compiled unconditionally. Previously it was included only when WITH_CLANG_EXTRAS was set, but the complexity of a new special case for (CLANG_EXTRAS | LLVM_COV) is not worth avoiding a tiny increase in build time. Reviewed by: dim, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D142645 Added: head/tools/build/options/WITHOUT_LLVM_COV (contents, props changed) head/tools/build/options/WITH_LLVM_COV (contents, props changed) Modified: head/lib/clang/libllvm/Makefile head/share/mk/src.opts.mk head/usr.bin/clang/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Sat Feb 10 00:22:25 2018 (r329092) +++ head/lib/clang/libllvm/Makefile Sat Feb 10 00:22:35 2018 (r329093) @@ -664,7 +664,7 @@ SRCS_MIN+= Passes/PassBuilder.cpp SRCS_MIN+= ProfileData/Coverage/CoverageMapping.cpp SRCS_MIN+= ProfileData/Coverage/CoverageMappingReader.cpp SRCS_MIN+= ProfileData/Coverage/CoverageMappingWriter.cpp -SRCS_EXT+= ProfileData/GCOV.cpp +SRCS_MIN+= ProfileData/GCOV.cpp SRCS_MIN+= ProfileData/InstrProf.cpp SRCS_MIN+= ProfileData/InstrProfReader.cpp SRCS_MIN+= ProfileData/InstrProfWriter.cpp Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Feb 10 00:22:25 2018 (r329092) +++ head/share/mk/src.opts.mk Sat Feb 10 00:22:35 2018 (r329093) @@ -119,6 +119,7 @@ __DEFAULT_YES_OPTIONS = \ LIB32 \ LIBPTHREAD \ LIBTHR \ + LLVM_COV \ LOCALES \ LOCATE \ LPR \ @@ -425,6 +426,7 @@ MK_LLDB:= no .if ${MK_CLANG} == "no" MK_CLANG_EXTRAS:= no MK_CLANG_FULL:= no +MK_LLVM_COV:= no .endif # Added: head/tools/build/options/WITHOUT_LLVM_COV ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLVM_COV Sat Feb 10 00:22:35 2018 (r329093) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build the +.Xr llvm-cov 1 +tool. Added: head/tools/build/options/WITH_LLVM_COV ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_COV Sat Feb 10 00:22:35 2018 (r329093) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build the +.Xr llvm-cov 1 +tool. Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Sat Feb 10 00:22:25 2018 (r329092) +++ head/usr.bin/clang/Makefile Sat Feb 10 00:22:35 2018 (r329093) @@ -17,7 +17,6 @@ SUBDIR+= lli SUBDIR+= llvm-ar SUBDIR+= llvm-as SUBDIR+= llvm-bcanalyzer -SUBDIR+= llvm-cov SUBDIR+= llvm-cxxdump SUBDIR+= llvm-cxxfilt SUBDIR+= llvm-diff @@ -44,7 +43,10 @@ SUBDIR+= lld .endif .if ${MK_LLDB} != "no" SUBDIR+= lldb -.endif # MK_LLDB +.endif +.if ${MK_LLVM_COV} != "no" +SUBDIR+= llvm-cov +.endif .endif # TOOLS_PREFIX SUBDIR_PARALLEL= From owner-svn-src-head@freebsd.org Sat Feb 10 00:27:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22487F0F794; Sat, 10 Feb 2018 00:27:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA5B5816AD; Sat, 10 Feb 2018 00:27:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C53444646; Sat, 10 Feb 2018 00:27:29 +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 w1A0RTVi082706; Sat, 10 Feb 2018 00:27:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A0RTcC082705; Sat, 10 Feb 2018 00:27:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201802100027.w1A0RTcC082705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 10 Feb 2018 00:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329094 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 329094 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.25 Precedence: list List-Id: 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, 10 Feb 2018 00:27:30 -0000 Author: emaste Date: Sat Feb 10 00:27:29 2018 New Revision: 329094 URL: https://svnweb.freebsd.org/changeset/base/329094 Log: Regen src.conf.5 after r329093, WITH_/WITHOUT_LLVM_COV Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sat Feb 10 00:22:35 2018 (r329093) +++ head/share/man/man5/src.conf.5 Sat Feb 10 00:27:29 2018 (r329094) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd January 12, 2018 +.Dd February 9, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -314,6 +314,8 @@ When set, it enforces these options: .Va WITHOUT_CLANG_EXTRAS .It .Va WITHOUT_CLANG_FULL +.It +.Va WITHOUT_LLVM_COV .El .It Va WITH_CLANG Set to build the Clang C/C++ compiler during the normal phase of the build. @@ -463,6 +465,8 @@ When set, it enforces these options: .It .Va WITHOUT_GNUCXX .It +.Va WITHOUT_LLVM_COV +.It .Va WITHOUT_TESTS .It .Va WITHOUT_TESTS_SUPPORT @@ -986,6 +990,20 @@ Set to use LLVM's LLD as the system linker, instead of .Pp This is a default setting on arm64/aarch64. +.It Va WITHOUT_LLVM_COV +Set to not build the +.Xr llvm-cov 1 +tool. +.Pp +This is a default setting on +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LLVM_COV +Set to build the +.Xr llvm-cov 1 +tool. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITHOUT_LLVM_LIBUNWIND Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp @@ -1494,6 +1512,8 @@ When set, it enforces these options: .Va WITHOUT_LLD .It .Va WITHOUT_LLDB +.It +.Va WITHOUT_LLVM_COV .El .It Va WITHOUT_UNBOUND Set to not build From owner-svn-src-head@freebsd.org Sat Feb 10 00:55:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77701F112F3; Sat, 10 Feb 2018 00:55:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CE5682BE8; Sat, 10 Feb 2018 00:55:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AAA24B2F; Sat, 10 Feb 2018 00:55:47 +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 w1A0tkE0098643; Sat, 10 Feb 2018 00:55:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A0tkHg098637; Sat, 10 Feb 2018 00:55:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802100055.w1A0tkHg098637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 10 Feb 2018 00:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329096 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 329096 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.25 Precedence: list List-Id: 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, 10 Feb 2018 00:55:47 -0000 Author: mav Date: Sat Feb 10 00:55:46 2018 New Revision: 329096 URL: https://svnweb.freebsd.org/changeset/base/329096 Log: Teach mps(4) and mpr(4) drivers to autotune chain frames. This is a first part of the change. It makes the drivers to calculate the required number of chain frames to satisfy worst case scenarios, but it does not change existing overly strict limits on them. The next step will be to rewrite the allocator to not require megabytes of physically contiguous address space, that may be problematic if done after boot, after doing which the limits can be removed. Until that this code can just correct user set limits, if they are set too high. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14261 Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mpr/mpr.c Sat Feb 10 00:55:46 2018 (r329096) @@ -382,7 +382,7 @@ mpr_transition_operational(struct mpr_softc *sc) static void mpr_resize_queues(struct mpr_softc *sc) { - int reqcr, prireqcr; + u_int reqcr, prireqcr, maxio, sges_per_frame; /* * Size the queues. Since the reply queues always need one free @@ -401,7 +401,61 @@ mpr_resize_queues(struct mpr_softc *sc) sc->num_replies = MIN(sc->max_replyframes + sc->max_evtframes, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; + /* Store the request frame size in bytes rather than as 32bit words */ + sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; + /* + * Gen3 and beyond uses the IOCMaxChainSegmentSize from IOC Facts to + * get the size of a Chain Frame. Previous versions use the size as a + * Request Frame for the Chain Frame size. If IOCMaxChainSegmentSize + * is 0, use the default value. The IOCMaxChainSegmentSize is the + * number of 16-byte elelements that can fit in a Chain Frame, which is + * the size of an IEEE Simple SGE. + */ + if (sc->facts->MsgVersion >= MPI2_VERSION_02_05) { + sc->chain_seg_size = + htole16(sc->facts->IOCMaxChainSegmentSize); + if (sc->chain_seg_size == 0) { + sc->chain_frame_size = MPR_DEFAULT_CHAIN_SEG_SIZE * + MPR_MAX_CHAIN_ELEMENT_SIZE; + } else { + sc->chain_frame_size = sc->chain_seg_size * + MPR_MAX_CHAIN_ELEMENT_SIZE; + } + } else { + sc->chain_frame_size = sc->reqframesz; + } + + /* + * Max IO Size is Page Size * the following: + * ((SGEs per frame - 1 for chain element) * Max Chain Depth) + * + 1 for no chain needed in last frame + * + * If user suggests a Max IO size to use, use the smaller of the + * user's value and the calculated value as long as the user's + * value is larger than 0. The user's value is in pages. + */ + sges_per_frame = sc->chain_frame_size/sizeof(MPI2_IEEE_SGE_SIMPLE64)-1; + maxio = (sges_per_frame * sc->facts->MaxChainDepth + 1) * PAGE_SIZE; + + /* + * If I/O size limitation requested then use it and pass up to CAM. + * If not, use MAXPHYS as an optimization hint, but report HW limit. + */ + if (sc->max_io_pages > 0) { + maxio = min(maxio, sc->max_io_pages * PAGE_SIZE); + sc->maxio = maxio; + } else { + sc->maxio = maxio; + maxio = min(maxio, MAXPHYS); + } + + sc->num_chains = (maxio / PAGE_SIZE + sges_per_frame - 2) / + sges_per_frame * reqcr; + if (sc->max_chains > 0 && sc->max_chains < sc->num_chains) + sc->num_chains = sc->max_chains; + + /* * Figure out the number of MSIx-based queues. If the firmware or * user has done something crazy and not allowed enough credit for * the queues to be useful then don't enable multi-queue. @@ -1355,9 +1409,6 @@ mpr_alloc_requests(struct mpr_softc *sc) struct mpr_chain *chain; int i, rsize, nsegs; - /* Store the request frame size in bytes rather than as 32bit words */ - sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; - rsize = sc->reqframesz * sc->num_reqs; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ @@ -1382,28 +1433,7 @@ mpr_alloc_requests(struct mpr_softc *sc) bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mpr_memaddr_cb, &sc->req_busaddr, 0); - /* - * Gen3 and beyond uses the IOCMaxChainSegmentSize from IOC Facts to - * get the size of a Chain Frame. Previous versions use the size as a - * Request Frame for the Chain Frame size. If IOCMaxChainSegmentSize - * is 0, use the default value. The IOCMaxChainSegmentSize is the - * number of 16-byte elelements that can fit in a Chain Frame, which is - * the size of an IEEE Simple SGE. - */ - if (sc->facts->MsgVersion >= MPI2_VERSION_02_05) { - sc->chain_seg_size = - htole16(sc->facts->IOCMaxChainSegmentSize); - if (sc->chain_seg_size == 0) { - sc->chain_frame_size = MPR_DEFAULT_CHAIN_SEG_SIZE * - MPR_MAX_CHAIN_ELEMENT_SIZE; - } else { - sc->chain_frame_size = sc->chain_seg_size * - MPR_MAX_CHAIN_ELEMENT_SIZE; - } - } else { - sc->chain_frame_size = sc->reqframesz; - } - rsize = sc->chain_frame_size * sc->max_chains; + rsize = sc->chain_frame_size * sc->num_chains; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ @@ -1451,13 +1481,13 @@ mpr_alloc_requests(struct mpr_softc *sc) bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mpr_memaddr_cb, &sc->sense_busaddr, 0); - sc->chains = malloc(sizeof(struct mpr_chain) * sc->max_chains, M_MPR, + sc->chains = malloc(sizeof(struct mpr_chain) * sc->num_chains, M_MPR, M_WAITOK | M_ZERO); if (!sc->chains) { mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain memory\n"); return (ENOMEM); } - for (i = 0; i < sc->max_chains; i++) { + for (i = 0; i < sc->num_chains; i++) { chain = &sc->chains[i]; chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + i * sc->chain_frame_size); @@ -1477,8 +1507,7 @@ mpr_alloc_requests(struct mpr_softc *sc) return (ENOMEM); } - /* XXX Need to pick a more precise value */ - nsegs = (MAXPHYS / PAGE_SIZE) + 1; + nsegs = (sc->maxio / PAGE_SIZE) + 1; if (bus_dma_tag_create( sc->mpr_parent_dmat, /* parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mpr/mpr_sas.c Sat Feb 10 00:55:46 2018 (r329096) @@ -1009,7 +1009,6 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb) { struct ccb_pathinq *cpi = &ccb->cpi; struct mpr_softc *sc = sassc->sc; - uint8_t sges_per_frame; cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; @@ -1043,24 +1042,7 @@ mprsas_action(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = 0; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_SPC; - - /* - * Max IO Size is Page Size * the following: - * ((SGEs per frame - 1 for chain element) * - * Max Chain Depth) + 1 for no chain needed in last frame - * - * If user suggests a Max IO size to use, use the smaller of the - * user's value and the calculated value as long as the user's - * value is larger than 0. The user's value is in pages. - */ - sges_per_frame = (sc->chain_frame_size / - sizeof(MPI2_IEEE_SGE_SIMPLE64)) - 1; - cpi->maxio = (sges_per_frame * sc->facts->MaxChainDepth) + 1; - cpi->maxio *= PAGE_SIZE; - if ((sc->max_io_pages > 0) && (sc->max_io_pages * PAGE_SIZE < - cpi->maxio)) - cpi->maxio = sc->max_io_pages * PAGE_SIZE; - sc->maxio = cpi->maxio; + cpi->maxio = sc->maxio; mprsas_set_ccbstatus(ccb, CAM_REQ_CMP); break; } Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mpr/mprvar.h Sat Feb 10 00:55:46 2018 (r329096) @@ -361,6 +361,7 @@ struct mpr_softc { int num_reqs; int num_prireqs; int num_replies; + int num_chains; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mps/mps.c Sat Feb 10 00:55:46 2018 (r329096) @@ -379,8 +379,8 @@ mps_transition_operational(struct mps_softc *sc) static void mps_resize_queues(struct mps_softc *sc) { - int reqcr, prireqcr; - + u_int reqcr, prireqcr, maxio, sges_per_frame; + /* * Size the queues. Since the reply queues always need one free * entry, we'll deduct one reply message here. The LSI documents @@ -398,7 +398,39 @@ mps_resize_queues(struct mps_softc *sc) sc->num_replies = MIN(sc->max_replyframes + sc->max_evtframes, sc->facts->MaxReplyDescriptorPostQueueDepth) - 1; + /* Store the request frame size in bytes rather than as 32bit words */ + sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; + /* + * Max IO Size is Page Size * the following: + * ((SGEs per frame - 1 for chain element) * Max Chain Depth) + * + 1 for no chain needed in last frame + * + * If user suggests a Max IO size to use, use the smaller of the + * user's value and the calculated value as long as the user's + * value is larger than 0. The user's value is in pages. + */ + sges_per_frame = sc->reqframesz / sizeof(MPI2_SGE_SIMPLE64) - 1; + maxio = (sges_per_frame * sc->facts->MaxChainDepth + 1) * PAGE_SIZE; + + /* + * If I/O size limitation requested, then use it and pass up to CAM. + * If not, use MAXPHYS as an optimization hint, but report HW limit. + */ + if (sc->max_io_pages > 0) { + maxio = min(maxio, sc->max_io_pages * PAGE_SIZE); + sc->maxio = maxio; + } else { + sc->maxio = maxio; + maxio = min(maxio, MAXPHYS); + } + + sc->num_chains = (maxio / PAGE_SIZE + sges_per_frame - 2) / + sges_per_frame * reqcr; + if (sc->max_chains > 0 && sc->max_chains < sc->num_chains) + sc->num_chains = sc->max_chains; + + /* * Figure out the number of MSIx-based queues. If the firmware or * user has done something crazy and not allowed enough credit for * the queues to be useful then don't enable multi-queue. @@ -1334,9 +1366,6 @@ mps_alloc_requests(struct mps_softc *sc) struct mps_chain *chain; int i, rsize, nsegs; - /* Store the request frame size in bytes rather than as 32bit words */ - sc->reqframesz = sc->facts->IOCRequestFrameSize * 4; - rsize = sc->reqframesz * sc->num_reqs; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ @@ -1361,7 +1390,7 @@ mps_alloc_requests(struct mps_softc *sc) bus_dmamap_load(sc->req_dmat, sc->req_map, sc->req_frames, rsize, mps_memaddr_cb, &sc->req_busaddr, 0); - rsize = sc->reqframesz * sc->max_chains; + rsize = sc->reqframesz * sc->num_chains; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 16, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ @@ -1409,13 +1438,13 @@ mps_alloc_requests(struct mps_softc *sc) bus_dmamap_load(sc->sense_dmat, sc->sense_map, sc->sense_frames, rsize, mps_memaddr_cb, &sc->sense_busaddr, 0); - sc->chains = malloc(sizeof(struct mps_chain) * sc->max_chains, M_MPT2, + sc->chains = malloc(sizeof(struct mps_chain) * sc->num_chains, M_MPT2, M_WAITOK | M_ZERO); if(!sc->chains) { mps_dprint(sc, MPS_ERROR, "Cannot allocate chains memory\n"); return (ENOMEM); } - for (i = 0; i < sc->max_chains; i++) { + for (i = 0; i < sc->num_chains; i++) { chain = &sc->chains[i]; chain->chain = (MPI2_SGE_IO_UNION *)(sc->chain_frames + i * sc->reqframesz); @@ -1425,8 +1454,7 @@ mps_alloc_requests(struct mps_softc *sc) sc->chain_free_lowwater++; } - /* XXX Need to pick a more precise value */ - nsegs = (MAXPHYS / PAGE_SIZE) + 1; + nsegs = (sc->maxio / PAGE_SIZE) + 1; if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ 1, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mps/mps_sas.c Sat Feb 10 00:55:46 2018 (r329096) @@ -958,7 +958,6 @@ mpssas_action(struct cam_sim *sim, union ccb *ccb) { struct ccb_pathinq *cpi = &ccb->cpi; struct mps_softc *sc = sassc->sc; - uint8_t sges_per_frame; cpi->version_num = 1; cpi->hba_inquiry = PI_SDTR_ABLE|PI_TAG_ABLE|PI_WIDE_16; @@ -987,23 +986,7 @@ mpssas_action(struct cam_sim *sim, union ccb *ccb) cpi->transport_version = 0; cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_SPC; - - /* - * Max IO Size is Page Size * the following: - * ((SGEs per frame - 1 for chain element) * - * Max Chain Depth) + 1 for no chain needed in last frame - * - * If user suggests a Max IO size to use, use the smaller of the - * user's value and the calculated value as long as the user's - * value is larger than 0. The user's value is in pages. - */ - sges_per_frame = ((sc->reqframesz) / - sizeof(MPI2_SGE_SIMPLE64)) - 1; - cpi->maxio = (sges_per_frame * sc->facts->MaxChainDepth) + 1; - cpi->maxio *= PAGE_SIZE; - if ((sc->max_io_pages > 0) && (sc->max_io_pages * PAGE_SIZE < - cpi->maxio)) - cpi->maxio = sc->max_io_pages * PAGE_SIZE; + cpi->maxio = sc->maxio; mpssas_set_ccbstatus(ccb, CAM_REQ_CMP); break; } Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Sat Feb 10 00:39:34 2018 (r329095) +++ head/sys/dev/mps/mpsvar.h Sat Feb 10 00:55:46 2018 (r329096) @@ -315,6 +315,7 @@ struct mps_softc { int chain_free; int max_chains; int max_io_pages; + u_int maxio; int chain_free_lowwater; u_int enable_ssu; int spinup_wait_time; @@ -349,6 +350,7 @@ struct mps_softc { int num_reqs; int num_prireqs; int num_replies; + int num_chains; int fqdepth; /* Free queue */ int pqdepth; /* Post queue */ From owner-svn-src-head@freebsd.org Sat Feb 10 01:09:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AE52F12277; Sat, 10 Feb 2018 01:09:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E4A783595; Sat, 10 Feb 2018 01:09:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 485644CF0; Sat, 10 Feb 2018 01:09:23 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1A19NqF004167; Sat, 10 Feb 2018 01:09:23 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1A19N3R004166; Sat, 10 Feb 2018 01:09:23 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201802100109.w1A19N3R004166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 10 Feb 2018 01:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329097 - head/sys/nlm X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/nlm X-SVN-Commit-Revision: 329097 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.25 Precedence: list List-Id: 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, 10 Feb 2018 01:09:24 -0000 Author: brooks Date: Sat Feb 10 01:09:22 2018 New Revision: 329097 URL: https://svnweb.freebsd.org/changeset/base/329097 Log: Use syscall_helper_register() to register syscalls and initialize though the module interface. This is the more common approach and the syscall_helper interface is easier to understand. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14251 Modified: head/sys/nlm/nlm_prot_impl.c Modified: head/sys/nlm/nlm_prot_impl.c ============================================================================== --- head/sys/nlm/nlm_prot_impl.c Sat Feb 10 00:55:46 2018 (r329096) +++ head/sys/nlm/nlm_prot_impl.c Sat Feb 10 01:09:22 2018 (r329097) @@ -93,17 +93,10 @@ static SYSCTL_NODE(_vfs_nlm, OID_AUTO, sysid, CTLFLAG_ /* * Syscall hooks */ -static int nlm_syscall_offset = SYS_nlm_syscall; -static struct sysent nlm_syscall_prev_sysent; -#if __FreeBSD_version < 700000 -static struct sysent nlm_syscall_sysent = { - (sizeof(struct nlm_syscall_args) / sizeof(register_t)) | SYF_MPSAFE, - (sy_call_t *) nlm_syscall +static struct syscall_helper_data nlm_syscalls[] = { + SYSCALL_INIT_HELPER(nlm_syscall), + SYSCALL_INIT_LAST }; -#else -MAKE_SYSENT(nlm_syscall); -#endif -static bool_t nlm_syscall_registered = FALSE; /* * Debug level passed in from userland. We also support a sysctl hook @@ -287,8 +280,8 @@ ng_cookie(struct netobj *src) /* * Initialise NLM globals. */ -static void -nlm_init(void *dummy) +static int +nlm_init(void) { int error; @@ -296,24 +289,18 @@ nlm_init(void *dummy) TAILQ_INIT(&nlm_waiting_locks); TAILQ_INIT(&nlm_hosts); - error = syscall_register(&nlm_syscall_offset, &nlm_syscall_sysent, - &nlm_syscall_prev_sysent, SY_THR_STATIC_KLD); - if (error) + error = syscall_helper_register(nlm_syscalls, SY_THR_STATIC_KLD); + if (error != 0) NLM_ERR("Can't register NLM syscall\n"); - else - nlm_syscall_registered = TRUE; + return (error); } -SYSINIT(nlm_init, SI_SUB_LOCK, SI_ORDER_FIRST, nlm_init, NULL); static void -nlm_uninit(void *dummy) +nlm_uninit(void) { - if (nlm_syscall_registered) - syscall_deregister(&nlm_syscall_offset, - &nlm_syscall_prev_sysent); + syscall_helper_unregister(nlm_syscalls); } -SYSUNINIT(nlm_uninit, SI_SUB_LOCK, SI_ORDER_FIRST, nlm_uninit, NULL); /* * Create a netobj from an arbitrary source. @@ -2412,8 +2399,10 @@ nfslockd_modevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: - return (0); + return (nlm_init()); + case MOD_UNLOAD: + nlm_uninit(); /* The NLM module cannot be safely unloaded. */ /* FALLTHROUGH */ default: From owner-svn-src-head@freebsd.org Sat Feb 10 01:22:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 923D9F138C6; Sat, 10 Feb 2018 01:22:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F7AC8470E; Sat, 10 Feb 2018 01:22:39 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x233.google.com with SMTP id d13so11654968iog.5; Fri, 09 Feb 2018 17:22:39 -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=B/kCtiRvSnzne1MN0Y0Bw66KgZDNU6pGlV0uyVDD/2Y=; b=nOuJYqrVjJFS0PCTExTMekDC3QoB/w22z4xifYU3x6nl0Pvw2bQSW0NhqWIF7F+Y3y O+XowKzLtwnhpeXsIBh/TCjQSgLlCmeM2DJ1T3xv+zDvgiZ70sxaR8zZt3M1MPnvn2Ey 2b2gl2dUP5M2PcZqkxforDX/wM8UoP3LPfKZdkH1g1lsFnhCdW3wviMBtZdJ+00yZN7U gBjU6vTW23/0hluFQJWKExxTFX6EGa5/LFW8Ypsw27cZ1wHfDZ/D6imfd7zFTIMCIAkU iiLZuiNqW3YxfPn/qvlk4ODxHuSbH0GQaTRPu51KZv/DWWGoQe7SeC80+VfRIb86YKfM Cqvw== 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=B/kCtiRvSnzne1MN0Y0Bw66KgZDNU6pGlV0uyVDD/2Y=; b=QlG4zC+XrZljRo/qyHsoYnxli9Cck9nnui4p/3mSPwipwTHkk/26uwWfFDoZjVD1JV zxHZDCNThWKIzm7yANNEe/g+JlbfIGqIbK5HcUn1LkllwMekjD2aZtrN5QQDOySbJh4C /7pSbg2IOd4pqg8CdyZ/mrTAtPC0csvrpHeQ7LoQjqwbhl80ST0d6K6dXuu+nP43eGLu nR/TiZHCazc9PsFmlW8Qv6nqC9gGYIEeYVjq9QDEcndufyNTfqha1FwjzCBkQNr2uAdL g8pXIIIIO3virqJ/hMslyZ4e0o8+ru5OO0R+zUsfkpluKgWjtM/vl1FPOp8sRn9oSHBQ 50yQ== X-Gm-Message-State: APf1xPDpNaJPFNaYtI1CUs1Y4CmNYCiLLvUhkl/BNig77OfxyYcDN6mF Cl6oyfyLb/rO4D5jkVxNoaeefsEUPbrTY2hbExFb4QwJ X-Google-Smtp-Source: AH8x225O2z3rRNmidK4RlnmG/FPjQlQLwUcdokjM5cFcoIO6bqsnzM1dTTZCFvBpDSG9FwGMYSNNXwtUv7q1ILQ3Vbk= X-Received: by 10.107.173.225 with SMTP id m94mr5307131ioo.36.1518225758228; Fri, 09 Feb 2018 17:22:38 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.147.9 with HTTP; Fri, 9 Feb 2018 17:22:17 -0800 (PST) In-Reply-To: <201802091946.w19Jkqb3038864@repo.freebsd.org> References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Ed Maste Date: Fri, 9 Feb 2018 20:22:17 -0500 X-Google-Sender-Auth: UESpACwiCTIzlexilHcPzksWL0M Message-ID: Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Conrad Meyer 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.25 Precedence: list List-Id: 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, 10 Feb 2018 01:22:39 -0000 On 9 February 2018 at 14:46, Conrad Meyer wrote: > Author: cem > Date: Fri Feb 9 19:46:51 2018 > New Revision: 329077 > URL: https://svnweb.freebsd.org/changeset/base/329077 > > Log: > tftp(1): Fix libedit state corruption involving signals >From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: 01:15:24 --- all_subdir_usr.bin/tftp --- 01:15:24 --- main.o --- 01:15:24 cc1: warnings being treated as errors 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used uninitialized in this function 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used uninitialized in this function From owner-svn-src-head@freebsd.org Sat Feb 10 04:03:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79F9EF1B7F7; Sat, 10 Feb 2018 04:03:04 +0000 (UTC) (envelope-from jon@brawn.org) Received: from ahs1.r4l.com (ahs1.r4l.com [198.27.81.125]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DF006A736; Sat, 10 Feb 2018 04:03:03 +0000 (UTC) (envelope-from jon@brawn.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=brawn.org; s=default; h=References:To:Cc:In-Reply-To:Date:Subject:Mime-Version: Content-Type:Message-Id:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=H+nDFPukB3u6KvqJmhLaOWWfrLf1vsmxhSlNE0/+uuA=; b=SFLkAyUpdVqAzBxT4R1pWdOCTe mwLb0X35mcN1M61lAOW1tfzV6Fqjd+eOkE18oJPTIVHKy6FX5osGirJx/rr8lDMxvjHBzjhBk2+6g E50pvZcQrmIWwi+/b+cTmNIz1SmAZslertTMfbMRY2W1x6Th87X2zBbXzog4oejZD/whuwudkksHa 4VMCLjJIM2qCf4lj/EUxaslkmF1PTfc1++ACtuvmkph504dSCU84a785VVMt3ZTRCegyKWIvC/EdH lOVrl39pjdtpt2O3Z8CcvHGnFcgigN7OUoAmorzcVfXzzWVcN46sb7MzCL9+jvES5ywyNwWKAkkCg aGdtM7uQ==; Received: from [136.62.171.86] (port=58988 helo=[192.168.1.120]) by ahs1.r4l.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1ekMNL-002dwS-Pr; Fri, 09 Feb 2018 23:02:56 -0500 From: Jon Brawn Message-Id: <64E137CE-79AE-4EC2-85AC-D8069D7447A6@brawn.org> Content-Type: multipart/signed; boundary="Apple-Mail=_904B8EF2-81C4-4FF6-B484-3D2D66B35485"; protocol="application/pkcs7-signature"; micalg=sha1 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r329064 - head/share/zoneinfo Date: Fri, 9 Feb 2018 22:02:53 -0600 In-Reply-To: <20180209190450.GA85711@FreeBSD.org> Cc: Warner Losh , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , Warner Losh , John Baldwin To: Alexey Dokuchaev References: <201802091550.w19FoXEb018181@repo.freebsd.org> <14002093.zLdzgIqnsv@ralph.baldwin.cx> <20180209190450.GA85711@FreeBSD.org> X-Mailer: Apple Mail (2.3445.5.20) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ahs1.r4l.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - brawn.org X-Get-Message-Sender-Via: ahs1.r4l.com: authenticated_id: jon@brawn.org X-Authenticated-Sender: ahs1.r4l.com: jon@brawn.org X-Source: X-Source-Args: X-Source-Dir: X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 10 Feb 2018 04:03:04 -0000 --Apple-Mail=_904B8EF2-81C4-4FF6-B484-3D2D66B35485 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Feb 9, 2018, at 1:04 PM, Alexey Dokuchaev wrote: >=20 > On Fri, Feb 09, 2018 at 11:50:35AM -0700, Warner Losh wrote: >> On Fri, Feb 9, 2018 at 10:49 AM, John Baldwin = wrote: >>> On Friday, February 09, 2018 03:50:33 PM Warner Losh wrote: >>>> New Revision: 329064 >>>> URL: https://svnweb.freebsd.org/changeset/base/329064 >>>>=20 >>>> Log: >>>> We don't actually need env here, so drop it. All shells allow = setting >>>> of shell variables for the next command like this. >>>=20 >>> Eh: >>>=20 >>> % LC_ALL=3DC env >>> LC_ALL=3DC: Command not found. >>>=20 >>> csh and tcsh don't let you set environment variables as a prefix. >>>=20 >>> That said, if you try to use csh as the SHELL for make I bet many = things >>> would break. >>=20 >> Right, all shells supported as SHELL for make. csh isn't on the list = of >> supported shells. Your bet is right: a lot of things do break. >=20 > I don't really understand why we're discussing it: (t)csh, fish, = whatever > are for interactive use *only*. Scripts (and makefiles) should only = be > written for standard plain POSIX shell. >=20 > ./danfe Meanwhile, back in the real world, occasionally you are mandated to = write scripts in tcsh because of external requirements over which you = have no control. This seems to happen to me at work with regular = monotony. I do shower afterwards, of course. Jon.= --Apple-Mail=_904B8EF2-81C4-4FF6-B484-3D2D66B35485 Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIILEzCCBSUw ggQNoAMCAQICECQcc6QQWc3Um5HgAnmjhBYwDQYJKoZIhvcNAQELBQAwgZcxCzAJBgNVBAYTAkdC MRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoT EUNPTU9ETyBDQSBMaW1pdGVkMT0wOwYDVQQDEzRDT01PRE8gUlNBIENsaWVudCBBdXRoZW50aWNh dGlvbiBhbmQgU2VjdXJlIEVtYWlsIENBMB4XDTE3MTAyODAwMDAwMFoXDTE4MTAyODIzNTk1OVow HjEcMBoGCSqGSIb3DQEJARYNam9uQGJyYXduLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBALEscuT73gkjXEfkaQU3QXOOIDFilHr9RV/FKPk+ZO3wyXpoChqRW+anE+kKBLSCsmoX 6HnhAmcq3j9umj5jIYwpD84m26XbWQK+uo42GZ3cAF12VvO0g/toUvI+nJcxiD39APWowPKQ4Nae 4FN4hLOcwd2zyF3LiJgq4aXXcBQxl2s1JRCb7STFl5qpp73JVbFp1MkABmESyzI6KE0LLH3hHICU d2m+Omg6L8T+RgsTEKmgTvw1hYD04ms9ttji/viI8LtR3V9p9DDGH0iSCF56kPo4WfsbfGVBs1km tw8uvB6OVNGiD0q05kR/GI4jGiMLa4UhlCC0VsYfx7ZyGEUCAwEAAaOCAeMwggHfMB8GA1UdIwQY MBaAFIKvbIz4xf6WYXzoHz0rcUhexIvAMB0GA1UdDgQWBBRYtBFf7BnRYLxKWDc5DiI35q5WVzAO BgNVHQ8BAf8EBAMCBaAwDAYDVR0TAQH/BAIwADAgBgNVHSUEGTAXBggrBgEFBQcDBAYLKwYBBAGy MQEDBQIwEQYJYIZIAYb4QgEBBAQDAgUgMEYGA1UdIAQ/MD0wOwYMKwYBBAGyMQECAQEBMCswKQYI KwYBBQUHAgEWHWh0dHBzOi8vc2VjdXJlLmNvbW9kby5uZXQvQ1BTMFoGA1UdHwRTMFEwT6BNoEuG SWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL0NPTU9ET1JTQUNsaWVudEF1dGhlbnRpY2F0aW9uYW5k U2VjdXJlRW1haWxDQS5jcmwwgYsGCCsGAQUFBwEBBH8wfTBVBggrBgEFBQcwAoZJaHR0cDovL2Ny dC5jb21vZG9jYS5jb20vQ09NT0RPUlNBQ2xpZW50QXV0aGVudGljYXRpb25hbmRTZWN1cmVFbWFp bENBLmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMBgGA1UdEQQRMA+B DWpvbkBicmF3bi5vcmcwDQYJKoZIhvcNAQELBQADggEBAKZgWVdxinnS81TZvPWc8kXjtzxKSBFU 6ZXBkofX+CSRuD+Wmg4vlt6fNIaVWqWDF95qjR3TOwyb+LQJnsMyYhAl9NI6AJTxgfghzKK49MVP aC0K7V4TnWCiucJsfK+xDqZIevPFPF3mpYz7/Uf8VPbX2uK80/uUoBRroXDLyHv7fTzG8K+bHBh6 l2x2xFB04nxAhRS4yaJvOeV6ckPOHvCgHhncXQ1HoPUvV/M94K3jaURLPvSUm2tgzODJ97QDHDWM SF7xfItpAM7AVAmN0M0U8sWI/qDykqpoeOc/TrMNeRTEcuphuJASMuN+oP57T+XZFq/lOEEIw1H+ 4QZ1mnIwggXmMIIDzqADAgECAhBqm+E4O/8ra58B1dm4p1JWMA0GCSqGSIb3DQEBDAUAMIGFMQsw CQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3Jk MRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDErMCkGA1UEAxMiQ09NT0RPIFJTQSBDZXJ0aWZp Y2F0aW9uIEF1dGhvcml0eTAeFw0xMzAxMTAwMDAwMDBaFw0yODAxMDkyMzU5NTlaMIGXMQswCQYD VQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRow GAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDE9MDsGA1UEAxM0Q09NT0RPIFJTQSBDbGllbnQgQXV0 aGVudGljYXRpb24gYW5kIFNlY3VyZSBFbWFpbCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBAL6znlesKHZ1QBbHOAOY08YYdiFQ8yV5C0y1oNF9Olg+nKcxLqf2NHbZhGra0D00SOTq 9bus3/mxgUsg/Wh/eXQ0pnp8tZ8XZWAnlyKMpjL+qUByRjXCA6RQyDMqVaVUkbIr5SU0RDX/kSsK wer3H1pT/HUrBN0X8sKtPTdGX8XAWt/VdMLBrZBlgvnkCos+KQWWCo63OTTqRvaq8aWccm+KOMjT cE6s2mj6RkalweyDI7X+7U5lNo6jzC8RTXtVV4/Vwdax720YpMPJQaDaElmOupyTf1Qib+cpukNJ nQmwygjD8m046DQkLnpXNCAGjuJy1F5NATksUsbfJAr7FLUCAwEAAaOCATwwggE4MB8GA1UdIwQY MBaAFLuvfgI9+qbxPISOre44mOzZMjLUMB0GA1UdDgQWBBSCr2yM+MX+lmF86B89K3FIXsSLwDAO BgNVHQ8BAf8EBAMCAYYwEgYDVR0TAQH/BAgwBgEB/wIBADARBgNVHSAECjAIMAYGBFUdIAAwTAYD VR0fBEUwQzBBoD+gPYY7aHR0cDovL2NybC5jb21vZG9jYS5jb20vQ09NT0RPUlNBQ2VydGlmaWNh dGlvbkF1dGhvcml0eS5jcmwwcQYIKwYBBQUHAQEEZTBjMDsGCCsGAQUFBzAChi9odHRwOi8vY3J0 LmNvbW9kb2NhLmNvbS9DT01PRE9SU0FBZGRUcnVzdENBLmNydDAkBggrBgEFBQcwAYYYaHR0cDov L29jc3AuY29tb2RvY2EuY29tMA0GCSqGSIb3DQEBDAUAA4ICAQB4XLKBKDRPPO5fVs6fl1bsj6Jr F/bz9kkIBtTYLzXN30D+03Hj6OxCDBEaIeNmsBhrJmuubvyE7HtoSmR809AgcYboW+rcTNZ/8u/H v+GTrNI/AhqX2/kiQNxmgUPt/eJPs92Qclj0HnVyy9TnSvGkSDU7I5Px+TbO+88G4zipA2psZaWe EykgzClZlPz1FjTCkk77ZXp5cQYYexE6zeeN4/0OqqoAloFrjAF4o50YJafX8mnahjp3I2Y2mkjh k0xQfhNqbzlLWPoT3m7j7U26u7zg6swjOq8hITYc3/np5tM5aVyu6t99p17bTbY7+1RTWBviN9YJ zK8HxzObXYWBf/L+VGOYNsQDTxAk0Hbvb1j6KjUhg7fO294F29QIhhmiNOr84JHoy+fNLpfvYc/Q 9EtFOI5ISYgOxLk3nD/whbUe9rmEQXLp8MB933Ij474gwwCPUpwv9mj2PMnXoc7mbrS22XUSeTwx CTP9bcmUdp4jmIoWfhQm7X9w/Zgddg+JZ/YnIHOwsGsaTUgj7fIvxqith7DoJC91WJ8Lce3CVJqb 1XWeKIJ84F7YLXZN0oa7TktYgDdmQVxYkZo1c5noaDKH9Oq9cbm/vOYRUM1cWcef20Wkyk5S/GFy yPJwG0fR1nRas3DqAf4cXxMiEKcff7PNa4M3RGTqH0pWR8p6EjGCA7cwggOzAgEBMIGsMIGXMQsw CQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3Jk MRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDE9MDsGA1UEAxM0Q09NT0RPIFJTQSBDbGllbnQg QXV0aGVudGljYXRpb24gYW5kIFNlY3VyZSBFbWFpbCBDQQIQJBxzpBBZzdSbkeACeaOEFjAJBgUr DgMCGgUAoIIB3zAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xODAy MTAwNDAyNTNaMCMGCSqGSIb3DQEJBDEWBBS5zO/lGrpF4eE+yWSkHWo1oPnn/DCBvQYJKwYBBAGC NxAEMYGvMIGsMIGXMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAw DgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDE9MDsGA1UEAxM0Q09N T0RPIFJTQSBDbGllbnQgQXV0aGVudGljYXRpb24gYW5kIFNlY3VyZSBFbWFpbCBDQQIQJBxzpBBZ zdSbkeACeaOEFjCBvwYLKoZIhvcNAQkQAgsxga+ggawwgZcxCzAJBgNVBAYTAkdCMRswGQYDVQQI ExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBD QSBMaW1pdGVkMT0wOwYDVQQDEzRDT01PRE8gUlNBIENsaWVudCBBdXRoZW50aWNhdGlvbiBhbmQg U2VjdXJlIEVtYWlsIENBAhAkHHOkEFnN1JuR4AJ5o4QWMA0GCSqGSIb3DQEBAQUABIIBAEp+a0T4 osXuo4oLMWApxCDWCSIfn+SVZ9DzZSVPsclkZwKfXpsl/fDPEti5IJ5zxyoQ8wQLuIrVAKEvOUli nu8tkBdhdZRGNXEK/17gG4Sv/3ubxMbZaRC1nUKYdip2kGzTfxyxLXEpNWs681Ca67pLjwHyaxsL 2/63WW8dtLiEHEKNlw7y9U6YHCf3NhpNPtIZk9LjjbYBT31D9WnZDbpcRKL/YiakSbvTbX4tbeLC FStJsZ+pIzsw+45SFhBKRvA1ElyzQO2rgRcA+FlTIKff6Kc+JWNaoGs6HMtQXJXcs51DAd8Ih3nH kibrCwz7/NpcYn1wp5RiZ5ZRaXuEdM0AAAAAAAA= --Apple-Mail=_904B8EF2-81C4-4FF6-B484-3D2D66B35485-- From owner-svn-src-head@freebsd.org Sat Feb 10 10:13:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96214F0E879; Sat, 10 Feb 2018 10:13:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C40376EA4; Sat, 10 Feb 2018 10:13:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4745F12AB4; Sat, 10 Feb 2018 10:13:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1AADIDv091212; Sat, 10 Feb 2018 10:13:18 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AADINx091211; Sat, 10 Feb 2018 10:13:18 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802101013.w1AADINx091211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sat, 10 Feb 2018 10:13:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329101 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 329101 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.25 Precedence: list List-Id: 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, 10 Feb 2018 10:13:18 -0000 Author: ae Date: Sat Feb 10 10:13:17 2018 New Revision: 329101 URL: https://svnweb.freebsd.org/changeset/base/329101 Log: Reinitialize IP header length after checksum calculation. It is used later by TCP-MD5 code. This fixes the problem with broken TCP-MD5 over IPv4 when NIC has disabled TCP checksum offloading. PR: 223835 MFC after: 1 week Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sat Feb 10 04:56:07 2018 (r329100) +++ head/sys/netinet/tcp_input.c Sat Feb 10 10:13:17 2018 (r329101) @@ -707,6 +707,7 @@ tcp_input(struct mbuf **mp, int *offp, int proto) ip->ip_tos = iptos; /* Re-initialization for later version check */ ip->ip_v = IPVERSION; + ip->ip_hl = off0 >> 2; } if (th->th_sum) { From owner-svn-src-head@freebsd.org Sat Feb 10 14:45:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3DADF013D9; Sat, 10 Feb 2018 14:45:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99C0A81ABC; Sat, 10 Feb 2018 14:45:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F5F6156ED; Sat, 10 Feb 2018 14:45:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1AEjTOP037607; Sat, 10 Feb 2018 14:45:29 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AEjTlI037606; Sat, 10 Feb 2018 14:45:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802101445.w1AEjTlI037606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 10 Feb 2018 14:45:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329102 - head/lib/libcompat/4.3 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/lib/libcompat/4.3 X-SVN-Commit-Revision: 329102 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.25 Precedence: list List-Id: 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, 10 Feb 2018 14:45:30 -0000 Author: pfg Date: Sat Feb 10 14:45:29 2018 New Revision: 329102 URL: https://svnweb.freebsd.org/changeset/base/329102 Log: libcompat: Use %hu for unsigned shorts. Obtained from: DragonFlyBSD (git 82e1476a) Modified: head/lib/libcompat/4.3/rexec.c Modified: head/lib/libcompat/4.3/rexec.c ============================================================================== --- head/lib/libcompat/4.3/rexec.c Sat Feb 10 10:13:17 2018 (r329101) +++ head/lib/libcompat/4.3/rexec.c Sat Feb 10 14:45:29 2018 (r329102) @@ -356,7 +356,7 @@ retry: goto bad; } port = ntohs((u_short)sin2.sin_port); - (void) sprintf(num, "%u", port); + (void) sprintf(num, "%hu", port); (void) write(s, num, strlen(num)+1); { int len = sizeof (from); s3 = accept(s2, (struct sockaddr *)&from, &len); From owner-svn-src-head@freebsd.org Sat Feb 10 15:29:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29311F0490F; Sat, 10 Feb 2018 15:29:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB16B8396F; Sat, 10 Feb 2018 15:29:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C123515D69; Sat, 10 Feb 2018 15:29:48 +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 w1AFTm2D058370; Sat, 10 Feb 2018 15:29:48 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AFTlQ0058352; Sat, 10 Feb 2018 15:29:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201802101529.w1AFTlQ0058352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 10 Feb 2018 15:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329104 - in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/phy include/dt-bindings/pinctrl include/dt-bindings/p... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm include/dt-bindings/clock include/dt-bindings/gpio include/dt-bindings/input include/dt-bindings/phy include/dt-bindings/pinctrl include/dt-bindings/power include/dt-bindings/... X-SVN-Commit-Revision: 329104 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.25 Precedence: list List-Id: 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, 10 Feb 2018 15:29:49 -0000 Author: manu Date: Sat Feb 10 15:29:46 2018 New Revision: 329104 URL: https://svnweb.freebsd.org/changeset/base/329104 Log: dts: Update our device tree sources files from Linux 4.15 Added: head/sys/gnu/dts/arm/axp81x.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm-hr2.dtsi (contents, props changed) head/sys/gnu/dts/arm/bcm47094-luxul-abr-4500.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47094-luxul-xbr-4500.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47189-luxul-xap-1440.dts (contents, props changed) head/sys/gnu/dts/arm/bcm47189-luxul-xap-810.dts (contents, props changed) head/sys/gnu/dts/arm/bcm53340-ubnt-unifi-switch8.dts (contents, props changed) head/sys/gnu/dts/arm/exynos5422-odroid-core.dtsi (contents, props changed) head/sys/gnu/dts/arm/exynos5422-odroidhc1.dts (contents, props changed) head/sys/gnu/dts/arm/imx51-zii-rdu1.dts (contents, props changed) head/sys/gnu/dts/arm/imx53-ppd.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-tx6s-8034-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-tx6s-8035-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-8033-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-tx6u-80xx-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6dl-wandboard-revd1.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-display5-tianma-tm070-1280x768.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-display5.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6q-pistachio.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-tx6q-1036-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-tx6q-10x0-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-wandboard-revd1.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-tx6-lcd.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-tx6-lvds.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-tx6-mb7.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qdl-wandboard-revd1.dtsi (contents, props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8037-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8037.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8137-mb7.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qp-tx6qp-8137.dts (contents, props changed) head/sys/gnu/dts/arm/imx6qp-wandboard-revd1.dts (contents, props changed) head/sys/gnu/dts/arm/imx6sx-softing-vining-2000.dts (contents, props changed) head/sys/gnu/dts/arm/iwg20d-q7-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/iwg20d-q7-dbcm-ca.dtsi (contents, props changed) head/sys/gnu/dts/arm/omap3-evm-processor-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/owl-s500-cubieboard6.dts (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8974-fairphone-fp2.dts (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8974-sony-xperia-castor.dts (contents, props changed) head/sys/gnu/dts/arm/qcom-msm8974pro.dtsi (contents, props changed) head/sys/gnu/dts/arm/r8a7743-iwg20d-q7-dbcm-ca.dts (contents, props changed) head/sys/gnu/dts/arm/r8a7745-iwg22d-sodimm.dts (contents, props changed) head/sys/gnu/dts/arm/r8a7745-iwg22m.dtsi (contents, props changed) head/sys/gnu/dts/arm/rk3288-vyasa.dts (contents, props changed) head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro-emmc.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a83t-tbs-a711.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-r40-bananapi-m2-ultra.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-r40.dtsi (contents, props changed) head/sys/gnu/dts/arm/sun8i-v40-bananapi-m2-berry.dts (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt2712-clk.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/mt7622-clk.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/clock/r8a77970-cpg-mssr.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/gpio/uniphier-gpio.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/pinctrl/stm32-pinfunc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/power/r8a77970-sysc.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/reset/mt7622-reset.h (contents, props changed) head/sys/gnu/dts/include/dt-bindings/thermal/tegra186-bpmp-thermal.h (contents, props changed) Modified: head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-cm-t43.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts head/sys/gnu/dts/arm/armada-385-db-ap.dts head/sys/gnu/dts/arm/armada-385-linksys.dtsi head/sys/gnu/dts/arm/armada-385-synology-ds116.dts head/sys/gnu/dts/arm/armada-388-gp.dts head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts head/sys/gnu/dts/arm/artpec6.dtsi head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/at91-ariag25.dts head/sys/gnu/dts/arm/at91-ariettag25.dts head/sys/gnu/dts/arm/at91-cosino_mega2560.dts head/sys/gnu/dts/arm/at91-kizbox2.dts head/sys/gnu/dts/arm/at91-kizboxmini.dts head/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts (contents, props changed) head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-sama5d3_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4_ma5d4evk.dts head/sys/gnu/dts/arm/at91-sama5d4_xplained.dts head/sys/gnu/dts/arm/at91-sama5d4ek.dts head/sys/gnu/dts/arm/at91-tse850-3.dts head/sys/gnu/dts/arm/at91-vinco.dts head/sys/gnu/dts/arm/at91rm9200.dtsi head/sys/gnu/dts/arm/at91rm9200ek.dts head/sys/gnu/dts/arm/at91sam9260.dtsi head/sys/gnu/dts/arm/at91sam9261.dtsi head/sys/gnu/dts/arm/at91sam9261ek.dts head/sys/gnu/dts/arm/at91sam9263.dtsi head/sys/gnu/dts/arm/at91sam9263ek.dts head/sys/gnu/dts/arm/at91sam9g20.dtsi head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9m10g45ek.dts head/sys/gnu/dts/arm/at91sam9n12.dtsi head/sys/gnu/dts/arm/at91sam9n12ek.dts head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9rlek.dts head/sys/gnu/dts/arm/at91sam9x25ek.dts head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/at91sam9x5ek.dtsi head/sys/gnu/dts/arm/at91sam9xe.dtsi head/sys/gnu/dts/arm/axp209.dtsi head/sys/gnu/dts/arm/bcm-cygnus.dtsi head/sys/gnu/dts/arm/bcm-nsp.dtsi head/sys/gnu/dts/arm/bcm2837-rpi-3-b.dts head/sys/gnu/dts/arm/bcm283x.dtsi head/sys/gnu/dts/arm/bcm47081-luxul-xwr-1200.dts head/sys/gnu/dts/arm/bcm5301x.dtsi head/sys/gnu/dts/arm/bcm53573.dtsi head/sys/gnu/dts/arm/bcm958623hr.dts head/sys/gnu/dts/arm/bcm958625hr.dts head/sys/gnu/dts/arm/berlin2.dtsi head/sys/gnu/dts/arm/berlin2cd.dtsi head/sys/gnu/dts/arm/berlin2q.dtsi head/sys/gnu/dts/arm/da850-lcdk.dts head/sys/gnu/dts/arm/da850-lego-ev3.dts head/sys/gnu/dts/arm/da850.dtsi head/sys/gnu/dts/arm/dm814x.dtsi head/sys/gnu/dts/arm/dove.dtsi head/sys/gnu/dts/arm/dra7-evm-common.dtsi (contents, props changed) head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/ep7211-edb7211.dts head/sys/gnu/dts/arm/exynos3250-artik5.dtsi head/sys/gnu/dts/arm/exynos3250-monk.dts head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos3250.dtsi head/sys/gnu/dts/arm/exynos4.dtsi head/sys/gnu/dts/arm/exynos4210-pinctrl.dtsi head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4210.dtsi head/sys/gnu/dts/arm/exynos4412-itop-scp-core.dtsi head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-odroidx.dts head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos4412-pinctrl.dtsi head/sys/gnu/dts/arm/exynos4412-trats2.dts head/sys/gnu/dts/arm/exynos4412.dtsi head/sys/gnu/dts/arm/exynos5250-arndale.dts head/sys/gnu/dts/arm/exynos5250-smdk5250.dts head/sys/gnu/dts/arm/exynos5250-snow-common.dtsi head/sys/gnu/dts/arm/exynos5250-spring.dts head/sys/gnu/dts/arm/exynos5250.dtsi head/sys/gnu/dts/arm/exynos5410-odroidxu.dts head/sys/gnu/dts/arm/exynos5410-smdk5410.dts head/sys/gnu/dts/arm/exynos5410.dtsi head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts head/sys/gnu/dts/arm/exynos5420-cpus.dtsi head/sys/gnu/dts/arm/exynos5420-peach-pit.dts head/sys/gnu/dts/arm/exynos5420-smdk5420.dts head/sys/gnu/dts/arm/exynos5420.dtsi head/sys/gnu/dts/arm/exynos5422-cpus.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-audio.dtsi head/sys/gnu/dts/arm/exynos5422-odroidxu3-common.dtsi head/sys/gnu/dts/arm/exynos5440-ssdk5440.dts head/sys/gnu/dts/arm/exynos5440.dtsi head/sys/gnu/dts/arm/exynos54xx.dtsi head/sys/gnu/dts/arm/exynos5800-peach-pi.dts head/sys/gnu/dts/arm/ge863-pro3.dtsi head/sys/gnu/dts/arm/gemini.dtsi head/sys/gnu/dts/arm/hip01.dtsi head/sys/gnu/dts/arm/hip04-d01.dts head/sys/gnu/dts/arm/hisi-x5hd2.dtsi head/sys/gnu/dts/arm/imx1.dtsi head/sys/gnu/dts/arm/imx25-eukrea-mbimxsd25-baseboard.dts head/sys/gnu/dts/arm/imx25-pdk.dts head/sys/gnu/dts/arm/imx28-apx4devkit.dts head/sys/gnu/dts/arm/imx28-eukrea-mbmx28lc.dtsi head/sys/gnu/dts/arm/imx28-evk.dts head/sys/gnu/dts/arm/imx28-m28evk.dts head/sys/gnu/dts/arm/imx28-tx28.dts head/sys/gnu/dts/arm/imx35-eukrea-mbimxsd35-baseboard.dts head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx51-apf51dev.dts head/sys/gnu/dts/arm/imx51-babbage.dts head/sys/gnu/dts/arm/imx51-ts4800.dts head/sys/gnu/dts/arm/imx51.dtsi head/sys/gnu/dts/arm/imx53-m53evk.dts head/sys/gnu/dts/arm/imx53-mba53.dts head/sys/gnu/dts/arm/imx53-qsb-common.dtsi head/sys/gnu/dts/arm/imx53-smd.dts head/sys/gnu/dts/arm/imx53-tx53-x03x.dts head/sys/gnu/dts/arm/imx53-tx53-x13x.dts head/sys/gnu/dts/arm/imx53-tx53.dtsi head/sys/gnu/dts/arm/imx53-voipac-bsb.dts head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6dl-aristainetos2_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos_4.dts head/sys/gnu/dts/arm/imx6dl-aristainetos_7.dts head/sys/gnu/dts/arm/imx6dl-colibri-eval-v3.dts head/sys/gnu/dts/arm/imx6dl-icore.dts head/sys/gnu/dts/arm/imx6dl-riotboard.dts head/sys/gnu/dts/arm/imx6dl-tx6dl-comtft.dts head/sys/gnu/dts/arm/imx6dl-tx6s-8034.dts head/sys/gnu/dts/arm/imx6dl-tx6s-8035.dts head/sys/gnu/dts/arm/imx6dl-tx6u-801x.dts head/sys/gnu/dts/arm/imx6dl-tx6u-8033.dts head/sys/gnu/dts/arm/imx6dl-tx6u-811x.dts head/sys/gnu/dts/arm/imx6dl-tx6u-81xx-mb7.dts head/sys/gnu/dts/arm/imx6dl.dtsi head/sys/gnu/dts/arm/imx6q-apalis-eval.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-apalis-ixora-v1.1.dts (contents, props changed) head/sys/gnu/dts/arm/imx6q-apalis-ixora.dts head/sys/gnu/dts/arm/imx6q-bx50v3.dtsi head/sys/gnu/dts/arm/imx6q-cm-fx6.dts head/sys/gnu/dts/arm/imx6q-dmo-edmqmx6.dts head/sys/gnu/dts/arm/imx6q-gw5400-a.dts head/sys/gnu/dts/arm/imx6q-h100.dts head/sys/gnu/dts/arm/imx6q-icore-rqs.dts head/sys/gnu/dts/arm/imx6q-mccmon6.dts head/sys/gnu/dts/arm/imx6q-novena.dts head/sys/gnu/dts/arm/imx6q-tbs2910.dts head/sys/gnu/dts/arm/imx6q-tx6q-1010-comtft.dts head/sys/gnu/dts/arm/imx6q-tx6q-1010.dts head/sys/gnu/dts/arm/imx6q-tx6q-1020-comtft.dts head/sys/gnu/dts/arm/imx6q-tx6q-1020.dts head/sys/gnu/dts/arm/imx6q-tx6q-1036.dts head/sys/gnu/dts/arm/imx6q-tx6q-1110.dts head/sys/gnu/dts/arm/imx6q-tx6q-11x0-mb7.dts head/sys/gnu/dts/arm/imx6q-utilite-pro.dts head/sys/gnu/dts/arm/imx6q.dtsi head/sys/gnu/dts/arm/imx6qdl-apalis.dtsi head/sys/gnu/dts/arm/imx6qdl-apf6dev.dtsi head/sys/gnu/dts/arm/imx6qdl-colibri.dtsi head/sys/gnu/dts/arm/imx6qdl-gw51xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw52xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw53xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw54xx.dtsi head/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi head/sys/gnu/dts/arm/imx6qdl-hummingboard.dtsi head/sys/gnu/dts/arm/imx6qdl-icore-rqs.dtsi head/sys/gnu/dts/arm/imx6qdl-icore.dtsi head/sys/gnu/dts/arm/imx6qdl-nit6xlite.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_max.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6_som2.dtsi head/sys/gnu/dts/arm/imx6qdl-nitrogen6x.dtsi head/sys/gnu/dts/arm/imx6qdl-rex.dtsi head/sys/gnu/dts/arm/imx6qdl-sabreauto.dtsi head/sys/gnu/dts/arm/imx6qdl-sabrelite.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl-tx6.dtsi head/sys/gnu/dts/arm/imx6qdl-wandboard.dtsi head/sys/gnu/dts/arm/imx6qdl-zii-rdu2.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6qp.dtsi head/sys/gnu/dts/arm/imx6sl-evk.dts head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sx-nitrogen6sx.dts head/sys/gnu/dts/arm/imx6sx-sdb-reva.dts head/sys/gnu/dts/arm/imx6sx-sdb.dts head/sys/gnu/dts/arm/imx6sx-udoo-neo.dtsi head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-14x14-evk.dts head/sys/gnu/dts/arm/imx6ul-pico-hobbit.dts head/sys/gnu/dts/arm/imx6ul-tx6ul-mainboard.dts head/sys/gnu/dts/arm/imx6ul-tx6ul.dtsi head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx7-colibri.dtsi head/sys/gnu/dts/arm/imx7d-nitrogen7.dts head/sys/gnu/dts/arm/imx7d-pico.dts head/sys/gnu/dts/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7s-warp.dts head/sys/gnu/dts/arm/integrator.dtsi head/sys/gnu/dts/arm/integratorap.dts head/sys/gnu/dts/arm/keystone-k2e.dtsi head/sys/gnu/dts/arm/keystone-k2g-evm.dts head/sys/gnu/dts/arm/keystone-k2g.dtsi head/sys/gnu/dts/arm/keystone-k2hk.dtsi head/sys/gnu/dts/arm/keystone-k2l.dtsi head/sys/gnu/dts/arm/keystone.dtsi head/sys/gnu/dts/arm/kirkwood-openblocks_a7.dts head/sys/gnu/dts/arm/kirkwood-synology.dtsi head/sys/gnu/dts/arm/kirkwood-ts219.dtsi head/sys/gnu/dts/arm/kirkwood.dtsi head/sys/gnu/dts/arm/logicpd-som-lv-37xx-devkit.dts head/sys/gnu/dts/arm/logicpd-som-lv.dtsi head/sys/gnu/dts/arm/lpc3250-ea3250.dts head/sys/gnu/dts/arm/lpc3250-phy3250.dts head/sys/gnu/dts/arm/lpc32xx.dtsi head/sys/gnu/dts/arm/ls1021a-qds.dts head/sys/gnu/dts/arm/ls1021a-twr.dts head/sys/gnu/dts/arm/meson.dtsi head/sys/gnu/dts/arm/meson6.dtsi head/sys/gnu/dts/arm/meson8.dtsi head/sys/gnu/dts/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/mpa1600.dts head/sys/gnu/dts/arm/mt2701-evb.dts head/sys/gnu/dts/arm/mt2701.dtsi head/sys/gnu/dts/arm/mt6589.dtsi head/sys/gnu/dts/arm/mt7623.dtsi head/sys/gnu/dts/arm/nspire.dtsi head/sys/gnu/dts/arm/omap2420-n8x0-common.dtsi head/sys/gnu/dts/arm/omap3-beagle-xm.dts head/sys/gnu/dts/arm/omap3-beagle.dts head/sys/gnu/dts/arm/omap3-cm-t3x.dtsi head/sys/gnu/dts/arm/omap3-evm-37xx.dts head/sys/gnu/dts/arm/omap3-evm-common.dtsi head/sys/gnu/dts/arm/omap3-evm.dts head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-igep0020-common.dtsi head/sys/gnu/dts/arm/omap3-igep0030-common.dtsi head/sys/gnu/dts/arm/omap3-lilly-a83x.dtsi head/sys/gnu/dts/arm/omap3-n9.dts head/sys/gnu/dts/arm/omap3-n900.dts head/sys/gnu/dts/arm/omap3-n950-n9.dtsi head/sys/gnu/dts/arm/omap3-n950.dts head/sys/gnu/dts/arm/omap3-overo-base.dtsi head/sys/gnu/dts/arm/omap3-pandora-common.dtsi head/sys/gnu/dts/arm/omap3-panel-sharp-ls037v7dw01.dtsi head/sys/gnu/dts/arm/omap3-tao3530.dtsi head/sys/gnu/dts/arm/omap3.dtsi head/sys/gnu/dts/arm/omap4-droid4-xt894.dts head/sys/gnu/dts/arm/omap4-duovero.dtsi head/sys/gnu/dts/arm/omap4-panda-common.dtsi head/sys/gnu/dts/arm/omap4-var-som-om44.dtsi head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap5-board-common.dtsi head/sys/gnu/dts/arm/omap5-cm-t54.dts head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/owl-s500-guitar-bb-rev-b.dts head/sys/gnu/dts/arm/owl-s500.dtsi head/sys/gnu/dts/arm/ox810se.dtsi head/sys/gnu/dts/arm/ox820.dtsi head/sys/gnu/dts/arm/picoxcell-pc3x2.dtsi head/sys/gnu/dts/arm/picoxcell-pc3x3.dtsi head/sys/gnu/dts/arm/pm9g45.dts head/sys/gnu/dts/arm/qcom-apq8060-dragonboard.dts head/sys/gnu/dts/arm/qcom-apq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8660.dtsi head/sys/gnu/dts/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/r7s72100-gr-peach.dts head/sys/gnu/dts/arm/r7s72100.dtsi head/sys/gnu/dts/arm/r8a73a4.dtsi head/sys/gnu/dts/arm/r8a7743-iwg20d-q7.dts head/sys/gnu/dts/arm/r8a7743-iwg20m.dtsi head/sys/gnu/dts/arm/r8a7743.dtsi head/sys/gnu/dts/arm/r8a7745.dtsi head/sys/gnu/dts/arm/r8a7778.dtsi head/sys/gnu/dts/arm/r8a7779.dtsi head/sys/gnu/dts/arm/r8a7790-lager.dts head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791-koelsch.dts head/sys/gnu/dts/arm/r8a7791-porter.dts head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7792-blanche.dts head/sys/gnu/dts/arm/r8a7792-wheat.dts head/sys/gnu/dts/arm/r8a7792.dtsi head/sys/gnu/dts/arm/r8a7793-gose.dts head/sys/gnu/dts/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794-alt.dts head/sys/gnu/dts/arm/r8a7794-silk.dts head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/rk3036-kylin.dts head/sys/gnu/dts/arm/rk3036.dtsi head/sys/gnu/dts/arm/rk3066a-marsboard.dts head/sys/gnu/dts/arm/rk3066a-rayeager.dts head/sys/gnu/dts/arm/rk3066a.dtsi head/sys/gnu/dts/arm/rk3188-radxarock.dts head/sys/gnu/dts/arm/rk3188.dtsi head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-firefly-reload-core.dtsi head/sys/gnu/dts/arm/rk3288-firefly-reload.dts head/sys/gnu/dts/arm/rk3288-popmetal.dts head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/rk3xxx.dtsi head/sys/gnu/dts/arm/rv1108-evb.dts head/sys/gnu/dts/arm/rv1108.dtsi head/sys/gnu/dts/arm/sama5d2.dtsi head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sama5d3xmb.dtsi head/sys/gnu/dts/arm/sama5d3xmb_cmp.dtsi head/sys/gnu/dts/arm/sama5d4.dtsi head/sys/gnu/dts/arm/sh73a0.dtsi head/sys/gnu/dts/arm/ste-href-stuib.dtsi head/sys/gnu/dts/arm/ste-href-tvk1281618.dtsi head/sys/gnu/dts/arm/stih407-clock.dtsi head/sys/gnu/dts/arm/stih407-family.dtsi head/sys/gnu/dts/arm/stih407-pinctrl.dtsi head/sys/gnu/dts/arm/stih410-b2120.dts head/sys/gnu/dts/arm/stih410-b2260.dts head/sys/gnu/dts/arm/stih410-clock.dtsi head/sys/gnu/dts/arm/stih410.dtsi head/sys/gnu/dts/arm/stih418-b2199.dts head/sys/gnu/dts/arm/stih418-clock.dtsi head/sys/gnu/dts/arm/stih418.dtsi head/sys/gnu/dts/arm/stihxxx-b2120.dtsi head/sys/gnu/dts/arm/stm32746g-eval.dts head/sys/gnu/dts/arm/stm32f4-pinctrl.dtsi (contents, props changed) head/sys/gnu/dts/arm/stm32f429.dtsi head/sys/gnu/dts/arm/stm32f746-disco.dts head/sys/gnu/dts/arm/stm32f746.dtsi head/sys/gnu/dts/arm/stm32h743-pinctrl.dtsi head/sys/gnu/dts/arm/stm32h743.dtsi head/sys/gnu/dts/arm/stm32h743i-eval.dts head/sys/gnu/dts/arm/sun4i-a10-a1000.dts head/sys/gnu/dts/arm/sun4i-a10-ba10-tvbox.dts head/sys/gnu/dts/arm/sun4i-a10-chuwi-v7-cw0825.dts head/sys/gnu/dts/arm/sun4i-a10-cubieboard.dts head/sys/gnu/dts/arm/sun4i-a10-dserve-dsrv9703c.dts head/sys/gnu/dts/arm/sun4i-a10-gemei-g9.dts head/sys/gnu/dts/arm/sun4i-a10-hackberry.dts head/sys/gnu/dts/arm/sun4i-a10-hyundai-a7hd.dts head/sys/gnu/dts/arm/sun4i-a10-inet1.dts head/sys/gnu/dts/arm/sun4i-a10-inet97fv2.dts head/sys/gnu/dts/arm/sun4i-a10-inet9f-rev03.dts head/sys/gnu/dts/arm/sun4i-a10-itead-iteaduino-plus.dts head/sys/gnu/dts/arm/sun4i-a10-jesurun-q5.dts head/sys/gnu/dts/arm/sun4i-a10-marsboard.dts head/sys/gnu/dts/arm/sun4i-a10-mini-xplus.dts head/sys/gnu/dts/arm/sun4i-a10-mk802.dts head/sys/gnu/dts/arm/sun4i-a10-mk802ii.dts head/sys/gnu/dts/arm/sun4i-a10-olinuxino-lime.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino.dts head/sys/gnu/dts/arm/sun4i-a10-pcduino2.dts head/sys/gnu/dts/arm/sun4i-a10-pov-protab2-ips9.dts head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i-a10s.dtsi head/sys/gnu/dts/arm/sun5i-a13.dtsi head/sys/gnu/dts/arm/sun5i-gr8.dtsi head/sys/gnu/dts/arm/sun5i-reference-design-tablet.dtsi head/sys/gnu/dts/arm/sun5i.dtsi head/sys/gnu/dts/arm/sun6i-a31-hummingbird.dts head/sys/gnu/dts/arm/sun6i-a31.dtsi head/sys/gnu/dts/arm/sun6i-a31s-primo81.dts head/sys/gnu/dts/arm/sun6i-a31s-sina31s.dts head/sys/gnu/dts/arm/sun7i-a20-bananapi-m1-plus.dts head/sys/gnu/dts/arm/sun7i-a20-cubieboard2.dts head/sys/gnu/dts/arm/sun7i-a20-cubietruck.dts head/sys/gnu/dts/arm/sun7i-a20-lamobo-r1.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime2.dts head/sys/gnu/dts/arm/sun7i-a20-olinuxino-micro.dts head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a23-a33.dtsi head/sys/gnu/dts/arm/sun8i-a23.dtsi head/sys/gnu/dts/arm/sun8i-a33.dtsi head/sys/gnu/dts/arm/sun8i-a83t-allwinner-h8homlet-v2.dts head/sys/gnu/dts/arm/sun8i-a83t-bananapi-m3.dts (contents, props changed) head/sys/gnu/dts/arm/sun8i-a83t-cubietruck-plus.dts head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-orangepi-zero.dts head/sys/gnu/dts/arm/sun8i-h3-bananapi-m2-plus.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1-plus.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-m1.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi-neo.dts head/sys/gnu/dts/arm/sun8i-h3-nanopi.dtsi head/sys/gnu/dts/arm/sun8i-h3-orangepi-2.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-lite.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-one.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc-plus.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-pc.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus.dts head/sys/gnu/dts/arm/sun8i-h3-orangepi-plus2e.dts head/sys/gnu/dts/arm/sun8i-v3s.dtsi head/sys/gnu/dts/arm/sun9i-a80-cubieboard4.dts head/sys/gnu/dts/arm/sun9i-a80-optimus.dts head/sys/gnu/dts/arm/sun9i-a80.dtsi head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/arm/sunxi-itead-core-common.dtsi head/sys/gnu/dts/arm/tango4-common.dtsi head/sys/gnu/dts/arm/tegra124-jetson-tk1.dts head/sys/gnu/dts/arm/tegra124.dtsi head/sys/gnu/dts/arm/uniphier-ld4-ref.dts head/sys/gnu/dts/arm/uniphier-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-pinctrl.dtsi head/sys/gnu/dts/arm/uniphier-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pro5.dtsi head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/uniphier-sld8-ref.dts head/sys/gnu/dts/arm/uniphier-sld8.dtsi head/sys/gnu/dts/arm/uniphier-support-card.dtsi head/sys/gnu/dts/arm/usb_a9263.dts head/sys/gnu/dts/arm/usb_a9g20_common.dtsi head/sys/gnu/dts/arm/vf610-twr.dts head/sys/gnu/dts/arm/vf610-zii-dev-rev-c.dts head/sys/gnu/dts/arm/zx296702.dtsi head/sys/gnu/dts/arm/zynq-zc702.dts head/sys/gnu/dts/arm/zynq-zc706.dts head/sys/gnu/dts/include/dt-bindings/clock/exynos4.h head/sys/gnu/dts/include/dt-bindings/clock/gxbb-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/imx7d-clock.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,rpmcc.h head/sys/gnu/dts/include/dt-bindings/clock/r7s72100-clock.h head/sys/gnu/dts/include/dt-bindings/clock/rk3188-cru-common.h head/sys/gnu/dts/include/dt-bindings/clock/rk3368-cru.h head/sys/gnu/dts/include/dt-bindings/clock/s3c2443.h head/sys/gnu/dts/include/dt-bindings/clock/sun4i-a10-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/sun6i-a31-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h head/sys/gnu/dts/include/dt-bindings/gpio/gpio.h head/sys/gnu/dts/include/dt-bindings/gpio/meson-gxbb-gpio.h head/sys/gnu/dts/include/dt-bindings/gpio/meson-gxl-gpio.h head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h head/sys/gnu/dts/include/dt-bindings/phy/phy.h head/sys/gnu/dts/include/dt-bindings/pinctrl/am43xx.h Directory Properties: head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts (props changed) head/sys/gnu/dts/arm/am57xx-beagle-x15-revc.dts (props changed) head/sys/gnu/dts/arm/at91-sama5d27_som1.dtsi (props changed) head/sys/gnu/dts/arm/bcm2835-rpi-zero-w.dts (props changed) head/sys/gnu/dts/arm/bcm2837.dtsi (props changed) head/sys/gnu/dts/arm/bcm947189acdbmr.dts (props changed) head/sys/gnu/dts/arm/dra72x-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/dra74x-mmc-iodelay.dtsi (props changed) head/sys/gnu/dts/arm/dra76-evm.dts (props changed) head/sys/gnu/dts/arm/dra76x.dtsi (props changed) head/sys/gnu/dts/arm/gemini-dlink-dir-685.dts (props changed) head/sys/gnu/dts/arm/imx53-cx9020.dts (props changed) head/sys/gnu/dts/arm/imx6ul-geam.dts (props changed) head/sys/gnu/dts/arm/imx7ulp-pinfunc.h (props changed) head/sys/gnu/dts/arm/mt6323.dtsi (props changed) head/sys/gnu/dts/arm/mt7623n-bananapi-bpi-r2.dts (props changed) head/sys/gnu/dts/arm/mt7623n-rfb-nand.dts (props changed) head/sys/gnu/dts/arm/mt7623n-rfb.dtsi (props changed) head/sys/gnu/dts/arm/rk3229.dtsi (props changed) head/sys/gnu/dts/arm/stm32f429-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/stm32f469-pinctrl.dtsi (props changed) head/sys/gnu/dts/arm/sun8i-r16-bananapi-m2m.dts (props changed) Modified: head/sys/gnu/dts/arm/am33xx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/am33xx.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -130,9 +130,11 @@ }; }; - pmu { + pmu@4b000000 { compatible = "arm,cortex-a8-pmu"; interrupts = <3>; + reg = <0x4b000000 0x1000000>; + ti,hwmods = "debugss"; }; /* @@ -628,6 +630,7 @@ reg-names = "phy"; status = "disabled"; ti,ctrl_mod = <&usb_ctrl_mod>; + #phy-cells = <0>; }; usb0: usb@47401000 { @@ -676,6 +679,7 @@ reg-names = "phy"; status = "disabled"; ti,ctrl_mod = <&usb_ctrl_mod>; + #phy-cells = <0>; }; usb1: usb@47401800 { @@ -927,6 +931,12 @@ #io-channel-cells = <1>; compatible = "ti,am3359-adc"; }; + }; + + emif: emif@4c000000 { + compatible = "ti,emif-am3352"; + reg = <0x4c000000 0x1000000>; + ti,hwmods = "emif"; }; gpmc: gpmc@50000000 { Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/am4372.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -927,7 +927,8 @@ reg = <0x48038000 0x2000>, <0x46000000 0x400000>; reg-names = "mpu", "dat"; - interrupts = <80>, <81>; + interrupts = , + ; interrupt-names = "tx", "rx"; status = "disabled"; dmas = <&edma 8 2>, @@ -941,7 +942,8 @@ reg = <0x4803C000 0x2000>, <0x46400000 0x400000>; reg-names = "mpu", "dat"; - interrupts = <82>, <83>; + interrupts = , + ; interrupt-names = "tx", "rx"; status = "disabled"; dmas = <&edma 10 2>, Modified: head/sys/gnu/dts/arm/am437x-cm-t43.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-cm-t43.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/am437x-cm-t43.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -301,8 +301,8 @@ status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&spi0_pins>; - dmas = <&edma 16 - &edma 17>; + dmas = <&edma 16 0 + &edma 17 0>; dma-names = "tx0", "rx0"; flash: w25q64cvzpig@0 { Modified: head/sys/gnu/dts/arm/am43x-epos-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am43x-epos-evm.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/am43x-epos-evm.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -75,6 +75,9 @@ compatible = "gpio-matrix-keypad"; debounce-delay-ms = <5>; col-scan-delay-us = <2>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&matrix_keypad_default>; + pinctrl-1 = <&matrix_keypad_sleep>; row-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH /* Bank0, pin12 */ &gpio0 13 GPIO_ACTIVE_HIGH /* Bank0, pin13 */ @@ -145,6 +148,43 @@ }; &am43xx_pinmux { + pinctrl-names = "default"; + pinctrl-0 = <&unused_pins>; + + unused_pins: unused_pins { + pinctrl-single,pins = < + AM4372_IOPAD(0x848, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x850, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x858, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x860, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x864, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x868, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x86c, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x878, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x908, DS0_PIN_INPUT_PULLDOWN | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x91c, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x920, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x9e0, DS0_PIN_INPUT_PULLDOWN | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA0c, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA38, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA3c, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA40, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA44, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA48, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA4c, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA50, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA54, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA58, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA5c, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA60, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA64, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0xA68, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA6C, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA74, DS0_PIN_INPUT_PULLDOWN | PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0xA78, DS0_PIN_INPUT | PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + cpsw_default: cpsw_default { pinctrl-single,pins = < /* Slave 1 */ @@ -198,7 +238,7 @@ >; }; - nand_flash_x8: nand_flash_x8 { + nand_flash_x8_default: nand_flash_x8_default { pinctrl-single,pins = < AM4372_IOPAD(0x840, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a0.SELQSPIorNAND/GPIO */ AM4372_IOPAD(0x800, PIN_INPUT_PULLDOWN | MUX_MODE0) /* gpmc_ad0.gpmc_ad0 */ @@ -219,12 +259,39 @@ >; }; - ecap0_pins: backlight_pins { + nand_flash_x8_sleep: nand_flash_x8_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x840, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x800, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x804, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x808, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x80c, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x810, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x814, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x818, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x81c, DS0_PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x870, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x874, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x87c, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x890, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x894, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x898, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x89c, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + >; + }; + + ecap0_pins_default: backlight_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x964, MUX_MODE0) /* eCAP0_in_PWM0_out.eCAP0_in_PWM0_out MODE0 */ >; }; + ecap0_pins_sleep: backlight_pins_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0x964, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + >; + }; + i2c2_pins: pinmux_i2c2_pins { pinctrl-single,pins = < AM4372_IOPAD(0x9c0, PIN_INPUT_PULLUP | SLEWCTRL_FAST | MUX_MODE8) /* i2c2_sda.i2c2_sda */ @@ -232,7 +299,7 @@ >; }; - spi0_pins: pinmux_spi0_pins { + spi0_pins_default: pinmux_spi0_pins_default { pinctrl-single,pins = < AM4372_IOPAD(0x950, PIN_INPUT | MUX_MODE0) /* spi0_clk.spi0_clk */ AM4372_IOPAD(0x954, PIN_OUTPUT | MUX_MODE0) /* spi0_d0.spi0_d0 */ @@ -241,8 +308,17 @@ >; }; - spi1_pins: pinmux_spi1_pins { + spi0_pins_sleep: pinmux_spi0_pins_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x950, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x954, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x958, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x95c, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) + >; + }; + + spi1_pins_default: pinmux_spi1_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x990, PIN_INPUT | MUX_MODE3) /* mcasp0_aclkx.spi1_clk */ AM4372_IOPAD(0x994, PIN_OUTPUT | MUX_MODE3) /* mcasp0_fsx.spi1_d0 */ AM4372_IOPAD(0x998, PIN_INPUT | MUX_MODE3) /* mcasp0_axr0.spi1_d1 */ @@ -250,14 +326,55 @@ >; }; - mmc1_pins: pinmux_mmc1_pins { + spi1_pins_sleep: pinmux_spi1_pins_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x990, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x994, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x998, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x99c, DS0_PIN_OUTPUT_PULLDOWN | PIN_OUTPUT_PULLDOWN | MUX_MODE7) + >; + }; + + mmc1_pins_default: pinmux_mmc1_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */ >; }; - qspi1_default: qspi1_default { + mmc1_pins_sleep: pinmux_mmc1_pins_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x960, DS0_PIN_OUTPUT_PULLUP | PIN_INPUT | MUX_MODE7) + >; + }; + + matrix_keypad_default: matrix_keypad_default { + pinctrl-single,pins = < + AM4372_IOPAD(0x92c, PIN_OUTPUT | MUX_MODE7) /* mii1_tx_clk.gpio3_9 */ + AM4372_IOPAD(0x930, PIN_OUTPUT | MUX_MODE7) /* mii1_rx_clk.gpio3_10 */ + AM4372_IOPAD(0x934, PIN_OUTPUT | MUX_MODE7) /* mii1_rxd3.gpio2_18 */ + AM4372_IOPAD(0x938, PIN_OUTPUT | MUX_MODE7) /* mii1_rxd2.gpio2_19 */ + AM4372_IOPAD(0x978, PIN_INPUT_PULLDOWN | MUX_MODE7) /* uart1_ctsn.gpio0_12 */ + AM4372_IOPAD(0x97C, PIN_INPUT_PULLDOWN | MUX_MODE7) /* uart1_rtsn.gpio0_13 */ + AM4372_IOPAD(0x980, PIN_INPUT_PULLDOWN | MUX_MODE7) /* uart1_rxd.gpio0_14 */ + AM4372_IOPAD(0x984, PIN_INPUT_PULLDOWN | MUX_MODE7) /* uart1_txd.gpio0_15 */ + >; + }; + + matrix_keypad_sleep: matrix_keypad_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0x92c, PIN_INPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x930, PIN_INPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x934, PIN_INPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x938, PIN_INPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x978, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x97C, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x980, PIN_INPUT_PULLDOWN | MUX_MODE7) + AM4372_IOPAD(0x984, PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + + qspi1_pins_default: qspi1_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x87c, PIN_INPUT_PULLUP | MUX_MODE3) AM4372_IOPAD(0x888, PIN_INPUT_PULLUP | MUX_MODE2) AM4372_IOPAD(0x890, PIN_INPUT_PULLUP | MUX_MODE3) @@ -267,12 +384,29 @@ >; }; - pixcir_ts_pins: pixcir_ts_pins { + qspi1_pins_sleep: qspi1_pins_sleep { pinctrl-single,pins = < + AM4372_IOPAD(0x87c, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x888, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x890, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x894, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x898, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + AM4372_IOPAD(0x89c, DS0_PIN_OUTPUT_PULLUP | MUX_MODE7) + >; + }; + + pixcir_ts_pins_default: pixcir_ts_pins_default { + pinctrl-single,pins = < AM4372_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE7) /* gpmc_a1.gpio1_17 */ >; }; + pixcir_ts_pins_sleep: pixcir_ts_pins_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0x844, DS0_PIN_OUTPUT_PULLUP | PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a1.gpio1_17 */ + >; + }; + hdq_pins: pinmux_hdq_pins { pinctrl-single,pins = < AM4372_IOPAD(0xa34, PIN_INPUT_PULLUP | MUX_MODE1) /* cam1_wen.hdq_gpio */ @@ -355,6 +489,48 @@ >; }; + uart0_pins_default: uart0_pins_default { + pinctrl-single,pins = < + AM4372_IOPAD(0x968, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE0) /* uart0_ctsn.uart0_ctsn */ + AM4372_IOPAD(0x96C, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE0) /* uart0_rtsn.uart0_rtsn */ + AM4372_IOPAD(0x970, PIN_INPUT_PULLUP | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart0_rxd.uart0_rxd */ + AM4372_IOPAD(0x974, PIN_INPUT | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) /* uart0_txd.uart0_txd */ + >; + }; + + uart0_pins_sleep: uart0_pins_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0x968, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE7) + AM4372_IOPAD(0x96C, DS0_PULL_UP_DOWN_EN | INPUT_EN | MUX_MODE7) + AM4372_IOPAD(0x970, PIN_INPUT_PULLUP | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) + AM4372_IOPAD(0x974, PIN_INPUT | SLEWCTRL_FAST | DS0_PULL_UP_DOWN_EN | MUX_MODE0) + >; + }; + + usb2_phy1_default: usb2_phy1_default { + pinctrl-single,pins = < + AM4372_IOPAD(0xac0, PIN_INPUT_PULLDOWN | MUX_MODE0) + >; + }; + + usb2_phy1_sleep: usb2_phy1_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0xac0, DS0_PULL_UP_DOWN_EN | PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + + usb2_phy2_default: usb2_phy2_default { + pinctrl-single,pins = < + AM4372_IOPAD(0xac4, PIN_INPUT_PULLDOWN | MUX_MODE0) + >; + }; + + usb2_phy2_sleep: usb2_phy2_sleep { + pinctrl-single,pins = < + AM4372_IOPAD(0xac4, DS0_PULL_UP_DOWN_EN | PIN_INPUT_PULLDOWN | MUX_MODE7) + >; + }; + mcasp1_pins: mcasp1_pins { pinctrl-single,pins = < AM4372_IOPAD(0x9a0, PIN_INPUT_PULLDOWN | MUX_MODE3) /* MCASP0_ACLKR/MCASP1_ACLKX */ @@ -378,8 +554,9 @@ status = "okay"; vmmc-supply = <&vmmcsd_fixed>; bus-width = <4>; - pinctrl-names = "default"; - pinctrl-0 = <&mmc1_pins>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&mmc1_pins_default>; + pinctrl-1 = <&mmc1_pins_sleep>; cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; }; @@ -478,8 +655,10 @@ pixcir_ts@5c { compatible = "pixcir,pixcir_tangoc"; - pinctrl-names = "default"; - pinctrl-0 = <&pixcir_ts_pins>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&pixcir_ts_pins_default>; + pinctrl-1 = <&pixcir_ts_pins_sleep>; + reg = <0x5c>; interrupt-parent = <&gpio1>; interrupts = <17 IRQ_TYPE_EDGE_FALLING>; @@ -550,8 +729,9 @@ &gpmc { status = "okay"; /* Disable QSPI when enabling GPMC (NAND) */ - pinctrl-names = "default"; - pinctrl-0 = <&nand_flash_x8>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&nand_flash_x8_default>; + pinctrl-1 = <&nand_flash_x8_sleep>; ranges = <0 0 0x08000000 0x01000000>; /* CS0 space. Min partition = 16MB */ nand@0,0 { compatible = "ti,omap2-nand"; @@ -647,24 +827,30 @@ &ecap0 { status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&ecap0_pins>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&ecap0_pins_default>; + pinctrl-1 = <&ecap0_pins_sleep>; }; &spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_pins>; status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&spi0_pins_default>; + pinctrl-1 = <&spi0_pins_sleep>; }; &spi1 { - pinctrl-names = "default"; - pinctrl-0 = <&spi1_pins>; status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&spi1_pins_default>; + pinctrl-1 = <&spi1_pins_sleep>; }; &usb2_phy1 { status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&usb2_phy1_default>; + pinctrl-1 = <&usb2_phy1_sleep>; }; &usb1 { @@ -674,6 +860,9 @@ &usb2_phy2 { status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&usb2_phy2_default>; + pinctrl-1 = <&usb2_phy2_sleep>; }; &usb2 { @@ -683,8 +872,9 @@ &qspi { status = "disabled"; /* Disable GPMC (NAND) when enabling QSPI */ - pinctrl-names = "default"; - pinctrl-0 = <&qspi1_default>; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&qspi1_pins_default>; + pinctrl-1 = <&qspi1_pins_sleep>; spi-max-frequency = <48000000>; m25p80@0 { @@ -768,6 +958,13 @@ vsync-active = <0>; }; }; +}; + +&uart0 { + status = "okay"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&uart0_pins_default>; + pinctrl-1 = <&uart0_pins_sleep>; }; &mcasp1 { Modified: head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-370-synology-ds213j.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -316,32 +316,32 @@ * change the default environment, unless you know * what you are doing. */ - partition@00000000 { /* u-boot */ + partition@0 { /* u-boot */ label = "RedBoot"; reg = <0x00000000 0x000c0000>; /* 768KB */ }; - partition@000c0000 { /* uImage */ + partition@c0000 { /* uImage */ label = "zImage"; reg = <0x000c0000 0x002d0000>; /* 2880KB */ }; - partition@00390000 { /* uInitramfs */ + partition@390000 { /* uInitramfs */ label = "rd.gz"; reg = <0x00390000 0x00440000>; /* 4250KB */ }; - partition@007d0000 { /* MAC address and serial number */ + partition@7d0000 { /* MAC address and serial number */ label = "vendor"; reg = <0x007d0000 0x00010000>; /* 64KB */ }; - partition@007e0000 { + partition@7e0000 { label = "RedBoot config"; reg = <0x007e0000 0x00010000>; /* 64KB */ }; - partition@007f0000 { + partition@7f0000 { label = "FIS directory"; reg = <0x007f0000 0x00010000>; /* 64KB */ }; Modified: head/sys/gnu/dts/arm/armada-385-db-ap.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-385-db-ap.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-385-db-ap.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -236,6 +236,7 @@ usb3_phy: usb3_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_xhci0_vbus>; + #phy-cells = <0>; }; reg_xhci0_vbus: xhci0-vbus { Modified: head/sys/gnu/dts/arm/armada-385-linksys.dtsi ============================================================================== --- head/sys/gnu/dts/arm/armada-385-linksys.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-385-linksys.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -66,6 +66,7 @@ usb3_1_phy: usb3_1-phy { compatible = "usb-nop-xceiv"; vcc-supply = <&usb3_1_vbus>; + #phy-cells = <0>; }; usb3_1_vbus: usb3_1-vbus { Modified: head/sys/gnu/dts/arm/armada-385-synology-ds116.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-385-synology-ds116.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-385-synology-ds116.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -191,11 +191,13 @@ usb3_0_phy: usb3_0_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_usb3_0_vbus>; + #phy-cells = <0>; }; usb3_1_phy: usb3_1_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_usb3_1_vbus>; + #phy-cells = <0>; }; reg_usb3_0_vbus: usb3-vbus0 { @@ -267,35 +269,35 @@ * enumerated. The MAC address and the serial number are listed * in the "vendor" partition. */ - partition@00000000 { + partition@0 { label = "RedBoot"; reg = <0x00000000 0x000f0000>; read-only; }; - partition@000c0000 { + partition@c0000 { label = "zImage"; reg = <0x000f0000 0x002d0000>; }; - partition@00390000 { + partition@390000 { label = "rd.gz"; reg = <0x003c0000 0x00410000>; }; - partition@007d0000 { + partition@7d0000 { label = "vendor"; reg = <0x007d0000 0x00010000>; read-only; }; - partition@007e0000 { + partition@7e0000 { label = "RedBoot config"; reg = <0x007e0000 0x00010000>; read-only; }; - partition@007f0000 { + partition@7f0000 { label = "FIS directory"; reg = <0x007f0000 0x00010000>; read-only; Modified: head/sys/gnu/dts/arm/armada-388-gp.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-388-gp.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-388-gp.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -276,11 +276,13 @@ usb2_1_phy: usb2_1_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_usb2_1_vbus>; + #phy-cells = <0>; }; usb3_phy: usb3_phy { compatible = "usb-nop-xceiv"; vcc-supply = <®_usb3_vbus>; + #phy-cells = <0>; }; reg_usb3_vbus: usb3-vbus { Modified: head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts ============================================================================== --- head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/armada-xp-synology-ds414.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -332,32 +332,32 @@ * change the default environment, unless you know * what you are doing. */ - partition@00000000 { /* u-boot */ + partition@0 { /* u-boot */ label = "RedBoot"; reg = <0x00000000 0x000d0000>; /* 832KB */ }; - partition@000c0000 { /* uImage */ + partition@c0000 { /* uImage */ label = "zImage"; reg = <0x000d0000 0x002d0000>; /* 2880KB */ }; - partition@003a0000 { /* uInitramfs */ + partition@3a0000 { /* uInitramfs */ label = "rd.gz"; reg = <0x003a0000 0x00430000>; /* 4250KB */ }; - partition@007d0000 { /* MAC address and serial number */ + partition@7d0000 { /* MAC address and serial number */ label = "vendor"; reg = <0x007d0000 0x00010000>; /* 64KB */ }; - partition@007e0000 { + partition@7e0000 { label = "RedBoot config"; reg = <0x007e0000 0x00010000>; /* 64KB */ }; - partition@007f0000 { + partition@7f0000 { label = "FIS directory"; reg = <0x007f0000 0x00010000>; /* 64KB */ }; Modified: head/sys/gnu/dts/arm/artpec6.dtsi ============================================================================== --- head/sys/gnu/dts/arm/artpec6.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/artpec6.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -151,7 +151,6 @@ interrupts = , ; interrupt-affinity = <&cpu0>, <&cpu1>; - interrupt-parent = <&intc>; }; pcie: pcie@f8050000 { @@ -185,7 +184,6 @@ compatible = "simple-bus"; #address-cells = <0x1>; #size-cells = <0x1>; - interrupt-parent = <&intc>; ranges; dma-ranges = <0x80000000 0x00000000 0x40000000>; dma-coherent; @@ -195,7 +193,6 @@ clocks = <ð_phy_ref_clk>, <&clkctrl ARTPEC6_CLK_ETH_ACLK>; compatible = "snps,dwc-qos-ethernet-4.10"; - interrupt-parent = <&intc>; interrupts = ; reg = <0xf8010000 0x4000>; Modified: head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts ============================================================================== --- head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/aspeed-ast2500-evb.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -60,3 +60,22 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rgmii2_default &pinctrl_mdio2_default>; }; + +&i2c3 { + status = "okay"; + + eeprom@50 { + compatible = "atmel,24c08"; + reg = <0x50>; + pagesize = <16>; + }; +}; + +&i2c7 { + status = "okay"; + + lm75@4d { + compatible = "national,lm75"; + reg = <0x4d>; + }; +}; Modified: head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts ============================================================================== --- head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/aspeed-bmc-opp-palmetto.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -7,10 +7,6 @@ model = "Palmetto BMC"; compatible = "tyan,palmetto-bmc", "aspeed,ast2400"; - aliases { - serial4 = &uart5; - }; - chosen { stdout-path = &uart5; bootargs = "console=ttyS4,115200 earlyprintk"; @@ -61,4 +57,56 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rmii1_default>; +}; + +&i2c0 { + status = "okay"; + + eeprom@50 { + compatible = "atmel,24c256"; + reg = <0x50>; + pagesize = <64>; + }; + + rtc@68 { + compatible = "dallas,ds3231"; + reg = <0x68>; + }; +}; + +&i2c1 { + status = "okay"; +}; + +&i2c2 { + status = "okay"; + + tmp423@4c { + compatible = "ti,tmp423"; + reg = <0x4c>; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + status = "okay"; +}; + +&i2c7 { + status = "okay"; +}; + +&vuart { + status = "okay"; }; Modified: head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts ============================================================================== --- head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts Sat Feb 10 15:29:46 2018 (r329104) @@ -80,3 +80,61 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rmii1_default>; }; + +&i2c2 { + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + /* PCIe slot 1 (x8) */ + status = "okay"; +}; + +&i2c7 { + /* PCIe slot 2 (x16) */ + status = "okay"; +}; + +&i2c8 { + /* PCIe slot 3 (x16) */ + status = "okay"; +}; + +&i2c9 { + /* PCIe slot 4 (x16) */ + status = "okay"; +}; + +&i2c10 { + /* PCIe slot 5 (x8) */ + status = "okay"; +}; + +&i2c11 { + status = "okay"; + + rtc@32 { + compatible = "epson,rx8900"; + reg = <0x32>; + }; +}; + +&i2c12 { + status = "okay"; +}; + +&vuart { + status = "okay"; +}; Modified: head/sys/gnu/dts/arm/aspeed-g4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/aspeed-g4.dtsi Sat Feb 10 15:23:30 2018 (r329103) +++ head/sys/gnu/dts/arm/aspeed-g4.dtsi Sat Feb 10 15:29:46 2018 (r329104) @@ -8,6 +8,29 @@ #size-cells = <1>; interrupt-parent = <&vic>; + aliases { + i2c0 = &i2c0; + i2c1 = &i2c1; + i2c2 = &i2c2; + i2c3 = &i2c3; + i2c4 = &i2c4; + i2c5 = &i2c5; + i2c6 = &i2c6; + i2c7 = &i2c7; + i2c8 = &i2c8; + i2c9 = &i2c9; + i2c10 = &i2c10; + i2c11 = &i2c11; + i2c12 = &i2c12; + i2c13 = &i2c13; + serial0 = &uart1; + serial1 = &uart2; + serial2 = &uart3; + serial3 = &uart4; + serial4 = &uart5; + serial5 = &vuart; + }; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -110,7 +133,7 @@ clock-frequency = <192000000>; }; - clk_apb: clk_apb@08 { + clk_apb: clk_apb@8 { #clock-cells = <0>; compatible = "aspeed,g4-apb-clock", "fixed-clock"; reg = <0x08>; @@ -127,856 +150,1091 @@ pinctrl: pinctrl { compatible = "aspeed,g4-pinctrl"; + }; + }; - pinctrl_acpi_default: acpi_default { - function = "ACPI"; - groups = "ACPI"; - }; + adc: adc@1e6e9000 { + compatible = "aspeed,ast2400-adc"; + reg = <0x1e6e9000 0xb0>; + clocks = <&clk_apb>; + #io-channel-cells = <1>; + status = "disabled"; + }; - pinctrl_adc0_default: adc0_default { - function = "ADC0"; - groups = "ADC0"; - }; + sram@1e720000 { + compatible = "mmio-sram"; + reg = <0x1e720000 0x8000>; // 32K + }; - pinctrl_adc1_default: adc1_default { - function = "ADC1"; - groups = "ADC1"; - }; + gpio: gpio@1e780000 { + #gpio-cells = <2>; + gpio-controller; + compatible = "aspeed,ast2400-gpio"; + reg = <0x1e780000 0x1000>; + interrupts = <20>; + gpio-ranges = <&pinctrl 0 0 220>; + interrupt-controller; + }; - pinctrl_adc10_default: adc10_default { - function = "ADC10"; - groups = "ADC10"; - }; + timer: timer@1e782000 { + /* This timer is a Faraday FTTMR010 derivative */ + compatible = "aspeed,ast2400-timer"; + reg = <0x1e782000 0x90>; + interrupts = <16 17 18 35 36 37 38 39>; + clocks = <&clk_apb>; + clock-names = "PCLK"; + }; - pinctrl_adc11_default: adc11_default { - function = "ADC11"; - groups = "ADC11"; - }; + uart1: serial@1e783000 { + compatible = "ns16550a"; + reg = <0x1e783000 0x20>; + reg-shift = <2>; + interrupts = <9>; + clocks = <&clk_uart>; + no-loopback-test; + status = "disabled"; + }; - pinctrl_adc12_default: adc12_default { - function = "ADC12"; - groups = "ADC12"; - }; + uart5: serial@1e784000 { + compatible = "ns16550a"; + reg = <0x1e784000 0x20>; + reg-shift = <2>; + interrupts = <10>; + clocks = <&clk_uart>; + no-loopback-test; + status = "disabled"; + }; - pinctrl_adc13_default: adc13_default { - function = "ADC13"; - groups = "ADC13"; - }; + wdt1: watchdog@1e785000 { + compatible = "aspeed,ast2400-wdt"; + reg = <0x1e785000 0x1c>; + }; - pinctrl_adc14_default: adc14_default { - function = "ADC14"; - groups = "ADC14"; - }; + wdt2: watchdog@1e785020 { + compatible = "aspeed,ast2400-wdt"; + reg = <0x1e785020 0x1c>; + }; - pinctrl_adc15_default: adc15_default { - function = "ADC15"; - groups = "ADC15"; - }; + vuart: serial@1e787000 { + compatible = "aspeed,ast2400-vuart"; + reg = <0x1e787000 0x40>; + reg-shift = <2>; + interrupts = <8>; + clocks = <&clk_uart>; + no-loopback-test; + status = "disabled"; + }; - pinctrl_adc2_default: adc2_default { - function = "ADC2"; - groups = "ADC2"; - }; + uart2: serial@1e78d000 { + compatible = "ns16550a"; + reg = <0x1e78d000 0x20>; + reg-shift = <2>; + interrupts = <32>; + clocks = <&clk_uart>; + no-loopback-test; + status = "disabled"; + }; - pinctrl_adc3_default: adc3_default { - function = "ADC3"; - groups = "ADC3"; - }; + uart3: serial@1e78e000 { + compatible = "ns16550a"; + reg = <0x1e78e000 0x20>; + reg-shift = <2>; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Feb 10 16:13:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ADEEF07E57; Sat, 10 Feb 2018 16:13:46 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x22e.google.com (mail-lf0-x22e.google.com [IPv6:2a00:1450:4010:c07::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 F1FC4853E7; Sat, 10 Feb 2018 16:13:45 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x22e.google.com with SMTP id g72so15184134lfg.5; Sat, 10 Feb 2018 08:13:45 -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=Hcoh1hgpx7DXrsw4axUsVy8/UiH8uOXXu+gxRTEkhPg=; b=G/1dvoKTwzBKeXSuSLnz8v/9nu17cjf2nyLxaoLKX1CY42+6ig+hXtvFDaeG2z1jZ0 nJILGG5V92M/feOQTXY2E0j3FxniJZc28aaDIONPh8aybJrNlaXJ6q9F83OA/bpYE0Ql MhmHvt48FMFHWTm4dLAWT0l94yHCZDfeoCqVEjAaDzZ01k3BKsX/HiEwAHDhcNCFej+u GP1mHWH1arzOdSfOQuSbIDgC7ExcEk+fzE33RO17nTgcyv763o58FdKQBZI8zOFSz2WE B3VLWoLI2ME1knmEkT8BlYFLVEotQcVi9ZpdyqMaC7aKjhBA7JAWH1Dmj557kFrxyr1n F+bQ== 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=Hcoh1hgpx7DXrsw4axUsVy8/UiH8uOXXu+gxRTEkhPg=; b=lBiLkGM2RgEuCvS0nq4Bg5EEnHMmP07+VkbeKKeOJZdpd2YJukHTZmTY9xhxKG05mr NSJvQaAhv4N3CXldAyfxt2WC6j0xAVdGd2l8duWF+ypgYfBs4Pc/10Msbz0B4HlxjKQI 771Y9bVqySnuh2yoGUYiPzx3cjsf8BDf11ch2oKAjygHY4H6nQs77HGW80gG02Xq6WO2 PzPMe08RxtbigO4bY+xE5is3F+OMXQGdLygq/1IVDPjWvW+i83QVkfqk9lgCnXJ4o0WK 5hGm4/m5rFwjYwYqIuUkIcelROg1SunzKjEyJ8jTOWwYK7nh2aj2RDDnFmT2pZ3ERr4s bjXw== X-Gm-Message-State: APf1xPCJ/VH3WPvLE9V4Mq0wXxmin9kH2zF2vW3T4IO9ElFveaHP/22n ykeJU0uUOWhw0qval3aTm0JAFvUQnou3OM5XlfgqBA== X-Google-Smtp-Source: AH8x226p9cKSIvYyBKp34jIjcpKS12gFfB407FO3QC9d0pUNmORNJxrMf9ZlnGuvMrGeJ63DMZPnl4cQ2c6L+q/hUGQ= X-Received: by 10.46.77.157 with SMTP id c29mr4255034ljd.116.1518279224157; Sat, 10 Feb 2018 08:13:44 -0800 (PST) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.75.1 with HTTP; Sat, 10 Feb 2018 08:13:43 -0800 (PST) In-Reply-To: References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Justin Hibbits Date: Sat, 10 Feb 2018 10:13:43 -0600 X-Google-Sender-Auth: knT5JOVUO_WT8rRIxGH-sYBDCP8 Message-ID: Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Ed Maste Cc: Conrad Meyer , 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.25 Precedence: list List-Id: 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, 10 Feb 2018 16:13:46 -0000 On Fri, Feb 9, 2018 at 7:22 PM, Ed Maste wrote: > On 9 February 2018 at 14:46, Conrad Meyer wrote: >> Author: cem >> Date: Fri Feb 9 19:46:51 2018 >> New Revision: 329077 >> URL: https://svnweb.freebsd.org/changeset/base/329077 >> >> Log: >> tftp(1): Fix libedit state corruption involving signals > > From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: > > 01:15:24 --- all_subdir_usr.bin/tftp --- > 01:15:24 --- main.o --- > 01:15:24 cc1: warnings being treated as errors > 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': > 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used > uninitialized in this function > 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used > uninitialized in this function > After initializing these, I see the following interesting error: /home/chmeee/freebsd/head/usr.bin/tftp/main.c:181: warning: variable 'el' might be clobbered by 'longjmp' or 'vfork' /home/chmeee/freebsd/head/usr.bin/tftp/main.c:182: warning: variable 'hist' might be clobbered by 'longjmp' or 'vfork' This appears to be a known bug in gcc, at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 so I don't know what the best way to fix it is. - Justin From owner-svn-src-head@freebsd.org Sat Feb 10 17:09:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 198BDF0BF59; Sat, 10 Feb 2018 17:09:53 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD8F087913; Sat, 10 Feb 2018 17:09:52 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B87AE16DD9; Sat, 10 Feb 2018 17:09:52 +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 w1AH9qY4009505; Sat, 10 Feb 2018 17:09:52 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AH9quA009499; Sat, 10 Feb 2018 17:09:52 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201802101709.w1AH9quA009499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 10 Feb 2018 17:09:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329105 - head/usr.sbin/ppp X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/ppp X-SVN-Commit-Revision: 329105 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.25 Precedence: list List-Id: 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, 10 Feb 2018 17:09:53 -0000 Author: eugen Date: Sat Feb 10 17:09:51 2018 New Revision: 329105 URL: https://svnweb.freebsd.org/changeset/base/329105 Log: ppp(8): fix code producing debugging logs Fix several cases when long buffer is copied to shorter one using snprintf that results in contents truncation and clobbering unsaved errno value and creation of misleading logs. PR: 218517 Approved by: avg (mentor) MFC after: 1 month Modified: head/usr.sbin/ppp/defs.h head/usr.sbin/ppp/iface.c head/usr.sbin/ppp/ip.c head/usr.sbin/ppp/ipv6cp.c head/usr.sbin/ppp/ncpaddr.c head/usr.sbin/ppp/route.c Modified: head/usr.sbin/ppp/defs.h ============================================================================== --- head/usr.sbin/ppp/defs.h Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/defs.h Sat Feb 10 17:09:51 2018 (r329105) @@ -119,6 +119,8 @@ #define ROUNDUP(x) ((x) ? (1 + (((x) - 1) | (sizeof(long) - 1))) : sizeof(long)) +#define NCP_ASCIIBUFFERSIZE 52 + #ifdef __NetBSD__ extern void randinit(void); #else Modified: head/usr.sbin/ppp/iface.c ============================================================================== --- head/usr.sbin/ppp/iface.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/iface.c Sat Feb 10 17:09:51 2018 (r329105) @@ -209,7 +209,7 @@ iface_addr_Zap(const char *name, struct iface_addr *ad #endif struct sockaddr_in *me4, *msk4, *peer4; struct sockaddr_storage ssme, sspeer, ssmsk; - int res; + int res, saved_errno; ncprange_getsa(&addr->ifa, &ssme, &ssmsk); ncpaddr_getsa(&addr->peer, &sspeer); @@ -235,8 +235,9 @@ iface_addr_Zap(const char *name, struct iface_addr *ad memcpy(peer4, &sspeer, sizeof *peer4); res = ID0ioctl(s, SIOCDIFADDR, &ifra); + saved_errno = errno; if (log_IsKept(LogDEBUG)) { - char buf[100]; + char buf[NCP_ASCIIBUFFERSIZE]; snprintf(buf, sizeof buf, "%s", ncprange_ntoa(&addr->ifa)); log_Printf(LogWARN, "%s: DIFADDR %s -> %s returns %d\n", @@ -260,12 +261,13 @@ iface_addr_Zap(const char *name, struct iface_addr *ad ifra6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; res = ID0ioctl(s, SIOCDIFADDR_IN6, &ifra6); + saved_errno = errno; break; #endif } if (res == -1) { - char dst[40]; + char dst[NCP_ASCIIBUFFERSIZE]; const char *end = #ifndef NOINET6 ncprange_family(&addr->ifa) == AF_INET6 ? "_IN6" : @@ -274,11 +276,11 @@ iface_addr_Zap(const char *name, struct iface_addr *ad if (ncpaddr_family(&addr->peer) == AF_UNSPEC) log_Printf(LogWARN, "iface rm: ioctl(SIOCDIFADDR%s, %s): %s\n", - end, ncprange_ntoa(&addr->ifa), strerror(errno)); + end, ncprange_ntoa(&addr->ifa), strerror(saved_errno)); else { snprintf(dst, sizeof dst, "%s", ncpaddr_ntoa(&addr->peer)); log_Printf(LogWARN, "iface rm: ioctl(SIOCDIFADDR%s, %s -> %s): %s\n", - end, ncprange_ntoa(&addr->ifa), dst, strerror(errno)); + end, ncprange_ntoa(&addr->ifa), dst, strerror(saved_errno)); } } @@ -294,7 +296,7 @@ iface_addr_Add(const char *name, struct iface_addr *ad #endif struct sockaddr_in *me4, *msk4, *peer4; struct sockaddr_storage ssme, sspeer, ssmsk; - int res; + int res, saved_errno; ncprange_getsa(&addr->ifa, &ssme, &ssmsk); ncpaddr_getsa(&addr->peer, &sspeer); @@ -320,8 +322,9 @@ iface_addr_Add(const char *name, struct iface_addr *ad memcpy(peer4, &sspeer, sizeof *peer4); res = ID0ioctl(s, SIOCAIFADDR, &ifra); + saved_errno = errno; if (log_IsKept(LogDEBUG)) { - char buf[100]; + char buf[NCP_ASCIIBUFFERSIZE]; snprintf(buf, sizeof buf, "%s", ncprange_ntoa(&addr->ifa)); log_Printf(LogWARN, "%s: AIFADDR %s -> %s returns %d\n", @@ -345,12 +348,13 @@ iface_addr_Add(const char *name, struct iface_addr *ad ifra6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; res = ID0ioctl(s, SIOCAIFADDR_IN6, &ifra6); + saved_errno = errno; break; #endif } if (res == -1) { - char dst[40]; + char dst[NCP_ASCIIBUFFERSIZE]; const char *end = #ifndef NOINET6 ncprange_family(&addr->ifa) == AF_INET6 ? "_IN6" : @@ -359,11 +363,11 @@ iface_addr_Add(const char *name, struct iface_addr *ad if (ncpaddr_family(&addr->peer) == AF_UNSPEC) log_Printf(LogWARN, "iface add: ioctl(SIOCAIFADDR%s, %s): %s\n", - end, ncprange_ntoa(&addr->ifa), strerror(errno)); + end, ncprange_ntoa(&addr->ifa), strerror(saved_errno)); else { snprintf(dst, sizeof dst, "%s", ncpaddr_ntoa(&addr->peer)); log_Printf(LogWARN, "iface add: ioctl(SIOCAIFADDR%s, %s -> %s): %s\n", - end, ncprange_ntoa(&addr->ifa), dst, strerror(errno)); + end, ncprange_ntoa(&addr->ifa), dst, strerror(saved_errno)); } } Modified: head/usr.sbin/ppp/ip.c ============================================================================== --- head/usr.sbin/ppp/ip.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/ip.c Sat Feb 10 17:09:51 2018 (r329105) @@ -226,7 +226,7 @@ FilterCheck(const unsigned char *packet, int match; /* true if condition matched */ int mindata; /* minimum data size or zero */ const struct filterent *fp = filter->rule; - char dbuff[100], dstip[16]; + char dbuff[100], dstip[NCP_ASCIIBUFFERSIZE]; struct ncpaddr srcaddr, dstaddr; const char *payload; /* IP payload */ int datalen; /* IP datagram length */ Modified: head/usr.sbin/ppp/ipv6cp.c ============================================================================== --- head/usr.sbin/ppp/ipv6cp.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/ipv6cp.c Sat Feb 10 17:09:51 2018 (r329105) @@ -467,7 +467,7 @@ ipv6cp_LayerUp(struct fsm *fp) { /* We're now up */ struct ipv6cp *ipv6cp = fsm2ipv6cp(fp); - char tbuff[40]; + char tbuff[NCP_ASCIIBUFFERSIZE]; log_Printf(LogIPV6CP, "%s: LayerUp.\n", fp->link->name); if (!ipv6cp_InterfaceUp(ipv6cp)) @@ -524,7 +524,7 @@ ipv6cp_LayerDown(struct fsm *fp) /* About to come down */ struct ipv6cp *ipv6cp = fsm2ipv6cp(fp); static int recursing; - char addr[40]; + char addr[NCP_ASCIIBUFFERSIZE]; if (!recursing++) { snprintf(addr, sizeof addr, "%s", ncpaddr_ntoa(&ipv6cp->myaddr)); Modified: head/usr.sbin/ppp/ncpaddr.c ============================================================================== --- head/usr.sbin/ppp/ncpaddr.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/ncpaddr.c Sat Feb 10 17:09:51 2018 (r329105) @@ -78,8 +78,6 @@ #define ncpaddr_ip6addr u.ip6addr #endif -#define NCP_ASCIIBUFFERSIZE 52 - static struct in_addr bits2mask4(int bits) { Modified: head/usr.sbin/ppp/route.c ============================================================================== --- head/usr.sbin/ppp/route.c Sat Feb 10 15:29:46 2018 (r329104) +++ head/usr.sbin/ppp/route.c Sat Feb 10 17:09:51 2018 (r329105) @@ -437,7 +437,7 @@ route_IfDelete(struct bundle *bundle, int all) ) && (all || (rtm->rtm_flags & RTF_GATEWAY))) { if (log_IsKept(LogDEBUG)) { - char gwstr[41]; + char gwstr[NCP_ASCIIBUFFERSIZE]; struct ncpaddr gw; ncprange_setsa(&range, sa[RTAX_DST], sa[RTAX_NETMASK]); ncpaddr_setsa(&gw, sa[RTAX_GATEWAY]); @@ -843,7 +843,7 @@ failed: } if (log_IsKept(LogDEBUG)) { - char gwstr[40]; + char gwstr[NCP_ASCIIBUFFERSIZE]; if (gw) snprintf(gwstr, sizeof gwstr, "%s", ncpaddr_ntoa(gw)); From owner-svn-src-head@freebsd.org Sat Feb 10 17:17:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CB3AF0C9EC; Sat, 10 Feb 2018 17:17:16 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0C5F987F9A; Sat, 10 Feb 2018 17:17:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02BCD16F8C; Sat, 10 Feb 2018 17:17:16 +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 w1AHHF9C014201; Sat, 10 Feb 2018 17:17:15 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AHHFUE014200; Sat, 10 Feb 2018 17:17:15 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201802101717.w1AHHFUE014200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 10 Feb 2018 17:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329106 - head/usr.bin/tftp X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/usr.bin/tftp X-SVN-Commit-Revision: 329106 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.25 Precedence: list List-Id: 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, 10 Feb 2018 17:17:16 -0000 Author: jhibbits Date: Sat Feb 10 17:17:15 2018 New Revision: 329106 URL: https://svnweb.freebsd.org/changeset/base/329106 Log: Fix uninitialized warning, and work around a bug in gcc over clobbering Summary: r329077 caused gcc to emit uninitialized use warnings. Attempting to fix those warnings yielded the following warnings: usr.bin/tftp/main.c: In function 'main': usr.bin/tftp/main.c:181: warning: variable 'el' might be clobbered by 'longjmp' or 'vfork' usr.bin/tftp/main.c:182: warning: variable 'hist' might be clobbered by 'longjmp' or 'vfork' This is a known bug in gcc, found at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 Work around that by simply marking hist and el as static. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14302 Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Sat Feb 10 17:09:51 2018 (r329105) +++ head/usr.bin/tftp/main.c Sat Feb 10 17:17:15 2018 (r329106) @@ -178,8 +178,8 @@ int main(int argc, char *argv[]) { HistEvent he; - EditLine *el; - History *hist; + static EditLine *el; + static History *hist; bool interactive; acting_as_client = 1; From owner-svn-src-head@freebsd.org Sat Feb 10 17:20:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E12B5F0CDF4 for ; Sat, 10 Feb 2018 17:20:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic306-35.consmr.mail.ne1.yahoo.com (sonic306-35.consmr.mail.ne1.yahoo.com [66.163.189.97]) (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 5338B682B1 for ; Sat, 10 Feb 2018 17:20:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1518283222; bh=oMKjtLepHcqC8vc4B719YHHj3pVRaNhbUtknAFbgmCg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=mCcB/9VVWFN7nOz08VZhMQYe/YiEk7xhSOx9zlP8Ml1NPv0p7RmSpqYrUVa4DJG/TwMXPUATC6uPeY1rBRmAftiCS4NtTzfOW0ZuldvkyFYgaevFyV5ewwAqvpeWh4r5x3Mod2OG/7bFbf103Y6YoCYXSeId4ZRvkDejOSbIRme4mNFM0Rbhx+Fiip5UEluNgBWwJ2FQuURoTjc1JDzR7djTbbIRGUlpsavJiSBd3/KdhGVdCnO7RVdAXqlRmzPsi4MOysEDAc0l+HMsd5Bdin2VKp7IIRsQkCl5VRkm0nAJyjjATDO8KwlxFPI3hbtOFodm6al5rE7tzCjsa6kfUA== X-YMail-OSG: tN2pZSQVM1m2bC5l.6aDmYbW2FT2NaEsG7M06gjKGtCao6R.cbZH6w1C5HyYY5N F822zP3v_4BgaCypKDAZqJ3MkomGJZkaELYIKwgKiBjJoYFn1lYyCrwn_eyXIeC5od2I26yIKp87 IyMca6kssQF7JF2oAFHSQiKo1kjZh2Kfgkpj2ZVxtPe0bqPjFdlex8C8JBqxp5fTuVNxjAL4nOde .NwW6GKSl63vlEYl5vPVDd78sNsvcgU0U7MqutzFxi4_ieMz5gMyb9YQcKcq_6inTHpXB9pXbKGs E6GmYvDaJt2qmLvRqo6X2sdyFwMA2m5Qi9yzsfrY_OEk4Pz02dICWCmFVqu9YeGvpk2giiyS6DyA aIccKYoZA9hCNrG9F1SN9tYjxWnNWa7kFGg4lZcNheTdPthQ8z8v46X0AuRX1Mwgyx2xfrMWRtcC ODhHCuAiWpKbLbLq..LJZB1tNtSW.A6cDg_t6j41xah4DTLX2vD8b9u2m9raRj_Ks7N6WKLUuyJO T0JvPF9GWKA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Sat, 10 Feb 2018 17:20:22 +0000 Received: from smtp235.mail.ne1.yahoo.com (EHLO [192.168.0.8]) ([10.218.253.206]) by smtp403.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 9883850e26d98faa04ee84187afca94c; Sat, 10 Feb 2018 17:10:14 +0000 (UTC) Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Justin Hibbits , Ed Maste Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Pedro Giffuni Message-ID: Date: Sat, 10 Feb 2018 12:10:11 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------C66CCBE0737B54B1E4A9245D" Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 10 Feb 2018 17:20:31 -0000 This is a multi-part message in MIME format. --------------C66CCBE0737B54B1E4A9245D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 02/10/18 11:13, Justin Hibbits wrote: > On Fri, Feb 9, 2018 at 7:22 PM, Ed Maste wrote: >> On 9 February 2018 at 14:46, Conrad Meyer wrote: >>> Author: cem >>> Date: Fri Feb 9 19:46:51 2018 >>> New Revision: 329077 >>> URL: https://svnweb.freebsd.org/changeset/base/329077 >>> >>> Log: >>> tftp(1): Fix libedit state corruption involving signals >> From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: >> >> 01:15:24 --- all_subdir_usr.bin/tftp --- >> 01:15:24 --- main.o --- >> 01:15:24 cc1: warnings being treated as errors >> 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': >> 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used >> uninitialized in this function >> 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used >> uninitialized in this function >> > After initializing these, I see the following interesting error: > > /home/chmeee/freebsd/head/usr.bin/tftp/main.c:181: warning: variable > 'el' might be clobbered by 'longjmp' or 'vfork' > /home/chmeee/freebsd/head/usr.bin/tftp/main.c:182: warning: variable > 'hist' might be clobbered by 'longjmp' or 'vfork' > > This appears to be a known bug in gcc, at > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 so I don't know > what the best way to fix it is. Independent of the compiler bug, it does seem like 'el' and 'hist' can be used uninitialized for the non-interactive case. Untested, but perhaps an only-when-needed initialization like this may workaround the compiler bug. Cheers, Pedro. --------------C66CCBE0737B54B1E4A9245D Content-Type: text/x-patch; name="tftp-gcc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tftp-gcc.diff" Index: usr.bin/tftp/main.c =================================================================== --- usr.bin/tftp/main.c (revision 329104) +++ usr.bin/tftp/main.c (working copy) @@ -197,6 +197,9 @@ el_set(el, EL_PROMPT, command_prompt); el_set(el, EL_SIGNAL, 1); el_source(el, NULL); + } else { /* Quell GCC */ + el = NULL; + hist = NULL; } if (argc > 1) { --------------C66CCBE0737B54B1E4A9245D-- From owner-svn-src-head@freebsd.org Sat Feb 10 17:42:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64B6F0E7B7; Sat, 10 Feb 2018 17:42:11 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::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 0E55D692CA; Sat, 10 Feb 2018 17:42:11 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-lf0-x233.google.com with SMTP id a204so15349049lfa.2; Sat, 10 Feb 2018 09:42:10 -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=O96WKeAmPvWkZgiUHMqiPP5VfcGo75PPpCLpP7INs/w=; b=AgPRnLSVyYN2bgW+IDT/mfUjDBE00eK8+XX8oFDuUNpSAZpDi1lcEOWgdScedr9Q51 3RjtfHaDpsMDRZxAIyZghlRyUPX7wkJt0bEry0bNlRCxm3ZleEMvqcTgJ7E72lVZKWyn qHmQnHLXkuKliIG/RVA4xFoNbvpJpxOLLHF1yHrJMT6dptnYNysx3bMCb6+YBJspwIhp KwDfV1gWqdm6MzujdJD6VeTOt5692sqeV6AMyfinuV6ZahTMnf0JYgf89eUbSkWreifv q7pI9mp24vSdGjL9I2IdFDiVRmKLKQEPkqRbOovgqCk0ppsOMdUrRJ7fiB+FPZ2eN+ep 8QbA== 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=O96WKeAmPvWkZgiUHMqiPP5VfcGo75PPpCLpP7INs/w=; b=tjVIctAnDefoO2LGO3Ps9M9s4hVLP+xNYcL3m3rlJW56225xojhtGNzFYh2rVeZ0Rv UAZZuETbvzndOyeVK4eYk2yh7eK9NGkwVQXAecz56a/h2uTJWJyFsUAv8P+MTcQ3NqYU nRIpXtaYbCL6ZVEYOVYDtHclxEYZNvxym0Y9PR1V2OM5zugYS0v59DgpuOirxjXWj6KY yJXricZ6yoOaokU172SpDOiJ1J0dyWTyONErch0Z5JWUD5ML4cD9F/vqFJxMCkIbu6Vm LnfkrIeY6osB8cwof2oEgXlrvDCDMXC8TS1aUIRRH+sN0V8Lkp7W4HhbhN9/sMDAMi18 VVOQ== X-Gm-Message-State: APf1xPCjsZkXOlo1F6ujwrJhYwzBNvsPmH+f1QqmVM3Jkn2TCDRclhOr 89PxIlFEO0ttbC3yNCB9QYIOkVWDZrn9mL1SN0I= X-Google-Smtp-Source: AH8x224MEUIUoxpWi0nJ4ZBTZcvKPRifrbJ5vEJ6uPCr9RNfmaz0BvbK0K+fdZxIs9X9vNEl0dEsUHfiGx9N+LBfEUY= X-Received: by 10.25.56.86 with SMTP id d22mr4565870lfj.46.1518284529283; Sat, 10 Feb 2018 09:42:09 -0800 (PST) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.46.75.1 with HTTP; Sat, 10 Feb 2018 09:42:08 -0800 (PST) In-Reply-To: References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Justin Hibbits Date: Sat, 10 Feb 2018 11:42:08 -0600 X-Google-Sender-Auth: nF_3a87PGcSK3NicVobnK0G_nNA Message-ID: Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Pedro Giffuni Cc: Ed Maste , Conrad Meyer , 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.25 Precedence: list List-Id: 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, 10 Feb 2018 17:42:12 -0000 On Sat, Feb 10, 2018 at 11:10 AM, Pedro Giffuni wrote: > > > On 02/10/18 11:13, Justin Hibbits wrote: >> >> On Fri, Feb 9, 2018 at 7:22 PM, Ed Maste wrote: >>> >>> On 9 February 2018 at 14:46, Conrad Meyer wrote: >>>> >>>> Author: cem >>>> Date: Fri Feb 9 19:46:51 2018 >>>> New Revision: 329077 >>>> URL: https://svnweb.freebsd.org/changeset/base/329077 >>>> >>>> Log: >>>> tftp(1): Fix libedit state corruption involving signals >>> >>> From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: >>> >>> 01:15:24 --- all_subdir_usr.bin/tftp --- >>> 01:15:24 --- main.o --- >>> 01:15:24 cc1: warnings being treated as errors >>> 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': >>> 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used >>> uninitialized in this function >>> 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used >>> uninitialized in this function >>> >> After initializing these, I see the following interesting error: >> >> /home/chmeee/freebsd/head/usr.bin/tftp/main.c:181: warning: variable >> 'el' might be clobbered by 'longjmp' or 'vfork' >> /home/chmeee/freebsd/head/usr.bin/tftp/main.c:182: warning: variable >> 'hist' might be clobbered by 'longjmp' or 'vfork' >> >> This appears to be a known bug in gcc, at >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 so I don't know >> what the best way to fix it is. > > > Independent of the compiler bug, it does seem like 'el' and 'hist' can be > used uninitialized for the non-interactive case. > > Untested, but perhaps an only-when-needed initialization like this may > workaround the compiler bug. > > Cheers, > > Pedro. Nope, I tried that as well, and hit the compiler bug. r329106 works around both. - Justin From owner-svn-src-head@freebsd.org Sat Feb 10 19:41:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 465E3F17E33; Sat, 10 Feb 2018 19:41:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E86DE6E458; Sat, 10 Feb 2018 19:41:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E351A187E9; Sat, 10 Feb 2018 19:41:32 +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 w1AJfWtY084728; Sat, 10 Feb 2018 19:41:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AJfWHR084727; Sat, 10 Feb 2018 19:41:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802101941.w1AJfWHR084727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Feb 2018 19:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329107 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 329107 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.25 Precedence: list List-Id: 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, 10 Feb 2018 19:41:33 -0000 Author: cem Date: Sat Feb 10 19:41:32 2018 New Revision: 329107 URL: https://svnweb.freebsd.org/changeset/base/329107 Log: socketpair.2: Reference relevant POSIX standards Sponsored by: Dell EMC Isilon Modified: head/lib/libc/sys/socketpair.2 Modified: head/lib/libc/sys/socketpair.2 ============================================================================== --- head/lib/libc/sys/socketpair.2 Sat Feb 10 17:17:15 2018 (r329106) +++ head/lib/libc/sys/socketpair.2 Sat Feb 10 19:41:32 2018 (r329107) @@ -28,7 +28,7 @@ .\" @(#)socketpair.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 4, 2015 +.Dd February 10, 2018 .Dt SOCKETPAIR 2 .Os .Sh NAME @@ -89,6 +89,13 @@ process address space. .Xr read 2 , .Xr socket 2 , .Xr write 2 +.Sh STANDARDS +The +.Fn socketpair +system call conforms to +.St -p1003.1-2001 +and +.St -p1003.1-2008 . .Sh HISTORY The .Fn socketpair From owner-svn-src-head@freebsd.org Sat Feb 10 19:42:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D816FF17F53; Sat, 10 Feb 2018 19:42:13 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) (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 98D746E643; Sat, 10 Feb 2018 19:42:13 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f173.google.com with SMTP id p188so13343422ioe.12; Sat, 10 Feb 2018 11:42:13 -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=Hlcr5AqjqT1O1hY2Hzck6O2mvwZIilpnczPHjPqtniI=; b=CLWxH3/0mne9d3NisYeo9ynIKdl4GBFuhQrsdN+0S0e0DDswC+dq19LqeB9I97jDyv Sm4c40KB0mzYKS/41M/YVcuaXBfus+jtsuUJX/nHMXqlLZf0UumXNmtM8aVY1mOrItPw fK/mKKeXidb6MaY7GjeKvCzlZ6NumBYlJLc1kAIsie4JMuGakIlhNMot1OvOnmND8wo8 IPFdbAXarPTCqDqxTb6yLY7QosCZAVrLoMcODJinCkcVmkYOkf69Okvnd/YWMH8zN4m2 ryu2jwdfcNfQdV8hW0CpMM7HHDNzXMIFWhmxaOjVvvXZZcVEx2UJWuE8/C/Nf6291VAg 9YPQ== X-Gm-Message-State: APf1xPDJC0P+1PnKCKZNTOXJ0KGQ3Ms/rgRjpeU0X8+cEsDcBkR/9ZMu Y9i/UdnKyl7Yt3iK22STuHW4vZ0/ X-Google-Smtp-Source: AH8x2252YrLoh3eM74yFQdDEsm4RxbF927YpghKqM1HDZ+m1n0yD/OQxpVZw56JHrTeQbyzpotTTWQ== X-Received: by 10.107.4.133 with SMTP id 127mr7688333ioe.209.1518290478015; Sat, 10 Feb 2018 11:21:18 -0800 (PST) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com. [209.85.223.175]) by smtp.gmail.com with ESMTPSA id n73sm6903856ioi.84.2018.02.10.11.21.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 11:21:17 -0800 (PST) Received: by mail-io0-f175.google.com with SMTP id k80so1960292ioe.13; Sat, 10 Feb 2018 11:21:17 -0800 (PST) X-Received: by 10.107.15.8 with SMTP id x8mr3039896ioi.38.1518290477520; Sat, 10 Feb 2018 11:21:17 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.152.123 with HTTP; Sat, 10 Feb 2018 11:21:17 -0800 (PST) In-Reply-To: References: <201802091946.w19Jkqb3038864@repo.freebsd.org> From: Conrad Meyer Date: Sat, 10 Feb 2018 11:21:17 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329077 - head/usr.bin/tftp To: Pedro Giffuni Cc: Justin Hibbits , Ed Maste , 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.25 Precedence: list List-Id: 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, 10 Feb 2018 19:42:14 -0000 Nah, both sets of warnings are spurious. The first set is arguably not a compiler bug, just lack of omniscience. The variables are never actually used uninitialized in the !interactive case. The second set is pure bug. Justin found the workaround (same as before this change) and has applied it. Thanks, Justin. Best, Conrad On Sat, Feb 10, 2018 at 9:10 AM, Pedro Giffuni wrote: > > > On 02/10/18 11:13, Justin Hibbits wrote: >> >> On Fri, Feb 9, 2018 at 7:22 PM, Ed Maste wrote: >>> >>> On 9 February 2018 at 14:46, Conrad Meyer wrote: >>>> >>>> Author: cem >>>> Date: Fri Feb 9 19:46:51 2018 >>>> New Revision: 329077 >>>> URL: https://svnweb.freebsd.org/changeset/base/329077 >>>> >>>> Log: >>>> tftp(1): Fix libedit state corruption involving signals >>> >>> From https://ci.freebsd.org/job/FreeBSD-head-mips-build/391/console: >>> >>> 01:15:24 --- all_subdir_usr.bin/tftp --- >>> 01:15:24 --- main.o --- >>> 01:15:24 cc1: warnings being treated as errors >>> 01:15:24 /usr/src/usr.bin/tftp/main.c: In function 'main': >>> 01:15:24 /usr/src/usr.bin/tftp/main.c:182: warning: 'hist' may be used >>> uninitialized in this function >>> 01:15:24 /usr/src/usr.bin/tftp/main.c:181: warning: 'el' may be used >>> uninitialized in this function >>> >> After initializing these, I see the following interesting error: >> >> /home/chmeee/freebsd/head/usr.bin/tftp/main.c:181: warning: variable >> 'el' might be clobbered by 'longjmp' or 'vfork' >> /home/chmeee/freebsd/head/usr.bin/tftp/main.c:182: warning: variable >> 'hist' might be clobbered by 'longjmp' or 'vfork' >> >> This appears to be a known bug in gcc, at >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24239 so I don't know >> what the best way to fix it is. > > > Independent of the compiler bug, it does seem like 'el' and 'hist' can be > used uninitialized for the non-interactive case. > > Untested, but perhaps an only-when-needed initialization like this may > workaround the compiler bug. > > Cheers, > > Pedro. From owner-svn-src-head@freebsd.org Sat Feb 10 19:43:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 182AFF18113; Sat, 10 Feb 2018 19:43:53 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF7D26E83B; Sat, 10 Feb 2018 19:43:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA59518838; Sat, 10 Feb 2018 19:43:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1AJhqxO088797; Sat, 10 Feb 2018 19:43:52 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AJhq7T088796; Sat, 10 Feb 2018 19:43:52 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201802101943.w1AJhq7T088796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 10 Feb 2018 19:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329108 - in head: contrib/netbsd-tests/lib/libc/sys tools/regression/sockets/socketpair X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: contrib/netbsd-tests/lib/libc/sys tools/regression/sockets/socketpair X-SVN-Commit-Revision: 329108 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.25 Precedence: list List-Id: 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, 10 Feb 2018 19:43:53 -0000 Author: asomers Date: Sat Feb 10 19:43:52 2018 New Revision: 329108 URL: https://svnweb.freebsd.org/changeset/base/329108 Log: Convert tools/regression/sockets/socketpair to ATF Reviewed by: cem MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14305 Deleted: head/tools/regression/sockets/socketpair/ Modified: head/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c Modified: head/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c Sat Feb 10 19:41:32 2018 (r329107) +++ head/contrib/netbsd-tests/lib/libc/sys/t_socketpair.c Sat Feb 10 19:43:52 2018 (r329108) @@ -56,7 +56,7 @@ connected(int fd) } static void -run(int flags) +run(int domain, int type, int flags) { int fd[2], i; @@ -69,7 +69,7 @@ run(int flags) ATF_REQUIRE(closefrom(3) != -1); #endif - ATF_REQUIRE(socketpair(AF_UNIX, SOCK_DGRAM | flags, 0, fd) == 0); + ATF_REQUIRE(socketpair(domain, type | flags, 0, fd) == 0); ATF_REQUIRE(fd[0] == 3); ATF_REQUIRE(fd[1] == 4); @@ -97,6 +97,42 @@ run(int flags) ATF_REQUIRE(close(fd[1]) != -1); } +ATF_TC(inet); +ATF_TC_HEAD(inet, tc) +{ + atf_tc_set_md_var(tc, "descr", + "socketpair(2) does not work in the PF_INET domain"); +} + +ATF_TC_BODY(inet, tc) +{ + int fd[2]; + + ATF_REQUIRE_EQ(socketpair(PF_INET, SOCK_DGRAM, 0, fd), -1); + ATF_REQUIRE_EQ(EOPNOTSUPP, errno); + ATF_REQUIRE_EQ(socketpair(PF_INET, SOCK_STREAM, 0, fd), -1); + ATF_REQUIRE_EQ(EOPNOTSUPP, errno); +} + +ATF_TC(null_sv); +ATF_TC_HEAD(null_sv, tc) +{ + atf_tc_set_md_var(tc, "descr", + "socketpair(2) should fail without return storage"); +} + +ATF_TC_BODY(null_sv, tc) +{ + int fd; + + closefrom(3); + ATF_REQUIRE_EQ(socketpair(AF_UNIX, SOCK_DGRAM, 0, NULL), -1); + ATF_REQUIRE_EQ(EFAULT, errno); + fd = open("/", O_RDONLY); + ATF_REQUIRE_EQ_MSG(fd, 3, + "socketpair(..., NULL) allocated descriptors"); +} + ATF_TC(socketpair_basic); ATF_TC_HEAD(socketpair_basic, tc) { @@ -105,7 +141,7 @@ ATF_TC_HEAD(socketpair_basic, tc) ATF_TC_BODY(socketpair_basic, tc) { - run(0); + run(AF_UNIX, SOCK_DGRAM, 0); } ATF_TC(socketpair_nonblock); @@ -116,7 +152,7 @@ ATF_TC_HEAD(socketpair_nonblock, tc) ATF_TC_BODY(socketpair_nonblock, tc) { - run(SOCK_NONBLOCK); + run(AF_UNIX, SOCK_DGRAM, SOCK_NONBLOCK); } ATF_TC(socketpair_cloexec); @@ -127,15 +163,29 @@ ATF_TC_HEAD(socketpair_cloexec, tc) ATF_TC_BODY(socketpair_cloexec, tc) { - run(SOCK_CLOEXEC); + run(AF_UNIX, SOCK_DGRAM, SOCK_CLOEXEC); } +ATF_TC(socketpair_stream); +ATF_TC_HEAD(socketpair_stream, tc) +{ + atf_tc_set_md_var(tc, "descr", "A stream-oriented socketpair(2)"); +} + +ATF_TC_BODY(socketpair_stream, tc) +{ + run(AF_UNIX, SOCK_STREAM, 0); +} + ATF_TP_ADD_TCS(tp) { + ATF_TP_ADD_TC(tp, inet); + ATF_TP_ADD_TC(tp, null_sv); ATF_TP_ADD_TC(tp, socketpair_basic); ATF_TP_ADD_TC(tp, socketpair_nonblock); ATF_TP_ADD_TC(tp, socketpair_cloexec); + ATF_TP_ADD_TC(tp, socketpair_stream); return atf_no_error(); } From owner-svn-src-head@freebsd.org Sat Feb 10 20:34:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39FCDF1C092; Sat, 10 Feb 2018 20:34:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E19EA7130C; Sat, 10 Feb 2018 20:34:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C245A19061; Sat, 10 Feb 2018 20:34:09 +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 w1AKY9fr015136; Sat, 10 Feb 2018 20:34:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1AKY9IP015134; Sat, 10 Feb 2018 20:34:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201802102034.w1AKY9IP015134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Feb 2018 20:34:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329109 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 329109 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.25 Precedence: list List-Id: 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, 10 Feb 2018 20:34:10 -0000 Author: cem Date: Sat Feb 10 20:34:09 2018 New Revision: 329109 URL: https://svnweb.freebsd.org/changeset/base/329109 Log: Document syscall_helper_register(9), syscall_helper_unregister(9) Added: head/share/man/man9/syscall_helper_register.9 (contents, props changed) Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Feb 10 19:43:52 2018 (r329108) +++ head/share/man/man9/Makefile Sat Feb 10 20:34:09 2018 (r329109) @@ -285,6 +285,7 @@ MAN= accept_filter.9 \ style.9 \ swi.9 \ sx.9 \ + syscall_helper_register.9 \ SYSCALL_MODULE.9 \ sysctl.9 \ sysctl_add_oid.9 \ @@ -1921,6 +1922,11 @@ MLINKS+=sx.9 sx_assert.9 \ sx.9 sx_xlock_sig.9 \ sx.9 sx_xlocked.9 \ sx.9 sx_xunlock.9 +MLINKS+=syscall_helper_register.9 syscall_helper_unregister.9 \ + syscall_helper_register.9 SYSCALL_INIT_HELPER.9 \ + syscall_helper_register.9 SYSCALL_INIT_HELPER_COMPAT.9 \ + syscall_helper_register.9 SYSCALL_INIT_HELPER_COMPAT_F.9 \ + syscall_helper_register.9 SYSCALL_INIT_HELPER_F.9 MLINKS+=sysctl.9 SYSCTL_DECL.9 \ sysctl.9 SYSCTL_ADD_INT.9 \ sysctl.9 SYSCTL_ADD_LONG.9 \ Added: head/share/man/man9/syscall_helper_register.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/syscall_helper_register.9 Sat Feb 10 20:34:09 2018 (r329109) @@ -0,0 +1,139 @@ +.\" Copyright (c) 2018 Conrad Meyer +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 10, 2018 +.Dt SYSCALL_HELPER_REGISTER 9 +.Os +.Sh NAME +.Nm syscall_helper_register , +.Nm syscall_helper_unregister +.Nd kernel syscall registration routines +.\" +.Sh SYNOPSIS +.In sys/sysent.h +.Ft int +.Fn syscall_helper_register "struct syscall_helper_data *sd" "int flags" +.Ft int +.Fn syscall_helper_unregister "struct syscall_helper_data *sd" +.\" +.Ss INITIALIZER MACROS +.Ft struct syscall_helper_data +.Fn SYSCALL_INIT_HELPER "syscallname" +.Ft struct syscall_helper_data +.Fn SYSCALL_INIT_HELPER_F "syscallname" "int flags" +.\" +.Ss COMPATIBILITY INITIALIZER MACROS +.Ft struct syscall_helper_data +.Fn SYSCALL_INIT_HELPER_COMPAT "syscallname" +.Ft struct syscall_helper_data +.Fn SYSCALL_INIT_HELPER_COMPAT_F "syscallname" "int flags" +.\" +.Sh DESCRIPTION +The +.Fn syscall_helper_register +registers a system call. +This function takes the structure +.Va struct syscall_helper_data sd , +which specifies the parameters for syscall registration: +.Pp +.Bd -literal -offset indent -compact +struct syscall_helper_data { + struct sysent new_sysent; + struct sysent old_sysent; + int syscall_no; + int registered; +}; +.Ed +.Pp +The only valid flag for the +.Fa flags +argument to +.Fn syscall_helper_register +is +.Dv SY_THR_STATIC . +This flag prevents the syscall from being unregistered. +.\" +.Pp +Before use, the structure must be initialized with one of the +.Fn SYSCALL_INIT_HELPER* +macros. +In new code, syscall implementation functions shall be named +.Fn sys_syscallname +and the regular macros shall be used. +.Pp +For legacy syscall functions named without "sys_" prefixes, the "COMPAT" +versions of the macros may be used. +.Pp +The only valid flag for the +.Fa flags +argument to the "F" variants of the initializer macros is +.Dv SYF_CAPENABLED . +This flag indicates that the syscall is allowed in capability mode. +.Pp +The +.Fn syscall_helper_unregister +unregisters a system call. +This function takes the same structure +.Va struct syscall_helper_data sd +that was previously initialized in the manner described above and used in a +successful invocation of +.Fn syscall_helper_register . +.\" +.Sh RETURN VALUES +If successful, +.Fn syscall_helper_register +and +.Fn syscall_helper_unregister +will return 0. +Otherwise, they will return an error. +.\" +.Sh ERRORS +The +.Fn syscall_helper_register +call will fail and the syscall will not be registered if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa flags +argument contained a value other than +.Dv SY_THR_STATIC . +.It Bq Er EINVAL +The specified syscall number, +.Dv sd.syscall_no +.Dv ( SYS_syscallname ) , +was outside of the valid range of system call numbers (zero through +.Dv SYS_MAXSYSCALL ) . +.It Bq Er ENFILE +The system call table does not have any available slots. +.It Bq Er EEXIST +The specified syscall number, +.Dv sd.syscall_no +.Dv ( SYS_syscallname ) , +was already in use. +.El +.\" +.Sh SEE ALSO +.Xr SYSCALL_MODULE 9