From owner-svn-src-head@freebsd.org Sun Mar 4 00:13: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 2D23FF48D6F; Sun, 4 Mar 2018 00:13:49 +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 901037E9E8; Sun, 4 Mar 2018 00:13:48 +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 w240DXbT040295 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 4 Mar 2018 02:13:36 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w240DXbT040295 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w240DXp6040294; Sun, 4 Mar 2018 02:13:33 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 4 Mar 2018 02:13:33 +0200 From: Konstantin Belousov To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330362 - head/share/man/man9 Message-ID: <20180304001333.GJ3194@kib.kiev.ua> References: <201803032308.w23N8nAV013138@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201803032308.w23N8nAV013138@repo.freebsd.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 Mar 2018 00:13:49 -0000 On Sat, Mar 03, 2018 at 11:08:49PM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Sat Mar 3 23:08:49 2018 > New Revision: 330362 > URL: https://svnweb.freebsd.org/changeset/base/330362 > > Log: > Document pause_sig(9) and update prototypes for existing pause(9) and > pause_sbt(9) functions. > > MFC after: 1 week > Suggested by: cem@ > Sponsored by: Mellanox Technologies > > Modified: > head/share/man/man9/Makefile > head/share/man/man9/sleep.9 > > Modified: head/share/man/man9/Makefile > ============================================================================== > --- head/share/man/man9/Makefile Sat Mar 3 22:28:20 2018 (r330361) > +++ head/share/man/man9/Makefile Sat Mar 3 23:08:49 2018 (r330362) > @@ -1830,6 +1830,7 @@ MLINKS+=sleep.9 msleep.9 \ > sleep.9 msleep_spin.9 \ > sleep.9 msleep_spin_sbt.9 \ > sleep.9 pause.9 \ > + sleep.9 pause_sig.9 \ > sleep.9 pause_sbt.9 \ > sleep.9 tsleep.9 \ > sleep.9 tsleep_sbt.9 \ > > Modified: head/share/man/man9/sleep.9 > ============================================================================== > --- head/share/man/man9/sleep.9 Sat Mar 3 22:28:20 2018 (r330361) > +++ head/share/man/man9/sleep.9 Sat Mar 3 23:08:49 2018 (r330362) > @@ -25,7 +25,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd May 24, 2015 > +.Dd March 4, 2018 > .Dt SLEEP 9 > .Os > .Sh NAME > @@ -34,6 +34,7 @@ > .Nm msleep_spin , > .Nm msleep_spin_sbt , > .Nm pause , > +.Nm pause_sig , > .Nm pause_sbt , pause_sbt is before pause_sig alphabetically. This note is applicable for all insertions of the pause_sig name in the man page. > .Nm tsleep , > .Nm tsleep_sbt , > @@ -53,9 +54,11 @@ > .Ft int > .Fn msleep_spin_sbt "void *chan" "struct mtx *mtx" "const char *wmesg" \ > "sbintime_t sbt" "sbintime_t pr" "int flags" > -.Ft void > +.Ft int > .Fn pause "const char *wmesg" "int timo" > -.Ft void > +.Ft int > +.Fn pause_sig "const char *wmesg" "int timo" > +.Ft int > .Fn pause_sbt "const char *wmesg" "sbintime_t sbt" "sbintime_t pr" \ > "int flags" > .Ft int > @@ -73,6 +76,8 @@ The functions > .Fn msleep , > .Fn msleep_spin , > .Fn pause , > +.Fn pause_sig , > +.Fn pause_sbt , > .Fn wakeup , > and > .Fn wakeup_one > @@ -82,8 +87,10 @@ external event, it is put to sleep by > .Fn tsleep , > .Fn msleep , > .Fn msleep_spin , > +.Fn pause , > +.Fn pause_sig , > or > -.Fn pause . > +.Fn pause_sbt . > Threads may also wait using one of the locking primitive sleep routines > .Xr mtx_sleep 9 , > .Xr rw_sleep 9 , > @@ -248,6 +255,11 @@ The thread can not be awakened early by signals or cal > .Fn wakeup > or > .Fn wakeup_one . > +The > +.Fn pause_sig > +function is a variant of > +.Fn pause > +which can be awakened early by signals. It would be useful to mention that pause_sbt(9) provides the same feature by using a flag. > .Pp > The > .Fn wakeup_one > @@ -385,6 +397,10 @@ The > .Fn pause > function appeared in > .Fx 7.0 . > +The > +.Fn pause_sig > +function appeared in > +.Fx 12.0 . > .Sh AUTHORS > .An -nosplit > This manual page was written by From owner-svn-src-head@freebsd.org Sun Mar 4 01:25: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 0CC27F291F8 for ; Sun, 4 Mar 2018 01:25:23 +0000 (UTC) (envelope-from 01000161ee9cea0c-d2eb273c-d586-4a7e-9ba9-53a67b0a95c4-000000@amazonses.com) Received: from a8-52.smtp-out.amazonses.com (a8-52.smtp-out.amazonses.com [54.240.8.52]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A83028114A for ; Sun, 4 Mar 2018 01:25:22 +0000 (UTC) (envelope-from 01000161ee9cea0c-d2eb273c-d586-4a7e-9ba9-53a67b0a95c4-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=dqtolf56kk3wpt62c3jnwboqvr7iedax; d=tarsnap.com; t=1520126716; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=a87Q0j1WL+QrUND38MtDRDE8tD6W7SQOC5+2LJaobNo=; b=XXCR3qZH0vweYspdZA1VkBQEoe54hJVuhL93DF6djSXa3UyRhDqDQxJEetiHN4qo 6KkA9vBnsa6Y5pxFVuogq/VecuC04df4xqN6SOKV/bSFwg39E5b9qpMsD5OsnsePn9g ocklF5X8nMx+4drI7kmlvnEo9BJybNWuM4DRSJOU= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1520126716; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=a87Q0j1WL+QrUND38MtDRDE8tD6W7SQOC5+2LJaobNo=; b=brXiak65RztfEdoSl5tdZR/VTSYE1KLaFYVPjv1mPV4Cb8zK2VaLByw2y/l+pVW9 ROSxr7a/Fvvk9D6a37NiBiqUioulPaIIL9PLU5YlQxY5/IyAD0cggR1Rg+zfHFJOcXF yBr35AY5XcLBByoNjhHletBhBnFsljAYh7hdvq7I= Subject: Re: svn commit: r330236 - head/sys/compat/linuxkpi/common/src To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803011031.w21AVpNU076475@repo.freebsd.org> From: Colin Percival Message-ID: <01000161ee9cea0c-d2eb273c-d586-4a7e-9ba9-53a67b0a95c4-000000@email.amazonses.com> Date: Sun, 4 Mar 2018 01:25:16 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <201803011031.w21AVpNU076475@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2018.03.04-54.240.8.52 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES 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 Mar 2018 01:25:23 -0000 On 03/01/18 02:31, Hans Petter Selasky wrote: > New Revision: 330236 > Correct the return value from flush_work() and flush_delayed_work() in the > LinuxKPI to comply more with Linux. This fixes an issue when these functions > are used in waiting loops. > > MFC after: 1 week > Sponsored by: Mellanox Technologies In case the data point is useful: Merging this to stable/11 unbroke S3 suspend/resume on my laptop (system76 Galago Pro, kabylake, using the drm-next-kmod port). -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Sun Mar 4 01:37: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 EEE97F2A229; Sun, 4 Mar 2018 01:37:49 +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 A0E3E81935; Sun, 4 Mar 2018 01:37:49 +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 9BE8969B8; Sun, 4 Mar 2018 01:37:49 +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 w241bnek087832; Sun, 4 Mar 2018 01:37:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w241bnMN087831; Sun, 4 Mar 2018 01:37:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803040137.w241bnMN087831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 4 Mar 2018 01:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330366 - head/gnu/usr.bin/binutils/ld X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/gnu/usr.bin/binutils/ld X-SVN-Commit-Revision: 330366 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:37:50 -0000 Author: emaste Date: Sun Mar 4 01:37:49 2018 New Revision: 330366 URL: https://svnweb.freebsd.org/changeset/base/330366 Log: When lld is ld, install bfd's man page as ld.bfd.1 When WITH_LLD_IS_LD is set, lld's man page is installed as ld.1.gz, as was GNU BFD's man page prior to this change. Reported by: Tobias Kortkamp Sponsored by: The FreeBSD Foundation Modified: head/gnu/usr.bin/binutils/ld/Makefile Modified: head/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile Sat Mar 3 23:39:07 2018 (r330365) +++ head/gnu/usr.bin/binutils/ld/Makefile Sun Mar 4 01:37:49 2018 (r330366) @@ -7,7 +7,15 @@ ELF_SCR_EXT= x xbn xc xd xdc xdw xn xr xs xsc xsw xu x .PATH: ${SRCDIR}/ld PROG= ld.bfd +.if ${MK_LLD_IS_LD} == "no" MAN= ld.1 +.else +MAN= ld.bfd.1 +CLEANFILES+= ld.bfd.1 +ld.bfd.1: ld.1 + ${CP} ${.ALLSRC} ${.TARGET} +.endif + SCRIPTDIR= /usr/libdata/ldscripts SRCS+= ldcref.c \ ldctor.c \ From owner-svn-src-head@freebsd.org Sun Mar 4 03:21: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 E7774F2ED0E; Sun, 4 Mar 2018 03:21:12 +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 9AA6085A19; Sun, 4 Mar 2018 03:21:12 +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 95A9A7BDE; Sun, 4 Mar 2018 03:21:12 +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 w243LCaY040004; Sun, 4 Mar 2018 03:21:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w243LCnU040003; Sun, 4 Mar 2018 03:21:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803040321.w243LCnU040003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 4 Mar 2018 03:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330369 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330369 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 03:21:13 -0000 Author: kevans Date: Sun Mar 4 03:21:12 2018 New Revision: 330369 URL: https://svnweb.freebsd.org/changeset/base/330369 Log: lualoader: Return meaningful value in cli_execute loader.command(...) will return whatever the executed function returns, so follow suit and return whatever loader.command() returned or whatever the Lua function returns. Modified: head/stand/lua/cli.lua Modified: head/stand/lua/cli.lua ============================================================================== --- head/stand/lua/cli.lua Sun Mar 4 03:13:13 2018 (r330368) +++ head/stand/lua/cli.lua Sun Mar 4 03:21:12 2018 (r330369) @@ -77,8 +77,7 @@ function cli_execute(...) local argv = {...} -- Just in case... if #argv == 0 then - loader.command(...) - return + return loader.command(...) end local cmd_name = argv[1] @@ -88,9 +87,9 @@ function cli_execute(...) -- traditional reasons for including it don't necessarily apply, -- it may not be totally redundant if we want to have one global -- handling multiple commands - cmd(...) + return cmd(...) else - loader.command(...) + return loader.command(...) end end From owner-svn-src-head@freebsd.org Sun Mar 4 03:23: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 79B70F2EF9E; Sun, 4 Mar 2018 03:23:20 +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 2727B85DD9; Sun, 4 Mar 2018 03:23:20 +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 220177D41; Sun, 4 Mar 2018 03:23:20 +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 w243NJVv043333; Sun, 4 Mar 2018 03:23:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w243NJ9J043332; Sun, 4 Mar 2018 03:23:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803040323.w243NJ9J043332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 4 Mar 2018 03:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330370 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330370 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 03:23:20 -0000 Author: kevans Date: Sun Mar 4 03:23:19 2018 New Revision: 330370 URL: https://svnweb.freebsd.org/changeset/base/330370 Log: lualoader: logdef -> logodef typo Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sun Mar 4 03:21:12 2018 (r330369) +++ head/stand/lua/drawer.lua Sun Mar 4 03:23:19 2018 (r330370) @@ -454,7 +454,7 @@ function drawer.drawlogo() x = x + drawer.shift.x y = y + drawer.shift.y - if logdef ~= nil and logodef.shift ~= nil then + if logodef ~= nil and logodef.shift ~= nil then x = x + logodef.shift.x y = y + logodef.shift.y end From owner-svn-src-head@freebsd.org Sun Mar 4 03:13: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 A96EBF2E431; Sun, 4 Mar 2018 03:13:14 +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 3D0FA8523A; Sun, 4 Mar 2018 03:13:14 +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 300C87B9A; Sun, 4 Mar 2018 03:13:14 +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 w243DD4q038144; Sun, 4 Mar 2018 03:13:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w243DDSc038143; Sun, 4 Mar 2018 03:13:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803040313.w243DDSc038143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 4 Mar 2018 03:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330368 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 330368 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 03:13:14 -0000 Author: imp Date: Sun Mar 4 03:13:13 2018 New Revision: 330368 URL: https://svnweb.freebsd.org/changeset/base/330368 Log: Add documentation for CTLFLAG_MPSAFE. Modified: head/share/man/man9/sysctl.9 Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Sun Mar 4 02:41:25 2018 (r330367) +++ head/share/man/man9/sysctl.9 Sun Mar 4 03:13:13 2018 (r330368) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2017 +.Dd March 3, 2018 .Dt SYSCTL 9 .Os .Sh NAME @@ -662,6 +662,11 @@ this flag will prevent fetching the initial value from environment. Typically this flag should only be used for very early low level system setup code, and not by common drivers and modules. +.It Dv CTLFLAG_MPSAFE +This +.Xr sysctl 9 +handler is MP safe. +Do not grab Giant around calls to this handler. .El .Pp Additionally, any of the following optional flags may also be specified: From owner-svn-src-head@freebsd.org Sun Mar 4 04: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 218A5F33D98; Sun, 4 Mar 2018 04:49:10 +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 ACBD7689A6; Sun, 4 Mar 2018 04:49:09 +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 A4CD310A70; Sun, 4 Mar 2018 04:49:09 +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 w244n9md083121; Sun, 4 Mar 2018 04:49:09 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w244n993083120; Sun, 4 Mar 2018 04:49:09 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803040449.w244n993083120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 4 Mar 2018 04:49:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330371 - head/stand/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/stand/powerpc/ofw X-SVN-Commit-Revision: 330371 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 04:49:10 -0000 Author: nwhitehorn Date: Sun Mar 4 04:49:09 2018 New Revision: 330371 URL: https://svnweb.freebsd.org/changeset/base/330371 Log: Where we can, pass the kernel an FDT facsimile of the OF device tree rather than a pointer to Open Firmware by default. This eliminates a number of potentially unsafe calls to firmware from the kernel and provides better performance. This feature is meant to be expanded until it is on by default unconditionally and, ideally, we can then garbage-collect the nightmare pile of hacks required to call into Open Firmware from a live kernel. Reviewed by: jhibbits Modified: head/stand/powerpc/ofw/main.c Modified: head/stand/powerpc/ofw/main.c ============================================================================== --- head/stand/powerpc/ofw/main.c Sun Mar 4 03:23:19 2018 (r330370) +++ head/stand/powerpc/ofw/main.c Sun Mar 4 04:49:09 2018 (r330371) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include "libofw.h" #include "bootstrap.h" +#include + struct arch_switch archsw; /* MI/MD interface boundary */ extern char end[]; @@ -47,6 +49,16 @@ static char heap[HEAP_SIZE]; // In BSS, so uses no spa #define OF_puts(fd, text) OF_write(fd, text, strlen(text)) +static __inline register_t +mfmsr(void) +{ + register_t value; + + __asm __volatile ("mfmsr %0" : "=r"(value)); + + return (value); +} + void init_heap(void) { @@ -144,6 +156,15 @@ main(int (*openfirm)(void *)) env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset, env_nounset); setenv("LINES", "24", 1); /* optional */ + + /* + * On non-Apple hardware, where it works reliably, pass flattened + * device trees to the kernel by default instead of OF CI pointers. + * Apple hardware is the only virtual-mode OF implementation in + * existence, so far as I am aware, so use that as a flag. + */ + if (!(mfmsr() & PSL_DR)) + setenv("usefdt", "1", 1); archsw.arch_getdev = ofw_getdev; archsw.arch_copyin = ofw_copyin; From owner-svn-src-head@freebsd.org Sun Mar 4 06:19: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 F2042F38DC0; Sun, 4 Mar 2018 06:19:41 +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 8BF216C327; Sun, 4 Mar 2018 06:19:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 814FD1192C; Sun, 4 Mar 2018 06:19:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w246Jf9p028130; Sun, 4 Mar 2018 06:19:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w246JfLX028129; Sun, 4 Mar 2018 06:19:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803040619.w246JfLX028129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 4 Mar 2018 06:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330372 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 330372 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 06:19:42 -0000 Author: imp Date: Sun Mar 4 06:19:41 2018 New Revision: 330372 URL: https://svnweb.freebsd.org/changeset/base/330372 Log: Mention that CTLFLAG_MPSAFE is only for _PROC entries. Modified: head/share/man/man9/sysctl.9 Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Sun Mar 4 04:49:09 2018 (r330371) +++ head/share/man/man9/sysctl.9 Sun Mar 4 06:19:41 2018 (r330372) @@ -667,6 +667,9 @@ This .Xr sysctl 9 handler is MP safe. Do not grab Giant around calls to this handler. +This should only be used for +.Fn SYSCTL_PROC +entries. .El .Pp Additionally, any of the following optional flags may also be specified: From owner-svn-src-head@freebsd.org Sun Mar 4 09:56: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 89494F46D1A; Sun, 4 Mar 2018 09:56:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0B273ABE; Sun, 4 Mar 2018 09:56:56 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 348001D4DF; Sun, 4 Mar 2018 09:56:56 +0000 (UTC) Date: Sun, 4 Mar 2018 09:56:56 +0000 From: Alexey Dokuchaev To: Colin Percival Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330236 - head/sys/compat/linuxkpi/common/src Message-ID: <20180304095656.GA36450@FreeBSD.org> References: <201803011031.w21AVpNU076475@repo.freebsd.org> <01000161ee9cee29-0a02aaff-9052-41d2-a638-4bc673a41df6-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <01000161ee9cee29-0a02aaff-9052-41d2-a638-4bc673a41df6-000000@email.amazonses.com> 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: Sun, 04 Mar 2018 09:56:56 -0000 On Sun, Mar 04, 2018 at 01:25:17AM +0000, Colin Percival wrote: > On 03/01/18 02:31, Hans Petter Selasky wrote: > > New Revision: 330236 > > Correct the return value from flush_work() and flush_delayed_work() > > in the LinuxKPI to comply more with Linux. This fixes an issue when > > these functions are used in waiting loops. > > > > MFC after: 1 week > > Sponsored by: Mellanox Technologies > > In case the data point is useful: Merging this to stable/11 unbroke S3 > suspend/resume on my laptop (system76 Galago Pro, kabylake, using the > drm-next-kmod port). Any data point about laptops and, particularly, suspend/resume is useful, thanks for sharing Colin! ./danfe From owner-svn-src-head@freebsd.org Sun Mar 4 10:05: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 CB87BF477E3 for ; Sun, 4 Mar 2018 10:05:00 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x236.google.com (mail-yw0-x236.google.com [IPv6:2607:f8b0:4002:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 619A97414E for ; Sun, 4 Mar 2018 10:05:00 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x236.google.com with SMTP id j143so4744155ywb.4 for ; Sun, 04 Mar 2018 02:05:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YNYFaCvQGnbJxr+MkDggA9F+WTjeXdvXgcbR88MFMk8=; b=QSF6b8MUbvwsRsMMQ3rN3zkyOZWmogurPmslRvf1VKeFPmIHGriyhBzYPiSje3FNMO SG8cmVx2WqRmdEGXyE6sKorDqA9xARCckuHA3F+MFVP6ycO4mQyBnKi22JAKo6CBo+Ek 7k5pfyXowrsqcjEztO4WXKNjW58/6HWsvgtQg= 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=YNYFaCvQGnbJxr+MkDggA9F+WTjeXdvXgcbR88MFMk8=; b=Uet09VptQBahG/g4hOnXE2qutFs2mr7uXmg8H0qz2DDTp3cEdD40Q48AEBmi6cPNM2 2VdyOitULRi1mBvufb8gC4pq5d39qWCYceRGRj8led8dePEHZg+tf+3npwdnglG4CVvv aqTsGtqP0+f31v4wG3Jv3G2gAKIMBa3Qk4zKbXuByLGAGz/fGU1jHwf9v+0XxmxwlI8b VLx1V1dozI/eG+ObhG1zpBJR6jrIGM+mQjTG3FBZKCFIHC4yB8qY8SnjaLUmK+E2D29X RwvU+Y+nPxlUNuxqGWwFingse5FrE22zfSJyYfdFvvzOadKw4szUTiMuMbTsNnzEDuBw mDPQ== X-Gm-Message-State: APf1xPB2zmOswddvrSozjgqLEyCGGv/JXMpxdewXokQJtyJa+dFcwBPE AXTxCIAj1NiVFQQdTu7fehX0vQjau7iA9nT4cV86Nw== X-Google-Smtp-Source: AG47ELv62xTlycN9PmSC955eRRCARDgZ5S10l/0D3lAndWjhbYfhqNgR6WKDA3qP2p7Epm7Pd8wfpGK3V6gzYHFamCI= X-Received: by 10.129.109.1 with SMTP id i1mr7104543ywc.113.1520157899662; Sun, 04 Mar 2018 02:04:59 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:23d2:0:0:0:0:0 with HTTP; Sun, 4 Mar 2018 02:04:29 -0800 (PST) In-Reply-To: <201707022100.v62L0Ume001253@repo.freebsd.org> References: <201707022100.v62L0Ume001253@repo.freebsd.org> From: Eitan Adler Date: Sun, 4 Mar 2018 02:04:29 -0800 Message-ID: Subject: Re: svn commit: r320579 - head/usr.bin/patch To: "Pedro F. Giffuni" 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: Sun, 04 Mar 2018 10:05:01 -0000 On 2 July 2017 at 14:00, Pedro F. Giffuni wrote: > + } else if (strnEQ(s, "diff --git a/", 13)) { > + /* Git-style diffs. */ > + piece_of_git = 1; This is incomplete and leaves to confusing behavior for some git diffs. In particular with 'diff.mnemonicprefix = true' the prefix is awesome something other than 'a/'. It can be 'w' for working copy, 'i' for index, 'c' for commit, or some other values. While I don't oppose this feature, it'd be better if we did not tie it to a single specific prefix. -- Eitan Adler From owner-svn-src-head@freebsd.org Sun Mar 4 11:29: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 DB0EFF29DC1; Sun, 4 Mar 2018 11:29:29 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.92]) (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 770837696C; Sun, 4 Mar 2018 11:29:29 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.110.112]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1esRpS-0001T6-5c; Sun, 04 Mar 2018 12:29:22 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Hans Petter Selasky" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Colin Percival" Subject: Re: svn commit: r330236 - head/sys/compat/linuxkpi/common/src References: <201803011031.w21AVpNU076475@repo.freebsd.org> <01000161ee9cee29-0a02aaff-9052-41d2-a638-4bc673a41df6-000000@email.amazonses.com> Date: Sun, 04 Mar 2018 12:29:28 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <01000161ee9cee29-0a02aaff-9052-41d2-a638-4bc673a41df6-000000@email.amazonses.com> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: 919fae14bc17c74543a025539baad412 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 Mar 2018 11:29:30 -0000 On Sun, 04 Mar 2018 02:25:17 +0100, Colin Percival wrote: > On 03/01/18 02:31, Hans Petter Selasky wrote: >> New Revision: 330236 >> Correct the return value from flush_work() and flush_delayed_work() >> in the >> LinuxKPI to comply more with Linux. This fixes an issue when these >> functions >> are used in waiting loops. >> >> MFC after: 1 week >> Sponsored by: Mellanox Technologies > > In case the data point is useful: Merging this to stable/11 unbroke S3 > suspend/resume on my laptop (system76 Galago Pro, kabylake, using the > drm-next-kmod port). > These data points are much more useful than commit messages that describe what the patch already shows and talk about 'an issue'. Every patch solves 'an issue' (or creates some :-) ). No personal pun intended. Just taking this example as general thoughts about commit messages. Regards, Ronald. From owner-svn-src-head@freebsd.org Sun Mar 4 11:41: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 3885EF2AA23; Sun, 4 Mar 2018 11:41:09 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.92]) (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 D0BA476FD6; Sun, 4 Mar 2018 11:41:08 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.110.112]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1esS0o-00046v-Sc; Sun, 04 Mar 2018 12:41:06 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Edward Tomasz Napierala" Subject: Re: svn commit: r330277 - in head: bin/stty libexec/getty References: <201803021416.w22EGJHm015205@repo.freebsd.org> Date: Sun, 04 Mar 2018 12:41:13 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201803021416.w22EGJHm015205@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: 7b320cd02cd98c580351ccd23ba1512a 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 Mar 2018 11:41:09 -0000 On Fri, 02 Mar 2018 15:16:19 +0100, Edward Tomasz Napierala wrote: > Author: trasz > Date: Fri Mar 2 14:16:19 2018 > New Revision: 330277 > URL: https://svnweb.freebsd.org/changeset/base/330277 > > Log: > .Xr pstat(8), so that people have a chance to learn how to get a list > of terminal devices using "pstat -t". Nice tip. Never seen pstat -t before. I have a feeling it will be useful to me some day. :-) From owner-svn-src-head@freebsd.org Sun Mar 4 13:27: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 80F24F32FD6; Sun, 4 Mar 2018 13:27:22 +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 379337AD33; Sun, 4 Mar 2018 13:27:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DFAA15F22; Sun, 4 Mar 2018 13:27:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24DRM6r040715; Sun, 4 Mar 2018 13:27:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24DRMBI040714; Sun, 4 Mar 2018 13:27:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803041327.w24DRMBI040714@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sun, 4 Mar 2018 13:27:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330374 - head/sys/ddb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/ddb X-SVN-Commit-Revision: 330374 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:27:22 -0000 Author: avg Date: Sun Mar 4 13:27:21 2018 New Revision: 330374 URL: https://svnweb.freebsd.org/changeset/base/330374 Log: db_script_exec: use a saved script name when reporting commands executed Before executing a command in a ddb script ddb prints an information line of the form: db:1:my-script> command where 1 is the script's depth level, "my-script" is the scipt's name, and "command" is the current command in the script. db_script_exec() uses its 'scriptname' parameter to produce that string. In the case when db_script_exec() is called from db_run_cmd() the argument points to db_tok_string that is a global variable used for command parsing. So, its value changes with every command executed. This commit changes the code to use the script's name stored in ds_scriptname to print the line. MFC after: 2 weeks Modified: head/sys/ddb/db_script.c Modified: head/sys/ddb/db_script.c ============================================================================== --- head/sys/ddb/db_script.c Sun Mar 4 08:00:07 2018 (r330373) +++ head/sys/ddb/db_script.c Sun Mar 4 13:27:21 2018 (r330374) @@ -296,7 +296,7 @@ db_script_exec(const char *scriptname, int warnifnotfo buffer = drd->drd_buffer; strcpy(buffer, dsp->ds_script); while ((command = strsep(&buffer, ";")) != NULL) { - db_printf("db:%d:%s> %s\n", db_recursion, scriptname, + db_printf("db:%d:%s> %s\n", db_recursion, dsp->ds_scriptname, command); db_command_trim(&command); prev_jb = kdb_jmpbuf(jb); From owner-svn-src-head@freebsd.org Sun Mar 4 17:06: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 9C076F44451; Sun, 4 Mar 2018 17:06:39 +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 455E583A94; Sun, 4 Mar 2018 17:06:39 +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 3C0551828C; Sun, 4 Mar 2018 17:06:39 +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 w24H6dY1051989; Sun, 4 Mar 2018 17:06:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24H6coa051979; Sun, 4 Mar 2018 17:06:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201803041706.w24H6coa051979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 4 Mar 2018 17:06:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330384 - in head: contrib/llvm/lib/Target/AArch64 contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/lib/Basic lib/clang lib/clang/includ... X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: contrib/llvm/lib/Target/AArch64 contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/lib/Basic lib/clang lib/clang/include/clang/Basic lib/clang/i... X-SVN-Commit-Revision: 330384 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:06:39 -0000 Author: dim Date: Sun Mar 4 17:06:37 2018 New Revision: 330384 URL: https://svnweb.freebsd.org/changeset/base/330384 Log: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 6.0.0 release (upstream r326565). Release notes for llvm, clang and lld will be available here soon: Relnotes: yes MFC after: 3 months X-MFC-With: r327952 PR: 224669 Modified: head/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/tools/clang/include/clang/Basic/AttrDocs.td head/contrib/llvm/tools/clang/lib/Basic/Version.cpp head/lib/clang/freebsd_cc_version.h head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/lld/Common/Version.inc head/lib/clang/include/llvm/Support/VCSRevision.h head/sys/sys/param.h Directory Properties: head/contrib/compiler-rt/ (props changed) head/contrib/libc++/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) Modified: head/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp ============================================================================== --- head/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp Sun Mar 4 15:07:23 2018 (r330383) +++ head/contrib/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp Sun Mar 4 17:06:37 2018 (r330384) @@ -840,6 +840,7 @@ bool AArch64InstructionSelector::select(MachineInstr & case TargetOpcode::G_EXTRACT: { LLT SrcTy = MRI.getType(I.getOperand(1).getReg()); LLT DstTy = MRI.getType(I.getOperand(0).getReg()); + (void)DstTy; unsigned SrcSize = SrcTy.getSizeInBits(); // Larger extracts are vectors, same-size extracts should be something else // by now (either split up or simplified to a COPY). Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sun Mar 4 15:07:23 2018 (r330383) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Sun Mar 4 17:06:37 2018 (r330384) @@ -35520,7 +35520,7 @@ static SDValue combineFneg(SDNode *N, SelectionDAG &DA // If we're negating an FMA node, then we can adjust the // instruction to include the extra negation. unsigned NewOpcode = 0; - if (Arg.hasOneUse()) { + if (Arg.hasOneUse() && Subtarget.hasAnyFMA()) { switch (Arg.getOpcode()) { case ISD::FMA: NewOpcode = X86ISD::FNMSUB; break; case X86ISD::FMSUB: NewOpcode = X86ISD::FNMADD; break; Modified: head/contrib/llvm/tools/clang/include/clang/Basic/AttrDocs.td ============================================================================== --- head/contrib/llvm/tools/clang/include/clang/Basic/AttrDocs.td Sun Mar 4 15:07:23 2018 (r330383) +++ head/contrib/llvm/tools/clang/include/clang/Basic/AttrDocs.td Sun Mar 4 17:06:37 2018 (r330384) @@ -353,7 +353,7 @@ available in C. int isdigit(int c); int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); - + void foo(char c) { isdigit(c); isdigit(10); @@ -406,7 +406,7 @@ overload out of a number of viable overloads using ena void f() __attribute__((enable_if(true, ""))); // #1 void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 - + void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 @@ -918,11 +918,11 @@ default name. can only be placed before an @protocol or @interface declaration: .. code-block:: objc - + __attribute__((objc_runtime_name("MyLocalName"))) @interface Message @end - + }]; } @@ -1228,7 +1228,7 @@ potentially-evaluated discarded-value expression that .. code-block: c++ struct [[nodiscard]] error_info { /*...*/ }; error_info enable_missile_safety_mode(); - + void launch_missiles(); void test_missiles() { enable_missile_safety_mode(); // diagnoses @@ -2641,23 +2641,23 @@ used to process multiple arguments from a single invoc concurrently. The syntax of the `declare simd` construct is as follows: - .. code-block:: c + .. code-block:: none - #pragma omp declare simd [clause[[,] clause] ...] new-line - [#pragma omp declare simd [clause[[,] clause] ...] new-line] - [...] - function definition or declaration + #pragma omp declare simd [clause[[,] clause] ...] new-line + [#pragma omp declare simd [clause[[,] clause] ...] new-line] + [...] + function definition or declaration where clause is one of the following: - .. code-block:: c + .. code-block:: none - simdlen(length) - linear(argument-list[:constant-linear-step]) - aligned(argument-list[:alignment]) - uniform(argument-list) - inbranch - notinbranch + simdlen(length) + linear(argument-list[:constant-linear-step]) + aligned(argument-list[:alignment]) + uniform(argument-list) + inbranch + notinbranch }]; } @@ -2673,9 +2673,9 @@ The syntax of the declare target directive is as follo .. code-block:: c - #pragma omp declare target new-line - declarations-definition-seq - #pragma omp end declare target new-line + #pragma omp declare target new-line + declarations-definition-seq + #pragma omp end declare target new-line }]; } Modified: head/contrib/llvm/tools/clang/lib/Basic/Version.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sun Mar 4 15:07:23 2018 (r330383) +++ head/contrib/llvm/tools/clang/lib/Basic/Version.cpp Sun Mar 4 17:06:37 2018 (r330384) @@ -36,7 +36,7 @@ std::string getClangRepositoryPath() { // If the SVN_REPOSITORY is empty, try to use the SVN keyword. This helps us // pick up a tag in an SVN export, for example. - StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/branches/release_60/lib/Basic/Version.cpp $"); + StringRef SVNRepository("$URL: https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_600/final/lib/Basic/Version.cpp $"); if (URL.empty()) { URL = SVNRepository.slice(SVNRepository.find(':'), SVNRepository.find("/lib/Basic")); Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Sun Mar 4 15:07:23 2018 (r330383) +++ head/lib/clang/freebsd_cc_version.h Sun Mar 4 17:06:37 2018 (r330384) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200010 +#define FREEBSD_CC_VERSION 1200011 Modified: head/lib/clang/include/clang/Basic/Version.inc ============================================================================== --- head/lib/clang/include/clang/Basic/Version.inc Sun Mar 4 15:07:23 2018 (r330383) +++ head/lib/clang/include/clang/Basic/Version.inc Sun Mar 4 17:06:37 2018 (r330384) @@ -8,4 +8,4 @@ #define CLANG_VENDOR "FreeBSD " -#define SVN_REVISION "325932" +#define SVN_REVISION "326565" Modified: head/lib/clang/include/lld/Common/Version.inc ============================================================================== --- head/lib/clang/include/lld/Common/Version.inc Sun Mar 4 15:07:23 2018 (r330383) +++ head/lib/clang/include/lld/Common/Version.inc Sun Mar 4 17:06:37 2018 (r330384) @@ -4,5 +4,5 @@ #define LLD_VERSION_STRING "6.0.0" #define LLD_VERSION_MAJOR 6 #define LLD_VERSION_MINOR 0 -#define LLD_REVISION_STRING "325932" +#define LLD_REVISION_STRING "326565" #define LLD_REPOSITORY_STRING "FreeBSD" Modified: head/lib/clang/include/llvm/Support/VCSRevision.h ============================================================================== --- head/lib/clang/include/llvm/Support/VCSRevision.h Sun Mar 4 15:07:23 2018 (r330383) +++ head/lib/clang/include/llvm/Support/VCSRevision.h Sun Mar 4 17:06:37 2018 (r330384) @@ -1,2 +1,2 @@ /* $FreeBSD$ */ -#define LLVM_REVISION "svn-r325932" +#define LLVM_REVISION "svn-r326565" Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Mar 4 15:07:23 2018 (r330383) +++ head/sys/sys/param.h Sun Mar 4 17:06:37 2018 (r330384) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200059 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200060 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sun Mar 4 17: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 4C2F4F45F01; Sun, 4 Mar 2018 17:30:17 +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 EEBDE84902; Sun, 4 Mar 2018 17:30:16 +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 E95B11860C; Sun, 4 Mar 2018 17:30:16 +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 w24HUGHp061973; Sun, 4 Mar 2018 17:30:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24HUGtj061972; Sun, 4 Mar 2018 17:30:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803041730.w24HUGtj061972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 17:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330385 - head/sys/dev/usb/serial X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/usb/serial X-SVN-Commit-Revision: 330385 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:30:17 -0000 Author: ian Date: Sun Mar 4 17:30:16 2018 New Revision: 330385 URL: https://svnweb.freebsd.org/changeset/base/330385 Log: Flag the first interface on a KTLINK FTDI-based jtag+uart device as being the jtag port, so that a tty is not created for it. This is based on information in the PR and from the vendor website. When the PR was first opened we had no facility for flagging the jtag ports. I stumbled across the still-open PR with the idea of closing it, and noticed that this wee update was needed. PR: 175893 Modified: head/sys/dev/usb/serial/uftdi.c Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Sun Mar 4 17:06:37 2018 (r330384) +++ head/sys/dev/usb/serial/uftdi.c Sun Mar 4 17:30:16 2018 (r330385) @@ -441,7 +441,7 @@ static const STRUCT_USB_HOST_ID uftdi_devs[] = { UFTDI_DEV(FTDI, IPLUS2, 0), UFTDI_DEV(FTDI, IRTRANS, 0), UFTDI_DEV(FTDI, KBS, 0), - UFTDI_DEV(FTDI, KTLINK, 0), + UFTDI_DEV(FTDI, KTLINK, UFTDI_JTAG_IFACE(0)), UFTDI_DEV(FTDI, LENZ_LIUSB, 0), UFTDI_DEV(FTDI, LK202, 0), UFTDI_DEV(FTDI, LK204, 0), From owner-svn-src-head@freebsd.org Sun Mar 4 18:00: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 E04DBF487DD; Sun, 4 Mar 2018 18:00:32 +0000 (UTC) (envelope-from eadler@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 9655C8677A; Sun, 4 Mar 2018 18:00:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 914D918AE9; Sun, 4 Mar 2018 18:00:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24I0Whu077762; Sun, 4 Mar 2018 18:00:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24I0WsW077761; Sun, 4 Mar 2018 18:00:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803041800.w24I0WsW077761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 4 Mar 2018 18:00:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330386 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 330386 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:00:33 -0000 Author: eadler Date: Sun Mar 4 18:00:32 2018 New Revision: 330386 URL: https://svnweb.freebsd.org/changeset/base/330386 Log: open.3: Use .Fa where appropriate Obtained From: DragonFlyBSD (78732326a796ca521f3c0fe33c6fc9c695742ede) Modified: head/lib/libutil/flopen.3 Modified: head/lib/libutil/flopen.3 ============================================================================== --- head/lib/libutil/flopen.3 Sun Mar 4 17:30:16 2018 (r330385) +++ head/lib/libutil/flopen.3 Sun Mar 4 18:00:32 2018 (r330386) @@ -54,7 +54,7 @@ It is essentially equivalent with calling with the same parameters followed by .Fn flock with an -.Va operation +.Fa operation argument of .Dv LOCK_EX , except that @@ -66,7 +66,7 @@ files, mailboxes and other kinds of files which are us synchronization between processes. .Pp If -.Va flags +.Fa flags includes .Dv O_NONBLOCK and the file is already locked, @@ -79,9 +79,9 @@ to As with .Fn open , the additional -.Va mode +.Fa mode argument is required if -.Va flags +.Fa flags includes .Dv O_CREAT . .Pp From owner-svn-src-head@freebsd.org Sun Mar 4 18:04: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 469E2F48D8B; Sun, 4 Mar 2018 18:04:38 +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 F0AF186D5A; Sun, 4 Mar 2018 18:04:37 +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 CD84718C88; Sun, 4 Mar 2018 18:04:37 +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 w24I4bYj082555; Sun, 4 Mar 2018 18:04:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24I4bCo082553; Sun, 4 Mar 2018 18:04:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041804.w24I4bCo082553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330387 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 330387 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:04:38 -0000 Author: hselasky Date: Sun Mar 4 18:04:37 2018 New Revision: 330387 URL: https://svnweb.freebsd.org/changeset/base/330387 Log: Rename the SLAB_DESTROY_BY_RCU flag into SLAB_TYPESAFE_BY_RCU in the LinuxKPI to be compatible with Linux. MFC after: 1 week Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h head/sys/compat/linuxkpi/common/src/linux_slab.c Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Mar 4 18:00:32 2018 (r330386) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Mar 4 18:04:37 2018 (r330387) @@ -79,7 +79,7 @@ struct linux_kmem_cache { }; #define SLAB_HWCACHE_ALIGN (1 << 0) -#define SLAB_DESTROY_BY_RCU (1 << 1) +#define SLAB_TYPESAFE_BY_RCU (1 << 1) #define SLAB_RECLAIM_ACCOUNT (1 << 2) static inline gfp_t @@ -162,7 +162,7 @@ extern void linux_kmem_cache_free_rcu(struct linux_kme static inline void linux_kmem_cache_free(struct linux_kmem_cache *c, void *m) { - if (unlikely(c->cache_flags & SLAB_DESTROY_BY_RCU)) + if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) linux_kmem_cache_free_rcu(c, m); else uma_zfree(c->cache_zone, m); Modified: head/sys/compat/linuxkpi/common/src/linux_slab.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_slab.c Sun Mar 4 18:00:32 2018 (r330386) +++ head/sys/compat/linuxkpi/common/src/linux_slab.c Sun Mar 4 18:04:37 2018 (r330387) @@ -49,7 +49,7 @@ linux_kmem_ctor(void *mem, int size, void *arg, int fl { struct linux_kmem_cache *c = arg; - if (unlikely(c->cache_flags & SLAB_DESTROY_BY_RCU)) { + if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) { struct linux_kmem_rcu *rcu = LINUX_KMEM_TO_RCU(c, mem); /* duplicate cache pointer */ @@ -85,7 +85,7 @@ linux_kmem_cache_create(const char *name, size_t size, else if (align != 0) align--; - if (flags & SLAB_DESTROY_BY_RCU) { + if (flags & SLAB_TYPESAFE_BY_RCU) { /* make room for RCU structure */ size = ALIGN(size, sizeof(void *)); size += sizeof(struct linux_kmem_rcu); @@ -118,7 +118,7 @@ linux_kmem_cache_free_rcu(struct linux_kmem_cache *c, void linux_kmem_cache_destroy(struct linux_kmem_cache *c) { - if (unlikely(c->cache_flags & SLAB_DESTROY_BY_RCU)) { + if (unlikely(c->cache_flags & SLAB_TYPESAFE_BY_RCU)) { /* make sure all free callbacks have been called */ rcu_barrier(); } From owner-svn-src-head@freebsd.org Sun Mar 4 18:08: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 5F00BF49208; Sun, 4 Mar 2018 18:08:22 +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 122CA8700F; Sun, 4 Mar 2018 18:08:22 +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 03D8A18C89; Sun, 4 Mar 2018 18:08:22 +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 w24I8LSV082720; Sun, 4 Mar 2018 18:08:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24I8LTI082719; Sun, 4 Mar 2018 18:08:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041808.w24I8LTI082719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330388 - 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: 330388 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:08:22 -0000 Author: hselasky Date: Sun Mar 4 18:08:21 2018 New Revision: 330388 URL: https://svnweb.freebsd.org/changeset/base/330388 Log: Implement GENMASK_ULL() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Sun Mar 4 18:04:37 2018 (r330387) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Sun Mar 4 18:08:21 2018 (r330388) @@ -45,12 +45,15 @@ #define BITS_PER_LONG 32 #endif +#define BITS_PER_LONG_LONG 64 + #define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG)) #define BITMAP_LAST_WORD_MASK(n) (~0UL >> (BITS_PER_LONG - (n))) #define BITS_TO_LONGS(n) howmany((n), BITS_PER_LONG) #define BIT_MASK(nr) (1UL << ((nr) & (BITS_PER_LONG - 1))) #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) #define GENMASK(h, l) (((~0UL) >> (BITS_PER_LONG - (h) - 1)) & ((~0UL) << (l))) +#define GENMASK_ULL(h, l) (((~0ULL) >> (BITS_PER_LONG_LONG - (h) - 1)) & ((~0ULL) << (l))) #define BITS_PER_BYTE 8 #define hweight8(x) bitcount((uint8_t)(x)) From owner-svn-src-head@freebsd.org Sun Mar 4 18:10: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 9B685F493F4; Sun, 4 Mar 2018 18:10:19 +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 49D64871BD; Sun, 4 Mar 2018 18:10:19 +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 3DEE418C8D; Sun, 4 Mar 2018 18:10:19 +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 w24IAJhh082864; Sun, 4 Mar 2018 18:10:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24IAJs5082863; Sun, 4 Mar 2018 18:10:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041810.w24IAJs5082863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330389 - 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: 330389 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:10:19 -0000 Author: hselasky Date: Sun Mar 4 18:10:18 2018 New Revision: 330389 URL: https://svnweb.freebsd.org/changeset/base/330389 Log: Implement for_each_clear_bit() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Sun Mar 4 18:08:21 2018 (r330388) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Sun Mar 4 18:10:18 2018 (r330389) @@ -390,6 +390,10 @@ done: (bit) < (size); \ (bit) = find_next_bit((addr), (size), (bit) + 1)) +#define for_each_clear_bit(bit, addr, size) \ + for ((bit) = find_first_zero_bit((addr), (size)); \ + (bit) < (size); \ + (bit) = find_next_zero_bit((addr), (size), (bit) + 1)) static inline uint64_t sign_extend64(uint64_t value, int index) From owner-svn-src-head@freebsd.org Sun Mar 4 18:13: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 08B59F49A0A; Sun, 4 Mar 2018 18:13:32 +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 CDEB3876F0; Sun, 4 Mar 2018 18:13:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8EBE18E19; Sun, 4 Mar 2018 18:13:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24IDV2P087365; Sun, 4 Mar 2018 18:13:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24IDVP5087364; Sun, 4 Mar 2018 18:13:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041813.w24IDVP5087364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:13:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330390 - 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: 330390 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:13:32 -0000 Author: hselasky Date: Sun Mar 4 18:13:31 2018 New Revision: 330390 URL: https://svnweb.freebsd.org/changeset/base/330390 Log: Define noinline and __maybe_unused macros in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/compiler.h Sun Mar 4 18:10:18 2018 (r330389) +++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Sun Mar 4 18:13:31 2018 (r330390) @@ -64,6 +64,7 @@ #define __attribute_const__ __attribute__((__const__)) #undef __always_inline #define __always_inline inline +#define noinline __noinline #define ____cacheline_aligned __aligned(CACHE_LINE_SIZE) #define likely(x) __builtin_expect(!!(x), 1) @@ -71,6 +72,7 @@ #define typeof(x) __typeof(x) #define uninitialized_var(x) x = x +#define __maybe_unused __unused #define __always_unused __unused #define __must_check __result_use_check From owner-svn-src-head@freebsd.org Sun Mar 4 18:17: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 6892DF49F9B; Sun, 4 Mar 2018 18:17:55 +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 160CB879C5; Sun, 4 Mar 2018 18:17:55 +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 10FF918E20; Sun, 4 Mar 2018 18:17:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24IHsAY087553; Sun, 4 Mar 2018 18:17:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24IHstF087552; Sun, 4 Mar 2018 18:17:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041817.w24IHstF087552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330391 - 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: 330391 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:17:55 -0000 Author: hselasky Date: Sun Mar 4 18:17:54 2018 New Revision: 330391 URL: https://svnweb.freebsd.org/changeset/base/330391 Log: Implement writel_relaxed() in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/io.h Modified: head/sys/compat/linuxkpi/common/include/linux/io.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/io.h Sun Mar 4 18:13:31 2018 (r330390) +++ head/sys/compat/linuxkpi/common/include/linux/io.h Sun Mar 4 18:17:54 2018 (r330391) @@ -74,6 +74,13 @@ writel(uint32_t b, void *addr) *(volatile uint32_t *)addr = b; } +#undef writel_relaxed +static inline void +writel_relaxed(uint32_t b, void *addr) +{ + *(volatile uint32_t *)addr = b; +} + #undef writeq static inline void writeq(uint64_t b, void *addr) From owner-svn-src-head@freebsd.org Sun Mar 4 18:19: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 AA4B6F24230; Sun, 4 Mar 2018 18:19:45 +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 5678187B84; Sun, 4 Mar 2018 18:19:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51A1C18E23; Sun, 4 Mar 2018 18:19:45 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24IJjPn087661; Sun, 4 Mar 2018 18:19:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24IJjeZ087660; Sun, 4 Mar 2018 18:19:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041819.w24IJjeZ087660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330392 - 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: 330392 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:19:45 -0000 Author: hselasky Date: Sun Mar 4 18:19:44 2018 New Revision: 330392 URL: https://svnweb.freebsd.org/changeset/base/330392 Log: Implement BUILD_BUG() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun Mar 4 18:17:54 2018 (r330391) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun Mar 4 18:19:44 2018 (r330392) @@ -86,6 +86,7 @@ #define S64_C(x) x ## LL #define U64_C(x) x ## ULL +#define BUILD_BUG() CTASSERT(0) #define BUILD_BUG_ON(x) CTASSERT(!(x)) #define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) From owner-svn-src-head@freebsd.org Sun Mar 4 18:21: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 4BB2EF24468; Sun, 4 Mar 2018 18:21:22 +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 B5D2087ED5; Sun, 4 Mar 2018 18:21:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0C6218F4A; Sun, 4 Mar 2018 18:21:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24ILLdu090157; Sun, 4 Mar 2018 18:21:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24ILLno090156; Sun, 4 Mar 2018 18:21:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041821.w24ILLno090156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330393 - 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: 330393 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:21:22 -0000 Author: hselasky Date: Sun Mar 4 18:21:21 2018 New Revision: 330393 URL: https://svnweb.freebsd.org/changeset/base/330393 Log: Implement __MODULE_STRING() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/module.h Modified: head/sys/compat/linuxkpi/common/include/linux/module.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/module.h Sun Mar 4 18:19:44 2018 (r330392) +++ head/sys/compat/linuxkpi/common/include/linux/module.h Sun Mar 4 18:21:21 2018 (r330393) @@ -53,6 +53,7 @@ #define EXPORT_SYMBOL(name) #define EXPORT_SYMBOL_GPL(name) +#define __MODULE_STRING(x) __stringify(x) /* OFED pre-module initialization */ #define SI_SUB_OFED_PREINIT (SI_SUB_ROOT_CONF - 2) From owner-svn-src-head@freebsd.org Sun Mar 4 18:27: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 7C9B1F25027; Sun, 4 Mar 2018 18:27:51 +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 27EAE68403; Sun, 4 Mar 2018 18:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22DC018FBC; Sun, 4 Mar 2018 18:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24IRpSR092608; Sun, 4 Mar 2018 18:27:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24IRpQ8092607; Sun, 4 Mar 2018 18:27:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041827.w24IRpQ8092607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330394 - 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: 330394 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:27:51 -0000 Author: hselasky Date: Sun Mar 4 18:27:50 2018 New Revision: 330394 URL: https://svnweb.freebsd.org/changeset/base/330394 Log: Implement pr_err_ratelimited() function macro in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h Modified: head/sys/compat/linuxkpi/common/include/linux/printk.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/printk.h Sun Mar 4 18:21:21 2018 (r330393) +++ head/sys/compat/linuxkpi/common/include/linux/printk.h Sun Mar 4 18:27:50 2018 (r330394) @@ -118,4 +118,7 @@ print_hex_dump_bytes(const char *prefix_str, const int __retval; \ }) +#define pr_err_ratelimited(fmt, ...) \ + printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) + #endif /* _LINUX_PRINTK_H_ */ From owner-svn-src-head@freebsd.org Sun Mar 4 18:51: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 330E3F272BE; Sun, 4 Mar 2018 18:51:44 +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 D9532696A5; Sun, 4 Mar 2018 18:51:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D43EA1945D; Sun, 4 Mar 2018 18:51:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24IphmE006859; Sun, 4 Mar 2018 18:51:43 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24IphJG006857; Sun, 4 Mar 2018 18:51:43 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041851.w24IphJG006857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330395 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 330395 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:51:44 -0000 Author: hselasky Date: Sun Mar 4 18:51:43 2018 New Revision: 330395 URL: https://svnweb.freebsd.org/changeset/base/330395 Log: Implement DEFINE_WAIT_FUNC() function macro and default_wake_function() in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h head/sys/compat/linuxkpi/common/src/linux_schedule.c Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Sun Mar 4 18:27:50 2018 (r330394) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Sun Mar 4 18:51:43 2018 (r330395) @@ -76,13 +76,17 @@ struct wait_queue_head { * renamed and furthermore must be the default wait queue callback. */ extern wait_queue_func_t autoremove_wake_function; +extern wait_queue_func_t default_wake_function; -#define DEFINE_WAIT(name) \ +#define DEFINE_WAIT_FUNC(name, function) \ wait_queue_t name = { \ .private = current, \ - .func = autoremove_wake_function, \ + .func = function, \ .task_list = LINUX_LIST_HEAD_INIT(name.task_list) \ } + +#define DEFINE_WAIT(name) \ + DEFINE_WAIT_FUNC(name, autoremove_wake_function) #define DECLARE_WAITQUEUE(name, task) \ wait_queue_t name = { \ Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_schedule.c Sun Mar 4 18:27:50 2018 (r330394) +++ head/sys/compat/linuxkpi/common/src/linux_schedule.c Sun Mar 4 18:51:43 2018 (r330395) @@ -176,6 +176,13 @@ autoremove_wake_function(wait_queue_t *wq, unsigned in return (ret); } +int +default_wake_function(wait_queue_t *wq, unsigned int state, int flags, + void *key __unused) +{ + return (wake_up_task(wq->private, state)); +} + void linux_wake_up(wait_queue_head_t *wqh, unsigned int state, int nr, bool locked) { From owner-svn-src-head@freebsd.org Sun Mar 4 18:53: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 E017CF27759; Sun, 4 Mar 2018 18:53:41 +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 8A40A69919; Sun, 4 Mar 2018 18:53:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8268B19497; Sun, 4 Mar 2018 18:53:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24Irfm3007663; Sun, 4 Mar 2018 18:53:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24Irf3w007662; Sun, 4 Mar 2018 18:53:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041853.w24Irf3w007662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 18:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330396 - 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: 330396 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:53:42 -0000 Author: hselasky Date: Sun Mar 4 18:53:41 2018 New Revision: 330396 URL: https://svnweb.freebsd.org/changeset/base/330396 Log: Keep the old SLAB_DESTROY_BY_RCU macro definition around in the LinuxKPI to avoid compilation breakage in external kernel modules. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h Modified: head/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Mar 4 18:51:43 2018 (r330395) +++ head/sys/compat/linuxkpi/common/include/linux/slab.h Sun Mar 4 18:53:41 2018 (r330396) @@ -82,6 +82,9 @@ struct linux_kmem_cache { #define SLAB_TYPESAFE_BY_RCU (1 << 1) #define SLAB_RECLAIM_ACCOUNT (1 << 2) +#define SLAB_DESTROY_BY_RCU \ + SLAB_TYPESAFE_BY_RCU + static inline gfp_t linux_check_m_flags(gfp_t flags) { From owner-svn-src-head@freebsd.org Sun Mar 4 18:58: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 6E2F9F27CFA; Sun, 4 Mar 2018 18:58:25 +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 17C5E69B63; Sun, 4 Mar 2018 18:58:25 +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 032511949C; Sun, 4 Mar 2018 18:58:25 +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 w24IwOLQ007880; Sun, 4 Mar 2018 18:58:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24IwOQK007879; Sun, 4 Mar 2018 18:58:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803041858.w24IwOQK007879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 18:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330397 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330397 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:58:25 -0000 Author: ian Date: Sun Mar 4 18:58:24 2018 New Revision: 330397 URL: https://svnweb.freebsd.org/changeset/base/330397 Log: Fix a paste-o: use the IICBUS version constants, not IICBB bitbang driver's. Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Sun Mar 4 18:53:41 2018 (r330396) +++ head/sys/dev/iicbus/nxprtc.c Sun Mar 4 18:58:24 2018 (r330397) @@ -823,4 +823,4 @@ static devclass_t nxprtc_devclass; DRIVER_MODULE(nxprtc, iicbus, nxprtc_driver, nxprtc_devclass, NULL, NULL); MODULE_VERSION(nxprtc, 1); -MODULE_DEPEND(nxprtc, iicbus, IICBB_MINVER, IICBB_PREFVER, IICBB_MAXVER); +MODULE_DEPEND(nxprtc, iicbus, IICBUS_MINVER, IICBUS_PREFVER, IICBUS_MAXVER); From owner-svn-src-head@freebsd.org Sun Mar 4 19:07: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 67DDEF296A3; Sun, 4 Mar 2018 19:07:11 +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 1A8126A0B9; Sun, 4 Mar 2018 19:07:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 113D219643; Sun, 4 Mar 2018 19:07:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24J7AIq012604; Sun, 4 Mar 2018 19:07:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24J7ALe012603; Sun, 4 Mar 2018 19:07:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041907.w24J7ALe012603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 19:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330398 - 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: 330398 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:07:11 -0000 Author: hselasky Date: Sun Mar 4 19:07:10 2018 New Revision: 330398 URL: https://svnweb.freebsd.org/changeset/base/330398 Log: Implement wait_event_lock_irq() macro function in the LinuxKPI. MFC after: 1 week Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/wait.h Sun Mar 4 18:58:24 2018 (r330397) +++ head/sys/compat/linuxkpi/common/include/linux/wait.h Sun Mar 4 19:07:10 2018 (r330398) @@ -194,11 +194,19 @@ int linux_wait_event_common(wait_queue_head_t *, wait_ }) /* - * Hold the (locked) spinlock when testing the cond. + * The passed spinlock is held when testing the condition. */ #define wait_event_interruptible_lock_irq(wqh, cond, lock) ({ \ __wait_event_common(wqh, cond, MAX_SCHEDULE_TIMEOUT, \ TASK_INTERRUPTIBLE, &(lock)); \ +}) + +/* + * The passed spinlock is held when testing the condition. + */ +#define wait_event_lock_irq(wqh, cond, lock) ({ \ + __wait_event_common(wqh, cond, MAX_SCHEDULE_TIMEOUT, \ + TASK_UNINTERRUPTIBLE, &(lock)); \ }) static inline void From owner-svn-src-head@freebsd.org Sun Mar 4 19:10: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 79C04F29A80; Sun, 4 Mar 2018 19:10:31 +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 2BC656A3A6; Sun, 4 Mar 2018 19:10:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2280919648; Sun, 4 Mar 2018 19:10:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24JAUqs012966; Sun, 4 Mar 2018 19:10:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24JAUV7012965; Sun, 4 Mar 2018 19:10:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041910.w24JAUV7012965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 19:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330399 - 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: 330399 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:10:31 -0000 Author: hselasky Date: Sun Mar 4 19:10:30 2018 New Revision: 330399 URL: https://svnweb.freebsd.org/changeset/base/330399 Log: Stub kernel_param_lock() and kernel_param_unlock() in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Modified: head/sys/compat/linuxkpi/common/include/linux/moduleparam.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Sun Mar 4 19:07:10 2018 (r330398) +++ head/sys/compat/linuxkpi/common/include/linux/moduleparam.h Sun Mar 4 19:10:30 2018 (r330399) @@ -125,6 +125,9 @@ #define MODULE_PARM_DESC(name, desc) \ const char LINUXKPI_PARAM_DESC(name)[] = { desc } +#define kernel_param_lock(...) do {} while (0) +#define kernel_param_unlock(...) do {} while (0) + SYSCTL_DECL(_compat_linuxkpi); #endif /* _LINUX_MODULEPARAM_H_ */ From owner-svn-src-head@freebsd.org Sun Mar 4 19:12: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 19D40F29F42; Sun, 4 Mar 2018 19:12:55 +0000 (UTC) (envelope-from mjg@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 B58636A8CE; Sun, 4 Mar 2018 19:12:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB42E197D8; Sun, 4 Mar 2018 19:12:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24JCsd7018131; Sun, 4 Mar 2018 19:12:54 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24JCsaa018130; Sun, 4 Mar 2018 19:12:54 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201803041912.w24JCsaa018130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 4 Mar 2018 19:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330400 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330400 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:12:55 -0000 Author: mjg Date: Sun Mar 4 19:12:54 2018 New Revision: 330400 URL: https://svnweb.freebsd.org/changeset/base/330400 Log: lockmgr: start decomposing the main routine The main routine takes 8 args, 3 of which are almost the same for most uses. This in particular pushes it above the limit of 6 arguments passable through registers on amd64 making it impossible to tail call. This is a prerequisite for further cleanups. Tested by: pho Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sun Mar 4 19:10:30 2018 (r330399) +++ head/sys/kern/kern_lock.c Sun Mar 4 19:12:54 2018 (r330400) @@ -160,11 +160,31 @@ struct lock_class lock_class_lockmgr = { #endif }; +struct lockmgr_wait { + const char *iwmesg; + int ipri; + int itimo; +}; + static bool __always_inline lockmgr_slock_try(struct lock *lk, uintptr_t *xp, int flags); -static bool __always_inline lockmgr_sunlock_try(struct lock *lk, uintptr_t x); +static bool __always_inline lockmgr_sunlock_try(struct lock *lk, uintptr_t *xp); static void +lockmgr_exit(u_int flags, struct lock_object *ilk, int wakeup_swapper) +{ + struct lock_class *class; + + if (flags & LK_INTERLOCK) { + class = LOCK_CLASS(ilk); + class->lc_unlock(ilk); + } + + if (__predict_false(wakeup_swapper)) + kick_proc0(); +} + +static void lockmgr_note_shared_acquire(struct lock *lk, int contested, uint64_t waittime, const char *file, int line, int flags) { @@ -295,7 +315,7 @@ wakeupshlk(struct lock *lk, const char *file, int line wakeup_swapper = 0; for (;;) { x = lk->lk_lock; - if (lockmgr_sunlock_try(lk, x)) + if (lockmgr_sunlock_try(lk, &x)) break; /* @@ -502,7 +522,7 @@ lockmgr_slock_try(struct lock *lk, uintptr_t *xp, int } static bool __always_inline -lockmgr_sunlock_try(struct lock *lk, uintptr_t x) +lockmgr_sunlock_try(struct lock *lk, uintptr_t *xp) { for (;;) { @@ -510,9 +530,9 @@ lockmgr_sunlock_try(struct lock *lk, uintptr_t x) * If there is more than one shared lock held, just drop one * and return. */ - if (LK_SHARERS(x) > 1) { - if (atomic_fcmpset_rel_ptr(&lk->lk_lock, &x, - x - LK_ONE_SHARER)) + if (LK_SHARERS(*xp) > 1) { + if (atomic_fcmpset_rel_ptr(&lk->lk_lock, xp, + *xp - LK_ONE_SHARER)) return (true); continue; } @@ -521,10 +541,10 @@ lockmgr_sunlock_try(struct lock *lk, uintptr_t x) * If there are not waiters on the exclusive queue, drop the * lock quickly. */ - if ((x & LK_ALL_WAITERS) == 0) { - MPASS((x & ~LK_EXCLUSIVE_SPINNERS) == + if ((*xp & LK_ALL_WAITERS) == 0) { + MPASS((*xp & ~LK_EXCLUSIVE_SPINNERS) == LK_SHARERS_LOCK(1)); - if (atomic_fcmpset_rel_ptr(&lk->lk_lock, &x, + if (atomic_fcmpset_rel_ptr(&lk->lk_lock, xp, LK_UNLOCKED)) return (true); continue; @@ -534,12 +554,373 @@ lockmgr_sunlock_try(struct lock *lk, uintptr_t x) return (false); } +static __noinline int +lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, + const char *file, int line, struct lockmgr_wait *lwa) +{ + uintptr_t tid, x; + int error = 0; + const char *iwmesg; + int ipri, itimo; + +#ifdef LOCK_PROFILING + uint64_t waittime = 0; + int contested = 0; +#endif + + if (__predict_false(panicstr != NULL)) + goto out; + + tid = (uintptr_t)curthread; + + if (LK_CAN_WITNESS(flags)) + WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, + file, line, flags & LK_INTERLOCK ? ilk : NULL); + for (;;) { + if (lockmgr_slock_try(lk, &x, flags)) + break; +#ifdef HWPMC_HOOKS + PMC_SOFT_CALL( , , lock, failed); +#endif + lock_profile_obtain_lock_failed(&lk->lock_object, + &contested, &waittime); + + /* + * If the lock is already held by curthread in + * exclusive way avoid a deadlock. + */ + if (LK_HOLDER(x) == tid) { + LOCK_LOG2(lk, + "%s: %p already held in exclusive mode", + __func__, lk); + error = EDEADLK; + break; + } + + /* + * If the lock is expected to not sleep just give up + * and return. + */ + if (LK_TRYOP(flags)) { + LOCK_LOG2(lk, "%s: %p fails the try operation", + __func__, lk); + error = EBUSY; + break; + } + + /* + * Acquire the sleepqueue chain lock because we + * probabilly will need to manipulate waiters flags. + */ + sleepq_lock(&lk->lock_object); + x = lk->lk_lock; + + /* + * if the lock can be acquired in shared mode, try + * again. + */ + if (LK_CAN_SHARE(x, flags)) { + sleepq_release(&lk->lock_object); + continue; + } + + /* + * Try to set the LK_SHARED_WAITERS flag. If we fail, + * loop back and retry. + */ + if ((x & LK_SHARED_WAITERS) == 0) { + if (!atomic_cmpset_acq_ptr(&lk->lk_lock, x, + x | LK_SHARED_WAITERS)) { + sleepq_release(&lk->lock_object); + continue; + } + LOCK_LOG2(lk, "%s: %p set shared waiters flag", + __func__, lk); + } + + if (lwa == NULL) { + iwmesg = lk->lock_object.lo_name; + ipri = lk->lk_pri; + itimo = lk->lk_timo; + } else { + iwmesg = lwa->iwmesg; + ipri = lwa->ipri; + itimo = lwa->itimo; + } + + /* + * As far as we have been unable to acquire the + * shared lock and the shared waiters flag is set, + * we will sleep. + */ + error = sleeplk(lk, flags, ilk, iwmesg, ipri, itimo, + SQ_SHARED_QUEUE); + flags &= ~LK_INTERLOCK; + if (error) { + LOCK_LOG3(lk, + "%s: interrupted sleep for %p with %d", + __func__, lk, error); + break; + } + LOCK_LOG2(lk, "%s: %p resuming from the sleep queue", + __func__, lk); + } + if (error == 0) { +#ifdef LOCK_PROFILING + lockmgr_note_shared_acquire(lk, contested, waittime, + file, line, flags); +#else + lockmgr_note_shared_acquire(lk, 0, 0, file, line, + flags); +#endif + } + +out: + lockmgr_exit(flags, ilk, 0); + return (error); +} + +static __noinline int +lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, + const char *file, int line, struct lockmgr_wait *lwa) +{ + struct lock_class *class; + uintptr_t tid, x, v; + int error = 0; + const char *iwmesg; + int ipri, itimo; + +#ifdef LOCK_PROFILING + uint64_t waittime = 0; + int contested = 0; +#endif + + if (__predict_false(panicstr != NULL)) + goto out; + + tid = (uintptr_t)curthread; + + if (LK_CAN_WITNESS(flags)) + WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER | + LOP_EXCLUSIVE, file, line, flags & LK_INTERLOCK ? + ilk : NULL); + + /* + * If curthread already holds the lock and this one is + * allowed to recurse, simply recurse on it. + */ + if (lockmgr_xlocked(lk)) { + if ((flags & LK_CANRECURSE) == 0 && + (lk->lock_object.lo_flags & LO_RECURSABLE) == 0) { + /* + * If the lock is expected to not panic just + * give up and return. + */ + if (LK_TRYOP(flags)) { + LOCK_LOG2(lk, + "%s: %p fails the try operation", + __func__, lk); + error = EBUSY; + goto out; + } + if (flags & LK_INTERLOCK) { + class = LOCK_CLASS(ilk); + class->lc_unlock(ilk); + } + panic("%s: recursing on non recursive lockmgr %s @ %s:%d\n", + __func__, iwmesg, file, line); + } + lk->lk_recurse++; + LOCK_LOG2(lk, "%s: %p recursing", __func__, lk); + LOCK_LOG_LOCK("XLOCK", &lk->lock_object, 0, + lk->lk_recurse, file, line); + WITNESS_LOCK(&lk->lock_object, LOP_EXCLUSIVE | + LK_TRYWIT(flags), file, line); + TD_LOCKS_INC(curthread); + goto out; + } + + for (;;) { + if (lk->lk_lock == LK_UNLOCKED && + atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) + break; +#ifdef HWPMC_HOOKS + PMC_SOFT_CALL( , , lock, failed); +#endif + lock_profile_obtain_lock_failed(&lk->lock_object, + &contested, &waittime); + + /* + * If the lock is expected to not sleep just give up + * and return. + */ + if (LK_TRYOP(flags)) { + LOCK_LOG2(lk, "%s: %p fails the try operation", + __func__, lk); + error = EBUSY; + break; + } + + /* + * Acquire the sleepqueue chain lock because we + * probabilly will need to manipulate waiters flags. + */ + sleepq_lock(&lk->lock_object); + x = lk->lk_lock; + + /* + * if the lock has been released while we spun on + * the sleepqueue chain lock just try again. + */ + if (x == LK_UNLOCKED) { + sleepq_release(&lk->lock_object); + continue; + } + + /* + * The lock can be in the state where there is a + * pending queue of waiters, but still no owner. + * This happens when the lock is contested and an + * owner is going to claim the lock. + * If curthread is the one successfully acquiring it + * claim lock ownership and return, preserving waiters + * flags. + */ + v = x & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); + if ((x & ~v) == LK_UNLOCKED) { + v &= ~LK_EXCLUSIVE_SPINNERS; + if (atomic_cmpset_acq_ptr(&lk->lk_lock, x, + tid | v)) { + sleepq_release(&lk->lock_object); + LOCK_LOG2(lk, + "%s: %p claimed by a new writer", + __func__, lk); + break; + } + sleepq_release(&lk->lock_object); + continue; + } + + /* + * Try to set the LK_EXCLUSIVE_WAITERS flag. If we + * fail, loop back and retry. + */ + if ((x & LK_EXCLUSIVE_WAITERS) == 0) { + if (!atomic_cmpset_ptr(&lk->lk_lock, x, + x | LK_EXCLUSIVE_WAITERS)) { + sleepq_release(&lk->lock_object); + continue; + } + LOCK_LOG2(lk, "%s: %p set excl waiters flag", + __func__, lk); + } + + if (lwa == NULL) { + iwmesg = lk->lock_object.lo_name; + ipri = lk->lk_pri; + itimo = lk->lk_timo; + } else { + iwmesg = lwa->iwmesg; + ipri = lwa->ipri; + itimo = lwa->itimo; + } + + /* + * As far as we have been unable to acquire the + * exclusive lock and the exclusive waiters flag + * is set, we will sleep. + */ + error = sleeplk(lk, flags, ilk, iwmesg, ipri, itimo, + SQ_EXCLUSIVE_QUEUE); + flags &= ~LK_INTERLOCK; + if (error) { + LOCK_LOG3(lk, + "%s: interrupted sleep for %p with %d", + __func__, lk, error); + break; + } + LOCK_LOG2(lk, "%s: %p resuming from the sleep queue", + __func__, lk); + } + if (error == 0) { +#ifdef LOCK_PROFILING + lockmgr_note_exclusive_acquire(lk, contested, waittime, + file, line, flags); +#else + lockmgr_note_exclusive_acquire(lk, 0, 0, file, line, + flags); +#endif + } + +out: + lockmgr_exit(flags, ilk, 0); + return (error); +} + +static __noinline int +lockmgr_upgrade(struct lock *lk, u_int flags, struct lock_object *ilk, + const char *file, int line, struct lockmgr_wait *lwa) +{ + uintptr_t tid, x, v; + int error = 0; + int wakeup_swapper = 0; + int op; + + if (__predict_false(panicstr != NULL)) + goto out; + + tid = (uintptr_t)curthread; + + _lockmgr_assert(lk, KA_SLOCKED, file, line); + v = lk->lk_lock; + x = v & LK_ALL_WAITERS; + v &= LK_EXCLUSIVE_SPINNERS; + + /* + * Try to switch from one shared lock to an exclusive one. + * We need to preserve waiters flags during the operation. + */ + if (atomic_cmpset_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x | v, + tid | x)) { + LOCK_LOG_LOCK("XUPGRADE", &lk->lock_object, 0, 0, file, + line); + WITNESS_UPGRADE(&lk->lock_object, LOP_EXCLUSIVE | + LK_TRYWIT(flags), file, line); + TD_SLOCKS_DEC(curthread); + goto out; + } + + op = flags & LK_TYPE_MASK; + + /* + * In LK_TRYUPGRADE mode, do not drop the lock, + * returning EBUSY instead. + */ + if (op == LK_TRYUPGRADE) { + LOCK_LOG2(lk, "%s: %p failed the nowait upgrade", + __func__, lk); + error = EBUSY; + goto out; + } + + /* + * We have been unable to succeed in upgrading, so just + * give up the shared lock. + */ + wakeup_swapper |= wakeupshlk(lk, file, line); + error = lockmgr_xlock_hard(lk, flags, ilk, file, line, lwa); + flags &= ~LK_INTERLOCK; +out: + lockmgr_exit(flags, ilk, wakeup_swapper); + return (error); +} + int lockmgr_lock_fast_path(struct lock *lk, u_int flags, struct lock_object *ilk, const char *file, int line) { struct lock_class *class; - uintptr_t x, v, tid; + uintptr_t x, tid; u_int op; bool locked; @@ -556,6 +937,9 @@ lockmgr_lock_fast_path(struct lock *lk, u_int flags, s lockmgr_note_shared_acquire(lk, 0, 0, file, line, flags); locked = true; + } else { + return (lockmgr_slock_hard(lk, flags, ilk, file, line, + NULL)); } break; case LK_EXCLUSIVE: @@ -569,21 +953,14 @@ lockmgr_lock_fast_path(struct lock *lk, u_int flags, s lockmgr_note_exclusive_acquire(lk, 0, 0, file, line, flags); locked = true; + } else { + return (lockmgr_xlock_hard(lk, flags, ilk, file, line, + NULL)); } break; case LK_UPGRADE: case LK_TRYUPGRADE: - _lockmgr_assert(lk, KA_SLOCKED, file, line); - tid = (uintptr_t)curthread; - v = lk->lk_lock; - x = v & LK_ALL_WAITERS; - v &= LK_EXCLUSIVE_SPINNERS; - if (atomic_cmpset_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x | v, - tid | x)) { - lockmgr_note_exclusive_upgrade(lk, file, line, flags); - locked = true; - } - break; + return (lockmgr_upgrade(lk, flags, ilk, file, line, NULL)); default: break; } @@ -599,6 +976,127 @@ lockmgr_lock_fast_path(struct lock *lk, u_int flags, s } } +static __noinline int +lockmgr_sunlock_hard(struct lock *lk, uintptr_t x, u_int flags, struct lock_object *ilk, + const char *file, int line) + +{ + int wakeup_swapper = 0; + + if (__predict_false(panicstr != NULL)) + goto out; + + wakeup_swapper = wakeupshlk(lk, file, line); + +out: + lockmgr_exit(flags, ilk, wakeup_swapper); + return (0); +} + +static __noinline int +lockmgr_xunlock_hard(struct lock *lk, uintptr_t x, u_int flags, struct lock_object *ilk, + const char *file, int line) +{ + uintptr_t tid, v; + int wakeup_swapper = 0; + u_int realexslp; + int queue; + + if (__predict_false(panicstr != NULL)) + goto out; + + tid = (uintptr_t)curthread; + + /* + * As first option, treact the lock as if it has not + * any waiter. + * Fix-up the tid var if the lock has been disowned. + */ + if (LK_HOLDER(x) == LK_KERNPROC) + tid = LK_KERNPROC; + else { + WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, file, line); + TD_LOCKS_DEC(curthread); + } + LOCK_LOG_LOCK("XUNLOCK", &lk->lock_object, 0, lk->lk_recurse, file, line); + + /* + * The lock is held in exclusive mode. + * If the lock is recursed also, then unrecurse it. + */ + if (lockmgr_xlocked(lk) && lockmgr_recursed(lk)) { + LOCK_LOG2(lk, "%s: %p unrecursing", __func__, lk); + lk->lk_recurse--; + goto out; + } + if (tid != LK_KERNPROC) + lock_profile_release_lock(&lk->lock_object); + + if (atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) + goto out; + + sleepq_lock(&lk->lock_object); + x = lk->lk_lock; + v = LK_UNLOCKED; + + /* + * If the lock has exclusive waiters, give them + * preference in order to avoid deadlock with + * shared runners up. + * If interruptible sleeps left the exclusive queue + * empty avoid a starvation for the threads sleeping + * on the shared queue by giving them precedence + * and cleaning up the exclusive waiters bit anyway. + * Please note that lk_exslpfail count may be lying + * about the real number of waiters with the + * LK_SLEEPFAIL flag on because they may be used in + * conjunction with interruptible sleeps so + * lk_exslpfail might be considered an 'upper limit' + * bound, including the edge cases. + */ + MPASS((x & LK_EXCLUSIVE_SPINNERS) == 0); + realexslp = sleepq_sleepcnt(&lk->lock_object, SQ_EXCLUSIVE_QUEUE); + if ((x & LK_EXCLUSIVE_WAITERS) != 0 && realexslp != 0) { + if (lk->lk_exslpfail < realexslp) { + lk->lk_exslpfail = 0; + queue = SQ_EXCLUSIVE_QUEUE; + v |= (x & LK_SHARED_WAITERS); + } else { + lk->lk_exslpfail = 0; + LOCK_LOG2(lk, + "%s: %p has only LK_SLEEPFAIL sleepers", + __func__, lk); + LOCK_LOG2(lk, + "%s: %p waking up threads on the exclusive queue", + __func__, lk); + wakeup_swapper = sleepq_broadcast(&lk->lock_object, + SLEEPQ_LK, 0, SQ_EXCLUSIVE_QUEUE); + queue = SQ_SHARED_QUEUE; + } + } else { + + /* + * Exclusive waiters sleeping with LK_SLEEPFAIL + * on and using interruptible sleeps/timeout + * may have left spourious lk_exslpfail counts + * on, so clean it up anyway. + */ + lk->lk_exslpfail = 0; + queue = SQ_SHARED_QUEUE; + } + + LOCK_LOG3(lk, "%s: %p waking up threads on the %s queue", + __func__, lk, queue == SQ_SHARED_QUEUE ? "shared" : + "exclusive"); + atomic_store_rel_ptr(&lk->lk_lock, v); + wakeup_swapper |= sleepq_broadcast(&lk->lock_object, SLEEPQ_LK, 0, queue); + sleepq_release(&lk->lock_object); + +out: + lockmgr_exit(flags, ilk, wakeup_swapper); + return (0); +} + int lockmgr_unlock_fast_path(struct lock *lk, u_int flags, struct lock_object *ilk) { @@ -615,9 +1113,11 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, unlocked = false; x = lk->lk_lock; if (__predict_true(x & LK_SHARE) != 0) { - if (lockmgr_sunlock_try(lk, x)) { + if (lockmgr_sunlock_try(lk, &x)) { lockmgr_note_shared_release(lk, file, line); unlocked = true; + } else { + return (lockmgr_sunlock_hard(lk, x, flags, ilk, file, line)); } } else { tid = (uintptr_t)curthread; @@ -625,18 +1125,15 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, atomic_cmpset_rel_ptr(&lk->lk_lock, tid, LK_UNLOCKED)) { lockmgr_note_exclusive_release(lk, file, line); unlocked = true; + } else { + return (lockmgr_xunlock_hard(lk, x, flags, ilk, file, line)); } } - if (__predict_true(unlocked)) { - if (__predict_false(flags & LK_INTERLOCK)) { - class = LOCK_CLASS(ilk); - class->lc_unlock(ilk); - } - return (0); - } else { - return (__lockmgr_args(lk, flags | LK_RELEASE, ilk, LK_WMESG_DEFAULT, - LK_PRIO_DEFAULT, LK_TIMO_DEFAULT, LOCK_FILE, LOCK_LINE)); + if (__predict_false(flags & LK_INTERLOCK)) { + class = LOCK_CLASS(ilk); + class->lc_unlock(ilk); } + return (0); } int @@ -644,6 +1141,7 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo const char *wmesg, int pri, int timo, const char *file, int line) { GIANT_DECLARE; + struct lockmgr_wait lwa; struct lock_class *class; const char *iwmesg; uintptr_t tid, v, x; @@ -661,6 +1159,10 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo ipri = (pri == LK_PRIO_DEFAULT) ? lk->lk_pri : pri; itimo = (timo == LK_TIMO_DEFAULT) ? lk->lk_timo : timo; + lwa.iwmesg = iwmesg; + lwa.ipri = ipri; + lwa.itimo = itimo; + MPASS((flags & ~LK_TOTAL_MASK) == 0); KASSERT((op & (op - 1)) == 0, ("%s: Invalid requested operation @ %s:%d", __func__, file, line)); @@ -701,278 +1203,14 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo wakeup_swapper = 0; switch (op) { case LK_SHARED: - if (LK_CAN_WITNESS(flags)) - WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, - file, line, flags & LK_INTERLOCK ? ilk : NULL); - for (;;) { - if (lockmgr_slock_try(lk, &x, flags)) - break; -#ifdef HWPMC_HOOKS - PMC_SOFT_CALL( , , lock, failed); -#endif - lock_profile_obtain_lock_failed(&lk->lock_object, - &contested, &waittime); - - /* - * If the lock is already held by curthread in - * exclusive way avoid a deadlock. - */ - if (LK_HOLDER(x) == tid) { - LOCK_LOG2(lk, - "%s: %p already held in exclusive mode", - __func__, lk); - error = EDEADLK; - break; - } - - /* - * If the lock is expected to not sleep just give up - * and return. - */ - if (LK_TRYOP(flags)) { - LOCK_LOG2(lk, "%s: %p fails the try operation", - __func__, lk); - error = EBUSY; - break; - } - - /* - * Acquire the sleepqueue chain lock because we - * probabilly will need to manipulate waiters flags. - */ - sleepq_lock(&lk->lock_object); - x = lk->lk_lock; - - /* - * if the lock can be acquired in shared mode, try - * again. - */ - if (LK_CAN_SHARE(x, flags)) { - sleepq_release(&lk->lock_object); - continue; - } - - /* - * Try to set the LK_SHARED_WAITERS flag. If we fail, - * loop back and retry. - */ - if ((x & LK_SHARED_WAITERS) == 0) { - if (!atomic_cmpset_acq_ptr(&lk->lk_lock, x, - x | LK_SHARED_WAITERS)) { - sleepq_release(&lk->lock_object); - continue; - } - LOCK_LOG2(lk, "%s: %p set shared waiters flag", - __func__, lk); - } - - /* - * As far as we have been unable to acquire the - * shared lock and the shared waiters flag is set, - * we will sleep. - */ - error = sleeplk(lk, flags, ilk, iwmesg, ipri, itimo, - SQ_SHARED_QUEUE); - flags &= ~LK_INTERLOCK; - if (error) { - LOCK_LOG3(lk, - "%s: interrupted sleep for %p with %d", - __func__, lk, error); - break; - } - LOCK_LOG2(lk, "%s: %p resuming from the sleep queue", - __func__, lk); - } - if (error == 0) { -#ifdef LOCK_PROFILING - lockmgr_note_shared_acquire(lk, contested, waittime, - file, line, flags); -#else - lockmgr_note_shared_acquire(lk, 0, 0, file, line, - flags); -#endif - } + return (lockmgr_slock_hard(lk, flags, ilk, file, line, &lwa)); break; case LK_UPGRADE: case LK_TRYUPGRADE: - _lockmgr_assert(lk, KA_SLOCKED, file, line); - v = lk->lk_lock; - x = v & LK_ALL_WAITERS; - v &= LK_EXCLUSIVE_SPINNERS; - - /* - * Try to switch from one shared lock to an exclusive one. - * We need to preserve waiters flags during the operation. - */ - if (atomic_cmpset_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x | v, - tid | x)) { - LOCK_LOG_LOCK("XUPGRADE", &lk->lock_object, 0, 0, file, - line); - WITNESS_UPGRADE(&lk->lock_object, LOP_EXCLUSIVE | - LK_TRYWIT(flags), file, line); - TD_SLOCKS_DEC(curthread); - break; - } - - /* - * In LK_TRYUPGRADE mode, do not drop the lock, - * returning EBUSY instead. - */ - if (op == LK_TRYUPGRADE) { - LOCK_LOG2(lk, "%s: %p failed the nowait upgrade", - __func__, lk); - error = EBUSY; - break; - } - - /* - * We have been unable to succeed in upgrading, so just - * give up the shared lock. - */ - wakeup_swapper |= wakeupshlk(lk, file, line); - - /* FALLTHROUGH */ + return (lockmgr_upgrade(lk, flags, ilk, file, line, &lwa)); + break; case LK_EXCLUSIVE: - if (LK_CAN_WITNESS(flags)) - WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER | - LOP_EXCLUSIVE, file, line, flags & LK_INTERLOCK ? - ilk : NULL); - - /* - * If curthread already holds the lock and this one is - * allowed to recurse, simply recurse on it. - */ - if (lockmgr_xlocked(lk)) { - if ((flags & LK_CANRECURSE) == 0 && - (lk->lock_object.lo_flags & LO_RECURSABLE) == 0) { - - /* - * If the lock is expected to not panic just - * give up and return. - */ - if (LK_TRYOP(flags)) { - LOCK_LOG2(lk, - "%s: %p fails the try operation", - __func__, lk); - error = EBUSY; - break; - } - if (flags & LK_INTERLOCK) - class->lc_unlock(ilk); - panic("%s: recursing on non recursive lockmgr %s @ %s:%d\n", - __func__, iwmesg, file, line); - } - lk->lk_recurse++; - LOCK_LOG2(lk, "%s: %p recursing", __func__, lk); - LOCK_LOG_LOCK("XLOCK", &lk->lock_object, 0, - lk->lk_recurse, file, line); - WITNESS_LOCK(&lk->lock_object, LOP_EXCLUSIVE | - LK_TRYWIT(flags), file, line); - TD_LOCKS_INC(curthread); - break; - } - - for (;;) { - if (lk->lk_lock == LK_UNLOCKED && - atomic_cmpset_acq_ptr(&lk->lk_lock, LK_UNLOCKED, tid)) - break; -#ifdef HWPMC_HOOKS - PMC_SOFT_CALL( , , lock, failed); -#endif - lock_profile_obtain_lock_failed(&lk->lock_object, - &contested, &waittime); - - /* - * If the lock is expected to not sleep just give up - * and return. - */ - if (LK_TRYOP(flags)) { - LOCK_LOG2(lk, "%s: %p fails the try operation", - __func__, lk); - error = EBUSY; - break; - } - - /* - * Acquire the sleepqueue chain lock because we - * probabilly will need to manipulate waiters flags. - */ - sleepq_lock(&lk->lock_object); - x = lk->lk_lock; - - /* - * if the lock has been released while we spun on - * the sleepqueue chain lock just try again. - */ - if (x == LK_UNLOCKED) { - sleepq_release(&lk->lock_object); - continue; - } - - /* - * The lock can be in the state where there is a - * pending queue of waiters, but still no owner. - * This happens when the lock is contested and an - * owner is going to claim the lock. - * If curthread is the one successfully acquiring it - * claim lock ownership and return, preserving waiters - * flags. - */ - v = x & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); - if ((x & ~v) == LK_UNLOCKED) { - v &= ~LK_EXCLUSIVE_SPINNERS; - if (atomic_cmpset_acq_ptr(&lk->lk_lock, x, - tid | v)) { - sleepq_release(&lk->lock_object); - LOCK_LOG2(lk, - "%s: %p claimed by a new writer", - __func__, lk); - break; - } - sleepq_release(&lk->lock_object); - continue; - } - - /* - * Try to set the LK_EXCLUSIVE_WAITERS flag. If we - * fail, loop back and retry. - */ - if ((x & LK_EXCLUSIVE_WAITERS) == 0) { - if (!atomic_cmpset_ptr(&lk->lk_lock, x, - x | LK_EXCLUSIVE_WAITERS)) { - sleepq_release(&lk->lock_object); - continue; - } - LOCK_LOG2(lk, "%s: %p set excl waiters flag", - __func__, lk); - } - - /* - * As far as we have been unable to acquire the - * exclusive lock and the exclusive waiters flag - * is set, we will sleep. - */ - error = sleeplk(lk, flags, ilk, iwmesg, ipri, itimo, - SQ_EXCLUSIVE_QUEUE); - flags &= ~LK_INTERLOCK; - if (error) { - LOCK_LOG3(lk, - "%s: interrupted sleep for %p with %d", - __func__, lk, error); - break; - } - LOCK_LOG2(lk, "%s: %p resuming from the sleep queue", - __func__, lk); - } - if (error == 0) { -#ifdef LOCK_PROFILING - lockmgr_note_exclusive_acquire(lk, contested, waittime, - file, line, flags); -#else - lockmgr_note_exclusive_acquire(lk, 0, 0, file, line, - flags); -#endif - } + return (lockmgr_xlock_hard(lk, flags, ilk, file, line, &lwa)); break; case LK_DOWNGRADE: _lockmgr_assert(lk, KA_XLOCKED, file, line); @@ -1007,103 +1245,11 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo _lockmgr_assert(lk, KA_LOCKED, file, line); x = lk->lk_lock; - if ((x & LK_SHARE) == 0) { - - /* - * As first option, treact the lock as if it has not - * any waiter. - * Fix-up the tid var if the lock has been disowned. - */ - if (LK_HOLDER(x) == LK_KERNPROC) - tid = LK_KERNPROC; - else { - WITNESS_UNLOCK(&lk->lock_object, LOP_EXCLUSIVE, - file, line); - TD_LOCKS_DEC(curthread); - } - LOCK_LOG_LOCK("XUNLOCK", &lk->lock_object, 0, - lk->lk_recurse, file, line); - - /* - * The lock is held in exclusive mode. - * If the lock is recursed also, then unrecurse it. - */ - if (lockmgr_xlocked(lk) && lockmgr_recursed(lk)) { - LOCK_LOG2(lk, "%s: %p unrecursing", __func__, - lk); - lk->lk_recurse--; - break; - } - if (tid != LK_KERNPROC) - lock_profile_release_lock(&lk->lock_object); - - if (atomic_cmpset_rel_ptr(&lk->lk_lock, tid, - LK_UNLOCKED)) - break; - - sleepq_lock(&lk->lock_object); - x = lk->lk_lock; - v = LK_UNLOCKED; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Mar 4 19:15: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 475DFF2A2CB; Sun, 4 Mar 2018 19:15:58 +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 DA6516ABC3; Sun, 4 Mar 2018 19:15:57 +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 932AE2606D0; Sun, 4 Mar 2018 20:15:55 +0100 (CET) Subject: Re: svn commit: r330236 - head/sys/compat/linuxkpi/common/src To: Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803011031.w21AVpNU076475@repo.freebsd.org> <01000161ee9cf3f7-13ba5d11-831e-4a9b-99d7-fd670a35ecb0-000000@email.amazonses.com> From: Hans Petter Selasky Message-ID: <1f719ab8-488c-e541-b0e8-47151aa2d916@selasky.org> Date: Sun, 4 Mar 2018 20:15:53 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <01000161ee9cf3f7-13ba5d11-831e-4a9b-99d7-fd670a35ecb0-000000@email.amazonses.com> 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 Mar 2018 19:15:58 -0000 On 03/04/18 02:25, Colin Percival wrote: > In case the data point is useful: Merging this to stable/11 unbroke S3 > suspend/resume on my laptop (system76 Galago Pro, kabylake, using the > drm-next-kmod port). FYI: Now MFC'ed to stable/11. --HPS From owner-svn-src-head@freebsd.org Sun Mar 4 19:20: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 04416F2A8A4; Sun, 4 Mar 2018 19:20:12 +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 ABCDC6AFA0; Sun, 4 Mar 2018 19:20:11 +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 A6C13197E5; Sun, 4 Mar 2018 19:20:11 +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 w24JKBN4018535; Sun, 4 Mar 2018 19:20:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24JKBTY018534; Sun, 4 Mar 2018 19:20:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803041920.w24JKBTY018534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 19:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330403 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330403 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:20:12 -0000 Author: ian Date: Sun Mar 4 19:20:11 2018 New Revision: 330403 URL: https://svnweb.freebsd.org/changeset/base/330403 Log: Add calls to the new clock_dbgprint_xxx() functions. Modified: head/sys/dev/iicbus/ds1307.c Modified: head/sys/dev/iicbus/ds1307.c ============================================================================== --- head/sys/dev/iicbus/ds1307.c Sun Mar 4 19:17:32 2018 (r330402) +++ head/sys/dev/iicbus/ds1307.c Sun Mar 4 19:20:11 2018 (r330403) @@ -359,6 +359,7 @@ ds1307_gettime(device_t dev, struct timespec *ts) bct.mon = data[DS1307_MONTH] & DS1307_MONTH_MASK; bct.year = data[DS1307_YEAR] & DS1307_YEAR_MASK; + clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_READ, &bct); return (clock_bcd_to_ts(&bct, ts, sc->sc_use_ampm)); } @@ -379,6 +380,7 @@ ds1307_settime(device_t dev, struct timespec *ts) */ ts->tv_sec -= utc_offset(); clock_ts_to_bcd(ts, &bct, sc->sc_use_ampm); + clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_WRITE, &bct); /* If the chip is in AM/PM mode, adjust hour and set flags as needed. */ if (sc->sc_use_ampm) { From owner-svn-src-head@freebsd.org Sun Mar 4 19:23: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 5C73AF2B054; Sun, 4 Mar 2018 19:23:49 +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 049CE6B571; Sun, 4 Mar 2018 19:23:49 +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 F3D0D19974; Sun, 4 Mar 2018 19:23:48 +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 w24JNmbR023381; Sun, 4 Mar 2018 19:23:48 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24JNmS4023380; Sun, 4 Mar 2018 19:23:48 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803041923.w24JNmS4023380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 19:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330404 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330404 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:23:49 -0000 Author: ian Date: Sun Mar 4 19:23:48 2018 New Revision: 330404 URL: https://svnweb.freebsd.org/changeset/base/330404 Log: Add calls to the new clock_dbgprint_xxx() functions. Modified: head/sys/dev/iicbus/ds13rtc.c Modified: head/sys/dev/iicbus/ds13rtc.c ============================================================================== --- head/sys/dev/iicbus/ds13rtc.c Sun Mar 4 19:20:11 2018 (r330403) +++ head/sys/dev/iicbus/ds13rtc.c Sun Mar 4 19:23:48 2018 (r330404) @@ -395,6 +395,7 @@ ds13rtc_gettime(device_t dev, struct timespec *ts) if (sc->use_century) bct.year += (tregs.month & DS13xx_B_MONTH_CENTURY) ? 0x100 : 0; + clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_READ, &bct); err = clock_bcd_to_ts(&bct, ts, sc->use_ampm); return (err); @@ -422,6 +423,7 @@ ds13rtc_settime(device_t dev, struct timespec *ts) return (write_timeword(sc, ts->tv_sec)); clock_ts_to_bcd(ts, &bct, sc->use_ampm); + clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_WRITE, &bct); /* If the chip is in AMPM mode deal with the PM flag. */ pmflags = 0; From owner-svn-src-head@freebsd.org Sun Mar 4 19:25: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 D3887F2B2B4; Sun, 4 Mar 2018 19:25:54 +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 75CC56B74E; Sun, 4 Mar 2018 19:25:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E99519978; Sun, 4 Mar 2018 19:25:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24JPsa7023504; Sun, 4 Mar 2018 19:25:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24JPsVB023503; Sun, 4 Mar 2018 19:25:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803041925.w24JPsVB023503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 19:25:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330405 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330405 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:25:55 -0000 Author: ian Date: Sun Mar 4 19:25:54 2018 New Revision: 330405 URL: https://svnweb.freebsd.org/changeset/base/330405 Log: Oops, fix a paste-o. Modified: head/sys/dev/iicbus/ds13rtc.c Modified: head/sys/dev/iicbus/ds13rtc.c ============================================================================== --- head/sys/dev/iicbus/ds13rtc.c Sun Mar 4 19:23:48 2018 (r330404) +++ head/sys/dev/iicbus/ds13rtc.c Sun Mar 4 19:25:54 2018 (r330405) @@ -395,7 +395,7 @@ ds13rtc_gettime(device_t dev, struct timespec *ts) if (sc->use_century) bct.year += (tregs.month & DS13xx_B_MONTH_CENTURY) ? 0x100 : 0; - clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_READ, &bct); + clock_dbgprint_bcd(sc->dev, CLOCK_DBG_READ, &bct); err = clock_bcd_to_ts(&bct, ts, sc->use_ampm); return (err); @@ -423,7 +423,7 @@ ds13rtc_settime(device_t dev, struct timespec *ts) return (write_timeword(sc, ts->tv_sec)); clock_ts_to_bcd(ts, &bct, sc->use_ampm); - clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_WRITE, &bct); + clock_dbgprint_bcd(sc->dev, CLOCK_DBG_WRITE, &bct); /* If the chip is in AMPM mode deal with the PM flag. */ pmflags = 0; From owner-svn-src-head@freebsd.org Sun Mar 4 19:26: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 D5925F2B3CB; Sun, 4 Mar 2018 19:26:47 +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 84C386B89A; Sun, 4 Mar 2018 19:26:47 +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 7FB3419979; Sun, 4 Mar 2018 19:26:47 +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 w24JQldC023579; Sun, 4 Mar 2018 19:26:47 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24JQl01023578; Sun, 4 Mar 2018 19:26:47 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803041926.w24JQl01023578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 19:26:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330406 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330406 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:26:48 -0000 Author: ian Date: Sun Mar 4 19:26:47 2018 New Revision: 330406 URL: https://svnweb.freebsd.org/changeset/base/330406 Log: Add calls to the new clock_dbgprint_xxx() functions. Modified: head/sys/dev/iicbus/nxprtc.c Modified: head/sys/dev/iicbus/nxprtc.c ============================================================================== --- head/sys/dev/iicbus/nxprtc.c Sun Mar 4 19:25:54 2018 (r330405) +++ head/sys/dev/iicbus/nxprtc.c Sun Mar 4 19:26:47 2018 (r330406) @@ -608,6 +608,7 @@ nxprtc_gettime(device_t dev, struct timespec *ts) sc->flags |= SC_F_CPOL; } + clock_dbgprint_bcd(sc->dev, CLOCK_DBG_READ, &bct); err = clock_bcd_to_ts(&bct, ts, sc->use_ampm); ts->tv_sec += utc_offset(); @@ -648,6 +649,7 @@ nxprtc_settime(device_t dev, struct timespec *ts) ts->tv_sec -= utc_offset(); ts->tv_nsec = 0; clock_ts_to_bcd(ts, &bct, sc->use_ampm); + clock_dbgprint_bcd(sc->dev, CLOCK_DBG_WRITE, &bct); /* On 8563 set the century based on the polarity seen when reading. */ cflag = 0; From owner-svn-src-head@freebsd.org Sun Mar 4 19: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 83FB6F2BC9D; Sun, 4 Mar 2018 19:32:53 +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 33DF96BE7E; Sun, 4 Mar 2018 19:32:53 +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 2EA8A19B21; Sun, 4 Mar 2018 19:32:53 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24JWqWY028170; Sun, 4 Mar 2018 19:32:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24JWqei028169; Sun, 4 Mar 2018 19:32:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803041932.w24JWqei028169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 19:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330407 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330407 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:32:53 -0000 Author: ian Date: Sun Mar 4 19:32:52 2018 New Revision: 330407 URL: https://svnweb.freebsd.org/changeset/base/330407 Log: Add calls to the new clock_dbgprint_xxx() functions. Also, stop applying a local .5 second adjustment to the time, since that is now done by the code in subr_rtc.c. Modified: head/sys/dev/iicbus/ds1672.c Modified: head/sys/dev/iicbus/ds1672.c ============================================================================== --- head/sys/dev/iicbus/ds1672.c Sun Mar 4 19:26:47 2018 (r330406) +++ head/sys/dev/iicbus/ds1672.c Sun Mar 4 19:32:52 2018 (r330407) @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); #define DS1672_CTRL_EOSC (1 << 7) /* Stop/start flag. */ -#define NANOSEC 1000000000 - #define MAX_IIC_DATA_SIZE 4 struct ds1672_softc { @@ -144,8 +142,9 @@ ds1672_gettime(device_t dev, struct timespec *ts) /* counter has seconds since epoch */ ts->tv_sec = (secs[3] << 24) | (secs[2] << 16) | (secs[1] << 8) | (secs[0] << 0); - ts->tv_nsec = NANOSEC / 2; + ts->tv_nsec = 0; } + clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_READ, ts); return (error); } @@ -159,6 +158,8 @@ ds1672_settime(device_t dev, struct timespec *ts) data[2] = (ts->tv_sec >> 16) & 0xff; data[3] = (ts->tv_sec >> 24) & 0xff; + ts->tv_nsec = 0; + clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_WRITE, ts); return (ds1672_write(dev, DS1672_COUNTER, data, 4)); } From owner-svn-src-head@freebsd.org Sun Mar 4 19:42: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 A3AB8F2C92D; Sun, 4 Mar 2018 19:42:50 +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 56D2A6C5E2; Sun, 4 Mar 2018 19:42:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51C7019CB2; Sun, 4 Mar 2018 19:42:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24Jgo5f033225; Sun, 4 Mar 2018 19:42:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24Jgobe033224; Sun, 4 Mar 2018 19:42:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803041942.w24Jgobe033224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 4 Mar 2018 19:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330408 - 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: 330408 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:42:50 -0000 Author: hselasky Date: Sun Mar 4 19:42:50 2018 New Revision: 330408 URL: https://svnweb.freebsd.org/changeset/base/330408 Log: Properly wrap the BUILD_BUG() function macro in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun Mar 4 19:32:52 2018 (r330407) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Sun Mar 4 19:42:50 2018 (r330408) @@ -86,7 +86,7 @@ #define S64_C(x) x ## LL #define U64_C(x) x ## ULL -#define BUILD_BUG() CTASSERT(0) +#define BUILD_BUG() do { CTASSERT(0); } while (0) #define BUILD_BUG_ON(x) CTASSERT(!(x)) #define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) From owner-svn-src-head@freebsd.org Sun Mar 4 20:06: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 2BBA1F2E63E; Sun, 4 Mar 2018 20:06:03 +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 D50B66D5ED; Sun, 4 Mar 2018 20:06:02 +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 CFF0F19FE8; Sun, 4 Mar 2018 20:06:02 +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 w24K622P043585; Sun, 4 Mar 2018 20:06:02 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24K62Zv043582; Sun, 4 Mar 2018 20:06:02 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803042006.w24K62Zv043582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sun, 4 Mar 2018 20:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330409 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 330409 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 20:06:03 -0000 Author: brooks Date: Sun Mar 4 20:06:02 2018 New Revision: 330409 URL: https://svnweb.freebsd.org/changeset/base/330409 Log: Refer to SysV IPC permissions as numeric constants. POSIX defines no macros for these permissions. Also remove unneeded headers from synopsis. PR: 225905 Reviewed by: wblock MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14461 Modified: head/lib/libc/sys/msgget.2 head/lib/libc/sys/semget.2 head/lib/libc/sys/shmget.2 Modified: head/lib/libc/sys/msgget.2 ============================================================================== --- head/lib/libc/sys/msgget.2 Sun Mar 4 19:42:50 2018 (r330408) +++ head/lib/libc/sys/msgget.2 Sun Mar 4 20:06:02 2018 (r330409) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" .\"/ -.Dd July 9, 2009 +.Dd March 4, 2018 .Dt MSGGET 2 .Os .Sh NAME @@ -40,8 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h .In sys/msg.h .Ft int .Fn msgget "key_t key" "int msgflg" @@ -83,7 +81,22 @@ are set to the effective gid of the calling process. .It .Va msg_perm.mode is set to the lower 9 bits of -.Fa msgflg . +.Fa msgflg +which are set by ORing these constants: +.Bl -tag -width 0000 +.It Dv 0400 +Read access for user. +.It Dv 0200 +Write access for user. +.It Dv 0040 +Read access for group. +.It Dv 0020 +Write access for group. +.It Dv 0004 +Read access for other. +.It Dv 0002 +Write access for other. +.El .It .Va msg_cbytes , .Va msg_qnum , Modified: head/lib/libc/sys/semget.2 ============================================================================== --- head/lib/libc/sys/semget.2 Sun Mar 4 19:42:50 2018 (r330408) +++ head/lib/libc/sys/semget.2 Sun Mar 4 20:06:02 2018 (r330409) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2016 +.Dd March 4, 2018 .Dt SEMGET 2 .Os .Sh NAME @@ -34,8 +34,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h -.In sys/ipc.h .In sys/sem.h .Ft int .Fn semget "key_t key" "int nsems" "int flag" @@ -77,23 +75,22 @@ may be used to generate a key from a pathname. .\" Likewise for this section, except SHM_* becomes SEM_*. .\" .Pp -The mode of a newly created IPC object is determined by -.Em OR Ns 'ing -the following constants into the +The mode of a newly created IPC object is determined by ORing these constants +into the .Fa flag argument: -.Bl -tag -width XSEM_WXX6XXX -.It Dv SEM_R +.Bl -tag -width 0000 +.It Dv 0400 Read access for user. -.It Dv SEM_A +.It Dv 0200 Alter access for user. -.It Dv ( SEM_R>>3 ) +.It Dv 0040 Read access for group. -.It Dv ( SEM_A>>3 ) +.It Dv 0020 Alter access for group. -.It Dv ( SEM_R>>6 ) +.It Dv 0004 Read access for other. -.It Dv ( SEM_A>>6 ) +.It Dv 0002 Alter access for other. .El .Pp Modified: head/lib/libc/sys/shmget.2 ============================================================================== --- head/lib/libc/sys/shmget.2 Sun Mar 4 19:42:50 2018 (r330408) +++ head/lib/libc/sys/shmget.2 Sun Mar 4 20:06:02 2018 (r330409) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 12, 2017 +.Dd March 4, 2018 .Dt SHMGET 2 .Os .Sh NAME @@ -34,9 +34,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h -.In sys/stat.h -.In sys/ipc.h .In sys/shm.h .Ft int .Fn shmget "key_t key" "size_t size" "int flag" @@ -75,22 +72,21 @@ may be used to generate a key from a pathname. .El .Pp The mode of a newly created IPC object is determined by -.Em OR Ns 'ing -the following constants into the +which are set by ORing these constants into the .Fa flag argument: -.Bl -tag -width XSHM_WXX6XXX -.It Dv S_IRUSR +.Bl -tag -width 0000 +.It Dv 0400 Read access for owner. -.It Dv S_IWUSR +.It Dv 0200 Write access for owner. -.It Dv S_IRGRP +.It Dv 0040 Read access for group. -.It Dv S_IWGRP +.It Dv 0020 Write access for group. -.It Dv S_IROTH +.It Dv 0004 Read access for other. -.It Dv S_IWOTH +.It Dv 0002 Write access for other. .El .\" @@ -143,5 +139,4 @@ already exists. .Xr shmat 2 , .Xr shmctl 2 , .Xr shmdt 2 , -.Xr stat 2 , .Xr ftok 3 From owner-svn-src-head@freebsd.org Sun Mar 4 20:53: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 62E35F31AF9; Sun, 4 Mar 2018 20:53: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 15D7E6EE75; Sun, 4 Mar 2018 20:53:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F9CB1A7F8; Sun, 4 Mar 2018 20:53:21 +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 w24KrLkA068077; Sun, 4 Mar 2018 20:53:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24KrKsB068070; Sun, 4 Mar 2018 20:53:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803042053.w24KrKsB068070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 4 Mar 2018 20:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330410 - in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 riscv/riscv vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm/arm arm64/arm64 i386/i386 riscv/riscv vm X-SVN-Commit-Revision: 330410 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 20:53:21 -0000 Author: kib Date: Sun Mar 4 20:53:20 2018 New Revision: 330410 URL: https://svnweb.freebsd.org/changeset/base/330410 Log: Unify bulk free operations in several pmaps. Submitted by: Yoshihiro Ota Reviewed by: markj MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D13485 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm/arm/pmap-v6.c head/sys/arm64/arm64/pmap.c head/sys/i386/i386/pmap.c head/sys/riscv/riscv/pmap.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Mar 4 20:06:02 2018 (r330409) +++ head/sys/amd64/amd64/pmap.c Sun Mar 4 20:53:20 2018 (r330410) @@ -2369,20 +2369,6 @@ pmap_qremove(vm_offset_t sva, int count) /*************************************************** * Page table page management routines..... ***************************************************/ -static __inline void -pmap_free_zero_pages(struct spglist *free) -{ - vm_page_t m; - int count; - - for (count = 0; (m = SLIST_FIRST(free)) != NULL; count++) { - SLIST_REMOVE_HEAD(free, plinks.s.ss); - /* Preserve the page's PG_ZERO setting. */ - vm_page_free_toq(m); - } - vm_wire_sub(count); -} - /* * Schedule the specified unused page table page to be freed. Specifically, * add the page to the specified list of pages that will be released to the @@ -3282,7 +3268,7 @@ next_chunk: /* Recycle a freed page table page. */ m_pc->wire_count = 1; } - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); return (m_pc); } @@ -3781,7 +3767,7 @@ pmap_demote_pde_locked(pmap_t pmap, pd_entry_t *pde, v pmap_remove_pde(pmap, pde, sva, &free, lockp); if ((oldpde & PG_G) == 0) pmap_invalidate_pde_page(pmap, sva, oldpde); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#lx" " in pmap %p", va, pmap); return (FALSE); @@ -4183,7 +4169,7 @@ out: pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); pmap_delayed_invl_finished(); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); } /* @@ -4281,7 +4267,7 @@ retry: vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(lock); pmap_delayed_invl_wait(m); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); } /* @@ -4949,7 +4935,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t pmap_invalidate_all(pmap); pmap_delayed_invl_finished(); } - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); if (va >= VM_MAXUSER_ADDRESS) { mt = PHYS_TO_VM_PAGE(*pde & PG_FRAME); if (pmap_insert_pt_page(pmap, mt)) { @@ -4978,7 +4964,7 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t * pages. Invalidate those entries. */ pmap_invalidate_page(pmap, va); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); } CTR2(KTR_PMAP, "pmap_enter_pde: failure for va %#lx" " in pmap %p", va, pmap); @@ -5159,7 +5145,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v * pages. Invalidate those entries. */ pmap_invalidate_page(pmap, va); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); } mpte = NULL; } @@ -5537,7 +5523,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ */ pmap_invalidate_page(dst_pmap, addr); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, + true); } goto out; } @@ -5955,7 +5942,7 @@ pmap_remove_pages(pmap_t pmap) rw_wunlock(lock); pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); } static boolean_t @@ -6440,7 +6427,7 @@ small_mappings: not_cleared < PMAP_TS_REFERENCED_MAX); out: rw_wunlock(lock); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); return (cleared + not_cleared); } Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Sun Mar 4 20:06:02 2018 (r330409) +++ head/sys/arm/arm/pmap-v6.c Sun Mar 4 20:53:20 2018 (r330410) @@ -2550,18 +2550,6 @@ retry: return (m); } -static __inline void -pmap_free_zero_pages(struct spglist *free) -{ - vm_page_t m; - - while ((m = SLIST_FIRST(free)) != NULL) { - SLIST_REMOVE_HEAD(free, plinks.s.ss); - /* Preserve the page's PG_ZERO setting. */ - vm_page_free_toq(m); - } -} - /* * Schedule the specified unused L2 page table page to be freed. Specifically, * add the page to the specified list of pages that will be released to the @@ -2948,7 +2936,7 @@ out: m_pc->wire_count = 1; vm_wire_add(1); } - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); return (m_pc); } @@ -3711,7 +3699,7 @@ pmap_demote_pte1(pmap_t pmap, pt1_entry_t *pte1p, vm_o VM_ALLOC_NORMAL | VM_ALLOC_WIRED)) == NULL) { SLIST_INIT(&free); pmap_remove_pte1(pmap, pte1p, pte1_trunc(va), &free); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); CTR3(KTR_PMAP, "%s: failure for va %#x in pmap %p", __func__, va, pmap); return (FALSE); @@ -4235,7 +4223,7 @@ out: sched_unpin(); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } /* @@ -4309,7 +4297,7 @@ small_mappings: vm_page_aflag_clear(m, PGA_WRITEABLE); sched_unpin(); rw_wunlock(&pvh_global_lock); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } /* @@ -4496,7 +4484,7 @@ pmap_remove_pages(pmap_t pmap) sched_unpin(); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } /* @@ -4605,7 +4593,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v SLIST_INIT(&free); if (pmap_unwire_pt2(pmap, va, mpt2pg, &free)) { pmap_tlb_flush(pmap, va); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } mpt2pg = NULL; @@ -6079,7 +6067,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ if (pmap_unwire_pt2(dst_pmap, addr, dst_mpt2pg, &free)) { pmap_tlb_flush(dst_pmap, addr); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, + false); } goto out; } Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sun Mar 4 20:06:02 2018 (r330409) +++ head/sys/arm64/arm64/pmap.c Sun Mar 4 20:53:20 2018 (r330410) @@ -1266,18 +1266,6 @@ pmap_qremove(vm_offset_t sva, int count) /*************************************************** * Page table page management routines..... ***************************************************/ -static __inline void -pmap_free_zero_pages(struct spglist *free) -{ - vm_page_t m; - - while ((m = SLIST_FIRST(free)) != NULL) { - SLIST_REMOVE_HEAD(free, plinks.s.ss); - /* Preserve the page's PG_ZERO setting. */ - vm_page_free_toq(m); - } -} - /* * Schedule the specified unused page table page to be freed. Specifically, * add the page to the specified list of pages that will be released to the @@ -1909,7 +1897,7 @@ reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **l m_pc->wire_count = 1; vm_wire_add(1); } - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); return (m_pc); } @@ -2417,7 +2405,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t if (lock != NULL) rw_wunlock(lock); PMAP_UNLOCK(pmap); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } /* @@ -2522,7 +2510,7 @@ retry: } vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(lock); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } /* @@ -3230,7 +3218,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v SLIST_INIT(&free); if (pmap_unwire_l3(pmap, va, mpte, &free)) { pmap_invalidate_page(pmap, va); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } mpte = NULL; } @@ -3750,7 +3738,7 @@ pmap_remove_pages(pmap_t pmap) if (lock != NULL) rw_wunlock(lock); PMAP_UNLOCK(pmap); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } /* @@ -4211,7 +4199,7 @@ small_mappings: not_cleared < PMAP_TS_REFERENCED_MAX); out: rw_wunlock(lock); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); return (cleared + not_cleared); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Mar 4 20:06:02 2018 (r330409) +++ head/sys/i386/i386/pmap.c Sun Mar 4 20:53:20 2018 (r330410) @@ -1711,20 +1711,6 @@ pmap_qremove(vm_offset_t sva, int count) /*************************************************** * Page table page management routines..... ***************************************************/ -static __inline void -pmap_free_zero_pages(struct spglist *free) -{ - vm_page_t m; - int count; - - for (count = 0; (m = SLIST_FIRST(free)) != NULL; count++) { - SLIST_REMOVE_HEAD(free, plinks.s.ss); - /* Preserve the page's PG_ZERO setting. */ - vm_page_free_toq(m); - } - vm_wire_sub(count); -} - /* * Schedule the specified unused page table page to be freed. Specifically, * add the page to the specified list of pages that will be released to the @@ -2324,7 +2310,7 @@ out: /* Recycle a freed page table page. */ m_pc->wire_count = 1; } - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); return (m_pc); } @@ -2674,7 +2660,7 @@ pmap_demote_pde(pmap_t pmap, pd_entry_t *pde, vm_offse pmap_remove_pde(pmap, pde, sva, &free); if ((oldpde & PG_G) == 0) pmap_invalidate_pde_page(pmap, sva, oldpde); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); CTR2(KTR_PMAP, "pmap_demote_pde: failure for va %#x" " in pmap %p", va, pmap); return (FALSE); @@ -3044,7 +3030,7 @@ out: pmap_invalidate_all(pmap); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); } /* @@ -3118,7 +3104,7 @@ small_mappings: vm_page_aflag_clear(m, PGA_WRITEABLE); sched_unpin(); rw_wunlock(&pvh_global_lock); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); } /* @@ -3886,7 +3872,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v SLIST_INIT(&free); if (pmap_unwire_ptp(pmap, mpte, &free)) { pmap_invalidate_page(pmap, va); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); } mpte = NULL; @@ -4201,7 +4187,8 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ &free)) { pmap_invalidate_page(dst_pmap, addr); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, + true); } goto out; } @@ -4619,7 +4606,7 @@ pmap_remove_pages(pmap_t pmap) pmap_invalidate_all(pmap); rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, true); } /* Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Sun Mar 4 20:06:02 2018 (r330409) +++ head/sys/riscv/riscv/pmap.c Sun Mar 4 20:53:20 2018 (r330410) @@ -1069,18 +1069,6 @@ pmap_qremove(vm_offset_t sva, int count) /*************************************************** * Page table page management routines..... ***************************************************/ -static __inline void -pmap_free_zero_pages(struct spglist *free) -{ - vm_page_t m; - - while ((m = SLIST_FIRST(free)) != NULL) { - SLIST_REMOVE_HEAD(free, plinks.s.ss); - /* Preserve the page's PG_ZERO setting. */ - vm_page_free_toq(m); - } -} - /* * Schedule the specified unused page table page to be freed. Specifically, * add the page to the specified list of pages that will be released to the @@ -1876,7 +1864,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t rw_wunlock(lock); rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } /* @@ -1942,7 +1930,7 @@ pmap_remove_all(vm_page_t m) } vm_page_aflag_clear(m, PGA_WRITEABLE); rw_wunlock(&pvh_global_lock); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } /* @@ -2377,7 +2365,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v SLIST_INIT(&free); if (pmap_unwire_l3(pmap, va, mpte, &free)) { pmap_invalidate_page(pmap, va); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } mpte = NULL; } @@ -2783,7 +2771,7 @@ pmap_remove_pages(pmap_t pmap) rw_wunlock(lock); rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); } /* @@ -3085,7 +3073,7 @@ retry: out: rw_wunlock(lock); rw_runlock(&pvh_global_lock); - pmap_free_zero_pages(&free); + vm_page_free_pages_toq(&free, false); return (cleared + not_cleared); } Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Mar 4 20:06:02 2018 (r330409) +++ head/sys/vm/vm_page.c Sun Mar 4 20:53:20 2018 (r330410) @@ -2538,17 +2538,7 @@ unlock: } if (m_mtx != NULL) mtx_unlock(m_mtx); - if ((m = SLIST_FIRST(&free)) != NULL) { - vmd = VM_DOMAIN(domain); - vm_domain_free_lock(vmd); - do { - MPASS(vm_phys_domain(m) == domain); - SLIST_REMOVE_HEAD(&free, plinks.s.ss); - vm_page_free_phys(vmd, m); - } while ((m = SLIST_FIRST(&free)) != NULL); - vm_domain_free_wakeup(vmd); - vm_domain_free_unlock(vmd); - } + vm_page_free_pages_toq(&free, false); return (error); } @@ -3248,7 +3238,42 @@ vm_page_free_toq(vm_page_t m) } /* - * vm_page_wire: + * vm_page_free_pages_toq: + * + * Returns a list of pages to the free list, disassociating it + * from any VM object. In other words, this is equivalent to + * calling vm_page_free_toq() for each page of a list of VM objects. + * + * The objects must be locked. The pages must be locked if it is + * managed. + */ +void +vm_page_free_pages_toq(struct spglist *free, bool update_wire_count) +{ + vm_page_t m; + struct pglist pgl; + int count; + + if (SLIST_EMPTY(free)) + return; + + count = 0; + TAILQ_INIT(&pgl); + while ((m = SLIST_FIRST(free)) != NULL) { + count++; + SLIST_REMOVE_HEAD(free, plinks.s.ss); + if (vm_page_free_prep(m, false)) + TAILQ_INSERT_TAIL(&pgl, m, listq); + } + + vm_page_free_phys_pglist(&pgl); + + if (update_wire_count && count > 0) + vm_wire_sub(count); +} + +/* + * vm_page_wire: * * Mark this page as wired down. If the page is fictitious, then * its wire count must remain one. Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Sun Mar 4 20:06:02 2018 (r330409) +++ head/sys/vm/vm_page.h Sun Mar 4 20:53:20 2018 (r330410) @@ -535,6 +535,7 @@ void vm_page_test_dirty (vm_page_t); vm_page_bits_t vm_page_bits(int base, int size); void vm_page_zero_invalid(vm_page_t m, boolean_t setvalid); void vm_page_free_toq(vm_page_t m); +void vm_page_free_pages_toq(struct spglist *free, bool update_wire_count); void vm_page_dirty_KBI(vm_page_t m); void vm_page_lock_KBI(vm_page_t m, const char *file, int line); From owner-svn-src-head@freebsd.org Sun Mar 4 21:04: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 56FA7F32E4C; Sun, 4 Mar 2018 21:04:31 +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 0C71A6FBC8; Sun, 4 Mar 2018 21:04:31 +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 E1FBC1A992; Sun, 4 Mar 2018 21:04:30 +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 w24L4UXQ073088; Sun, 4 Mar 2018 21:04:30 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24L4UmG073087; Sun, 4 Mar 2018 21:04:30 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803042104.w24L4UmG073087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 21:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330411 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330411 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 21:04:31 -0000 Author: ian Date: Sun Mar 4 21:04:30 2018 New Revision: 330411 URL: https://svnweb.freebsd.org/changeset/base/330411 Log: Convert to the new(ish) bcd_clocktime conversion functions, add calls to the new debug output functions, and when setting the clock, propagate the timespec nsecs to the 1/100ths register. Modified: head/sys/dev/iicbus/rtc8583.c Modified: head/sys/dev/iicbus/rtc8583.c ============================================================================== --- head/sys/dev/iicbus/rtc8583.c Sun Mar 4 20:53:20 2018 (r330410) +++ head/sys/dev/iicbus/rtc8583.c Sun Mar 4 21:04:30 2018 (r330411) @@ -190,7 +190,7 @@ static int rtc8583_gettime(device_t dev, struct timespec *ts) { struct rtc8583_softc *sc; - struct clocktime ct; + struct bcd_clocktime bct; struct time_regs tregs; uint8_t y, ytmp, sreg; int err; @@ -227,42 +227,49 @@ rtc8583_gettime(device_t dev, struct timespec *ts) iicbus_release_bus(sc->busdev, sc->dev); } - ct.nsec = FROMBCD(tregs.msec) * 10 * 1000 * 1000; - ct.sec = FROMBCD(tregs.sec); - ct.min = FROMBCD(tregs.min); - ct.hour = FROMBCD(tregs.hour & 0x3f); - ct.day = FROMBCD(tregs.day & 0x3f); - ct.mon = FROMBCD(tregs.month & 0x1f); - ct.year = 2000 + sreg; + if (!validbcd(tregs.msec)) + return (EINVAL); - return (clock_ct_to_ts(&ct, ts)); + /* The 'msec' reg is actually 1/100ths, in bcd. */ + bct.nsec = bcd2bin(tregs.msec) * 10 * 1000 * 1000; + bct.sec = tregs.sec; + bct.min = tregs.min; + bct.hour = tregs.hour & 0x3f; + bct.day = tregs.day & 0x3f; + bct.mon = tregs.month & 0x1f; + bct.year = (bin2bcd(sreg / 100) << 8) | bin2bcd(sreg % 100); + + clock_dbgprint_bcd(sc->dev, CLOCK_DBG_READ, &bct); + return (clock_bcd_to_ts(&bct, ts, false)); } static int rtc8583_settime(device_t dev, struct timespec *ts) { struct rtc8583_softc *sc; - struct clocktime ct; + struct bcd_clocktime bct; struct time_regs tregs; uint8_t sreg; int err; sc = device_get_softc(dev); ts->tv_sec -= utc_offset(); - ts->tv_nsec = 0; - clock_ts_to_ct(ts, &ct); + clock_ts_to_bcd(ts, &bct, false); + clock_dbgprint_bcd(sc->dev, CLOCK_DBG_WRITE, &bct); - tregs.sec = TOBCD(ct.sec); - tregs.min = TOBCD(ct.min); - tregs.hour = TOBCD(ct.hour); - tregs.day = TOBCD(ct.day) | ((ct.year & 0x03) << 6); - tregs.month = TOBCD(ct.mon); + /* The 'msec' reg is actually 1/100ths, in bcd. */ + tregs.msec = bin2bcd(ts->tv_nsec / (10 * 1000 * 1000)); + tregs.sec = bct.sec; + tregs.min = bct.min; + tregs.hour = bct.hour; + tregs.day = bct.day | (bct.year & 0x03 << 6); + tregs.month = bct.mon; if ((err = iicbus_request_bus(sc->busdev, sc->dev, IIC_WAIT)) != 0) return (err); err = rtc8583_writeto(sc->dev, RTC8583_SC_REG, &tregs, sizeof(tregs), IIC_WAIT); - sreg = ct.year - 2000; + sreg = bcd2bin(bct.year & 0xff) + 100 * bcd2bin(bct.year >> 8); /* save to year to sram */ rtc8583_write1(sc, RTC8583_USERSRAM_REG, sreg); iicbus_release_bus(sc->busdev, sc->dev); From owner-svn-src-head@freebsd.org Sun Mar 4 21:06: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 4E9E7F331FA; Sun, 4 Mar 2018 21:06:22 +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 017136FF3A; Sun, 4 Mar 2018 21:06:22 +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 EC69D1A993; Sun, 4 Mar 2018 21:06:21 +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 w24L6LgF073194; Sun, 4 Mar 2018 21:06:21 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24L6Lqe073191; Sun, 4 Mar 2018 21:06:21 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803042106.w24L6Lqe073191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 21:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330412 - in head/sys/modules/i2c: . rtc8583 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys/modules/i2c: . rtc8583 X-SVN-Commit-Revision: 330412 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 21:06:22 -0000 Author: ian Date: Sun Mar 4 21:06:21 2018 New Revision: 330412 URL: https://svnweb.freebsd.org/changeset/base/330412 Log: Build iicbus/rtc8583 as a module. Added: head/sys/modules/i2c/rtc8583/ head/sys/modules/i2c/rtc8583/Makefile (contents, props changed) Modified: head/sys/modules/i2c/Makefile Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Sun Mar 4 21:04:30 2018 (r330411) +++ head/sys/modules/i2c/Makefile Sun Mar 4 21:06:21 2018 (r330412) @@ -17,6 +17,7 @@ SUBDIR = \ jedec_dimm \ jedec_ts \ nxprtc \ + rtc8583 \ s35390a \ smb \ smbus \ Added: head/sys/modules/i2c/rtc8583/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/rtc8583/Makefile Sun Mar 4 21:06:21 2018 (r330412) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus +KMOD = rtc8583 +SRCS = rtc8583.c + +# Generated files... +SRCS+= \ + bus_if.h \ + clock_if.h \ + device_if.h \ + iicbus_if.h \ + opt_platform.h \ + +.if !empty(OPT_FDT) +SRCS+= ofw_bus_if.h +.endif + +.include From owner-svn-src-head@freebsd.org Sun Mar 4 21:15: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 6FEF7F34070; Sun, 4 Mar 2018 21:15:32 +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 19AEE708C3; Sun, 4 Mar 2018 21:15:32 +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 148921AB26; Sun, 4 Mar 2018 21:15:32 +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 w24LFVF3078135; Sun, 4 Mar 2018 21:15:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24LFVjN078134; Sun, 4 Mar 2018 21:15:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803042115.w24LFVjN078134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 4 Mar 2018 21:15:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330413 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 330413 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 21:15:32 -0000 Author: kib Date: Sun Mar 4 21:15:31 2018 New Revision: 330413 URL: https://svnweb.freebsd.org/changeset/base/330413 Log: Remove redundant test from r330410. If the input slist is non-empty, counter cannot be zero after freeing. Noted by: mjg MFC after: 2 weeks Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Mar 4 21:06:21 2018 (r330412) +++ head/sys/vm/vm_page.c Sun Mar 4 21:15:31 2018 (r330413) @@ -3268,7 +3268,7 @@ vm_page_free_pages_toq(struct spglist *free, bool upda vm_page_free_phys_pglist(&pgl); - if (update_wire_count && count > 0) + if (update_wire_count) vm_wire_sub(count); } From owner-svn-src-head@freebsd.org Sun Mar 4 21:38: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 CB421F35C3E; Sun, 4 Mar 2018 21:38:31 +0000 (UTC) (envelope-from mjg@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 818E8715B4; Sun, 4 Mar 2018 21:38:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C4F71AE6C; Sun, 4 Mar 2018 21:38:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24LcVUJ088122; Sun, 4 Mar 2018 21:38:31 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24LcVAa088120; Sun, 4 Mar 2018 21:38:31 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201803042138.w24LcVAa088120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 4 Mar 2018 21:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330414 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330414 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 21:38:32 -0000 Author: mjg Date: Sun Mar 4 21:38:30 2018 New Revision: 330414 URL: https://svnweb.freebsd.org/changeset/base/330414 Log: locks: fix a corner case in r327399 If there were exactly rowner_retries/asx_retries (by default: 10) transitions between read and write state and the waiters still did not get the lock, the next owner -> reader transition would result in the code correctly falling back to turnstile/sleepq where it would incorrectly think it was waiting for a writer and decide to leave turnstile/sleepq to loop back. From this point it would take ts/sq trips until the lock gets released. The bug sometimes manifested itself in stalls during -j 128 package builds. Refactor the code to fix the bug, while here remove some of the gratituous differences between rw and sx locks. Modified: head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sun Mar 4 21:15:31 2018 (r330413) +++ head/sys/kern/kern_rwlock.c Sun Mar 4 21:38:30 2018 (r330414) @@ -875,7 +875,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC #ifdef ADAPTIVE_RWLOCKS int spintries = 0; int i, n; - int sleep_reason = 0; + enum { READERS, WRITER } sleep_reason; #endif uintptr_t x; #ifdef LOCK_PROFILING @@ -956,9 +956,11 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC * running on another CPU, spin until the owner stops * running or the state of the lock changes. */ - sleep_reason = 1; - owner = lv_rw_wowner(v); - if (!(v & RW_LOCK_READ) && TD_IS_RUNNING(owner)) { + if (!(v & RW_LOCK_READ)) { + sleep_reason = WRITER; + owner = lv_rw_wowner(v); + if (!TD_IS_RUNNING(owner)) + goto ts; if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR3(KTR_LOCK, "%s: spinning on %p held by %p", __func__, rw, owner); @@ -973,9 +975,10 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; - } - if ((v & RW_LOCK_READ) && RW_READERS(v) && - spintries < rowner_retries) { + } else if (RW_READERS(v) > 0) { + sleep_reason = READERS; + if (spintries == rowner_retries) + goto ts; if (!(v & RW_LOCK_WRITE_SPINNER)) { if (!atomic_fcmpset_ptr(&rw->rw_lock, &v, v | RW_LOCK_WRITE_SPINNER)) { @@ -993,15 +996,15 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC if ((v & RW_LOCK_WRITE_SPINNER) == 0) break; } - KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), - "running"); #ifdef KDTRACE_HOOKS - lda.spin_cnt += rowner_loops - i; + lda.spin_cnt += i; #endif + KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), + "running"); if (i < rowner_loops) continue; - sleep_reason = 2; } +ts: #endif ts = turnstile_trywait(&rw->lock_object); v = RW_READ_VALUE(rw); @@ -1021,7 +1024,7 @@ retry_ts: turnstile_cancel(ts); continue; } - } else if (RW_READERS(v) > 0 && sleep_reason == 1) { + } else if (RW_READERS(v) > 0 && sleep_reason == WRITER) { turnstile_cancel(ts); continue; } Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sun Mar 4 21:15:31 2018 (r330413) +++ head/sys/kern/kern_sx.c Sun Mar 4 21:38:30 2018 (r330414) @@ -533,8 +533,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO #ifdef ADAPTIVE_SX volatile struct thread *owner; u_int i, n, spintries = 0; + enum { READERS, WRITER } sleep_reason; bool adaptive; - int sleep_reason = 0; #endif #ifdef LOCK_PROFILING uint64_t waittime = 0; @@ -628,37 +628,33 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO * running or the state of the lock changes. */ if ((x & SX_LOCK_SHARED) == 0) { + sleep_reason = WRITER; owner = lv_sx_owner(x); - if (TD_IS_RUNNING(owner)) { - if (LOCK_LOG_TEST(&sx->lock_object, 0)) - CTR3(KTR_LOCK, - "%s: spinning on %p held by %p", - __func__, sx, owner); - KTR_STATE1(KTR_SCHED, "thread", - sched_tdname(curthread), "spinning", - "lockname:\"%s\"", - sx->lock_object.lo_name); - do { - lock_delay(&lda); - x = SX_READ_VALUE(sx); - owner = lv_sx_owner(x); - } while (owner != NULL && - TD_IS_RUNNING(owner)); - KTR_STATE0(KTR_SCHED, "thread", - sched_tdname(curthread), "running"); - continue; - } - sleep_reason = 1; - } else if (SX_SHARERS(x) && spintries < asx_retries) { - KTR_STATE1(KTR_SCHED, "thread", - sched_tdname(curthread), "spinning", - "lockname:\"%s\"", sx->lock_object.lo_name); + if (!TD_IS_RUNNING(owner)) + goto sleepq; + if (LOCK_LOG_TEST(&sx->lock_object, 0)) + CTR3(KTR_LOCK, "%s: spinning on %p held by %p", + __func__, sx, owner); + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), + "spinning", "lockname:\"%s\"", + sx->lock_object.lo_name); + do { + lock_delay(&lda); + x = SX_READ_VALUE(sx); + owner = lv_sx_owner(x); + } while (owner != NULL && TD_IS_RUNNING(owner)); + KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), + "running"); + continue; + } else if (SX_SHARERS(x) > 0) { + sleep_reason = READERS; + if (spintries == asx_retries) + goto sleepq; spintries++; + KTR_STATE1(KTR_SCHED, "thread", sched_tdname(curthread), + "spinning", "lockname:\"%s\"", + sx->lock_object.lo_name); for (i = 0; i < asx_loops; i += n) { - if (LOCK_LOG_TEST(&sx->lock_object, 0)) - CTR4(KTR_LOCK, - "%s: shared spinning on %p with %u and %u", - __func__, sx, spintries, i); n = SX_SHARERS(x); lock_delay_spin(n); x = SX_READ_VALUE(sx); @@ -669,11 +665,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO #ifdef KDTRACE_HOOKS lda.spin_cnt += i; #endif - KTR_STATE0(KTR_SCHED, "thread", - sched_tdname(curthread), "running"); + KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), + "running"); if (i < asx_loops) continue; - sleep_reason = 2; } sleepq: #endif @@ -705,7 +700,7 @@ retry_sleepq: sleepq_release(&sx->lock_object); continue; } - } else if (SX_SHARERS(x) > 0 && sleep_reason == 1) { + } else if (SX_SHARERS(x) > 0 && sleep_reason == WRITER) { sleepq_release(&sx->lock_object); continue; } From owner-svn-src-head@freebsd.org Sun Mar 4 21:41: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 6A69BF36009; Sun, 4 Mar 2018 21:41:06 +0000 (UTC) (envelope-from mjg@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 1D67C71982; Sun, 4 Mar 2018 21:41:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 172FF1AF8D; Sun, 4 Mar 2018 21:41:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24Lf57C091926; Sun, 4 Mar 2018 21:41:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24Lf59C091925; Sun, 4 Mar 2018 21:41:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201803042141.w24Lf59C091925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 4 Mar 2018 21:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330415 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330415 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 21:41:06 -0000 Author: mjg Date: Sun Mar 4 21:41:05 2018 New Revision: 330415 URL: https://svnweb.freebsd.org/changeset/base/330415 Log: sx: don't do an atomic op in upgrade if it cananot succeed The code already pays the cost of reading the lock to obtain the waiters flag. Checking whether there is more than one reader is not a problem and avoids dirtying the line. This also fixes a small corner case: if waiters were to show up between reading the flag and upgrading the lock, the operation would fail even though it should not. No correctness change here though. Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sun Mar 4 21:38:30 2018 (r330414) +++ head/sys/kern/kern_sx.c Sun Mar 4 21:41:05 2018 (r330415) @@ -413,6 +413,7 @@ int sx_try_upgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) { uintptr_t x; + uintptr_t waiters; int success; if (SCHEDULER_STOPPED()) @@ -427,9 +428,18 @@ sx_try_upgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DE * to maintain the SX_LOCK_EXCLUSIVE_WAITERS flag if set so that * we will wake up the exclusive waiters when we drop the lock. */ - x = sx->sx_lock & SX_LOCK_EXCLUSIVE_WAITERS; - success = atomic_cmpset_acq_ptr(&sx->sx_lock, SX_SHARERS_LOCK(1) | x, - (uintptr_t)curthread | x); + success = 0; + x = SX_READ_VALUE(sx); + for (;;) { + if (SX_SHARERS(x) > 1) + break; + waiters = (x & SX_LOCK_EXCLUSIVE_WAITERS); + if (atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, + (uintptr_t)curthread | waiters)) { + success = 1; + break; + } + } LOCK_LOG_TRY("XUPGRADE", &sx->lock_object, 0, success, file, line); if (success) { WITNESS_UPGRADE(&sx->lock_object, LOP_EXCLUSIVE | LOP_TRYLOCK, From owner-svn-src-head@freebsd.org Sun Mar 4 21: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 ADA72F375B8; Sun, 4 Mar 2018 21:58:32 +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 610E972381; Sun, 4 Mar 2018 21:58:32 +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 5BE0C1B18E; Sun, 4 Mar 2018 21:58:32 +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 w24LwWJM098201; Sun, 4 Mar 2018 21:58:32 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24LwWO5098200; Sun, 4 Mar 2018 21:58:32 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803042158.w24LwWO5098200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 21:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330416 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330416 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 21:58:32 -0000 Author: ian Date: Sun Mar 4 21:58:32 2018 New Revision: 330416 URL: https://svnweb.freebsd.org/changeset/base/330416 Log: The year is stored in a single byte in sram, in binary format, as a count of years since the century, so strip the century out when converting to or from bcd_clocktime format (the conversion routines will infer century by pivoting on 70). Modified: head/sys/dev/iicbus/rtc8583.c Modified: head/sys/dev/iicbus/rtc8583.c ============================================================================== --- head/sys/dev/iicbus/rtc8583.c Sun Mar 4 21:41:05 2018 (r330415) +++ head/sys/dev/iicbus/rtc8583.c Sun Mar 4 21:58:32 2018 (r330416) @@ -237,7 +237,7 @@ rtc8583_gettime(device_t dev, struct timespec *ts) bct.hour = tregs.hour & 0x3f; bct.day = tregs.day & 0x3f; bct.mon = tregs.month & 0x1f; - bct.year = (bin2bcd(sreg / 100) << 8) | bin2bcd(sreg % 100); + bct.year = bin2bcd(sreg % 100); clock_dbgprint_bcd(sc->dev, CLOCK_DBG_READ, &bct); return (clock_bcd_to_ts(&bct, ts, false)); @@ -269,7 +269,7 @@ rtc8583_settime(device_t dev, struct timespec *ts) return (err); err = rtc8583_writeto(sc->dev, RTC8583_SC_REG, &tregs, sizeof(tregs), IIC_WAIT); - sreg = bcd2bin(bct.year & 0xff) + 100 * bcd2bin(bct.year >> 8); + sreg = bcd2bin(bct.year & 0xff); /* save to year to sram */ rtc8583_write1(sc, RTC8583_USERSRAM_REG, sreg); iicbus_release_bus(sc->busdev, sc->dev); From owner-svn-src-head@freebsd.org Sun Mar 4 22:01: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 074B6F37A7E; Sun, 4 Mar 2018 22:01:24 +0000 (UTC) (envelope-from mjg@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 B1DB07275A; Sun, 4 Mar 2018 22:01:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACE7F1B1CD; Sun, 4 Mar 2018 22:01:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24M1NN9000731; Sun, 4 Mar 2018 22:01:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24M1N0U000730; Sun, 4 Mar 2018 22:01:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201803042201.w24M1N0U000730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 4 Mar 2018 22:01:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330418 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330418 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:01:24 -0000 Author: mjg Date: Sun Mar 4 22:01:23 2018 New Revision: 330418 URL: https://svnweb.freebsd.org/changeset/base/330418 Log: mtx: tidy up recursion handling in thread lock Normally after grabbing the lock it has to be verified we got the right one to begin with. However, if we are recursing, it must not change thus the check can be avoided. In particular this avoids a lock read for non-recursing case which found out the lock was changed. While here avoid an irq trip of this happens. Tested by: pho (previous version) Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sun Mar 4 21:58:55 2018 (r330417) +++ head/sys/kern/kern_mutex.c Sun Mar 4 22:01:23 2018 (r330418) @@ -829,10 +829,8 @@ _thread_lock(struct thread *td) WITNESS_LOCK(&m->lock_object, LOP_EXCLUSIVE, file, line); return; } - if (m->mtx_recurse != 0) - m->mtx_recurse--; - else - _mtx_release_lock_quick(m); + MPASS(m->mtx_recurse == 0); + _mtx_release_lock_quick(m); slowpath_unlocked: spinlock_exit(); slowpath_noirq: @@ -886,9 +884,10 @@ thread_lock_flags_(struct thread *td, int opts, const if (__predict_false(doing_lockprof)) spin_time -= lockstat_nsecs(&td->td_lock->lock_object); #endif + spinlock_enter(); + for (;;) { retry: - spinlock_enter(); m = td->td_lock; thread_lock_validate(m, opts, file, line); v = MTX_READ_VALUE(m); @@ -900,6 +899,7 @@ retry: } if (v == tid) { m->mtx_recurse++; + MPASS(m == td->td_lock); break; } lock_profile_obtain_lock_failed(&m->lock_object, @@ -912,15 +912,18 @@ retry: } else { _mtx_lock_indefinite_check(m, &lda); } - if (m != td->td_lock) + if (m != td->td_lock) { + spinlock_enter(); goto retry; + } v = MTX_READ_VALUE(m); } while (v != MTX_UNOWNED); spinlock_enter(); } if (m == td->td_lock) break; - __mtx_unlock_spin(m); /* does spinlock_exit() */ + MPASS(m->mtx_recurse == 0); + _mtx_release_lock_quick(m); } LOCK_LOG_LOCK("LOCK", &m->lock_object, opts, m->mtx_recurse, file, line); From owner-svn-src-head@freebsd.org Sun Mar 4 22: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 BF173F3898F; Sun, 4 Mar 2018 22:14:21 +0000 (UTC) (envelope-from mjg@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 B90B17313D; Sun, 4 Mar 2018 22:14:20 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3E7F1B4C7; Sun, 4 Mar 2018 22:14:20 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w24MEKPo008544; Sun, 4 Mar 2018 22:14:20 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24MEKM0008543; Sun, 4 Mar 2018 22:14:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201803042214.w24MEKM0008543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 4 Mar 2018 22:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330419 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330419 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:14:21 -0000 Author: mjg Date: Sun Mar 4 22:14:20 2018 New Revision: 330419 URL: https://svnweb.freebsd.org/changeset/base/330419 Log: lockmgr: whack unused lockmgr_note_exclusive_upgrade Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sun Mar 4 22:01:23 2018 (r330418) +++ head/sys/kern/kern_lock.c Sun Mar 4 22:14:20 2018 (r330419) @@ -234,18 +234,6 @@ lockmgr_note_exclusive_release(struct lock *lk, const TD_LOCKS_DEC(curthread); } -static void -lockmgr_note_exclusive_upgrade(struct lock *lk, const char *file, int line, - int flags) -{ - - LOCK_LOG_LOCK("XUPGRADE", &lk->lock_object, 0, 0, file, - line); - WITNESS_UPGRADE(&lk->lock_object, LOP_EXCLUSIVE | - LK_TRYWIT(flags), file, line); - TD_SLOCKS_DEC(curthread); -} - static __inline struct thread * lockmgr_xholder(const struct lock *lk) { From owner-svn-src-head@freebsd.org Sun Mar 4 23:39: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 A1778F3F13B; Sun, 4 Mar 2018 23:39:41 +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 5489D76FC1; Sun, 4 Mar 2018 23:39:41 +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 35A261C18F; Sun, 4 Mar 2018 23:39:41 +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 w24Ndf3m050758; Sun, 4 Mar 2018 23:39:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w24NdfXh050757; Sun, 4 Mar 2018 23:39:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803042339.w24NdfXh050757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 4 Mar 2018 23:39:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330430 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330430 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 23:39:41 -0000 Author: ian Date: Sun Mar 4 23:39:40 2018 New Revision: 330430 URL: https://svnweb.freebsd.org/changeset/base/330430 Log: Switch to the new bcd_clocktime conversion routines, and add calls to the new clock_dbgprint_xxx() functions. Modified: head/sys/dev/iicbus/isl12xx.c Modified: head/sys/dev/iicbus/isl12xx.c ============================================================================== --- head/sys/dev/iicbus/isl12xx.c Sun Mar 4 23:39:12 2018 (r330429) +++ head/sys/dev/iicbus/isl12xx.c Sun Mar 4 23:39:40 2018 (r330430) @@ -233,7 +233,7 @@ static int isl12xx_gettime(device_t dev, struct timespec *ts) { struct isl12xx_softc *sc = device_get_softc(dev); - struct clocktime ct; + struct bcd_clocktime bct; struct time_regs tregs; int err; uint8_t hourmask, sreg; @@ -263,29 +263,24 @@ isl12xx_gettime(device_t dev, struct timespec *ts) hourmask = ISL12xx_12HR_MASK; } - ct.nsec = 0; - ct.sec = FROMBCD(tregs.sec); - ct.min = FROMBCD(tregs.min); - ct.hour = FROMBCD(tregs.hour & hourmask); - ct.day = FROMBCD(tregs.day); - ct.mon = FROMBCD(tregs.month); - ct.year = FROMBCD(tregs.year); + bct.nsec = 0; + bct.sec = tregs.sec; + bct.min = tregs.min; + bct.hour = tregs.hour & hourmask; + bct.day = tregs.day; + bct.mon = tregs.month; + bct.year = tregs.year; + bct.ispm = tregs.hour & ISL12XX_PM_FLAG; - if (sc->use_ampm) { - if (ct.hour == 12) - ct.hour = 0; - if (tregs.hour & ISL12XX_PM_FLAG) - ct.hour += 12; - } - - return (clock_ct_to_ts(&ct, ts)); + clock_dbgprint_bcd(sc->dev, CLOCK_DBG_READ, &bct); + return (clock_bcd_to_ts(&bct, ts, sc->use_ampm)); } static int isl12xx_settime(device_t dev, struct timespec *ts) { struct isl12xx_softc *sc = device_get_softc(dev); - struct clocktime ct; + struct bcd_clocktime bct; struct time_regs tregs; int err; uint8_t ampmflags, sreg; @@ -296,27 +291,21 @@ isl12xx_settime(device_t dev, struct timespec *ts) */ ts->tv_sec -= utc_offset(); ts->tv_nsec = 0; - clock_ts_to_ct(ts, &ct); + clock_ts_to_bcd(ts, &bct, sc->use_ampm); + clock_dbgprint_bcd(sc->dev, CLOCK_DBG_WRITE, &bct); - /* If the chip is in AM/PM mode, adjust hour and set flags as needed. */ - if (!sc->use_ampm) { + /* If the chip is in AM/PM mode, set flags as needed. */ + if (!sc->use_ampm) ampmflags = ISL12XX_24HR_FLAG; - } else { - ampmflags = 0; - if (ct.hour >= 12) { - ct.hour -= 12; - ampmflags |= ISL12XX_PM_FLAG; - } - if (ct.hour == 0) - ct.hour = 12; - } + else + ampmflags = bct.ispm ? ISL12XX_PM_FLAG : 0; - tregs.sec = TOBCD(ct.sec); - tregs.min = TOBCD(ct.min); - tregs.hour = TOBCD(ct.hour) | ampmflags; - tregs.day = TOBCD(ct.day); - tregs.month = TOBCD(ct.mon); - tregs.year = TOBCD(ct.year % 100); + tregs.sec = bct.sec; + tregs.min = bct.min; + tregs.hour = bct.hour | ampmflags; + tregs.day = bct.day; + tregs.month = bct.mon; + tregs.year = bct.year % 100; /* * To set the time we have to set the WRTC enable bit in the control From owner-svn-src-head@freebsd.org Sun Mar 4 23:42: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 7626AF3F5C8; Sun, 4 Mar 2018 23:42:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B20277428; Sun, 4 Mar 2018 23:42:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id DC526B297; Sun, 4 Mar 2018 23:42:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id CF5E289D; Sun, 4 Mar 2018 23:42:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id lmv2RE7AwYPK; Sun, 4 Mar 2018 23:42:24 +0000 (UTC) Subject: Re: svn commit: r330384 - in head: contrib/llvm/lib/Target/AArch64 contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/lib/Basic lib/clang lib/clang/includ... DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 3AE30898 To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803041706.w24H6coa051979@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Sun, 4 Mar 2018 15:42:22 -0800 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: <201803041706.w24H6coa051979@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y3d3JsQeA2ejEL1fDuoeiOtqUg7iCfG7u" 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 Mar 2018 23:42:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Y3d3JsQeA2ejEL1fDuoeiOtqUg7iCfG7u Content-Type: multipart/mixed; boundary="dL2PxpPWrYJ3bnFvKKTGaBPu8l59rT7CU"; protected-headers="v1" From: Bryan Drewery To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r330384 - in head: contrib/llvm/lib/Target/AArch64 contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/include/clang/Basic contrib/llvm/tools/clang/lib/Basic lib/clang lib/clang/includ... References: <201803041706.w24H6coa051979@repo.freebsd.org> In-Reply-To: <201803041706.w24H6coa051979@repo.freebsd.org> --dL2PxpPWrYJ3bnFvKKTGaBPu8l59rT7CU Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 3/4/2018 9:06 AM, Dimitry Andric wrote: > Modified: head/lib/clang/include/lld/Common/Version.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/lib/clang/include/lld/Common/Version.inc Sun Mar 4 15:07:23 2= 018 (r330383) > +++ head/lib/clang/include/lld/Common/Version.inc Sun Mar 4 17:06:37 2= 018 (r330384) > @@ -4,5 +4,5 @@ > #define LLD_VERSION_STRING "6.0.0" > #define LLD_VERSION_MAJOR 6 > #define LLD_VERSION_MINOR 0 > -#define LLD_REVISION_STRING "325932" > +#define LLD_REVISION_STRING "326565" > #define LLD_REPOSITORY_STRING "FreeBSD" >=20 > Modified: head/lib/clang/include/llvm/Support/VCSRevision.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/lib/clang/include/llvm/Support/VCSRevision.h Sun Mar 4 15:07:= 23 2018 (r330383) > +++ head/lib/clang/include/llvm/Support/VCSRevision.h Sun Mar 4 17:06:= 37 2018 (r330384) > @@ -1,2 +1,2 @@ > /* $FreeBSD$ */ > -#define LLVM_REVISION "svn-r325932" > +#define LLVM_REVISION "svn-r326565" Thanks for handling these. I need to finish my WITH_SYSTEM_LINKER patch. --=20 Regards, Bryan Drewery --dL2PxpPWrYJ3bnFvKKTGaBPu8l59rT7CU-- --Y3d3JsQeA2ejEL1fDuoeiOtqUg7iCfG7u Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJanIRfAAoJEDXXcbtuRpfPwMcH/i/JOc457fc4JAirk3RSiidr jE25v7fhDRji7PvVRNAveTqzYsXNDwgpmZkahoWnvoBMmyQXq39De1xrPzRk3K9K WtEAfjeSYe/Y3Oi+kgrHvKVlRe7fs+QT9HDf69rFF0U7vC2J9mX6KSFPQL/J1XdU okTuM4JFFdiPR/4ZbJJE3kM6bzi54cXyX+FB7ymZ+2NIPkTAswl3j6P7qbbR61UZ eVnLXCkFeAiPDiuaj6k6FIc8XwVNdpBDW+PpzBpbJoWTFsAY0HUInuvcr7l7w8Mm DZ+KJDIqg1wJR9aLhVS8TzhZfdqBF+BSS0oBLVAxioG0Do5lQJMpcp1FX++BlmA= =NaJJ -----END PGP SIGNATURE----- --Y3d3JsQeA2ejEL1fDuoeiOtqUg7iCfG7u-- From owner-svn-src-head@freebsd.org Mon Mar 5 00:15: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 7D1A5F41A43; Mon, 5 Mar 2018 00:15:57 +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 2E3E27855B; Mon, 5 Mar 2018 00:15:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 291E11C802; Mon, 5 Mar 2018 00:15:57 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w250Fvwq071122; Mon, 5 Mar 2018 00:15:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w250FvLY071121; Mon, 5 Mar 2018 00:15:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803050015.w250FvLY071121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 5 Mar 2018 00:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330431 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330431 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 00:15:57 -0000 Author: ian Date: Mon Mar 5 00:15:56 2018 New Revision: 330431 URL: https://svnweb.freebsd.org/changeset/base/330431 Log: Switch to the new bcd_clocktime conversion routines, and add calls to the new clock_dbgprint_xxx() functions. Modified: head/sys/dev/iicbus/ds3231.c Modified: head/sys/dev/iicbus/ds3231.c ============================================================================== --- head/sys/dev/iicbus/ds3231.c Sun Mar 4 23:39:40 2018 (r330430) +++ head/sys/dev/iicbus/ds3231.c Mon Mar 5 00:15:56 2018 (r330431) @@ -377,7 +377,7 @@ ds3231_attach(device_t dev) sc->sc_dev = dev; sc->sc_addr = iicbus_get_addr(dev); sc->sc_last_c = -1; - sc->sc_year0 = 1900; + sc->sc_year0 = 0; sc->enum_hook.ich_func = ds3231_start; sc->enum_hook.ich_arg = dev; @@ -477,7 +477,7 @@ static int ds3231_gettime(device_t dev, struct timespec *ts) { int c, error; - struct clocktime ct; + struct bcd_clocktime bct; struct ds3231_softc *sc; uint8_t data[7], hourmask; @@ -505,13 +505,14 @@ ds3231_gettime(device_t dev, struct timespec *ts) } else hourmask = DS3231_HOUR_MASK_24HR; - ct.nsec = 0; - ct.sec = FROMBCD(data[DS3231_SECS] & DS3231_SECS_MASK); - ct.min = FROMBCD(data[DS3231_MINS] & DS3231_MINS_MASK); - ct.hour = FROMBCD(data[DS3231_HOUR] & hourmask); - ct.day = FROMBCD(data[DS3231_DATE] & DS3231_DATE_MASK); - ct.mon = FROMBCD(data[DS3231_MONTH] & DS3231_MONTH_MASK); - ct.year = FROMBCD(data[DS3231_YEAR] & DS3231_YEAR_MASK); + bct.nsec = 0; + bct.sec = data[DS3231_SECS] & DS3231_SECS_MASK; + bct.min = data[DS3231_MINS] & DS3231_MINS_MASK; + bct.hour = data[DS3231_HOUR] & hourmask; + bct.day = data[DS3231_DATE] & DS3231_DATE_MASK; + bct.mon = data[DS3231_MONTH] & DS3231_MONTH_MASK; + bct.year = data[DS3231_YEAR] & DS3231_YEAR_MASK; + bct.ispm = data[DS3231_HOUR] & DS3231_HOUR_IS_PM; /* * If the century flag has toggled since we last saw it, there has been @@ -522,29 +523,20 @@ ds3231_gettime(device_t dev, struct timespec *ts) if (sc->sc_last_c == -1) sc->sc_last_c = c; else if (c != sc->sc_last_c) { - sc->sc_year0 += 100; + sc->sc_year0 += 0x100; sc->sc_last_c = c; } - ct.year += sc->sc_year0; - if (ct.year < POSIX_BASE_YEAR) - ct.year += 100; /* assume [1970, 2069] */ + bct.year |= sc->sc_year0; - /* If running in AM/PM mode, deal with it. */ - if (sc->sc_use_ampm) { - if (ct.hour == 12) - ct.hour = 0; - if (data[DS3231_HOUR] & DS3231_HOUR_IS_PM) - ct.hour += 12; - } - - return (clock_ct_to_ts(&ct, ts)); + clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_READ, &bct); + return (clock_bcd_to_ts(&bct, ts, sc->sc_use_ampm)); } static int ds3231_settime(device_t dev, struct timespec *ts) { int error; - struct clocktime ct; + struct bcd_clocktime bct; struct ds3231_softc *sc; uint8_t data[7]; uint8_t pmflags; @@ -556,27 +548,24 @@ ds3231_settime(device_t dev, struct timespec *ts) * disables utc adjustment, so apply that ourselves. */ ts->tv_sec -= utc_offset(); - clock_ts_to_ct(ts, &ct); + clock_ts_to_bcd(ts, &bct, sc->sc_use_ampm); + clock_dbgprint_bcd(sc->sc_dev, CLOCK_DBG_WRITE, &bct); /* If the chip is in AM/PM mode, adjust hour and set flags as needed. */ if (sc->sc_use_ampm) { pmflags = DS3231_HOUR_USE_AMPM; - if (ct.hour >= 12) { - ct.hour -= 12; + if (bct.ispm) pmflags |= DS3231_HOUR_IS_PM; - } - if (ct.hour == 0) - ct.hour = 12; } else pmflags = 0; - data[DS3231_SECS] = TOBCD(ct.sec); - data[DS3231_MINS] = TOBCD(ct.min); - data[DS3231_HOUR] = TOBCD(ct.hour) | pmflags; - data[DS3231_DATE] = TOBCD(ct.day); - data[DS3231_WEEKDAY] = ct.dow + 1; - data[DS3231_MONTH] = TOBCD(ct.mon); - data[DS3231_YEAR] = TOBCD(ct.year % 100); + data[DS3231_SECS] = bct.sec; + data[DS3231_MINS] = bct.min; + data[DS3231_HOUR] = bct.hour | pmflags; + data[DS3231_DATE] = bct.day; + data[DS3231_WEEKDAY] = bct.dow + 1; + data[DS3231_MONTH] = bct.mon; + data[DS3231_YEAR] = bct.year & 0xff; if (sc->sc_last_c) data[DS3231_MONTH] |= DS3231_C_MASK; From owner-svn-src-head@freebsd.org Mon Mar 5 00:30: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 E290CF428AE; Mon, 5 Mar 2018 00:30:07 +0000 (UTC) (envelope-from mjg@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 94F0E78C97; Mon, 5 Mar 2018 00:30:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8BB761C9AA; Mon, 5 Mar 2018 00:30:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w250U7SS076204; Mon, 5 Mar 2018 00:30:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w250U7gm076203; Mon, 5 Mar 2018 00:30:07 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201803050030.w250U7gm076203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Mon, 5 Mar 2018 00:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330432 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330432 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 00:30:08 -0000 Author: mjg Date: Mon Mar 5 00:30:07 2018 New Revision: 330432 URL: https://svnweb.freebsd.org/changeset/base/330432 Log: lockmgr: save on sleepq when cmpset fails Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Mon Mar 5 00:15:56 2018 (r330431) +++ head/sys/kern/kern_lock.c Mon Mar 5 00:30:07 2018 (r330432) @@ -296,7 +296,7 @@ sleeplk(struct lock *lk, u_int flags, struct lock_obje static __inline int wakeupshlk(struct lock *lk, const char *file, int line) { - uintptr_t v, x; + uintptr_t v, x, orig_x; u_int realexslp; int queue, wakeup_swapper; @@ -311,7 +311,9 @@ wakeupshlk(struct lock *lk, const char *file, int line * path in order to handle wakeups correctly. */ sleepq_lock(&lk->lock_object); - x = lk->lk_lock & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); + orig_x = lk->lk_lock; +retry_sleepq: + x = orig_x & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); v = LK_UNLOCKED; /* @@ -360,11 +362,16 @@ wakeupshlk(struct lock *lk, const char *file, int line queue = SQ_SHARED_QUEUE; } - if (!atomic_cmpset_rel_ptr(&lk->lk_lock, LK_SHARERS_LOCK(1) | x, - v)) { + if (lockmgr_sunlock_try(lk, &orig_x)) { sleepq_release(&lk->lock_object); - continue; + break; } + + x |= LK_SHARERS_LOCK(1); + if (!atomic_fcmpset_rel_ptr(&lk->lk_lock, &x, v)) { + orig_x = x; + goto retry_sleepq; + } LOCK_LOG3(lk, "%s: %p waking up threads on the %s queue", __func__, lk, queue == SQ_SHARED_QUEUE ? "shared" : "exclusive"); @@ -602,6 +609,7 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struc */ sleepq_lock(&lk->lock_object); x = lk->lk_lock; +retry_sleepq: /* * if the lock can be acquired in shared mode, try @@ -617,10 +625,9 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struc * loop back and retry. */ if ((x & LK_SHARED_WAITERS) == 0) { - if (!atomic_cmpset_acq_ptr(&lk->lk_lock, x, + if (!atomic_fcmpset_acq_ptr(&lk->lk_lock, &x, x | LK_SHARED_WAITERS)) { - sleepq_release(&lk->lock_object); - continue; + goto retry_sleepq; } LOCK_LOG2(lk, "%s: %p set shared waiters flag", __func__, lk); @@ -755,6 +762,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc */ sleepq_lock(&lk->lock_object); x = lk->lk_lock; +retry_sleepq: /* * if the lock has been released while we spun on @@ -777,7 +785,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc v = x & (LK_ALL_WAITERS | LK_EXCLUSIVE_SPINNERS); if ((x & ~v) == LK_UNLOCKED) { v &= ~LK_EXCLUSIVE_SPINNERS; - if (atomic_cmpset_acq_ptr(&lk->lk_lock, x, + if (atomic_fcmpset_acq_ptr(&lk->lk_lock, &x, tid | v)) { sleepq_release(&lk->lock_object); LOCK_LOG2(lk, @@ -785,8 +793,7 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc __func__, lk); break; } - sleepq_release(&lk->lock_object); - continue; + goto retry_sleepq; } /* @@ -794,10 +801,9 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struc * fail, loop back and retry. */ if ((x & LK_EXCLUSIVE_WAITERS) == 0) { - if (!atomic_cmpset_ptr(&lk->lk_lock, x, + if (!atomic_fcmpset_ptr(&lk->lk_lock, &x, x | LK_EXCLUSIVE_WAITERS)) { - sleepq_release(&lk->lock_object); - continue; + goto retry_sleepq; } LOCK_LOG2(lk, "%s: %p set excl waiters flag", __func__, lk); From owner-svn-src-head@freebsd.org Mon Mar 5 00:43: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 065F2F436ED; Mon, 5 Mar 2018 00:43:54 +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 A73F57954D; Mon, 5 Mar 2018 00:43:53 +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 A08871CCC5; Mon, 5 Mar 2018 00:43:53 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w250hrYl085940; Mon, 5 Mar 2018 00:43:53 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w250hrPE085939; Mon, 5 Mar 2018 00:43:53 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803050043.w250hrPE085939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 5 Mar 2018 00:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330433 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330433 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 00:43:54 -0000 Author: ian Date: Mon Mar 5 00:43:53 2018 New Revision: 330433 URL: https://svnweb.freebsd.org/changeset/base/330433 Log: Switch to the new bcd_clocktime conversion routines, and add calls to the new clock_dbgprint_xxx() functions. Modified: head/sys/dev/iicbus/s35390a.c Modified: head/sys/dev/iicbus/s35390a.c ============================================================================== --- head/sys/dev/iicbus/s35390a.c Mon Mar 5 00:30:07 2018 (r330432) +++ head/sys/dev/iicbus/s35390a.c Mon Mar 5 00:43:53 2018 (r330433) @@ -297,7 +297,7 @@ static int s390rtc_gettime(device_t dev, struct timespec *ts) { uint8_t bcd[S390_RT1_NBYTES]; - struct clocktime ct; + struct bcd_clocktime bct; int error; error = s390rtc_read(dev, S390_REALTIME1, bcd, S390_RT1_NBYTES); @@ -310,37 +310,39 @@ s390rtc_gettime(device_t dev, struct timespec *ts) /* * Convert the register values into something useable. */ - ct.nsec = 0; - ct.sec = FROMBCD(bcd[S390_RT1_SECOND]); - ct.min = FROMBCD(bcd[S390_RT1_MINUTE]); - ct.hour = FROMBCD(bcd[S390_RT1_HOUR] & 0x3f); - ct.day = FROMBCD(bcd[S390_RT1_DAY]); - ct.dow = bcd[S390_RT1_WDAY] & 0x07; - ct.mon = FROMBCD(bcd[S390_RT1_MONTH]); - ct.year = FROMBCD(bcd[S390_RT1_YEAR]) + 2000; + bct.nsec = 0; + bct.sec = bcd[S390_RT1_SECOND]; + bct.min = bcd[S390_RT1_MINUTE]; + bct.hour = bcd[S390_RT1_HOUR] & 0x3f; + bct.day = bcd[S390_RT1_DAY]; + bct.dow = bcd[S390_RT1_WDAY] & 0x07; + bct.mon = bcd[S390_RT1_MONTH]; + bct.year = bcd[S390_RT1_YEAR]; - return (clock_ct_to_ts(&ct, ts)); + clock_dbgprint_bcd(dev, CLOCK_DBG_READ, &bct); + return (clock_bcd_to_ts(&bct, ts, false)); } static int s390rtc_settime(device_t dev, struct timespec *ts) { uint8_t bcd[S390_RT1_NBYTES]; - struct clocktime ct; + struct bcd_clocktime bct; - clock_ts_to_ct(ts, &ct); + clock_ts_to_bcd(ts, &bct, false); + clock_dbgprint_bcd(dev, CLOCK_DBG_WRITE, &bct); /* * Convert our time representation into something the S-xx390 * can understand. */ - bcd[S390_RT1_SECOND] = TOBCD(ct.sec); - bcd[S390_RT1_MINUTE] = TOBCD(ct.min); - bcd[S390_RT1_HOUR] = TOBCD(ct.hour); - bcd[S390_RT1_DAY] = TOBCD(ct.day); - bcd[S390_RT1_WDAY] = ct.dow; - bcd[S390_RT1_MONTH] = TOBCD(ct.mon); - bcd[S390_RT1_YEAR] = TOBCD(ct.year % 100); + bcd[S390_RT1_SECOND] = bct.sec; + bcd[S390_RT1_MINUTE] = bct.min; + bcd[S390_RT1_HOUR] = bct.hour; + bcd[S390_RT1_DAY] = bct.day; + bcd[S390_RT1_WDAY] = bct.dow; + bcd[S390_RT1_MONTH] = bct.mon; + bcd[S390_RT1_YEAR] = bct.year & 0xff; return (s390rtc_write(dev, S390_REALTIME1, bcd, S390_RT1_NBYTES)); } From owner-svn-src-head@freebsd.org Mon Mar 5 00: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 79E55F446BA; Mon, 5 Mar 2018 00:59:56 +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 26A3979C1E; Mon, 5 Mar 2018 00:59:56 +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 1BA241CE5A; Mon, 5 Mar 2018 00:59:56 +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 w250xt3R091062; Mon, 5 Mar 2018 00:59:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w250xtm8091061; Mon, 5 Mar 2018 00:59:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803050059.w250xtm8091061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Mar 2018 00:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330434 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330434 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 00:59:56 -0000 Author: kevans Date: Mon Mar 5 00:59:55 2018 New Revision: 330434 URL: https://svnweb.freebsd.org/changeset/base/330434 Log: lualoader: Add note about importance of including the cli module early Modified: head/stand/lua/loader.lua Modified: head/stand/lua/loader.lua ============================================================================== --- head/stand/lua/loader.lua Mon Mar 5 00:43:53 2018 (r330433) +++ head/stand/lua/loader.lua Mon Mar 5 00:59:55 2018 (r330434) @@ -29,6 +29,10 @@ -- $FreeBSD$ -- +-- The cli module should be included first here. Some of the functions that it +-- defines are necessary for the Lua-based loader to operate in general. +-- Other modules will also need some of the functions it defines to safely +-- execute loader commands. require("cli") local core = require("core") local config = require("config") From owner-svn-src-head@freebsd.org Mon Mar 5 01:18: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 3B108F45FA7; Mon, 5 Mar 2018 01:18:33 +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 E30EB7AA6F; Mon, 5 Mar 2018 01:18:32 +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 DC8881D1DA; Mon, 5 Mar 2018 01:18:32 +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 w251IW5j001212; Mon, 5 Mar 2018 01:18:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w251IWpw001211; Mon, 5 Mar 2018 01:18:32 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803050118.w251IWpw001211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 5 Mar 2018 01:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330435 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330435 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:18:33 -0000 Author: kevans Date: Mon Mar 5 01:18:32 2018 New Revision: 330435 URL: https://svnweb.freebsd.org/changeset/base/330435 Log: lualoader: Use FILESDIR instead of BINDIR Minor nit: We're not installing binaries, we're installing scripts/files that are documented to be installed based on FILESDIR. Modified: head/stand/lua/Makefile Modified: head/stand/lua/Makefile ============================================================================== --- head/stand/lua/Makefile Mon Mar 5 00:59:55 2018 (r330434) +++ head/stand/lua/Makefile Mon Mar 5 01:18:32 2018 (r330435) @@ -2,7 +2,7 @@ .include -BINDIR= /boot/lua +FILESDIR= /boot/lua FILES= cli.lua \ color.lua \ config.lua \ From owner-svn-src-head@freebsd.org Mon Mar 5 01:56: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 4EF94F487A2; Mon, 5 Mar 2018 01:56:08 +0000 (UTC) (envelope-from bdrewery@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 012D17C01C; Mon, 5 Mar 2018 01:56:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F02921D84C; Mon, 5 Mar 2018 01:56:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w251u7l9020944; Mon, 5 Mar 2018 01:56:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w251u7Y8020941; Mon, 5 Mar 2018 01:56:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803050156.w251u7Y8020941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 5 Mar 2018 01:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330436 - head/bin/chflags X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/bin/chflags X-SVN-Commit-Revision: 330436 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:56:08 -0000 Author: bdrewery Date: Mon Mar 5 01:56:07 2018 New Revision: 330436 URL: https://svnweb.freebsd.org/changeset/base/330436 Log: chflags: Add -x option to not traverse mount points. MFC after: 2 weeks Modified: head/bin/chflags/chflags.1 head/bin/chflags/chflags.c Modified: head/bin/chflags/chflags.1 ============================================================================== --- head/bin/chflags/chflags.1 Mon Mar 5 01:18:32 2018 (r330435) +++ head/bin/chflags/chflags.1 Mon Mar 5 01:56:07 2018 (r330436) @@ -32,7 +32,7 @@ .\" @(#)chflags.1 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd April 20, 2015 +.Dd March 4, 2018 .Dt CHFLAGS 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Nd change file flags .Sh SYNOPSIS .Nm -.Op Fl fhv +.Op Fl fhvx .Oo .Fl R .Op Fl H | Fl L | Fl P @@ -98,6 +98,8 @@ If the .Fl v option is specified more than once, the old and new flags of the file will also be printed, in octal notation. +.It Fl x +Do not cross mount points. .El .Pp The flags are specified as an octal number or a comma separated list Modified: head/bin/chflags/chflags.c ============================================================================== --- head/bin/chflags/chflags.c Mon Mar 5 01:18:32 2018 (r330435) +++ head/bin/chflags/chflags.c Mon Mar 5 01:56:07 2018 (r330436) @@ -65,12 +65,12 @@ main(int argc, char *argv[]) FTSENT *p; u_long clear, newflags, set; long val; - int Hflag, Lflag, Rflag, fflag, hflag, vflag; + int Hflag, Lflag, Rflag, fflag, hflag, vflag, xflag; int ch, fts_options, oct, rval; char *flags, *ep; - Hflag = Lflag = Rflag = fflag = hflag = vflag = 0; - while ((ch = getopt(argc, argv, "HLPRfhv")) != -1) + Hflag = Lflag = Rflag = fflag = hflag = vflag = xflag = 0; + while ((ch = getopt(argc, argv, "HLPRfhvx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -95,6 +95,9 @@ main(int argc, char *argv[]) case 'v': vflag++; break; + case 'x': + xflag = 1; + break; case '?': default: usage(); @@ -123,6 +126,8 @@ main(int argc, char *argv[]) } else { fts_options = FTS_LOGICAL; } + if (xflag) + fts_options |= FTS_XDEV; flags = *argv; if (*flags >= '0' && *flags <= '7') { @@ -201,6 +206,6 @@ static void usage(void) { (void)fprintf(stderr, - "usage: chflags [-fhv] [-R [-H | -L | -P]] flags file ...\n"); + "usage: chflags [-fhvx] [-R [-H | -L | -P]] flags file ...\n"); exit(1); } From owner-svn-src-head@freebsd.org Mon Mar 5 02:08: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 810C3F4948F; Mon, 5 Mar 2018 02:08:34 +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 2FCE57CA47; Mon, 5 Mar 2018 02:08:34 +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 2A9FA1D9E9; Mon, 5 Mar 2018 02:08:34 +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 w2528YGD026303; Mon, 5 Mar 2018 02:08:34 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2528Y6S026302; Mon, 5 Mar 2018 02:08:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803050208.w2528Y6S026302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 5 Mar 2018 02:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330437 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 330437 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:08:34 -0000 Author: ian Date: Mon Mar 5 02:08:33 2018 New Revision: 330437 URL: https://svnweb.freebsd.org/changeset/base/330437 Log: Do not stop the loop that configures gpio chipselect pins on the first error, just ignore pins that don't configure and keep setting up the ones that do. (But when bootverbose is on, whine about the errors.) Modified: head/sys/arm/freescale/imx/imx_spi.c Modified: head/sys/arm/freescale/imx/imx_spi.c ============================================================================== --- head/sys/arm/freescale/imx/imx_spi.c Mon Mar 5 01:56:07 2018 (r330436) +++ head/sys/arm/freescale/imx/imx_spi.c Mon Mar 5 02:08:33 2018 (r330437) @@ -541,7 +541,7 @@ spi_attach(device_t dev) /* Allocate gpio pins for configured chip selects. */ node = ofw_bus_get_node(sc->dev); - for (err = 0, idx = 0; err == 0 && idx < nitems(sc->cspins); ++idx) { + for (idx = 0; idx < nitems(sc->cspins); ++idx) { err = gpio_pin_get_by_ofw_propidx(sc->dev, node, "cs-gpios", idx, &sc->cspins[idx]); if (err == 0) { From owner-svn-src-head@freebsd.org Mon Mar 5 02:11: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 935AEF498C1 for ; Mon, 5 Mar 2018 02:11:09 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1ECFE7CCC4 for ; Mon, 5 Mar 2018 02:11:08 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 6477c6f2-201a-11e8-bb8e-b35b57339d60 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.ore.mailhop.org (Halon) with ESMTPSA id 6477c6f2-201a-11e8-bb8e-b35b57339d60; Mon, 05 Mar 2018 02:10:36 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w252B0TD094434; Sun, 4 Mar 2018 19:11:00 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520215860.38056.3.camel@freebsd.org> Subject: Re: svn commit: r330436 - head/bin/chflags From: Ian Lepore To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 04 Mar 2018 19:11:00 -0700 In-Reply-To: <201803050156.w251u7Y8020941@repo.freebsd.org> References: <201803050156.w251u7Y8020941@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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 Mar 2018 02:11:09 -0000 On Mon, 2018-03-05 at 01:56 +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Mon Mar5 01:56:07 2018 > New Revision: 330436 > URL: https://svnweb.freebsd.org/changeset/base/330436 > > Log: > chflags: Add -x option to not traverse mount points. Yay! One day later than I needed it, but still, yay! -- Ian From owner-svn-src-head@freebsd.org Mon Mar 5 02:13: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 54E95F49B87; Mon, 5 Mar 2018 02:13:29 +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 E8DE87D0AB; Mon, 5 Mar 2018 02:13:28 +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 DDC2E1DB77; Mon, 5 Mar 2018 02:13:28 +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 w252DS70031279; Mon, 5 Mar 2018 02:13:28 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w252DSqh031278; Mon, 5 Mar 2018 02:13:28 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803050213.w252DSqh031278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 5 Mar 2018 02:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330438 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 330438 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:13:29 -0000 Author: ian Date: Mon Mar 5 02:13:28 2018 New Revision: 330438 URL: https://svnweb.freebsd.org/changeset/base/330438 Log: Defer attaching the spibus until timers and interrupts are working. The driver requires interrupts to do transfers, and the drivers for the SPI devices on the bus quite reasonably expect to be able to do IO while probing and attaching. Modified: head/sys/arm/freescale/imx/imx_spi.c Modified: head/sys/arm/freescale/imx/imx_spi.c ============================================================================== --- head/sys/arm/freescale/imx/imx_spi.c Mon Mar 5 02:08:33 2018 (r330437) +++ head/sys/arm/freescale/imx/imx_spi.c Mon Mar 5 02:13:28 2018 (r330438) @@ -558,9 +558,16 @@ spi_attach(device_t dev) */ WR4(sc, ECSPI_CTLREG, CTLREG_CMODES_MASTER); - /* Attach the bus driver. */ + /* + * Add the spibus driver as a child, and setup a one-shot intrhook to + * attach it after interrupts are working. It will attach actual SPI + * devices as its children, and those devices may need to do IO during + * their attach. We can't do IO until timers and interrupts are working. + */ sc->spibus = device_add_child(dev, "spibus", -1); - return (bus_generic_attach(sc->dev)); + config_intrhook_oneshot((ich_func_t)bus_generic_attach, dev); + + return (0); } static int From owner-svn-src-head@freebsd.org Mon Mar 5 02:28: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 422E0F24E30; Mon, 5 Mar 2018 02:28:26 +0000 (UTC) (envelope-from anish@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 E94DB7D919; Mon, 5 Mar 2018 02:28:25 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E44101DD29; Mon, 5 Mar 2018 02:28:25 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w252SPkU036574; Mon, 5 Mar 2018 02:28:25 GMT (envelope-from anish@FreeBSD.org) Received: (from anish@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w252SP6v036571; Mon, 5 Mar 2018 02:28:25 GMT (envelope-from anish@FreeBSD.org) Message-Id: <201803050228.w252SP6v036571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: anish set sender to anish@FreeBSD.org using -f From: Anish Gupta Date: Mon, 5 Mar 2018 02:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330439 - in head/sys: amd64/vmm/amd contrib/dev/acpica/include X-SVN-Group: head X-SVN-Commit-Author: anish X-SVN-Commit-Paths: in head/sys: amd64/vmm/amd contrib/dev/acpica/include X-SVN-Commit-Revision: 330439 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:28:26 -0000 Author: anish Date: Mon Mar 5 02:28:25 2018 New Revision: 330439 URL: https://svnweb.freebsd.org/changeset/base/330439 Log: Move the new AMD-Vi IVHD [ACPI_IVRS_HARDWARE_NEW]definitions added in r329360 in contrib ACPI to local files till ACPI code adds new definitions reported by jkim. Rename ACPI_IVRS_HARDWARE_NEW to ACPI_IVRS_HARDWARE_EFRSUP, since new definitions add Extended Feature Register support. Use IvrsType to distinguish three types of IVHD - 0x10(legacy), 0x11 and 0x40(with EFR). IVHD 0x40 is also called mixed type since it supports HID device entries. Fix 2 coverity bugs reported by cem. Reported by:jkim, cem Approved by:grehan Differential Revision://reviews.freebsd.org/D14501 Modified: head/sys/amd64/vmm/amd/amdvi_priv.h head/sys/amd64/vmm/amd/ivrs_drv.c head/sys/contrib/dev/acpica/include/actbl2.h Modified: head/sys/amd64/vmm/amd/amdvi_priv.h ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_priv.h Mon Mar 5 02:13:28 2018 (r330438) +++ head/sys/amd64/vmm/amd/amdvi_priv.h Mon Mar 5 02:28:25 2018 (r330439) @@ -355,12 +355,43 @@ struct amdvi_domain { }; /* + * I/O Virtualization Hardware Definition Block (IVHD) type 0x10 (legacy) + * uses ACPI_IVRS_HARDWARE define in contrib/dev/acpica/include/actbl2.h + * New IVHD types 0x11 and 0x40 as defined in AMD IOMMU spec[48882] are missing in + * ACPI code. These new types add extra field EFR(Extended Feature Register). + * XXX : Use definition from ACPI when it is available. + */ +typedef struct acpi_ivrs_hardware_efr_sup +{ + ACPI_IVRS_HEADER Header; + UINT16 CapabilityOffset; /* Offset for IOMMU control fields */ + UINT64 BaseAddress; /* IOMMU control registers */ + UINT16 PciSegmentGroup; + UINT16 Info; /* MSI number and unit ID */ + UINT32 Attr; /* IOMMU Feature */ + UINT64 ExtFR; /* IOMMU Extended Feature */ + UINT64 Reserved; /* v1 feature or v2 attribute */ +} __attribute__ ((__packed__)) ACPI_IVRS_HARDWARE_EFRSUP; +CTASSERT(sizeof(ACPI_IVRS_HARDWARE_EFRSUP) == 40); + +/* + * Different type of IVHD. + * XXX: Use AcpiIvrsType once new IVHD types are available. +*/ +enum IvrsType +{ + IVRS_TYPE_HARDWARE_LEGACY = 0x10, /* Legacy without EFRi support. */ + IVRS_TYPE_HARDWARE_EFR = 0x11, /* With EFR support. */ + IVRS_TYPE_HARDWARE_MIXED = 0x40, /* Mixed with EFR support. */ +}; + +/* * AMD IOMMU softc. */ struct amdvi_softc { struct amdvi_ctrl *ctrl; /* Control area. */ device_t dev; /* IOMMU device. */ - enum AcpiIvrsType ivhd_type; /* IOMMU IVHD type 0x10/0x11 or 0x40 */ + enum IvrsType ivhd_type; /* IOMMU IVHD type. */ bool iotlb; /* IOTLB supported by IOMMU */ struct amdvi_cmd *cmd; /* Command descriptor area. */ int cmd_max; /* Max number of commands. */ Modified: head/sys/amd64/vmm/amd/ivrs_drv.c ============================================================================== --- head/sys/amd64/vmm/amd/ivrs_drv.c Mon Mar 5 02:13:28 2018 (r330438) +++ head/sys/amd64/vmm/amd/ivrs_drv.c Mon Mar 5 02:28:25 2018 (r330439) @@ -86,9 +86,9 @@ ivrs_hdr_iterate_tbl(ivhd_iter_t iter, void *arg) } switch (ivrs_hdr->Type) { - case ACPI_IVRS_TYPE_HARDWARE: /* Legacy */ - case 0x11: - case 0x40: /* ACPI HID */ + case IVRS_TYPE_HARDWARE_LEGACY: /* Legacy */ + case IVRS_TYPE_HARDWARE_EFR: + case IVRS_TYPE_HARDWARE_MIXED: if (!iter(ivrs_hdr, arg)) return; break; @@ -116,9 +116,9 @@ ivrs_is_ivhd(UINT8 type) { switch(type) { - case ACPI_IVRS_TYPE_HARDWARE: - case ACPI_IVRS_TYPE_HARDWARE_EXT1: - case ACPI_IVRS_TYPE_HARDWARE_EXT2: + case IVRS_TYPE_HARDWARE_LEGACY: + case IVRS_TYPE_HARDWARE_EFR: + case IVRS_TYPE_HARDWARE_MIXED: return (true); default: @@ -206,17 +206,13 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE* ivhd, struct amdvi_ softc->end_dev_rid = 0; switch (ivhd->Header.Type) { - case ACPI_IVRS_TYPE_HARDWARE_EXT1: - case ACPI_IVRS_TYPE_HARDWARE_EXT2: - p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE_NEW); - de = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd + - sizeof(ACPI_IVRS_HARDWARE_NEW)); + case IVRS_TYPE_HARDWARE_LEGACY: + p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE); break; - case ACPI_IVRS_TYPE_HARDWARE: - p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE); - de = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd + - sizeof(ACPI_IVRS_HARDWARE)); + case IVRS_TYPE_HARDWARE_EFR: + case IVRS_TYPE_HARDWARE_MIXED: + p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE_EFRSUP); break; default: @@ -316,9 +312,9 @@ ivhd_is_newer(ACPI_IVRS_HEADER *old, ACPI_IVRS_HEADER * Newer IVRS header type take precedence. */ if ((old->DeviceId == new->DeviceId) && - (old->Type == ACPI_IVRS_TYPE_HARDWARE) && - ((new->Type == ACPI_IVRS_TYPE_HARDWARE_EXT1) || - (new->Type == ACPI_IVRS_TYPE_HARDWARE_EXT1))) { + (old->Type == IVRS_TYPE_HARDWARE_LEGACY) && + ((new->Type == IVRS_TYPE_HARDWARE_EFR) || + (new->Type == IVRS_TYPE_HARDWARE_MIXED))) { return (true); } @@ -422,23 +418,33 @@ ivhd_probe(device_t dev) ivhd = ivhd_hdrs[unit]; KASSERT(ivhd, ("ivhd is NULL")); - if (ivhd->Header.Type == ACPI_IVRS_TYPE_HARDWARE) - device_set_desc(dev, "AMD-Vi/IOMMU ivhd"); - else + switch (ivhd->Header.Type) { + case IVRS_TYPE_HARDWARE_EFR: device_set_desc(dev, "AMD-Vi/IOMMU ivhd with EFR"); + break; + + case IVRS_TYPE_HARDWARE_MIXED: + device_set_desc(dev, "AMD-Vi/IOMMU ivhd in mixed format"); + break; + case IVRS_TYPE_HARDWARE_LEGACY: + default: + device_set_desc(dev, "AMD-Vi/IOMMU ivhd"); + break; + } + return (BUS_PROBE_NOWILDCARD); } static void -ivhd_print_flag(device_t dev, enum AcpiIvrsType ivhd_type, uint8_t flag) +ivhd_print_flag(device_t dev, enum IvrsType ivhd_type, uint8_t flag) { /* * IVHD lgeacy type has two extra high bits in flag which has * been moved to EFR for non-legacy device. */ switch (ivhd_type) { - case ACPI_IVRS_TYPE_HARDWARE: + case IVRS_TYPE_HARDWARE_LEGACY: device_printf(dev, "Flag:%b\n", flag, "\020" "\001HtTunEn" @@ -451,8 +457,8 @@ ivhd_print_flag(device_t dev, enum AcpiIvrsType ivhd_t "\008PPRSup"); break; - case ACPI_IVRS_TYPE_HARDWARE_EXT1: - case ACPI_IVRS_TYPE_HARDWARE_EXT2: + case IVRS_TYPE_HARDWARE_EFR: + case IVRS_TYPE_HARDWARE_MIXED: device_printf(dev, "Flag:%b\n", flag, "\020" "\001HtTunEn" @@ -474,10 +480,10 @@ ivhd_print_flag(device_t dev, enum AcpiIvrsType ivhd_t * Feature in legacy IVHD type(0x10) and attribute in newer type(0x11 and 0x40). */ static void -ivhd_print_feature(device_t dev, enum AcpiIvrsType ivhd_type, uint32_t feature) +ivhd_print_feature(device_t dev, enum IvrsType ivhd_type, uint32_t feature) { switch (ivhd_type) { - case ACPI_IVRS_TYPE_HARDWARE: + case IVRS_TYPE_HARDWARE_LEGACY: device_printf(dev, "Features(type:0x%x) HATS = %d GATS = %d" " MsiNumPPR = %d PNBanks= %d PNCounters= %d\n", ivhd_type, @@ -500,8 +506,8 @@ ivhd_print_feature(device_t dev, enum AcpiIvrsType ivh break; /* Fewer features or attributes are reported in non-legacy type. */ - case ACPI_IVRS_TYPE_HARDWARE_EXT1: - case ACPI_IVRS_TYPE_HARDWARE_EXT2: + case IVRS_TYPE_HARDWARE_EFR: + case IVRS_TYPE_HARDWARE_MIXED: device_printf(dev, "Features(type:0x%x) MsiNumPPR = %d" " PNBanks= %d PNCounters= %d\n", ivhd_type, @@ -605,7 +611,7 @@ static int ivhd_attach(device_t dev) { ACPI_IVRS_HARDWARE *ivhd; - ACPI_IVRS_HARDWARE_NEW *ivhd1; + ACPI_IVRS_HARDWARE_EFRSUP *ivhd_efr; struct amdvi_softc *softc; int status, unit; @@ -640,10 +646,10 @@ ivhd_attach(device_t dev) softc->event_msix = ivhd->Info & 0x1F; #endif switch (ivhd->Header.Type) { - case ACPI_IVRS_TYPE_HARDWARE_EXT1: - case ACPI_IVRS_TYPE_HARDWARE_EXT2: - ivhd1 = (ACPI_IVRS_HARDWARE_NEW *)ivhd; - softc->ext_feature = ivhd1->ExtFR; + case IVRS_TYPE_HARDWARE_EFR: + case IVRS_TYPE_HARDWARE_MIXED: + ivhd_efr = (ACPI_IVRS_HARDWARE_EFRSUP *)ivhd; + softc->ext_feature = ivhd_efr->ExtFR; break; } Modified: head/sys/contrib/dev/acpica/include/actbl2.h ============================================================================== --- head/sys/contrib/dev/acpica/include/actbl2.h Mon Mar 5 02:13:28 2018 (r330438) +++ head/sys/contrib/dev/acpica/include/actbl2.h Mon Mar 5 02:28:25 2018 (r330439) @@ -444,8 +444,6 @@ typedef struct acpi_ivrs_header enum AcpiIvrsType { ACPI_IVRS_TYPE_HARDWARE = 0x10, - ACPI_IVRS_TYPE_HARDWARE_EXT1 = 0x11, - ACPI_IVRS_TYPE_HARDWARE_EXT2 = 0x40, ACPI_IVRS_TYPE_MEMORY1 = 0x20, ACPI_IVRS_TYPE_MEMORY2 = 0x21, ACPI_IVRS_TYPE_MEMORY3 = 0x22 @@ -483,21 +481,6 @@ typedef struct acpi_ivrs_hardware UINT32 Reserved; } ACPI_IVRS_HARDWARE; - -/* 0x11 and 0x40: I/O Virtualization Hardware Definition Block (IVHD) */ - -typedef struct acpi_ivrs_hardware_new -{ - ACPI_IVRS_HEADER Header; - UINT16 CapabilityOffset; /* Offset for IOMMU control fields */ - UINT64 BaseAddress; /* IOMMU control registers */ - UINT16 PciSegmentGroup; - UINT16 Info; /* MSI number and unit ID */ - UINT32 Attr; /* IOMMU Feature */ - UINT64 ExtFR; /* IOMMU Extended Feature */ - UINT64 Reserved; /* v1 feature or v2 attribute */ - -} ACPI_IVRS_HARDWARE_NEW; /* Masks for Info field above */ From owner-svn-src-head@freebsd.org Mon Mar 5 02:32: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 3546FF255DB; Mon, 5 Mar 2018 02:32:24 +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 DDD5D7DE80; Mon, 5 Mar 2018 02:32:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8C131DEB4; Mon, 5 Mar 2018 02:32:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w252WNph041209; Mon, 5 Mar 2018 02:32:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w252WN72041208; Mon, 5 Mar 2018 02:32:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803050232.w252WN72041208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 5 Mar 2018 02:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330440 - head/sys/arm/freescale/imx X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/freescale/imx X-SVN-Commit-Revision: 330440 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:32:24 -0000 Author: ian Date: Mon Mar 5 02:32:23 2018 New Revision: 330440 URL: https://svnweb.freebsd.org/changeset/base/330440 Log: Switch imx_gpio to attach at BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE. Pretty much any other device might need to manipulate a gpio pin during its probe or attach routines, so these devices must be available as early as possible. The gpio device is an interrupt controller, but I didn't choose the INTERRUPT pass for that reason (it works fine as an interrupt controller as long as it attaches any time before interrupts are enabled). That just looked like the right place in the passes to ensure that it attaches before any type of device that might need gpio pin manipulations. Modified: head/sys/arm/freescale/imx/imx_gpio.c Modified: head/sys/arm/freescale/imx/imx_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx_gpio.c Mon Mar 5 02:28:25 2018 (r330439) +++ head/sys/arm/freescale/imx/imx_gpio.c Mon Mar 5 02:32:23 2018 (r330440) @@ -868,5 +868,5 @@ static driver_t imx51_gpio_driver = { }; static devclass_t imx51_gpio_devclass; -DRIVER_MODULE(imx51_gpio, simplebus, imx51_gpio_driver, imx51_gpio_devclass, - 0, 0); +EARLY_DRIVER_MODULE(imx51_gpio, simplebus, imx51_gpio_driver, + imx51_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); From owner-svn-src-head@freebsd.org Mon Mar 5 03:34: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 4D11EF2ABE8; Mon, 5 Mar 2018 03:34:02 +0000 (UTC) (envelope-from hrs@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 E04F2800B4; Mon, 5 Mar 2018 03:34:01 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DA2FC1E8CB; Mon, 5 Mar 2018 03:34:01 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w253Y18h071836; Mon, 5 Mar 2018 03:34:01 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w253Y1Rq071835; Mon, 5 Mar 2018 03:34:01 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201803050334.w253Y1Rq071835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 5 Mar 2018 03:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330441 - head/usr.sbin/rpcbind X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/usr.sbin/rpcbind X-SVN-Commit-Revision: 330441 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 03:34:02 -0000 Author: hrs Date: Mon Mar 5 03:34:01 2018 New Revision: 330441 URL: https://svnweb.freebsd.org/changeset/base/330441 Log: Partially back out changes in r327464. stdlib.h is used when RPCBIND_DEBUG is enabled. Modified: head/usr.sbin/rpcbind/rpcb_svc.c Modified: head/usr.sbin/rpcbind/rpcb_svc.c ============================================================================== --- head/usr.sbin/rpcbind/rpcb_svc.c Mon Mar 5 02:32:23 2018 (r330440) +++ head/usr.sbin/rpcbind/rpcb_svc.c Mon Mar 5 03:34:01 2018 (r330441) @@ -48,6 +48,9 @@ #include #include #include +#ifdef RPCBIND_DEBUG +#include +#endif #include #include "rpcbind.h" From owner-svn-src-head@freebsd.org Mon Mar 5 03:38: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 C947EF2B105; Mon, 5 Mar 2018 03:38:31 +0000 (UTC) (envelope-from hrs@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 7344B80354; Mon, 5 Mar 2018 03:38:31 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6E5511E8D4; Mon, 5 Mar 2018 03:38:31 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w253cVBv072023; Mon, 5 Mar 2018 03:38:31 GMT (envelope-from hrs@FreeBSD.org) Received: (from hrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w253cVLt072022; Mon, 5 Mar 2018 03:38:31 GMT (envelope-from hrs@FreeBSD.org) Message-Id: <201803050338.w253cVLt072022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hrs set sender to hrs@FreeBSD.org using -f From: Hiroki Sato Date: Mon, 5 Mar 2018 03:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330442 - head/usr.sbin/rpcbind X-SVN-Group: head X-SVN-Commit-Author: hrs X-SVN-Commit-Paths: head/usr.sbin/rpcbind X-SVN-Commit-Revision: 330442 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 03:38:32 -0000 Author: hrs Date: Mon Mar 5 03:38:31 2018 New Revision: 330442 URL: https://svnweb.freebsd.org/changeset/base/330442 Log: - Remove extra NULL check before free(). - Fix null pointer dereference in netbuffree() and use netbuffree() where applicable. Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c Modified: head/usr.sbin/rpcbind/rpcb_svc_com.c ============================================================================== --- head/usr.sbin/rpcbind/rpcb_svc_com.c Mon Mar 5 03:34:01 2018 (r330441) +++ head/usr.sbin/rpcbind/rpcb_svc_com.c Mon Mar 5 03:38:31 2018 (r330442) @@ -183,12 +183,9 @@ map_set(RPCB *regp, char *owner) a->r_addr = strdup(reg.r_addr); a->r_owner = strdup(owner); if (!a->r_addr || !a->r_netid || !a->r_owner) { - if (a->r_netid) - free(a->r_netid); - if (a->r_addr) - free(a->r_addr); - if (a->r_owner) - free(a->r_owner); + free(a->r_netid); + free(a->r_addr); + free(a->r_owner); free(rbl); return (FALSE); } @@ -372,11 +369,8 @@ rpcbproc_uaddr2taddr_com(void *arg, struct svc_req *rq static struct netbuf nbuf; static struct netbuf *taddr; - if (taddr) { - free(taddr->buf); - free(taddr); - taddr = NULL; - } + netbuffree(taddr); + taddr = NULL; if (((nconf = rpcbind_get_conf(transp->xp_netid)) == NULL) || ((taddr = uaddr2taddr(nconf, *uaddrp)) == NULL)) { (void) memset((char *)&nbuf, 0, sizeof (struct netbuf)); @@ -685,8 +679,7 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *tr (unsigned long)a.rmt_prog, (unsigned long)a.rmt_vers, (unsigned long)a.rmt_proc, transp->xp_netid, uaddr ? uaddr : "unknown"); - if (uaddr) - free(uaddr); + free(uaddr); } #endif @@ -730,8 +723,7 @@ rpcbproc_callit_com(struct svc_req *rqstp, SVCXPRT *tr rbl->rpcb_map.r_addr, NULL); if (uaddr == NULL || uaddr[0] == '\0') { svcerr_noprog(transp); - if (uaddr != NULL) - free(uaddr); + free(uaddr); goto error; } free(uaddr); @@ -910,18 +902,11 @@ error: if (call_msg.rm_xid != 0) (void) free_slot_by_xid(call_msg.rm_xid); out: - if (local_uaddr) - free(local_uaddr); - if (buf_alloc) - free(buf_alloc); - if (outbuf_alloc) - free(outbuf_alloc); - if (na) { - free(na->buf); - free(na); - } - if (m_uaddr != NULL) - free(m_uaddr); + free(local_uaddr); + free(buf_alloc); + free(outbuf_alloc); + netbuffree(na); + free(m_uaddr); } /* @@ -1058,8 +1043,7 @@ netbuf_copybuf(struct netbuf *dst, const struct netbuf assert(src->len <= src->maxlen); if (dst->maxlen < src->len || dst->buf == NULL) { - if (dst->buf != NULL) - free(dst->buf); + free(dst->buf); if ((dst->buf = calloc(1, src->maxlen)) == NULL) return (FALSE); dst->maxlen = src->maxlen; @@ -1088,6 +1072,9 @@ netbufdup(struct netbuf *ap) static void netbuffree(struct netbuf *ap) { + + if (ap == NULL) + return; free(ap->buf); ap->buf = NULL; free(ap); @@ -1317,13 +1304,11 @@ handle_reply(int fd, SVCXPRT *xprt) fprintf(stderr, "handle_reply: forwarding address %s to %s\n", a.rmt_uaddr, uaddr ? uaddr : "unknown"); } - if (uaddr) - free(uaddr); + free(uaddr); #endif svc_sendreply(xprt, (xdrproc_t) xdr_rmtcall_result, (char *) &a); done: - if (buffer) - free(buffer); + free(buffer); if (reply_msg.rm_xid == 0) { #ifdef SVC_RUN_DEBUG From owner-svn-src-head@freebsd.org Mon Mar 5 04:30: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 507B6F2EB17; Mon, 5 Mar 2018 04:30:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9913381D43; Mon, 5 Mar 2018 04:30: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 mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 1CF833C598C; Mon, 5 Mar 2018 15:30:06 +1100 (AEDT) Date: Mon, 5 Mar 2018 15:30:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330436 - head/bin/chflags In-Reply-To: <1520215860.38056.3.camel@freebsd.org> Message-ID: <20180305140228.P935@besplex.bde.org> References: <201803050156.w251u7Y8020941@repo.freebsd.org> <1520215860.38056.3.camel@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VJytp5HX c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=NBMmwN1QNX4WqbsGi18A:9 a=aKvoep2yXyZLnYum:21 a=h_QEmZbpdLjRLaRh:21 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: Mon, 05 Mar 2018 04:30:15 -0000 On Sun, 4 Mar 2018, Ian Lepore wrote: > On Mon, 2018-03-05 at 01:56 +0000, Bryan Drewery wrote: >> >> Log: >> \xa0 chflags: Add -x option to not traverse mount points. > > Yay! \xa0One day later than I needed it, but still, yay! I recently noticed that find(1) needs an option to not look at mount points at all, and further options to classify mount points so that you can prune them. After reading the above and investigating further, I noticed that -x is broken in most FreeBSD utilities, since POSIX requires not looking at mount points at all for the few utilities that support -x. E.g., for du in 2001 draft 7 POSIX: 12578 -x When evaluating file sizes, evaluate only those files that have the same device as 12579 the file specified by the file operand. 12580 Specifying more than one of the mutually-exclusive options -H and -L shall not be considered Mount points are on a different device, but FreeBSD du -x is broken by using FTS_XDEV and not filtering out the mount points. Linux du -x (an old version in /compat/linyx/usr/bin) works correctly. (Elsewhere, POSIX uses the terms "mount point" and "file system" without specifying what they mean. E.g., for FTW_MOUNT which corresponds tp FTS_XDEV, it says "The walk does not cross a mount point". It is also unclear what "cross" means here -- the names of mount points are in the same file system although everything (?) else is in another file system. "mount point" should be specified as "a file whose device differs from the device of its directory", and "file system" should be specified as "all files on the system with the same given device". The latter allows the trees for file system to have weird topologies but is as good as anything. It is better than "all files under a mount point with the same device as the mount point". With the latter definition, given stat structs or even pathnames to 2 files, you would potentially have to walk all files starting at the root directory (if there is one) to determine if the 2 files satisfy the topological condtion of being under the same mount point.) FTS_XDEV is documented as doing the wrong thing for du -x by saying that it doesn't "descend" "into directories that have a different device number than the file from which the descent began". Its description of "same device" is too verbose. It would benefit from formally specifying mount points and file systems and "cross" too. Its "descent" is just good enough without a formal specification since the mount point is at level 0 in the new file system and a descent of 0 levels is not a descent in informal use (like for "negative", but unlike for ascent/positive where it is unclear if 0 levels is an degenerate ascent). The old POSIX draft uses "same.*device" just once according to a simple grep. This is the one quoted above for du -x. Old POSIX find doesn't even have -x. It has -xdev. This is strange, since FreeBSD's man page has said since long before 2001 that it is -xdev that is deprecated. It specifies -xdev using "descending", like for FTS_XDEV but with worse verbose wording. find(1) seems to be missing a classification option for mount points in both FreeBSD and POSIX. This could be used to prune mount points, but pruning is much harder than using a flag that works like -x should work. Perhaps something can be done with pruning levels for any utility that supports -x). E.g. -xx could descend to N levels, where the level counter is set to 0 when a mount point is _first_ reached. Then -xx-1 would give the correct du -x behaviour of not doing the degenerate descent to level 0; -xx0 would give the find behaviour of doing the degenerate descent to level 0; -xx1 would descend 1 level; other positive descents are easy to implement; ther negative descents are too hard to implement. Bruce From owner-svn-src-head@freebsd.org Mon Mar 5 08:19: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 976E6F3C737 for ; Mon, 5 Mar 2018 08:19:24 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x234.google.com (mail-yw0-x234.google.com [IPv6:2607:f8b0:4002:c05::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35CB26A857 for ; Mon, 5 Mar 2018 08:19:24 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x234.google.com with SMTP id j143so5356293ywb.4 for ; Mon, 05 Mar 2018 00:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ltHISW9qns7DXK1iF1O4O7LAmmeDA7N40c/16R2nPBE=; b=mRWJoQpuOn3DW/+VT14sRecbeNKW/Kn42Uzieqop4qUX30FVSwqXCtQ492Edrj1hAv UkFE3P5RVITURBQQkwHX1HTVwgINeaSqAEsc4kxRg5ElU96VP3QkTmHORKF6375X0DzX H6EieFIb02YGQZGYwrH6FZnVRK4I63LvsvE9w= 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=ltHISW9qns7DXK1iF1O4O7LAmmeDA7N40c/16R2nPBE=; b=O9VE1AL4UDk4iT28/XU0tf9NGVWGYJyZ/CZHbp/0o3Utmfn15nmxD2wf9187Qnj0uz vQZOgVvhy2A5Ek97TWzsHCZi09ogTWWzd47BzFlN0L3aj0dpztmNWWr1jc45EJcAnhAa YCiBfA2rz66eOV3vGDGFB5gzkfK7icusIGLgXC9NSUWvwjIbxaiQJDJnmfY5Kd8CKHfK emxbm9t7/O3IkIZDhPuaa3Kz7iSe5EQdoiSZ5d8och8A0EjUtCax7tfx5DbMxHvjE2WA +YgL+tUvYfOWql/gO6GZOegLSPWpb7zazOIz3YUbBZTosq+zD5RlgbYslJjcbsrOGXHz /8aw== X-Gm-Message-State: AElRT7GGMuKsNf2+K9RoFK3N7TDPIVpoCWTUZVMGyUXMjrsz48rht7sD vBbcvrhK/x5F9ZzNJ0iC6GLbcM3Mjj0oHxhDuM03aw== X-Google-Smtp-Source: AG47ELvbDbNc/UZoEpIrb2BxVSVStU8THude1Jgh61393dz5aAYosne/7lh1OvGjTKZYZXUvD5pJQyAEX2L+e7gCzN4= X-Received: by 10.13.243.198 with SMTP id c189mr8672307ywf.141.1520237963551; Mon, 05 Mar 2018 00:19:23 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:23d2:0:0:0:0:0 with HTTP; Mon, 5 Mar 2018 00:18:53 -0800 (PST) In-Reply-To: <201609301959.u8UJxvJg011567@repo.freebsd.org> References: <201609301959.u8UJxvJg011567@repo.freebsd.org> From: Eitan Adler Date: Mon, 5 Mar 2018 00:18:53 -0800 Message-ID: Subject: Re: svn commit: r306525 - in head/lib: . librss To: Adrian Chadd 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: Mon, 05 Mar 2018 08:19:24 -0000 On 30 September 2016 at 12:59, Adrian Chadd wrote: > Author: adrian > Date: Fri Sep 30 19:59:56 2016 > New Revision: 306525 > URL: https://svnweb.freebsd.org/changeset/base/306525 > > Log: > Add librss, a simple wrapper around RSS APIs so applications can begin auto-tuning. Any reason to not MFC this? -- Eitan Adler From owner-svn-src-head@freebsd.org Mon Mar 5 10:09: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 8A1F8F44AD7; Mon, 5 Mar 2018 10:09:19 +0000 (UTC) (envelope-from andrew@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 3B65A70CD9; Mon, 5 Mar 2018 10:09:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2F12A226EB; Mon, 5 Mar 2018 10:09:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w25A9IgN069368; Mon, 5 Mar 2018 10:09:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25A9I83069367; Mon, 5 Mar 2018 10:09:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803051009.w25A9I83069367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 5 Mar 2018 10:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330488 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330488 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 10:09:19 -0000 Author: andrew Date: Mon Mar 5 10:09:18 2018 New Revision: 330488 URL: https://svnweb.freebsd.org/changeset/base/330488 Log: In the ACPI GICv3 attach function call device_get_children to get the list of children. We expect this to be populated when configuring the secondary cores. Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/gic_v3_acpi.c Modified: head/sys/arm64/arm64/gic_v3_acpi.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_acpi.c Mon Mar 5 09:18:40 2018 (r330487) +++ head/sys/arm64/arm64/gic_v3_acpi.c Mon Mar 5 10:09:18 2018 (r330488) @@ -280,6 +280,9 @@ gic_v3_acpi_attach(device_t dev) */ gic_v3_acpi_bus_attach(dev); + if (device_get_children(dev, &sc->gic_children, &sc->gic_nchildren) !=0) + sc->gic_nchildren = 0; + return (0); error: From owner-svn-src-head@freebsd.org Mon Mar 5 10:11: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 2D42DF44CF2; Mon, 5 Mar 2018 10:11:31 +0000 (UTC) (envelope-from andrew@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 D470570F0E; Mon, 5 Mar 2018 10:11:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CF8032272E; Mon, 5 Mar 2018 10:11:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w25ABUd1073093; Mon, 5 Mar 2018 10:11:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25ABUh2073092; Mon, 5 Mar 2018 10:11:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803051011.w25ABUh2073092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 5 Mar 2018 10:11:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330489 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330489 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 10:11:31 -0000 Author: andrew Date: Mon Mar 5 10:11:30 2018 New Revision: 330489 URL: https://svnweb.freebsd.org/changeset/base/330489 Log: Register each GICv3 ITS driver with a useful cross reference. We currently only use the first driver, however this may change in the future and hardware exists with multiple ITS devices. Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Mon Mar 5 10:09:18 2018 (r330488) +++ head/sys/arm64/arm64/gicv3_its.c Mon Mar 5 10:11:30 2018 (r330489) @@ -1734,7 +1734,7 @@ gicv3_its_acpi_attach(device_t dev) if (err != 0) return (err); - sc->sc_pic = intr_pic_register(dev, 1); + sc->sc_pic = intr_pic_register(dev, device_get_unit(dev) + 1); intr_pic_add_handler(device_get_parent(dev), sc->sc_pic, gicv3_its_intr, sc, GIC_FIRST_LPI, LPI_NIRQS); From owner-svn-src-head@freebsd.org Mon Mar 5 11:49: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 04E4EF25687; Mon, 5 Mar 2018 11:49:53 +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 7ACBB74886; Mon, 5 Mar 2018 11:49:52 +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 56361236A5; Mon, 5 Mar 2018 11:49:52 +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 w25Bnqaf019628; Mon, 5 Mar 2018 11:49:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25BnjKp019562; Mon, 5 Mar 2018 11:49:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051149.w25BnjKp019562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 11:49:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330490 - in head/sys/ofed: drivers/infiniband/core include/rdma include/uapi/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/ofed: drivers/infiniband/core include/rdma include/uapi/rdma X-SVN-Commit-Revision: 330490 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:49:53 -0000 Author: hselasky Date: Mon Mar 5 11:49:45 2018 New Revision: 330490 URL: https://svnweb.freebsd.org/changeset/base/330490 Log: Add missing FreeBSD tags and SVN properties to ibcore. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/agent.h (contents, props changed) head/sys/ofed/drivers/infiniband/core/cm_msgs.h (contents, props changed) head/sys/ofed/drivers/infiniband/core/core_priv.h (contents, props changed) head/sys/ofed/drivers/infiniband/core/ib_addr.c head/sys/ofed/drivers/infiniband/core/ib_agent.c head/sys/ofed/drivers/infiniband/core/ib_cache.c head/sys/ofed/drivers/infiniband/core/ib_cm.c head/sys/ofed/drivers/infiniband/core/ib_cma.c head/sys/ofed/drivers/infiniband/core/ib_cq.c head/sys/ofed/drivers/infiniband/core/ib_device.c head/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c head/sys/ofed/drivers/infiniband/core/ib_iwcm.c head/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c head/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c head/sys/ofed/drivers/infiniband/core/ib_mad.c head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c head/sys/ofed/drivers/infiniband/core/ib_multicast.c head/sys/ofed/drivers/infiniband/core/ib_packer.c head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c head/sys/ofed/drivers/infiniband/core/ib_sa_query.c head/sys/ofed/drivers/infiniband/core/ib_smi.c head/sys/ofed/drivers/infiniband/core/ib_sysfs.c head/sys/ofed/drivers/infiniband/core/ib_ucm.c head/sys/ofed/drivers/infiniband/core/ib_ucma.c head/sys/ofed/drivers/infiniband/core/ib_ud_header.c head/sys/ofed/drivers/infiniband/core/ib_umem.c head/sys/ofed/drivers/infiniband/core/ib_umem_odp.c head/sys/ofed/drivers/infiniband/core/ib_umem_rbtree.c head/sys/ofed/drivers/infiniband/core/ib_user_mad.c head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c head/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c head/sys/ofed/drivers/infiniband/core/ib_uverbs_marshall.c head/sys/ofed/drivers/infiniband/core/ib_verbs.c head/sys/ofed/drivers/infiniband/core/iwcm.h (contents, props changed) head/sys/ofed/drivers/infiniband/core/iwpm_util.h head/sys/ofed/drivers/infiniband/core/mad_priv.h (contents, props changed) head/sys/ofed/drivers/infiniband/core/mad_rmpp.h (contents, props changed) head/sys/ofed/drivers/infiniband/core/opa_smi.h head/sys/ofed/drivers/infiniband/core/sa.h (contents, props changed) head/sys/ofed/drivers/infiniband/core/smi.h (contents, props changed) head/sys/ofed/drivers/infiniband/core/uverbs.h (contents, props changed) head/sys/ofed/include/rdma/ib.h head/sys/ofed/include/rdma/ib_addr.h (contents, props changed) head/sys/ofed/include/rdma/ib_cache.h (contents, props changed) head/sys/ofed/include/rdma/ib_cm.h (contents, props changed) head/sys/ofed/include/rdma/ib_fmr_pool.h (contents, props changed) head/sys/ofed/include/rdma/ib_hdrs.h head/sys/ofed/include/rdma/ib_mad.h (contents, props changed) head/sys/ofed/include/rdma/ib_marshall.h (contents, props changed) head/sys/ofed/include/rdma/ib_pack.h (contents, props changed) head/sys/ofed/include/rdma/ib_pma.h (contents, props changed) head/sys/ofed/include/rdma/ib_sa.h (contents, props changed) head/sys/ofed/include/rdma/ib_smi.h (contents, props changed) head/sys/ofed/include/rdma/ib_umem.h (contents, props changed) head/sys/ofed/include/rdma/ib_umem_odp.h head/sys/ofed/include/rdma/ib_verbs.h (contents, props changed) head/sys/ofed/include/rdma/iw_cm.h (contents, props changed) head/sys/ofed/include/rdma/iw_portmap.h head/sys/ofed/include/rdma/opa_port_info.h head/sys/ofed/include/rdma/opa_smi.h head/sys/ofed/include/rdma/rdma_cm.h (contents, props changed) head/sys/ofed/include/rdma/rdma_cm_ib.h (contents, props changed) head/sys/ofed/include/rdma/rdma_vt.h head/sys/ofed/include/rdma/rdmavt_cq.h head/sys/ofed/include/rdma/rdmavt_mr.h head/sys/ofed/include/rdma/rdmavt_qp.h head/sys/ofed/include/uapi/rdma/ib_user_cm.h head/sys/ofed/include/uapi/rdma/ib_user_mad.h head/sys/ofed/include/uapi/rdma/ib_user_sa.h head/sys/ofed/include/uapi/rdma/ib_user_verbs.h head/sys/ofed/include/uapi/rdma/mlx4-abi.h head/sys/ofed/include/uapi/rdma/mlx5-abi.h head/sys/ofed/include/uapi/rdma/mthca-abi.h (contents, props changed) head/sys/ofed/include/uapi/rdma/rdma_user_cm.h Modified: head/sys/ofed/drivers/infiniband/core/agent.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/agent.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/agent.h Mon Mar 5 11:49:45 2018 (r330490) @@ -34,6 +34,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef __AGENT_H_ Modified: head/sys/ofed/drivers/infiniband/core/cm_msgs.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cm_msgs.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/cm_msgs.h Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004, 2011 Intel Corporation. All rights reserved. * Copyright (c) 2004 Topspin Corporation. All rights reserved. * Copyright (c) 2004 Voltaire Corporation. All rights reserved. @@ -30,7 +32,10 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS THE * SOFTWARE. + * + * $FreeBSD$ */ + #if !defined(CM_MSGS_H) #define CM_MSGS_H Modified: head/sys/ofed/drivers/infiniband/core/core_priv.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/core_priv.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/core_priv.h Mon Mar 5 11:49:45 2018 (r330490) @@ -30,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef _CORE_PRIV_H Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_addr.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_addr.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2005 Voltaire Inc. All rights reserved. * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. * Copyright (c) 1999-2005, Mellanox Technologies, Inc. All rights reserved. @@ -31,6 +33,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_agent.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_agent.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_agent.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004, 2005 Mellanox Technologies Ltd. All rights reserved. * Copyright (c) 2004, 2005 Infinicon Corporation. All rights reserved. * Copyright (c) 2004, 2005 Intel Corporation. All rights reserved. @@ -34,6 +36,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_cache.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cache.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_cache.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004 Topspin Communications. All rights reserved. * Copyright (c) 2005 Intel Corporation. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. @@ -31,6 +33,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cm.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_cm.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004-2007 Intel Corporation. All rights reserved. * Copyright (c) 2004 Topspin Corporation. All rights reserved. * Copyright (c) 2004, 2005 Voltaire Corporation. All rights reserved. @@ -31,6 +33,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2005 Voltaire Inc. All rights reserved. * Copyright (c) 2002-2005, Network Appliance, Inc. All rights reserved. * Copyright (c) 1999-2005, Mellanox Technologies, Inc. All rights reserved. @@ -31,6 +33,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #define LINUXKPI_PARAM_PREFIX ibcore_ Modified: head/sys/ofed/drivers/infiniband/core/ib_cq.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cq.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_cq.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2017 Mellanox Technologies Ltd. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_device.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_device.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_device.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004 Topspin Communications. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. * @@ -29,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004 Topspin Communications. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. * @@ -29,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_iwcm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_iwcm.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_iwcm.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004, 2005 Intel Corporation. All rights reserved. * Copyright (c) 2004 Topspin Corporation. All rights reserved. * Copyright (c) 2004, 2005 Voltaire Corporation. All rights reserved. @@ -34,7 +36,9 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * + * $FreeBSD$ */ + #include #include #include Modified: head/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Intel Corporation. All rights reserved. * Copyright (c) 2014 Chelsio, Inc. All rights reserved. * @@ -29,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include "iwpm_util.h" Modified: head/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Chelsio, Inc. All rights reserved. * Copyright (c) 2014 Intel Corporation. All rights reserved. * @@ -29,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include "iwpm_util.h" Modified: head/sys/ofed/drivers/infiniband/core/ib_mad.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_mad.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_mad.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004-2007 Voltaire, Inc. All rights reserved. * Copyright (c) 2005 Intel Corporation. All rights reserved. * Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved. @@ -33,6 +35,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * + * $FreeBSD$ */ #define LINUXKPI_PARAM_PREFIX ibcore_ Modified: head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2005 Intel Inc. All rights reserved. * Copyright (c) 2005-2006 Voltaire, Inc. All rights reserved. * Copyright (c) 2014 Intel Corporation. All rights reserved. @@ -30,6 +32,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_multicast.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_multicast.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_multicast.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2006 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #define LINUXKPI_PARAM_PREFIX ibcore_ Modified: head/sys/ofed/drivers/infiniband/core/ib_packer.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_packer.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_packer.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004 Topspin Corporation. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. * @@ -29,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2015-2017, Mellanox Technologies inc. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include "core_priv.h" Modified: head/sys/ofed/drivers/infiniband/core/ib_sa_query.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_sa_query.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_sa_query.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004 Topspin Communications. All rights reserved. * Copyright (c) 2005 Voltaire, Inc. All rights reserved. * Copyright (c) 2006 Intel Corporation. All rights reserved. @@ -30,6 +32,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_smi.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_smi.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_smi.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004, 2005 Mellanox Technologies Ltd. All rights reserved. * Copyright (c) 2004, 2005 Infinicon Corporation. All rights reserved. * Copyright (c) 2004, 2005 Intel Corporation. All rights reserved. @@ -35,6 +37,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_sysfs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_sysfs.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_sysfs.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. * Copyright (c) 2005 Mellanox Technologies Ltd. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. @@ -30,6 +32,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include "core_priv.h" Modified: head/sys/ofed/drivers/infiniband/core/ib_ucm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_ucm.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_ucm.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2005 Topspin Communications. All rights reserved. * Copyright (c) 2005 Intel Corporation. All rights reserved. * @@ -29,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_ucma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_ucma.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_ucma.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2005-2006 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_ud_header.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_ud_header.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_ud_header.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004 Topspin Corporation. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. * @@ -29,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_umem.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_umem.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_umem.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2005 Topspin Communications. All rights reserved. * Copyright (c) 2005 Cisco Systems. All rights reserved. * Copyright (c) 2005 Mellanox Technologies. All rights reserved. @@ -30,6 +32,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #define LINUXKPI_PARAM_PREFIX ibcore_ Modified: head/sys/ofed/drivers/infiniband/core/ib_umem_odp.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_umem_odp.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_umem_odp.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Mellanox Technologies. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_umem_rbtree.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_umem_rbtree.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_umem_rbtree.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Mellanox Technologies. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_user_mad.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_user_mad.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004 Topspin Communications. All rights reserved. * Copyright (c) 2005 Voltaire, Inc. All rights reserved. * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved. @@ -31,6 +33,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #define pr_fmt(fmt) "user_mad: " fmt Modified: head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2005 Topspin Communications. All rights reserved. * Copyright (c) 2005, 2006, 2007 Cisco Systems. All rights reserved. * Copyright (c) 2005 PathScale, Inc. All rights reserved. @@ -31,6 +33,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #define LINUXKPI_PARAM_PREFIX ibcore_ Modified: head/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2005 Topspin Communications. All rights reserved. * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. * Copyright (c) 2005 Mellanox Technologies. All rights reserved. @@ -32,6 +34,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_uverbs_marshall.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_uverbs_marshall.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_uverbs_marshall.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2005 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_verbs.c Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/ib_verbs.c Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2004 Mellanox Technologies Ltd. All rights reserved. * Copyright (c) 2004 Infinicon Corporation. All rights reserved. * Copyright (c) 2004 Intel Corporation. All rights reserved. @@ -34,6 +36,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #include Modified: head/sys/ofed/drivers/infiniband/core/iwcm.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/iwcm.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/iwcm.h Mon Mar 5 11:49:45 2018 (r330490) @@ -31,7 +31,10 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ + #ifndef IWCM_H #define IWCM_H Modified: head/sys/ofed/drivers/infiniband/core/iwpm_util.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/iwpm_util.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/iwpm_util.h Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Intel Corporation. All rights reserved. * Copyright (c) 2014 Chelsio, Inc. All rights reserved. * @@ -29,7 +31,10 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ + #ifndef _IWPM_UTIL_H #define _IWPM_UTIL_H Modified: head/sys/ofed/drivers/infiniband/core/mad_priv.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/mad_priv.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/mad_priv.h Mon Mar 5 11:49:45 2018 (r330490) @@ -33,6 +33,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef __IB_MAD_PRIV_H__ Modified: head/sys/ofed/drivers/infiniband/core/mad_rmpp.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/mad_rmpp.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/mad_rmpp.h Mon Mar 5 11:49:45 2018 (r330490) @@ -30,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef __MAD_RMPP_H__ Modified: head/sys/ofed/drivers/infiniband/core/opa_smi.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/opa_smi.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/opa_smi.h Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two @@ -29,6 +31,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * + * $FreeBSD$ */ #ifndef __OPA_SMI_H_ Modified: head/sys/ofed/drivers/infiniband/core/sa.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/sa.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/sa.h Mon Mar 5 11:49:45 2018 (r330490) @@ -32,6 +32,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef SA_H Modified: head/sys/ofed/drivers/infiniband/core/smi.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/smi.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/smi.h Mon Mar 5 11:49:45 2018 (r330490) @@ -35,6 +35,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * + * $FreeBSD$ */ #ifndef __SMI_H_ Modified: head/sys/ofed/drivers/infiniband/core/uverbs.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/uverbs.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/drivers/infiniband/core/uverbs.h Mon Mar 5 11:49:45 2018 (r330490) @@ -34,6 +34,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef UVERBS_H Modified: head/sys/ofed/include/rdma/ib.h ============================================================================== --- head/sys/ofed/include/rdma/ib.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib.h Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2010 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(_RDMA_IB_H) Modified: head/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- head/sys/ofed/include/rdma/ib_addr.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_addr.h Mon Mar 5 11:49:45 2018 (r330490) @@ -31,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(IB_ADDR_H) Modified: head/sys/ofed/include/rdma/ib_cache.h ============================================================================== --- head/sys/ofed/include/rdma/ib_cache.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_cache.h Mon Mar 5 11:49:45 2018 (r330490) @@ -32,6 +32,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef _IB_CACHE_H Modified: head/sys/ofed/include/rdma/ib_cm.h ============================================================================== --- head/sys/ofed/include/rdma/ib_cm.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_cm.h Mon Mar 5 11:49:45 2018 (r330490) @@ -33,7 +33,10 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ + #if !defined(IB_CM_H) #define IB_CM_H Modified: head/sys/ofed/include/rdma/ib_fmr_pool.h ============================================================================== --- head/sys/ofed/include/rdma/ib_fmr_pool.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_fmr_pool.h Mon Mar 5 11:49:45 2018 (r330490) @@ -31,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(IB_FMR_POOL_H) Modified: head/sys/ofed/include/rdma/ib_hdrs.h ============================================================================== --- head/sys/ofed/include/rdma/ib_hdrs.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_hdrs.h Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright(c) 2016 Intel Corporation. * * This file is provided under a dual BSD/GPLv2 license. When using or @@ -43,6 +45,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * + * $FreeBSD$ */ #ifndef IB_HDRS_H Modified: head/sys/ofed/include/rdma/ib_mad.h ============================================================================== --- head/sys/ofed/include/rdma/ib_mad.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_mad.h Mon Mar 5 11:49:45 2018 (r330490) @@ -34,6 +34,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(IB_MAD_H) Modified: head/sys/ofed/include/rdma/ib_marshall.h ============================================================================== --- head/sys/ofed/include/rdma/ib_marshall.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_marshall.h Mon Mar 5 11:49:45 2018 (r330490) @@ -30,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(IB_USER_MARSHALL_H) Modified: head/sys/ofed/include/rdma/ib_pack.h ============================================================================== --- head/sys/ofed/include/rdma/ib_pack.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_pack.h Mon Mar 5 11:49:45 2018 (r330490) @@ -30,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef IB_PACK_H Modified: head/sys/ofed/include/rdma/ib_pma.h ============================================================================== --- head/sys/ofed/include/rdma/ib_pma.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_pma.h Mon Mar 5 11:49:45 2018 (r330490) @@ -32,6 +32,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(IB_PMA_H) Modified: head/sys/ofed/include/rdma/ib_sa.h ============================================================================== --- head/sys/ofed/include/rdma/ib_sa.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_sa.h Mon Mar 5 11:49:45 2018 (r330490) @@ -32,6 +32,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef IB_SA_H Modified: head/sys/ofed/include/rdma/ib_smi.h ============================================================================== --- head/sys/ofed/include/rdma/ib_smi.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_smi.h Mon Mar 5 11:49:45 2018 (r330490) @@ -34,6 +34,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(IB_SMI_H) Modified: head/sys/ofed/include/rdma/ib_umem.h ============================================================================== --- head/sys/ofed/include/rdma/ib_umem.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_umem.h Mon Mar 5 11:49:45 2018 (r330490) @@ -30,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef IB_UMEM_H Modified: head/sys/ofed/include/rdma/ib_umem_odp.h ============================================================================== --- head/sys/ofed/include/rdma/ib_umem_odp.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_umem_odp.h Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Mellanox Technologies. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #ifndef IB_UMEM_ODP_H Modified: head/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- head/sys/ofed/include/rdma/ib_verbs.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/ib_verbs.h Mon Mar 5 11:49:45 2018 (r330490) @@ -36,6 +36,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(IB_VERBS_H) Modified: head/sys/ofed/include/rdma/iw_cm.h ============================================================================== --- head/sys/ofed/include/rdma/iw_cm.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/iw_cm.h Mon Mar 5 11:49:45 2018 (r330490) @@ -31,7 +31,10 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ + #ifndef IW_CM_H #define IW_CM_H Modified: head/sys/ofed/include/rdma/iw_portmap.h ============================================================================== --- head/sys/ofed/include/rdma/iw_portmap.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/iw_portmap.h Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Intel Corporation. All rights reserved. * Copyright (c) 2014 Chelsio, Inc. All rights reserved. * @@ -29,7 +31,10 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ + #ifndef _IW_PORTMAP_H #define _IW_PORTMAP_H Modified: head/sys/ofed/include/rdma/opa_port_info.h ============================================================================== --- head/sys/ofed/include/rdma/opa_port_info.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/opa_port_info.h Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(OPA_PORT_INFO_H) Modified: head/sys/ofed/include/rdma/opa_smi.h ============================================================================== --- head/sys/ofed/include/rdma/opa_smi.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/opa_smi.h Mon Mar 5 11:49:45 2018 (r330490) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0 + * * Copyright (c) 2014 Intel Corporation. All rights reserved. * * This software is available to you under a choice of one of two @@ -28,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(OPA_SMI_H) Modified: head/sys/ofed/include/rdma/rdma_cm.h ============================================================================== --- head/sys/ofed/include/rdma/rdma_cm.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/rdma_cm.h Mon Mar 5 11:49:45 2018 (r330490) @@ -31,6 +31,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ #if !defined(RDMA_CM_H) Modified: head/sys/ofed/include/rdma/rdma_cm_ib.h ============================================================================== --- head/sys/ofed/include/rdma/rdma_cm_ib.h Mon Mar 5 10:11:30 2018 (r330489) +++ head/sys/ofed/include/rdma/rdma_cm_ib.h Mon Mar 5 11:49:45 2018 (r330490) @@ -30,6 +30,8 @@ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. + * + * $FreeBSD$ */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Mar 5 11:52: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 425EFF25BC8; Mon, 5 Mar 2018 11:52:40 +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 E6FA674D00; Mon, 5 Mar 2018 11:52:39 +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 E1F5A2382E; Mon, 5 Mar 2018 11:52:39 +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 w25BqdBY024130; Mon, 5 Mar 2018 11:52:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25Bqd0H024129; Mon, 5 Mar 2018 11:52:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051152.w25Bqd0H024129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 11:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330491 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330491 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:52:40 -0000 Author: hselasky Date: Mon Mar 5 11:52:39 2018 New Revision: 330491 URL: https://svnweb.freebsd.org/changeset/base/330491 Log: Do not add RoCEv2 default GID in ibcore when IPv6 is disabled to honor the networking stack's IPv6 disabled setting. Else the offload HCA can start using IPv6 packets for QPs. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cache.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cache.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cache.c Mon Mar 5 11:49:45 2018 (r330490) +++ head/sys/ofed/drivers/infiniband/core/ib_cache.c Mon Mar 5 11:52:39 2018 (r330491) @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -702,6 +703,16 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib make_default_gid(ndev, &gid); memset(&gid_attr, 0, sizeof(gid_attr)); gid_attr.ndev = ndev; + + /* Default GID is created using unique GUID and local subnet prefix, + * as described in section 4.1.1 and 3.5.10 in IB spec 1.3. + * Therefore don't create RoCEv2 default GID based on it that + * resembles as IPv6 GID based on link local address when IPv6 is + * disabled in kernel. + */ +#ifndef INET6 + gid_type_mask &= ~BIT(IB_GID_TYPE_ROCE_UDP_ENCAP); +#endif for (gid_type = 0; gid_type < IB_GID_TYPE_SIZE; ++gid_type) { int ix; From owner-svn-src-head@freebsd.org Mon Mar 5 11:55: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 77B68F25F80; Mon, 5 Mar 2018 11:55:30 +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 27F6C74EFB; Mon, 5 Mar 2018 11:55:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C9C22382F; Mon, 5 Mar 2018 11:55:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w25BtTn8024313; Mon, 5 Mar 2018 11:55:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25BtTh2024312; Mon, 5 Mar 2018 11:55:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051155.w25BtTh2024312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 11:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330492 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330492 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:55:30 -0000 Author: hselasky Date: Mon Mar 5 11:55:29 2018 New Revision: 330492 URL: https://svnweb.freebsd.org/changeset/base/330492 Log: Add support for IPv6 link local GIDs equal to the default GID for VLANs in ibcore. IPv6 link local addresses are usually derived from the netdev MAC address. This is applicable to VLAN devices and its lower netdevice as well. In such cases the IPv6 link local address is a duplicate of the default GID. Now that link local IPv6 addresses based GIDs are supported, allow adding such GID entries in the GID table. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cache.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cache.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cache.c Mon Mar 5 11:52:39 2018 (r330491) +++ head/sys/ofed/drivers/infiniband/core/ib_cache.c Mon Mar 5 11:55:29 2018 (r330492) @@ -336,29 +336,12 @@ int ib_cache_gid_add(struct ib_device *ib_dev, u8 port struct ib_gid_table *table; int ix; int ret = 0; - struct net_device *idev; int empty; table = ports_table[port - rdma_start_port(ib_dev)]; if (!memcmp(gid, &zgid, sizeof(*gid))) return -EINVAL; - - if (ib_dev->get_netdev) { - idev = ib_dev->get_netdev(ib_dev, port); - if (idev && attr->ndev != idev) { - union ib_gid default_gid; - - /* Adding default GIDs in not permitted */ - make_default_gid(idev, &default_gid); - if (!memcmp(gid, &default_gid, sizeof(*gid))) { - dev_put(idev); - return -EPERM; - } - } - if (idev) - dev_put(idev); - } mutex_lock(&table->lock); write_lock_irq(&table->rwlock); From owner-svn-src-head@freebsd.org Mon Mar 5 11:57: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 53C02F26224; Mon, 5 Mar 2018 11:57:27 +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 058F6750D9; Mon, 5 Mar 2018 11:57:27 +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 F00D323830; Mon, 5 Mar 2018 11:57:26 +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 w25BvQMg024423; Mon, 5 Mar 2018 11:57:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25BvQ0X024422; Mon, 5 Mar 2018 11:57:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051157.w25BvQ0X024422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 11:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330493 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330493 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:57:27 -0000 Author: hselasky Date: Mon Mar 5 11:57:26 2018 New Revision: 330493 URL: https://svnweb.freebsd.org/changeset/base/330493 Log: Make deletion of RoCE GID entries synchronous in ibcore. When a network device is departing, the RoCE GID entries should be cleared before the default L2 link layer address is freed. Else a NULL pointer access may happen. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Modified: head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Mon Mar 5 11:55:29 2018 (r330492) +++ head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Mon Mar 5 11:57:26 2018 (r330493) @@ -362,6 +362,9 @@ roce_gid_delete_all_event(struct net_device *ndev) dev_hold(ndev); work->ndev = ndev; queue_work(roce_gid_mgmt_wq, &work->work); + + /* make sure job is complete before returning */ + flush_workqueue(roce_gid_mgmt_wq); } static int From owner-svn-src-head@freebsd.org Mon Mar 5 11:58: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 364C3F26476; Mon, 5 Mar 2018 11:58:38 +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 D0E6475262; Mon, 5 Mar 2018 11:58:37 +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 CBA1723831; Mon, 5 Mar 2018 11:58:37 +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 w25BwbNQ024503; Mon, 5 Mar 2018 11:58:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25BwbAC024502; Mon, 5 Mar 2018 11:58:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051158.w25BwbAC024502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 11:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330494 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330494 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:58:38 -0000 Author: hselasky Date: Mon Mar 5 11:58:37 2018 New Revision: 330494 URL: https://svnweb.freebsd.org/changeset/base/330494 Log: Select RoCEv2 by default in ibcore. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 11:57:26 2018 (r330493) +++ head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 11:58:37 2018 (r330494) @@ -4137,7 +4137,6 @@ static void cma_add_one(struct ib_device *device) struct cma_device *cma_dev; struct rdma_id_private *id_priv; unsigned int i; - unsigned long supported_gids = 0; cma_dev = kmalloc(sizeof *cma_dev, GFP_KERNEL); if (!cma_dev) @@ -4154,10 +4153,23 @@ static void cma_add_one(struct ib_device *device) return; } for (i = rdma_start_port(device); i <= rdma_end_port(device); i++) { + unsigned long supported_gids; + unsigned int default_gid_type; + supported_gids = roce_gid_type_mask_support(device, i); - WARN_ON(!supported_gids); + + if (WARN_ON(!supported_gids)) { + /* set something valid */ + default_gid_type = 0; + } else if (test_bit(IB_GID_TYPE_ROCE_UDP_ENCAP, &supported_gids)) { + /* prefer RoCEv2, if supported */ + default_gid_type = IB_GID_TYPE_ROCE_UDP_ENCAP; + } else { + default_gid_type = find_first_bit(&supported_gids, + BITS_PER_LONG); + } cma_dev->default_gid_type[i - rdma_start_port(device)] = - find_first_bit(&supported_gids, BITS_PER_LONG); + default_gid_type; } init_completion(&cma_dev->comp); From owner-svn-src-head@freebsd.org Mon Mar 5 11:59: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 C6DEFF265ED; Mon, 5 Mar 2018 11:59:54 +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 73E94753CD; Mon, 5 Mar 2018 11:59:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EEBD23832; Mon, 5 Mar 2018 11:59:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w25BxsdL024585; Mon, 5 Mar 2018 11:59:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25Bxsrb024584; Mon, 5 Mar 2018 11:59:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051159.w25Bxsrb024584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 11:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330495 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330495 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:59:55 -0000 Author: hselasky Date: Mon Mar 5 11:59:54 2018 New Revision: 330495 URL: https://svnweb.freebsd.org/changeset/base/330495 Log: Map type of service, TOS, to IB or VLAN service level 1:1 in ibcore. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 11:58:37 2018 (r330494) +++ head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 11:59:54 2018 (r330495) @@ -2422,8 +2422,17 @@ static int cma_resolve_iw_route(struct rdma_id_private static int iboe_tos_to_sl(struct net_device *ndev, int tos) { - /* TODO: Implement this function */ - return 0; + /* get service level, SL, from type of service, TOS */ + int sl = tos; + + /* range check input argument and map 1:1 */ + if (sl > 255) + sl = 255; + else if (sl < 0) + sl = 0; + + /* final mappings are done by the vendor specific drivers */ + return sl; } static enum ib_gid_type cma_route_gid_type(enum rdma_network_type network_type, From owner-svn-src-head@freebsd.org Mon Mar 5 12:04: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 26E3EF2768C; Mon, 5 Mar 2018 12:04:35 +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 C2E2675B81; Mon, 5 Mar 2018 12:04:34 +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 B9A3D239BB; Mon, 5 Mar 2018 12:04:34 +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 w25C4Ypf029564; Mon, 5 Mar 2018 12:04:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25C4YW2029563; Mon, 5 Mar 2018 12:04:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051204.w25C4YW2029563@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 12:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330496 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330496 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 12:04:35 -0000 Author: hselasky Date: Mon Mar 5 12:04:34 2018 New Revision: 330496 URL: https://svnweb.freebsd.org/changeset/base/330496 Log: Need to check for IPv6 linklocal address inside rdma_resolve_addr() in ibcore. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 11:59:54 2018 (r330495) +++ head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 12:04:34 2018 (r330496) @@ -107,6 +107,7 @@ const char *__attribute_const__ rdma_event_msg(enum rd } EXPORT_SYMBOL(rdma_event_msg); +static int cma_check_linklocal(struct rdma_dev_addr *, struct sockaddr *); static void cma_add_one(struct ib_device *device); static void cma_remove_one(struct ib_device *device, void *client_data); @@ -2807,6 +2808,10 @@ int rdma_resolve_addr(struct rdma_cm_id *id, struct so if (dst_addr->sa_family == AF_IB) { ret = cma_resolve_ib_addr(id_priv); } else { + ret = cma_check_linklocal(&id->route.addr.dev_addr, dst_addr); + if (ret) + goto err; + ret = rdma_resolve_ip(&addr_client, cma_src_addr(id_priv), dst_addr, &id->route.addr.dev_addr, timeout_ms, addr_handler, id_priv); From owner-svn-src-head@freebsd.org Mon Mar 5 12:39: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 0EC32F2B808; Mon, 5 Mar 2018 12:39:35 +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 AED4877A73; Mon, 5 Mar 2018 12:39:34 +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 8FA8B23E77; Mon, 5 Mar 2018 12:39:34 +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 w25CdYj5044745; Mon, 5 Mar 2018 12:39:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25CdYKr044744; Mon, 5 Mar 2018 12:39:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051239.w25CdYKr044744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 12:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330501 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330501 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 12:39:35 -0000 Author: hselasky Date: Mon Mar 5 12:39:34 2018 New Revision: 330501 URL: https://svnweb.freebsd.org/changeset/base/330501 Log: Make sure to register the VLAN GIDs using the VLAN network interface and not the parent one in ibcore. Else looking up the VLAN GIDs will fail for VLAN IPs. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Modified: head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Mon Mar 5 12:21:36 2018 (r330500) +++ head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c Mon Mar 5 12:39:34 2018 (r330501) @@ -169,12 +169,14 @@ roce_gid_update_addr_callback(struct ib_device *device struct sockaddr_in v4; struct sockaddr_in6 v6; } ipx_addr; + struct net_device *ndev; }; struct ipx_entry *entry; struct net_device *idev; #if defined(INET) || defined(INET6) struct ifaddr *ifa; #endif + struct ib_gid_attr gid_attr; union ib_gid gid; int default_gids; u16 index_num; @@ -211,6 +213,7 @@ roce_gid_update_addr_callback(struct ib_device *device continue; } entry->ipx_addr.v4 = *((struct sockaddr_in *)ifa->ifa_addr); + entry->ndev = idev; STAILQ_INSERT_TAIL(&ipx_head, entry, entry); } #endif @@ -226,6 +229,7 @@ roce_gid_update_addr_callback(struct ib_device *device continue; } entry->ipx_addr.v6 = *((struct sockaddr_in6 *)ifa->ifa_addr); + entry->ndev = idev; /* trash IPv6 scope ID */ sa6_recoverscope(&entry->ipx_addr.v6); @@ -251,19 +255,25 @@ roce_gid_update_addr_callback(struct ib_device *device continue; /* check if entry found */ if (ib_find_cached_gid_by_port(device, &gid, i, - port, ndev, &index_num) == 0) + port, entry->ndev, &index_num) == 0) break; } if (i != IB_GID_TYPE_SIZE) continue; /* add new GID */ - update_gid(GID_ADD, device, port, &gid, ndev); + update_gid(GID_ADD, device, port, &gid, entry->ndev); } /* remove stale GIDs, if any */ - for (i = default_gids; ib_get_cached_gid(device, port, i, &gid, NULL) == 0; i++) { + for (i = default_gids; ib_get_cached_gid(device, port, i, &gid, &gid_attr) == 0; i++) { union ipx_addr ipx; + /* check for valid network device pointer */ + ndev = gid_attr.ndev; + if (ndev == NULL) + continue; + dev_put(ndev); + /* don't delete empty entries */ if (memcmp(&gid, &zgid, sizeof(zgid)) == 0) continue; @@ -274,7 +284,8 @@ roce_gid_update_addr_callback(struct ib_device *device rdma_gid2ip(&ipx.sa[0], &gid); STAILQ_FOREACH(entry, &ipx_head, entry) { - if (memcmp(&entry->ipx_addr, &ipx, sizeof(ipx)) == 0) + if (entry->ndev == ndev && + memcmp(&entry->ipx_addr, &ipx, sizeof(ipx)) == 0) break; } /* check if entry found */ From owner-svn-src-head@freebsd.org Mon Mar 5 13:57: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 A53CEF3157A; Mon, 5 Mar 2018 13:57:38 +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 5413D7AC2A; Mon, 5 Mar 2018 13:57:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A8D324AF4; Mon, 5 Mar 2018 13:57:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w25DvcMm084583; Mon, 5 Mar 2018 13:57:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25Dvcr5084582; Mon, 5 Mar 2018 13:57:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051357.w25Dvcr5084582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 13:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330504 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330504 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:57:39 -0000 Author: hselasky Date: Mon Mar 5 13:57:37 2018 New Revision: 330504 URL: https://svnweb.freebsd.org/changeset/base/330504 Log: Add support for loopback in ibcore. Implement the missing pieces in addr_resolve() to support loopback addresses. IB core will test for the IFF_LOOPBACK flag in the network interface and treat these devices in a special way. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_addr.c Mon Mar 5 13:52:25 2018 (r330503) +++ head/sys/ofed/drivers/infiniband/core/ib_addr.c Mon Mar 5 13:57:37 2018 (r330504) @@ -123,7 +123,15 @@ rdma_copy_addr_sub(u8 *dst, const u8 *src, unsigned mi int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev, const unsigned char *dst_dev_addr) { - if (dev->if_type == IFT_INFINIBAND) + /* check for loopback device */ + if (dev->if_type == IFT_LOOP) { + dev_addr->dev_type = ARPHRD_ETHER; + memset(dev_addr->src_dev_addr, 0, MAX_ADDR_LEN); + memset(dev_addr->broadcast, 0, MAX_ADDR_LEN); + memset(dev_addr->dst_dev_addr, 0, MAX_ADDR_LEN); + dev_addr->bound_dev_if = dev->if_index; + return (0); + } else if (dev->if_type == IFT_INFINIBAND) dev_addr->dev_type = ARPHRD_INFINIBAND; else if (dev->if_type == IFT_ETHER) dev_addr->dev_type = ARPHRD_ETHER; @@ -240,10 +248,10 @@ static int addr_resolve_multi(u8 *edst, struct ifnet * static int addr4_resolve(struct sockaddr_in *src_in, const struct sockaddr_in *dst_in, struct rdma_dev_addr *addr, + u8 *edst, struct ifnet **ifpp) { struct sockaddr_in dst_tmp = *dst_in; - u8 edst[MAX_ADDR_LEN]; in_port_t src_port; struct sockaddr *saddr; struct rtentry *rte; @@ -278,8 +286,7 @@ static int addr4_resolve(struct sockaddr_in *src_in, if (rte == NULL) { error = EHOSTUNREACH; goto done; - } else if (rte->rt_ifp == NULL || rte->rt_ifp == V_loif || - RT_LINK_IS_UP(rte->rt_ifp) == 0) { + } else if (rte->rt_ifp == NULL || RT_LINK_IS_UP(rte->rt_ifp) == 0) { RTFREE_LOCKED(rte); error = EHOSTUNREACH; goto done; @@ -294,8 +301,14 @@ static int addr4_resolve(struct sockaddr_in *src_in, /* Step 2 - find outgoing network interface */ switch (type) { case 0: - /* source check */ - ifp = ip_dev_find(addr->net, src_in->sin_addr.s_addr); + /* check for loopback device */ + if (rte->rt_ifp->if_flags & IFF_LOOPBACK) { + ifp = rte->rt_ifp; + dev_hold(ifp); + } else { + ifp = ip_dev_find(addr->net, src_in->sin_addr.s_addr); + } + /* check source interface */ if (ifp == NULL) { error = ENETUNREACH; goto error_rt_free; @@ -305,11 +318,17 @@ static int addr4_resolve(struct sockaddr_in *src_in, } break; case 1: + /* check for loopback device */ + if (rte->rt_ifp->if_flags & IFF_LOOPBACK) + saddr = (struct sockaddr *)&dst_tmp; + else + saddr = rte->rt_ifa->ifa_addr; + /* get destination network interface from route */ ifp = rte->rt_ifp; dev_hold(ifp); - saddr = rte->rt_ifa->ifa_addr; + /* update source address */ src_port = src_in->sin_port; memcpy(src_in, saddr, rdma_addr_size(saddr)); src_in->sin_port = src_port; /* preserve port number */ @@ -324,13 +343,17 @@ static int addr4_resolve(struct sockaddr_in *src_in, if (dst_tmp.sin_addr.s_addr == INADDR_BROADCAST) { rdma_copy_addr_sub(edst, ifp->if_broadcastaddr, ifp->if_addrlen, MAX_ADDR_LEN); + error = 0; } else if (IN_MULTICAST(ntohl(dst_tmp.sin_addr.s_addr))) { error = addr_resolve_multi(edst, ifp, (struct sockaddr *)&dst_tmp); if (error != 0) goto error_put_ifp; + } else if (ifp->if_flags & IFF_LOOPBACK) { + memset(edst, 0, MAX_ADDR_LEN); + error = 0; } else { bool is_gw = (rte->rt_flags & RTF_GATEWAY) != 0; - memset(edst, 0, sizeof(edst)); + memset(edst, 0, MAX_ADDR_LEN); error = arpresolve(ifp, is_gw, NULL, is_gw ? rte->rt_gateway : (const struct sockaddr *)&dst_tmp, edst, NULL, NULL); @@ -340,13 +363,6 @@ static int addr4_resolve(struct sockaddr_in *src_in, addr->network = RDMA_NETWORK_IPV4; } - /* - * Step 4 - copy destination and source MAC addresses - */ - error = -rdma_copy_addr(addr, ifp, edst); - if (error != 0) - goto error_put_ifp; - if (rte != NULL) RTFREE(rte); @@ -369,6 +385,7 @@ done: static int addr4_resolve(struct sockaddr_in *src_in, const struct sockaddr_in *dst_in, struct rdma_dev_addr *addr, + u8 *edst, struct ifnet **ifpp) { return -EADDRNOTAVAIL; @@ -379,10 +396,10 @@ static int addr4_resolve(struct sockaddr_in *src_in, static int addr6_resolve(struct sockaddr_in6 *src_in, const struct sockaddr_in6 *dst_in, struct rdma_dev_addr *addr, + u8 *edst, struct ifnet **ifpp) { struct sockaddr_in6 dst_tmp = *dst_in; - u8 edst[MAX_ADDR_LEN]; in_port_t src_port; struct sockaddr *saddr; struct rtentry *rte; @@ -424,8 +441,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, if (rte == NULL) { error = EHOSTUNREACH; goto done; - } else if (rte->rt_ifp == NULL || rte->rt_ifp == V_loif || - RT_LINK_IS_UP(rte->rt_ifp) == 0) { + } else if (rte->rt_ifp == NULL || RT_LINK_IS_UP(rte->rt_ifp) == 0) { RTFREE_LOCKED(rte); error = EHOSTUNREACH; goto done; @@ -440,8 +456,14 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, /* Step 2 - find outgoing network interface */ switch (type) { case 0: - /* source check */ - ifp = ip6_dev_find(addr->net, src_in->sin6_addr); + /* check for loopback device */ + if (rte->rt_ifp->if_flags & IFF_LOOPBACK) { + ifp = rte->rt_ifp; + dev_hold(ifp); + } else { + ifp = ip6_dev_find(addr->net, src_in->sin6_addr); + } + /* check source interface */ if (ifp == NULL) { error = ENETUNREACH; goto error_rt_free; @@ -451,10 +473,15 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, } break; case 1: + /* check for loopback device */ + if (rte->rt_ifp->if_flags & IFF_LOOPBACK) + saddr = (struct sockaddr *)&dst_tmp; + else + saddr = rte->rt_ifa->ifa_addr; + /* get destination network interface from route */ ifp = rte->rt_ifp; dev_hold(ifp); - saddr = rte->rt_ifa->ifa_addr; src_port = src_in->sin6_port; memcpy(src_in, saddr, rdma_addr_size(saddr)); @@ -472,9 +499,12 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, (struct sockaddr *)&dst_tmp); if (error != 0) goto error_put_ifp; + } else if (rte->rt_ifp->if_flags & IFF_LOOPBACK) { + memset(edst, 0, MAX_ADDR_LEN); + error = 0; } else { bool is_gw = (rte->rt_flags & RTF_GATEWAY) != 0; - memset(edst, 0, sizeof(edst)); + memset(edst, 0, MAX_ADDR_LEN); error = nd6_resolve(ifp, is_gw, NULL, is_gw ? rte->rt_gateway : (const struct sockaddr *)&dst_tmp, edst, NULL, NULL); @@ -484,13 +514,6 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, addr->network = RDMA_NETWORK_IPV6; } - /* - * Step 4 - copy destination and source MAC addresses - */ - error = -rdma_copy_addr(addr, ifp, edst); - if (error != 0) - goto error_put_ifp; - if (rte != NULL) RTFREE(rte); @@ -513,6 +536,7 @@ done: static int addr6_resolve(struct sockaddr_in6 *src_in, const struct sockaddr_in6 *dst_in, struct rdma_dev_addr *addr, + u8 *edst, struct ifnet **ifpp) { return -EADDRNOTAVAIL; @@ -521,6 +545,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, static int addr_resolve_neigh(struct ifnet *dev, const struct sockaddr *dst_in, + u8 *edst, struct rdma_dev_addr *addr) { if (dev->if_flags & IFF_LOOPBACK) { @@ -536,7 +561,7 @@ static int addr_resolve_neigh(struct ifnet *dev, /* If the device doesn't do ARP internally */ if (!(dev->if_flags & IFF_NOARP)) - return 0; + return rdma_copy_addr(addr, dev, edst); return rdma_copy_addr(addr, dev, NULL); } @@ -547,6 +572,7 @@ static int addr_resolve(struct sockaddr *src_in, bool resolve_neigh) { struct net_device *ndev = NULL; + u8 edst[MAX_ADDR_LEN]; int ret; if (dst_in->sa_family != src_in->sa_family) @@ -555,21 +581,21 @@ static int addr_resolve(struct sockaddr *src_in, if (src_in->sa_family == AF_INET) { ret = addr4_resolve((struct sockaddr_in *)src_in, (const struct sockaddr_in *)dst_in, - addr, &ndev); + addr, edst, &ndev); if (ret) return ret; if (resolve_neigh) - ret = addr_resolve_neigh(ndev, dst_in, addr); + ret = addr_resolve_neigh(ndev, dst_in, edst, addr); } else { ret = addr6_resolve((struct sockaddr_in6 *)src_in, (const struct sockaddr_in6 *)dst_in, addr, - &ndev); + edst, &ndev); if (ret) return ret; if (resolve_neigh) - ret = addr_resolve_neigh(ndev, dst_in, addr); + ret = addr_resolve_neigh(ndev, dst_in, edst, addr); } addr->bound_dev_if = ndev->if_index; From owner-svn-src-head@freebsd.org Mon Mar 5 14: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 13D58F330B0; Mon, 5 Mar 2018 14:22: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 B05127BCB7; Mon, 5 Mar 2018 14:22: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 AB39324FAB; Mon, 5 Mar 2018 14:22: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 w25EMafM099062; Mon, 5 Mar 2018 14:22:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25EMah5099061; Mon, 5 Mar 2018 14:22:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051422.w25EMah5099061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 14:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330506 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330506 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:22:37 -0000 Author: hselasky Date: Mon Mar 5 14:22:36 2018 New Revision: 330506 URL: https://svnweb.freebsd.org/changeset/base/330506 Log: Pass valid if_index to rdma_addr_find_l2_eth_by_grh() in ibcore when possible. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_verbs.c Mon Mar 5 13:58:03 2018 (r330505) +++ head/sys/ofed/drivers/infiniband/core/ib_verbs.c Mon Mar 5 14:22:36 2018 (r330506) @@ -483,7 +483,7 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 po return ret; if (rdma_protocol_roce(device, port_num)) { - int if_index = 0; + int if_index; u16 vlan_id = wc->wc_flags & IB_WC_WITH_VLAN ? wc->vlan_id : 0xffff; struct net_device *idev; @@ -498,6 +498,12 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 po idev = device->get_netdev(device, port_num); if (!idev) return -ENODEV; + + /* + * Get network interface index early on. This is + * useful for IPv6 link local addresses: + */ + if_index = idev->if_index; ret = rdma_addr_find_l2_eth_by_grh(&dgid, &sgid, ah_attr->dmac, From owner-svn-src-head@freebsd.org Mon Mar 5 14:24: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 A3EF9F33228; Mon, 5 Mar 2018 14:24:31 +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 521917BE48; Mon, 5 Mar 2018 14:24:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47E6C24FAC; Mon, 5 Mar 2018 14:24:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w25EOVAu099175; Mon, 5 Mar 2018 14:24:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25EOUPC099171; Mon, 5 Mar 2018 14:24:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051424.w25EOUPC099171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 14:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330507 - in head/sys/ofed: drivers/infiniband/core include/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/ofed: drivers/infiniband/core include/rdma X-SVN-Commit-Revision: 330507 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:24:32 -0000 Author: hselasky Date: Mon Mar 5 14:24:30 2018 New Revision: 330507 URL: https://svnweb.freebsd.org/changeset/base/330507 Log: Get correct network device when accepting incoming RDMA connections in ibcore. This patch ensures the GID index is always used as a basis of resolving incoming RDMA connections, as compared to the GID value itself. Background: On a per infiniband port basis, the GID identifier is not a unique identifier! This assumption falls apart when VLAN ID, IPv6 scope ID and RoCE type, as supported by RoCE v2, is taken into account. This additional information is stored in the so-called GID attributes and is needed to correctly identify the destination network interface for an incoming connection. Different VLANs are allowed to define the same IPv4 addresses and especially for the default IPv6 link-local addresses or when using so-called containers or jails, this is true. The VNET information for the destination network interface is needed in order to perform the L2 address lookup in the right Virtual Network Stack context. Consequently old functions previously used by RoCE v1, like rdma_addr_find_smac_by_sgid() are impossible to support, because there can be multiple identical GIDs associated with the same infiniband port, and the answer to such a request becomes undefined. This function has been removed. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c head/sys/ofed/drivers/infiniband/core/ib_cma.c head/sys/ofed/drivers/infiniband/core/ib_verbs.c head/sys/ofed/include/rdma/ib_addr.h Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_addr.c Mon Mar 5 14:22:36 2018 (r330506) +++ head/sys/ofed/drivers/infiniband/core/ib_addr.c Mon Mar 5 14:24:30 2018 (r330507) @@ -151,8 +151,7 @@ int rdma_copy_addr(struct rdma_dev_addr *dev_addr, str EXPORT_SYMBOL(rdma_copy_addr); int rdma_translate_ip(const struct sockaddr *addr, - struct rdma_dev_addr *dev_addr, - u16 *vlan_id) + struct rdma_dev_addr *dev_addr) { struct net_device *dev = NULL; int ret = -EADDRNOTAVAIL; @@ -185,8 +184,6 @@ int rdma_translate_ip(const struct sockaddr *addr, if (dev != NULL) { ret = rdma_copy_addr(dev_addr, dev, NULL); - if (vlan_id) - *vlan_id = rdma_vlan_dev_vlan_id(dev); dev_put(dev); } return ret; @@ -305,6 +302,8 @@ static int addr4_resolve(struct sockaddr_in *src_in, if (rte->rt_ifp->if_flags & IFF_LOOPBACK) { ifp = rte->rt_ifp; dev_hold(ifp); + } else if (addr->bound_dev_if != 0) { + ifp = dev_get_by_index(addr->net, addr->bound_dev_if); } else { ifp = ip_dev_find(addr->net, src_in->sin_addr.s_addr); } @@ -460,6 +459,8 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, if (rte->rt_ifp->if_flags & IFF_LOOPBACK) { ifp = rte->rt_ifp; dev_hold(ifp); + } else if (addr->bound_dev_if != 0) { + ifp = dev_get_by_index(addr->net, addr->bound_dev_if); } else { ifp = ip6_dev_find(addr->net, src_in->sin6_addr); } @@ -551,7 +552,7 @@ static int addr_resolve_neigh(struct ifnet *dev, if (dev->if_flags & IFF_LOOPBACK) { int ret; - ret = rdma_translate_ip(dst_in, addr, NULL); + ret = rdma_translate_ip(dst_in, addr); if (!ret) memcpy(addr->dst_dev_addr, addr->src_dev_addr, MAX_ADDR_LEN); @@ -757,13 +758,12 @@ static void resolve_cb(int status, struct sockaddr *sr int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid, const union ib_gid *dgid, - u8 *dmac, u16 *vlan_id, int *if_index, + u8 *dmac, struct net_device *dev, int *hoplimit) { int ret = 0; struct rdma_dev_addr dev_addr; struct resolve_cb_context ctx; - struct net_device *dev; union { struct sockaddr _sockaddr; @@ -771,15 +771,14 @@ int rdma_addr_find_l2_eth_by_grh(const union ib_gid *s struct sockaddr_in6 _sockaddr_in6; } sgid_addr, dgid_addr; - rdma_gid2ip(&sgid_addr._sockaddr, sgid); rdma_gid2ip(&dgid_addr._sockaddr, dgid); memset(&dev_addr, 0, sizeof(dev_addr)); - if (if_index) - dev_addr.bound_dev_if = *if_index; - dev_addr.net = TD_TO_VNET(curthread); + dev_addr.bound_dev_if = dev->if_index; + dev_addr.net = dev_net(dev); + ctx.addr = &dev_addr; init_completion(&ctx.comp); ret = rdma_resolve_ip(&self, &sgid_addr._sockaddr, &dgid_addr._sockaddr, @@ -794,42 +793,11 @@ int rdma_addr_find_l2_eth_by_grh(const union ib_gid *s return ret; memcpy(dmac, dev_addr.dst_dev_addr, ETH_ALEN); - dev = dev_get_by_index(dev_addr.net, dev_addr.bound_dev_if); - if (!dev) - return -ENODEV; - if (if_index) - *if_index = dev_addr.bound_dev_if; - if (vlan_id) - *vlan_id = rdma_vlan_dev_vlan_id(dev); if (hoplimit) *hoplimit = dev_addr.hoplimit; - dev_put(dev); return ret; } EXPORT_SYMBOL(rdma_addr_find_l2_eth_by_grh); - -int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id) -{ - int ret = 0; - struct rdma_dev_addr dev_addr; - union { - struct sockaddr _sockaddr; - struct sockaddr_in _sockaddr_in; - struct sockaddr_in6 _sockaddr_in6; - } gid_addr; - - rdma_gid2ip(&gid_addr._sockaddr, sgid); - - memset(&dev_addr, 0, sizeof(dev_addr)); - dev_addr.net = TD_TO_VNET(curthread); - ret = rdma_translate_ip(&gid_addr._sockaddr, &dev_addr, vlan_id); - if (ret) - return ret; - - memcpy(smac, dev_addr.src_dev_addr, ETH_ALEN); - return ret; -} -EXPORT_SYMBOL(rdma_addr_find_smac_by_sgid); int addr_init(void) { Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 14:22:36 2018 (r330506) +++ head/sys/ofed/drivers/infiniband/core/ib_cma.c Mon Mar 5 14:24:30 2018 (r330507) @@ -533,7 +533,7 @@ static int cma_translate_addr(struct sockaddr *addr, s int ret; if (addr->sa_family != AF_IB) { - ret = rdma_translate_ip(addr, dev_addr, NULL); + ret = rdma_translate_ip(addr, dev_addr); } else { cma_translate_ib((struct sockaddr_ib *) addr, dev_addr); ret = 0; @@ -2094,7 +2094,7 @@ static int iw_conn_req_handler(struct iw_cm_id *cm_id, mutex_lock_nested(&conn_id->handler_mutex, SINGLE_DEPTH_NESTING); conn_id->state = RDMA_CM_CONNECT; - ret = rdma_translate_ip(laddr, &conn_id->id.route.addr.dev_addr, NULL); + ret = rdma_translate_ip(laddr, &conn_id->id.route.addr.dev_addr); if (ret) { mutex_unlock(&conn_id->handler_mutex); rdma_destroy_id(new_cm_id); Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_verbs.c Mon Mar 5 14:22:36 2018 (r330506) +++ head/sys/ofed/drivers/infiniband/core/ib_verbs.c Mon Mar 5 14:24:30 2018 (r330507) @@ -483,56 +483,29 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 po return ret; if (rdma_protocol_roce(device, port_num)) { - int if_index; - u16 vlan_id = wc->wc_flags & IB_WC_WITH_VLAN ? + struct ib_gid_attr dgid_attr; + const u16 vlan_id = wc->wc_flags & IB_WC_WITH_VLAN ? wc->vlan_id : 0xffff; - struct net_device *idev; - struct net_device *resolved_dev; if (!(wc->wc_flags & IB_WC_GRH)) return -EPROTOTYPE; - if (!device->get_netdev) - return -EOPNOTSUPP; - - idev = device->get_netdev(device, port_num); - if (!idev) - return -ENODEV; - - /* - * Get network interface index early on. This is - * useful for IPv6 link local addresses: - */ - if_index = idev->if_index; - - ret = rdma_addr_find_l2_eth_by_grh(&dgid, &sgid, - ah_attr->dmac, - wc->wc_flags & IB_WC_WITH_VLAN ? - NULL : &vlan_id, - &if_index, &hoplimit); - if (ret) { - dev_put(idev); + ret = get_sgid_index_from_eth(device, port_num, vlan_id, + &dgid, gid_type, &gid_index); + if (ret) return ret; - } - resolved_dev = dev_get_by_index(&init_net, if_index); - if (resolved_dev->if_flags & IFF_LOOPBACK) { - dev_put(resolved_dev); - resolved_dev = idev; - dev_hold(resolved_dev); - } - rcu_read_lock(); - if (resolved_dev != idev && !rdma_is_upper_dev_rcu(idev, - resolved_dev)) - ret = -EHOSTUNREACH; - rcu_read_unlock(); - dev_put(idev); - dev_put(resolved_dev); + ret = ib_get_cached_gid(device, port_num, gid_index, &dgid, &dgid_attr); if (ret) return ret; - ret = get_sgid_index_from_eth(device, port_num, vlan_id, - &dgid, gid_type, &gid_index); + if (dgid_attr.ndev == NULL) + return -ENODEV; + + ret = rdma_addr_find_l2_eth_by_grh(&dgid, &sgid, ah_attr->dmac, + dgid_attr.ndev, &hoplimit); + + dev_put(dgid_attr.ndev); if (ret) return ret; } @@ -1207,7 +1180,6 @@ int ib_resolve_eth_dmac(struct ib_qp *qp, } else { union ib_gid sgid; struct ib_gid_attr sgid_attr; - int ifindex; int hop_limit; ret = ib_query_gid(qp->device, @@ -1221,12 +1193,10 @@ int ib_resolve_eth_dmac(struct ib_qp *qp, goto out; } - ifindex = sgid_attr.ndev->if_index; - ret = rdma_addr_find_l2_eth_by_grh(&sgid, &qp_attr->ah_attr.grh.dgid, qp_attr->ah_attr.dmac, - NULL, &ifindex, &hop_limit); + sgid_attr.ndev, &hop_limit); dev_put(sgid_attr.ndev); Modified: head/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- head/sys/ofed/include/rdma/ib_addr.h Mon Mar 5 14:22:36 2018 (r330506) +++ head/sys/ofed/include/rdma/ib_addr.h Mon Mar 5 14:24:30 2018 (r330507) @@ -95,10 +95,10 @@ struct rdma_dev_addr { * rdma_translate_ip - Translate a local IP address to an RDMA hardware * address. * - * The dev_addr->net field must be initialized. + * The dev_addr->net and dev_addr->bound_dev_if fields must be initialized. */ int rdma_translate_ip(const struct sockaddr *addr, - struct rdma_dev_addr *dev_addr, u16 *vlan_id); + struct rdma_dev_addr *dev_addr); /** * rdma_resolve_ip - Resolve source and destination IP addresses to @@ -134,10 +134,9 @@ int rdma_copy_addr(struct rdma_dev_addr *dev_addr, str int rdma_addr_size(struct sockaddr *addr); -int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id); int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid, const union ib_gid *dgid, - u8 *smac, u16 *vlan_id, int *if_index, + u8 *smac, struct net_device *dev, int *hoplimit); static inline u16 ib_addr_get_pkey(struct rdma_dev_addr *dev_addr) From owner-svn-src-head@freebsd.org Mon Mar 5 14:34: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 699E1F33DEE; Mon, 5 Mar 2018 14:34:54 +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 12C6F7C556; Mon, 5 Mar 2018 14:34:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0994225136; Mon, 5 Mar 2018 14:34:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w25EYr26004405; Mon, 5 Mar 2018 14:34:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25EYqRb004391; Mon, 5 Mar 2018 14:34:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803051434.w25EYqRb004391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 5 Mar 2018 14:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330508 - in head/sys: dev/cxgbe/iw_cxgbe dev/mlx4/mlx4_ib dev/mlx5/mlx5_ib dev/mthca ofed/drivers/infiniband/core ofed/include/rdma ofed/include/uapi/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: dev/cxgbe/iw_cxgbe dev/mlx4/mlx4_ib dev/mlx5/mlx5_ib dev/mthca ofed/drivers/infiniband/core ofed/include/rdma ofed/include/uapi/rdma X-SVN-Commit-Revision: 330508 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:34:54 -0000 Author: hselasky Date: Mon Mar 5 14:34:52 2018 New Revision: 330508 URL: https://svnweb.freebsd.org/changeset/base/330508 Log: Optimize ibcore RoCE address handle creation from user-space. Creating a UD address handle from user-space or from the kernel-space, when the link layer is ethernet, requires resolving the remote L3 address into a L2 address. Doing this from the kernel is easy because the required ARP(IPv4) and ND6(IPv6) address resolving APIs are readily available. In userspace such an interface does not exist and kernel help is required. It should be noted that in an IP-based GID environment, the GID itself does not contain all the information needed to resolve the destination IP address. For example information like VLAN ID and SCOPE ID, is not part of the GID and must be fetched from the GID attributes. Therefore a source GID should always be referred to as a GID index. Instead of going through various racy steps to obtain information about the GID attributes from user-space, this is now all done by the kernel. This patch optimises the L3 to L2 address resolving using the existing create address handle uverbs interface, retrieving back the L2 address as an additional user-space information structure. This commit combines the following Linux upstream commits: IB/core: Let create_ah return extended response to user IB/core: Change ib_resolve_eth_dmac to use it in create AH IB/mlx5: Make create/destroy_ah available to userspace IB/mlx5: Use kernel driver to help userspace create ah IB/mlx5: Report that device has udata response in create_ah MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h head/sys/dev/mlx4/mlx4_ib/mlx4_ib_ah.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h head/sys/dev/mlx5/mlx5_ib/mlx5_ib_ah.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c head/sys/dev/mthca/mthca_provider.c head/sys/ofed/drivers/infiniband/core/core_priv.h head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c head/sys/ofed/drivers/infiniband/core/ib_verbs.c head/sys/ofed/include/rdma/ib_verbs.h head/sys/ofed/include/uapi/rdma/mlx5-abi.h Modified: head/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- head/sys/dev/cxgbe/iw_cxgbe/provider.c Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/dev/cxgbe/iw_cxgbe/provider.c Mon Mar 5 14:34:52 2018 (r330508) @@ -59,7 +59,8 @@ static int c4iw_modify_port(struct ib_device *ibdev, } static struct ib_ah *c4iw_ah_create(struct ib_pd *pd, - struct ib_ah_attr *ah_attr) + struct ib_ah_attr *ah_attr, + struct ib_udata *udata) { return ERR_PTR(-ENOSYS); } Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h Mon Mar 5 14:34:52 2018 (r330508) @@ -747,7 +747,8 @@ int mlx4_ib_arm_cq(struct ib_cq *cq, enum ib_cq_notify void __mlx4_ib_cq_clean(struct mlx4_ib_cq *cq, u32 qpn, struct mlx4_ib_srq *srq); void mlx4_ib_cq_clean(struct mlx4_ib_cq *cq, u32 qpn, struct mlx4_ib_srq *srq); -struct ib_ah *mlx4_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr); +struct ib_ah *mlx4_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr, + struct ib_udata *udata); int mlx4_ib_query_ah(struct ib_ah *ibah, struct ib_ah_attr *ah_attr); int mlx4_ib_destroy_ah(struct ib_ah *ah); Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_ah.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_ah.c Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_ah.c Mon Mar 5 14:34:52 2018 (r330508) @@ -129,7 +129,9 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, return &ah->ibah; } -struct ib_ah *mlx4_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr) +struct ib_ah *mlx4_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr, + struct ib_udata *udata) + { struct mlx4_ib_ah *ah; struct ib_ah *ret; Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Mon Mar 5 14:34:52 2018 (r330508) @@ -734,7 +734,8 @@ void mlx5_ib_free_srq_wqe(struct mlx5_ib_srq *srq, int int mlx5_MAD_IFC(struct mlx5_ib_dev *dev, int ignore_mkey, int ignore_bkey, u8 port, const struct ib_wc *in_wc, const struct ib_grh *in_grh, const void *in_mad, void *response_mad); -struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr); +struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr, + struct ib_udata *udata); int mlx5_ib_query_ah(struct ib_ah *ibah, struct ib_ah_attr *ah_attr); int mlx5_ib_destroy_ah(struct ib_ah *ah); struct ib_srq *mlx5_ib_create_srq(struct ib_pd *pd, Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_ah.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_ah.c Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_ah.c Mon Mar 5 14:34:52 2018 (r330508) @@ -59,7 +59,9 @@ static struct ib_ah *create_ib_ah(struct mlx5_ib_dev * return &ah->ibah; } -struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr) +struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr, + struct ib_udata *udata) + { struct mlx5_ib_ah *ah; struct mlx5_ib_dev *dev = to_mdev(pd->device); @@ -69,6 +71,27 @@ struct ib_ah *mlx5_ib_create_ah(struct ib_pd *pd, stru if (ll == IB_LINK_LAYER_ETHERNET && !(ah_attr->ah_flags & IB_AH_GRH)) return ERR_PTR(-EINVAL); + + if (ll == IB_LINK_LAYER_ETHERNET && udata) { + int err; + struct mlx5_ib_create_ah_resp resp = {}; + u32 min_resp_len = offsetof(typeof(resp), dmac) + + sizeof(resp.dmac); + + if (udata->outlen < min_resp_len) + return ERR_PTR(-EINVAL); + + resp.response_length = min_resp_len; + + err = ib_resolve_eth_dmac(pd->device, ah_attr); + if (err) + return ERR_PTR(err); + + memcpy(resp.dmac, ah_attr->dmac, ETH_ALEN); + err = ib_copy_to_udata(udata, &resp, resp.response_length); + if (err) + return ERR_PTR(err); + } ah = kzalloc(sizeof(*ah), GFP_ATOMIC); if (!ah) Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Mon Mar 5 14:34:52 2018 (r330508) @@ -1080,7 +1080,8 @@ static struct ib_ucontext *mlx5_ib_alloc_ucontext(stru resp.response_length += sizeof(resp.cqe_version); if (field_avail(typeof(resp), cmds_supp_uhw, udata->outlen)) { - resp.cmds_supp_uhw |= MLX5_USER_CMDS_SUPP_UHW_QUERY_DEVICE; + resp.cmds_supp_uhw |= MLX5_USER_CMDS_SUPP_UHW_QUERY_DEVICE | + MLX5_USER_CMDS_SUPP_UHW_CREATE_AH; resp.response_length += sizeof(resp.cmds_supp_uhw); } @@ -2974,6 +2975,8 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) (1ull << IB_USER_VERBS_CMD_QUERY_PORT) | (1ull << IB_USER_VERBS_CMD_ALLOC_PD) | (1ull << IB_USER_VERBS_CMD_DEALLOC_PD) | + (1ull << IB_USER_VERBS_CMD_CREATE_AH) | + (1ull << IB_USER_VERBS_CMD_DESTROY_AH) | (1ull << IB_USER_VERBS_CMD_REG_MR) | (1ull << IB_USER_VERBS_CMD_REREG_MR) | (1ull << IB_USER_VERBS_CMD_DEREG_MR) | Modified: head/sys/dev/mthca/mthca_provider.c ============================================================================== --- head/sys/dev/mthca/mthca_provider.c Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/dev/mthca/mthca_provider.c Mon Mar 5 14:34:52 2018 (r330508) @@ -409,7 +409,8 @@ static int mthca_dealloc_pd(struct ib_pd *pd) } static struct ib_ah *mthca_ah_create(struct ib_pd *pd, - struct ib_ah_attr *ah_attr) + struct ib_ah_attr *ah_attr, + struct ib_udata *udata) { int err; struct mthca_ah *ah; Modified: head/sys/ofed/drivers/infiniband/core/core_priv.h ============================================================================== --- head/sys/ofed/drivers/infiniband/core/core_priv.h Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/ofed/drivers/infiniband/core/core_priv.h Mon Mar 5 14:34:52 2018 (r330508) @@ -78,9 +78,6 @@ void ib_device_unregister_sysfs(struct ib_device *devi void ib_cache_setup(void); void ib_cache_cleanup(void); -int ib_resolve_eth_dmac(struct ib_qp *qp, - struct ib_qp_attr *qp_attr, int *qp_attr_mask); - typedef void (*roce_netdev_callback)(struct ib_device *device, u8 port, struct net_device *idev, void *cookie); Modified: head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c Mon Mar 5 14:34:52 2018 (r330508) @@ -2409,9 +2409,11 @@ ssize_t ib_uverbs_modify_qp(struct ib_uverbs_file *fil attr->alt_ah_attr.port_num = cmd.alt_dest.port_num; if (qp->real_qp == qp) { - ret = ib_resolve_eth_dmac(qp, attr, &cmd.attr_mask); - if (ret) - goto release_qp; + if (cmd.attr_mask & IB_QP_AV) { + ret = ib_resolve_eth_dmac(qp->device, &attr->ah_attr); + if (ret) + goto release_qp; + } ret = qp->device->modify_qp(qp, attr, modify_qp_mask(qp->qp_type, cmd.attr_mask), &udata); } else { @@ -2882,6 +2884,7 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *fil struct ib_ah *ah; struct ib_ah_attr attr; int ret; + struct ib_udata udata; if (out_len < sizeof resp) return -ENOSPC; @@ -2889,6 +2892,10 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *fil if (copy_from_user(&cmd, buf, sizeof cmd)) return -EFAULT; + INIT_UDATA(&udata, buf + sizeof(cmd), + (unsigned long)cmd.response + sizeof(resp), + in_len - sizeof(cmd), out_len - sizeof(resp)); + uobj = kmalloc(sizeof *uobj, GFP_KERNEL); if (!uobj) return -ENOMEM; @@ -2915,12 +2922,16 @@ ssize_t ib_uverbs_create_ah(struct ib_uverbs_file *fil memset(&attr.dmac, 0, sizeof(attr.dmac)); memcpy(attr.grh.dgid.raw, cmd.attr.grh.dgid, 16); - ah = ib_create_ah(pd, &attr); + ah = pd->device->create_ah(pd, &attr, &udata); + if (IS_ERR(ah)) { ret = PTR_ERR(ah); goto err_put; } + ah->device = pd->device; + ah->pd = pd; + atomic_inc(&pd->usecnt); ah->uobject = uobj; uobj->object = ah; Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_verbs.c Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/ofed/drivers/infiniband/core/ib_verbs.c Mon Mar 5 14:34:52 2018 (r330508) @@ -321,7 +321,7 @@ struct ib_ah *ib_create_ah(struct ib_pd *pd, struct ib { struct ib_ah *ah; - ah = pd->device->create_ah(pd, ah_attr); + ah = pd->device->create_ah(pd, ah_attr, NULL); if (!IS_ERR(ah)) { ah->device = pd->device; @@ -1161,47 +1161,45 @@ int ib_modify_qp_is_ok(enum ib_qp_state cur_state, enu } EXPORT_SYMBOL(ib_modify_qp_is_ok); -int ib_resolve_eth_dmac(struct ib_qp *qp, - struct ib_qp_attr *qp_attr, int *qp_attr_mask) +int ib_resolve_eth_dmac(struct ib_device *device, + struct ib_ah_attr *ah_attr) { int ret = 0; - if (*qp_attr_mask & IB_QP_AV) { - if (qp_attr->ah_attr.port_num < rdma_start_port(qp->device) || - qp_attr->ah_attr.port_num > rdma_end_port(qp->device)) - return -EINVAL; + if (ah_attr->port_num < rdma_start_port(device) || + ah_attr->port_num > rdma_end_port(device)) + return -EINVAL; - if (!rdma_cap_eth_ah(qp->device, qp_attr->ah_attr.port_num)) - return 0; + if (!rdma_cap_eth_ah(device, ah_attr->port_num)) + return 0; - if (rdma_link_local_addr((struct in6_addr *)qp_attr->ah_attr.grh.dgid.raw)) { - rdma_get_ll_mac((struct in6_addr *)qp_attr->ah_attr.grh.dgid.raw, - qp_attr->ah_attr.dmac); - } else { - union ib_gid sgid; - struct ib_gid_attr sgid_attr; - int hop_limit; + if (rdma_link_local_addr((struct in6_addr *)ah_attr->grh.dgid.raw)) { + rdma_get_ll_mac((struct in6_addr *)ah_attr->grh.dgid.raw, + ah_attr->dmac); + } else { + union ib_gid sgid; + struct ib_gid_attr sgid_attr; + int hop_limit; - ret = ib_query_gid(qp->device, - qp_attr->ah_attr.port_num, - qp_attr->ah_attr.grh.sgid_index, - &sgid, &sgid_attr); + ret = ib_query_gid(device, + ah_attr->port_num, + ah_attr->grh.sgid_index, + &sgid, &sgid_attr); - if (ret || !sgid_attr.ndev) { - if (!ret) - ret = -ENXIO; - goto out; - } + if (ret || !sgid_attr.ndev) { + if (!ret) + ret = -ENXIO; + goto out; + } - ret = rdma_addr_find_l2_eth_by_grh(&sgid, - &qp_attr->ah_attr.grh.dgid, - qp_attr->ah_attr.dmac, - sgid_attr.ndev, &hop_limit); + ret = rdma_addr_find_l2_eth_by_grh(&sgid, + &ah_attr->grh.dgid, + ah_attr->dmac, + sgid_attr.ndev, &hop_limit); - dev_put(sgid_attr.ndev); + dev_put(sgid_attr.ndev); - qp_attr->ah_attr.grh.hop_limit = hop_limit; - } + ah_attr->grh.hop_limit = hop_limit; } out: return ret; @@ -1213,11 +1211,13 @@ int ib_modify_qp(struct ib_qp *qp, struct ib_qp_attr *qp_attr, int qp_attr_mask) { - int ret; + if (qp_attr_mask & IB_QP_AV) { + int ret; - ret = ib_resolve_eth_dmac(qp, qp_attr, &qp_attr_mask); - if (ret) - return ret; + ret = ib_resolve_eth_dmac(qp->device, &qp_attr->ah_attr); + if (ret) + return ret; + } return qp->device->modify_qp(qp->real_qp, qp_attr, qp_attr_mask, NULL); } Modified: head/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- head/sys/ofed/include/rdma/ib_verbs.h Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/ofed/include/rdma/ib_verbs.h Mon Mar 5 14:34:52 2018 (r330508) @@ -1937,7 +1937,8 @@ struct ib_device { struct ib_udata *udata); int (*dealloc_pd)(struct ib_pd *pd); struct ib_ah * (*create_ah)(struct ib_pd *pd, - struct ib_ah_attr *ah_attr); + struct ib_ah_attr *ah_attr, + struct ib_udata *udata); int (*modify_ah)(struct ib_ah *ah, struct ib_ah_attr *ah_attr); int (*query_ah)(struct ib_ah *ah, @@ -3360,4 +3361,7 @@ int ib_sg_to_pages(struct ib_mr *mr, struct scatterlis void ib_drain_rq(struct ib_qp *qp); void ib_drain_sq(struct ib_qp *qp); void ib_drain_qp(struct ib_qp *qp); + +int ib_resolve_eth_dmac(struct ib_device *device, + struct ib_ah_attr *ah_attr); #endif /* IB_VERBS_H */ Modified: head/sys/ofed/include/uapi/rdma/mlx5-abi.h ============================================================================== --- head/sys/ofed/include/uapi/rdma/mlx5-abi.h Mon Mar 5 14:24:30 2018 (r330507) +++ head/sys/ofed/include/uapi/rdma/mlx5-abi.h Mon Mar 5 14:34:52 2018 (r330508) @@ -90,6 +90,7 @@ enum mlx5_ib_alloc_ucontext_resp_mask { enum mlx5_user_cmds_supp_uhw { MLX5_USER_CMDS_SUPP_UHW_QUERY_DEVICE = 1 << 0, + MLX5_USER_CMDS_SUPP_UHW_CREATE_AH = 1 << 1, }; struct mlx5_ib_alloc_ucontext_resp { @@ -238,6 +239,12 @@ struct mlx5_ib_create_wq { __u32 flags; __u32 comp_mask; __u32 reserved; +}; + +struct mlx5_ib_create_ah_resp { + __u32 response_length; + __u8 dmac[ETH_ALEN]; + __u8 reserved[6]; }; struct mlx5_ib_create_wq_resp { From owner-svn-src-head@freebsd.org Mon Mar 5 15:10: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 49741F3689D; Mon, 5 Mar 2018 15:10:18 +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 ECF197DB21; Mon, 5 Mar 2018 15:10:17 +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 E631E2562B; Mon, 5 Mar 2018 15:10:17 +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 w25FAHvl019370; Mon, 5 Mar 2018 15:10:17 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25FAHVl019369; Mon, 5 Mar 2018 15:10:17 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201803051510.w25FAHVl019369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 5 Mar 2018 15:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330510 - 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: 330510 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:10:18 -0000 Author: jtl Date: Mon Mar 5 15:10:17 2018 New Revision: 330510 URL: https://svnweb.freebsd.org/changeset/base/330510 Log: Prior to r329071, pmap_bootstrap() used pmap_kmem_choose() to round the first available virtual address to a 2MB boundary. After r329071, create_pagetables() rounds firstaddr up to a 2MB boundary. This ensures the kernel is mapped in super-pages, which is the point of the logic in pmap_kmem_choose(). Therefore, it is no longer necessary for pmap_bootstrap() to round up to the 2MB boundary again. As pmap_bootstrap() was the only user of pmap_kmem_choose(), we can delete pmap_kmem_choose(). Reviewed by: kib MFC after: 2 weeks X-MFC-with: r329071 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14355 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Mar 5 14:54:01 2018 (r330509) +++ head/sys/amd64/amd64/pmap.c Mon Mar 5 15:10:17 2018 (r330510) @@ -687,23 +687,7 @@ static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_ static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); static int pmap_unuse_pt(pmap_t, vm_offset_t, pd_entry_t, struct spglist *); -static vm_offset_t pmap_kmem_choose(vm_offset_t addr); -/* - * Move the kernel virtual free pointer to the next - * 2MB. This is used to help improve performance - * by using a large (2MB) page for much of the kernel - * (.text, .data, .bss) - */ -static vm_offset_t -pmap_kmem_choose(vm_offset_t addr) -{ - vm_offset_t newaddr = addr; - - newaddr = roundup2(addr, NBPDR); - return (newaddr); -} - /********************/ /* Inline functions */ /********************/ @@ -1049,7 +1033,6 @@ pmap_bootstrap(vm_paddr_t *firstaddr) vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); virtual_avail = (vm_offset_t) KERNBASE + *firstaddr; - virtual_avail = pmap_kmem_choose(virtual_avail); virtual_end = VM_MAX_KERNEL_ADDRESS; From owner-svn-src-head@freebsd.org Mon Mar 5 15:12: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 039DFF36D12; Mon, 5 Mar 2018 15:12:36 +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 A91D17E036; Mon, 5 Mar 2018 15:12:35 +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 A3ABB257B6; Mon, 5 Mar 2018 15:12:35 +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 w25FCZb4024348; Mon, 5 Mar 2018 15:12:35 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25FCZEW024347; Mon, 5 Mar 2018 15:12:35 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201803051512.w25FCZEW024347@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Mon, 5 Mar 2018 15:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330511 - 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: 330511 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:12:36 -0000 Author: jtl Date: Mon Mar 5 15:12:35 2018 New Revision: 330511 URL: https://svnweb.freebsd.org/changeset/base/330511 Log: We shouldn't need to execute code in the recursive page table mappings; therefore, it should be safe to set the NX bit on the PML4E for the recursive page table mappings. According to the Intel docs, the effect of the NX bit should propogate to any page reached through a PML4E which has the NX bit set. Reviewed by: kib, markj MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14333 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Mon Mar 5 15:10:17 2018 (r330510) +++ head/sys/amd64/amd64/pmap.c Mon Mar 5 15:12:35 2018 (r330511) @@ -983,7 +983,7 @@ create_pagetables(vm_paddr_t *firstaddr) /* And recursively map PML4 to itself in order to get PTmap */ p4_p = (pml4_entry_t *)KPML4phys; p4_p[PML4PML4I] = KPML4phys; - p4_p[PML4PML4I] |= X86_PG_RW | X86_PG_V | PG_U; + p4_p[PML4PML4I] |= X86_PG_RW | X86_PG_V | PG_U | pg_nx; /* Connect the Direct Map slot(s) up to the PML4. */ for (i = 0; i < ndmpdpphys; i++) { From owner-svn-src-head@freebsd.org Mon Mar 5 16:11: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 2C630F3B92D; Mon, 5 Mar 2018 16:11:08 +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 CF768805D6; Mon, 5 Mar 2018 16:11:07 +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 CA862260F9; Mon, 5 Mar 2018 16:11:07 +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 w25GB7I9052109; Mon, 5 Mar 2018 16:11:07 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25GB72e052107; Mon, 5 Mar 2018 16:11:07 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803051611.w25GB72e052107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 5 Mar 2018 16:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330514 - head/libexec/rpc.sprayd X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/libexec/rpc.sprayd X-SVN-Commit-Revision: 330514 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 16:11:08 -0000 Author: asomers Date: Mon Mar 5 16:11:07 2018 New Revision: 330514 URL: https://svnweb.freebsd.org/changeset/base/330514 Log: rpc.sprayd: raise WARNS to 6 MFC after: 3 weeks Modified: head/libexec/rpc.sprayd/Makefile head/libexec/rpc.sprayd/sprayd.c Modified: head/libexec/rpc.sprayd/Makefile ============================================================================== --- head/libexec/rpc.sprayd/Makefile Mon Mar 5 16:07:55 2018 (r330513) +++ head/libexec/rpc.sprayd/Makefile Mon Mar 5 16:11:07 2018 (r330514) @@ -6,6 +6,4 @@ MAN = rpc.sprayd.8 LIBADD= rpcsvc -WARNS?= 2 - .include Modified: head/libexec/rpc.sprayd/sprayd.c ============================================================================== --- head/libexec/rpc.sprayd/sprayd.c Mon Mar 5 16:07:55 2018 (r330513) +++ head/libexec/rpc.sprayd/sprayd.c Mon Mar 5 16:11:07 2018 (r330514) @@ -58,21 +58,21 @@ static int from_inetd = 1; #define TIMEOUT 120 -void +static void cleanup(int sig __unused) { (void)rpcb_unset(SPRAYPROG, SPRAYVERS, NULL); exit(0); } -void +static void die(int sig __unused) { exit(0); } int -main(int argc, char *argv[]) +main(int argc __unused, char *argv[] __unused) { SVCXPRT *transp; int ok; From owner-svn-src-head@freebsd.org Mon Mar 5 16:13: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 85962F3BBF3; Mon, 5 Mar 2018 16:13:30 +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 292388089C; Mon, 5 Mar 2018 16:13:30 +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 2155626167; Mon, 5 Mar 2018 16:13:30 +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 w25GDT2k053815; Mon, 5 Mar 2018 16:13:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25GDTel053814; Mon, 5 Mar 2018 16:13:29 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803051613.w25GDTel053814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 5 Mar 2018 16:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330515 - head/usr.sbin/spray X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/usr.sbin/spray X-SVN-Commit-Revision: 330515 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 16:13:30 -0000 Author: asomers Date: Mon Mar 5 16:13:29 2018 New Revision: 330515 URL: https://svnweb.freebsd.org/changeset/base/330515 Log: spray: fix the spelling in an output string MFC after: 3 weeks Modified: head/usr.sbin/spray/spray.c Modified: head/usr.sbin/spray/spray.c ============================================================================== --- head/usr.sbin/spray/spray.c Mon Mar 5 16:11:07 2018 (r330514) +++ head/usr.sbin/spray/spray.c Mon Mar 5 16:13:29 2018 (r330515) @@ -145,7 +145,7 @@ main(int argc, char *argv[]) /* Spray server with packets */ - printf ("sending %u packets of lnth %d to %s ...", count, length, + printf ("sending %u packets of length %d to %s ...", count, length, *argv); fflush (stdout); From owner-svn-src-head@freebsd.org Mon Mar 5 16:14: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 84891F3BCB3; Mon, 5 Mar 2018 16:14:05 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE96809D9; Mon, 5 Mar 2018 16:14:05 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x235.google.com with SMTP id g21so18537225ioj.5; Mon, 05 Mar 2018 08:14:05 -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:in-reply-to:user-agent; bh=tmhl+4VFksFcsotEfVlbaYTWOkye/uuWlTtJ02CVkg4=; b=qUVy4r+qDzJP9I6LvpDZcCBJ+4xxsQ5cg6w8s7H0BKASXI/Miwo9OVE+bUhCDQ5E1/ ldPdPW5endFJJ7Z6xs/3ZbsTeXER5G+K6geXxZxJgkSVcuym60PqOXNcvrBvzwf4JXXk LkUSHW4i97SzMgR5nzAqqWy+ZAeuw3cCUmEP25asVJSPgEMVLgAOKWyNKCt9TpwuGSZ0 Mzfw5To83rnYTN1sDWm6hEDBYNqcDNGj6YMRtS6v6KmxvUHMItvZpcl1AXGS+zOGcmLq mDGvFrMMhWIuSpwPM8+wkqQza37FGpp7BTqCq8RTFrG5Hn9PvBckG3MwPNzUd8OQg67W eXbw== 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:in-reply-to:user-agent; bh=tmhl+4VFksFcsotEfVlbaYTWOkye/uuWlTtJ02CVkg4=; b=TpUzIbI2tG6cu+Pq5gzcJPD0Ntm6p+igPH7FvGwa8y/iSC4I7WTch0WDOf/Foe+tvw jh+MEKyGi7nyvUQkC9CoLjXZJOoXm1lb/kKf/NTDF3zkP+1KfH/QW3wOq9u2he5zKeR+ QvyP6Lenygdp5PAoHygi4X2XqTuVzfsqfVMf2Z7f6WMJS+7ElLtfK+ouTzflzNeHfpy9 VcrMMg8Pq9ezTLVF/Eb9K8XnLYGTrOmmjTDfMEKWfeExa6O3eCMidGd+05mQju1IjPCa NiW1oVlZhnxkFDePN09cZwQBonH86TtZ9nbrYrq7X+jkL/3THM4AR/Z2M0dMEgYnFCY1 x7+g== X-Gm-Message-State: APf1xPDPqJOcUuBe2d/DTUvUAbG1AYerMEYSueWYkgB8BivMx280CQBf yg+M/fR8sIKIqSKj6HKhRSkKvA== X-Google-Smtp-Source: AG47ELuYU4xAmVEFHZfVbRnxAE26NQ3HsdDuoVyb+1s4KVt/C42od3HGzDVwJlR2k+8s207Zx1GmlA== X-Received: by 10.107.131.82 with SMTP id f79mr17731259iod.102.1520266444151; Mon, 05 Mar 2018 08:14:04 -0800 (PST) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id k76sm4963445ita.32.2018.03.05.08.14.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 08:14:03 -0800 (PST) Sender: Mark Johnston Date: Mon, 5 Mar 2018 11:13:58 -0500 From: Mark Johnston To: Mariusz Zaborski Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325739 - in head: lib/libcasper/services lib/libcasper/services/cap_syslog share/mk Message-ID: <20180305161358.GA704@raichu> References: <201711120834.vAC8YQUq006611@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201711120834.vAC8YQUq006611@repo.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: Mon, 05 Mar 2018 16:14:05 -0000 On Sun, Nov 12, 2017 at 08:34:26AM +0000, Mariusz Zaborski wrote: > Author: oshogbo > Date: Sun Nov 12 08:34:25 2017 > New Revision: 325739 > URL: https://svnweb.freebsd.org/changeset/base/325739 > > Log: > Introduce syslog service for Casper. > > syslog in libc secretly reconnects to the daemon. > Another issue is that we don't have any information from openlog(3) if we > succeeded to open log or not so we don't know if we are ready > to enter cabability mode. > Because all of that we decided we need a syslog service for Caspser. Hi, Do you plan to MFC this or any of the other recent changes to libcasper? The growing divergence with stable/11 makes it rather painful to maintain a port, depending on libcasper, that aims to work on both 11 and head. From owner-svn-src-head@freebsd.org Mon Mar 5 16:38: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 1AD58F3D947; Mon, 5 Mar 2018 16:38:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B419C81AA7; Mon, 5 Mar 2018 16:38:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 6D8E51CC46; Mon, 5 Mar 2018 16:38:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 2C4CB113A; Mon, 5 Mar 2018 16:38:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id mpyh5rfIkH5n; Mon, 5 Mar 2018 16:37:58 +0000 (UTC) Subject: Re: svn commit: r330436 - head/bin/chflags DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 8A2D61135 To: Bruce Evans , Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803050156.w251u7Y8020941@repo.freebsd.org> <1520215860.38056.3.camel@freebsd.org> <20180305140228.P935@besplex.bde.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Mon, 5 Mar 2018 08:37:58 -0800 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: <20180305140228.P935@besplex.bde.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EXNBP6NHEphxYPszBEMjUwEYkFEbwxtMd" 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 Mar 2018 16:38:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EXNBP6NHEphxYPszBEMjUwEYkFEbwxtMd Content-Type: multipart/mixed; boundary="nfyizFNlDLrVdEOF1v75JkIMKxLEUuwwp"; protected-headers="v1" From: Bryan Drewery To: Bruce Evans , Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r330436 - head/bin/chflags References: <201803050156.w251u7Y8020941@repo.freebsd.org> <1520215860.38056.3.camel@freebsd.org> <20180305140228.P935@besplex.bde.org> In-Reply-To: <20180305140228.P935@besplex.bde.org> --nfyizFNlDLrVdEOF1v75JkIMKxLEUuwwp Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 3/4/2018 8:30 PM, Bruce Evans wrote: > On Sun, 4 Mar 2018, Ian Lepore wrote: >=20 >> On Mon, 2018-03-05 at 01:56 +0000, Bryan Drewery wrote: >>> >>> Log: >>> \xa0 chflags: Add -x option to not traverse mount points. >> >> Yay! \xa0One day later than I needed it, but still, yay! >=20 > I recently noticed that find(1) needs an option to not look at mount > points at all, and further options to classify mount points so that > you can prune them. >=20 > After reading the above and investigating further, I noticed that -x > is broken in most FreeBSD utilities, since POSIX requires not looking > at mount points at all for the few utilities that support -x.=C2=A0 E.g= =2E, > for du in 2001 draft 7 POSIX: >=20 > 12578=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= -x=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Whe= n evaluating file sizes, evaluate only > those files that have the same device as > 12579=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 the file specified by the file operand. > 12580=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= Specifying more than one of the mutually-exclusive > options -H and -L shall not be considered Yes I'm quite annoyed that my workaround for chflags not having -x, using `find -x ... -exec chflags`, is still trying to modify mountpoints but not descending into them. >=20 > Mount points are on a different device, but FreeBSD du -x is broken by > using FTS_XDEV and not filtering out the mount points. Linux du -x > (an old version in /compat/linyx/usr/bin) works correctly. --=20 Regards, Bryan Drewery --nfyizFNlDLrVdEOF1v75JkIMKxLEUuwwp-- --EXNBP6NHEphxYPszBEMjUwEYkFEbwxtMd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJanXJnAAoJEDXXcbtuRpfP3OAIAJgz2iFO/vuWWpMfUZ8/3R57 LYWSyO+T5krJMg+qtLmrnbN3VKmFyktNgZszSuLa3qiVzFcaTTJiFDom9kqWxhlb Mp9WUn0JTm4nZB05IgGzMwsgdsx6c6hsuG7CXU/nZ6vARJywoV0jGvvEqzq91F6V qq1euJmc4VRky0m6b2Tl8ex2t7gU1Dg6XQKAHBW1Ug0A96bCr1hDoZJitPZ2trgo YAWQGJCqtDYMZ6DZGJZ2witQ3Jo0dPXQ1gwmw4BYTXVjhGowXA9PsCtkepHwYDAS gWAzrTaQ3pNLeLeR7wvB4zp/Uapllo0uA2irL2846yvDGjR4vWWTCdJaD/J5H24= =KL3i -----END PGP SIGNATURE----- --EXNBP6NHEphxYPszBEMjUwEYkFEbwxtMd-- From owner-svn-src-head@freebsd.org Mon Mar 5 17:02: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 16B10F3F706; Mon, 5 Mar 2018 17:02:17 +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 959B482F1F; Mon, 5 Mar 2018 17:02:16 +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 8C2AD26973; Mon, 5 Mar 2018 17:02:16 +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 w25H2G3u078937; Mon, 5 Mar 2018 17:02:16 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25H2Gg5078935; Mon, 5 Mar 2018 17:02:16 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803051702.w25H2Gg5078935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Mar 2018 17:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330517 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 330517 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:02:17 -0000 Author: brooks Date: Mon Mar 5 17:02:16 2018 New Revision: 330517 URL: https://svnweb.freebsd.org/changeset/base/330517 Log: Remove remenants of 1990s efforts to let us run Net/OpenBSD binaries. No functional change (comments change in some generated files.) Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14571 Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Mar 5 17:01:26 2018 (r330516) +++ head/sys/compat/freebsd32/syscalls.master Mon Mar 5 17:02:16 2018 (r330517) @@ -392,7 +392,7 @@ 206 AUE_FUTIMES STD { int freebsd32_futimes(int fd, \ struct timeval32 *tptr); } 207 AUE_GETPGID NOPROTO { int getpgid(pid_t pid); } -208 AUE_NULL UNIMPL newreboot (NetBSD) +208 AUE_NULL UNIMPL nosys 209 AUE_POLL NOPROTO { int poll(struct pollfd *fds, u_int nfds, \ int timeout); } @@ -410,10 +410,6 @@ 218 AUE_NULL NODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int 219 AUE_NULL NODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int -; -; The following were introduced with NetBSD/4.4Lite-2 -; They are initialized by their respective modules/sysinits -; XXX PROBLEM!! 220 AUE_SEMCTL COMPAT7|NOSTD { int freebsd32_semctl( \ int semid, int semnum, \ int cmd, union semun32 *arg); } @@ -475,7 +471,6 @@ int which, clockid_t *clock_id); } 248 AUE_NULL UNIMPL ntp_gettime 249 AUE_NULL UNIMPL nosys -; syscall numbers initially used in OpenBSD 250 AUE_MINHERIT NOPROTO { int minherit(void *addr, size_t len, \ int inherit); } 251 AUE_RFORK NOPROTO { int rfork(int flags); } @@ -525,7 +520,6 @@ 286 AUE_NULL UNIMPL nosys 287 AUE_NULL UNIMPL nosys 288 AUE_NULL UNIMPL nosys -; 289 and 290 from NetBSD (OpenBSD: 267 and 268) 289 AUE_PREADV STD { ssize_t freebsd32_preadv(int fd, \ struct iovec32 *iovp, \ u_int iovcnt, \ @@ -540,7 +534,6 @@ 294 AUE_NULL UNIMPL nosys 295 AUE_NULL UNIMPL nosys 296 AUE_NULL UNIMPL nosys -; XXX 297 is 300 in NetBSD 297 AUE_FHSTATFS COMPAT4 { int freebsd32_fhstatfs( \ const struct fhandle *u_fhp, \ struct statfs32 *buf); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Mar 5 17:01:26 2018 (r330516) +++ head/sys/kern/syscalls.master Mon Mar 5 17:02:16 2018 (r330517) @@ -400,7 +400,7 @@ 205 AUE_UNDELETE STD { int undelete(char *path); } 206 AUE_FUTIMES STD { int futimes(int fd, struct timeval *tptr); } 207 AUE_GETPGID STD { int getpgid(pid_t pid); } -208 AUE_NULL UNIMPL newreboot (NetBSD) +208 AUE_NULL UNIMPL nosys 209 AUE_POLL STD { int poll(struct pollfd *fds, u_int nfds, \ int timeout); } @@ -418,8 +418,6 @@ 218 AUE_NULL NODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int 219 AUE_NULL NODEF|NOTSTATIC lkmnosys lkmnosys nosys_args int -; -; The following were introduced with NetBSD/4.4Lite-2 220 AUE_SEMCTL COMPAT7|NOSTD { int __semctl(int semid, int semnum, \ int cmd, union semun_old *arg); } 221 AUE_SEMGET NOSTD { int semget(key_t key, int nsems, \ @@ -474,7 +472,6 @@ int which, clockid_t *clock_id); } 248 AUE_NULL STD { int ntp_gettime(struct ntptimeval *ntvp); } 249 AUE_NULL UNIMPL nosys -; syscall numbers initially used in OpenBSD 250 AUE_MINHERIT STD { int minherit(void *addr, size_t len, \ int inherit); } 251 AUE_RFORK STD { int rfork(int flags); } @@ -522,7 +519,6 @@ 286 AUE_NULL UNIMPL nosys 287 AUE_NULL UNIMPL nosys 288 AUE_NULL UNIMPL nosys -; 289 and 290 from NetBSD (OpenBSD: 267 and 268) 289 AUE_PREADV STD { ssize_t preadv(int fd, struct iovec *iovp, \ u_int iovcnt, off_t offset); } 290 AUE_PWRITEV STD { ssize_t pwritev(int fd, struct iovec *iovp, \ @@ -533,7 +529,6 @@ 294 AUE_NULL UNIMPL nosys 295 AUE_NULL UNIMPL nosys 296 AUE_NULL UNIMPL nosys -; XXX 297 is 300 in NetBSD 297 AUE_FHSTATFS COMPAT4 { int fhstatfs( \ const struct fhandle *u_fhp, \ struct ostatfs *buf); } @@ -541,7 +536,6 @@ int flags); } 299 AUE_FHSTAT COMPAT11 { int fhstat(const struct fhandle *u_fhp, \ struct freebsd11_stat *sb); } -; syscall numbers for FreeBSD 300 AUE_NULL STD { int modnext(int modid); } 301 AUE_NULL STD { int modstat(int modid, \ struct module_stat *stat); } From owner-svn-src-head@freebsd.org Mon Mar 5 17:02: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 0AD71F3F8DF; Mon, 5 Mar 2018 17:02:52 +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 94E01831C1; Mon, 5 Mar 2018 17:02:51 +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 8FDF02698C; Mon, 5 Mar 2018 17:02:51 +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 w25H2pp9079006; Mon, 5 Mar 2018 17:02:51 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25H2pvL079002; Mon, 5 Mar 2018 17:02:51 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803051702.w25H2pvL079002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 5 Mar 2018 17:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330518 - in head/sys: compat/freebsd32 kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/sys: compat/freebsd32 kern X-SVN-Commit-Revision: 330518 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:02:52 -0000 Author: brooks Date: Mon Mar 5 17:02:50 2018 New Revision: 330518 URL: https://svnweb.freebsd.org/changeset/base/330518 Log: Regen after r330517. Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Mar 5 17:02:16 2018 (r330517) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Mar 5 17:02:50 2018 (r330518) @@ -217,7 +217,7 @@ const char *freebsd32_syscallnames[] = { "undelete", /* 205 = undelete */ "freebsd32_futimes", /* 206 = freebsd32_futimes */ "getpgid", /* 207 = getpgid */ - "#208", /* 208 = newreboot */ + "#208", /* 208 = nosys */ "poll", /* 209 = poll */ "lkmnosys", /* 210 = lkmnosys */ "lkmnosys", /* 211 = lkmnosys */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Mon Mar 5 17:02:16 2018 (r330517) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Mon Mar 5 17:02:50 2018 (r330518) @@ -266,7 +266,7 @@ struct sysent freebsd32_sysent[] = { { AS(undelete_args), (sy_call_t *)sys_undelete, AUE_UNDELETE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 205 = undelete */ { AS(freebsd32_futimes_args), (sy_call_t *)freebsd32_futimes, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 206 = freebsd32_futimes */ { AS(getpgid_args), (sy_call_t *)sys_getpgid, AUE_GETPGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 207 = getpgid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = newreboot */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = nosys */ { AS(poll_args), (sy_call_t *)sys_poll, AUE_POLL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 209 = poll */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = lkmnosys */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = lkmnosys */ Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Mon Mar 5 17:02:16 2018 (r330517) +++ head/sys/kern/init_sysent.c Mon Mar 5 17:02:50 2018 (r330518) @@ -259,7 +259,7 @@ struct sysent sysent[] = { { AS(undelete_args), (sy_call_t *)sys_undelete, AUE_UNDELETE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 205 = undelete */ { AS(futimes_args), (sy_call_t *)sys_futimes, AUE_FUTIMES, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 206 = futimes */ { AS(getpgid_args), (sy_call_t *)sys_getpgid, AUE_GETPGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 207 = getpgid */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = newreboot */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = nosys */ { AS(poll_args), (sy_call_t *)sys_poll, AUE_POLL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 209 = poll */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = lkmnosys */ { AS(nosys_args), (sy_call_t *)lkmnosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = lkmnosys */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Mon Mar 5 17:02:16 2018 (r330517) +++ head/sys/kern/syscalls.c Mon Mar 5 17:02:50 2018 (r330518) @@ -214,7 +214,7 @@ const char *syscallnames[] = { "undelete", /* 205 = undelete */ "futimes", /* 206 = futimes */ "getpgid", /* 207 = getpgid */ - "#208", /* 208 = newreboot */ + "#208", /* 208 = nosys */ "poll", /* 209 = poll */ "lkmnosys", /* 210 = lkmnosys */ "lkmnosys", /* 211 = lkmnosys */ From owner-svn-src-head@freebsd.org Mon Mar 5 17:19: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 86C5BF40EF7; Mon, 5 Mar 2018 17:19:19 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 156168476D; Mon, 5 Mar 2018 17:19:18 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id C41D9EA8; Mon, 5 Mar 2018 11:19:17 -0600 (CST) Date: Mon, 5 Mar 2018 11:19:16 -0600 From: Mark Linimon To: Mark Johnston Cc: Mariusz Zaborski , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r325739 - in head: lib/libcasper/services lib/libcasper/services/cap_syslog share/mk Message-ID: <20180305171916.GA2359@lonesome.com> References: <201711120834.vAC8YQUq006611@repo.freebsd.org> <20180305161358.GA704@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180305161358.GA704@raichu> 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: Mon, 05 Mar 2018 17:19:19 -0000 On Mon, Mar 05, 2018 at 11:13:58AM -0500, Mark Johnston wrote: > The growing divergence with stable/11 makes it rather painful to > maintain a port, depending on libcasper, that aims to work on both 11 > and head. Even an MFC won't help you, in the medium-term. e.g. via https://www.freebsd.org/security/#sup, even if the MFC made it into 11.2, you would still have several months of supporting the old one. (The FreeBSD package builds are based on the oldest supported point release from a branch.) The current estimate for 11.2 is late June. mcl From owner-svn-src-head@freebsd.org Mon Mar 5 17:32: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 68DB8F41F63; Mon, 5 Mar 2018 17:32:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 102908536B; Mon, 5 Mar 2018 17:32:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id D4F8A1ECC7; Mon, 5 Mar 2018 17:32:31 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id CC45A12CE; Mon, 5 Mar 2018 17:32:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id nDIqjrWiShoK; Mon, 5 Mar 2018 17:32:28 +0000 (UTC) Subject: Re: svn commit: r330436 - head/bin/chflags DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com F20A612C7 From: Bryan Drewery To: Bruce Evans , Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803050156.w251u7Y8020941@repo.freebsd.org> <1520215860.38056.3.camel@freebsd.org> <20180305140228.P935@besplex.bde.org> Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <8a8cd29b-9936-6d23-4e2b-4c646eca6aba@FreeBSD.org> Date: Mon, 5 Mar 2018 09:32:29 -0800 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: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3wTtYlb06OSDXKKVpMTEWxCYNc6tcWPUi" 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 Mar 2018 17:32:32 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3wTtYlb06OSDXKKVpMTEWxCYNc6tcWPUi Content-Type: multipart/mixed; boundary="X5VoSTSGGBACKRZqY0WzRvrcvy6RCefaO"; protected-headers="v1" From: Bryan Drewery To: Bruce Evans , Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <8a8cd29b-9936-6d23-4e2b-4c646eca6aba@FreeBSD.org> Subject: Re: svn commit: r330436 - head/bin/chflags References: <201803050156.w251u7Y8020941@repo.freebsd.org> <1520215860.38056.3.camel@freebsd.org> <20180305140228.P935@besplex.bde.org> In-Reply-To: --X5VoSTSGGBACKRZqY0WzRvrcvy6RCefaO Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 3/5/2018 8:37 AM, Bryan Drewery wrote: > On 3/4/2018 8:30 PM, Bruce Evans wrote: >> On Sun, 4 Mar 2018, Ian Lepore wrote: >> >>> On Mon, 2018-03-05 at 01:56 +0000, Bryan Drewery wrote: >>>> >>>> Log: >>>> \xa0 chflags: Add -x option to not traverse mount points. >>> >>> Yay! \xa0One day later than I needed it, but still, yay! >> >> I recently noticed that find(1) needs an option to not look at mount >> points at all, and further options to classify mount points so that >> you can prune them. >> >> After reading the above and investigating further, I noticed that -x >> is broken in most FreeBSD utilities, since POSIX requires not looking >> at mount points at all for the few utilities that support -x.=C2=A0 E.= g., >> for du in 2001 draft 7 POSIX: >> >> 12578=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= -x=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Whe= n evaluating file sizes, evaluate only >> those files that have the same device as >> 12579=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 the file specified by the file operand. >> 12580=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= Specifying more than one of the mutually-exclusive >> options -H and -L shall not be considered >=20 > Yes I'm quite annoyed that my workaround for chflags not having -x, > using `find -x ... -exec chflags`, is still trying to modify mountpoint= s > but not descending into them. >=20 Note of course my chflags change suffers the same problem of course since it's just using FTS (these are null-mounted read-only or devfs/procfs paths): > # /scratch/obj/root/git/freebsd/amd64.amd64/bin/chflags/chflags.full -R= x schg /poudriere/data/.m/exp-11amd64-commit-test/ref > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/distfiles:= Operation not supported > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/compat/lin= ux/proc: Operation not supported > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/proc: Oper= ation not supported > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/dev: Inval= id argument > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/rescue: Re= ad-only file system > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/usr/tests:= Read-only file system > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/usr/share:= Read-only file system > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/usr/ports:= Read-only file system > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/usr/src: R= ead-only file system > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/packages: = Read-only file system Personally I find this behavior surprising and wrong and think all of the tools -x[dev] behavior should not interact with these paths either by default or with an option. >> >> Mount points are on a different device, but FreeBSD du -x is broken by= >> using FTS_XDEV and not filtering out the mount points. Linux du -x >> (an old version in /compat/linyx/usr/bin) works correctly. >=20 >=20 --=20 Regards, Bryan Drewery --X5VoSTSGGBACKRZqY0WzRvrcvy6RCefaO-- --3wTtYlb06OSDXKKVpMTEWxCYNc6tcWPUi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJanX8tAAoJEDXXcbtuRpfPB70H/im82x6xxvceGRXWtmJ18ssL 5DsIHjgwIjpulBoJHdgW6Liewj3S5BQ+4DkQDmHHPckId9xMehXapwhY289Q48Tc uJTpkUItKOYMRpgCuMOusCtNLsukwcRyRNOzyY3U6O/iiEMxQsCp613jhTX9HB9+ YNkvq7uhw3Xmvrv701hUxEqRe1PFVikZ2Lqx/rqARt0Qe7N69XdK+k40UT0pnVrX AJzhrBMqskYpFBD7cAndHIm2H7uoAjXu/EoV2co7LHZBa8aaJSiwyp9f2mryYw83 UPo3rDTDSmm2SkHBUjg8tiy4RL2usIgSirggMk0q+os8B2LVSviqZRhtSQuMrYk= =vpAc -----END PGP SIGNATURE----- --3wTtYlb06OSDXKKVpMTEWxCYNc6tcWPUi-- From owner-svn-src-head@freebsd.org Mon Mar 5 18:20: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 CFC62F45037; Mon, 5 Mar 2018 18:20:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA1387288; Mon, 5 Mar 2018 18:20:52 +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 2308F10A87D; Mon, 5 Mar 2018 13:20:51 -0500 (EST) From: John Baldwin To: Emmanuel Vadot Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330335 - head/sys/sys Date: Mon, 05 Mar 2018 09:40:25 -0800 Message-ID: <1619920.YOJitH0Jj0@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201803031243.w23ChBMQ096308@repo.freebsd.org> References: <201803031243.w23ChBMQ096308@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); Mon, 05 Mar 2018 13:20:51 -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: Mon, 05 Mar 2018 18:20:53 -0000 On Saturday, March 03, 2018 12:43:11 PM Emmanuel Vadot wrote: > Author: manu > Date: Sat Mar 3 12:43:11 2018 > New Revision: 330335 > URL: https://svnweb.freebsd.org/changeset/base/330335 > > Log: > Introduce BUS_PASS_SUPPORTDEV > > The reason for this new pass is : > > The earlier pass names are really specific (interrupt, timer, scheduler etc ..) > and making a driver that other device driver (that attach at DEFAULT pass) > needs probe at earlier pass can be confiusing. We can live with GPIO driver > at INTERRUPT pass because they are often an interrupt controller too but having > a usb phy driver probed at RESOURCES (or SCHEDULER for example) is silly. > The number was choosen to have a lot of margin if we want to introduce other > pass in the futur. > > Reviewed by: ian, imp, kevans > Differential Revision: https://reviews.freebsd.org/D14568 I have a different issue on x86 which is that I want acpi0 to kind of probe even before BUS_PASS_BUS. I've wondered if the pass stuff actually needs to be recursive in some way. That is, when a bus first enumerates children, we start probing drivers for those children starting at pass 0 and working up to the current global pass level before increasing the global pass level. This scheme would also making bus passes still operate the same in a post-boot environment as the I think an implementation would mean that each bus device had its own pass level that governed the attach logic and we would raise that pass level up across the different levels to the current level when attaching a new bus device. (I would perhaps handle this logic in bus_generic_attach() to make it transparent to bus drivers.) Do you have any thoughts on that and if it would help with any situations you are aware of? It would mean that if some new bus was discovered when the global pass level was a higher number, the new bus could still "step up" through the pass levels. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Mar 5 18:56: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 6D5A6F47268; Mon, 5 Mar 2018 18:56:32 +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 E6B0068B13; Mon, 5 Mar 2018 18:56:31 +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 w25IuT7k045285; Mon, 5 Mar 2018 10:56:29 -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 w25IuTid045284; Mon, 5 Mar 2018 10:56:29 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803051856.w25IuTid045284@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330436 - head/bin/chflags In-Reply-To: <8a8cd29b-9936-6d23-4e2b-4c646eca6aba@FreeBSD.org> To: Bryan Drewery Date: Mon, 5 Mar 2018 10:56:29 -0800 (PST) CC: Bruce Evans , Ian Lepore , 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: Mon, 05 Mar 2018 18:56:32 -0000 > On 3/5/2018 8:37 AM, Bryan Drewery wrote: > > On 3/4/2018 8:30 PM, Bruce Evans wrote: > >> On Sun, 4 Mar 2018, Ian Lepore wrote: > >> > >>> On Mon, 2018-03-05 at 01:56 +0000, Bryan Drewery wrote: > >>>> > >>>> Log: > >>>> \xa0 chflags: Add -x option to not traverse mount points. > >>> > >>> Yay! \xa0One day later than I needed it, but still, yay! > >> > >> I recently noticed that find(1) needs an option to not look at mount > >> points at all, and further options to classify mount points so that > >> you can prune them. > >> > >> After reading the above and investigating further, I noticed that -x > >> is broken in most FreeBSD utilities, since POSIX requires not looking > >> at mount points at all for the few utilities that support -x.? E.g., > >> for du in 2001 draft 7 POSIX: > >> > >> 12578??????????? -x??????????? When evaluating file sizes, evaluate only > >> those files that have the same device as > >> 12579????????????????????????? the file specified by the file operand. > >> 12580??????????? Specifying more than one of the mutually-exclusive > >> options -H and -L shall not be considered > > > > Yes I'm quite annoyed that my workaround for chflags not having -x, > > using `find -x ... -exec chflags`, is still trying to modify mountpoints > > but not descending into them. > > > > Note of course my chflags change suffers the same problem of course > since it's just using FTS (these are null-mounted read-only or > devfs/procfs paths): > > > # /scratch/obj/root/git/freebsd/amd64.amd64/bin/chflags/chflags.full -Rx schg /poudriere/data/.m/exp-11amd64-commit-test/ref > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/distfiles: Operation not supported > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/compat/linux/proc: Operation not supported > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/proc: Operation not supported > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/dev: Invalid argument > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/rescue: Read-only file system > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/usr/tests: Read-only file system > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/usr/share: Read-only file system > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/usr/ports: Read-only file system > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/usr/src: Read-only file system > > chflags.full: /poudriere/data/.m/exp-11amd64-commit-test/ref/packages: Read-only file system > > Personally I find this behavior surprising and wrong and think all of > the tools -x[dev] behavior should not interact with these paths either > by default or with an option. Isnt part of the problem the directory under the mount point is technically a part of the parent file system, such that FTS is getting that, but then stating aginst the root of mounted directory? Would it be wrong to make it return the data for the hidden, and probably empty directory that is mounted over the top of, as technically that is part of the traversed file system. I also think this may be time for a change, especially in the zfs world of lots of datasets! > > >> > >> Mount points are on a different device, but FreeBSD du -x is broken by > >> using FTS_XDEV and not filtering out the mount points. Linux du -x > >> (an old version in /compat/linyx/usr/bin) works correctly. > -- > Regards, > Bryan Drewery -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Mon Mar 5 20: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 1EA32F23A97; Mon, 5 Mar 2018 20:03:46 +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 C27B46B472; Mon, 5 Mar 2018 20:03:45 +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 BBC5A7AB; Mon, 5 Mar 2018 20:03:45 +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 w25K3jsf069458; Mon, 5 Mar 2018 20:03:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25K3jdH069457; Mon, 5 Mar 2018 20:03:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803052003.w25K3jdH069457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 5 Mar 2018 20:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330521 - head/sys/contrib/zstd/programs X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/contrib/zstd/programs X-SVN-Commit-Revision: 330521 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 20:03:46 -0000 Author: cem Date: Mon Mar 5 20:03:45 2018 New Revision: 330521 URL: https://svnweb.freebsd.org/changeset/base/330521 Log: MFV: zstd: FIO_addFInfo: Fully initialize output 'total' struct Silence a Coverity warning about 'windowSize' being uninitialized. (Yes, nothing that calls this routine actually uses the windowSize value. Still, appeasing Coverity is pretty harmless in this case.) Reported by: Coverity Reviewed by: Yann Collet Obtained from: zstd 606374269cf3485972c90b993fbb84dc20da032f Sponsored by: Dell EMC Isilon Modified: head/sys/contrib/zstd/programs/fileio.c Modified: head/sys/contrib/zstd/programs/fileio.c ============================================================================== --- head/sys/contrib/zstd/programs/fileio.c Mon Mar 5 19:02:32 2018 (r330520) +++ head/sys/contrib/zstd/programs/fileio.c Mon Mar 5 20:03:45 2018 (r330521) @@ -1971,6 +1971,7 @@ static void displayInfo(const char* inFileName, fileIn static fileInfo_t FIO_addFInfo(fileInfo_t fi1, fileInfo_t fi2) { fileInfo_t total; + memset(&total, 0, sizeof(total)); total.numActualFrames = fi1.numActualFrames + fi2.numActualFrames; total.numSkippableFrames = fi1.numSkippableFrames + fi2.numSkippableFrames; total.compressedSize = fi1.compressedSize + fi2.compressedSize; From owner-svn-src-head@freebsd.org Mon Mar 5 20:51: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 9D0F3F279ED; Mon, 5 Mar 2018 20:51:24 +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 511A96D754; Mon, 5 Mar 2018 20:51:24 +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 4B617F5E; Mon, 5 Mar 2018 20:51:24 +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 w25KpOh9093471; Mon, 5 Mar 2018 20:51:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w25KpNbu093467; Mon, 5 Mar 2018 20:51:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803052051.w25KpNbu093467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 5 Mar 2018 20:51:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330525 - in head/lib/libc: arm mips riscv softfloat X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/lib/libc: arm mips riscv softfloat X-SVN-Commit-Revision: 330525 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 20:51:25 -0000 Author: jhb Date: Mon Mar 5 20:51:23 2018 New Revision: 330525 URL: https://svnweb.freebsd.org/changeset/base/330525 Log: Move softfloat symbol map entries to softfloat/Symbol.map. The arm, mips, and riscv MD Symbol.map files listed some (but not all) of the softfloat symbols that were actually defined in softfloat.c. While here, also remove entries for __fixuns[sd]fsi which are provided by libcompiler_rt and not by libc. Sponsored by: DARPA / AFRL Modified: head/lib/libc/arm/Symbol.map head/lib/libc/mips/Symbol.map head/lib/libc/riscv/Symbol.map head/lib/libc/softfloat/Symbol.map Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Mon Mar 5 20:43:43 2018 (r330524) +++ head/lib/libc/arm/Symbol.map Mon Mar 5 20:51:23 2018 (r330525) @@ -61,23 +61,5 @@ FBSDprivate_1.0 { _end; _sbrk; - /* softfloat */ - __addsf3; - __adddf3; - __subsf3; - __subdf3; - __mulsf3; - __muldf3; - __divsf3; - __divdf3; - __floatsisf; - __floatsidf; - __fixsfsi; - __fixdfsi; - __fixunssfsi; - __fixunsdfsi; - __extendsfdf2; - __truncdfsf2; - _libc_arm_fpu_present; }; Modified: head/lib/libc/mips/Symbol.map ============================================================================== --- head/lib/libc/mips/Symbol.map Mon Mar 5 20:43:43 2018 (r330524) +++ head/lib/libc/mips/Symbol.map Mon Mar 5 20:51:23 2018 (r330525) @@ -53,22 +53,4 @@ FBSDprivate_1.0 { _end; _brk; _sbrk; - - /* softfloat */ - __addsf3; - __adddf3; - __subsf3; - __subdf3; - __mulsf3; - __muldf3; - __divsf3; - __divdf3; - __floatsisf; - __floatsidf; - __fixsfsi; - __fixdfsi; - __fixunssfsi; - __fixunsdfsi; - __extendsfdf2; - __truncdfsf2; }; Modified: head/lib/libc/riscv/Symbol.map ============================================================================== --- head/lib/libc/riscv/Symbol.map Mon Mar 5 20:43:43 2018 (r330524) +++ head/lib/libc/riscv/Symbol.map Mon Mar 5 20:51:23 2018 (r330525) @@ -35,22 +35,4 @@ FBSDprivate_1.0 { _set_tp; _end; __makecontext; - - /* softfloat */ - __addsf3; - __adddf3; - __subsf3; - __subdf3; - __mulsf3; - __muldf3; - __divsf3; - __divdf3; - __floatsisf; - __floatsidf; - __fixsfsi; - __fixdfsi; - __fixunssfsi; - __fixunsdfsi; - __extendsfdf2; - __truncdfsf2; }; Modified: head/lib/libc/softfloat/Symbol.map ============================================================================== --- head/lib/libc/softfloat/Symbol.map Mon Mar 5 20:43:43 2018 (r330524) +++ head/lib/libc/softfloat/Symbol.map Mon Mar 5 20:51:23 2018 (r330525) @@ -22,8 +22,17 @@ FBSDprivate_1.0 { __softfloat_float_exception_mask; __softfloat_float_rounding_mode; __softfloat_float_raise; + __adddf3; + __addsf3; + __divdf3; + __divsf3; __eqdf2; __eqsf2; + __extendsfdf2; + __fixdfsi; + __fixsfsi; + __floatsidf; + __floatsisf; __gedf2; __gesf2; __gtdf2; @@ -32,10 +41,15 @@ FBSDprivate_1.0 { __lesf2; __ltdf2; __ltsf2; + __muldf3; + __mulsf3; __nedf2; __negdf2; __negsf2; __nesf2; + __subdf3; + __subsf3; + __truncdfsf2; __unorddf2; __unordsf2; }; From owner-svn-src-head@freebsd.org Tue Mar 6 00:05: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 7549CF367EA; Tue, 6 Mar 2018 00:05:47 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-x22e.google.com (mail-wr0-x22e.google.com [IPv6:2a00:1450:400c:c0c::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 D8CDC749B7; Tue, 6 Mar 2018 00:05:46 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-x22e.google.com with SMTP id v18so18478632wrv.0; Mon, 05 Mar 2018 16:05:46 -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=Q28ESpLKjIOc1fbz8i+bgjxnIPkqW8n6jfX21+mnRvs=; b=izECDC++gAA0DcOOiA7eNDMfkVv4b27Za959IK7EwvDuss7cEeBU6eaecWjKkTC4BO zrDgsE2W9ZBthoJRfYYCjsZ9EEyc6xu37VvGsWixQYw+oAsQnXr6Dj/5cWm65ImMeSbx Ps4piBvWbc26NHucOMDSR4ilYSQv92O3kDUNQPQAU5Bo1GlHgPkFrNrcfYtqiYQpr00c j9Nqo6K6tdF5IMXbIIhmaq9AiOtgW++iAIBliFL6diIda8zmzZiw1xQT7W3J5gFb8AG5 H0A6Nt8TN/zSds3oObvb28fR+yWhjizlrOBsy316sZH0vRHR3lmzgRWk1IovjUMxkRMk u+PQ== 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=Q28ESpLKjIOc1fbz8i+bgjxnIPkqW8n6jfX21+mnRvs=; b=IODdplq36Ot0QRYFdxh72LVPaBWtYk3txor2cyk213a3H2qON52jJLCQbC2lGc7bv4 Y4F52TY4Am64eNp5EqQXd3GsVAm8kyss08Kq7mGc5Z5ulsQl32ZmUw7I26iQZ9kk38fg 3ixOUYMWoAZC+2ePOmQClB2XlT58SioudfG/59mFKVmdiedh957B252G//J2TZX4x7JL x4BO3qkqyYSRwBeDMcm8VbB/YaT4Y/uyBcyTVSpIWXEh1iL59ljPcbic2AifKZCkD7ZA NDKyIHjkxWxMG3JS7q0jB4uGqtogIbnmxy2ye9cTX+p3Wi/1AtzLKZaQf0PNJ16gFUf7 s2SA== X-Gm-Message-State: APf1xPA+olWYQcvVT6BMj0NLIby2xRyB/cZ3gFMO/FoxIUJLjKl79X1B vBd3Rur3LcsUNbm2LBbL7C/mtJjd2g0AUNMIyGkucTmZ X-Google-Smtp-Source: AG47ELuNVMvc6wW8fFtVs0O+SxUAR64XaY73g4N/EkDpZHgzYr3nKXN6zlnZjwVqBDH8npPykVkpD4A/1Nz8lJyqjQo= X-Received: by 10.223.209.205 with SMTP id m13mr12930307wri.99.1520294745645; Mon, 05 Mar 2018 16:05:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.192.2 with HTTP; Mon, 5 Mar 2018 16:05:45 -0800 (PST) In-Reply-To: <201803041932.w24JWqei028169@repo.freebsd.org> References: <201803041932.w24JWqei028169@repo.freebsd.org> From: Jonathan Looney Date: Mon, 5 Mar 2018 19:05:45 -0500 Message-ID: Subject: Re: svn commit: r330407 - head/sys/dev/iicbus To: Ian Lepore 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: Tue, 06 Mar 2018 00:05:47 -0000 It looks like this is causing compilation failures: /home/jtl/head/sys/dev/iicbus/ds1672.c:147:20: error: use of undeclared identifier 'sc' clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_READ, ts); ^ /home/jtl/head/sys/dev/iicbus/ds1672.c:162:20: error: use of undeclared identifier 'sc' clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_WRITE, ts); ^ 2 errors generated. Jonathan On Sun, Mar 4, 2018 at 2:32 PM, Ian Lepore wrote: > Author: ian > Date: Sun Mar 4 19:32:52 2018 > New Revision: 330407 > URL: https://svnweb.freebsd.org/changeset/base/330407 > > Log: > Add calls to the new clock_dbgprint_xxx() functions. Also, stop applying > a local .5 second adjustment to the time, since that is now done by the > code in subr_rtc.c. > > Modified: > head/sys/dev/iicbus/ds1672.c > > Modified: head/sys/dev/iicbus/ds1672.c > ============================================================ > ================== > --- head/sys/dev/iicbus/ds1672.c Sun Mar 4 19:26:47 2018 > (r330406) > +++ head/sys/dev/iicbus/ds1672.c Sun Mar 4 19:32:52 2018 > (r330407) > @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); > > #define DS1672_CTRL_EOSC (1 << 7) /* Stop/start > flag. */ > > -#define NANOSEC 1000000000 > - > #define MAX_IIC_DATA_SIZE 4 > > struct ds1672_softc { > @@ -144,8 +142,9 @@ ds1672_gettime(device_t dev, struct timespec *ts) > /* counter has seconds since epoch */ > ts->tv_sec = (secs[3] << 24) | (secs[2] << 16) > | (secs[1] << 8) | (secs[0] << 0); > - ts->tv_nsec = NANOSEC / 2; > + ts->tv_nsec = 0; > } > + clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_READ, ts); > return (error); > } > > @@ -159,6 +158,8 @@ ds1672_settime(device_t dev, struct timespec *ts) > data[2] = (ts->tv_sec >> 16) & 0xff; > data[3] = (ts->tv_sec >> 24) & 0xff; > > + ts->tv_nsec = 0; > + clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_WRITE, ts); > return (ds1672_write(dev, DS1672_COUNTER, data, 4)); > } > > > From owner-svn-src-head@freebsd.org Tue Mar 6 01:52: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 06DE6F40168; Tue, 6 Mar 2018 01:52:05 +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 AB2FC79C0E; Tue, 6 Mar 2018 01:52:04 +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 A62D845EB; Tue, 6 Mar 2018 01:52:04 +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 w261q4IT044218; Tue, 6 Mar 2018 01:52:04 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w261q4Bf044217; Tue, 6 Mar 2018 01:52:04 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803060152.w261q4Bf044217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 6 Mar 2018 01:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330527 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330527 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:52:05 -0000 Author: brooks Date: Tue Mar 6 01:52:04 2018 New Revision: 330527 URL: https://svnweb.freebsd.org/changeset/base/330527 Log: Use umtx_copyin_umtx_time32() in __umtx_op_lock_umutex_compat32(). Non-NULL timeouts where copied in improperly and could produce failures due to incompatible data structures. Reviewed by: kib MFC after: 3 days Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14587 Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Mar 5 23:51:29 2018 (r330526) +++ head/sys/kern/kern_umtx.c Tue Mar 6 01:52:04 2018 (r330527) @@ -4118,7 +4118,7 @@ __umtx_op_lock_umutex_compat32(struct thread *td, stru if (uap->uaddr2 == NULL) tm_p = NULL; else { - error = umtx_copyin_umtx_time(uap->uaddr2, + error = umtx_copyin_umtx_time32(uap->uaddr2, (size_t)uap->uaddr1, &timeout); if (error != 0) return (error); From owner-svn-src-head@freebsd.org Tue Mar 6 02:21: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 6E188F42F00; Tue, 6 Mar 2018 02:21:42 +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 1A1727B143; Tue, 6 Mar 2018 02:21:42 +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 14FAD4B04; Tue, 6 Mar 2018 02:21:42 +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 w262LfR8056731; Tue, 6 Mar 2018 02:21:41 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w262LfdD056730; Tue, 6 Mar 2018 02:21:41 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803060221.w262LfdD056730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 6 Mar 2018 02:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330528 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 330528 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:21:42 -0000 Author: ian Date: Tue Mar 6 02:21:41 2018 New Revision: 330528 URL: https://svnweb.freebsd.org/changeset/base/330528 Log: Fix a paste-o that broke the build. There is no softc pointer here, just use the dev arg. Reported by: Jonathan Looney Pointy hat: ian@ Modified: head/sys/dev/iicbus/ds1672.c Modified: head/sys/dev/iicbus/ds1672.c ============================================================================== --- head/sys/dev/iicbus/ds1672.c Tue Mar 6 01:52:04 2018 (r330527) +++ head/sys/dev/iicbus/ds1672.c Tue Mar 6 02:21:41 2018 (r330528) @@ -144,7 +144,7 @@ ds1672_gettime(device_t dev, struct timespec *ts) | (secs[1] << 8) | (secs[0] << 0); ts->tv_nsec = 0; } - clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_READ, ts); + clock_dbgprint_ts(dev, CLOCK_DBG_READ, ts); return (error); } @@ -159,7 +159,7 @@ ds1672_settime(device_t dev, struct timespec *ts) data[3] = (ts->tv_sec >> 24) & 0xff; ts->tv_nsec = 0; - clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_WRITE, ts); + clock_dbgprint_ts(dev, CLOCK_DBG_WRITE, ts); return (ds1672_write(dev, DS1672_COUNTER, data, 4)); } From owner-svn-src-head@freebsd.org Tue Mar 6 02:23: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 C227CF4326A for ; Tue, 6 Mar 2018 02:23:01 +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 4FACF7B3DD for ; Tue, 6 Mar 2018 02:23:01 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 45bd274f-20e5-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 45bd274f-20e5-11e8-91c6-33ffc249f3e8; Tue, 06 Mar 2018 02:22:53 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w262Mmbp097441; Mon, 5 Mar 2018 19:22:48 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520302968.15494.7.camel@freebsd.org> Subject: Re: svn commit: r330407 - head/sys/dev/iicbus From: Ian Lepore To: Jonathan Looney Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 05 Mar 2018 19:22:48 -0700 In-Reply-To: References: <201803041932.w24JWqei028169@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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 Mar 2018 02:23:01 -0000 On Mon, 2018-03-05 at 19:05 -0500, Jonathan Looney wrote: > It looks like this is causing compilation failures: > > /home/jtl/head/sys/dev/iicbus/ds1672.c:147:20: error: use of > undeclared > identifier 'sc' > clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_READ, ts); > ^ > /home/jtl/head/sys/dev/iicbus/ds1672.c:162:20: error: use of > undeclared > identifier 'sc' > clock_dbgprint_ts(sc->sc_dev, CLOCK_DBG_WRITE, ts); > ^ > 2 errors generated. > > > Jonathan Oops, sorry about that. I didn't realize it wasn't being built as a module, so I never actually compile-tested it. Fixed in r330528. -- Ian > On Sun, Mar 4, 2018 at 2:32 PM, Ian Lepore wrote: > > > > > Author: ian > > Date: Sun Mar4 19:32:52 2018 > > New Revision: 330407 > > URL: https://svnweb.freebsd.org/changeset/base/330407 > > > > Log: > > Add calls to the new clock_dbgprint_xxx() functions.Also, stop > > applying > > a local .5 second adjustment to the time, since that is now done > > by the > > code in subr_rtc.c. > > > > Modified: > > head/sys/dev/iicbus/ds1672.c > > > > > > From owner-svn-src-head@freebsd.org Tue Mar 6 02:30: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 8FEDDF43E52; Tue, 6 Mar 2018 02:30:35 +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 3BDEB7BA8B; Tue, 6 Mar 2018 02:30:35 +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 364BE4B79; Tue, 6 Mar 2018 02:30:35 +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 w262UZ8F060139; Tue, 6 Mar 2018 02:30:35 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w262UYXe060136; Tue, 6 Mar 2018 02:30:34 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803060230.w262UYXe060136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 6 Mar 2018 02:30:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330529 - in head/sys: dev/iicbus modules/i2c modules/i2c/ds1672 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: dev/iicbus modules/i2c modules/i2c/ds1672 X-SVN-Commit-Revision: 330529 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:30:35 -0000 Author: ian Date: Tue Mar 6 02:30:34 2018 New Revision: 330529 URL: https://svnweb.freebsd.org/changeset/base/330529 Log: Build the ds1672 driver as a module. Add a detach() to unregister the rtc. Added: head/sys/modules/i2c/ds1672/ head/sys/modules/i2c/ds1672/Makefile (contents, props changed) Modified: head/sys/dev/iicbus/ds1672.c head/sys/modules/i2c/Makefile Modified: head/sys/dev/iicbus/ds1672.c ============================================================================== --- head/sys/dev/iicbus/ds1672.c Tue Mar 6 02:21:41 2018 (r330528) +++ head/sys/dev/iicbus/ds1672.c Tue Mar 6 02:30:34 2018 (r330529) @@ -118,6 +118,14 @@ ds1672_init(device_t dev) } static int +ds1672_detach(device_t dev) +{ + + clock_unregister(dev); + return (0); +} + +static int ds1672_attach(device_t dev) { struct ds1672_softc *sc = device_get_softc(dev); @@ -166,6 +174,7 @@ ds1672_settime(device_t dev, struct timespec *ts) static device_method_t ds1672_methods[] = { DEVMETHOD(device_probe, ds1672_probe), DEVMETHOD(device_attach, ds1672_attach), + DEVMETHOD(device_detach, ds1672_detach), DEVMETHOD(clock_gettime, ds1672_gettime), DEVMETHOD(clock_settime, ds1672_settime), Modified: head/sys/modules/i2c/Makefile ============================================================================== --- head/sys/modules/i2c/Makefile Tue Mar 6 02:21:41 2018 (r330528) +++ head/sys/modules/i2c/Makefile Tue Mar 6 02:30:34 2018 (r330529) @@ -5,6 +5,7 @@ SUBDIR = \ cyapa \ ds1307 \ ds13rtc \ + ds1672 \ ds3231 \ icee \ if_ic \ Added: head/sys/modules/i2c/ds1672/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/i2c/ds1672/Makefile Tue Mar 6 02:30:34 2018 (r330529) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/iicbus +KMOD = ds1672 +SRCS = ds1672.c + +# Generated files... +SRCS+= \ + bus_if.h \ + clock_if.h \ + device_if.h \ + iicbus_if.h \ + opt_platform.h \ + +.if !empty(OPT_FDT) +SRCS+= ofw_bus_if.h +.endif + +.include From owner-svn-src-head@freebsd.org Tue Mar 6 12:01: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 9A9BFF2A128; Tue, 6 Mar 2018 12:01:32 +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 47F5572FF6; Tue, 6 Mar 2018 12:01:32 +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 4307C1299F; Tue, 6 Mar 2018 12:01:32 +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 w26C1WOW047410; Tue, 6 Mar 2018 12:01:32 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26C1Wja047409; Tue, 6 Mar 2018 12:01:32 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201803061201.w26C1Wja047409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 6 Mar 2018 12:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330536 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 330536 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 12:01:32 -0000 Author: ae Date: Tue Mar 6 12:01:31 2018 New Revision: 330536 URL: https://svnweb.freebsd.org/changeset/base/330536 Log: Define ethernet type 0x88A8 as ETHERTYPE_QINQ. Reviewed by: kp Obtained from: OpenBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14593 Modified: head/sys/net/ethernet.h Modified: head/sys/net/ethernet.h ============================================================================== --- head/sys/net/ethernet.h Tue Mar 6 07:38:32 2018 (r330535) +++ head/sys/net/ethernet.h Tue Mar 6 12:01:31 2018 (r330536) @@ -344,6 +344,7 @@ struct ether_vlan_header { #define ETHERTYPE_PPPOE 0x8864 /* PPP Over Ethernet Session Stage */ #define ETHERTYPE_LANPROBE 0x8888 /* HP LanProbe test? */ #define ETHERTYPE_PAE 0x888e /* EAPOL PAE/802.1x */ +#define ETHERTYPE_QINQ 0x88A8 /* 802.1ad VLAN stacking */ #define ETHERTYPE_LOOPBACK 0x9000 /* Loopback: used to test interfaces */ #define ETHERTYPE_LBACK ETHERTYPE_LOOPBACK /* DEC MOP loopback */ #define ETHERTYPE_XNSSM 0x9001 /* 3Com (Formerly Bridge Communications), XNS Systems Management */ From owner-svn-src-head@freebsd.org Tue Mar 6 12: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 2F964F2F624; Tue, 6 Mar 2018 12:58:01 +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 CFA1975DA0; Tue, 6 Mar 2018 12:58:00 +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 C97001321E; Tue, 6 Mar 2018 12:58:00 +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 w26Cw08a076388; Tue, 6 Mar 2018 12:58:00 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26Cw05B076386; Tue, 6 Mar 2018 12:58:00 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201803061258.w26Cw05B076386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 6 Mar 2018 12:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330537 - in head/sys: compat/linuxkpi/common/include/linux dev/mlx4/mlx4_core X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: compat/linuxkpi/common/include/linux dev/mlx4/mlx4_core X-SVN-Commit-Revision: 330537 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 12:58:01 -0000 Author: ae Date: Tue Mar 6 12:58:00 2018 New Revision: 330537 URL: https://svnweb.freebsd.org/changeset/base/330537 Log: Add mapping for several ethernet types used by Linux to FreeBSD ethernet types. Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14594 Modified: head/sys/compat/linuxkpi/common/include/linux/if_ether.h head/sys/dev/mlx4/mlx4_core/mlx4.h Modified: head/sys/compat/linuxkpi/common/include/linux/if_ether.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/if_ether.h Tue Mar 6 12:01:31 2018 (r330536) +++ head/sys/compat/linuxkpi/common/include/linux/if_ether.h Tue Mar 6 12:58:00 2018 (r330537) @@ -35,8 +35,6 @@ #include -#define ETH_P_8021Q ETHERTYPE_VLAN - #define ETH_HLEN ETHER_HDR_LEN /* Total octets in header. */ #ifndef ETH_ALEN #define ETH_ALEN ETHER_ADDR_LEN @@ -47,6 +45,11 @@ /* * defined Ethernet Protocol ID's. */ -#define ETH_P_IP 0x0800 /* Internet Protocol packet */ +#define ETH_P_IP ETHERTYPE_IP +#define ETH_P_IPV6 ETHERTYPE_IPV6 +#define ETH_P_MPLS_UC ETHERTYPE_MPLS +#define ETH_P_MPLS_MC ETHERTYPE_MPLS_MCAST +#define ETH_P_8021Q ETHERTYPE_VLAN +#define ETH_P_8021AD ETHERTYPE_QINQ #endif /* _LINUX_IF_ETHER_H_ */ Modified: head/sys/dev/mlx4/mlx4_core/mlx4.h ============================================================================== --- head/sys/dev/mlx4/mlx4_core/mlx4.h Tue Mar 6 12:01:31 2018 (r330536) +++ head/sys/dev/mlx4/mlx4_core/mlx4.h Tue Mar 6 12:58:00 2018 (r330537) @@ -66,8 +66,6 @@ #define MLX4_QUERY_IF_STAT_RESET BIT(31) -#define ETH_P_8021AD 0x88A8 - enum { MLX4_HCR_BASE = 0x80680, MLX4_HCR_SIZE = 0x0001c, From owner-svn-src-head@freebsd.org Tue Mar 6 14:18: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 D0D24F3547F; Tue, 6 Mar 2018 14:18:45 +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 7F21978CAB; Tue, 6 Mar 2018 14:18:45 +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 79F3E13F06; Tue, 6 Mar 2018 14:18:45 +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 w26EIjHH016090; Tue, 6 Mar 2018 14:18:45 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26EIjZB016089; Tue, 6 Mar 2018 14:18:45 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201803061418.w26EIjZB016089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 6 Mar 2018 14:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330538 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 330538 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:18:46 -0000 Author: jtl Date: Tue Mar 6 14:18:45 2018 New Revision: 330538 URL: https://svnweb.freebsd.org/changeset/base/330538 Log: Nudge lld to break the kernel read-only and read-write sections into separate 2M pages. The binutils default for max-page-size and common-page-size used to produce this result. By setting these values, we can nudge lld to also separate these sections into separate 2M pages. Reviewed by: jhb, kib Discussed with: emaste Sponsored by: Netflix Differential Revision: D14282 Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Mar 6 12:58:00 2018 (r330537) +++ head/sys/conf/kern.pre.mk Tue Mar 6 14:18:45 2018 (r330538) @@ -120,6 +120,10 @@ CFLAGS+= ${CONF_CFLAGS} LDFLAGS+= -Wl,--build-id=sha1 .endif +.if ${MACHINE_CPUARCH} == "amd64" +LDFLAGS+= -Wl,-z max-page-size=2097152 -Wl,-z common-page-size=4096 +.endif + NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC} NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} PROFILE_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC} From owner-svn-src-head@freebsd.org Tue Mar 6 14:28: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 01108F360FE; Tue, 6 Mar 2018 14:28:40 +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 A14B979395; Tue, 6 Mar 2018 14:28:39 +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 93C5D140B2; Tue, 6 Mar 2018 14:28:39 +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 w26ESd1i020940; Tue, 6 Mar 2018 14:28:39 GMT (envelope-from jtl@FreeBSD.org) Received: (from jtl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26EScwJ020926; Tue, 6 Mar 2018 14:28:38 GMT (envelope-from jtl@FreeBSD.org) Message-Id: <201803061428.w26EScwJ020926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jtl set sender to jtl@FreeBSD.org using -f From: "Jonathan T. Looney" Date: Tue, 6 Mar 2018 14:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330539 - in head/sys: amd64/amd64 amd64/include arm/include conf gdb i386/include mips/include powerpc/include sparc64/include X-SVN-Group: head X-SVN-Commit-Author: jtl X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/include arm/include conf gdb i386/include mips/include powerpc/include sparc64/include X-SVN-Commit-Revision: 330539 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:28:40 -0000 Author: jtl Date: Tue Mar 6 14:28:37 2018 New Revision: 330539 URL: https://svnweb.freebsd.org/changeset/base/330539 Log: amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits correctly for the data contained on each memory page. There are several components to this change: * Add a variable to indicate the start of the R/W portion of the initial memory. * Stop detecting NX bit support for each AP. Instead, use the value from the BSP and, if supported, activate the feature on the other APs just before loading the correct page table. (Functionally, we already assume that the BSP and all APs had the same support or lack of support for the NX bit.) * Set the RW and NX bits correctly for the kernel text, data, and BSS (subject to some caveats below). * Ensure DDB can write to memory when necessary (such as to set a breakpoint). * Ensure GDB can write to memory when necessary (such as to set a breakpoint). For this purpose, add new MD functions gdb_begin_write() and gdb_end_write() which the GDB support code can call before and after writing to memory. This change is not comprehensive: * It doesn't do anything to protect modules. * It doesn't do anything for kernel memory allocated after the kernel starts running. * In order to avoid excessive memory inefficiency, it may let multiple types of data share a 2M page, and assigns the most permissions needed for data on that page. Reviewed by: jhb, kib Discussed with: emaste MFC after: 2 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D14282 Modified: head/sys/amd64/amd64/db_interface.c head/sys/amd64/amd64/gdb_machdep.c head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/mpboot.S head/sys/amd64/amd64/pmap.c head/sys/amd64/include/cpu.h head/sys/amd64/include/gdb_machdep.h head/sys/arm/include/gdb_machdep.h head/sys/conf/ldscript.amd64 head/sys/gdb/gdb_packet.c head/sys/i386/include/gdb_machdep.h head/sys/mips/include/gdb_machdep.h head/sys/powerpc/include/gdb_machdep.h head/sys/sparc64/include/gdb_machdep.h Modified: head/sys/amd64/amd64/db_interface.c ============================================================================== --- head/sys/amd64/amd64/db_interface.c Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/amd64/amd64/db_interface.c Tue Mar 6 14:28:37 2018 (r330539) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include /* @@ -62,6 +65,9 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat /* * Write bytes to kernel address space for debugger. + * We need to disable write protection temporarily so we can write + * things (such as break points) that might be in write-protected + * memory. */ int db_write_bytes(vm_offset_t addr, size_t size, char *data) @@ -69,15 +75,19 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da jmp_buf jb; void *prev_jb; char *dst; + u_long cr0save; int ret; + cr0save = rcr0(); prev_jb = kdb_jmpbuf(jb); ret = setjmp(jb); if (ret == 0) { + load_cr0(cr0save & ~CR0_WP); dst = (char *)addr; while (size-- > 0) *dst++ = *data++; } + load_cr0(cr0save); (void)kdb_jmpbuf(prev_jb); return (ret); } Modified: head/sys/amd64/amd64/gdb_machdep.c ============================================================================== --- head/sys/amd64/amd64/gdb_machdep.c Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/amd64/amd64/gdb_machdep.c Tue Mar 6 14:28:37 2018 (r330539) @@ -36,11 +36,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -121,3 +123,21 @@ gdb_cpu_signal(int type, int code) } return (SIGEMT); } + +void * +gdb_begin_write(void) +{ + u_long cr0save; + + cr0save = rcr0(); + load_cr0(cr0save & ~CR0_WP); + return ((void *)cr0save); +} + +void +gdb_end_write(void *arg) +{ + + load_cr0((u_long)arg); +} + Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/amd64/amd64/initcpu.c Tue Mar 6 14:28:37 2018 (r330539) @@ -218,7 +218,7 @@ initializecpu(void) if (!IS_BSP() && (cpu_stdext_feature & CPUID_STDEXT_SMEP)) cr4 |= CR4_SMEP; load_cr4(cr4); - if ((amd_feature & AMDID_NX) != 0) { + if (IS_BSP() && (amd_feature & AMDID_NX) != 0) { msr = rdmsr(MSR_EFER) | EFER_NXE; wrmsr(MSR_EFER, msr); pg_nx = PG_NX; Modified: head/sys/amd64/amd64/mpboot.S ============================================================================== --- head/sys/amd64/amd64/mpboot.S Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/amd64/amd64/mpboot.S Tue Mar 6 14:28:37 2018 (r330539) @@ -221,15 +221,31 @@ mptramp_end: /* * From here on down is executed in the kernel .text section. - * - * Load a real %cr3 that has all the direct map stuff and switches - * off the 1GB replicated mirror. Load a stack pointer and jump - * into AP startup code in C. */ .text .code64 .p2align 4,0 entry_64: + /* + * If the BSP reported NXE support, enable EFER.NXE for all APs + * prior to loading %cr3. This avoids page faults if the AP + * encounters memory marked with the NX bit prior to detecting and + * enabling NXE support. + */ + movq pg_nx, %rbx + testq %rbx, %rbx + je 1f + movl $MSR_EFER, %ecx + rdmsr + orl $EFER_NXE, %eax + wrmsr + +1: + /* + * Load a real %cr3 that has all the direct map stuff and switches + * off the 1GB replicated mirror. Load a stack pointer and jump + * into AP startup code in C. + */ movq KPML4phys, %rax movq %rax, %cr3 movq bootSTK, %rsp Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/amd64/amd64/pmap.c Tue Mar 6 14:28:37 2018 (r330539) @@ -870,14 +870,64 @@ nkpt_init(vm_paddr_t addr) nkpt = pt_pages; } +/* + * Returns the proper write/execute permission for a physical page that is + * part of the initial boot allocations. + * + * If the page has kernel text, it is marked as read-only. If the page has + * kernel read-only data, it is marked as read-only/not-executable. If the + * page has only read-write data, it is marked as read-write/not-executable. + * If the page is below/above the kernel range, it is marked as read-write. + * + * This function operates on 2M pages, since we map the kernel space that + * way. + * + * Note that this doesn't currently provide any protection for modules. + */ +static inline pt_entry_t +bootaddr_rwx(vm_paddr_t pa) +{ + + /* + * Everything in the same 2M page as the start of the kernel + * should be static. On the other hand, things in the same 2M + * page as the end of the kernel could be read-write/executable, + * as the kernel image is not guaranteed to end on a 2M boundary. + */ + if (pa < trunc_2mpage(btext - KERNBASE) || + pa >= trunc_2mpage(_end - KERNBASE)) + return (X86_PG_RW); + /* + * The linker should ensure that the read-only and read-write + * portions don't share the same 2M page, so this shouldn't + * impact read-only data. However, in any case, any page with + * read-write data needs to be read-write. + */ + if (pa >= trunc_2mpage(brwsection - KERNBASE)) + return (X86_PG_RW | pg_nx); + /* + * Mark any 2M page containing kernel text as read-only. Mark + * other pages with read-only data as read-only and not executable. + * (It is likely a small portion of the read-only data section will + * be marked as read-only, but executable. This should be acceptable + * since the read-only protection will keep the data from changing.) + * Note that fixups to the .text section will still work until we + * set CR0.WP. + */ + if (pa < round_2mpage(etext - KERNBASE)) + return (0); + return (pg_nx); +} + static void create_pagetables(vm_paddr_t *firstaddr) { - int i, j, ndm1g, nkpdpe; + int i, j, ndm1g, nkpdpe, nkdmpde; pt_entry_t *pt_p; pd_entry_t *pd_p; pdp_entry_t *pdp_p; pml4_entry_t *p4_p; + uint64_t DMPDkernphys; /* Allocate page table pages for the direct map */ ndmpdp = howmany(ptoa(Maxmem), NBPDP); @@ -896,8 +946,20 @@ create_pagetables(vm_paddr_t *firstaddr) } DMPDPphys = allocpages(firstaddr, ndmpdpphys); ndm1g = 0; - if ((amd_feature & AMDID_PAGE1GB) != 0) + if ((amd_feature & AMDID_PAGE1GB) != 0) { + /* + * Calculate the number of 1G pages that will fully fit in + * Maxmem. + */ ndm1g = ptoa(Maxmem) >> PDPSHIFT; + + /* + * Allocate 2M pages for the kernel. These will be used in + * place of the first one or more 1G pages from ndm1g. + */ + nkdmpde = howmany((vm_offset_t)(brwsection - KERNBASE), NBPDP); + DMPDkernphys = allocpages(firstaddr, nkdmpde); + } if (ndm1g < ndmpdp) DMPDphys = allocpages(firstaddr, ndmpdp - ndm1g); dmaplimit = (vm_paddr_t)ndmpdp << PDPSHIFT; @@ -923,11 +985,10 @@ create_pagetables(vm_paddr_t *firstaddr) KPDphys = allocpages(firstaddr, nkpdpe); /* Fill in the underlying page table pages */ - /* Nominally read-only (but really R/W) from zero to physfree */ /* XXX not fully used, underneath 2M pages */ pt_p = (pt_entry_t *)KPTphys; for (i = 0; ptoa(i) < *firstaddr; i++) - pt_p[i] = ptoa(i) | X86_PG_RW | X86_PG_V | pg_g; + pt_p[i] = ptoa(i) | X86_PG_V | pg_g | bootaddr_rwx(ptoa(i)); /* Now map the page tables at their location within PTmap */ pd_p = (pd_entry_t *)KPDphys; @@ -937,8 +998,8 @@ create_pagetables(vm_paddr_t *firstaddr) /* Map from zero to end of allocations under 2M pages */ /* This replaces some of the KPTphys entries above */ for (i = 0; (i << PDRSHIFT) < *firstaddr; i++) - pd_p[i] = (i << PDRSHIFT) | X86_PG_RW | X86_PG_V | PG_PS | - pg_g; + pd_p[i] = (i << PDRSHIFT) | X86_PG_V | PG_PS | pg_g | + bootaddr_rwx(i << PDRSHIFT); /* * Because we map the physical blocks in 2M pages, adjust firstaddr @@ -978,6 +1039,22 @@ create_pagetables(vm_paddr_t *firstaddr) for (j = 0; i < ndmpdp; i++, j++) { pdp_p[i] = DMPDphys + ptoa(j); pdp_p[i] |= X86_PG_RW | X86_PG_V | PG_U; + } + + /* + * Instead of using a 1G page for the memory containing the kernel, + * use 2M pages with appropriate permissions. (If using 1G pages, + * this will partially overwrite the PDPEs above.) + */ + if (ndm1g) { + pd_p = (pd_entry_t *)DMPDkernphys; + for (i = 0; i < (NPDEPG * nkdmpde); i++) + pd_p[i] = (i << PDRSHIFT) | X86_PG_V | PG_PS | pg_g | + X86_PG_M | X86_PG_A | pg_nx | + bootaddr_rwx(i << PDRSHIFT); + for (i = 0; i < nkdmpde; i++) + pdp_p[i] = (DMPDkernphys + ptoa(i)) | X86_PG_RW | + X86_PG_V | PG_U; } /* And recursively map PML4 to itself in order to get PTmap */ Modified: head/sys/amd64/include/cpu.h ============================================================================== --- head/sys/amd64/include/cpu.h Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/amd64/include/cpu.h Tue Mar 6 14:28:37 2018 (r330539) @@ -68,7 +68,9 @@ struct cpu_ops { }; extern struct cpu_ops cpu_ops; +extern char brwsection[]; extern char btext[]; +extern char _end[]; extern char etext[]; /* Resume hook for VMM. */ Modified: head/sys/amd64/include/gdb_machdep.h ============================================================================== --- head/sys/amd64/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/amd64/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) @@ -47,8 +47,10 @@ gdb_cpu_query(void) return (0); } +void *gdb_begin_write(void); void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); +void gdb_end_write(void *); #endif /* !_MACHINE_GDB_MACHDEP_H_ */ Modified: head/sys/arm/include/gdb_machdep.h ============================================================================== --- head/sys/arm/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/arm/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) @@ -47,6 +47,19 @@ gdb_cpu_query(void) return (0); } +static __inline void * +gdb_begin_write(void) +{ + + return (NULL); +} + +static __inline void +gdb_end_write(void *arg __unused) +{ + +} + void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); Modified: head/sys/conf/ldscript.amd64 ============================================================================== --- head/sys/conf/ldscript.amd64 Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/conf/ldscript.amd64 Tue Mar 6 14:28:37 2018 (r330539) @@ -80,6 +80,7 @@ SECTIONS /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); + PROVIDE (brwsection = .); /* Exception handling */ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } Modified: head/sys/gdb/gdb_packet.c ============================================================================== --- head/sys/gdb/gdb_packet.c Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/gdb/gdb_packet.c Tue Mar 6 14:28:37 2018 (r330539) @@ -147,6 +147,7 @@ gdb_rx_mem(unsigned char *addr, size_t size) { unsigned char *p; void *prev; + void *wctx; jmp_buf jb; size_t cnt; int ret; @@ -155,6 +156,7 @@ gdb_rx_mem(unsigned char *addr, size_t size) if (size * 2 != gdb_rxsz) return (-1); + wctx = gdb_begin_write(); prev = kdb_jmpbuf(jb); ret = setjmp(jb); if (ret == 0) { @@ -170,6 +172,7 @@ gdb_rx_mem(unsigned char *addr, size_t size) kdb_cpu_sync_icache(addr, size); } (void)kdb_jmpbuf(prev); + gdb_end_write(wctx); return ((ret == 0) ? 1 : 0); } Modified: head/sys/i386/include/gdb_machdep.h ============================================================================== --- head/sys/i386/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/i386/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) @@ -47,6 +47,19 @@ gdb_cpu_query(void) return (0); } +static __inline void * +gdb_begin_write(void) +{ + + return (NULL); +} + +static __inline void +gdb_end_write(void *arg __unused) +{ + +} + void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); Modified: head/sys/mips/include/gdb_machdep.h ============================================================================== --- head/sys/mips/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/mips/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) @@ -51,6 +51,19 @@ gdb_cpu_query(void) return (0); } +static __inline void * +gdb_begin_write(void) +{ + + return (NULL); +} + +static __inline void +gdb_end_write(void *arg __unused) +{ + +} + void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); Modified: head/sys/powerpc/include/gdb_machdep.h ============================================================================== --- head/sys/powerpc/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/powerpc/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) @@ -76,6 +76,19 @@ gdb_cpu_query(void) return (0); } +static __inline void * +gdb_begin_write(void) +{ + + return (NULL); +} + +static __inline void +gdb_end_write(void *arg __unused) +{ + +} + void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); int gdb_cpu_signal(int, int); Modified: head/sys/sparc64/include/gdb_machdep.h ============================================================================== --- head/sys/sparc64/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) +++ head/sys/sparc64/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) @@ -53,6 +53,19 @@ gdb_cpu_signal(int vector, int _) return (vector); } +static __inline void * +gdb_begin_write(void) +{ + + return (NULL); +} + +static __inline void +gdb_end_write(void *arg __unused) +{ + +} + void *gdb_cpu_getreg(int, size_t *); void gdb_cpu_setreg(int, void *); From owner-svn-src-head@freebsd.org Tue Mar 6 14:31: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 D5280F363B5; Tue, 6 Mar 2018 14:31:15 +0000 (UTC) (envelope-from rodrigo@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 832E3795EC; Tue, 6 Mar 2018 14:31:15 +0000 (UTC) (envelope-from rodrigo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7E229141DE; Tue, 6 Mar 2018 14:31:15 +0000 (UTC) (envelope-from rodrigo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w26EVFpd021094; Tue, 6 Mar 2018 14:31:15 GMT (envelope-from rodrigo@FreeBSD.org) Received: (from rodrigo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26EVF5u021093; Tue, 6 Mar 2018 14:31:15 GMT (envelope-from rodrigo@FreeBSD.org) Message-Id: <201803061431.w26EVF5u021093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigo set sender to rodrigo@FreeBSD.org using -f From: Rodrigo Osorio Date: Tue, 6 Mar 2018 14:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330540 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: rodrigo X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 330540 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:31:16 -0000 Author: rodrigo (ports committer) Date: Tue Mar 6 14:31:15 2018 New Revision: 330540 URL: https://svnweb.freebsd.org/changeset/base/330540 Log: Update the diskless manpage According with /etc/rc.initdiskless the default mfs allocation is now 5Mb (10240 x 512 bytes sectors) Submitted by: rodrigo Reviewed by: bcr Approved by: manpages (bcr) Differential Revision: https://reviews.freebsd.org/D14592 Modified: head/share/man/man8/diskless.8 Modified: head/share/man/man8/diskless.8 ============================================================================== --- head/share/man/man8/diskless.8 Tue Mar 6 14:28:37 2018 (r330539) +++ head/share/man/man8/diskless.8 Tue Mar 6 14:31:15 2018 (r330540) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2011 +.Dd March 6, 2018 .Dt DISKLESS 8 .Os .Sh NAME @@ -311,7 +311,7 @@ The .Nm scripts create memory file systems to hold the overridden directories. -Only a 2MB partition is created by default, which may not +Only a 5MB partition is created by default, which may not be sufficient for your purposes. To override this, you can create the file From owner-svn-src-head@freebsd.org Tue Mar 6 15:00: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 8EAECF384CB; Tue, 6 Mar 2018 15:00:22 +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 D35B97A6DE; Tue, 6 Mar 2018 15:00:21 +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 w26F0I5a049324; Tue, 6 Mar 2018 07:00:19 -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 w26F0INX049323; Tue, 6 Mar 2018 07:00:18 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803061500.w26F0INX049323@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330540 - head/share/man/man8 In-Reply-To: <201803061431.w26EVF5u021093@repo.freebsd.org> To: Rodrigo Osorio Date: Tue, 6 Mar 2018 07:00:18 -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 Mar 2018 15:00:22 -0000 > Author: rodrigo (ports committer) > Date: Tue Mar 6 14:31:15 2018 > New Revision: 330540 > URL: https://svnweb.freebsd.org/changeset/base/330540 > > Log: > Update the diskless manpage > > According with /etc/rc.initdiskless the default mfs allocation > is now 5Mb (10240 x 512 bytes sectors) > > Submitted by: rodrigo > Reviewed by: bcr > Approved by: manpages (bcr) > Differential Revision: https://reviews.freebsd.org/D14592 Thank you for fixing the man page, if someone wants to do some additional related cleanup in the /etc/rc.initdiskless script that would be great. One issue is we have "one size fits all" for the md files default size of 5MB, which is for all practical puposes too small. IIRC you need at least 8MB to hold what is in a 11.1 var.cpio.gz file, and possibly more for ^head. It would be nice to have the size of /var and /etc set seperatly with resonable defaults. At present my diskless environment over rides both of these with md_size files in the ./conf directory. There may be some lingering comments about 4MB, but I am looking at 11.1 /etc right now. > Modified: > head/share/man/man8/diskless.8 > > Modified: head/share/man/man8/diskless.8 > ============================================================================== > --- head/share/man/man8/diskless.8 Tue Mar 6 14:28:37 2018 (r330539) > +++ head/share/man/man8/diskless.8 Tue Mar 6 14:31:15 2018 (r330540) > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 7, 2011 > +.Dd March 6, 2018 > .Dt DISKLESS 8 > .Os > .Sh NAME > @@ -311,7 +311,7 @@ The > .Nm > scripts create memory file systems to hold the overridden > directories. > -Only a 2MB partition is created by default, which may not > +Only a 5MB partition is created by default, which may not > be sufficient for your purposes. > To override this, you can create the > file > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Mar 6 15: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 07365F3CD04; Tue, 6 Mar 2018 15:52:00 +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 ADBA97C91A; Tue, 6 Mar 2018 15:51:59 +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 A8B0414EF8; Tue, 6 Mar 2018 15:51:59 +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 w26FpxMi065414; Tue, 6 Mar 2018 15:51:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26FpxXj065413; Tue, 6 Mar 2018 15:51:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201803061551.w26FpxXj065413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 6 Mar 2018 15:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330541 - head/sys/cddl/dev/fbt/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/dev/fbt/x86 X-SVN-Commit-Revision: 330541 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:52:00 -0000 Author: markj Date: Tue Mar 6 15:51:59 2018 New Revision: 330541 URL: https://svnweb.freebsd.org/changeset/base/330541 Log: Unbreak amd64 FBT after r330539. X-MFC with: r330539 Modified: head/sys/cddl/dev/fbt/x86/fbt_isa.c Modified: head/sys/cddl/dev/fbt/x86/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/x86/fbt_isa.c Tue Mar 6 14:31:15 2018 (r330540) +++ head/sys/cddl/dev/fbt/x86/fbt_isa.c Tue Mar 6 15:51:59 2018 (r330541) @@ -34,6 +34,8 @@ #include +#include + #include "fbt.h" #define FBT_PUSHL_EBP 0x55 @@ -143,8 +145,15 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uin void fbt_patch_tracepoint(fbt_probe_t *fbt, fbt_patchval_t val) { + u_long cr0save; + register_t intr; + intr = intr_disable(); + cr0save = rcr0(); + load_cr0(cr0save & ~CR0_WP); *fbt->fbtp_patchpoint = val; + load_cr0(cr0save); + intr_restore(intr); } int From owner-svn-src-head@freebsd.org Tue Mar 6 15:52: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 000F3F3CFF2; Tue, 6 Mar 2018 15:52:43 +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 A6E137CAE2; Tue, 6 Mar 2018 15:52:43 +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 A1C7C14F26; Tue, 6 Mar 2018 15:52:43 +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 w26FqhXI065482; Tue, 6 Mar 2018 15:52:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26Fqhxw065480; Tue, 6 Mar 2018 15:52:43 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803061552.w26Fqhxw065480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 6 Mar 2018 15:52:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330542 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 330542 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:52:44 -0000 Author: nwhitehorn Date: Tue Mar 6 15:52:43 2018 New Revision: 330542 URL: https://svnweb.freebsd.org/changeset/base/330542 Log: Fix use of unitialized variables. Modified: head/sys/powerpc/powernv/opal_pci.c head/sys/powerpc/powernv/platform_powernv.c Modified: head/sys/powerpc/powernv/opal_pci.c ============================================================================== --- head/sys/powerpc/powernv/opal_pci.c Tue Mar 6 15:51:59 2018 (r330541) +++ head/sys/powerpc/powernv/opal_pci.c Tue Mar 6 15:52:43 2018 (r330542) @@ -429,6 +429,7 @@ opalpci_read_config(device_t dev, u_int bus, u_int slo config_addr, reg, vtophys(&word)); break; default: + error = OPAL_SUCCESS; word = 0xffffffff; } Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Tue Mar 6 15:51:59 2018 (r330541) +++ head/sys/powerpc/powernv/platform_powernv.c Tue Mar 6 15:52:43 2018 (r330542) @@ -127,7 +127,7 @@ powernv_attach(platform_t plat) char buf[255]; pcell_t prop; phandle_t cpu; - int res, len, node, idx; + int res, len, idx; register_t msr; /* Ping OPAL again just to make sure */ @@ -194,7 +194,7 @@ powernv_attach(platform_t plat) * for the encoding of the property. */ - len = OF_getproplen(node, "ibm,segment-page-sizes"); + len = OF_getproplen(cpu, "ibm,segment-page-sizes"); if (len > 0) { /* * We have to use a variable length array on the stack From owner-svn-src-head@freebsd.org Tue Mar 6 18:28: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 8B74FF48F97; Tue, 6 Mar 2018 18:28: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 3D97D83BD6; Tue, 6 Mar 2018 18:28: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 3892A16787; Tue, 6 Mar 2018 18:28: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 w26ISuel040818; Tue, 6 Mar 2018 18:28:56 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26ISuEL040817; Tue, 6 Mar 2018 18:28:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803061828.w26ISuEL040817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 6 Mar 2018 18:28:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330545 - 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: 330545 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:28:56 -0000 Author: brooks Date: Tue Mar 6 18:28:55 2018 New Revision: 330545 URL: https://svnweb.freebsd.org/changeset/base/330545 Log: Remove reference to unimplemented fuiword, etc. We don't support Harvard architectures. Modified: head/sys/mips/mips/support.S Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Tue Mar 6 16:16:30 2018 (r330544) +++ head/sys/mips/mips/support.S Tue Mar 6 18:28:55 2018 (r330545) @@ -281,10 +281,8 @@ LEAF(copyerr) END(copyerr) /* - * {fu,su},{ibyte,isword,iword}, fetch or store a byte, short or word to - * user text space. * {fu,su},{byte,sword,word}, fetch or store a byte, short or word to - * user data space. + * user-space. */ #ifdef __mips_n64 LEAF(fuword64) From owner-svn-src-head@freebsd.org Tue Mar 6 20:31: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 E7C5FF2C726; Tue, 6 Mar 2018 20:31:14 +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 9A6ED68F16; Tue, 6 Mar 2018 20:31:14 +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 9587817B06; Tue, 6 Mar 2018 20:31:14 +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 w26KVE0O001609; Tue, 6 Mar 2018 20:31:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26KVES5001608; Tue, 6 Mar 2018 20:31:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803062031.w26KVES5001608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 6 Mar 2018 20:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330546 - head/sys/dev/atkbdc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/atkbdc X-SVN-Commit-Revision: 330546 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 20:31:15 -0000 Author: cem Date: Tue Mar 6 20:31:14 2018 New Revision: 330546 URL: https://svnweb.freebsd.org/changeset/base/330546 Log: psm(4): Initialize variables before use dxp/dyp could have been used uninitialized in the subsequent debugging log invocation. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/sys/dev/atkbdc/psm.c Modified: head/sys/dev/atkbdc/psm.c ============================================================================== --- head/sys/dev/atkbdc/psm.c Tue Mar 6 18:28:55 2018 (r330545) +++ head/sys/dev/atkbdc/psm.c Tue Mar 6 20:31:14 2018 (r330546) @@ -3781,6 +3781,9 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i if (queue_len < gest->window_min) return; + dyp = -1; + dxp = -1; + /* Is a scrolling action occurring? */ if (!gest->in_taphold && !ms->button && (!gest->in_vscroll || two_finger_scroll)) { From owner-svn-src-head@freebsd.org Tue Mar 6 21:05: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 A4D8BF2F4E0; Tue, 6 Mar 2018 21:05:35 +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 5B0626B6A9; Tue, 6 Mar 2018 21:05:35 +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 5147D18156; Tue, 6 Mar 2018 21:05:35 +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 w26L5ZmR023592; Tue, 6 Mar 2018 21:05:35 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26L5ZAY023591; Tue, 6 Mar 2018 21:05:35 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803062105.w26L5ZAY023591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 6 Mar 2018 21:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330547 - head/etc X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 330547 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 21:05:35 -0000 Author: trasz Date: Tue Mar 6 21:05:34 2018 New Revision: 330547 URL: https://svnweb.freebsd.org/changeset/base/330547 Log: Add example devd.conf(5) entry for notifying init(8) about new USB ttys. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/etc/devd.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Tue Mar 6 20:31:14 2018 (r330546) +++ head/etc/devd.conf Tue Mar 6 21:05:34 2018 (r330547) @@ -339,4 +339,15 @@ notify 10 { action "logger $comm $core"; }; +# Let the init(8) know there's a new USB serial interface it might +# want to run getty(8) for. This includes device-side tty created +# by usb_template(4). +notify 100 { + match "system" "DEVFS"; + match "subsystem" "CDEV"; + match "type" "CREATE"; + match "cdev" "ttyU[0-9]+"; + action "/sbin/init q"; +}; + */ From owner-svn-src-head@freebsd.org Tue Mar 6 22:45: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 AD9A8F3656E; Tue, 6 Mar 2018 22:45:45 +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 620F96F78C; Tue, 6 Mar 2018 22:45:45 +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 5D18419160; Tue, 6 Mar 2018 22:45:45 +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 w26MjjSj073835; Tue, 6 Mar 2018 22:45:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26MjjJK073834; Tue, 6 Mar 2018 22:45:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803062245.w26MjjJK073834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 6 Mar 2018 22:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330554 - 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: 330554 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:45:45 -0000 Author: kevans Date: Tue Mar 6 22:45:45 2018 New Revision: 330554 URL: https://svnweb.freebsd.org/changeset/base/330554 Log: aw_usbphy: Move later to SUPPORTDEV pass vbus-supply properties may be specified for each PHY. These properties reference a regulator that we must turn on/off as we turn the PHY on/off. However, if the usbphy comes up before the regulator in question (as is the case with GPIO-controlled regulators), then we will fail to grab a handle to the regulator and control it as the PHY power state changes. Fix it by just attaching the usbphy driver later. We don't really need it at RESOURCE, we just need it to be before DEFAULT when ehci/ohci attach. In particular, this fixes the USB NIC on a board that we don't yet supported- without this, it will not power on and if_ure cannot attach. Tested on: various boards [manu] Tested on: OrangePi R1 [Rap2 (irc)] Reported by: Rap2 (irc, "Cannot find USB NIC") Modified: head/sys/arm/allwinner/aw_usbphy.c Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Tue Mar 6 21:45:23 2018 (r330553) +++ head/sys/arm/allwinner/aw_usbphy.c Tue Mar 6 22:45:45 2018 (r330554) @@ -418,7 +418,7 @@ static driver_t awusbphy_driver = { }; static devclass_t awusbphy_devclass; - +/* aw_usbphy needs to come up after regulators/gpio/etc, but before ehci/ohci */ EARLY_DRIVER_MODULE(awusbphy, simplebus, awusbphy_driver, awusbphy_devclass, - 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_SUPPORTDEV + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(awusbphy, 1); From owner-svn-src-head@freebsd.org Tue Mar 6 23: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 1660EF39C6F for ; Tue, 6 Mar 2018 23:31:51 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x244.google.com (mail-yb0-x244.google.com [IPv6:2607:f8b0:4002:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78A09715FE for ; Tue, 6 Mar 2018 23:31:50 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x244.google.com with SMTP id i13-v6so136696ybl.9 for ; Tue, 06 Mar 2018 15:31:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7A+l66mbrwCKtXfSJB9PzivkIlTP8kNjEOBqDvum8z4=; b=mMMDH90o1zxq4cujTehpFsTIsqkdeV6Z9A19XTaMB5c/3lmU8jYOaxKXJitb0TKv6k GDgK7b8qGsm0MgBrdzbux34GkmMIY341FcWo9/kWgO/XoOPkqICkko8npcd0d5ewyLPj LE+tRBb1CwCN0AacooGoyAQw883wBdLAeRg589io8xSbwkgq4QDQ61rlNbNdL/EmdeQy 9vlRaqsoYFyMLht509UdSvl+HjjxD8ipVJxPA1b9Dfz2YWO5kYySlgN8BqU0Oes+i6i5 ZX5PBPQUxj2R7g7AScBR+aytoBLqc73qfMRGtlswULve82k6XCuDg2Pcdi78Ubvh6wGx jUQA== 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=7A+l66mbrwCKtXfSJB9PzivkIlTP8kNjEOBqDvum8z4=; b=rX4z4v8tDjKqD0XCF01ZkySY/PhwN+uYX6uaG048LdTh4Ta7oQNTNXxQ3bOC6piuo0 iMN7xK4m/bXdcIhtAbRwU9IJDucIfyJ1KHCh6ywSFkmN8rYlcJiWwYJCH9TGXMOyCrL7 7AFdLFY16OsZOuinEtpQLCZvf4aAXFi9k4d8HByT+hATsQYqCtTfBfuAxaV8zlH4TBA/ HAondioVgniHWjDWiHYfLPjEPYN8bIKLMviNAOcCBivXQOzwDeEOrTWtAUQ0D3aRYseT /adM+wiVfWnHfGjCg7lssIgsqXwKRQhHIxLCL2OkAf5gfloEadJCJ9p4wCCGW+sYF0Z3 iyeg== X-Gm-Message-State: AElRT7GrlAyxjfae8Oj2WbFQDfKkUswYDLRqHp/qJPsVJbmVwpOC0U3l TapUyJm7piF3cLpB3+XhXJeswYAmZqGwRNTN6FkgiA== X-Google-Smtp-Source: AG47ELumSLrf8p8pZ5n0WTxTkeoLTqHFoNcoF2eplnapqZENKcphwyCYfPDOejbZ6c8U7wh4kZXMoreDbp7JVX40d8E= X-Received: by 2002:a25:6150:: with SMTP id v77-v6mr3250701ybb.331.1520379109005; Tue, 06 Mar 2018 15:31:49 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:5f41:0:0:0:0:0 with HTTP; Tue, 6 Mar 2018 15:31:48 -0800 (PST) In-Reply-To: <201803061428.w26EScwJ020926@repo.freebsd.org> References: <201803061428.w26EScwJ020926@repo.freebsd.org> From: Oliver Pinter Date: Wed, 7 Mar 2018 00:31:48 +0100 Message-ID: Subject: Re: svn commit: r330539 - in head/sys: amd64/amd64 amd64/include arm/include conf gdb i386/include mips/include powerpc/include sparc64/include To: "Jonathan T. Looney" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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 Mar 2018 23:31:51 -0000 X-MFC-with: commit 27ac811b7acd31b1bdbf959fe49a957cdeabf780 Author: bde Date: Fri Mar 24 17:34:55 2017 +0000 Remove buggy adjustment of page tables in db_write_bytes(). Long ago, perhaps only on i386, kernel text was mapped read-only and it was necessary to change the mapping to read-write to set breakpoints in kernel text. Other writes by ddb to kernel text were also allowed. This write protection is harder to implement with 4MB pages, and was lost even for 4K pages when 4MB pages were implemented. So changing the mapping became useless. It was actually worse than useless since it followed followed various null and otherwise garbage pointers to not change random memory instead of the mapping. (On i386s, the pointers became good in pmap_bootstrap(), and on amd64 the pointers became bad in pmap_bootstrap() if not before.) Another bug broke detection of following of null pointers on i386, except early in boot where not detecting this was a feature. When I fixed the bug, I accidentally broke the feature and soon got traps in db_write_bytes(). Setting breakpoints early in ddb was broken. kib pointed out that a clean way to do the adjustment would be to use a special [sub]map giving a small window on the bytes to be written. The trap handler didn't know how to fix up errors for pagefaults accessing the map itself. Such errors rarely need fixups, since most traps for the map are for the first access which is a read. Reviewed by: kib Notes: svn path=/head/; revision=315914 On 3/6/18, Jonathan T. Looney wrote: > Author: jtl > Date: Tue Mar 6 14:28:37 2018 > New Revision: 330539 > URL: https://svnweb.freebsd.org/changeset/base/330539 > > Log: > amd64: Protect the kernel text, data, and BSS by setting the RW/NX bits > correctly for the data contained on each memory page. > > There are several components to this change: > * Add a variable to indicate the start of the R/W portion of the > initial memory. > * Stop detecting NX bit support for each AP. Instead, use the value > from the BSP and, if supported, activate the feature on the other > APs just before loading the correct page table. (Functionally, we > already assume that the BSP and all APs had the same support or > lack of support for the NX bit.) > * Set the RW and NX bits correctly for the kernel text, data, and > BSS (subject to some caveats below). > * Ensure DDB can write to memory when necessary (such as to set a > breakpoint). > * Ensure GDB can write to memory when necessary (such as to set a > breakpoint). For this purpose, add new MD functions gdb_begin_write() > and gdb_end_write() which the GDB support code can call before and > after writing to memory. > > This change is not comprehensive: > * It doesn't do anything to protect modules. > * It doesn't do anything for kernel memory allocated after the kernel > starts running. > * In order to avoid excessive memory inefficiency, it may let multiple > types of data share a 2M page, and assigns the most permissions > needed for data on that page. > > Reviewed by: jhb, kib > Discussed with: emaste > MFC after: 2 weeks > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D14282 > > Modified: > head/sys/amd64/amd64/db_interface.c > head/sys/amd64/amd64/gdb_machdep.c > head/sys/amd64/amd64/initcpu.c > head/sys/amd64/amd64/mpboot.S > head/sys/amd64/amd64/pmap.c > head/sys/amd64/include/cpu.h > head/sys/amd64/include/gdb_machdep.h > head/sys/arm/include/gdb_machdep.h > head/sys/conf/ldscript.amd64 > head/sys/gdb/gdb_packet.c > head/sys/i386/include/gdb_machdep.h > head/sys/mips/include/gdb_machdep.h > head/sys/powerpc/include/gdb_machdep.h > head/sys/sparc64/include/gdb_machdep.h > > Modified: head/sys/amd64/amd64/db_interface.c > ============================================================================== > --- head/sys/amd64/amd64/db_interface.c Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/amd64/amd64/db_interface.c Tue Mar 6 14:28:37 2018 (r330539) > @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > +#include > + > #include > > /* > @@ -62,6 +65,9 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat > > /* > * Write bytes to kernel address space for debugger. > + * We need to disable write protection temporarily so we can write > + * things (such as break points) that might be in write-protected > + * memory. > */ > int > db_write_bytes(vm_offset_t addr, size_t size, char *data) > @@ -69,15 +75,19 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da > jmp_buf jb; > void *prev_jb; > char *dst; > + u_long cr0save; > int ret; > > + cr0save = rcr0(); > prev_jb = kdb_jmpbuf(jb); > ret = setjmp(jb); > if (ret == 0) { > + load_cr0(cr0save & ~CR0_WP); > dst = (char *)addr; > while (size-- > 0) > *dst++ = *data++; > } > + load_cr0(cr0save); > (void)kdb_jmpbuf(prev_jb); > return (ret); > } > > Modified: head/sys/amd64/amd64/gdb_machdep.c > ============================================================================== > --- head/sys/amd64/amd64/gdb_machdep.c Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/amd64/amd64/gdb_machdep.c Tue Mar 6 14:28:37 2018 (r330539) > @@ -36,11 +36,13 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include > #include > #include > #include > #include > #include > +#include > #include > #include > #include > @@ -121,3 +123,21 @@ gdb_cpu_signal(int type, int code) > } > return (SIGEMT); > } > + > +void * > +gdb_begin_write(void) > +{ > + u_long cr0save; > + > + cr0save = rcr0(); > + load_cr0(cr0save & ~CR0_WP); > + return ((void *)cr0save); > +} > + > +void > +gdb_end_write(void *arg) > +{ > + > + load_cr0((u_long)arg); > +} > + > > Modified: head/sys/amd64/amd64/initcpu.c > ============================================================================== > --- head/sys/amd64/amd64/initcpu.c Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/amd64/amd64/initcpu.c Tue Mar 6 14:28:37 2018 (r330539) > @@ -218,7 +218,7 @@ initializecpu(void) > if (!IS_BSP() && (cpu_stdext_feature & CPUID_STDEXT_SMEP)) > cr4 |= CR4_SMEP; > load_cr4(cr4); > - if ((amd_feature & AMDID_NX) != 0) { > + if (IS_BSP() && (amd_feature & AMDID_NX) != 0) { > msr = rdmsr(MSR_EFER) | EFER_NXE; > wrmsr(MSR_EFER, msr); > pg_nx = PG_NX; > > Modified: head/sys/amd64/amd64/mpboot.S > ============================================================================== > --- head/sys/amd64/amd64/mpboot.S Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/amd64/amd64/mpboot.S Tue Mar 6 14:28:37 2018 (r330539) > @@ -221,15 +221,31 @@ mptramp_end: > > /* > * From here on down is executed in the kernel .text section. > - * > - * Load a real %cr3 that has all the direct map stuff and switches > - * off the 1GB replicated mirror. Load a stack pointer and jump > - * into AP startup code in C. > */ > .text > .code64 > .p2align 4,0 > entry_64: > + /* > + * If the BSP reported NXE support, enable EFER.NXE for all APs > + * prior to loading %cr3. This avoids page faults if the AP > + * encounters memory marked with the NX bit prior to detecting and > + * enabling NXE support. > + */ > + movq pg_nx, %rbx > + testq %rbx, %rbx > + je 1f > + movl $MSR_EFER, %ecx > + rdmsr > + orl $EFER_NXE, %eax > + wrmsr > + > +1: > + /* > + * Load a real %cr3 that has all the direct map stuff and switches > + * off the 1GB replicated mirror. Load a stack pointer and jump > + * into AP startup code in C. > + */ > movq KPML4phys, %rax > movq %rax, %cr3 > movq bootSTK, %rsp > > Modified: head/sys/amd64/amd64/pmap.c > ============================================================================== > --- head/sys/amd64/amd64/pmap.c Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/amd64/amd64/pmap.c Tue Mar 6 14:28:37 2018 (r330539) > @@ -870,14 +870,64 @@ nkpt_init(vm_paddr_t addr) > nkpt = pt_pages; > } > > +/* > + * Returns the proper write/execute permission for a physical page that is > + * part of the initial boot allocations. > + * > + * If the page has kernel text, it is marked as read-only. If the page has > + * kernel read-only data, it is marked as read-only/not-executable. If the > + * page has only read-write data, it is marked as > read-write/not-executable. > + * If the page is below/above the kernel range, it is marked as > read-write. > + * > + * This function operates on 2M pages, since we map the kernel space that > + * way. > + * > + * Note that this doesn't currently provide any protection for modules. > + */ > +static inline pt_entry_t > +bootaddr_rwx(vm_paddr_t pa) > +{ > + > + /* > + * Everything in the same 2M page as the start of the kernel > + * should be static. On the other hand, things in the same 2M > + * page as the end of the kernel could be read-write/executable, > + * as the kernel image is not guaranteed to end on a 2M boundary. > + */ > + if (pa < trunc_2mpage(btext - KERNBASE) || > + pa >= trunc_2mpage(_end - KERNBASE)) > + return (X86_PG_RW); > + /* > + * The linker should ensure that the read-only and read-write > + * portions don't share the same 2M page, so this shouldn't > + * impact read-only data. However, in any case, any page with > + * read-write data needs to be read-write. > + */ > + if (pa >= trunc_2mpage(brwsection - KERNBASE)) > + return (X86_PG_RW | pg_nx); > + /* > + * Mark any 2M page containing kernel text as read-only. Mark > + * other pages with read-only data as read-only and not executable. > + * (It is likely a small portion of the read-only data section will > + * be marked as read-only, but executable. This should be acceptable > + * since the read-only protection will keep the data from changing.) > + * Note that fixups to the .text section will still work until we > + * set CR0.WP. > + */ > + if (pa < round_2mpage(etext - KERNBASE)) > + return (0); > + return (pg_nx); > +} > + > static void > create_pagetables(vm_paddr_t *firstaddr) > { > - int i, j, ndm1g, nkpdpe; > + int i, j, ndm1g, nkpdpe, nkdmpde; > pt_entry_t *pt_p; > pd_entry_t *pd_p; > pdp_entry_t *pdp_p; > pml4_entry_t *p4_p; > + uint64_t DMPDkernphys; > > /* Allocate page table pages for the direct map */ > ndmpdp = howmany(ptoa(Maxmem), NBPDP); > @@ -896,8 +946,20 @@ create_pagetables(vm_paddr_t *firstaddr) > } > DMPDPphys = allocpages(firstaddr, ndmpdpphys); > ndm1g = 0; > - if ((amd_feature & AMDID_PAGE1GB) != 0) > + if ((amd_feature & AMDID_PAGE1GB) != 0) { > + /* > + * Calculate the number of 1G pages that will fully fit in > + * Maxmem. > + */ > ndm1g = ptoa(Maxmem) >> PDPSHIFT; > + > + /* > + * Allocate 2M pages for the kernel. These will be used in > + * place of the first one or more 1G pages from ndm1g. > + */ > + nkdmpde = howmany((vm_offset_t)(brwsection - KERNBASE), NBPDP); > + DMPDkernphys = allocpages(firstaddr, nkdmpde); > + } > if (ndm1g < ndmpdp) > DMPDphys = allocpages(firstaddr, ndmpdp - ndm1g); > dmaplimit = (vm_paddr_t)ndmpdp << PDPSHIFT; > @@ -923,11 +985,10 @@ create_pagetables(vm_paddr_t *firstaddr) > KPDphys = allocpages(firstaddr, nkpdpe); > > /* Fill in the underlying page table pages */ > - /* Nominally read-only (but really R/W) from zero to physfree */ > /* XXX not fully used, underneath 2M pages */ > pt_p = (pt_entry_t *)KPTphys; > for (i = 0; ptoa(i) < *firstaddr; i++) > - pt_p[i] = ptoa(i) | X86_PG_RW | X86_PG_V | pg_g; > + pt_p[i] = ptoa(i) | X86_PG_V | pg_g | bootaddr_rwx(ptoa(i)); > > /* Now map the page tables at their location within PTmap */ > pd_p = (pd_entry_t *)KPDphys; > @@ -937,8 +998,8 @@ create_pagetables(vm_paddr_t *firstaddr) > /* Map from zero to end of allocations under 2M pages */ > /* This replaces some of the KPTphys entries above */ > for (i = 0; (i << PDRSHIFT) < *firstaddr; i++) > - pd_p[i] = (i << PDRSHIFT) | X86_PG_RW | X86_PG_V | PG_PS | > - pg_g; > + pd_p[i] = (i << PDRSHIFT) | X86_PG_V | PG_PS | pg_g | > + bootaddr_rwx(i << PDRSHIFT); > > /* > * Because we map the physical blocks in 2M pages, adjust firstaddr > @@ -978,6 +1039,22 @@ create_pagetables(vm_paddr_t *firstaddr) > for (j = 0; i < ndmpdp; i++, j++) { > pdp_p[i] = DMPDphys + ptoa(j); > pdp_p[i] |= X86_PG_RW | X86_PG_V | PG_U; > + } > + > + /* > + * Instead of using a 1G page for the memory containing the kernel, > + * use 2M pages with appropriate permissions. (If using 1G pages, > + * this will partially overwrite the PDPEs above.) > + */ > + if (ndm1g) { > + pd_p = (pd_entry_t *)DMPDkernphys; > + for (i = 0; i < (NPDEPG * nkdmpde); i++) > + pd_p[i] = (i << PDRSHIFT) | X86_PG_V | PG_PS | pg_g | > + X86_PG_M | X86_PG_A | pg_nx | > + bootaddr_rwx(i << PDRSHIFT); > + for (i = 0; i < nkdmpde; i++) > + pdp_p[i] = (DMPDkernphys + ptoa(i)) | X86_PG_RW | > + X86_PG_V | PG_U; > } > > /* And recursively map PML4 to itself in order to get PTmap */ > > Modified: head/sys/amd64/include/cpu.h > ============================================================================== > --- head/sys/amd64/include/cpu.h Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/amd64/include/cpu.h Tue Mar 6 14:28:37 2018 (r330539) > @@ -68,7 +68,9 @@ struct cpu_ops { > }; > > extern struct cpu_ops cpu_ops; > +extern char brwsection[]; > extern char btext[]; > +extern char _end[]; > extern char etext[]; > > /* Resume hook for VMM. */ > > Modified: head/sys/amd64/include/gdb_machdep.h > ============================================================================== > --- head/sys/amd64/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/amd64/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) > @@ -47,8 +47,10 @@ gdb_cpu_query(void) > return (0); > } > > +void *gdb_begin_write(void); > void *gdb_cpu_getreg(int, size_t *); > void gdb_cpu_setreg(int, void *); > int gdb_cpu_signal(int, int); > +void gdb_end_write(void *); > > #endif /* !_MACHINE_GDB_MACHDEP_H_ */ > > Modified: head/sys/arm/include/gdb_machdep.h > ============================================================================== > --- head/sys/arm/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/arm/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) > @@ -47,6 +47,19 @@ gdb_cpu_query(void) > return (0); > } > > +static __inline void * > +gdb_begin_write(void) > +{ > + > + return (NULL); > +} > + > +static __inline void > +gdb_end_write(void *arg __unused) > +{ > + > +} > + > void *gdb_cpu_getreg(int, size_t *); > void gdb_cpu_setreg(int, void *); > int gdb_cpu_signal(int, int); > > Modified: head/sys/conf/ldscript.amd64 > ============================================================================== > --- head/sys/conf/ldscript.amd64 Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/conf/ldscript.amd64 Tue Mar 6 14:28:37 2018 (r330539) > @@ -80,6 +80,7 @@ SECTIONS > /* Adjust the address for the data segment. We want to adjust up to > the same address within the page on the next page up. */ > . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & > (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT > (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); > + PROVIDE (brwsection = .); > /* Exception handling */ > .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } > .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table > .gcc_except_table.*) } > > Modified: head/sys/gdb/gdb_packet.c > ============================================================================== > --- head/sys/gdb/gdb_packet.c Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/gdb/gdb_packet.c Tue Mar 6 14:28:37 2018 (r330539) > @@ -147,6 +147,7 @@ gdb_rx_mem(unsigned char *addr, size_t size) > { > unsigned char *p; > void *prev; > + void *wctx; > jmp_buf jb; > size_t cnt; > int ret; > @@ -155,6 +156,7 @@ gdb_rx_mem(unsigned char *addr, size_t size) > if (size * 2 != gdb_rxsz) > return (-1); > > + wctx = gdb_begin_write(); > prev = kdb_jmpbuf(jb); > ret = setjmp(jb); > if (ret == 0) { > @@ -170,6 +172,7 @@ gdb_rx_mem(unsigned char *addr, size_t size) > kdb_cpu_sync_icache(addr, size); > } > (void)kdb_jmpbuf(prev); > + gdb_end_write(wctx); > return ((ret == 0) ? 1 : 0); > } > > > Modified: head/sys/i386/include/gdb_machdep.h > ============================================================================== > --- head/sys/i386/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/i386/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) > @@ -47,6 +47,19 @@ gdb_cpu_query(void) > return (0); > } > > +static __inline void * > +gdb_begin_write(void) > +{ > + > + return (NULL); > +} > + > +static __inline void > +gdb_end_write(void *arg __unused) > +{ > + > +} > + > void *gdb_cpu_getreg(int, size_t *); > void gdb_cpu_setreg(int, void *); > int gdb_cpu_signal(int, int); > > Modified: head/sys/mips/include/gdb_machdep.h > ============================================================================== > --- head/sys/mips/include/gdb_machdep.h Tue Mar 6 14:18:45 2018 (r330538) > +++ head/sys/mips/include/gdb_machdep.h Tue Mar 6 14:28:37 2018 (r330539) > @@ -51,6 +51,19 @@ gdb_cpu_query(void) > return (0); > } > > +static __inline void * > +gdb_begin_write(void) > +{ > + > + return (NULL); > +} > + > +static __inline void > +gdb_end_write(void *arg __unused) > +{ > + > +} > + > void *gdb_cpu_getreg(int, size_t *); > void gdb_cpu_setreg(int, void *); > int gdb_cpu_signal(int, int); > > Modified: head/sys/powerpc/include/gdb_machdep.h > ============================================================================== > --- head/sys/powerpc/include/gdb_machdep.h Tue Mar 6 14:18:45 > 2018 (r330538) > +++ head/sys/powerpc/include/gdb_machdep.h Tue Mar 6 14:28:37 > 2018 (r330539) > @@ -76,6 +76,19 @@ gdb_cpu_query(void) > return (0); > } > > +static __inline void * > +gdb_begin_write(void) > +{ > + > + return (NULL); > +} > + > +static __inline void > +gdb_end_write(void *arg __unused) > +{ > + > +} > + > void *gdb_cpu_getreg(int, size_t *); > void gdb_cpu_setreg(int, void *); > int gdb_cpu_signal(int, int); > > Modified: head/sys/sparc64/include/gdb_machdep.h > ============================================================================== > --- head/sys/sparc64/include/gdb_machdep.h Tue Mar 6 14:18:45 > 2018 (r330538) > +++ head/sys/sparc64/include/gdb_machdep.h Tue Mar 6 14:28:37 > 2018 (r330539) > @@ -53,6 +53,19 @@ gdb_cpu_signal(int vector, int _) > return (vector); > } > > +static __inline void * > +gdb_begin_write(void) > +{ > + > + return (NULL); > +} > + > +static __inline void > +gdb_end_write(void *arg __unused) > +{ > + > +} > + > void *gdb_cpu_getreg(int, size_t *); > void gdb_cpu_setreg(int, void *); > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Tue Mar 6 23:39: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 34225F3A44A; Tue, 6 Mar 2018 23:39:49 +0000 (UTC) (envelope-from gonzo@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 178E771C06; Tue, 6 Mar 2018 23:39:47 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D49D3199E0; Tue, 6 Mar 2018 23:39:43 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w26NdhfO098453; Tue, 6 Mar 2018 23:39:43 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26NdhEl098447; Tue, 6 Mar 2018 23:39:43 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201803062339.w26NdhEl098447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2018 23:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330558 - head/sys/dev/ichiic X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/sys/dev/ichiic X-SVN-Commit-Revision: 330558 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 23:39:49 -0000 Author: gonzo Date: Tue Mar 6 23:39:43 2018 New Revision: 330558 URL: https://svnweb.freebsd.org/changeset/base/330558 Log: [ig4] Add support for i2c controllers on Skylake and Kaby Lake This was tested by Ben on HP Chromebook 13 G1 with a Skylake CPU and Sunrise Point-LP I2C controller and by me on Minnowboard Turbot with Atom E3826 (formerly Bay Trail) Submitted by: Ben Pye Reviewed by: gonzo Obtained from: DragonflyBSD (a4549657 by Imre Vadász) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D13654 Modified: head/sys/dev/ichiic/ig4_acpi.c head/sys/dev/ichiic/ig4_iic.c head/sys/dev/ichiic/ig4_pci.c head/sys/dev/ichiic/ig4_reg.h head/sys/dev/ichiic/ig4_var.h Modified: head/sys/dev/ichiic/ig4_acpi.c ============================================================================== --- head/sys/dev/ichiic/ig4_acpi.c Tue Mar 6 23:28:12 2018 (r330557) +++ head/sys/dev/ichiic/ig4_acpi.c Tue Mar 6 23:39:43 2018 (r330558) @@ -85,6 +85,8 @@ ig4iic_acpi_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + /* All the HIDs matched are Atom SOCs. */ + sc->version = IG4_ATOM; sc->regs_rid = 0; sc->regs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->regs_rid, RF_ACTIVE); Modified: head/sys/dev/ichiic/ig4_iic.c ============================================================================== --- head/sys/dev/ichiic/ig4_iic.c Tue Mar 6 23:28:12 2018 (r330557) +++ head/sys/dev/ichiic/ig4_iic.c Tue Mar 6 23:39:43 2018 (r330558) @@ -525,22 +525,38 @@ ig4iic_attach(ig4iic_softc_t *sc) mtx_init(&sc->io_lock, "IG4 I/O lock", NULL, MTX_DEF); sx_init(&sc->call_lock, "IG4 call lock"); - v = reg_read(sc, IG4_REG_COMP_TYPE); - v = reg_read(sc, IG4_REG_COMP_PARAM1); - v = reg_read(sc, IG4_REG_GENERAL); - if ((v & IG4_GENERAL_SWMODE) == 0) { - v |= IG4_GENERAL_SWMODE; - reg_write(sc, IG4_REG_GENERAL, v); + if (sc->version == IG4_ATOM) + v = reg_read(sc, IG4_REG_COMP_TYPE); + + if (sc->version == IG4_HASWELL || sc->version == IG4_ATOM) { + v = reg_read(sc, IG4_REG_COMP_PARAM1); v = reg_read(sc, IG4_REG_GENERAL); + /* + * The content of IG4_REG_GENERAL is different for each + * controller version. + */ + if (sc->version == IG4_HASWELL && + (v & IG4_GENERAL_SWMODE) == 0) { + v |= IG4_GENERAL_SWMODE; + reg_write(sc, IG4_REG_GENERAL, v); + v = reg_read(sc, IG4_REG_GENERAL); + } } - v = reg_read(sc, IG4_REG_SW_LTR_VALUE); - v = reg_read(sc, IG4_REG_AUTO_LTR_VALUE); + if (sc->version == IG4_HASWELL) { + v = reg_read(sc, IG4_REG_SW_LTR_VALUE); + v = reg_read(sc, IG4_REG_AUTO_LTR_VALUE); + } else if (sc->version == IG4_SKYLAKE) { + v = reg_read(sc, IG4_REG_ACTIVE_LTR_VALUE); + v = reg_read(sc, IG4_REG_IDLE_LTR_VALUE); + } - v = reg_read(sc, IG4_REG_COMP_VER); - if (v != IG4_COMP_VER) { - error = ENXIO; - goto done; + if (sc->version == IG4_HASWELL || sc->version == IG4_ATOM) { + v = reg_read(sc, IG4_REG_COMP_VER); + if (v != IG4_COMP_VER) { + error = ENXIO; + goto done; + } } v = reg_read(sc, IG4_REG_SS_SCL_HCNT); v = reg_read(sc, IG4_REG_SS_SCL_LCNT); @@ -591,8 +607,13 @@ ig4iic_attach(ig4iic_softc_t *sc) /* * Don't do this, it blows up the PCI config */ - reg_write(sc, IG4_REG_RESETS, IG4_RESETS_ASSERT); - reg_write(sc, IG4_REG_RESETS, IG4_RESETS_DEASSERT); + if (sc->version == IG4_HASWELL || sc->version == IG4_ATOM) { + reg_write(sc, IG4_REG_RESETS_HSW, IG4_RESETS_ASSERT_HSW); + reg_write(sc, IG4_REG_RESETS_HSW, IG4_RESETS_DEASSERT_HSW); + } else if (sc->version = IG4_SKYLAKE) { + reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_ASSERT_SKL); + reg_write(sc, IG4_REG_RESETS_SKL, IG4_RESETS_DEASSERT_SKL); + } #endif mtx_lock(&sc->io_lock); @@ -727,14 +748,27 @@ ig4iic_dump(ig4iic_softc_t *sc) REGDUMP(sc, IG4_REG_DMA_RDLR); REGDUMP(sc, IG4_REG_SDA_SETUP); REGDUMP(sc, IG4_REG_ENABLE_STATUS); - REGDUMP(sc, IG4_REG_COMP_PARAM1); - REGDUMP(sc, IG4_REG_COMP_VER); - REGDUMP(sc, IG4_REG_COMP_TYPE); - REGDUMP(sc, IG4_REG_CLK_PARMS); - REGDUMP(sc, IG4_REG_RESETS); - REGDUMP(sc, IG4_REG_GENERAL); - REGDUMP(sc, IG4_REG_SW_LTR_VALUE); - REGDUMP(sc, IG4_REG_AUTO_LTR_VALUE); + if (sc->version == IG4_HASWELL || sc->version == IG4_ATOM) { + REGDUMP(sc, IG4_REG_COMP_PARAM1); + REGDUMP(sc, IG4_REG_COMP_VER); + } + if (sc->version == IG4_ATOM) { + REGDUMP(sc, IG4_REG_COMP_TYPE); + REGDUMP(sc, IG4_REG_CLK_PARMS); + } + if (sc->version == IG4_HASWELL || sc->version == IG4_ATOM) { + REGDUMP(sc, IG4_REG_RESETS_HSW); + REGDUMP(sc, IG4_REG_GENERAL); + } else if (sc->version == IG4_SKYLAKE) { + REGDUMP(sc, IG4_REG_RESETS_SKL); + } + if (sc->version == IG4_HASWELL) { + REGDUMP(sc, IG4_REG_SW_LTR_VALUE); + REGDUMP(sc, IG4_REG_AUTO_LTR_VALUE); + } else if (sc->version == IG4_SKYLAKE) { + REGDUMP(sc, IG4_REG_ACTIVE_LTR_VALUE); + REGDUMP(sc, IG4_REG_IDLE_LTR_VALUE); + } } #undef REGDUMP Modified: head/sys/dev/ichiic/ig4_pci.c ============================================================================== --- head/sys/dev/ichiic/ig4_pci.c Tue Mar 6 23:28:12 2018 (r330557) +++ head/sys/dev/ichiic/ig4_pci.c Tue Mar 6 23:39:43 2018 (r330558) @@ -74,34 +74,74 @@ static int ig4iic_pci_detach(device_t dev); #define PCI_CHIP_BRASWELL_I2C_5 0x22c58086 #define PCI_CHIP_BRASWELL_I2C_6 0x22c68086 #define PCI_CHIP_BRASWELL_I2C_7 0x22c78086 +#define PCI_CHIP_SKYLAKE_I2C_0 0x9d608086 +#define PCI_CHIP_SKYLAKE_I2C_1 0x9d618086 +#define PCI_CHIP_SKYLAKE_I2C_2 0x9d628086 +#define PCI_CHIP_SKYLAKE_I2C_3 0x9d638086 +#define PCI_CHIP_SKYLAKE_I2C_4 0x9d648086 +#define PCI_CHIP_SKYLAKE_I2C_5 0x9d658086 static int ig4iic_pci_probe(device_t dev) { + ig4iic_softc_t *sc = device_get_softc(dev); + switch(pci_get_devid(dev)) { case PCI_CHIP_LYNXPT_LP_I2C_1: device_set_desc(dev, "Intel Lynx Point-LP I2C Controller-1"); + sc->version = IG4_HASWELL; break; case PCI_CHIP_LYNXPT_LP_I2C_2: device_set_desc(dev, "Intel Lynx Point-LP I2C Controller-2"); + sc->version = IG4_HASWELL; break; case PCI_CHIP_BRASWELL_I2C_1: device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 1"); + sc->version = IG4_ATOM; break; case PCI_CHIP_BRASWELL_I2C_2: device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 2"); + sc->version = IG4_ATOM; break; case PCI_CHIP_BRASWELL_I2C_3: device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 3"); + sc->version = IG4_ATOM; break; case PCI_CHIP_BRASWELL_I2C_5: device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 5"); + sc->version = IG4_ATOM; break; case PCI_CHIP_BRASWELL_I2C_6: device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 6"); + sc->version = IG4_ATOM; break; case PCI_CHIP_BRASWELL_I2C_7: device_set_desc(dev, "Intel Braswell Serial I/O I2C Port 7"); + sc->version = IG4_ATOM; + break; + case PCI_CHIP_SKYLAKE_I2C_0: + device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-0"); + sc->version = IG4_SKYLAKE; + break; + case PCI_CHIP_SKYLAKE_I2C_1: + device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-1"); + sc->version = IG4_SKYLAKE; + break; + case PCI_CHIP_SKYLAKE_I2C_2: + device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-2"); + sc->version = IG4_SKYLAKE; + break; + case PCI_CHIP_SKYLAKE_I2C_3: + device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-3"); + sc->version = IG4_SKYLAKE; + break; + case PCI_CHIP_SKYLAKE_I2C_4: + device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-4"); + sc->version = IG4_SKYLAKE; + break; + case PCI_CHIP_SKYLAKE_I2C_5: + device_set_desc(dev, "Intel Sunrise Point-LP I2C Controller-5"); + sc->version = IG4_SKYLAKE; break; default: return (ENXIO); Modified: head/sys/dev/ichiic/ig4_reg.h ============================================================================== --- head/sys/dev/ichiic/ig4_reg.h Tue Mar 6 23:28:12 2018 (r330557) +++ head/sys/dev/ichiic/ig4_reg.h Tue Mar 6 23:39:43 2018 (r330558) @@ -109,12 +109,21 @@ #define IG4_REG_DMA_RDLR 0x0090 /* RW DMA Receive Data Level */ #define IG4_REG_SDA_SETUP 0x0094 /* RW SDA Setup */ #define IG4_REG_ENABLE_STATUS 0x009C /* RO Enable Status */ +/* Available at least on Atom SoCs and Haswell mobile. */ #define IG4_REG_COMP_PARAM1 0x00F4 /* RO Component Parameter */ #define IG4_REG_COMP_VER 0x00F8 /* RO Component Version */ +/* Available at least on Atom SoCs */ #define IG4_REG_COMP_TYPE 0x00FC /* RO Probe width/endian? (linux) */ +/* Available on Skylake-U/Y and Kaby Lake-U/Y */ +#define IG4_REG_RESETS_SKL 0x0204 /* RW Reset Register */ +#define IG4_REG_ACTIVE_LTR_VALUE 0x0210 /* RW Active LTR Value */ +#define IG4_REG_IDLE_LTR_VALUE 0x0214 /* RW Idle LTR Value */ +/* Available at least on Atom SoCs */ #define IG4_REG_CLK_PARMS 0x0800 /* RW Clock Parameters */ -#define IG4_REG_RESETS 0x0804 /* RW Reset Register */ +/* Available at least on Atom SoCs and Haswell mobile */ +#define IG4_REG_RESETS_HSW 0x0804 /* RW Reset Register */ #define IG4_REG_GENERAL 0x0808 /* RW General Register */ +/* These LTR config registers are at least available on Haswell mobile. */ #define IG4_REG_SW_LTR_VALUE 0x0810 /* RW SW LTR Value */ #define IG4_REG_AUTO_LTR_VALUE 0x0814 /* RW Auto LTR Value */ @@ -566,8 +575,12 @@ * 10 (reserved) * 11 I2C host controller is in reset. */ -#define IG4_RESETS_ASSERT 0x0003 -#define IG4_RESETS_DEASSERT 0x0000 +#define IG4_RESETS_ASSERT_HSW 0x0003 +#define IG4_RESETS_DEASSERT_HSW 0x0000 + +/* Skylake-U/Y and Kaby Lake-U/Y have the reset bits inverted */ +#define IG4_RESETS_DEASSERT_SKL 0x0003 +#define IG4_RESETS_ASSERT_SKL 0x0000 /* * GENERAL - (RW) General Reigster 22.2.38 Modified: head/sys/dev/ichiic/ig4_var.h ============================================================================== --- head/sys/dev/ichiic/ig4_var.h Tue Mar 6 23:28:12 2018 (r330557) +++ head/sys/dev/ichiic/ig4_var.h Tue Mar 6 23:39:43 2018 (r330558) @@ -47,6 +47,7 @@ #define IG4_RBUFMASK (IG4_RBUFSIZE - 1) enum ig4_op { IG4_IDLE, IG4_READ, IG4_WRITE }; +enum ig4_vers { IG4_HASWELL, IG4_ATOM, IG4_SKYLAKE }; struct ig4iic_softc { device_t dev; @@ -58,6 +59,7 @@ struct ig4iic_softc { int intr_rid; void *intr_handle; int intr_type; + enum ig4_vers version; enum ig4_op op; int cmd; int rnext; From owner-svn-src-head@freebsd.org Tue Mar 6 23:44: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 7C38AF3A93B; Tue, 6 Mar 2018 23:44:20 +0000 (UTC) (envelope-from dteske@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 1537072092; Tue, 6 Mar 2018 23:44:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A17619B6A; Tue, 6 Mar 2018 23:44:20 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w26NiKCl003912; Tue, 6 Mar 2018 23:44:20 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26NiJv0003907; Tue, 6 Mar 2018 23:44:19 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803062344.w26NiJv0003907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 6 Mar 2018 23:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330559 - in head: . cddl/usr.sbin cddl/usr.sbin/dwatch cddl/usr.sbin/dwatch/examples cddl/usr.sbin/dwatch/libexec etc/mtree share/dtrace X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in head: . cddl/usr.sbin cddl/usr.sbin/dwatch cddl/usr.sbin/dwatch/examples cddl/usr.sbin/dwatch/libexec etc/mtree share/dtrace X-SVN-Commit-Revision: 330559 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 23:44:20 -0000 Author: dteske Date: Tue Mar 6 23:44:19 2018 New Revision: 330559 URL: https://svnweb.freebsd.org/changeset/base/330559 Log: Introduce dwatch(1) as a tool for making DTrace more useful Reviewed by: markj, gnn, bdrewery (earlier version) Relnotes: yes Sponsored by: Smule, Inc. Differential Revision: https://reviews.freebsd.org/D10006 Added: head/cddl/usr.sbin/dwatch/ head/cddl/usr.sbin/dwatch/Makefile (contents, props changed) head/cddl/usr.sbin/dwatch/dwatch (contents, props changed) head/cddl/usr.sbin/dwatch/dwatch.1 (contents, props changed) head/cddl/usr.sbin/dwatch/examples/ head/cddl/usr.sbin/dwatch/examples/Makefile (contents, props changed) head/cddl/usr.sbin/dwatch/examples/profile_template (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/ head/cddl/usr.sbin/dwatch/libexec/Makefile (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/chmod (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/errno (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/io (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/ip (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/kill (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/nanosleep (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/open (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/proc (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/rw (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/sched (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/tcp (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/udp (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/vop_create (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/vop_readdir (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/vop_rename (contents, props changed) head/cddl/usr.sbin/dwatch/libexec/vop_symlink (contents, props changed) Deleted: head/share/dtrace/watch_execve head/share/dtrace/watch_kill head/share/dtrace/watch_vop_remove Modified: head/ObsoleteFiles.inc head/cddl/usr.sbin/Makefile head/etc/mtree/BSD.usr.dist head/share/dtrace/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Mar 6 23:39:43 2018 (r330558) +++ head/ObsoleteFiles.inc Tue Mar 6 23:44:19 2018 (r330559) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20180306: remove DTrace scripts made obsolete by dwatch(1) +OLD_FILES+=usr/share/dtrace/watch_execve +OLD_FILES+=usr/share/dtrace/watch_kill +OLD_FILES+=usr/share/dtrace/watch_vop_remove # 20180212: move devmatch OLD_FILES+=usr/sbin/devmatch # 20180211: remove usb.conf Modified: head/cddl/usr.sbin/Makefile ============================================================================== --- head/cddl/usr.sbin/Makefile Tue Mar 6 23:39:43 2018 (r330558) +++ head/cddl/usr.sbin/Makefile Tue Mar 6 23:44:19 2018 (r330559) @@ -3,6 +3,7 @@ .include SUBDIR= ${_dtrace} \ + ${_dwatch} \ ${_lockstat} \ ${_plockstat} \ ${_zdb} \ @@ -23,6 +24,7 @@ _zfsd= zfsd .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" _dtrace= dtrace +_dwatch= dwatch _lockstat= lockstat _plockstat= plockstat .endif @@ -30,15 +32,18 @@ _plockstat= plockstat .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \ ${MACHINE_CPUARCH} == "riscv" _dtrace= dtrace +_dwatch= dwatch _lockstat= lockstat .endif .if ${MACHINE_CPUARCH} == "mips" _dtrace= dtrace +_dwatch= dwatch .endif .if ${MACHINE_CPUARCH} == "powerpc" _dtrace= dtrace +_dwatch= dwatch _lockstat= lockstat .endif Added: head/cddl/usr.sbin/dwatch/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dwatch/Makefile Tue Mar 6 23:44:19 2018 (r330559) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.include + +SUBDIR= libexec + +.if ${MK_EXAMPLES} != "no" +SUBDIR+= examples +.endif + +SCRIPTS= dwatch + +MAN= dwatch.1 + +.include Added: head/cddl/usr.sbin/dwatch/dwatch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dwatch/dwatch Tue Mar 6 23:44:19 2018 (r330559) @@ -0,0 +1,1291 @@ +#!/bin/sh +#- +# Copyright (c) 2014-2018 Devin Teske +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +############################################################ IDENT(1) +# +# $Title: Watch processes as they trigger a particular DTrace probe $ +# $FreeBSD$ +# +############################################################ CONFIGURATION + +# +# DTrace pragma settings +# +DTRACE_PRAGMA=" + option quiet + option dynvarsize=16m + option switchrate=10hz +" # END-QUOTE + +# +# Profiles +# +: ${DWATCH_PROFILES_PATH="/usr/libexec/dwatch:/usr/local/libexec/dwatch"} + +############################################################ GLOBALS + +VERSION='$Version: 1.0-beta-91 $' # -V + +pgm="${0##*/}" # Program basename + +# +# Command-line arguments +# +PROBE_ARG= + +# +# Command-line options +# +CONSOLE= # -y +CONSOLE_FORCE= # -y +[ -t 1 ] && CONSOLE=1 # -y +COUNT=0 # -N count +CUSTOM_DETAILS= # -E code +CUSTOM_TEST= # -t test +DEBUG= # -d +DESTRUCTIVE_ACTIONS= # -w +EXECNAME= # -k name +EXECREGEX= # -z regex +EXIT_AFTER_COMPILE= # -e +FILTER= # -r regex +PROBE_COALESCE= # -F +GROUP= # -g group +JID= # -j jail +LIST= # -l +LIST_PROFILES= # -Q +MAX_ARGS=64 # -B num +MAX_DEPTH=64 # -K num +ONELINE= # -1 +OUTPUT= # -o file +OUTPUT_CMD= # -O cmd +PID= # -p pid +PROBE_TYPE= # -f -m -n -P +PROFILE= # -X profile +PSTREE= # -R +QUIET= # -q +TIMEOUT= # -T time +TRACE= # -x +USER= # -u user +USE_PROFILE= # -X profile +VERBOSE= # -v + +# +# Global exit status +# +SUCCESS=0 +FAILURE=1 + +# +# Miscellaneous +# +ACTIONS= +EVENT_DETAILS= +EVENT_TAG='printf("%d.%d %s[%d]: ", + this->uid0, this->gid0, execname, this->pid0);' +EVENT_TEST= +FILE= +ID=3 +MODULE_CHECKED= +PROBE= +PSARGS=1 +RGID= +RUID= +SUDO= +export SUDO_PROMPT="[sudo] Password:" +TITLE=\$Title: + +############################################################ FUNCTIONS + +ansi() { local fmt="$2 $4"; [ "$CONSOLE" ] && fmt="\\033[$1m$2\\033[$3m $4"; + shift 4; printf "$fmt\n" "$@"; } +die() { exec >&2; [ "$*" ] && echo "$pgm:" "$@"; exit $FAILURE; } +info() { [ "$QUIET" ] || ansi 35 "INFO" 39 "$@" >&2; } + +usage() +{ + local optfmt="\t%-10s %s\n" + exec >&2 + [ "$*" ] && printf "%s: %s\n" "$pgm" "$*" + printf "Usage: %s [-1defFmnPqRvVwxy] [%s] [%s] [%s] [%s]\n" "$pgm" \ + "-B num" "-E code" "-g group" "-j jail" + printf "\t [%s] [%s] [%s] [%s] [%s] [%s]\n" \ + "-k name" "-K num" "-N count" "-o file" "-O cmd" "-p pid" + printf "\t [%s] [%s] [%s] [%s] [%s] [%s]\n" \ + "-r regex" "-t test" "-T time" "-u user" "-X profile" \ + "-z regex" + printf "\t probe[,...] [args ...]\n" + printf " %s -l [-fmnPqy] [-r regex] [probe ...]\n" "$pgm" + printf " %s -Q [-1qy] [-r regex]\n" "$pgm" + printf "\n" + printf "$optfmt" "-1" \ + "Print one line per process/profile (Default; disables \`-R')." + printf "$optfmt" "-B num" \ + "Maximum process arguments to display (Default $MAX_ARGS)." + printf "$optfmt" "-d" \ + "Debug. Send dtrace(1) script to stdout instead of executing." + printf "$optfmt" "-e" \ + "Exit after compiling request but prior to enabling probes." + printf "$optfmt" "-E code" \ + "DTrace code for event details. If \`-', read from stdin." + printf "$optfmt" "-f" \ + "Enable probe matching the specified function name." + printf "$optfmt" "-F" \ + "Coalesce trace output by function." + printf "$optfmt" "-g group" \ + "Group filter. Only show processes matching group name/gid." + printf "$optfmt" "-j jail" \ + "Jail filter. Only show processes matching jail name/jid." + printf "$optfmt" "-k name" \ + "Only show processes matching name." + printf "$optfmt" "-K num" \ + "Maximum directory depth to display (Default $MAX_DEPTH)." + printf "$optfmt" "-l" \ + "List available probes on standard output and exit." + printf "$optfmt" "-m" \ + "Enable probe matching the specified module name." + printf "$optfmt" "-n" \ + "Enable probe matching the specified probe name." + printf "$optfmt" "-N count" \ + "Exit after count matching entries (Default 0 for disabled)." + printf "$optfmt" "-o file" \ + "Set output file. If \`-', the path \`/dev/stdout' is used." + printf "$optfmt" "-O cmd" \ + "Execute cmd for each event." + printf "$optfmt" "-p pid" \ + "Process id filter. Only show processes with matching pid." + printf "$optfmt" "-P" \ + "Enable probe matching the specified provider name." + printf "$optfmt" "-q" \ + "Quiet. Hide informational messages and all dtrace(1) errors." + printf "$optfmt" "-Q" \ + "List available profiles in DWATCH_PROFILES_PATH and exit." + printf "$optfmt" "-r regex" \ + "Filter. Only show blocks matching awk(1) regular expression." + printf "$optfmt" "-R" \ + "Show parent, grandparent, and ancestor of process." + printf "$optfmt" "-t test" \ + "Test clause (predicate) to limit events (Default none)." + printf "$optfmt" "-T time" \ + "Timeout. Format is \`\#[smhd]' or simply \`\#' for seconds." + printf "$optfmt" "-u user" \ + "User filter. Only show processes matching user name/uid." + printf "$optfmt" "-v" \ + "Verbose. Show all errors from dtrace(1)." + printf "$optfmt" "-V" \ + "Report dwatch version on standard output and exit." + printf "$optfmt" "-w" \ + "Permit destructive actions (copyout*, stop, panic, etc.)." + printf "$optfmt" "-x" \ + "Trace. Print \`' when a probe is triggered." + printf "$optfmt" "-X profile" \ + "Load profile name from DWATCH_PROFILES_PATH." + printf "$optfmt" "-y" \ + "Always treat stdout as console (enable colors/columns/etc.)." + printf "$optfmt" "-z regex" \ + "Only show processes matching awk(1) regular expression." + die +} + +dtrace_cmd() +{ + local status stdout + local timeout= + + if [ "$1" = "-t" ]; then + shift + [ "$TIMEOUT" ] && timeout=1 + fi + + exec 3>&1 + stdout=3 + + # + # Filter dtrace(1) stderr while preserving exit status + # + status=$( + exec 4>&1 + to_status=4 + ( trap 'echo $? >&$to_status' EXIT + eval $SUDO ${timeout:+timeout \"\$TIMEOUT\"} dtrace \ + \"\$@\" 2>&1 ${QUIET:+2> /dev/null} >&$stdout + ) | dtrace_stderr_filter >&2 + ) + + return $status +} + +dtrace_stderr_filter() +{ + if [ "$VERBOSE" ]; then + cat + return + # NOTREACHED + fi + + awk ' # Start awk(1) stderr-filter + /[[:digit:]]+ drops? on CPU [[:digit:]]+/ { next } + /failed to write to : No such file or directory/ { next } + /failed to write to : Broken pipe/ { next } + /processing aborted: Broken pipe/ { next } + /invalid address \(0x[[:xdigit:]]+\) in action #[[:digit:]]+/ { next } + /out of scratch space in action #[[:digit:]]+/ { next } + /^Bus error$/ { next } + { print; fflush() } + ' # END-QUOTE +} + +expand_probe() +{ + local OPTIND=1 OPTARG flag + local type= + + while getopts t: flag; do + case "$flag" in + t) type="$OPTARG" ;; + esac + done + shift $(( $OPTIND - 1 )) + + local probe="$1" + case "$probe" in + *:*) + echo "$probe" + return $SUCCESS + ;; + esac + + dtrace_cmd -l | awk -v probe="$probe" -v type="$type" ' + # Start awk(1) processor + #################################################### BEGIN + BEGIN { getline dtrace_header } + #################################################### FUNCTIONS + function dump(unused1,unused2) { + if (n) { + if (NcF[n] == 1) f = N2F[n] + if (NcM[n] == 1) m = N2M[n] + if (NcP[n] == 1) p = N2P[n] + } else if (f) { + if (FcM[f] == 1) m = F2M[f] + if (FcP[f] == 1) p = F2P[f] + if (FcN[f] == 0 && found) n = "entry" + } else if (m) { + if (McP[m] == 1) p = M2P[m] + } + printf "%s:%s:%s:%s\n", p, m, f, n + exit !found + } + function inFMP() { return probe in F || probe in M || probe in P } + function inNMP() { return probe in N || probe in M || probe in P } + function inNFP() { return probe in N || probe in F || probe in P } + function inNFM() { return probe in N || probe in F || probe in M } + function diva(value, peerA, peerB, peerC) { + return value >= peerA && value >= peerB && value >= peerC + } + #################################################### MAIN + type == "name" && $NF != probe { next } + type == "function" && NF >=4 && $(NF-1) != probe { next } + type == "module" && NF == 5 && $(NF-2) != probe { next } + type == "provider" && $2 != probe { next } + type || $2 == probe || $3 == probe || $4 == probe || $5 == probe { + P[_p = $2]++ + M[_m = (NF >= 5 ? $(NF-2) : "")]++ + F[_f = (NF >= 4 ? $(NF-1) : "")]++ + N[_n = $NF]++ + if (N2F[_n] != _f) NcF[_n]++; N2F[_n] = _f + if (N2M[_n] != _m) NcM[_n]++; N2M[_n] = _m + if (N2P[_n] != _p) NcP[_n]++; N2P[_n] = _p + if (_n !~ /entry|return/) { + if (F2N[_f] != _n) FcN[_f]++ + F2N[_f] = _n + } + if (F2M[_f] != _m) FcM[_f]++; F2M[_f] = _m + if (F2P[_f] != _p) FcP[_f]++; F2P[_f] = _p + if (M2P[_m] != _p) McP[_m]++; M2P[_m] = _p + } + #################################################### END + END { + if (type == "name") dump(n = probe, found = probe in N) + if (type == "function") dump(f = probe, found = probe in F) + if (type == "module") dump(m = probe, found = probe in M) + if (type == "provider") dump(p = probe, found = probe in P) + if (probe in N) { + found = 1 + if (!inFMP()) dump(n = probe) + if (diva(F[probe], N[probe], M[probe], P[probe])) + dump(f = probe) + if (diva(M[probe], N[probe], F[probe], P[probe])) + dump(m = probe) + if (diva(P[probe], N[probe], F[probe], M[probe])) + dump(p = probe) + dump(n = probe) # N is the diva + } else if (probe in F) { + found = 1 + if (!inNMP()) dump(f = probe) + if (diva(N[probe], F[probe], M[probe], P[probe])) + dump(n = probe) + if (diva(M[probe], F[probe], N[probe], P[probe])) + dump(m = probe) + if (diva(P[probe], F[probe], N[probe], M[probe])) + dump(p = probe) + dump(f = probe) # F is the diva + } else if (probe in M) { + found = 1 + if (!inNFP()) dump(m = probe) + if (diva(N[probe], M[probe], F[probe], P[probe])) + dump(n = probe) + if (diva(F[probe], M[probe], N[probe], P[probe])) + dump(f = probe) + if (diva(P[probe], M[probe], N[probe], F[probe])) + dump(p = probe) + dump(m = probe) # M is the diva + } else if (probe in P) { + found = 1 + if (!inNFM()) dump(p = probe) + if (diva(N[probe], P[probe], F[probe], M[probe])) + dump(n = probe) + if (diva(F[probe], P[probe], N[probe], M[probe])) + dump(f = probe) + if (diva(M[probe], P[probe], N[probe], F[probe])) + dump(m = probe) + dump(p = probe) # P is the diva + } + if (!found) print probe + exit !found + } + ' # END-QUOTE +} + +list_probes() +{ + local OPTIND=1 OPTARG flag + local column=0 header="PROVIDER:MODULE:FUNCTION:NAME" + local filter= quiet= type= + + while getopts f:qt: flag; do + case "$flag" in + f) filter="$OPTARG" ;; + q) quiet=1 ;; + t) type="$OPTARG" ;; + esac + done + shift $(( $OPTIND - 1 )) + + if [ $# -eq 0 ]; then + case "$type" in + provider) column=1 header="PROVIDER" ;; + module) column=2 header="MODULE" ;; + function) column=3 header="FUNCTION" ;; + name) column=4 header="NAME" ;; + esac + fi + + [ "$quiet" ] || echo "$header" + + local arg probe= + for arg in "$@"; do + arg=$( expand_probe -t "$type" -- "$arg" ) + probe="$probe${probe:+, }$arg" + done + + dtrace_cmd -l${probe:+n "$probe"} | awk -v pattern="$( + # Prevent backslashes from being lost + echo "$filter" | awk 'gsub(/\\/,"&&")||1' + )" -v want="$column" -v console="$CONSOLE" ' + BEGIN { getline dtrace_header } + function ans(seq) { return console ? "\033[" seq "m" : "" } + NF > 3 && $(NF-1) ~ /^#/ { next } + !_[$0 = column[0] = sprintf("%s:%s:%s:%s", + column[1] = $2, + column[2] = (NF >= 5 ? $(NF-2) : ""), + column[3] = (NF >= 4 ? $(NF-1) : ""), + column[4] = $NF)]++ && + !__[$0 = column[want]]++ && + gsub(pattern, ans("31;1") "&" ans("39;22")) { + print | "sort" + } + END { close("sort") } + ' # END-QUOTE + + exit $SUCCESS +} + +list_profiles() +{ + local OPTIND=1 OPTARG flag + local filter= oneline= quiet= + + while getopts 1f:q flag; do + case "$flag" in + 1) oneline=1 ;; + f) filter="$OPTARG" ;; + q) quiet=1 ;; + esac + done + shift $(( $OPTIND - 1 )) + + # Prevent backslashes from being lost + filter=$( echo "$filter" | awk 'gsub(/\\/,"&&")||1' ) + + # Build a list of profiles available + local profiles + profiles=$( { IFS=: + for dir in $DWATCH_PROFILES_PATH; do + [ -d "$dir" ] || continue + for path in $dir/*; do + [ -f "$path" ] || continue + name="${path##*/}" + [ "$name" = "${name%%[!0-9A-Za-z_-]*}" ] || + continue + echo $name + done + done + } | sort -u ) + + # Get the longest profile name + local longest_profile_name + longest_profile_name=$( echo "$profiles" | + awk -v N=0 '(L = length($0)) > N { N = L } END { print N }' ) + + # Get the width of the terminal + local max_size="$( stty size 2> /dev/null )" + : ${max_size:=24 80} + local max_width="${max_size#*[$IFS]}" + + # Determine how many columns we can display + local x=$longest_profile_name ncols=1 + [ "$QUIET" ] || x=$(( $x + 8 )) # Accommodate leading tab character + x=$(( $x + 3 + $longest_profile_name )) # Preload end of next column + while [ $x -lt $max_width ]; do + ncols=$(( $ncols + 1 )) + x=$(( $x + 3 + $longest_profile_name )) + done + + # Output single lines if sent to a pipe + if [ "$oneline" ]; then + echo "$profiles" | awk -v filter="$filter" -v cons="$CONSOLE" ' + function ans(s) { return cons ? "\033[" s "m" : "" } + gsub(filter, ans("31;1") "&" ans("39;22")) + ' # END-QUOTE + return $SUCCESS + # NOTREACHED + fi + + [ "$quiet" ] || echo PROFILES: + echo "$profiles" | awk \ + -v colsize=$longest_profile_name \ + -v console="$CONSOLE" \ + -v ncols=$ncols \ + -v quiet="$quiet" \ + -v filter="$filter" \ + ' # Begin awk(1) processor + function ans(seq) { return console ? "\033[" seq "m" : "" } + BEGIN { + row_item[1] = "" + replace = ans("31;1") "&" ans("39;22") + ansi_offset = length(replace) - 1 + } + function print_row() + { + cs = colsize + ansi_offset * \ + gsub(filter, replace, row_item[1]) + printf "%s%-*s", quiet ? "" : "\t", cs, row_item[1] + for (i = 2; i <= cur_col; i++) { + cs = colsize + ansi_offset * \ + gsub(filter, replace, row_item[i]) + printf " %-*s", cs, row_item[i] + } + printf "\n" + } + $0 ~ filter { + n++ + cur_col = ((n - 1) % ncols) + 1 + row_item[cur_col] = $0 + if (cur_col == ncols) print_row() + } + END { if (cur_col < ncols) print_row() } + ' # END-QUOTE + + exit $SUCCESS +} + +load_profile() +{ + local profile="$1" + + [ "$profile" ] || + die "missing profile argument (\`$pgm -Q' to list profiles)" + + local oldIFS="$IFS" + local dir found= + + IFS=: + for dir in $DWATCH_PROFILES_PATH; do + [ -d "$dir" ] || continue + [ -f "$dir/$profile" ] || continue + PROFILE="$profile" found=1 + info "Sourcing $profile profile [found in %s]" "$dir" + . "$dir/$profile" + break + done + IFS="$oldIFS" + + [ "$found" ] || + die "no module named \`$profile' (\`$pgm -Q' to list profiles)" +} + +pproc() +{ + local OPTIND=1 OPTARG flag + local P= N=0 + + while getopts P: flag; do + case "$flag" in + P) P="$OPTARG" ;; + esac + done + shift $(( OPTIND - 1 )) + + local proc=$1 + if [ ! "$proc" ]; then + if [ "$P" = "0" ]; then + proc="curthread->td_proc" + else + proc="this->proc ? this->proc->p_pptr : NULL" + fi + fi + + awk 'NR > 1 && $0 { $0 = "\t" $0 } + gsub(/\\\t/, "\t") || 1 + ' <<-EOFPREAMBLE + this->proc = $proc; + this->uid$P = this->proc ? this->proc->p_ucred->cr_uid : -1; + this->gid$P = this->proc ? this->proc->p_ucred->cr_rgid : -1; + this->pid$P = this->proc ? this->proc->p_pid : -1; + this->jid$P = this->proc ? this->proc->p_ucred->cr_prison->pr_id : -1; + + this->p_args = this->proc ? this->proc->p_args : 0; + this->ar_length = this->p_args ? this->p_args->ar_length : 0; + this->ar_args = (char *)(this->p_args ? this->p_args->ar_args : 0); + + this->args$P = this->arg${P}_$N = this->ar_length > 0 ? + \ this->ar_args : stringof(this->proc->p_comm); + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + EOFPREAMBLE + + awk -v P=$P -v MAX_ARGS=$MAX_ARGS ' + $0 { $0 = "\t" $0 } + buf = buf $0 "\n" { } + END { + while (++N <= MAX_ARGS) { + $0 = buf + gsub(/P/, P) + gsub(/N/, N) + gsub(/\\\t/, "\t") + sub(/\n$/, "") + print + } + } + ' <<-EOFARGS + this->argP_N = this->ar_length > 0 ? this->ar_args : ""; + this->argsP = strjoin(this->argsP, + \ strjoin(this->argP_N != "" ? " " : "", this->argP_N)); + this->len = this->ar_length > 0 ? strlen(this->ar_args) + 1 : 0; + this->ar_args += this->len; + this->ar_length -= this->len; + + EOFARGS + + N=$(( $MAX_ARGS + 1 )) + awk 'sub(/^\\\t/, "\t") || 1, $0 = "\t" $0' <<-EOFPROC + this->arg${P}_$N = this->ar_length > 0 ? "..." : ""; + this->args$P = strjoin(this->args$P, + \ strjoin(this->arg${P}_$N != "" ? " " : "", this->arg${P}_$N)); + EOFPROC +} + +pproc_dump() +{ + local OPTIND=1 OPTARG flag + local verbose= + + while getopts v flag; do + case "$flag" in + v) verbose=1 ;; + esac + done + shift $(( $OPTIND - 1 )) + + local P=$1 + if [ "$verbose" ]; then + awk -v P=$P ' + BEGIN { printf "\t" } + NR > 1 && $0 { $0 = "\t" $0 } + buf = buf $0 "\n" { } + END { + $0 = buf + if (P < 3) S = sprintf("%" 7-2*(P+1) "s", "") + gsub(/S/, S) + gsub(/B/, P < 3 ? "\\" : "") + gsub(/\\\t/, "\t") + sub(/\n$/, "") + print + } + ' <<-EOFPREAMBLE + printf(" SB-+= %05d %d.%d %s\n", + \ this->pid$P, this->uid$P, this->gid$P, this->args$P); + EOFPREAMBLE + else + cat <<-EOFPREAMBLE + printf("%s", this->args$P); + EOFPREAMBLE + fi +} + +############################################################ MAIN + +# If we're running as root, no need for sudo(8) +[ "$( id -u )" != 0 ] && type sudo > /dev/null 2>&1 && SUDO=sudo + +# +# Process command-line options +# +while getopts 1B:deE:fFg:j:k:K:lmnN:o:O:p:PqQr:Rt:T:u:vVwxX:yz: flag; do + case "$flag" in + 1) ONELINE=1 PSTREE= ;; + B) MAX_ARGS="$OPTARG" ;; + d) DEBUG=1 ;; + e) EXIT_AFTER_COMPILE=1 ;; + E) CUSTOM_DETAILS=1 + EVENT_DETAILS="${EVENT_DETAILS%;}" + [ "$EVENT_DETAILS" ] && EVENT_DETAILS="$EVENT_DETAILS; + printf(\" \"); + " # END-QUOTE + # Read event code from stdin if `-' is argument + [ "$OPTARG" = "-" ] && OPTARG=$( cat ) + EVENT_DETAILS="$EVENT_DETAILS$OPTARG" ;; + f) PROBE_TYPE=function ;; + F) PROBE_COALESCE=1 ;; + g) GROUP="$OPTARG" ;; + j) JID="$OPTARG" ;; + k) EXECNAME="$EXECNAME${EXECNAME:+ }$OPTARG" + case "$OPTARG" in + \**\*) name="${OPTARG%\*}" + predicate="strstr(execname, \"${name#\*}\") != NULL" ;; + \**) name="${OPTARG#\*}" + predicate="strstr(execname, \"$name\") == (execname +" + predicate="$predicate strlen(execname) - ${#name})" ;; + *\*) predicate="strstr(execname, \"${OPTARG%\*}\") == execname" ;; + *) predicate="execname == \"$OPTARG\"" + esac + EVENT_TEST="$predicate${EVENT_TEST:+ || + ($EVENT_TEST)}" ;; + K) MAX_DEPTH="$OPTARG" ;; + l) LIST=1 ;; + m) PROBE_TYPE=module ;; + n) PROBE_TYPE=name ;; + N) COUNT="$OPTARG" ;; + o) OUTPUT="$OPTARG" ;; + O) OUTPUT_CMD="$OPTARG" ;; + p) PID="$OPTARG" ;; + P) PROBE_TYPE=provider ;; + q) QUIET=1 ;; + Q) LIST_PROFILES=1 ;; + r) FILTER="$OPTARG" ;; + R) PSTREE=1 ;; + t) CUSTOM_TEST="${CUSTOM_TEST:+($CUSTOM_TEST) && }$OPTARG" ;; + T) TIMEOUT="$OPTARG" ;; + u) USER="$OPTARG" ;; + v) VERBOSE=1 ;; + V) vers="${VERSION#\$*[:\$]}" + vers="${vers% \$}" + printf "%s: %s\n" "$pgm" "${vers# }" + exit ;; + w) DESTRUCTIVE_ACTIONS=1 ;; + x) TRACE=1 ;; + X) USE_PROFILE=1 PROFILE="$OPTARG" ;; + y) CONSOLE=1 CONSOLE_FORCE=1 ;; + z) EXECREGEX="$OPTARG" ;; + *) usage + # NOTREACHED + esac +done +shift $(( $OPTIND - 1 )) + +# +# List probes if `-l' was given +# +[ "$LIST" ] && + list_probes -f "$FILTER" ${QUIET:+-q} -t "$PROBE_TYPE" -- "$@" + # NOTREACHED + +# +# List profiles if `-Q' was given +# +[ "$LIST_PROFILES" ] && + list_profiles ${ONELINE:+-1} -f "$FILTER" ${QUIET:+-q} + # NOTREACHED + +# +# Validate number of arguments +# +if [ ! "$PROFILE" ]; then + # If not given `-X profile' then a probe argument is required + [ $# -gt 0 ] || usage # NOTREACHED +fi + +# +# Validate `-N count' option argument +# +case "$COUNT" in +"") usage "-N option requires a number argument" ;; # NOTREACHED +*[!0-9]*) usage "-N argument must be a number" ;; # NOTREACHED +esac + +# +# Validate `-B num' option argument +# +case "$MAX_ARGS" in +"") usage "-B option requires a number argument" ;; # NOTREACHED +*[!0-9]*) usage "-B argument must be a number" ;; # NOTREACHED +esac + +# +# Validate `-K num' option argument +# +case "$MAX_DEPTH" in +"") usage "-K option requires a number argument" ;; # NOTREACHED +*[!0-9]*) usage "-K argument must be a number" ;; # NOTREACHED +esac + +# +# Validate `-j jail' option argument +# +case "$JID" in +"") : fall through ;; +*[!0-9]*) JID=$( jls -j "$JID" jid ) || exit ;; +esac + +# +# Validate `-u user' option argument +# +case "$USER" in +"") : fall through ;; +*[![:alnum:]_-]*) RUID="$USER" ;; +*[!0-9]*) RUID=$( id -u "$USER" 2> /dev/null ) || die "No such user: $USER" ;; +*) RUID=$USER +esac + +# +# Validate `-g group' option argument +# +case "$GROUP" in +"") : fall-through ;; +*[![:alnum:]_-]*) RGID="$GROUP" ;; +*[!0-9]*) + RGID=$( getent group | awk -F: -v group="$GROUP" ' + $1 == group { print $3; exit found=1 } + END { exit !found } + ' ) || die "No such group: $GROUP" ;; +*) RGID=$GROUP +esac + +# +# Expand probe argument into probe(s) +# +case "$1" in +-*) : Assume dtrace options such as "-c cmd" or "-p pid" ;; # No probe(s) given +*) + PROBE_ARG="$1" + shift +esac +if [ "$PROBE_ARG" ]; then + oldIFS="$IFS" + IFS="$IFS," + for arg in $PROBE_ARG; do + arg=$( expand_probe -t "$PROBE_TYPE" -- "$arg" ) + PROBE="$PROBE${PROBE:+, }$arg" + done + IFS="$oldIFS" +fi + +# +# Set default event details if `-E code' was not given +# +[ "$CUSTOM_DETAILS" ] || EVENT_DETAILS=$( pproc_dump 0 ) + +# +# Load profile if given `-X profile' +# +[ "$USE_PROFILE" ] && load_profile "$PROFILE" +[ "$PROBE" ] || die "PROBE not defined by profile and none given as argument" + +# +# Show the user what's being watched +# +[ "$DEBUG$QUIET$EXIT_AFTER_COMPILE" ] || info "Watching '$PROBE' ..." + +# +# Header for watched probe entry +# +case "$PROBE" in +*,*) : fall-through ;; +*:execve:entry|execve:entry) + ACTIONS=$( awk 'gsub(/\\\t/, "\t") || 1' <<-EOF + $PROBE /* probe ID $ID */ + {${TRACE:+ + \ printf("<$ID>");} + \ this->caller_execname = execname; + } + EOF + ) + PROBE="${PROBE%entry}return" + ID=$(( $ID + 1 )) + EVENT_TEST="execname != this->caller_execname${EVENT_TEST:+ && + ($EVENT_TEST)}" + EVENT_TAG='printf("%d.%d %s[%d]: ", + this->uid1, this->gid1, this->caller_execname, this->pid1);' + ;; +esac + +# +# Jail clause/predicate +# +if [ "$JID" ]; then + prison_id="curthread->td_proc->p_ucred->cr_prison->pr_id" + EVENT_TEST="$prison_id == $JID${EVENT_TEST:+ && + ($EVENT_TEST)}" +fi + +# +# Custom test clause/predicate +# +if [ "$CUSTOM_TEST" ]; then + case "$EVENT_TEST" in + "") EVENT_TEST="$CUSTOM_TEST" ;; + *) EVENT_TEST="$EVENT_TEST && + ($CUSTOM_TEST)" + esac +fi + +# +# Make sure dynamic code has trailing semi-colons if non-NULL +# +EVENT_TAG="${EVENT_TAG%;}${EVENT_TAG:+;}" +EVENT_DETAILS="${EVENT_DETAILS%;}${EVENT_DETAILS:+;}" + +# +# DTrace script +# +# If `-d' is given, script is sent to stdout for debugging +# If `-c count", `-g group', `-r regex', or `-u user' is given, run script with +# dtrace and send output to awk(1) post-processor (making sure to preserve the +# exit code returned by dtrace invocation). Otherwise, simply run script with +# dtrace and then exit. +# +exec 9<"); +} + /* + * Examine process, parent process, and grandparent process details + */ + + /******************* CURPROC *******************/ + + $( pproc -P0 ) + + /******************* PPARENT *******************/ + + $( if [ "$PSTREE" ]; then pproc -P1; else echo -n \ + "this->proc = this->proc ? this->proc->p_pptr : NULL; + this->pid1 = this->proc ? this->proc->p_pid : -1; + this->uid1 = this->proc ? this->proc->p_ucred->cr_uid : -1; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Mar 6 23:58: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 143D4F3BB82; Tue, 6 Mar 2018 23:58:54 +0000 (UTC) (envelope-from dteske@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 BA958727E4; Tue, 6 Mar 2018 23:58:53 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B124919D35; Tue, 6 Mar 2018 23:58:53 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w26Nwr6p008816; Tue, 6 Mar 2018 23:58:53 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w26Nwrd3008815; Tue, 6 Mar 2018 23:58:53 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803062358.w26Nwrd3008815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Tue, 6 Mar 2018 23:58:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330560 - head/cddl/usr.sbin/dwatch X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch X-SVN-Commit-Revision: 330560 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 23:58:54 -0000 Author: dteske Date: Tue Mar 6 23:58:53 2018 New Revision: 330560 URL: https://svnweb.freebsd.org/changeset/base/330560 Log: Bump dwatch(1) internal version from 1.0-beta-91 to 1.0 Modified: head/cddl/usr.sbin/dwatch/dwatch Modified: head/cddl/usr.sbin/dwatch/dwatch ============================================================================== --- head/cddl/usr.sbin/dwatch/dwatch Tue Mar 6 23:44:19 2018 (r330559) +++ head/cddl/usr.sbin/dwatch/dwatch Tue Mar 6 23:58:53 2018 (r330560) @@ -47,7 +47,7 @@ DTRACE_PRAGMA=" ############################################################ GLOBALS -VERSION='$Version: 1.0-beta-91 $' # -V +VERSION='$Version: 1.0 $' # -V pgm="${0##*/}" # Program basename From owner-svn-src-head@freebsd.org Wed Mar 7 01:55: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 D23A2F43798; Wed, 7 Mar 2018 01:55:39 +0000 (UTC) (envelope-from bdrewery@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 7F822766EC; Wed, 7 Mar 2018 01:55:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A79D1B03E; Wed, 7 Mar 2018 01:55:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w271tdfG067576; Wed, 7 Mar 2018 01:55:39 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w271td2J067574; Wed, 7 Mar 2018 01:55:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803070155.w271td2J067574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 7 Mar 2018 01:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330561 - head/bin/chflags X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/bin/chflags X-SVN-Commit-Revision: 330561 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:55:40 -0000 Author: bdrewery Date: Wed Mar 7 01:55:38 2018 New Revision: 330561 URL: https://svnweb.freebsd.org/changeset/base/330561 Log: chflags: Add SIGINFO support. This is copied from chmod r311668. MFC after: 2 weeks Modified: head/bin/chflags/chflags.1 head/bin/chflags/chflags.c Modified: head/bin/chflags/chflags.1 ============================================================================== --- head/bin/chflags/chflags.1 Tue Mar 6 23:58:53 2018 (r330560) +++ head/bin/chflags/chflags.1 Wed Mar 7 01:55:38 2018 (r330561) @@ -32,7 +32,7 @@ .\" @(#)chflags.1 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd March 4, 2018 +.Dd March 6, 2018 .Dt CHFLAGS 1 .Os .Sh NAME @@ -217,6 +217,16 @@ setting. See .Xr security 7 for more information on this setting. +.Pp +If +.Nm +receives a +.Dv SIGINFO +signal (see the +.Cm status +argument for +.Xr stty 1 ) , +then the current filename as well as the old and new flags are displayed. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO Modified: head/bin/chflags/chflags.c ============================================================================== --- head/bin/chflags/chflags.c Tue Mar 6 23:58:53 2018 (r330560) +++ head/bin/chflags/chflags.c Wed Mar 7 01:55:38 2018 (r330561) @@ -51,13 +51,23 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +static volatile sig_atomic_t siginfo; + static void usage(void); +static void +siginfo_handler(int sig __unused) +{ + + siginfo = 1; +} + int main(int argc, char *argv[]) { @@ -108,6 +118,8 @@ main(int argc, char *argv[]) if (argc < 2) usage(); + (void)signal(SIGINFO, siginfo_handler); + if (Rflag) { if (hflag) errx(1, "the -R and -h options may not be " @@ -188,13 +200,14 @@ main(int argc, char *argv[]) atflag) == -1 && !fflag) { warn("%s", p->fts_path); rval = 1; - } else if (vflag) { + } else if (vflag || siginfo) { (void)printf("%s", p->fts_path); - if (vflag > 1) + if (vflag > 1 || siginfo) (void)printf(": 0%lo -> 0%lo", (u_long)p->fts_statp->st_flags, newflags); (void)printf("\n"); + siginfo = 0; } } if (errno) From owner-svn-src-head@freebsd.org Wed Mar 7 01:55: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 14BF9F437DF; Wed, 7 Mar 2018 01:55:51 +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 BC746767DA; Wed, 7 Mar 2018 01:55:50 +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 B6F2E1B03F; Wed, 7 Mar 2018 01:55:50 +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 w271toP9067627; Wed, 7 Mar 2018 01:55:50 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w271toiB067626; Wed, 7 Mar 2018 01:55:50 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803070155.w271toiB067626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 7 Mar 2018 01:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330562 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 330562 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:55:51 -0000 Author: cem Date: Wed Mar 7 01:55:50 2018 New Revision: 330562 URL: https://svnweb.freebsd.org/changeset/base/330562 Log: g_part_gpt: Fix memory leak in error path If g_part_gpt_read() encountered a disk with bad primary and secondary tables, it could leak memory. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Wed Mar 7 01:55:38 2018 (r330561) +++ head/sys/geom/part/g_part_gpt.c Wed Mar 7 01:55:50 2018 (r330562) @@ -923,6 +923,14 @@ g_part_gpt_read(struct g_part_table *basetable, struct pp->name); printf("GEOM: %s: GPT rejected -- may not be recoverable.\n", pp->name); + if (prihdr != NULL) + g_free(prihdr); + if (pritbl != NULL) + g_free(pritbl); + if (sechdr != NULL) + g_free(sechdr); + if (sectbl != NULL) + g_free(sectbl); return (EINVAL); } From owner-svn-src-head@freebsd.org Wed Mar 7 04:11: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 C41C9F2638D; Wed, 7 Mar 2018 04:11: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 797897B7F2; Wed, 7 Mar 2018 04:11: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 747041C6AE; Wed, 7 Mar 2018 04:11: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 w274BE47037742; Wed, 7 Mar 2018 04:11:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w274BEji037741; Wed, 7 Mar 2018 04:11:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803070411.w274BEji037741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 04:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330564 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330564 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 04:11:14 -0000 Author: kevans Date: Wed Mar 7 04:11:14 2018 New Revision: 330564 URL: https://svnweb.freebsd.org/changeset/base/330564 Log: lualoader: Only loadelf before boot/autoboot if no kernel loaded Back when I "fixed" the loading of kernel/modules to be deferred until booting, I inadvertently broke the ability to manually load a set of kernels and modules in case of something bad having happened. lualoader would instead happily load whatever is specified in loader.conf(5) and go about the boot, leading to a panic loop as you try to rediscover a way to stop the panicky efirt module from loading and fail miserably. Reported by: me, sadly Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Wed Mar 7 03:54:38 2018 (r330563) +++ head/stand/lua/core.lua Wed Mar 7 04:11:14 2018 (r330564) @@ -240,12 +240,18 @@ function core.setDefaults() end function core.autoboot(argstr) - config.loadelf() + -- loadelf() only if we've not already loaded a kernel + if loader.getenv("kernelname") == nil then + config.loadelf() + end loader.perform(composeLoaderCmd("autoboot", argstr)) end function core.boot(argstr) - config.loadelf() + -- loadelf() only if we've not already loaded a kernel + if loader.getenv("kernelname") == nil then + config.loadelf() + end loader.perform(composeLoaderCmd("boot", argstr)) end From owner-svn-src-head@freebsd.org Wed Mar 7 09:31: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 A1392F3ECC8; Wed, 7 Mar 2018 09:31:27 +0000 (UTC) (envelope-from eadler@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 5444868F05; Wed, 7 Mar 2018 09:31:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F5261F9FC; Wed, 7 Mar 2018 09:31:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w279VRVW094521; Wed, 7 Mar 2018 09:31:27 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w279VRiM094520; Wed, 7 Mar 2018 09:31:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803070931.w279VRiM094520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 7 Mar 2018 09:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330572 - head/lib/libc/rpc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libc/rpc X-SVN-Commit-Revision: 330572 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 09:31:27 -0000 Author: eadler Date: Wed Mar 7 09:31:27 2018 New Revision: 330572 URL: https://svnweb.freebsd.org/changeset/base/330572 Log: des_crypt.3: Fix typo. Obtained from: DragonflyBSD (a78d083cf561cf325e8f1a151251b8901159e2ce) MFC After: 3 days Modified: head/lib/libc/rpc/des_crypt.3 Modified: head/lib/libc/rpc/des_crypt.3 ============================================================================== --- head/lib/libc/rpc/des_crypt.3 Wed Mar 7 06:39:00 2018 (r330571) +++ head/lib/libc/rpc/des_crypt.3 Wed Mar 7 09:31:27 2018 (r330572) @@ -108,7 +108,7 @@ vector upon return. No error. .It Bq Er DESERR_NOHWDEVICE Encryption succeeded, but done in software instead of the requested hardware. -.It Bq Er DESERR_HWERR +.It Bq Er DESERR_HWERROR An error occurred in the hardware or driver. .It Bq Er DESERR_BADPARAM Bad argument to routine. From owner-svn-src-head@freebsd.org Wed Mar 7 09:40: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 CB1E8F3FA12; Wed, 7 Mar 2018 09:40:41 +0000 (UTC) (envelope-from eadler@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 7E8706974C; Wed, 7 Mar 2018 09:40:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 797B11FA57; Wed, 7 Mar 2018 09:40:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w279ef8W098365; Wed, 7 Mar 2018 09:40:41 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w279efea098364; Wed, 7 Mar 2018 09:40:41 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803070940.w279efea098364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 7 Mar 2018 09:40:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330573 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 330573 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 09:40:42 -0000 Author: eadler Date: Wed Mar 7 09:40:41 2018 New Revision: 330573 URL: https://svnweb.freebsd.org/changeset/base/330573 Log: psm.4: remove useless information Obtained from: DragonflyBSD (f49f67c528ec63f5524da5c11e060a0e67866242) MFC After: 1 week Modified: head/share/man/man4/psm.4 Modified: head/share/man/man4/psm.4 ============================================================================== --- head/share/man/man4/psm.4 Wed Mar 7 09:31:27 2018 (r330572) +++ head/share/man/man4/psm.4 Wed Mar 7 09:40:41 2018 (r330573) @@ -868,11 +868,6 @@ unless the X server is accessing the mouse via .Xr moused 8 . Clicking any button without moving the mouse may also work. .Sh BUGS -The ioctl command -.Dv MOUSEIOCREAD -has been removed. -It was never functional anyway. -.Pp Enabling the extended support for Synaptics touchpads has been reported to cause problems with responsivity on some (newer) models of Synaptics hardware, particularly those with guest devices. From owner-svn-src-head@freebsd.org Wed Mar 7 09:58: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 C18A1F40DAB; Wed, 7 Mar 2018 09:58:36 +0000 (UTC) (envelope-from andrew@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 77ADC6A1A5; Wed, 7 Mar 2018 09:58:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 64FDC1FD6C; Wed, 7 Mar 2018 09:58:36 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w279waLS008234; Wed, 7 Mar 2018 09:58:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w279waNW008233; Wed, 7 Mar 2018 09:58:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803070958.w279waNW008233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 7 Mar 2018 09:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330574 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330574 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 09:58:36 -0000 Author: andrew Date: Wed Mar 7 09:58:36 2018 New Revision: 330574 URL: https://svnweb.freebsd.org/changeset/base/330574 Log: Restrict the arm64 DMAP region to the 1G blocks where we have at least one physical page. This is in preparation for limiting it further as this is needed on some hardware, however testing has shown issues with further restricting the DMAP and ACPI. Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Mar 7 09:40:41 2018 (r330573) +++ head/sys/arm64/arm64/pmap.c Wed Mar 7 09:58:36 2018 (r330574) @@ -570,21 +570,32 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi vm_offset_t va; vm_paddr_t pa; u_int l1_slot; + int i; - pa = dmap_phys_base = min_pa & ~L1_OFFSET; - va = DMAP_MIN_ADDRESS; - for (; va < DMAP_MAX_ADDRESS && pa < max_pa; - pa += L1_SIZE, va += L1_SIZE, l1_slot++) { - l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT); + dmap_phys_base = min_pa & ~L1_OFFSET; + dmap_phys_max = 0; + dmap_max_addr = 0; - pmap_load_store(&pagetable_dmap[l1_slot], - (pa & ~L1_OFFSET) | ATTR_DEFAULT | ATTR_XN | - ATTR_IDX(CACHED_MEMORY) | L1_BLOCK); - } + for (i = 0; i < (physmap_idx * 2); i += 2) { + pa = physmap[i] & ~L1_OFFSET; + va = pa - dmap_phys_base + DMAP_MIN_ADDRESS; - /* Set the upper limit of the DMAP region */ - dmap_phys_max = pa; - dmap_max_addr = va; + for (; va < DMAP_MAX_ADDRESS && pa < physmap[i + 1]; + pa += L1_SIZE, va += L1_SIZE) { + l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT); + /* We already have an entry */ + if (pagetable_dmap[l1_slot] != 0) + continue; + pmap_load_store(&pagetable_dmap[l1_slot], + (pa & ~L1_OFFSET) | ATTR_DEFAULT | ATTR_XN | + ATTR_IDX(CACHED_MEMORY) | L1_BLOCK); + } + + if (pa > dmap_phys_max) { + dmap_phys_max = pa; + dmap_max_addr = va; + } + } cpu_tlb_flushID(); } From owner-svn-src-head@freebsd.org Wed Mar 7 10:47: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 71E9BF44693; Wed, 7 Mar 2018 10:47:28 +0000 (UTC) (envelope-from andrew@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 0718C6C038; Wed, 7 Mar 2018 10:47:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 01C4420562; Wed, 7 Mar 2018 10:47:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27AlRBI032949; Wed, 7 Mar 2018 10:47:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27AlRiY032946; Wed, 7 Mar 2018 10:47:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803071047.w27AlRiY032946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 7 Mar 2018 10:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330575 - in head/sys: conf dev/acpica dev/pci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: conf dev/acpica dev/pci X-SVN-Commit-Revision: 330575 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 10:47:28 -0000 Author: andrew Date: Wed Mar 7 10:47:27 2018 New Revision: 330575 URL: https://svnweb.freebsd.org/changeset/base/330575 Log: Add an acpi attachment to the pci_host_generic driver and have the ACPI bus provide it with its needed memory resources. This allows us to use PCIe on the ThunderX2 and, with a previous version of the patch, on the SoftIron 3000 with ACPI. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Differential Revision: https://reviews.freebsd.org/D8767 Added: head/sys/dev/pci/pci_host_generic_acpi.c (contents, props changed) Modified: head/sys/conf/files.arm64 head/sys/dev/acpica/acpi.c Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Wed Mar 7 09:58:36 2018 (r330574) +++ head/sys/conf/files.arm64 Wed Mar 7 10:47:27 2018 (r330575) @@ -171,6 +171,8 @@ crypto/blowfish/bf_enc.c optional crypto | ipsec | ips crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/acpica/acpi_bus_if.m optional acpi dev/acpica/acpi_if.m optional acpi +dev/acpica/acpi_pci_link.c optional acpi pci +dev/acpica/acpi_pcib.c optional acpi pci dev/ahci/ahci_generic.c optional ahci dev/axgbe/if_axgbe.c optional axgbe dev/axgbe/xgbe-desc.c optional axgbe @@ -191,6 +193,7 @@ dev/neta/if_mvneta.c optional neta mdio mii dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofwpci.c optional fdt pci dev/pci/pci_host_generic.c optional pci +dev/pci/pci_host_generic_acpi.c optional pci acpi dev/pci/pci_host_generic_fdt.c optional pci fdt dev/psci/psci.c optional psci dev/psci/psci_arm64.S optional psci Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Mar 7 09:58:36 2018 (r330574) +++ head/sys/dev/acpica/acpi.c Wed Mar 7 10:47:27 2018 (r330575) @@ -1883,6 +1883,29 @@ acpi_enable_pcie(void) alloc++; } } +#elif defined(__aarch64__) +static void +acpi_enable_pcie(device_t child, int segment) +{ + ACPI_TABLE_HEADER *hdr; + ACPI_MCFG_ALLOCATION *alloc, *end; + ACPI_STATUS status; + + status = AcpiGetTable(ACPI_SIG_MCFG, 1, &hdr); + if (ACPI_FAILURE(status)) + return; + + end = (ACPI_MCFG_ALLOCATION *)((char *)hdr + hdr->Length); + alloc = (ACPI_MCFG_ALLOCATION *)((ACPI_TABLE_MCFG *)hdr + 1); + while (alloc < end) { + if (alloc->PciSegment == segment) { + bus_set_resource(child, SYS_RES_MEMORY, 0, + alloc->Address, 0x10000000); + return; + } + alloc++; + } +} #endif /* @@ -1974,6 +1997,9 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi { ACPI_DEVICE_INFO *devinfo; struct acpi_device *ad; +#ifdef __aarch64__ + int segment; +#endif struct acpi_prw_data prw; ACPI_OBJECT_TYPE type; ACPI_HANDLE h; @@ -2076,6 +2102,13 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi ad->ad_cls_class = strtoul(devinfo->ClassCode.String, NULL, 16); } +#ifdef __aarch64__ + if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { + if (ACPI_SUCCESS(acpi_GetInteger(handle, "_SEG", &segment))) { + acpi_enable_pcie(child, segment); + } + } +#endif AcpiOsFree(devinfo); } break; Added: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/pci/pci_host_generic_acpi.c Wed Mar 7 10:47:27 2018 (r330575) @@ -0,0 +1,329 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2014 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Semihalf under + * the sponsorship of the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE 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. + */ + +/* Generic ECAM PCIe driver */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "pcib_if.h" + +int pci_host_generic_acpi_attach(device_t); + +/* Assembling ECAM Configuration Address */ +#define PCIE_BUS_SHIFT 20 +#define PCIE_SLOT_SHIFT 15 +#define PCIE_FUNC_SHIFT 12 +#define PCIE_BUS_MASK 0xFF +#define PCIE_SLOT_MASK 0x1F +#define PCIE_FUNC_MASK 0x07 +#define PCIE_REG_MASK 0xFFF + +#define PCIE_ADDR_OFFSET(bus, slot, func, reg) \ + ((((bus) & PCIE_BUS_MASK) << PCIE_BUS_SHIFT) | \ + (((slot) & PCIE_SLOT_MASK) << PCIE_SLOT_SHIFT) | \ + (((func) & PCIE_FUNC_MASK) << PCIE_FUNC_SHIFT) | \ + ((reg) & PCIE_REG_MASK)) + +#define PCI_IO_WINDOW_OFFSET 0x1000 + +#define SPACE_CODE_SHIFT 24 +#define SPACE_CODE_MASK 0x3 +#define SPACE_CODE_IO_SPACE 0x1 +#define PROPS_CELL_SIZE 1 +#define PCI_ADDR_CELL_SIZE 2 + +struct generic_pcie_acpi_softc { + struct generic_pcie_core_softc base; + ACPI_BUFFER ap_prt; /* interrupt routing table */ +}; + +/* Forward prototypes */ + +static int generic_pcie_acpi_probe(device_t dev); +static uint32_t generic_pcie_read_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, int bytes); +static void generic_pcie_write_config(device_t dev, u_int bus, u_int slot, + u_int func, u_int reg, uint32_t val, int bytes); +static int generic_pcie_release_resource(device_t dev, device_t child, + int type, int rid, struct resource *res); + +static int +generic_pcie_acpi_probe(device_t dev) +{ + ACPI_DEVICE_INFO *devinfo; + ACPI_HANDLE h; + int root; + + if (acpi_disabled("pcib") || (h = acpi_get_handle(dev)) == NULL || + ACPI_FAILURE(AcpiGetObjectInfo(h, &devinfo))) + return (ENXIO); + root = (devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0; + AcpiOsFree(devinfo); + if (!root) + return (ENXIO); + + device_set_desc(dev, "Generic PCI host controller"); + return (BUS_PROBE_GENERIC); +} + +int +pci_host_generic_acpi_attach(device_t dev) +{ + struct generic_pcie_acpi_softc *sc; + ACPI_HANDLE handle; + int error; + + sc = device_get_softc(dev); + + handle = acpi_get_handle(dev); + if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &sc->base.coherent))) + sc->base.coherent = 0; + if (bootverbose) + device_printf(dev, "Bus is%s cache-coherent\n", + sc->base.coherent ? "" : " not"); + + acpi_pcib_fetch_prt(dev, &sc->ap_prt); + + error = pci_host_generic_core_attach(dev); + if (error != 0) + return (error); + + device_add_child(dev, "pci", -1); + return (bus_generic_attach(dev)); +} + +static int +generic_pcie_acpi_route_interrupt(device_t bus, device_t dev, int pin) +{ + struct generic_pcie_acpi_softc *sc; + + sc = device_get_softc(bus); + + return (acpi_pcib_route_interrupt(bus, dev, pin, &sc->ap_prt)); +} + +static struct rman * +generic_pcie_acpi_rman(struct generic_pcie_acpi_softc *sc, int type) +{ + + switch (type) { + case SYS_RES_IOPORT: + return (&sc->base.io_rman); + case SYS_RES_MEMORY: + return (&sc->base.mem_rman); + default: + break; + } + + return (NULL); +} + +static struct resource * +pci_host_generic_acpi_alloc_resource(device_t dev, device_t child, int type, + int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ +#if defined(NEW_PCIB) && defined(PCI_RES_BUS) + struct generic_pcie_acpi_softc *sc; + + if (type == PCI_RES_BUS) { + sc = device_get_softc(dev); + return (pci_domain_alloc_bus(sc->base.ecam, child, rid, start, + end, count, flags)); + } +#endif + + return (bus_generic_alloc_resource(dev, child, type, rid, start, end, + count, flags)); +} + +static int +generic_pcie_acpi_activate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + struct generic_pcie_acpi_softc *sc; + int res; + + sc = device_get_softc(dev); + + if ((res = rman_activate_resource(r)) != 0) + return (res); + + res = BUS_ACTIVATE_RESOURCE(device_get_parent(dev), child, type, rid,r); + return (res); +} + +static int +generic_pcie_acpi_deactivate_resource(device_t dev, device_t child, int type, + int rid, struct resource *r) +{ + int res; + + if ((res = rman_deactivate_resource(r)) != 0) + return (res); + + res = BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), child, type, + rid, r); + return (res); +} + +static int +generic_pcie_acpi_alloc_msi(device_t pci, device_t child, int count, + int maxcount, int *irqs) +{ + +#if defined(INTRNG) + return (intr_alloc_msi(pci, child, 1, count, maxcount, irqs)); +#else + return (ENXIO); +#endif +} + +static int +generic_pcie_acpi_release_msi(device_t pci, device_t child, int count, + int *irqs) +{ + +#if defined(INTRNG) + return (intr_release_msi(pci, child, 1, count, irqs)); +#else + return (ENXIO); +#endif +} + +static int +generic_pcie_acpi_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, + uint32_t *data) +{ + +#if defined(INTRNG) + return (intr_map_msi(pci, child, 1, irq, addr, data)); +#else + return (ENXIO); +#endif +} + +static int +generic_pcie_acpi_alloc_msix(device_t pci, device_t child, int *irq) +{ + +#if defined(INTRNG) + return (intr_alloc_msix(pci, child, 1, irq)); +#else + return (ENXIO); +#endif +} + +static int +generic_pcie_acpi_release_msix(device_t pci, device_t child, int irq) +{ + +#if defined(INTRNG) + return (intr_release_msix(pci, child, 1, irq)); +#else + return (ENXIO); +#endif +} + +static int +generic_pcie_acpi_get_id(device_t pci, device_t child, enum pci_id_type type, + uintptr_t *id) +{ + struct generic_pcie_acpi_softc *sc; + int err; + + /* Use the PCI RID to find the MSI ID */ + if (type == PCI_ID_MSI) { + sc = device_get_softc(pci); + type = PCI_ID_RID; + err = pcib_get_id(pci, child, type, id); + if (err != 0) + return (err); + *id |= sc->base.ecam << 16; + return (0); + } + + return (pcib_get_id(pci, child, type, id)); +} + +static device_method_t generic_pcie_acpi_methods[] = { + DEVMETHOD(device_probe, generic_pcie_acpi_probe), + DEVMETHOD(device_attach, pci_host_generic_acpi_attach), + DEVMETHOD(bus_alloc_resource, pci_host_generic_acpi_alloc_resource), + DEVMETHOD(bus_activate_resource, generic_pcie_acpi_activate_resource), + DEVMETHOD(bus_deactivate_resource, generic_pcie_acpi_deactivate_resource), + + /* pcib interface */ + DEVMETHOD(pcib_route_interrupt, generic_pcie_acpi_route_interrupt), + DEVMETHOD(pcib_alloc_msi, generic_pcie_acpi_alloc_msi), + DEVMETHOD(pcib_release_msi, generic_pcie_acpi_release_msi), + DEVMETHOD(pcib_alloc_msix, generic_pcie_acpi_alloc_msix), + DEVMETHOD(pcib_release_msix, generic_pcie_acpi_release_msix), + DEVMETHOD(pcib_map_msi, generic_pcie_acpi_map_msi), + DEVMETHOD(pcib_get_id, generic_pcie_acpi_get_id), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(pcib, generic_pcie_acpi_driver, generic_pcie_acpi_methods, + sizeof(struct generic_pcie_acpi_softc), generic_pcie_core_driver); + +static devclass_t generic_pcie_acpi_devclass; + +DRIVER_MODULE(pcib, acpi, generic_pcie_acpi_driver, generic_pcie_acpi_devclass, + 0, 0); From owner-svn-src-head@freebsd.org Wed Mar 7 12:56: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 5040DF27E62; Wed, 7 Mar 2018 12:56:05 +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 F1A2871707; Wed, 7 Mar 2018 12:56:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E84A121A0F; Wed, 7 Mar 2018 12:56:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27Cu4l1097690; Wed, 7 Mar 2018 12:56:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27Cu4iq097687; Wed, 7 Mar 2018 12:56:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071256.w27Cu4iq097687@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 Mar 2018 12:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330579 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330579 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 12:56:05 -0000 Author: hselasky Date: Wed Mar 7 12:56:04 2018 New Revision: 330579 URL: https://svnweb.freebsd.org/changeset/base/330579 Log: Fix for use-after-free when using delayed work structures in ibcore. It is not enough to cancel delayed work structures before freeing. Always cancel delayed work synchronously before freeing! MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cm.c head/sys/ofed/drivers/infiniband/core/ib_mad.c head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cm.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cm.c Wed Mar 7 11:09:07 2018 (r330578) +++ head/sys/ofed/drivers/infiniband/core/ib_cm.c Wed Mar 7 12:56:04 2018 (r330579) @@ -4132,6 +4132,7 @@ static void __exit ib_cm_cleanup(void) destroy_workqueue(cm.wq); list_for_each_entry_safe(timewait_info, tmp, &cm.timewait_list, list) { + cancel_delayed_work_sync(&timewait_info->work.work); list_del(&timewait_info->list); kfree(timewait_info); } Modified: head/sys/ofed/drivers/infiniband/core/ib_mad.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_mad.c Wed Mar 7 11:09:07 2018 (r330578) +++ head/sys/ofed/drivers/infiniband/core/ib_mad.c Wed Mar 7 12:56:04 2018 (r330579) @@ -572,7 +572,7 @@ static void unregister_mad_agent(struct ib_mad_agent_p */ cancel_mads(mad_agent_priv); port_priv = mad_agent_priv->qp_info->port_priv; - cancel_delayed_work(&mad_agent_priv->timed_work); + cancel_delayed_work_sync(&mad_agent_priv->timed_work); spin_lock_irqsave(&port_priv->reg_lock, flags); remove_mad_reg_req(mad_agent_priv); Modified: head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c Wed Mar 7 11:09:07 2018 (r330578) +++ head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c Wed Mar 7 12:56:04 2018 (r330579) @@ -103,8 +103,8 @@ void ib_cancel_rmpp_recvs(struct ib_mad_agent_private spin_unlock_irqrestore(&agent->lock, flags); list_for_each_entry(rmpp_recv, &agent->rmpp_list, list) { - cancel_delayed_work(&rmpp_recv->timeout_work); - cancel_delayed_work(&rmpp_recv->cleanup_work); + cancel_delayed_work_sync(&rmpp_recv->timeout_work); + cancel_delayed_work_sync(&rmpp_recv->cleanup_work); } flush_workqueue(agent->qp_info->port_priv->wq); From owner-svn-src-head@freebsd.org Wed Mar 7 12:58: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 3496EF2932E; Wed, 7 Mar 2018 12:58:52 +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 D2D7071984; Wed, 7 Mar 2018 12:58:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCB4F21A15; Wed, 7 Mar 2018 12:58:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27CwpAE097816; Wed, 7 Mar 2018 12:58:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27Cwpp3097815; Wed, 7 Mar 2018 12:58:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071258.w27Cwpp3097815@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 Mar 2018 12:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330580 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330580 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 12:58:52 -0000 Author: hselasky Date: Wed Mar 7 12:58:51 2018 New Revision: 330580 URL: https://svnweb.freebsd.org/changeset/base/330580 Log: Make sure the IPv6 scope ID gets properly masked in ibcore. When exchanging CM messages the IPv6 scope ID should be ignored for link local addresses when doing comparisons. Make sure the scope ID is always set to zero for link local addresses. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cma.c Wed Mar 7 12:56:04 2018 (r330579) +++ head/sys/ofed/drivers/infiniband/core/ib_cma.c Wed Mar 7 12:58:51 2018 (r330580) @@ -1116,6 +1116,17 @@ static void cma_save_ip4_info(struct sockaddr_in *src_ } } +static void cma_ip6_clear_scope_id(struct in6_addr *addr) +{ + /* make sure link local scope ID gets zeroed */ + if (IN6_IS_SCOPE_LINKLOCAL(addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(addr)) { + /* use byte-access to be alignment safe */ + addr->s6_addr[2] = 0; + addr->s6_addr[3] = 0; + } +} + static void cma_save_ip6_info(struct sockaddr_in6 *src_addr, struct sockaddr_in6 *dst_addr, struct cma_hdr *hdr, @@ -1128,6 +1139,7 @@ static void cma_save_ip6_info(struct sockaddr_in6 *src .sin6_addr = hdr->dst_addr.ip6, .sin6_port = local_port, }; + cma_ip6_clear_scope_id(&src_addr->sin6_addr); } if (dst_addr) { @@ -1137,6 +1149,7 @@ static void cma_save_ip6_info(struct sockaddr_in6 *src .sin6_addr = hdr->src_addr.ip6, .sin6_port = hdr->port, }; + cma_ip6_clear_scope_id(&dst_addr->sin6_addr); } } @@ -1395,6 +1408,7 @@ static bool cma_match_private_data(struct rdma_id_priv ip6_addr = ((struct sockaddr_in6 *)addr)->sin6_addr; if (cma_get_ip_ver(hdr) != 6) return false; + cma_ip6_clear_scope_id(&ip6_addr); if (!cma_any_addr(addr) && memcmp(&hdr->dst_addr.ip6, &ip6_addr, sizeof(ip6_addr))) return false; @@ -3242,6 +3256,8 @@ static int cma_format_hdr(void *hdr, struct rdma_id_pr cma_hdr->src_addr.ip6 = src6->sin6_addr; cma_hdr->dst_addr.ip6 = dst6->sin6_addr; cma_hdr->port = src6->sin6_port; + cma_ip6_clear_scope_id(&cma_hdr->src_addr.ip6); + cma_ip6_clear_scope_id(&cma_hdr->dst_addr.ip6); } return 0; } From owner-svn-src-head@freebsd.org Wed Mar 7 13:01: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 CF644F2964E; Wed, 7 Mar 2018 13:01:00 +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 7D5CD71CE8; Wed, 7 Mar 2018 13:01:00 +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 7834921A41; Wed, 7 Mar 2018 13:01:00 +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 w27D10L5099466; Wed, 7 Mar 2018 13:01:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27D10Ta099465; Wed, 7 Mar 2018 13:01:00 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071301.w27D10Ta099465@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 Mar 2018 13:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330581 - head/sys/ofed/include/rdma X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/include/rdma X-SVN-Commit-Revision: 330581 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:01:01 -0000 Author: hselasky Date: Wed Mar 7 13:01:00 2018 New Revision: 330581 URL: https://svnweb.freebsd.org/changeset/base/330581 Log: Add IB_SPEED_HDR definition in ibcore. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/rdma/ib_verbs.h Modified: head/sys/ofed/include/rdma/ib_verbs.h ============================================================================== --- head/sys/ofed/include/rdma/ib_verbs.h Wed Mar 7 12:58:51 2018 (r330580) +++ head/sys/ofed/include/rdma/ib_verbs.h Wed Mar 7 13:01:00 2018 (r330581) @@ -420,7 +420,8 @@ enum ib_port_speed { IB_SPEED_QDR = 4, IB_SPEED_FDR10 = 8, IB_SPEED_FDR = 16, - IB_SPEED_EDR = 32 + IB_SPEED_EDR = 32, + IB_SPEED_HDR = 64 }; /** From owner-svn-src-head@freebsd.org Wed Mar 7 13:16: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 EE384F2AC7F; Wed, 7 Mar 2018 13:16:04 +0000 (UTC) (envelope-from andrew@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 9CE3972797; Wed, 7 Mar 2018 13:16:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9749821D48; Wed, 7 Mar 2018 13:16:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27DG4IF007500; Wed, 7 Mar 2018 13:16:04 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27DG4YU007495; Wed, 7 Mar 2018 13:16:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803071316.w27DG4YU007495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 7 Mar 2018 13:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330582 - in head/sys: arm64/arm64 arm64/include dev/pci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include dev/pci X-SVN-Commit-Revision: 330582 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:16:05 -0000 Author: andrew Date: Wed Mar 7 13:16:03 2018 New Revision: 330582 URL: https://svnweb.freebsd.org/changeset/base/330582 Log: Create macros for the ACPI interrupt cross references. This is considered a band aid until a better solution to find the correct interrupt controller can be found. While here fix one place in the GICv3 ITS driver where the offset wasn't correctly applied. Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/arm64/gic_v3_acpi.c head/sys/arm64/arm64/gicv3_its.c head/sys/arm64/arm64/nexus.c head/sys/arm64/include/intr.h head/sys/dev/pci/pci_host_generic_acpi.c Modified: head/sys/arm64/arm64/gic_v3_acpi.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_acpi.c Wed Mar 7 13:01:00 2018 (r330581) +++ head/sys/arm64/arm64/gic_v3_acpi.c Wed Mar 7 13:16:03 2018 (r330582) @@ -27,6 +27,8 @@ * SUCH DAMAGE. */ +#include "opt_acpi.h" + #include __FBSDID("$FreeBSD$"); @@ -260,14 +262,14 @@ gic_v3_acpi_attach(device_t dev) if (err != 0) goto error; - sc->gic_pic = intr_pic_register(dev, 0); + sc->gic_pic = intr_pic_register(dev, ACPI_INTR_XREF); if (sc->gic_pic == NULL) { device_printf(dev, "could not register PIC\n"); err = ENXIO; goto error; } - if (intr_pic_claim_root(dev, 0, arm_gic_v3_intr, sc, + if (intr_pic_claim_root(dev, ACPI_INTR_XREF, arm_gic_v3_intr, sc, GIC_LAST_SGI - GIC_FIRST_SGI + 1) != 0) { err = ENXIO; goto error; Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Wed Mar 7 13:01:00 2018 (r330581) +++ head/sys/arm64/arm64/gicv3_its.c Wed Mar 7 13:16:03 2018 (r330582) @@ -1734,12 +1734,13 @@ gicv3_its_acpi_attach(device_t dev) if (err != 0) return (err); - sc->sc_pic = intr_pic_register(dev, device_get_unit(dev) + 1); + sc->sc_pic = intr_pic_register(dev, + device_get_unit(dev) + ACPI_MSI_XREF); intr_pic_add_handler(device_get_parent(dev), sc->sc_pic, gicv3_its_intr, sc, GIC_FIRST_LPI, LPI_NIRQS); /* Register this device to handle MSI interrupts */ - intr_msi_register(dev, 1); + intr_msi_register(dev, device_get_unit(dev) + ACPI_MSI_XREF); return (0); } Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Wed Mar 7 13:01:00 2018 (r330581) +++ head/sys/arm64/arm64/nexus.c Wed Mar 7 13:16:03 2018 (r330582) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "acpi_bus_if.h" +#include "pcib_if.h" #endif extern struct bus_space memmap_bus; @@ -524,7 +525,8 @@ nexus_acpi_map_intr(device_t dev, device_t child, u_in * controllers for the largest base value that is no larger than * the IRQ value. */ - irq = intr_map_irq(NULL, 0, (struct intr_map_data *)acpi_data); + irq = intr_map_irq(NULL, ACPI_INTR_XREF, + (struct intr_map_data *)acpi_data); return (irq); } #endif Modified: head/sys/arm64/include/intr.h ============================================================================== --- head/sys/arm64/include/intr.h Wed Mar 7 13:01:00 2018 (r330581) +++ head/sys/arm64/include/intr.h Wed Mar 7 13:16:03 2018 (r330582) @@ -48,4 +48,9 @@ arm_irq_memory_barrier(uintptr_t irq) void intr_ipi_dispatch(u_int, struct trapframe *); #endif +#ifdef DEV_ACPI +#define ACPI_INTR_XREF 1 +#define ACPI_MSI_XREF 2 +#endif + #endif /* _MACHINE_INTR_H */ Modified: head/sys/dev/pci/pci_host_generic_acpi.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_acpi.c Wed Mar 7 13:01:00 2018 (r330581) +++ head/sys/dev/pci/pci_host_generic_acpi.c Wed Mar 7 13:16:03 2018 (r330582) @@ -228,7 +228,8 @@ generic_pcie_acpi_alloc_msi(device_t pci, device_t chi { #if defined(INTRNG) - return (intr_alloc_msi(pci, child, 1, count, maxcount, irqs)); + return (intr_alloc_msi(pci, child, ACPI_MSI_XREF, count, maxcount, + irqs)); #else return (ENXIO); #endif @@ -240,7 +241,7 @@ generic_pcie_acpi_release_msi(device_t pci, device_t c { #if defined(INTRNG) - return (intr_release_msi(pci, child, 1, count, irqs)); + return (intr_release_msi(pci, child, ACPI_MSI_XREF, count, irqs)); #else return (ENXIO); #endif @@ -252,7 +253,7 @@ generic_pcie_acpi_map_msi(device_t pci, device_t child { #if defined(INTRNG) - return (intr_map_msi(pci, child, 1, irq, addr, data)); + return (intr_map_msi(pci, child, ACPI_MSI_XREF, irq, addr, data)); #else return (ENXIO); #endif @@ -263,7 +264,7 @@ generic_pcie_acpi_alloc_msix(device_t pci, device_t ch { #if defined(INTRNG) - return (intr_alloc_msix(pci, child, 1, irq)); + return (intr_alloc_msix(pci, child, ACPI_MSI_XREF, irq)); #else return (ENXIO); #endif @@ -274,7 +275,7 @@ generic_pcie_acpi_release_msix(device_t pci, device_t { #if defined(INTRNG) - return (intr_release_msix(pci, child, 1, irq)); + return (intr_release_msix(pci, child, ACPI_MSI_XREF, irq)); #else return (ENXIO); #endif From owner-svn-src-head@freebsd.org Wed Mar 7 13:25: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 72013F2B850; Wed, 7 Mar 2018 13:25:41 +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 27E5B72DFA; Wed, 7 Mar 2018 13:25:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 228DC21ED8; Wed, 7 Mar 2018 13:25:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27DPfWG012668; Wed, 7 Mar 2018 13:25:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27DPfR8012667; Wed, 7 Mar 2018 13:25:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071325.w27DPfR8012667@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 Mar 2018 13:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330583 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330583 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:25:41 -0000 Author: hselasky Date: Wed Mar 7 13:25:40 2018 New Revision: 330583 URL: https://svnweb.freebsd.org/changeset/base/330583 Log: Embed the IPv6 scope ID before calling rtalloc1() in ibcore. Else rtalloc1() will resolve to the loopback interface. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_addr.c Wed Mar 7 13:16:03 2018 (r330582) +++ head/sys/ofed/drivers/infiniband/core/ib_addr.c Wed Mar 7 13:25:40 2018 (r330583) @@ -424,6 +424,13 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, */ dst_tmp.sin6_len = sizeof(dst_tmp); + /* + * Make sure the scope ID gets embedded, else rtalloc1() will + * resolve to the loopback interface. + */ + dst_tmp.sin6_scope_id = addr->bound_dev_if; + sa6_embedscope(&dst_tmp, 0); + /* Step 1 - lookup destination route if any */ switch (type) { case 0: From owner-svn-src-head@freebsd.org Wed Mar 7 13:28: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 3A665F2BB1F; Wed, 7 Mar 2018 13:28:13 +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 DC81E72FFB; Wed, 7 Mar 2018 13:28:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D74E721EDB; Wed, 7 Mar 2018 13:28:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27DSCpx012789; Wed, 7 Mar 2018 13:28:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27DSC0P012788; Wed, 7 Mar 2018 13:28:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071328.w27DSC0P012788@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 Mar 2018 13:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330584 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330584 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:28:13 -0000 Author: hselasky Date: Wed Mar 7 13:28:12 2018 New Revision: 330584 URL: https://svnweb.freebsd.org/changeset/base/330584 Log: Recover IPv6 scope ID for multicast link-local addresses as well as unicast link-local addresses. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cma.c Wed Mar 7 13:25:40 2018 (r330583) +++ head/sys/ofed/drivers/infiniband/core/ib_cma.c Wed Mar 7 13:28:12 2018 (r330584) @@ -2785,7 +2785,8 @@ static int cma_bind_addr(struct rdma_cm_id *id, struct struct sockaddr_in6 *src_addr6 = (struct sockaddr_in6 *) src_addr; struct sockaddr_in6 *dst_addr6 = (struct sockaddr_in6 *) dst_addr; src_addr6->sin6_scope_id = dst_addr6->sin6_scope_id; - if (IN6_IS_SCOPE_LINKLOCAL(&dst_addr6->sin6_addr)) + if (IN6_IS_SCOPE_LINKLOCAL(&dst_addr6->sin6_addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&dst_addr6->sin6_addr)) id->route.addr.dev_addr.bound_dev_if = dst_addr6->sin6_scope_id; } else if (dst_addr->sa_family == AF_IB) { ((struct sockaddr_ib *) src_addr)->sib_pkey = @@ -3119,13 +3120,13 @@ static int cma_check_linklocal(struct rdma_dev_addr *d sin6 = *(struct sockaddr_in6 *)addr; - if (!(IN6_IS_SCOPE_LINKLOCAL(&sin6.sin6_addr))) - return 0; - - if (sa6_recoverscope(&sin6) || sin6.sin6_scope_id == 0) - return -EINVAL; - - dev_addr->bound_dev_if = sin6.sin6_scope_id; + if (IN6_IS_SCOPE_LINKLOCAL(&sin6.sin6_addr) || + IN6_IS_ADDR_MC_INTFACELOCAL(&sin6.sin6_addr)) { + /* check if IPv6 scope ID is set */ + if (sa6_recoverscope(&sin6) || sin6.sin6_scope_id == 0) + return -EINVAL; + dev_addr->bound_dev_if = sin6.sin6_scope_id; + } #endif return 0; } From owner-svn-src-head@freebsd.org Wed Mar 7 13:30: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 88FBEF2BE86; Wed, 7 Mar 2018 13:30:39 +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 3E57A73222; Wed, 7 Mar 2018 13:30:39 +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 3938321FD8; Wed, 7 Mar 2018 13:30:39 +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 w27DUdHF012936; Wed, 7 Mar 2018 13:30:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27DUdPY012935; Wed, 7 Mar 2018 13:30:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071330.w27DUdPY012935@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 Mar 2018 13:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330585 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330585 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:30:39 -0000 Author: hselasky Date: Wed Mar 7 13:30:38 2018 New Revision: 330585 URL: https://svnweb.freebsd.org/changeset/base/330585 Log: Define values instead of using hardcoding. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c Modified: head/sys/ofed/drivers/infiniband/core/ib_addr.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_addr.c Wed Mar 7 13:28:12 2018 (r330584) +++ head/sys/ofed/drivers/infiniband/core/ib_addr.c Wed Mar 7 13:30:38 2018 (r330585) @@ -248,6 +248,11 @@ static int addr4_resolve(struct sockaddr_in *src_in, u8 *edst, struct ifnet **ifpp) { + enum { + ADDR_VALID = 0, + ADDR_SRC_ANY = 1, + ADDR_DST_ANY = 2, + }; struct sockaddr_in dst_tmp = *dst_in; in_port_t src_port; struct sockaddr *saddr; @@ -262,11 +267,11 @@ static int addr4_resolve(struct sockaddr_in *src_in, /* set default TTL limit */ addr->hoplimit = V_ip_defttl; - type = 0; + type = ADDR_VALID; if (src_in->sin_addr.s_addr == INADDR_ANY) - type |= 1; + type |= ADDR_SRC_ANY; if (dst_tmp.sin_addr.s_addr == INADDR_ANY) - type |= 2; + type |= ADDR_DST_ANY; /* * Make sure the socket address length field @@ -276,8 +281,8 @@ static int addr4_resolve(struct sockaddr_in *src_in, /* Step 1 - lookup destination route if any */ switch (type) { - case 0: - case 1: + case ADDR_VALID: + case ADDR_SRC_ANY: /* regular destination route lookup */ rte = rtalloc1((struct sockaddr *)&dst_tmp, 1, 0); if (rte == NULL) { @@ -297,7 +302,7 @@ static int addr4_resolve(struct sockaddr_in *src_in, /* Step 2 - find outgoing network interface */ switch (type) { - case 0: + case ADDR_VALID: /* check for loopback device */ if (rte->rt_ifp->if_flags & IFF_LOOPBACK) { ifp = rte->rt_ifp; @@ -316,7 +321,7 @@ static int addr4_resolve(struct sockaddr_in *src_in, goto error_put_ifp; } break; - case 1: + case ADDR_SRC_ANY: /* check for loopback device */ if (rte->rt_ifp->if_flags & IFF_LOOPBACK) saddr = (struct sockaddr *)&dst_tmp; @@ -398,6 +403,11 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, u8 *edst, struct ifnet **ifpp) { + enum { + ADDR_VALID = 0, + ADDR_SRC_ANY = 1, + ADDR_DST_ANY = 2, + }; struct sockaddr_in6 dst_tmp = *dst_in; in_port_t src_port; struct sockaddr *saddr; @@ -412,11 +422,11 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, /* set default TTL limit */ addr->hoplimit = V_ip_defttl; - type = 0; + type = ADDR_VALID; if (ipv6_addr_any(&src_in->sin6_addr)) - type |= 1; + type |= ADDR_SRC_ANY; if (ipv6_addr_any(&dst_tmp.sin6_addr)) - type |= 2; + type |= ADDR_DST_ANY; /* * Make sure the socket address length field @@ -433,7 +443,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, /* Step 1 - lookup destination route if any */ switch (type) { - case 0: + case ADDR_VALID: /* sanity check for IPv4 addresses */ if (ipv6_addr_v4mapped(&src_in->sin6_addr) != ipv6_addr_v4mapped(&dst_tmp.sin6_addr)) { @@ -441,7 +451,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, goto done; } /* FALLTHROUGH */ - case 1: + case ADDR_SRC_ANY: /* regular destination route lookup */ rte = rtalloc1((struct sockaddr *)&dst_tmp, 1, 0); if (rte == NULL) { @@ -461,7 +471,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, /* Step 2 - find outgoing network interface */ switch (type) { - case 0: + case ADDR_VALID: /* check for loopback device */ if (rte->rt_ifp->if_flags & IFF_LOOPBACK) { ifp = rte->rt_ifp; @@ -480,7 +490,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, goto error_put_ifp; } break; - case 1: + case ADDR_SRC_ANY: /* check for loopback device */ if (rte->rt_ifp->if_flags & IFF_LOOPBACK) saddr = (struct sockaddr *)&dst_tmp; From owner-svn-src-head@freebsd.org Wed Mar 7 13:32: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 BD63EF2C463; Wed, 7 Mar 2018 13:32:52 +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 929E173717; Wed, 7 Mar 2018 13:32:52 +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 8D9B922068; Wed, 7 Mar 2018 13:32:52 +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 w27DWqTv017581; Wed, 7 Mar 2018 13:32:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27DWqjR017580; Wed, 7 Mar 2018 13:32:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071332.w27DWqjR017580@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 Mar 2018 13:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330586 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/ofed/drivers/infiniband/core X-SVN-Commit-Revision: 330586 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:32:53 -0000 Author: hselasky Date: Wed Mar 7 13:32:52 2018 New Revision: 330586 URL: https://svnweb.freebsd.org/changeset/base/330586 Log: Make sure VNET is set when calling sa6_recoverscope() in ibcore. Else panic will occur when VIMAGE is enabled. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c Modified: head/sys/ofed/drivers/infiniband/core/ib_cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ib_cma.c Wed Mar 7 13:30:38 2018 (r330585) +++ head/sys/ofed/drivers/infiniband/core/ib_cma.c Wed Mar 7 13:32:52 2018 (r330586) @@ -3122,8 +3122,14 @@ static int cma_check_linklocal(struct rdma_dev_addr *d if (IN6_IS_SCOPE_LINKLOCAL(&sin6.sin6_addr) || IN6_IS_ADDR_MC_INTFACELOCAL(&sin6.sin6_addr)) { - /* check if IPv6 scope ID is set */ - if (sa6_recoverscope(&sin6) || sin6.sin6_scope_id == 0) + bool failure; + + CURVNET_SET_QUIET(dev_addr->net); + failure = sa6_recoverscope(&sin6) || sin6.sin6_scope_id == 0; + CURVNET_RESTORE(); + + /* check if IPv6 scope ID is not set */ + if (failure) return -EINVAL; dev_addr->bound_dev_if = sin6.sin6_scope_id; } From owner-svn-src-head@freebsd.org Wed Mar 7 13:49: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 82ED9F2DCC6; Wed, 7 Mar 2018 13:49:27 +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 3422074604; Wed, 7 Mar 2018 13:49:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DE9922215; Wed, 7 Mar 2018 13:49:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27DnRg0022930; Wed, 7 Mar 2018 13:49:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27DnRfY022929; Wed, 7 Mar 2018 13:49:27 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803071349.w27DnRfY022929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 7 Mar 2018 13:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330592 - 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: 330592 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:49:27 -0000 Author: avg Date: Wed Mar 7 13:49:26 2018 New Revision: 330592 URL: https://svnweb.freebsd.org/changeset/base/330592 Log: MFV r330591: 8984 fix for 6764 breaks ACL inheritance illumos/illumos-gate@e9bacc6d1a71ea3f7082038b2868de8c4dd98bdc https://github.com/illumos/illumos-gate/commit/e9bacc6d1a71ea3f7082038b2868de8c4dd98bdc https://www.illumos.org/issues/8984 Consider a directory configured as: drwx-ws---+ 2 henson cpp 3 Jan 23 12:35 dropbox/ user:henson:rwxpdDaARWcC--:f-i----:allow owner@:--------------:f-i----:allow group@:--------------:f-i----:allow everyone@:--------------:f-i----:allow owner@:rwxpdDaARWcC--:-di----:allow group:cpp:-wx-----------:-------:allow owner@:rwxpdDaARWcC--:-------:allow A new file created in this directory ends up looking like: rw-r--r-+ 1 astudent cpp 0 Jan 23 12:39 testfile user:henson:rw-pdDaARWcC--:------I:allow owner@:--------------:------I:allow group@:--------------:------I:allow everyone@:--------------:------I:allow owner@:rw-p--aARWcCos:-------:allow group@:r-----a-R-c--s:-------:allow everyone@:r-----a-R-c--s:-------:allow with extraneous group@ and everyone@ entries allowing read access that shouldn't exist. Per Albert Lee on the zfs mailing list: "aclinherit=passthrough/passthrough-x should still ignore the requested mode when an inheritable ACE for owner@ group@, or everyone@ is present in the parent directory. It appears there was an oversight in my fix for https://www.illumos.org/issues/6764 which made calling zfs_acl_chmod from zfs_acl_inherit unconditional. I think the parent ACL check for aclinherit=passthrough needs to be reintroduced in zfs_acl_inherit." We have a large number of faculty who use dropbox directories like the example to have students submit projects. All of these directories are now allowing Reviewed by: Sam Zaydel Reviewed by: Paul B. Henson Reviewed by: Prakash Surya Approved by: Matthew Ahrens Author: Dominik Hassler PR: 216886 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed Mar 7 13:47:01 2018 (r330591) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Wed Mar 7 13:49:26 2018 (r330592) @@ -1476,7 +1476,7 @@ zfs_ace_can_use(vtype_t vtype, uint16_t acep_flags) */ static zfs_acl_t * zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_acl_t *paclp, - uint64_t mode) + uint64_t mode, boolean_t *need_chmod) { void *pacep = NULL; void *acep; @@ -1490,7 +1490,10 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_a size_t data1sz, data2sz; uint_t aclinherit; boolean_t isdir = (vtype == VDIR); + boolean_t isreg = (vtype == VREG); + *need_chmod = B_TRUE; + aclp = zfs_acl_alloc(paclp->z_version); aclinherit = zfsvfs->z_acl_inherit; if (aclinherit == ZFS_ACL_DISCARD || vtype == VLNK) @@ -1513,6 +1516,17 @@ zfs_acl_inherit(zfsvfs_t *zfsvfs, vtype_t vtype, zfs_a continue; /* + * If owner@, group@, or everyone@ inheritable + * then zfs_acl_chmod() isn't needed. + */ + if ((aclinherit == ZFS_ACL_PASSTHROUGH || + aclinherit == ZFS_ACL_PASSTHROUGH_X) && + ((iflags & (ACE_OWNER|ACE_EVERYONE)) || + ((iflags & OWNING_GROUP) == OWNING_GROUP)) && + (isreg || (isdir && (iflags & ACE_DIRECTORY_INHERIT_ACE)))) + *need_chmod = B_FALSE; + + /* * Strip inherited execute permission from file if * not in mode */ @@ -1599,6 +1613,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va zfsvfs_t *zfsvfs = dzp->z_zfsvfs; zfs_acl_t *paclp; gid_t gid; + boolean_t need_chmod = B_TRUE; boolean_t trim = B_FALSE; boolean_t inherited = B_FALSE; @@ -1694,7 +1709,7 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va !(dzp->z_pflags & ZFS_XATTR)) { VERIFY(0 == zfs_acl_node_read(dzp, &paclp, B_FALSE)); acl_ids->z_aclp = zfs_acl_inherit(zfsvfs, - vap->va_type, paclp, acl_ids->z_mode); + vap->va_type, paclp, acl_ids->z_mode, &need_chmod); inherited = B_TRUE; } else { acl_ids->z_aclp = @@ -1703,15 +1718,18 @@ zfs_acl_ids_create(znode_t *dzp, int flag, vattr_t *va } mutex_exit(&dzp->z_acl_lock); - if (vap->va_type == VDIR) - acl_ids->z_aclp->z_hints |= ZFS_ACL_AUTO_INHERIT; + if (need_chmod) { + if (vap->va_type == VDIR) + acl_ids->z_aclp->z_hints |= + ZFS_ACL_AUTO_INHERIT; - if (zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK && - zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH && - zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH_X) - trim = B_TRUE; - zfs_acl_chmod(vap->va_type, acl_ids->z_mode, B_FALSE, trim, - acl_ids->z_aclp); + if (zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK && + zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH && + zfsvfs->z_acl_inherit != ZFS_ACL_PASSTHROUGH_X) + trim = B_TRUE; + zfs_acl_chmod(vap->va_type, acl_ids->z_mode, B_FALSE, + trim, acl_ids->z_aclp); + } } if (inherited || vsecp) { From owner-svn-src-head@freebsd.org Wed Mar 7 13:54: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 E9253F2E551; Wed, 7 Mar 2018 13:54:44 +0000 (UTC) (envelope-from andrew@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 95A7874BCB; Wed, 7 Mar 2018 13:54:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8C9102239F; Wed, 7 Mar 2018 13:54:44 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27Dsi1P027618; Wed, 7 Mar 2018 13:54:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27Dsi3o027617; Wed, 7 Mar 2018 13:54:44 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803071354.w27Dsi3o027617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 7 Mar 2018 13:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330593 - head/sys/arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/include X-SVN-Commit-Revision: 330593 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:54:45 -0000 Author: andrew Date: Wed Mar 7 13:54:44 2018 New Revision: 330593 URL: https://svnweb.freebsd.org/changeset/base/330593 Log: Bump MAXCPUS on arm64. We are starting to see hardware with more than 96 cores so increase it to the same as amd64. Sponsored by: DARPA, AFRL Sponsored by: Cavium (Hardware) Modified: head/sys/arm64/include/param.h Modified: head/sys/arm64/include/param.h ============================================================================== --- head/sys/arm64/include/param.h Wed Mar 7 13:49:26 2018 (r330592) +++ head/sys/arm64/include/param.h Wed Mar 7 13:54:44 2018 (r330593) @@ -56,7 +56,7 @@ #if defined(SMP) || defined(KLD_MODULE) #ifndef MAXCPU -#define MAXCPU 96 +#define MAXCPU 256 #endif #else #define MAXCPU 1 From owner-svn-src-head@freebsd.org Wed Mar 7 13:57: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 4244EF2E8BA; Wed, 7 Mar 2018 13:57:33 +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 E53D474DFF; Wed, 7 Mar 2018 13:57:32 +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 C5F58223A2; Wed, 7 Mar 2018 13:57:32 +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 w27DvWVx027780; Wed, 7 Mar 2018 13:57:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27DvWAq027779; Wed, 7 Mar 2018 13:57:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071357.w27DvWAq027779@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 Mar 2018 13:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330594 - head/sys/dev/mlx4/mlx4_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_ib X-SVN-Commit-Revision: 330594 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:57:33 -0000 Author: hselasky Date: Wed Mar 7 13:57:32 2018 New Revision: 330594 URL: https://svnweb.freebsd.org/changeset/base/330594 Log: Disable unsupported disassociate ucontext functionality in mlx4ib(4). MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Wed Mar 7 13:54:44 2018 (r330593) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Wed Mar 7 13:57:32 2018 (r330594) @@ -1135,68 +1135,6 @@ static const struct vm_operations_struct mlx4_ib_vm_op .close = mlx4_ib_vma_close }; -static void mlx4_ib_disassociate_ucontext(struct ib_ucontext *ibcontext) -{ - int i; - int ret = 0; - struct vm_area_struct *vma; - struct mlx4_ib_ucontext *context = to_mucontext(ibcontext); - struct task_struct *owning_process = NULL; - struct mm_struct *owning_mm = NULL; - - owning_process = get_pid_task(ibcontext->tgid, PIDTYPE_PID); - if (!owning_process) - return; - - owning_mm = get_task_mm(owning_process); - if (!owning_mm) { - pr_info("no mm, disassociate ucontext is pending task termination\n"); - while (1) { - /* make sure that task is dead before returning, it may - * prevent a rare case of module down in parallel to a - * call to mlx4_ib_vma_close. - */ - put_task_struct(owning_process); - msleep(1); - owning_process = get_pid_task(ibcontext->tgid, - PIDTYPE_PID); - if (!owning_process /* || - owning_process->state == TASK_DEAD */) { - pr_info("disassociate ucontext done, task was terminated\n"); - /* in case task was dead need to release the task struct */ - if (owning_process) - put_task_struct(owning_process); - return; - } - } - } - - /* need to protect from a race on closing the vma as part of - * mlx4_ib_vma_close(). - */ - down_read(&owning_mm->mmap_sem); - for (i = 0; i < HW_BAR_COUNT; i++) { - vma = context->hw_bar_info[i].vma; - if (!vma) - continue; - - ret = zap_vma_ptes(context->hw_bar_info[i].vma, - context->hw_bar_info[i].vma->vm_start, - PAGE_SIZE); - if (ret) { - pr_err("Error: zap_vma_ptes failed for index=%d, ret=%d\n", i, ret); - BUG_ON(1); - } - - /* context going to be destroyed, should not access ops any more */ - context->hw_bar_info[i].vma->vm_ops = NULL; - } - - up_read(&owning_mm->mmap_sem); - mmput(owning_mm); - put_task_struct(owning_process); -} - static void mlx4_ib_set_vma_data(struct vm_area_struct *vma, struct mlx4_ib_vma_private_data *vma_private_data) { @@ -2694,7 +2632,6 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) ibdev->ib_dev.process_mad = mlx4_ib_process_mad; ibdev->ib_dev.get_port_immutable = mlx4_port_immutable; ibdev->ib_dev.get_dev_fw_str = get_fw_ver_str; - ibdev->ib_dev.disassociate_ucontext = mlx4_ib_disassociate_ucontext; if (!mlx4_is_slave(ibdev->dev)) { ibdev->ib_dev.alloc_fmr = mlx4_ib_fmr_alloc; From owner-svn-src-head@freebsd.org Wed Mar 7 13:58: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 E89EFF2EAE9; Wed, 7 Mar 2018 13:58:58 +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 8A1A974FA6; Wed, 7 Mar 2018 13:58:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FF0F223A4; Wed, 7 Mar 2018 13:58:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27DwwUd027864; Wed, 7 Mar 2018 13:58:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27Dwwmp027863; Wed, 7 Mar 2018 13:58:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071358.w27Dwwmp027863@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 Mar 2018 13:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330595 - head/sys/dev/mlx4/mlx4_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_ib X-SVN-Commit-Revision: 330595 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:58:59 -0000 Author: hselasky Date: Wed Mar 7 13:58:58 2018 New Revision: 330595 URL: https://svnweb.freebsd.org/changeset/base/330595 Log: The mlx4ib(4) should not be loaded before the ibcore is initialized. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Wed Mar 7 13:57:32 2018 (r330594) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Wed Mar 7 13:58:58 2018 (r330595) @@ -3317,7 +3317,7 @@ static void __exit mlx4_ib_cleanup(void) destroy_workqueue(wq); } -module_init_order(mlx4_ib_init, SI_ORDER_MIDDLE); +module_init_order(mlx4_ib_init, SI_ORDER_THIRD); module_exit(mlx4_ib_cleanup); static int From owner-svn-src-head@freebsd.org Wed Mar 7 13:59: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 9B3AEF2EBB4; Wed, 7 Mar 2018 13:59:47 +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 5107975103; Wed, 7 Mar 2018 13:59:47 +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 4C05B223A5; Wed, 7 Mar 2018 13:59:47 +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 w27Dxlo7027940; Wed, 7 Mar 2018 13:59:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27DxlU9027939; Wed, 7 Mar 2018 13:59:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071359.w27DxlU9027939@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 Mar 2018 13:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330596 - head/sys/dev/mlx4/mlx4_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_ib X-SVN-Commit-Revision: 330596 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 13:59:47 -0000 Author: hselasky Date: Wed Mar 7 13:59:46 2018 New Revision: 330596 URL: https://svnweb.freebsd.org/changeset/base/330596 Log: Bump version information in mlx4ib(4). MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Modified: head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c ============================================================================== --- head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Wed Mar 7 13:58:58 2018 (r330595) +++ head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c Wed Mar 7 13:59:46 2018 (r330596) @@ -63,8 +63,10 @@ #include "wc.h" #define DRV_NAME MLX4_IB_DRV_NAME -#define DRV_VERSION "3.4.1-BETA" -#define DRV_RELDATE "October 2017" +#ifndef DRV_VERSION +#define DRV_VERSION "3.4.1" +#endif +#define DRV_RELDATE "February 2018" #define MLX4_IB_FLOW_MAX_PRIO 0xFFF #define MLX4_IB_FLOW_QPN_MASK 0xFFFFFF From owner-svn-src-head@freebsd.org Wed Mar 7 14:03: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 3E3B8F2F2AB; Wed, 7 Mar 2018 14:03:32 +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 E013F7575F; Wed, 7 Mar 2018 14:03:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C08D722530; Wed, 7 Mar 2018 14:03:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27E3VKU033081; Wed, 7 Mar 2018 14:03:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27E3Ve1033080; Wed, 7 Mar 2018 14:03:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071403.w27E3Ve1033080@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 Mar 2018 14:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330597 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 330597 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:03:32 -0000 Author: hselasky Date: Wed Mar 7 14:03:31 2018 New Revision: 330597 URL: https://svnweb.freebsd.org/changeset/base/330597 Log: Disable unsupported disassociate ucontext functionality in mlx5ib(4). MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed Mar 7 13:59:46 2018 (r330596) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed Mar 7 14:03:31 2018 (r330597) @@ -1241,62 +1241,6 @@ static int mlx5_ib_set_vma_data(struct vm_area_struct return 0; } -static void mlx5_ib_disassociate_ucontext(struct ib_ucontext *ibcontext) -{ - int ret; - struct vm_area_struct *vma; - struct mlx5_ib_vma_private_data *vma_private, *n; - struct mlx5_ib_ucontext *context = to_mucontext(ibcontext); - struct task_struct *owning_process = NULL; - struct mm_struct *owning_mm = NULL; - - owning_process = get_pid_task(ibcontext->tgid, PIDTYPE_PID); - if (!owning_process) - return; - - owning_mm = get_task_mm(owning_process); - if (!owning_mm) { - pr_info("no mm, disassociate ucontext is pending task termination\n"); - while (1) { - put_task_struct(owning_process); - usleep_range(1000, 2000); - owning_process = get_pid_task(ibcontext->tgid, - PIDTYPE_PID); - if (!owning_process /* || - owning_process->state == TASK_DEAD */) { - pr_info("disassociate ucontext done, task was terminated\n"); - /* in case task was dead need to release the - * task struct. - */ - if (owning_process) - put_task_struct(owning_process); - return; - } - } - } - - /* need to protect from a race on closing the vma as part of - * mlx5_ib_vma_close. - */ - down_read(&owning_mm->mmap_sem); - list_for_each_entry_safe(vma_private, n, &context->vma_private_list, - list) { - vma = vma_private->vma; - ret = zap_vma_ptes(vma, vma->vm_start, - PAGE_SIZE); - WARN_ONCE(ret, "%s: zap_vma_ptes failed", __func__); - /* context going to be destroyed, should - * not access ops any more. - */ - vma->vm_ops = NULL; - list_del(&vma_private->list); - kfree(vma_private); - } - up_read(&owning_mm->mmap_sem); - mmput(owning_mm); - put_task_struct(owning_process); -} - static inline char *mmap_cmd2str(enum mlx5_ib_mmap_cmd cmd) { switch (cmd) { @@ -3055,8 +2999,6 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) dev->ib_dev.get_vf_stats = mlx5_ib_get_vf_stats; dev->ib_dev.set_vf_guid = mlx5_ib_set_vf_guid; } - - dev->ib_dev.disassociate_ucontext = mlx5_ib_disassociate_ucontext; mlx5_ib_internal_fill_odp_caps(dev); From owner-svn-src-head@freebsd.org Wed Mar 7 14:29: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 97C9CF312DB; Wed, 7 Mar 2018 14:29:31 +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 4704F76A7C; Wed, 7 Mar 2018 14:29:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27A832287F; Wed, 7 Mar 2018 14:29:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27ETVpo043106; Wed, 7 Mar 2018 14:29:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27ETV2Z043105; Wed, 7 Mar 2018 14:29:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071429.w27ETV2Z043105@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 Mar 2018 14:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330598 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 330598 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:29:31 -0000 Author: hselasky Date: Wed Mar 7 14:29:30 2018 New Revision: 330598 URL: https://svnweb.freebsd.org/changeset/base/330598 Log: Use a macro in mlx5_command_str() instead of copying OP name. linux commit 42ca502e179d0654ef441333a9d0f35c948734f3 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed Mar 7 14:03:31 2018 (r330597) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed Mar 7 14:29:30 2018 (r330598) @@ -296,403 +296,141 @@ static void dump_buf(void *buf, int size, int data_onl const char *mlx5_command_str(int command) { - switch (command) { - case MLX5_CMD_OP_QUERY_HCA_CAP: - return "QUERY_HCA_CAP"; + #define MLX5_COMMAND_STR_CASE(__cmd) case MLX5_CMD_OP_ ## __cmd: return #__cmd - case MLX5_CMD_OP_SET_HCA_CAP: - return "SET_HCA_CAP"; - - case MLX5_CMD_OP_QUERY_ADAPTER: - return "QUERY_ADAPTER"; - - case MLX5_CMD_OP_INIT_HCA: - return "INIT_HCA"; - - case MLX5_CMD_OP_TEARDOWN_HCA: - return "TEARDOWN_HCA"; - - case MLX5_CMD_OP_ENABLE_HCA: - return "MLX5_CMD_OP_ENABLE_HCA"; - - case MLX5_CMD_OP_DISABLE_HCA: - return "MLX5_CMD_OP_DISABLE_HCA"; - - case MLX5_CMD_OP_QUERY_PAGES: - return "QUERY_PAGES"; - - case MLX5_CMD_OP_MANAGE_PAGES: - return "MANAGE_PAGES"; - - case MLX5_CMD_OP_QUERY_ISSI: - return "QUERY_ISSI"; - - case MLX5_CMD_OP_SET_ISSI: - return "SET_ISSI"; - - case MLX5_CMD_OP_CREATE_MKEY: - return "CREATE_MKEY"; - - case MLX5_CMD_OP_QUERY_MKEY: - return "QUERY_MKEY"; - - case MLX5_CMD_OP_DESTROY_MKEY: - return "DESTROY_MKEY"; - - case MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS: - return "QUERY_SPECIAL_CONTEXTS"; - - case MLX5_CMD_OP_PAGE_FAULT_RESUME: - return "PAGE_FAULT_RESUME"; - - case MLX5_CMD_OP_CREATE_EQ: - return "CREATE_EQ"; - - case MLX5_CMD_OP_DESTROY_EQ: - return "DESTROY_EQ"; - - case MLX5_CMD_OP_QUERY_EQ: - return "QUERY_EQ"; - - case MLX5_CMD_OP_GEN_EQE: - return "GEN_EQE"; - - case MLX5_CMD_OP_CREATE_CQ: - return "CREATE_CQ"; - - case MLX5_CMD_OP_DESTROY_CQ: - return "DESTROY_CQ"; - - case MLX5_CMD_OP_QUERY_CQ: - return "QUERY_CQ"; - - case MLX5_CMD_OP_MODIFY_CQ: - return "MODIFY_CQ"; - - case MLX5_CMD_OP_CREATE_QP: - return "CREATE_QP"; - - case MLX5_CMD_OP_DESTROY_QP: - return "DESTROY_QP"; - - case MLX5_CMD_OP_RST2INIT_QP: - return "RST2INIT_QP"; - - case MLX5_CMD_OP_INIT2RTR_QP: - return "INIT2RTR_QP"; - - case MLX5_CMD_OP_RTR2RTS_QP: - return "RTR2RTS_QP"; - - case MLX5_CMD_OP_RTS2RTS_QP: - return "RTS2RTS_QP"; - - case MLX5_CMD_OP_SQERR2RTS_QP: - return "SQERR2RTS_QP"; - - case MLX5_CMD_OP_2ERR_QP: - return "2ERR_QP"; - - case MLX5_CMD_OP_2RST_QP: - return "2RST_QP"; - - case MLX5_CMD_OP_QUERY_QP: - return "QUERY_QP"; - - case MLX5_CMD_OP_SQD_RTS_QP: - return "SQD_RTS_QP"; - - case MLX5_CMD_OP_MAD_IFC: - return "MAD_IFC"; - - case MLX5_CMD_OP_INIT2INIT_QP: - return "INIT2INIT_QP"; - - case MLX5_CMD_OP_CREATE_PSV: - return "CREATE_PSV"; - - case MLX5_CMD_OP_DESTROY_PSV: - return "DESTROY_PSV"; - - case MLX5_CMD_OP_CREATE_SRQ: - return "CREATE_SRQ"; - - case MLX5_CMD_OP_DESTROY_SRQ: - return "DESTROY_SRQ"; - - case MLX5_CMD_OP_QUERY_SRQ: - return "QUERY_SRQ"; - - case MLX5_CMD_OP_ARM_RQ: - return "ARM_RQ"; - - case MLX5_CMD_OP_CREATE_XRC_SRQ: - return "CREATE_XRC_SRQ"; - - case MLX5_CMD_OP_DESTROY_XRC_SRQ: - return "DESTROY_XRC_SRQ"; - - case MLX5_CMD_OP_QUERY_XRC_SRQ: - return "QUERY_XRC_SRQ"; - - case MLX5_CMD_OP_ARM_XRC_SRQ: - return "ARM_XRC_SRQ"; - - case MLX5_CMD_OP_CREATE_DCT: - return "CREATE_DCT"; - - case MLX5_CMD_OP_SET_DC_CNAK_TRACE: - return "SET_DC_CNAK_TRACE"; - - case MLX5_CMD_OP_DESTROY_DCT: - return "DESTROY_DCT"; - - case MLX5_CMD_OP_DRAIN_DCT: - return "DRAIN_DCT"; - - case MLX5_CMD_OP_QUERY_DCT: - return "QUERY_DCT"; - - case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION: - return "ARM_DCT_FOR_KEY_VIOLATION"; - - case MLX5_CMD_OP_QUERY_VPORT_STATE: - return "QUERY_VPORT_STATE"; - - case MLX5_CMD_OP_MODIFY_VPORT_STATE: - return "MODIFY_VPORT_STATE"; - - case MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT: - return "QUERY_ESW_VPORT_CONTEXT"; - - case MLX5_CMD_OP_MODIFY_ESW_VPORT_CONTEXT: - return "MODIFY_ESW_VPORT_CONTEXT"; - - case MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT: - return "QUERY_NIC_VPORT_CONTEXT"; - - case MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT: - return "MODIFY_NIC_VPORT_CONTEXT"; - - case MLX5_CMD_OP_QUERY_ROCE_ADDRESS: - return "QUERY_ROCE_ADDRESS"; - - case MLX5_CMD_OP_SET_ROCE_ADDRESS: - return "SET_ROCE_ADDRESS"; - - case MLX5_CMD_OP_QUERY_HCA_VPORT_CONTEXT: - return "QUERY_HCA_VPORT_CONTEXT"; - - case MLX5_CMD_OP_MODIFY_HCA_VPORT_CONTEXT: - return "MODIFY_HCA_VPORT_CONTEXT"; - - case MLX5_CMD_OP_QUERY_HCA_VPORT_GID: - return "QUERY_HCA_VPORT_GID"; - - case MLX5_CMD_OP_QUERY_HCA_VPORT_PKEY: - return "QUERY_HCA_VPORT_PKEY"; - - case MLX5_CMD_OP_QUERY_VPORT_COUNTER: - return "QUERY_VPORT_COUNTER"; - - case MLX5_CMD_OP_SET_WOL_ROL: - return "SET_WOL_ROL"; - - case MLX5_CMD_OP_QUERY_WOL_ROL: - return "QUERY_WOL_ROL"; - - case MLX5_CMD_OP_ALLOC_Q_COUNTER: - return "ALLOC_Q_COUNTER"; - - case MLX5_CMD_OP_DEALLOC_Q_COUNTER: - return "DEALLOC_Q_COUNTER"; - - case MLX5_CMD_OP_QUERY_Q_COUNTER: - return "QUERY_Q_COUNTER"; - - case MLX5_CMD_OP_ALLOC_PD: - return "ALLOC_PD"; - - case MLX5_CMD_OP_DEALLOC_PD: - return "DEALLOC_PD"; - - case MLX5_CMD_OP_ALLOC_UAR: - return "ALLOC_UAR"; - - case MLX5_CMD_OP_DEALLOC_UAR: - return "DEALLOC_UAR"; - - case MLX5_CMD_OP_CONFIG_INT_MODERATION: - return "CONFIG_INT_MODERATION"; - - case MLX5_CMD_OP_ATTACH_TO_MCG: - return "ATTACH_TO_MCG"; - - case MLX5_CMD_OP_DETACH_FROM_MCG: - return "DETACH_FROM_MCG"; - - case MLX5_CMD_OP_GET_DROPPED_PACKET_LOG: - return "GET_DROPPED_PACKET_LOG"; - - case MLX5_CMD_OP_QUERY_MAD_DEMUX: - return "QUERY_MAD_DEMUX"; - - case MLX5_CMD_OP_SET_MAD_DEMUX: - return "SET_MAD_DEMUX"; - - case MLX5_CMD_OP_NOP: - return "NOP"; - - case MLX5_CMD_OP_ALLOC_XRCD: - return "ALLOC_XRCD"; - - case MLX5_CMD_OP_DEALLOC_XRCD: - return "DEALLOC_XRCD"; - - case MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN: - return "ALLOC_TRANSPORT_DOMAIN"; - - case MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN: - return "DEALLOC_TRANSPORT_DOMAIN"; - - case MLX5_CMD_OP_QUERY_CONG_STATUS: - return "QUERY_CONG_STATUS"; - - case MLX5_CMD_OP_MODIFY_CONG_STATUS: - return "MODIFY_CONG_STATUS"; - - case MLX5_CMD_OP_QUERY_CONG_PARAMS: - return "QUERY_CONG_PARAMS"; - - case MLX5_CMD_OP_MODIFY_CONG_PARAMS: - return "MODIFY_CONG_PARAMS"; - - case MLX5_CMD_OP_QUERY_CONG_STATISTICS: - return "QUERY_CONG_STATISTICS"; - - case MLX5_CMD_OP_ADD_VXLAN_UDP_DPORT: - return "ADD_VXLAN_UDP_DPORT"; - - case MLX5_CMD_OP_DELETE_VXLAN_UDP_DPORT: - return "DELETE_VXLAN_UDP_DPORT"; - - case MLX5_CMD_OP_SET_L2_TABLE_ENTRY: - return "SET_L2_TABLE_ENTRY"; - - case MLX5_CMD_OP_QUERY_L2_TABLE_ENTRY: - return "QUERY_L2_TABLE_ENTRY"; - - case MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY: - return "DELETE_L2_TABLE_ENTRY"; - - case MLX5_CMD_OP_CREATE_RMP: - return "CREATE_RMP"; - - case MLX5_CMD_OP_MODIFY_RMP: - return "MODIFY_RMP"; - - case MLX5_CMD_OP_DESTROY_RMP: - return "DESTROY_RMP"; - - case MLX5_CMD_OP_QUERY_RMP: - return "QUERY_RMP"; - - case MLX5_CMD_OP_CREATE_RQT: - return "CREATE_RQT"; - - case MLX5_CMD_OP_MODIFY_RQT: - return "MODIFY_RQT"; - - case MLX5_CMD_OP_DESTROY_RQT: - return "DESTROY_RQT"; - - case MLX5_CMD_OP_QUERY_RQT: - return "QUERY_RQT"; - - case MLX5_CMD_OP_ACCESS_REG: - return "MLX5_CMD_OP_ACCESS_REG"; - - case MLX5_CMD_OP_CREATE_SQ: - return "CREATE_SQ"; - - case MLX5_CMD_OP_MODIFY_SQ: - return "MODIFY_SQ"; - - case MLX5_CMD_OP_DESTROY_SQ: - return "DESTROY_SQ"; - - case MLX5_CMD_OP_QUERY_SQ: - return "QUERY_SQ"; - - case MLX5_CMD_OP_CREATE_RQ: - return "CREATE_RQ"; - - case MLX5_CMD_OP_MODIFY_RQ: - return "MODIFY_RQ"; - - case MLX5_CMD_OP_DESTROY_RQ: - return "DESTROY_RQ"; - - case MLX5_CMD_OP_QUERY_RQ: - return "QUERY_RQ"; - - case MLX5_CMD_OP_CREATE_TIR: - return "CREATE_TIR"; - - case MLX5_CMD_OP_MODIFY_TIR: - return "MODIFY_TIR"; - - case MLX5_CMD_OP_DESTROY_TIR: - return "DESTROY_TIR"; - - case MLX5_CMD_OP_QUERY_TIR: - return "QUERY_TIR"; - - case MLX5_CMD_OP_CREATE_TIS: - return "CREATE_TIS"; - - case MLX5_CMD_OP_MODIFY_TIS: - return "MODIFY_TIS"; - - case MLX5_CMD_OP_DESTROY_TIS: - return "DESTROY_TIS"; - - case MLX5_CMD_OP_QUERY_TIS: - return "QUERY_TIS"; - - case MLX5_CMD_OP_CREATE_FLOW_TABLE: - return "CREATE_FLOW_TABLE"; - - case MLX5_CMD_OP_DESTROY_FLOW_TABLE: - return "DESTROY_FLOW_TABLE"; - - case MLX5_CMD_OP_QUERY_FLOW_TABLE: - return "QUERY_FLOW_TABLE"; - - case MLX5_CMD_OP_CREATE_FLOW_GROUP: - return "CREATE_FLOW_GROUP"; - - case MLX5_CMD_OP_DESTROY_FLOW_GROUP: - return "DESTROY_FLOW_GROUP"; - - case MLX5_CMD_OP_QUERY_FLOW_GROUP: - return "QUERY_FLOW_GROUP"; - - case MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY: - return "SET_FLOW_TABLE_ENTRY"; - - case MLX5_CMD_OP_QUERY_FLOW_TABLE_ENTRY: - return "QUERY_FLOW_TABLE_ENTRY"; - - case MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY: - return "DELETE_FLOW_TABLE_ENTRY"; - - case MLX5_CMD_OP_SET_DIAGNOSTICS: - return "MLX5_CMD_OP_SET_DIAGNOSTICS"; - - case MLX5_CMD_OP_QUERY_DIAGNOSTICS: - return "MLX5_CMD_OP_QUERY_DIAGNOSTICS"; - + switch (command) { + MLX5_COMMAND_STR_CASE(QUERY_HCA_CAP); + MLX5_COMMAND_STR_CASE(SET_HCA_CAP); + MLX5_COMMAND_STR_CASE(QUERY_ADAPTER); + MLX5_COMMAND_STR_CASE(INIT_HCA); + MLX5_COMMAND_STR_CASE(TEARDOWN_HCA); + MLX5_COMMAND_STR_CASE(ENABLE_HCA); + MLX5_COMMAND_STR_CASE(DISABLE_HCA); + MLX5_COMMAND_STR_CASE(QUERY_PAGES); + MLX5_COMMAND_STR_CASE(MANAGE_PAGES); + MLX5_COMMAND_STR_CASE(QUERY_ISSI); + MLX5_COMMAND_STR_CASE(SET_ISSI); + MLX5_COMMAND_STR_CASE(CREATE_MKEY); + MLX5_COMMAND_STR_CASE(QUERY_MKEY); + MLX5_COMMAND_STR_CASE(DESTROY_MKEY); + MLX5_COMMAND_STR_CASE(QUERY_SPECIAL_CONTEXTS); + MLX5_COMMAND_STR_CASE(PAGE_FAULT_RESUME); + MLX5_COMMAND_STR_CASE(CREATE_EQ); + MLX5_COMMAND_STR_CASE(DESTROY_EQ); + MLX5_COMMAND_STR_CASE(QUERY_EQ); + MLX5_COMMAND_STR_CASE(GEN_EQE); + MLX5_COMMAND_STR_CASE(CREATE_CQ); + MLX5_COMMAND_STR_CASE(DESTROY_CQ); + MLX5_COMMAND_STR_CASE(QUERY_CQ); + MLX5_COMMAND_STR_CASE(MODIFY_CQ); + MLX5_COMMAND_STR_CASE(CREATE_QP); + MLX5_COMMAND_STR_CASE(DESTROY_QP); + MLX5_COMMAND_STR_CASE(RST2INIT_QP); + MLX5_COMMAND_STR_CASE(INIT2RTR_QP); + MLX5_COMMAND_STR_CASE(RTR2RTS_QP); + MLX5_COMMAND_STR_CASE(RTS2RTS_QP); + MLX5_COMMAND_STR_CASE(SQERR2RTS_QP); + MLX5_COMMAND_STR_CASE(2ERR_QP); + MLX5_COMMAND_STR_CASE(2RST_QP); + MLX5_COMMAND_STR_CASE(QUERY_QP); + MLX5_COMMAND_STR_CASE(SQD_RTS_QP); + MLX5_COMMAND_STR_CASE(MAD_IFC); + MLX5_COMMAND_STR_CASE(INIT2INIT_QP); + MLX5_COMMAND_STR_CASE(CREATE_PSV); + MLX5_COMMAND_STR_CASE(DESTROY_PSV); + MLX5_COMMAND_STR_CASE(CREATE_SRQ); + MLX5_COMMAND_STR_CASE(DESTROY_SRQ); + MLX5_COMMAND_STR_CASE(QUERY_SRQ); + MLX5_COMMAND_STR_CASE(ARM_RQ); + MLX5_COMMAND_STR_CASE(CREATE_XRC_SRQ); + MLX5_COMMAND_STR_CASE(DESTROY_XRC_SRQ); + MLX5_COMMAND_STR_CASE(QUERY_XRC_SRQ); + MLX5_COMMAND_STR_CASE(ARM_XRC_SRQ); + MLX5_COMMAND_STR_CASE(CREATE_DCT); + MLX5_COMMAND_STR_CASE(SET_DC_CNAK_TRACE); + MLX5_COMMAND_STR_CASE(DESTROY_DCT); + MLX5_COMMAND_STR_CASE(DRAIN_DCT); + MLX5_COMMAND_STR_CASE(QUERY_DCT); + MLX5_COMMAND_STR_CASE(ARM_DCT_FOR_KEY_VIOLATION); + MLX5_COMMAND_STR_CASE(QUERY_VPORT_STATE); + MLX5_COMMAND_STR_CASE(MODIFY_VPORT_STATE); + MLX5_COMMAND_STR_CASE(QUERY_ESW_VPORT_CONTEXT); + MLX5_COMMAND_STR_CASE(MODIFY_ESW_VPORT_CONTEXT); + MLX5_COMMAND_STR_CASE(QUERY_NIC_VPORT_CONTEXT); + MLX5_COMMAND_STR_CASE(MODIFY_NIC_VPORT_CONTEXT); + MLX5_COMMAND_STR_CASE(QUERY_ROCE_ADDRESS); + MLX5_COMMAND_STR_CASE(SET_ROCE_ADDRESS); + MLX5_COMMAND_STR_CASE(QUERY_HCA_VPORT_CONTEXT); + MLX5_COMMAND_STR_CASE(MODIFY_HCA_VPORT_CONTEXT); + MLX5_COMMAND_STR_CASE(QUERY_HCA_VPORT_GID); + MLX5_COMMAND_STR_CASE(QUERY_HCA_VPORT_PKEY); + MLX5_COMMAND_STR_CASE(QUERY_VPORT_COUNTER); + MLX5_COMMAND_STR_CASE(SET_WOL_ROL); + MLX5_COMMAND_STR_CASE(QUERY_WOL_ROL); + MLX5_COMMAND_STR_CASE(ALLOC_Q_COUNTER); + MLX5_COMMAND_STR_CASE(DEALLOC_Q_COUNTER); + MLX5_COMMAND_STR_CASE(QUERY_Q_COUNTER); + MLX5_COMMAND_STR_CASE(ALLOC_PD); + MLX5_COMMAND_STR_CASE(DEALLOC_PD); + MLX5_COMMAND_STR_CASE(ALLOC_UAR); + MLX5_COMMAND_STR_CASE(DEALLOC_UAR); + MLX5_COMMAND_STR_CASE(CONFIG_INT_MODERATION); + MLX5_COMMAND_STR_CASE(ATTACH_TO_MCG); + MLX5_COMMAND_STR_CASE(DETACH_FROM_MCG); + MLX5_COMMAND_STR_CASE(GET_DROPPED_PACKET_LOG); + MLX5_COMMAND_STR_CASE(QUERY_MAD_DEMUX); + MLX5_COMMAND_STR_CASE(SET_MAD_DEMUX); + MLX5_COMMAND_STR_CASE(NOP); + MLX5_COMMAND_STR_CASE(ALLOC_XRCD); + MLX5_COMMAND_STR_CASE(DEALLOC_XRCD); + MLX5_COMMAND_STR_CASE(ALLOC_TRANSPORT_DOMAIN); + MLX5_COMMAND_STR_CASE(DEALLOC_TRANSPORT_DOMAIN); + MLX5_COMMAND_STR_CASE(QUERY_CONG_STATUS); + MLX5_COMMAND_STR_CASE(MODIFY_CONG_STATUS); + MLX5_COMMAND_STR_CASE(QUERY_CONG_PARAMS); + MLX5_COMMAND_STR_CASE(MODIFY_CONG_PARAMS); + MLX5_COMMAND_STR_CASE(QUERY_CONG_STATISTICS); + MLX5_COMMAND_STR_CASE(ADD_VXLAN_UDP_DPORT); + MLX5_COMMAND_STR_CASE(DELETE_VXLAN_UDP_DPORT); + MLX5_COMMAND_STR_CASE(SET_L2_TABLE_ENTRY); + MLX5_COMMAND_STR_CASE(QUERY_L2_TABLE_ENTRY); + MLX5_COMMAND_STR_CASE(DELETE_L2_TABLE_ENTRY); + MLX5_COMMAND_STR_CASE(CREATE_RMP); + MLX5_COMMAND_STR_CASE(MODIFY_RMP); + MLX5_COMMAND_STR_CASE(DESTROY_RMP); + MLX5_COMMAND_STR_CASE(QUERY_RMP); + MLX5_COMMAND_STR_CASE(CREATE_RQT); + MLX5_COMMAND_STR_CASE(MODIFY_RQT); + MLX5_COMMAND_STR_CASE(DESTROY_RQT); + MLX5_COMMAND_STR_CASE(QUERY_RQT); + MLX5_COMMAND_STR_CASE(ACCESS_REG); + MLX5_COMMAND_STR_CASE(CREATE_SQ); + MLX5_COMMAND_STR_CASE(MODIFY_SQ); + MLX5_COMMAND_STR_CASE(DESTROY_SQ); + MLX5_COMMAND_STR_CASE(QUERY_SQ); + MLX5_COMMAND_STR_CASE(CREATE_RQ); + MLX5_COMMAND_STR_CASE(MODIFY_RQ); + MLX5_COMMAND_STR_CASE(DESTROY_RQ); + MLX5_COMMAND_STR_CASE(QUERY_RQ); + MLX5_COMMAND_STR_CASE(CREATE_TIR); + MLX5_COMMAND_STR_CASE(MODIFY_TIR); + MLX5_COMMAND_STR_CASE(DESTROY_TIR); + MLX5_COMMAND_STR_CASE(QUERY_TIR); + MLX5_COMMAND_STR_CASE(CREATE_TIS); + MLX5_COMMAND_STR_CASE(MODIFY_TIS); + MLX5_COMMAND_STR_CASE(DESTROY_TIS); + MLX5_COMMAND_STR_CASE(QUERY_TIS); + MLX5_COMMAND_STR_CASE(CREATE_FLOW_TABLE); + MLX5_COMMAND_STR_CASE(DESTROY_FLOW_TABLE); + MLX5_COMMAND_STR_CASE(QUERY_FLOW_TABLE); + MLX5_COMMAND_STR_CASE(CREATE_FLOW_GROUP); + MLX5_COMMAND_STR_CASE(DESTROY_FLOW_GROUP); + MLX5_COMMAND_STR_CASE(QUERY_FLOW_GROUP); + MLX5_COMMAND_STR_CASE(SET_FLOW_TABLE_ENTRY); + MLX5_COMMAND_STR_CASE(QUERY_FLOW_TABLE_ENTRY); + MLX5_COMMAND_STR_CASE(DELETE_FLOW_TABLE_ENTRY); + MLX5_COMMAND_STR_CASE(SET_DIAGNOSTICS); + MLX5_COMMAND_STR_CASE(QUERY_DIAGNOSTICS); default: return "unknown command opcode"; } } From owner-svn-src-head@freebsd.org Wed Mar 7 14: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 B5010F31AA4; Wed, 7 Mar 2018 14:35:28 +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 63B7D770CA; Wed, 7 Mar 2018 14:35:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A63F22A08; Wed, 7 Mar 2018 14:35:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27EZSj5048069; Wed, 7 Mar 2018 14:35:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27EZSvr048068; Wed, 7 Mar 2018 14:35:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071435.w27EZSvr048068@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 Mar 2018 14:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330599 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 330599 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:35:29 -0000 Author: hselasky Date: Wed Mar 7 14:35:28 2018 New Revision: 330599 URL: https://svnweb.freebsd.org/changeset/base/330599 Log: Fix potential deadlock in command mode change in mlx5core. Call command completion handler in case of timeout when working in interrupts mode. Avoid flushing the commands workqueue after acquiring the semaphores to prevent a potential deadlock. linux commit commit 9cba4ebcf374c3772f6eb61f2d065294b2451b49 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed Mar 7 14:29:30 2018 (r330598) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed Mar 7 14:35:28 2018 (r330599) @@ -735,11 +735,6 @@ static void cmd_work_handler(struct work_struct *work) struct semaphore *sem; sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem; - if (cmd->moving_to_polling) { - mlx5_core_warn(dev, "not expecting command execution, ignoring...\n"); - return; - } - down(sem); if (alloc_ent(ent) < 0) { @@ -826,13 +821,13 @@ static int wait_func(struct mlx5_core_dev *dev, struct if (cmd->mode == CMD_MODE_POLLING) { wait_for_completion(&ent->done); err = ent->ret; - } else { - if (!wait_for_completion_timeout(&ent->done, timeout)) - err = -ETIMEDOUT; - else - err = 0; - } + } else if (!wait_for_completion_timeout(&ent->done, timeout)) { + ent->ret = -ETIMEDOUT; + mlx5_cmd_comp_handler(dev, 1UL << ent->idx); + } + err = ent->ret; + if (err == -ETIMEDOUT) { mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command resource\n", mlx5_command_str(msg_to_opcode(ent->in)), @@ -881,27 +876,28 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, goto out_free; } - if (!callback) { - err = wait_func(dev, ent); - if (err == -ETIMEDOUT) - goto out; + if (callback) + goto out; - ds = ent->ts2 - ent->ts1; - op = be16_to_cpu(((struct mlx5_inbox_hdr *)in->first.data)->opcode); - if (op < ARRAY_SIZE(cmd->stats)) { - stats = &cmd->stats[op]; - spin_lock_irq(&stats->lock); - stats->sum += ds; - ++stats->n; - spin_unlock_irq(&stats->lock); - } - mlx5_core_dbg_mask(dev, 1 << MLX5_CMD_TIME, - "fw exec time for %s is %lld nsec\n", - mlx5_command_str(op), (long long)ds); - *status = ent->status; - free_cmd(ent); - } + err = wait_func(dev, ent); + if (err == -ETIMEDOUT) + goto out; + ds = ent->ts2 - ent->ts1; + op = be16_to_cpu(((struct mlx5_inbox_hdr *)in->first.data)->opcode); + if (op < ARRAY_SIZE(cmd->stats)) { + stats = &cmd->stats[op]; + spin_lock_irq(&stats->lock); + stats->sum += ds; + ++stats->n; + spin_unlock_irq(&stats->lock); + } + mlx5_core_dbg_mask(dev, 1 << MLX5_CMD_TIME, + "fw exec time for %s is %lld nsec\n", + mlx5_command_str(op), (long long)ds); + *status = ent->status; + free_cmd(ent); + return err; out_free: @@ -1017,7 +1013,7 @@ static void clean_debug_files(struct mlx5_core_dev *de } -void mlx5_cmd_use_events(struct mlx5_core_dev *dev) +static void mlx5_cmd_change_mod(struct mlx5_core_dev *dev, int mode) { struct mlx5_cmd *cmd = &dev->cmd; int i; @@ -1026,26 +1022,21 @@ void mlx5_cmd_use_events(struct mlx5_core_dev *dev) down(&cmd->sem); down(&cmd->pages_sem); + cmd->mode = mode; - flush_workqueue(cmd->wq); - - cmd->mode = CMD_MODE_EVENTS; - up(&cmd->pages_sem); for (i = 0; i < cmd->max_reg_cmds; i++) up(&cmd->sem); } -void mlx5_cmd_use_polling(struct mlx5_core_dev *dev) +void mlx5_cmd_use_events(struct mlx5_core_dev *dev) { - struct mlx5_cmd *cmd = &dev->cmd; + mlx5_cmd_change_mod(dev, CMD_MODE_EVENTS); +} - synchronize_irq(dev->priv.eq_table.pages_eq.irqn); - flush_workqueue(dev->priv.pg_wq); - cmd->moving_to_polling = 1; - flush_workqueue(cmd->wq); - cmd->mode = CMD_MODE_POLLING; - cmd->moving_to_polling = 0; +void mlx5_cmd_use_polling(struct mlx5_core_dev *dev) +{ + mlx5_cmd_change_mod(dev, CMD_MODE_POLLING); } static void free_msg(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *msg) From owner-svn-src-head@freebsd.org Wed Mar 7 14:41: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 01EF1F323F0; Wed, 7 Mar 2018 14:41:30 +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 A964677571; Wed, 7 Mar 2018 14:41:29 +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 A291A22A79; Wed, 7 Mar 2018 14:41:29 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27EfTA5049943; Wed, 7 Mar 2018 14:41:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27EfTIm049941; Wed, 7 Mar 2018 14:41:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071441.w27EfTIm049941@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 Mar 2018 14:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330600 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 330600 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:41:30 -0000 Author: hselasky Date: Wed Mar 7 14:41:29 2018 New Revision: 330600 URL: https://svnweb.freebsd.org/changeset/base/330600 Log: Add timeout handle to commands with callback in mlx5core. The current implementation does not handle timeout in case of command with callback request, and this can lead to deadlock if the command doesn't get firmware response. Add delayed callback timeout work before posting the command to firmware. In case of real firmware command completion we will cancel the delayed work. In case of firmware command timeout the callback timeout handler will be called and it will simulate firmware completion with timeout error. linux commit 65ee67084589c1783a74b4a4a5db38d7264ec8b5 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Mar 7 14:35:28 2018 (r330599) +++ head/sys/dev/mlx5/driver.h Wed Mar 7 14:41:29 2018 (r330600) @@ -727,6 +727,7 @@ struct mlx5_cmd_work_ent { void *uout; int uout_size; mlx5_cmd_cbk_t callback; + struct delayed_work cb_timeout_work; void *context; int idx; struct completion done; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed Mar 7 14:35:28 2018 (r330599) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Wed Mar 7 14:41:29 2018 (r330600) @@ -246,6 +246,7 @@ static void poll_timeout(struct mlx5_cmd_work_ent *ent static void free_cmd(struct mlx5_cmd_work_ent *ent) { + cancel_delayed_work_sync(&ent->cb_timeout_work); kfree(ent); } @@ -499,6 +500,30 @@ static void dump_command(struct mlx5_core_dev *dev, pr_debug("\n"); } +static u16 msg_to_opcode(struct mlx5_cmd_msg *in) +{ + struct mlx5_inbox_hdr *hdr = (struct mlx5_inbox_hdr *)(in->first.data); + + return be16_to_cpu(hdr->opcode); +} + +static void cb_timeout_handler(struct work_struct *work) +{ + struct delayed_work *dwork = container_of(work, struct delayed_work, + work); + struct mlx5_cmd_work_ent *ent = container_of(dwork, + struct mlx5_cmd_work_ent, + cb_timeout_work); + struct mlx5_core_dev *dev = container_of(ent->cmd, struct mlx5_core_dev, + cmd); + + ent->ret = -ETIMEDOUT; + mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command resource\n", + mlx5_command_str(msg_to_opcode(ent->in)), + msg_to_opcode(ent->in)); + mlx5_cmd_comp_handler(dev, 1UL << ent->idx); +} + static int set_internal_err_outbox(struct mlx5_core_dev *dev, u16 opcode, struct mlx5_outbox_hdr *hdr) { @@ -731,6 +756,7 @@ static void cmd_work_handler(struct work_struct *work) struct mlx5_cmd_work_ent *ent = container_of(work, struct mlx5_cmd_work_ent, work); struct mlx5_cmd *cmd = ent->cmd; struct mlx5_core_dev *dev = container_of(cmd, struct mlx5_core_dev, cmd); + unsigned long cb_timeout = msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC); struct mlx5_cmd_layout *lay; struct semaphore *sem; @@ -761,6 +787,9 @@ static void cmd_work_handler(struct work_struct *work) dump_command(dev, ent, 1); ent->ts1 = ktime_get_ns(); ent->busy = 0; + if (ent->callback) + schedule_delayed_work(&ent->cb_timeout_work, cb_timeout); + /* ring doorbell after the descriptor is valid */ mlx5_core_dbg(dev, "writing 0x%x to command doorbell\n", 1 << ent->idx); /* make sure data is written to RAM */ @@ -805,13 +834,6 @@ static const char *deliv_status_to_str(u8 status) } } -static u16 msg_to_opcode(struct mlx5_cmd_msg *in) -{ - struct mlx5_inbox_hdr *hdr = (struct mlx5_inbox_hdr *)(in->first.data); - - return be16_to_cpu(hdr->opcode); -} - static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent) { int timeout = msecs_to_jiffies(MLX5_CMD_TIMEOUT_MSEC); @@ -867,6 +889,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, if (!callback) init_completion(&ent->done); + INIT_DELAYED_WORK(&ent->cb_timeout_work, cb_timeout_handler); INIT_WORK(&ent->work, cmd_work_handler); if (page_queue) { cmd_work_handler(&ent->work); @@ -1065,6 +1088,8 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, i = ffs(vector) - 1; vector &= ~(1U << i); ent = cmd->ent_arr[i]; + if (ent->callback) + cancel_delayed_work(&ent->cb_timeout_work); ent->ts2 = ktime_get_ns(); memcpy(ent->out->first.data, ent->lay->out, sizeof(ent->lay->out)); From owner-svn-src-head@freebsd.org Wed Mar 7 14: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 311ABF32A63; Wed, 7 Mar 2018 14:44:33 +0000 (UTC) (envelope-from eadler@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 D934577B19; Wed, 7 Mar 2018 14:44:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D42EF22BD1; Wed, 7 Mar 2018 14:44:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27EiWHL053245; Wed, 7 Mar 2018 14:44:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27EiWBV053244; Wed, 7 Mar 2018 14:44:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803071444.w27EiWBV053244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 7 Mar 2018 14:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330601 - head/sys/i386/ibcs2 X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/i386/ibcs2 X-SVN-Commit-Revision: 330601 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:44:33 -0000 Author: eadler Date: Wed Mar 7 14:44:32 2018 New Revision: 330601 URL: https://svnweb.freebsd.org/changeset/base/330601 Log: sys: Fix a few potential infoleaks in cloudabi While there is no immediate leak, if the structure changes underneath us, there might be in the future. Submitted by: Domagoj Stolfa MFC After: 1 month Sponsored by: DARPA/AFRL Modified: head/sys/i386/ibcs2/ibcs2_ipc.c Modified: head/sys/i386/ibcs2/ibcs2_ipc.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar 7 14:41:29 2018 (r330600) +++ head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar 7 14:44:32 2018 (r330601) @@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v) struct msqid_ds bs; int error; + memset(&is, 0, sizeof(is)); + switch (uap->cmd) { case IBCS2_IPC_STAT: error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs); @@ -317,6 +319,8 @@ ibcs2_semctl(struct thread *td, void *v) union semun semun; register_t rval; int error; + + memset(&is, 0, sizeof(is)); switch(uap->cmd) { case IBCS2_IPC_STAT: From owner-svn-src-head@freebsd.org Wed Mar 7 14:47: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 4E619F32ED7; Wed, 7 Mar 2018 14:47:44 +0000 (UTC) (envelope-from eadler@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 E92FA77DD5; Wed, 7 Mar 2018 14:47:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E445322BD4; Wed, 7 Mar 2018 14:47:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27Elhlv053394; Wed, 7 Mar 2018 14:47:43 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27Elh7C053393; Wed, 7 Mar 2018 14:47:43 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803071447.w27Elh7C053393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 7 Mar 2018 14:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330602 - head/sys/compat/cloudabi X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/compat/cloudabi X-SVN-Commit-Revision: 330602 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:47:44 -0000 Author: eadler Date: Wed Mar 7 14:47:43 2018 New Revision: 330602 URL: https://svnweb.freebsd.org/changeset/base/330602 Log: sys/cloudabi: Avoid relying on GNU specific extensions An empty initializer list is not technically valid C grammar. MFC After: 1 week Modified: head/sys/compat/cloudabi/cloudabi_fd.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Wed Mar 7 14:44:32 2018 (r330601) +++ head/sys/compat/cloudabi/cloudabi_fd.c Wed Mar 7 14:47:43 2018 (r330602) @@ -382,7 +382,7 @@ int cloudabi_sys_fd_stat_get(struct thread *td, struct cloudabi_sys_fd_stat_get_args *uap) { - cloudabi_fdstat_t fsb = {}; + cloudabi_fdstat_t fsb = {0}; struct file *fp; cap_rights_t rights; struct filecaps fcaps; From owner-svn-src-head@freebsd.org Wed Mar 7 14:49: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 8649FF331B1; Wed, 7 Mar 2018 14:49:28 +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 3C4AB7805F; Wed, 7 Mar 2018 14:49:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3748F22BD6; Wed, 7 Mar 2018 14:49:28 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27EnS5O053492; Wed, 7 Mar 2018 14:49:28 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27EnSO9053491; Wed, 7 Mar 2018 14:49:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071449.w27EnSO9053491@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 Mar 2018 14:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330603 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 330603 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:49:28 -0000 Author: hselasky Date: Wed Mar 7 14:49:27 2018 New Revision: 330603 URL: https://svnweb.freebsd.org/changeset/base/330603 Log: Make sure default VNET is set when adding a new interface in mlx5core. Adding an interface might be done outside the device_attach() routine and will then cause a panic, due to the VNET not being set. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Mar 7 14:47:43 2018 (r330602) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Wed Mar 7 14:49:27 2018 (r330603) @@ -956,7 +956,9 @@ static void mlx5_add_device(struct mlx5_interface *int dev_ctx = kmalloc(sizeof(*dev_ctx), GFP_KERNEL); dev_ctx->intf = intf; + CURVNET_SET_QUIET(vnet0); dev_ctx->context = intf->add(dev); + CURVNET_RESTORE(); if (dev_ctx->context) { spin_lock_irq(&priv->ctx_lock); From owner-svn-src-head@freebsd.org Wed Mar 7 14:51: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 9075DF335CE; Wed, 7 Mar 2018 14:51:51 +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 4582178473; Wed, 7 Mar 2018 14:51:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 405BB22D46; Wed, 7 Mar 2018 14:51:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27Epp3k057973; Wed, 7 Mar 2018 14:51:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27Epoui057968; Wed, 7 Mar 2018 14:51:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071451.w27Epoui057968@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 Mar 2018 14:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330604 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 330604 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:51:51 -0000 Author: hselasky Date: Wed Mar 7 14:51:50 2018 New Revision: 330604 URL: https://svnweb.freebsd.org/changeset/base/330604 Log: Add log message for unsupported QSFPs in mlx5core. Submitted by: Matthew Finlay MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Wed Mar 7 14:49:27 2018 (r330603) +++ head/sys/dev/mlx5/device.h Wed Mar 7 14:51:50 2018 (r330604) @@ -501,9 +501,10 @@ struct mlx5_eqe_vport_change { #define PORT_MODULE_EVENT_ERROR_TYPE_MASK 0xF enum { - MLX5_MODULE_STATUS_PLUGGED = 0x1, - MLX5_MODULE_STATUS_UNPLUGGED = 0x2, - MLX5_MODULE_STATUS_ERROR = 0x3, + MLX5_MODULE_STATUS_PLUGGED_ENABLED = 0x1, + MLX5_MODULE_STATUS_UNPLUGGED = 0x2, + MLX5_MODULE_STATUS_ERROR = 0x3, + MLX5_MODULE_STATUS_PLUGGED_DISABLED = 0x4, }; enum { @@ -512,7 +513,7 @@ enum { MLX5_MODULE_EVENT_ERROR_BUS_STUCK = 0x2, MLX5_MODULE_EVENT_ERROR_NO_EEPROM_RETRY_TIMEOUT = 0x3, MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST = 0x4, - MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER = 0x5, + MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, }; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Mar 7 14:49:27 2018 (r330603) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Mar 7 14:51:50 2018 (r330604) @@ -618,8 +618,8 @@ static const char *mlx5_port_module_event_error_type_t return "No EEPROM/retry timeout"; case MLX5_MODULE_EVENT_ERROR_ENFORCE_PART_NUMBER_LIST: return "Enforce part number list"; - case MLX5_MODULE_EVENT_ERROR_UNKNOWN_IDENTIFIER: - return "Unknown identifier"; + case MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE: + return "Unsupported Cable"; case MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE: return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: @@ -655,8 +655,8 @@ static void mlx5_port_module_event(struct mlx5_core_de PORT_MODULE_EVENT_ERROR_TYPE_MASK; switch (module_status) { - case MLX5_MODULE_STATUS_PLUGGED: - device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged\n", module_num); + case MLX5_MODULE_STATUS_PLUGGED_ENABLED: + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged and enabled\n", module_num); break; case MLX5_MODULE_STATUS_UNPLUGGED: @@ -665,6 +665,10 @@ static void mlx5_port_module_event(struct mlx5_core_de case MLX5_MODULE_STATUS_ERROR: device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: error, %s\n", module_num, mlx5_port_module_event_error_type_to_string(error_type)); + break; + + case MLX5_MODULE_STATUS_PLUGGED_DISABLED: + device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, status: plugged but disabled\n", module_num); break; default: Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Mar 7 14:49:27 2018 (r330603) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Mar 7 14:51:50 2018 (r330604) @@ -2639,6 +2639,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t int error = 0; int mask = 0; int size_read = 0; + int module_status; int module_num; int max_mtu; uint8_t read_addr; @@ -2838,8 +2839,9 @@ out: goto err_i2c; } /* Check if module is present before doing an access */ - if (mlx5_query_module_status(priv->mdev, module_num) != - MLX5_MODULE_STATUS_PLUGGED) { + module_status = mlx5_query_module_status(priv->mdev, module_num); + if (module_status != MLX5_MODULE_STATUS_PLUGGED_ENABLED && + module_status != MLX5_MODULE_STATUS_PLUGGED_DISABLED) { error = EINVAL; goto err_i2c; } From owner-svn-src-head@freebsd.org Wed Mar 7 15:03: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 1232BF3477D; Wed, 7 Mar 2018 15:03:13 +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 BCBFD792C2; Wed, 7 Mar 2018 15:03:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B783B22F2C; Wed, 7 Mar 2018 15:03:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27F3CNw063731; Wed, 7 Mar 2018 15:03:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27F3Cbs063724; Wed, 7 Mar 2018 15:03:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071503.w27F3Cbs063724@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 Mar 2018 15:03:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330606 - in head/sys/dev/mlx5: . mlx5_core mlx5_en mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en mlx5_ib X-SVN-Commit-Revision: 330606 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:03:13 -0000 Author: hselasky Date: Wed Mar 7 15:03:11 2018 New Revision: 330606 URL: https://svnweb.freebsd.org/changeset/base/330606 Log: Implement missing query for current port rate in mlx5ib(4). - Factor out port speed definitions into new port.h header file, similarly as done in Linux upstream. - Correct two existing port speed definitions in mlx5en according to Linux upstream. MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/sys/dev/mlx5/port.h (contents, props changed) Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Wed Mar 7 15:02:13 2018 (r330605) +++ head/sys/dev/mlx5/driver.h Wed Mar 7 15:03:11 2018 (r330606) @@ -928,41 +928,7 @@ int mlx5_core_access_reg(struct mlx5_core_dev *dev, vo u16 reg_num, int arg, int write); void mlx5_toggle_port_link(struct mlx5_core_dev *dev); -int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps); -int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys, - int ptys_size, int proto_mask); -int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev, - u32 *proto_cap, int proto_mask); -int mlx5_query_port_autoneg(struct mlx5_core_dev *dev, int proto_mask, - u8 *an_disable_cap, u8 *an_disable_status); -int mlx5_set_port_autoneg(struct mlx5_core_dev *dev, bool disable, - u32 eth_proto_admin, int proto_mask); -int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev, - u32 *proto_admin, int proto_mask); -int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin, - int proto_mask); -int mlx5_set_port_status(struct mlx5_core_dev *dev, - enum mlx5_port_status status); -int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status); -int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, - enum mlx5_port_status *status); -int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 port, - u32 rx_pause, u32 tx_pause); -int mlx5_query_port_pause(struct mlx5_core_dev *dev, u32 port, - u32 *rx_pause, u32 *tx_pause); -int mlx5_set_port_pfc(struct mlx5_core_dev *dev, u8 pfc_en_tx, u8 pfc_en_rx); -int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 *pfc_en_rx); -int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu); -int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu); -int mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu); - -unsigned int mlx5_query_module_status(struct mlx5_core_dev *dev, int module_num); -int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num); -int mlx5_query_eeprom(struct mlx5_core_dev *dev, int i2c_addr, int page_num, - int device_addr, int size, int module_num, u32 *data, - int *size_read); - int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq); void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq); int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, @@ -1067,8 +1033,4 @@ static inline int mlx5_core_is_pf(struct mlx5_core_dev return !(dev->priv.pci_dev_data & MLX5_PCI_DEV_IS_VF); } -#define MLX5_EEPROM_MAX_BYTES 32 -#define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff -#define MLX5_EEPROM_REVISION_ID_BYTE_MASK 0x0000ff00 -#define MLX5_EEPROM_PAGE_3_VALID_BIT_MASK 0x00040000 #endif /* MLX5_DRIVER_H */ Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Mar 7 15:02:13 2018 (r330605) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Wed Mar 7 15:03:11 2018 (r330606) @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include "mlx5_core.h" Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar 7 15:02:13 2018 (r330605) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar 7 15:03:11 2018 (r330606) @@ -26,7 +26,7 @@ */ #include -#include +#include #include "mlx5_core.h" int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in, @@ -110,13 +110,13 @@ int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 p EXPORT_SYMBOL_GPL(mlx5_set_port_caps); int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys, - int ptys_size, int proto_mask) + int ptys_size, int proto_mask, u8 local_port) { u32 in[MLX5_ST_SZ_DW(ptys_reg)]; int err; memset(in, 0, sizeof(in)); - MLX5_SET(ptys_reg, in, local_port, 1); + MLX5_SET(ptys_reg, in, local_port, local_port); MLX5_SET(ptys_reg, in, proto_mask, proto_mask); err = mlx5_core_access_reg(dev, in, sizeof(in), ptys, @@ -132,7 +132,7 @@ int mlx5_query_port_proto_cap(struct mlx5_core_dev *de u32 out[MLX5_ST_SZ_DW(ptys_reg)]; int err; - err = mlx5_query_port_ptys(dev, out, sizeof(out), proto_mask); + err = mlx5_query_port_ptys(dev, out, sizeof(out), proto_mask, 1); if (err) return err; @@ -151,7 +151,7 @@ int mlx5_query_port_autoneg(struct mlx5_core_dev *dev, u32 out[MLX5_ST_SZ_DW(ptys_reg)]; int err; - err = mlx5_query_port_ptys(dev, out, sizeof(out), proto_mask); + err = mlx5_query_port_ptys(dev, out, sizeof(out), proto_mask, 1); if (err) return err; @@ -198,7 +198,7 @@ int mlx5_query_port_proto_admin(struct mlx5_core_dev * u32 out[MLX5_ST_SZ_DW(ptys_reg)]; int err; - err = mlx5_query_port_ptys(dev, out, sizeof(out), proto_mask); + err = mlx5_query_port_ptys(dev, out, sizeof(out), proto_mask, 1); if (err) return err; @@ -210,6 +210,23 @@ int mlx5_query_port_proto_admin(struct mlx5_core_dev * return 0; } EXPORT_SYMBOL_GPL(mlx5_query_port_proto_admin); + +int mlx5_query_port_eth_proto_oper(struct mlx5_core_dev *dev, + u32 *proto_oper, u8 local_port) +{ + u32 out[MLX5_ST_SZ_DW(ptys_reg)]; + int err; + + err = mlx5_query_port_ptys(dev, out, sizeof(out), MLX5_PTYS_EN, + local_port); + if (err) + return err; + + *proto_oper = MLX5_GET(ptys_reg, out, eth_proto_oper); + + return 0; +} +EXPORT_SYMBOL(mlx5_query_port_eth_proto_oper); int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin, int proto_mask) Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Mar 7 15:02:13 2018 (r330605) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Mar 7 15:03:11 2018 (r330606) @@ -62,6 +62,7 @@ #include #include #include +#include #include #include @@ -747,37 +748,6 @@ struct mlx5e_eeprom { u32 *data; }; -enum mlx5e_link_mode { - MLX5E_1000BASE_CX_SGMII = 0, - MLX5E_1000BASE_KX = 1, - MLX5E_10GBASE_CX4 = 2, - MLX5E_10GBASE_KX4 = 3, - MLX5E_10GBASE_KR = 4, - MLX5E_20GBASE_KR2 = 5, - MLX5E_40GBASE_CR4 = 6, - MLX5E_40GBASE_KR4 = 7, - MLX5E_56GBASE_R4 = 8, - MLX5E_10GBASE_CR = 12, - MLX5E_10GBASE_SR = 13, - MLX5E_10GBASE_LR = 14, - MLX5E_40GBASE_SR4 = 15, - MLX5E_40GBASE_LR4 = 16, - MLX5E_100GBASE_CR4 = 20, - MLX5E_100GBASE_SR4 = 21, - MLX5E_100GBASE_KR4 = 22, - MLX5E_100GBASE_LR4 = 23, - MLX5E_100BASE_TX = 24, - MLX5E_100BASE_T = 25, - MLX5E_10GBASE_T = 26, - MLX5E_25GBASE_CR = 27, - MLX5E_25GBASE_KR = 28, - MLX5E_25GBASE_SR = 29, - MLX5E_50GBASE_CR2 = 30, - MLX5E_50GBASE_KR2 = 31, - MLX5E_LINK_MODES_NUMBER, -}; - -#define MLX5E_PROT_MASK(link_mode) (1 << (link_mode)) #define MLX5E_FLD_MAX(typ, fld) ((1ULL << __mlx5_bit_sz(typ, fld)) - 1ULL) int mlx5e_xmit(struct ifnet *, struct mbuf *); Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Mar 7 15:02:13 2018 (r330605) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Wed Mar 7 15:03:11 2018 (r330606) @@ -90,8 +90,8 @@ static const struct { .subtype = IFM_10G_SR, .baudrate = IF_Gbps(10ULL), }, - [MLX5E_10GBASE_LR] = { - .subtype = IFM_10G_LR, + [MLX5E_10GBASE_ER] = { + .subtype = IFM_10G_ER, .baudrate = IF_Gbps(10ULL), }, [MLX5E_40GBASE_SR4] = { @@ -122,9 +122,9 @@ static const struct { .subtype = IFM_100_TX, .baudrate = IF_Mbps(100ULL), }, - [MLX5E_100BASE_T] = { - .subtype = IFM_100_T, - .baudrate = IF_Mbps(100ULL), + [MLX5E_1000BASE_T] = { + .subtype = IFM_1000_T, + .baudrate = IF_Mbps(1000ULL), }, [MLX5E_10GBASE_T] = { .subtype = IFM_10G_T, @@ -178,7 +178,7 @@ mlx5e_update_carrier(struct mlx5e_priv *priv) return; } - error = mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_EN); + error = mlx5_query_port_ptys(mdev, out, sizeof(out), MLX5_PTYS_EN, 1); if (error) { priv->media_active_last = IFM_ETHER; priv->ifp->if_baudrate = 1; Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed Mar 7 15:02:13 2018 (r330605) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Wed Mar 7 15:03:11 2018 (r330606) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -164,6 +165,64 @@ static struct net_device *mlx5_ib_get_netdev(struct ib return ndev; } +static int translate_eth_proto_oper(u32 eth_proto_oper, u8 *active_speed, + u8 *active_width) +{ + switch (eth_proto_oper) { + case MLX5E_PROT_MASK(MLX5E_1000BASE_CX_SGMII): + case MLX5E_PROT_MASK(MLX5E_1000BASE_KX): + case MLX5E_PROT_MASK(MLX5E_100BASE_TX): + case MLX5E_PROT_MASK(MLX5E_1000BASE_T): + *active_width = IB_WIDTH_1X; + *active_speed = IB_SPEED_SDR; + break; + case MLX5E_PROT_MASK(MLX5E_10GBASE_T): + case MLX5E_PROT_MASK(MLX5E_10GBASE_CX4): + case MLX5E_PROT_MASK(MLX5E_10GBASE_KX4): + case MLX5E_PROT_MASK(MLX5E_10GBASE_KR): + case MLX5E_PROT_MASK(MLX5E_10GBASE_CR): + case MLX5E_PROT_MASK(MLX5E_10GBASE_SR): + case MLX5E_PROT_MASK(MLX5E_10GBASE_ER): + *active_width = IB_WIDTH_1X; + *active_speed = IB_SPEED_QDR; + break; + case MLX5E_PROT_MASK(MLX5E_25GBASE_CR): + case MLX5E_PROT_MASK(MLX5E_25GBASE_KR): + case MLX5E_PROT_MASK(MLX5E_25GBASE_SR): + *active_width = IB_WIDTH_1X; + *active_speed = IB_SPEED_EDR; + break; + case MLX5E_PROT_MASK(MLX5E_40GBASE_CR4): + case MLX5E_PROT_MASK(MLX5E_40GBASE_KR4): + case MLX5E_PROT_MASK(MLX5E_40GBASE_SR4): + case MLX5E_PROT_MASK(MLX5E_40GBASE_LR4): + *active_width = IB_WIDTH_4X; + *active_speed = IB_SPEED_QDR; + break; + case MLX5E_PROT_MASK(MLX5E_50GBASE_CR2): + case MLX5E_PROT_MASK(MLX5E_50GBASE_KR2): + case MLX5E_PROT_MASK(MLX5E_50GBASE_SR2): + *active_width = IB_WIDTH_1X; + *active_speed = IB_SPEED_HDR; + break; + case MLX5E_PROT_MASK(MLX5E_56GBASE_R4): + *active_width = IB_WIDTH_4X; + *active_speed = IB_SPEED_FDR; + break; + case MLX5E_PROT_MASK(MLX5E_100GBASE_CR4): + case MLX5E_PROT_MASK(MLX5E_100GBASE_SR4): + case MLX5E_PROT_MASK(MLX5E_100GBASE_KR4): + case MLX5E_PROT_MASK(MLX5E_100GBASE_LR4): + *active_width = IB_WIDTH_4X; + *active_speed = IB_SPEED_EDR; + break; + default: + return -EINVAL; + } + + return 0; +} + static int mlx5_query_port_roce(struct ib_device *device, u8 port_num, struct ib_port_attr *props) { @@ -171,9 +230,21 @@ static int mlx5_query_port_roce(struct ib_device *devi struct net_device *ndev; enum ib_mtu ndev_ib_mtu; u16 qkey_viol_cntr; + u32 eth_prot_oper; + int err; memset(props, 0, sizeof(*props)); + /* Possible bad flows are checked before filling out props so in case + * of an error it will still be zeroed out. + */ + err = mlx5_query_port_eth_proto_oper(dev->mdev, ð_prot_oper, port_num); + if (err) + return err; + + translate_eth_proto_oper(eth_prot_oper, &props->active_speed, + &props->active_width); + props->port_cap_flags |= IB_PORT_CM_SUP; props->port_cap_flags |= IB_PORT_IP_BASED_GIDS; @@ -202,10 +273,6 @@ static int mlx5_query_port_roce(struct ib_device *devi dev_put(ndev); props->active_mtu = min(props->max_mtu, ndev_ib_mtu); - - props->active_width = IB_WIDTH_4X; /* TODO */ - props->active_speed = IB_SPEED_QDR; /* TODO */ - return 0; } Added: head/sys/dev/mlx5/port.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/port.h Wed Mar 7 15:03:11 2018 (r330606) @@ -0,0 +1,147 @@ +/*- + * Copyright (c) 2016, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __MLX5_PORT_H__ +#define __MLX5_PORT_H__ + +#include + +enum mlx5_beacon_duration { + MLX5_BEACON_DURATION_OFF = 0x0, + MLX5_BEACON_DURATION_INF = 0xffff, +}; + +enum mlx5_module_id { + MLX5_MODULE_ID_SFP = 0x3, + MLX5_MODULE_ID_QSFP = 0xC, + MLX5_MODULE_ID_QSFP_PLUS = 0xD, + MLX5_MODULE_ID_QSFP28 = 0x11, +}; + +enum mlx5_an_status { + MLX5_AN_UNAVAILABLE = 0, + MLX5_AN_COMPLETE = 1, + MLX5_AN_FAILED = 2, + MLX5_AN_LINK_UP = 3, + MLX5_AN_LINK_DOWN = 4, +}; + +#define MLX5_EEPROM_MAX_BYTES 32 +#define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff +#define MLX5_EEPROM_REVISION_ID_BYTE_MASK 0x0000ff00 +#define MLX5_EEPROM_PAGE_3_VALID_BIT_MASK 0x00040000 +#define MLX5_I2C_ADDR_LOW 0x50 +#define MLX5_I2C_ADDR_HIGH 0x51 +#define MLX5_EEPROM_PAGE_LENGTH 256 + +enum mlx5e_link_mode { + MLX5E_1000BASE_CX_SGMII = 0, + MLX5E_1000BASE_KX = 1, + MLX5E_10GBASE_CX4 = 2, + MLX5E_10GBASE_KX4 = 3, + MLX5E_10GBASE_KR = 4, + MLX5E_20GBASE_KR2 = 5, + MLX5E_40GBASE_CR4 = 6, + MLX5E_40GBASE_KR4 = 7, + MLX5E_56GBASE_R4 = 8, + MLX5E_10GBASE_CR = 12, + MLX5E_10GBASE_SR = 13, + MLX5E_10GBASE_ER = 14, + MLX5E_40GBASE_SR4 = 15, + MLX5E_40GBASE_LR4 = 16, + MLX5E_50GBASE_SR2 = 18, + MLX5E_100GBASE_CR4 = 20, + MLX5E_100GBASE_SR4 = 21, + MLX5E_100GBASE_KR4 = 22, + MLX5E_100GBASE_LR4 = 23, + MLX5E_100BASE_TX = 24, + MLX5E_1000BASE_T = 25, + MLX5E_10GBASE_T = 26, + MLX5E_25GBASE_CR = 27, + MLX5E_25GBASE_KR = 28, + MLX5E_25GBASE_SR = 29, + MLX5E_50GBASE_CR2 = 30, + MLX5E_50GBASE_KR2 = 31, + MLX5E_LINK_MODES_NUMBER, +}; + +enum mlx5e_connector_type { + MLX5E_PORT_UNKNOWN = 0, + MLX5E_PORT_NONE = 1, + MLX5E_PORT_TP = 2, + MLX5E_PORT_AUI = 3, + MLX5E_PORT_BNC = 4, + MLX5E_PORT_MII = 5, + MLX5E_PORT_FIBRE = 6, + MLX5E_PORT_DA = 7, + MLX5E_PORT_OTHER = 8, + MLX5E_CONNECTOR_TYPE_NUMBER, +}; + +#define MLX5E_PROT_MASK(link_mode) (1 << (link_mode)) + +#define PORT_MODULE_EVENT_MODULE_STATUS_MASK 0xF +#define PORT_MODULE_EVENT_ERROR_TYPE_MASK 0xF + +int mlx5_set_port_caps(struct mlx5_core_dev *dev, u8 port_num, u32 caps); +int mlx5_query_port_ptys(struct mlx5_core_dev *dev, u32 *ptys, + int ptys_size, int proto_mask, u8 local_port); +int mlx5_query_port_proto_cap(struct mlx5_core_dev *dev, + u32 *proto_cap, int proto_mask); +int mlx5_query_port_autoneg(struct mlx5_core_dev *dev, int proto_mask, + u8 *an_disable_cap, u8 *an_disable_status); +int mlx5_set_port_autoneg(struct mlx5_core_dev *dev, bool disable, + u32 eth_proto_admin, int proto_mask); +int mlx5_query_port_proto_admin(struct mlx5_core_dev *dev, + u32 *proto_admin, int proto_mask); +int mlx5_query_port_eth_proto_oper(struct mlx5_core_dev *dev, + u32 *proto_oper, u8 local_port); +int mlx5_set_port_proto(struct mlx5_core_dev *dev, u32 proto_admin, + int proto_mask); +int mlx5_set_port_status(struct mlx5_core_dev *dev, + enum mlx5_port_status status); +int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status); +int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, + enum mlx5_port_status *status); +int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 port, + u32 rx_pause, u32 tx_pause); +int mlx5_query_port_pause(struct mlx5_core_dev *dev, u32 port, + u32 *rx_pause, u32 *tx_pause); +int mlx5_set_port_pfc(struct mlx5_core_dev *dev, u8 pfc_en_tx, u8 pfc_en_rx); +int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 *pfc_en_rx); + +int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu); +int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu); +int mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu); + +unsigned int mlx5_query_module_status(struct mlx5_core_dev *dev, int module_num); +int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num); +int mlx5_query_eeprom(struct mlx5_core_dev *dev, int i2c_addr, int page_num, + int device_addr, int size, int module_num, u32 *data, + int *size_read); + +#endif /* __MLX5_PORT_H__ */ From owner-svn-src-head@freebsd.org Wed Mar 7 15:17: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 1CD8DF36012; Wed, 7 Mar 2018 15:17:38 +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 C4BAC7A2A5; Wed, 7 Mar 2018 15:17:37 +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 BF9CD230D2; Wed, 7 Mar 2018 15:17:37 +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 w27FHb2h069595; Wed, 7 Mar 2018 15:17:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27FHbPw069590; Wed, 7 Mar 2018 15:17:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071517.w27FHbPw069590@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 Mar 2018 15:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330607 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 330607 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:17:38 -0000 Author: hselasky Date: Wed Mar 7 15:17:36 2018 New Revision: 330607 URL: https://svnweb.freebsd.org/changeset/base/330607 Log: Implement rate limit per traffic class in mlx5core. Add support for rate limiting traffic class via sysctl. Submitted by: Slava Shwartsman MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/dev/mlx5/port.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar 7 15:03:11 2018 (r330606) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar 7 15:17:36 2018 (r330607) @@ -860,6 +860,89 @@ int mlx5_query_port_cong_params(struct mlx5_core_dev * out, out_size); } +static int mlx5_query_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *out, + int outlen) +{ + u32 in[MLX5_ST_SZ_DW(qtct_reg)]; + + if (!MLX5_CAP_GEN(mdev, ets)) + return -ENOTSUPP; + + memset(in, 0, sizeof(in)); + return mlx5_core_access_reg(mdev, in, sizeof(in), out, outlen, + MLX5_REG_QETCR, 0, 0); +} + +int mlx5_max_tc(struct mlx5_core_dev *mdev) +{ + u8 num_tc = MLX5_CAP_GEN(mdev, max_tc) ? : 8; + + return num_tc - 1; +} +EXPORT_SYMBOL_GPL(mlx5_max_tc); + +static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in, + int inlen) +{ + u32 out[MLX5_ST_SZ_DW(qtct_reg)]; + + if (!MLX5_CAP_GEN(mdev, ets)) + return -ENOTSUPP; + + return mlx5_core_access_reg(mdev, in, inlen, out, sizeof(out), + MLX5_REG_QETCR, 0, 1); +} + +int mlx5_query_port_tc_rate_limit(struct mlx5_core_dev *mdev, + u8 *max_bw_value, + u8 *max_bw_units) +{ + u32 out[MLX5_ST_SZ_DW(qetc_reg)]; + void *ets_tcn_conf; + int err; + int i; + + err = mlx5_query_port_qetcr_reg(mdev, out, sizeof(out)); + if (err) + return err; + + for (i = 0; i <= mlx5_max_tc(mdev); i++) { + ets_tcn_conf = MLX5_ADDR_OF(qetc_reg, out, tc_configuration[i]); + + max_bw_value[i] = MLX5_GET(ets_tcn_config_reg, ets_tcn_conf, + max_bw_value); + max_bw_units[i] = MLX5_GET(ets_tcn_config_reg, ets_tcn_conf, + max_bw_units); + } + + return 0; +} +EXPORT_SYMBOL_GPL(mlx5_query_port_tc_rate_limit); + +int mlx5_modify_port_tc_rate_limit(struct mlx5_core_dev *mdev, + const u8 *max_bw_value, + const u8 *max_bw_units) +{ + u32 in[MLX5_ST_SZ_DW(qetc_reg)] = {}; + void *ets_tcn_conf; + int i; + + MLX5_SET(qetc_reg, in, port_number, 1); + + for (i = 0; i <= mlx5_max_tc(mdev); i++) { + ets_tcn_conf = MLX5_ADDR_OF(qetc_reg, in, tc_configuration[i]); + + MLX5_SET(ets_tcn_config_reg, ets_tcn_conf, r, 1); + MLX5_SET(ets_tcn_config_reg, ets_tcn_conf, max_bw_units, + max_bw_units[i]); + MLX5_SET(ets_tcn_config_reg, ets_tcn_conf, max_bw_value, + max_bw_value[i]); + } + + return mlx5_set_port_qetcr_reg(mdev, in, sizeof(in)); +} +EXPORT_SYMBOL_GPL(mlx5_modify_port_tc_rate_limit); + int mlx5_modify_port_cong_params(struct mlx5_core_dev *mdev, void *in, int in_size) { Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Mar 7 15:03:11 2018 (r330606) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Mar 7 15:17:36 2018 (r330607) @@ -70,6 +70,8 @@ #include #include +#define IEEE_8021QAZ_MAX_TCS 8 + #define MLX5E_PARAMS_MINIMUM_LOG_SQ_SIZE 0x7 #define MLX5E_PARAMS_DEFAULT_LOG_SQ_SIZE 0xa #define MLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE 0xe @@ -114,6 +116,9 @@ (MLX5E_MAX_TX_HEADER - sizeof(struct mlx5e_tx_wqe) + \ sizeof(((struct mlx5e_tx_wqe *)0)->eth.inline_hdr_start)) /* bytes */ +#define MLX5E_100MB (100000) +#define MLX5E_1GB (1000000) + MALLOC_DECLARE(M_MLX5EN); struct mlx5_core_dev; @@ -417,11 +422,13 @@ struct mlx5e_params { m(+1, u64 mc_local_lb, "mc_local_lb", "0: Local multicast loopback enabled 1: Disabled") \ m(+1, u64 uc_local_lb, "uc_local_lb", "0: Local unicast loopback enabled 1: Disabled") + #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) struct mlx5e_params_ethtool { u64 arg [0]; MLX5E_PARAMS(MLX5E_STATS_VAR) + u64 max_bw_value[IEEE_8021QAZ_MAX_TCS]; }; /* EEPROM Standards for plug in modules */ @@ -629,6 +636,12 @@ enum { MLX5E_STATE_OPENED, }; +enum { + MLX5_BW_NO_LIMIT = 0, + MLX5_100_MBPS_UNIT = 3, + MLX5_GBPS_UNIT = 4, +}; + struct mlx5e_vlan_db { unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; struct mlx5_flow_rule *active_vlans_ft_rule[VLAN_N_VID]; @@ -747,6 +760,19 @@ struct mlx5e_eeprom { int page_valid; u32 *data; }; + +/* + * This structure contains rate limit extension to the IEEE 802.1Qaz ETS + * managed object. + * Values are 64 bits long and specified in Kbps to enable usage over both + * slow and very fast networks. + * + * @tc_maxrate: maximal tc tx bandwidth indexed by traffic class + */ +struct ieee_maxrate { + __u64 tc_maxrate[IEEE_8021QAZ_MAX_TCS]; +}; + #define MLX5E_FLD_MAX(typ, fld) ((1ULL << __mlx5_bit_sz(typ, fld)) - 1ULL) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Mar 7 15:03:11 2018 (r330606) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Mar 7 15:17:36 2018 (r330607) @@ -84,6 +84,97 @@ mlx5e_ethtool_sync_tx_completion_fact(struct mlx5e_pri priv->params_ethtool.tx_completion_fact = max; } +static int +mlx5e_getmaxrate(struct mlx5e_priv *priv) +{ + struct mlx5_core_dev *mdev = priv->mdev; + u8 max_bw_unit[IEEE_8021QAZ_MAX_TCS]; + u8 max_bw_value[IEEE_8021QAZ_MAX_TCS]; + int err; + int i; + + PRIV_LOCK(priv); + err = -mlx5_query_port_tc_rate_limit(mdev, max_bw_value, max_bw_unit); + if (err) + goto done; + + for (i = 0; i <= mlx5_max_tc(mdev); i++) { + switch (max_bw_unit[i]) { + case MLX5_100_MBPS_UNIT: + priv->params_ethtool.max_bw_value[i] = max_bw_value[i] * MLX5E_100MB; + break; + case MLX5_GBPS_UNIT: + priv->params_ethtool.max_bw_value[i] = max_bw_value[i] * MLX5E_1GB; + break; + case MLX5_BW_NO_LIMIT: + priv->params_ethtool.max_bw_value[i] = 0; + break; + default: + priv->params_ethtool.max_bw_value[i] = -1; + WARN_ONCE(true, "non-supported BW unit"); + break; + } + } +done: + PRIV_UNLOCK(priv); + return (err); +} + +static int +mlx5e_tc_maxrate_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + int prio_index = arg2; + struct mlx5_core_dev *mdev = priv->mdev; + u8 max_bw_unit[IEEE_8021QAZ_MAX_TCS]; + u8 max_bw_value[IEEE_8021QAZ_MAX_TCS]; + int i, err; + u64 bw_val; + u64 result = priv->params_ethtool.max_bw_value[prio_index]; + const u64 upper_limit_mbps = 255 * MLX5E_100MB; + const u64 upper_limit_gbps = 255 * MLX5E_1GB; + + PRIV_LOCK(priv); + err = sysctl_handle_64(oidp, &result, 0, req); + if (err || !req->newptr || + result == priv->params_ethtool.max_bw_value[prio_index]) + goto done; + + if (result % MLX5E_100MB) { + err = ERANGE; + goto done; + } + + memset(max_bw_value, 0, sizeof(max_bw_value)); + memset(max_bw_unit, 0, sizeof(max_bw_unit)); + + for (i = 0; i <= mlx5_max_tc(mdev); i++) { + bw_val = (i == prio_index) ? result : priv->params_ethtool.max_bw_value[i]; + + if (!bw_val) { + max_bw_unit[i] = MLX5_BW_NO_LIMIT; + } else if (bw_val > upper_limit_gbps) { + result = 0; + max_bw_unit[i] = MLX5_BW_NO_LIMIT; + } else if (bw_val <= upper_limit_mbps) { + max_bw_value[i] = howmany(bw_val, MLX5E_100MB); + max_bw_unit[i] = MLX5_100_MBPS_UNIT; + } else { + max_bw_value[i] = howmany(bw_val, MLX5E_1GB); + max_bw_unit[i] = MLX5_GBPS_UNIT; + } + } + + err = -mlx5_modify_port_tc_rate_limit(mdev, max_bw_value, max_bw_unit); + if (err) + goto done; + + priv->params_ethtool.max_bw_value[prio_index] = result; +done: + PRIV_UNLOCK(priv); + return (err); +} + #define MLX5_PARAM_OFFSET(n) \ __offsetof(struct mlx5e_priv, params_ethtool.n) @@ -734,9 +825,11 @@ mlx5e_create_diagnostics(struct mlx5e_priv *priv) void mlx5e_create_ethtool(struct mlx5e_priv *priv) { - struct sysctl_oid *node; + struct mlx5_core_dev *mdev = priv->mdev; + struct sysctl_oid *node, *qos_node; const char *pnameunit; unsigned x; + int i; /* set some defaults */ priv->params_ethtool.tx_queue_size_max = 1 << MLX5E_PARAMS_MAXIMUM_LOG_SQ_SIZE; @@ -830,4 +923,25 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) /* Diagnostics support */ mlx5e_create_diagnostics(priv); + + /* create qos node */ + qos_node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, + SYSCTL_CHILDREN(node), OID_AUTO, + "qos", CTLFLAG_RW, NULL, "Quality Of Service configuration"); + if (node == NULL) + return; + + /* Prioriry rate limit support */ + if (mlx5e_getmaxrate(priv)) + return; + + for (i = 0; i <= mlx5_max_tc(mdev); i++) { + char name[32]; + snprintf(name, sizeof(name), "tc_%d_max_rate", i); + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), + OID_AUTO, name, CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, + priv, i, mlx5e_tc_maxrate_handler, "QU", + "Max rate for priority, specified in kilobits, where kilo=1000, \ + max_rate must be divisible by 100000"); + } } Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Wed Mar 7 15:03:11 2018 (r330606) +++ head/sys/dev/mlx5/mlx5_ifc.h Wed Mar 7 15:17:36 2018 (r330607) @@ -9096,6 +9096,15 @@ struct mlx5_ifc_ets_global_config_reg_bits { u8 max_bw_value[0x8]; }; +struct mlx5_ifc_qetc_reg_bits { + u8 reserved_at_0[0x8]; + u8 port_number[0x8]; + u8 reserved_at_10[0x30]; + + struct mlx5_ifc_ets_tcn_config_reg_bits tc_configuration[0x8]; + struct mlx5_ifc_ets_global_config_reg_bits global_configuration; +}; + struct mlx5_ifc_nodnic_mac_filters_bits { struct mlx5_ifc_mac_address_layout_bits mac_filter0; Modified: head/sys/dev/mlx5/port.h ============================================================================== --- head/sys/dev/mlx5/port.h Wed Mar 7 15:03:11 2018 (r330606) +++ head/sys/dev/mlx5/port.h Wed Mar 7 15:17:36 2018 (r330607) @@ -144,4 +144,11 @@ int mlx5_query_eeprom(struct mlx5_core_dev *dev, int i int device_addr, int size, int module_num, u32 *data, int *size_read); +int mlx5_max_tc(struct mlx5_core_dev *mdev); +int mlx5_query_port_tc_rate_limit(struct mlx5_core_dev *mdev, + u8 *max_bw_value, + u8 *max_bw_units); +int mlx5_modify_port_tc_rate_limit(struct mlx5_core_dev *mdev, + const u8 *max_bw_value, + const u8 *max_bw_units); #endif /* __MLX5_PORT_H__ */ From owner-svn-src-head@freebsd.org Wed Mar 7 15:23: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 D5A1BF36B5C; Wed, 7 Mar 2018 15:23:08 +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 8BB5B7AAD1; Wed, 7 Mar 2018 15:23:08 +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 6DB9423290; Wed, 7 Mar 2018 15:23:08 +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 w27FN8u7074329; Wed, 7 Mar 2018 15:23:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27FN7ii074325; Wed, 7 Mar 2018 15:23:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803071523.w27FN7ii074325@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 Mar 2018 15:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330608 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 330608 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:23:09 -0000 Author: hselasky Date: Wed Mar 7 15:23:07 2018 New Revision: 330608 URL: https://svnweb.freebsd.org/changeset/base/330608 Log: Implement priority to traffic class mapping in mlx5core. Add support for mapping priority to traffic class via sysctl Submitted by: Slava Shwartsman MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/port.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar 7 15:17:36 2018 (r330607) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Wed Mar 7 15:23:07 2018 (r330608) @@ -943,6 +943,48 @@ int mlx5_modify_port_tc_rate_limit(struct mlx5_core_de } EXPORT_SYMBOL_GPL(mlx5_modify_port_tc_rate_limit); +int mlx5_query_port_prio_tc(struct mlx5_core_dev *mdev, + u8 prio, u8 *tc) +{ + u32 in[MLX5_ST_SZ_DW(qtct_reg)]; + u32 out[MLX5_ST_SZ_DW(qtct_reg)]; + int err; + + memset(in, 0, sizeof(in)); + memset(out, 0, sizeof(out)); + + MLX5_SET(qtct_reg, in, port_number, 1); + MLX5_SET(qtct_reg, in, prio, prio); + + err = mlx5_core_access_reg(mdev, in, sizeof(in), out, + sizeof(out), MLX5_REG_QTCT, 0, 0); + if (!err) + *tc = MLX5_GET(qtct_reg, out, tclass); + + return err; +} +EXPORT_SYMBOL_GPL(mlx5_query_port_prio_tc); + +int mlx5_set_port_prio_tc(struct mlx5_core_dev *mdev, int prio_index, + const u8 prio_tc) +{ + u32 in[MLX5_ST_SZ_DW(qtct_reg)] = {}; + u32 out[MLX5_ST_SZ_DW(qtct_reg)]; + int err; + + if (prio_tc > mlx5_max_tc(mdev)) + return -EINVAL; + + MLX5_SET(qtct_reg, in, prio, prio_index); + MLX5_SET(qtct_reg, in, tclass, prio_tc); + + err = mlx5_core_access_reg(mdev, in, sizeof(in), out, + sizeof(out), MLX5_REG_QTCT, 0, 1); + + return (err); +} +EXPORT_SYMBOL_GPL(mlx5_set_port_prio_tc); + int mlx5_modify_port_cong_params(struct mlx5_core_dev *mdev, void *in, int in_size) { Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Wed Mar 7 15:17:36 2018 (r330607) +++ head/sys/dev/mlx5/mlx5_en/en.h Wed Mar 7 15:23:07 2018 (r330608) @@ -429,6 +429,7 @@ struct mlx5e_params_ethtool { u64 arg [0]; MLX5E_PARAMS(MLX5E_STATS_VAR) u64 max_bw_value[IEEE_8021QAZ_MAX_TCS]; + u8 prio_tc[IEEE_8021QAZ_MAX_TCS]; }; /* EEPROM Standards for plug in modules */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Mar 7 15:17:36 2018 (r330607) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Wed Mar 7 15:23:07 2018 (r330608) @@ -175,6 +175,60 @@ done: return (err); } +static int +mlx5e_get_prio_tc(struct mlx5e_priv *priv) +{ + struct mlx5_core_dev *mdev = priv->mdev; + int err = 0; + int i; + + PRIV_LOCK(priv); + if (!MLX5_CAP_GEN(priv->mdev, ets)) { + PRIV_UNLOCK(priv); + return (EOPNOTSUPP); + } + + for (i = 0; i <= mlx5_max_tc(priv->mdev); i++) { + err = -mlx5_query_port_prio_tc(mdev, i, &(priv->params_ethtool.prio_tc[i])); + if (err) + break; + } + + PRIV_UNLOCK(priv); + return (err); +} + +static int +mlx5e_prio_to_tc_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + int prio_index = arg2; + struct mlx5_core_dev *mdev = priv->mdev; + int err; + uint8_t result = priv->params_ethtool.prio_tc[prio_index]; + + PRIV_LOCK(priv); + err = sysctl_handle_8(oidp, &result, 0, req); + if (err || !req->newptr || + result == priv->params_ethtool.prio_tc[prio_index]) + goto done; + + if (result > mlx5_max_tc(mdev)) { + err = ERANGE; + goto done; + } + + err = -mlx5_set_port_prio_tc(mdev, prio_index, result); + if (err) + goto done; + + priv->params_ethtool.prio_tc[prio_index] = result; + +done: + PRIV_UNLOCK(priv); + return (err); +} + #define MLX5_PARAM_OFFSET(n) \ __offsetof(struct mlx5e_priv, params_ethtool.n) @@ -943,5 +997,17 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) priv, i, mlx5e_tc_maxrate_handler, "QU", "Max rate for priority, specified in kilobits, where kilo=1000, \ max_rate must be divisible by 100000"); + } + + if (mlx5e_get_prio_tc(priv)) + return; + + for (i = 0; i <= mlx5_max_tc(mdev); i++) { + char name[32]; + snprintf(name, sizeof(name), "prio_%d_to_tc", i); + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), + OID_AUTO, name, CTLTYPE_U8 | CTLFLAG_RW | CTLFLAG_MPSAFE, + priv, i, mlx5e_prio_to_tc_handler, "CU", + "Set priority to traffic class"); } } Modified: head/sys/dev/mlx5/port.h ============================================================================== --- head/sys/dev/mlx5/port.h Wed Mar 7 15:17:36 2018 (r330607) +++ head/sys/dev/mlx5/port.h Wed Mar 7 15:23:07 2018 (r330608) @@ -151,4 +151,8 @@ int mlx5_query_port_tc_rate_limit(struct mlx5_core_dev int mlx5_modify_port_tc_rate_limit(struct mlx5_core_dev *mdev, const u8 *max_bw_value, const u8 *max_bw_units); +int mlx5_query_port_prio_tc(struct mlx5_core_dev *mdev, + u8 prio, u8 *tc); +int mlx5_set_port_prio_tc(struct mlx5_core_dev *mdev, int prio_index, + const u8 prio_tc); #endif /* __MLX5_PORT_H__ */ From owner-svn-src-head@freebsd.org Wed Mar 7 15:29: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 0878BF372FB for ; Wed, 7 Mar 2018 15:29:27 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x22f.google.com (mail-yb0-x22f.google.com [IPv6:2607:f8b0:4002: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 9232F7AF81 for ; Wed, 7 Mar 2018 15:29:26 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x22f.google.com with SMTP id b12-v6so853254ybn.8 for ; Wed, 07 Mar 2018 07:29:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fVmYmQopW/0esbsXUtVDHF6aiS0YkGthp3JQR0Vcm6E=; b=LIwOU//EoKmsrzlJNf8QTF/MGSiq+YgUYXOdtPtmMC5g382wPADdGeOw8PVq1fTqRD A7EMC/c5RlEjweOWWtor925sI6lDHU0rzdD+Y5dezQ7P3t/zPMdt26fXQSt4uU0WZhcQ xcTjKQiz355Kb3xL3CG8zyCy72pXIRVVcZNH9VixW0sm4fca/tUY+1UkQlyyI44AXCI8 7e06VRwkhYDJ2Bn9LSEtDx/Yhgj+Rk4DBQaBR6dJ4bjDnCOG4l/9Pozeap6mH/W0MaWY vwd7wBUbUat0vAvml6Wt7s8hQBcBTHGfOmbuDp5wr1dycIbDCty29EkLjB7NfnwRXfN2 4zqQ== 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=fVmYmQopW/0esbsXUtVDHF6aiS0YkGthp3JQR0Vcm6E=; b=nOYycX5/1bwzgGC3PT252MtIXX9pqBy0DXExeDldueeq3MgDTo8jJvvcEp9F044RcX qoUfkIft7RrAhkVoVUOqFMY+xyOIIDk1XoApnWsKLT/xbTbQJrVfQVoXo7CKX/hj3OHw /ESiLL4q3E/CTNM7sP1tH9EJhu1fHV5dNT0uO+mGky5w5AepL9AVBHo/60edUzJ8kHK1 4AsuVYdK90zvKdjWc9VAs1DmcbLAgqTIQeqQshA1Jx4abU+FMYgghJcxiIqB8zFrE4lg lmk2O9C6lrMYduikzGf9k/WJvhLPPQVuXRAxr5S0n/re8XXnOF9oyoz6Lnkd/VRokd2P h1hg== X-Gm-Message-State: AElRT7EjMXcV+n1F9Sp2uVuwDqBsAjjaP12hcAUBstE2ocRzZ6mfWiCW VSGNEzlz+3KaBjpg9V2kgijA296e/+GNXHxWlQZSZQ== X-Google-Smtp-Source: AG47ELvVXXzjfnSgYrov7xR4kWyneYWOxXG4i9Oj+UC76EldqfN7DEnmPiXqMvgErELxeag8SE2X+Y4R+7qPdpzcSWU= X-Received: by 2002:a25:880f:: with SMTP id c15-v6mr13864035ybl.348.1520436565910; Wed, 07 Mar 2018 07:29:25 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:5f41:0:0:0:0:0 with HTTP; Wed, 7 Mar 2018 07:29:25 -0800 (PST) In-Reply-To: <201803071444.w27EiWBV053244@repo.freebsd.org> References: <201803071444.w27EiWBV053244@repo.freebsd.org> From: Oliver Pinter Date: Wed, 7 Mar 2018 16:29:25 +0100 Message-ID: Subject: Re: svn commit: r330601 - head/sys/i386/ibcs2 To: Eitan Adler 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: Wed, 07 Mar 2018 15:29:27 -0000 Wrong commit message. IBCS isn't cloudabi. On Wednesday, March 7, 2018, Eitan Adler wrote: > Author: eadler > Date: Wed Mar 7 14:44:32 2018 > New Revision: 330601 > URL: https://svnweb.freebsd.org/changeset/base/330601 > > Log: > sys: Fix a few potential infoleaks in cloudabi > > While there is no immediate leak, if the structure changes underneath > us, there might be in the future. > > Submitted by: Domagoj Stolfa > MFC After: 1 month > Sponsored by: DARPA/AFRL > > Modified: > head/sys/i386/ibcs2/ibcs2_ipc.c > > Modified: head/sys/i386/ibcs2/ibcs2_ipc.c > ============================================================ > ================== > --- head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar 7 14:41:29 2018 > (r330600) > +++ head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar 7 14:44:32 2018 > (r330601) > @@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v) > struct msqid_ds bs; > int error; > > + memset(&is, 0, sizeof(is)); > + > switch (uap->cmd) { > case IBCS2_IPC_STAT: > error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs); > @@ -317,6 +319,8 @@ ibcs2_semctl(struct thread *td, void *v) > union semun semun; > register_t rval; > int error; > + > + memset(&is, 0, sizeof(is)); > > switch(uap->cmd) { > case IBCS2_IPC_STAT: > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Wed Mar 7 15:38: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 D19EBF37F2D for ; Wed, 7 Mar 2018 15:38:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AF5C7B6E0 for ; Wed, 7 Mar 2018 15:38:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id c11so3758627ith.4 for ; Wed, 07 Mar 2018 07:38:02 -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=k/QE485AcSSYnJ0GzUzSKXYy8E+VdmtLuXrwbxXEPhs=; b=Jfr5texUrPBh6yf2+2BTz+kaLD95SMLlFfv3Sb+0lhZri61OVO0ivl/S5q/o1wLoQG /OaDHzR7jFf4fzpOBbCJ6eUE5afcNKjuv9bFSnpuVQ3vYrmVTCAgagK0f5DpyNF9nLeQ fx97TdUwjoZO4CyrM7NfY+6b8KUPqDJGd7zE8EIsvfe/bh7DKQGv2N7euINq0HKi8V+f pjoBycddV9rvy8g2CI7MTFcqtdri3WN2zZ4LybCgKOsDqZdCGIufX0WOpc/eFj6wU9Qu +OiR2pksbRbZQ8B8mGFI6zj6kCbclBuWHgOonDndCa5wFz71IagsG9Esbg9EfC6rIfad QJDw== 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=k/QE485AcSSYnJ0GzUzSKXYy8E+VdmtLuXrwbxXEPhs=; b=WMS3W92mWVbAKpylwursbVRQrdSoUCk0+SQXEgWsiiaSjVlBiVGz8mXlxBygumBH5X ZJnf/MDusEFY7tjYdcGtu+QIoihOqkTavJOWqLU/Umdfe3D8nS86HCJlXWclx4ag6Ik+ 7KQf82BekduBMUbagEMfB5pOLnEZiVeYyjkk+Z6CQfYOAVTj8K5nMLbpg5BvKb3dB8ZA 5BQB67QKh1CexpceKoehw7VBh1KnCnzwf0Pd+YBA71Wy0LVt1c3FqUSHfdhkFCf9z2hv oHMfpzRFLS7EtGPH3lIpywO3HDdh5FnRHVMGgdmCNJwQMPYAqGbn4NiN7UGPPOo29MRk I67w== X-Gm-Message-State: AElRT7GvMRsXvKJ+IhxcsJ1AR2/qGtByrnWDlZeCBRzaAF4dMHGfBjCC Wkhw51yK/a1T8h6chm35YI3FGfK5GdIbon63usF7FQ== X-Google-Smtp-Source: AG47ELtxkvnhPcrZdwdCSDJU0eLDKLA2t3ffFTjoL85ajy1kgELHuVtAu8k6G+rKBhd8TKZ/aw3mr5cntzMTxoB90NA= X-Received: by 10.36.16.147 with SMTP id 141mr23909825ity.73.1520437081601; Wed, 07 Mar 2018 07:38:01 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Wed, 7 Mar 2018 07:38:00 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201803071444.w27EiWBV053244@repo.freebsd.org> From: Warner Losh Date: Wed, 7 Mar 2018 08:38:00 -0700 X-Google-Sender-Auth: PkYEb97KJ8My_-ug5KNeQpzLMuQ Message-ID: Subject: Re: svn commit: r330601 - head/sys/i386/ibcs2 To: Oliver Pinter Cc: Eitan Adler , "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: Wed, 07 Mar 2018 15:38:03 -0000 The message is right if you s/cloudabi/ibcs/ though. Warner On Wed, Mar 7, 2018 at 8:29 AM, Oliver Pinter wrote: > Wrong commit message. IBCS isn't cloudabi. > > On Wednesday, March 7, 2018, Eitan Adler wrote: > >> Author: eadler >> Date: Wed Mar 7 14:44:32 2018 >> New Revision: 330601 >> URL: https://svnweb.freebsd.org/changeset/base/330601 >> >> Log: >> sys: Fix a few potential infoleaks in cloudabi >> >> While there is no immediate leak, if the structure changes underneath >> us, there might be in the future. >> >> Submitted by: Domagoj Stolfa >> MFC After: 1 month >> Sponsored by: DARPA/AFRL >> >> Modified: >> head/sys/i386/ibcs2/ibcs2_ipc.c >> >> Modified: head/sys/i386/ibcs2/ibcs2_ipc.c >> ============================================================ >> ================== >> --- head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar 7 14:41:29 2018 >> (r330600) >> +++ head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar 7 14:44:32 2018 >> (r330601) >> @@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v) >> struct msqid_ds bs; >> int error; >> >> + memset(&is, 0, sizeof(is)); >> + >> switch (uap->cmd) { >> case IBCS2_IPC_STAT: >> error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs); >> @@ -317,6 +319,8 @@ ibcs2_semctl(struct thread *td, void *v) >> union semun semun; >> register_t rval; >> int error; >> + >> + memset(&is, 0, sizeof(is)); >> >> switch(uap->cmd) { >> case IBCS2_IPC_STAT: >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" >> > From owner-svn-src-head@freebsd.org Wed Mar 7 15:44: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 621D9F38B29; Wed, 7 Mar 2018 15:44:38 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA88D7BD60; Wed, 7 Mar 2018 15:44:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x236.google.com with SMTP id 30so3503086iog.2; Wed, 07 Mar 2018 07:44:37 -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=35JU3Efgmew9okbmhZpYfrugadmaCLTDmPkNm5R+bPM=; b=I922KV8Y/9TOwVfU+btmN8CjNpSSyNqCTYVm+wxvwNBR93q8SJrVcHTWYTlMIfkQJ+ SSsLCyOS3uBGfrfMl/3lP7Xp7NhTSCj7QQM7tBpvXtDYoRCG+xvWPenQK6cPVw2tX+yZ T7r0Ptuk8Qe+UfpNvZgOV4uj7dVzIPQcSs9XhkJwPCj8cMdLv4qCii0BDLnwWc1IOKhF yu1MXcrg4XoIb/OVnFNgtucwBRUz+mOo96aaEDcF/iqG8DxBIkISfRqbC7O8fGXBo4c/ UYBqTO2Aj8v8o8imRhzaBadEb0L0PW2DPVD1lEf5WXbw+i3Qta9ToQAEfZRvVhgYedfx jH+w== 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=35JU3Efgmew9okbmhZpYfrugadmaCLTDmPkNm5R+bPM=; b=DaqFEnX4nO3M2BDWifGs1A173WAQRqsiVOkD3iqJv55FnghQfK1bZ3FqQOp5ZOcyjD eEJvH5nFx/NjA8mVncZIlVtEUxy/3mCzCR0VZ2EKIFGNY2tXIlyqQ58sEDpdkiHbXWNp adSayWOR250O4QFajTErhTvwN5cRpOa8B5eUXHZLsKqRDl0xiaN4jYzBuQi2JCj7TBLn 2jGUMrzUhBnuv88NlC93TYCrDIHzFUD+RXSqkmbXLxzJTQxixA50i1ReTgwGRzen35Jr 6m6vc9PBgTJeJzltE190onm38NCpCjbnIf0h0sYeGmL8wHuLI5UWXfjMy4/rTQaVHDb3 SkzQ== X-Gm-Message-State: AElRT7FYjXf1QzjhPFHEtMY9cBE5aM8aMbm+M1GvrbPy5Re9u9XQfzWz +8jCeZcJu69bakaLmZTNeWgO4j2vCSQO/lS00SXCC1Jo X-Google-Smtp-Source: AG47ELuH7omvMn1iNF2sB1vhozjcYPWqhUqy1fwIVUC6tIBxZCtrlwt3Ath1dVHH3BBtQAb60EoBzG4JS4ylawoH6Oo= X-Received: by 10.107.134.95 with SMTP id i92mr26300209iod.210.1520437476924; Wed, 07 Mar 2018 07:44:36 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.163.13 with HTTP; Wed, 7 Mar 2018 07:44:14 -0800 (PST) In-Reply-To: <201803071447.w27Elh7C053393@repo.freebsd.org> References: <201803071447.w27Elh7C053393@repo.freebsd.org> From: Ed Maste Date: Wed, 7 Mar 2018 10:44:14 -0500 X-Google-Sender-Auth: UukLoBVTnKXvJp4Sj2uEwIUC3Z0 Message-ID: Subject: Re: svn commit: r330602 - head/sys/compat/cloudabi To: Eitan Adler 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: Wed, 07 Mar 2018 15:44:38 -0000 On 7 March 2018 at 09:47, Eitan Adler wrote: > Author: eadler > Date: Wed Mar 7 14:47:43 2018 > New Revision: 330602 > URL: https://svnweb.freebsd.org/changeset/base/330602 > > Log: > sys/cloudabi: Avoid relying on GNU specific extensions > > An empty initializer list is not technically valid C grammar. > > MFC After: 1 week > > - cloudabi_fdstat_t fsb = {}; > + cloudabi_fdstat_t fsb = {0}; In practice it appears initializing via { 0 } also zeros any padding in the struct, but I do not believe it's required by the C standard. Perhaps a language lawyer can weigh in? Commenting on this commit just because it's highlighted by this change; I do not believe there's a difference between the GNU extension { } and { 0 } here. From owner-svn-src-head@freebsd.org Wed Mar 7 15:54: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 9D4BDF39BDF; Wed, 7 Mar 2018 15:54:07 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x236.google.com (mail-ot0-x236.google.com [IPv6:2607:f8b0:4003:c0f::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28E387C66B; Wed, 7 Mar 2018 15:54:07 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x236.google.com with SMTP id h8so2476306oti.6; Wed, 07 Mar 2018 07:54:07 -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=4jrs60oonPnDZrNkK8Kjm+B8VI639MC1L7nMylZbQz4=; b=u6NvRcLm0irgAT+WJ+4l8D3ydW5qfT9zniftaMs1PB9hGbqcXvdYh9/4Wnic3/D3yt EVA78uBIDkwn5gQJmYOcrYLdcP5M6Lbr81FGjSm+avc3WMnGVO4wpCgUqacCksx6Kvq4 34MULY/0jHL/T19JLZxFdL8gv1PYPcFCJGjYS1hl1PlWni+IGSS2NNO+thN3it///QPN Wl0p3d5YrcxXZhzWaiyq4aJFLuKhZu4DgIvDlIf+6mYpZR/bnBDXoVT/ULIrtdN94rOD otukIhEwwJbYXnWHl5ZF79DK7awZIK4O6JcYo8PBN3Vxo4GkHfgJB/Ryc5tLBiS8+KGh dyYQ== 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=4jrs60oonPnDZrNkK8Kjm+B8VI639MC1L7nMylZbQz4=; b=NM1/E9A3/ifCaLeDmNgKVrpbpRvIkQl7rL0PhSZhPDv+Utt+UACK9msk+T+ADj46Tf /36m/gNoT3LS+tpq8SwO/069O8ZZ/YPLgTGcjEYopcr4Qm8bv2WmBlwTgznTiSgUFG0p cfWxS5It9vKgbJA/Fd+aLnR5V/PIeG0sUR/bvSJu7ufNO7OtXIUYvAqzI6iN5jiuc0sU q8WfHOJSDNdQVchpW8PnZbqUZ35q9ppI8r6BBVDXOtDxq7M/lKYnLpG0C2U60nir6H2Y g49TjbJ/BGfPrtX314He1LW+1+OXDihC9lIt6oXCBc1C42DN7BigmP0HSQaM8+qd+Pxg Yhcw== X-Gm-Message-State: AElRT7E1XCJH8kZxy2uRxz8bxJ+38dq/tAnQoQlZf5nbGqhCVAWBd1iK 56M9n7X/VfrzvQJO0kS5tW7V9zjYl3a4SzS9des= X-Google-Smtp-Source: AG47ELsMOF35VhC+vmlmRkXPxx8YSkRbiuqfSZoQ/C7Kh7/mgqYOCsPpDgpni4r4I3qe813SqjIfrArapBACi7LVF0w= X-Received: by 10.157.62.30 with SMTP id a30mr16139974otd.128.1520438046317; Wed, 07 Mar 2018 07:54:06 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.96.212 with HTTP; Wed, 7 Mar 2018 07:54:05 -0800 (PST) In-Reply-To: References: <201803071447.w27Elh7C053393@repo.freebsd.org> From: Benjamin Kaduk Date: Wed, 7 Mar 2018 09:54:05 -0600 Message-ID: Subject: Re: svn commit: r330602 - head/sys/compat/cloudabi To: Ed Maste Cc: Eitan Adler , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers 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 Mar 2018 15:54:08 -0000 On Wed, Mar 7, 2018 at 9:44 AM, Ed Maste wrote: > On 7 March 2018 at 09:47, Eitan Adler wrote: > > Author: eadler > > Date: Wed Mar 7 14:47:43 2018 > > New Revision: 330602 > > URL: https://svnweb.freebsd.org/changeset/base/330602 > > > > Log: > > sys/cloudabi: Avoid relying on GNU specific extensions > > > > An empty initializer list is not technically valid C grammar. > > > > MFC After: 1 week > > > > - cloudabi_fdstat_t fsb = {}; > > + cloudabi_fdstat_t fsb = {0}; > > In practice it appears initializing via { 0 } also zeros any padding > in the struct, but I do not believe it's required by the C standard. > Perhaps a language lawyer can weigh in? > > Commenting on this commit just because it's highlighted by this > change; I do not believe there's a difference between the GNU > extension { } and { 0 } here. > > The C spec says that if an incomplete initializer is given, then all other fields of the structure are initialized to zero. The state of padding is unspecified, whether a complete or incomplete initializer is given. The "issue" being "fixed" here is that the formal C grammar does not admit a totally empty initializer, so at least one element of the initializer needs to be given in order to satisfy the grammar. This is pretty silly, and the extension to allow a totally empty initializer a quite natural one to make. -Ben From owner-svn-src-head@freebsd.org Wed Mar 7 15:56: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 718F0F39ED3 for ; Wed, 7 Mar 2018 15:56:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 030277C854 for ; Wed, 7 Mar 2018 15:56:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id e7so3562071ioj.1 for ; Wed, 07 Mar 2018 07:56:02 -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=Rccl7TcY8UI8/MKr29R0/iAkZ3LjYHJVySExvYqtCCs=; b=0tc7kMsHN9GD1ErBiB9CUz3lWrPOJmyWdRonOgafAeCTc/t7AAOop2i1MjuWRY/BtB 3trpVTUApEo/mEcD7QzXAbaf5d3Ljb5DGCnlvav7wAP4sq0rJPfDjTUM5BtwS2pPGizz H7ASLUhcmwG4++W3WIiN9lpHnxsxhwXNnrqLL9wd4C8c1SRB3vpI88Fhq+8/Ve47IWH2 V93Y3rgUf3fVQGqC/fvTeo/bidSyzNYJ1CTuKJeeL+qmzxE1xGdl6X+i+NBy/9cZS2bE wlaYZlNPDFL8faIjMwh6nGskCsBaExOxQNGT7DpYYfxoA+AtqORwH5N7gnOjf4crNRiF sPIA== 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=Rccl7TcY8UI8/MKr29R0/iAkZ3LjYHJVySExvYqtCCs=; b=jZG1I9+LVMamedAwIhXLQnud6ECTclBd72D8OlALoB6OMpp1pUDVeH0yotmJGKV5Nj 5lC6kuc5XuuUWnK54ItsuNTpiZe09/ReGd4Fl/ZJ1wh/ub7xWDViR1sves687tOZB4Tx LKDbuWaiKgGtW3fi8qdrz9HkfHnV3FP0tSpJ7iRavLpzTKBbCS0Kwt2MYz7Dx8YgJeFC wQviwzwb8JdUGEqYgFkxF+hrKWsdyaBrdOEHljiPgnUpVSVJKAJT8VwLoFLpRw+6PwIY Y+EZLgl3L9jRPVJbE0Bx8BWuTljQ23uta3lEQcpl7VtJzViyf71A78z5CrZdvVd+Nv8V 2T4g== X-Gm-Message-State: AElRT7FDeV/9efzm8kp5IyqZlkjnFQWHL7KAImvZJcEC6EcHcYEtluRx 100h2yo+cMe4rHLBHpatG+Hvfp9eeBryf/wyEXqIzA== X-Google-Smtp-Source: AG47ELtFRkGBx9/4MmMF2cTPrSV2Zsy4wes2iKIIS0KuLlFypQuV9Ob7/wOv3C2I1wnH8VuNUlzXlHb3aTKc8RmHMXU= X-Received: by 10.107.180.83 with SMTP id d80mr26215419iof.168.1520438162230; Wed, 07 Mar 2018 07:56:02 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Wed, 7 Mar 2018 07:56:01 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201803071447.w27Elh7C053393@repo.freebsd.org> From: Warner Losh Date: Wed, 7 Mar 2018 08:56:01 -0700 X-Google-Sender-Auth: 0bY77ALy3BXRKLwdFOLzz6Fy6jU Message-ID: Subject: Re: svn commit: r330602 - head/sys/compat/cloudabi To: Ed Maste Cc: Eitan Adler , 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 Mar 2018 15:56:03 -0000 On Wed, Mar 7, 2018 at 8:44 AM, Ed Maste wrote: > On 7 March 2018 at 09:47, Eitan Adler wrote: > > Author: eadler > > Date: Wed Mar 7 14:47:43 2018 > > New Revision: 330602 > > URL: https://svnweb.freebsd.org/changeset/base/330602 > > > > Log: > > sys/cloudabi: Avoid relying on GNU specific extensions > > > > An empty initializer list is not technically valid C grammar. > > > > MFC After: 1 week > > > > - cloudabi_fdstat_t fsb = {}; > > + cloudabi_fdstat_t fsb = {0}; > > In practice it appears initializing via { 0 } also zeros any padding > in the struct, but I do not believe it's required by the C standard. > Perhaps a language lawyer can weigh in? > All the standard says are that all named are initialized to 0 (which has the usual meaning for the integer 0 for pointers) unless otherwise stated: 6.7.8 para 9: "Except where explicitly stated otherwise, for the purposes of this subclause unnamed members of objects of structure and union type do not participate in initialization. Unnamed members of structure objects have indeterminate value even after initialization." 6.7.8 para 21: "If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration." The aggregate here, I believe refers to the elements, not the padded structure, and the padding is definitely an unnamed part of the structure, which makes it unspecified. However 6.7.8 is quite long and detailed, and I'm not 100% sure I have totally grokked all its subtle implications. Commenting on this commit just because it's highlighted by this > change; I do not believe there's a difference between the GNU > extension { } and { 0 } here. > I believe that's correct as well. Warner From owner-svn-src-head@freebsd.org Wed Mar 7 17:08: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 7F084F4097F; Wed, 7 Mar 2018 17:08:09 +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 2CF258130A; Wed, 7 Mar 2018 17:08:09 +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 2657E24927; Wed, 7 Mar 2018 17:08:09 +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 w27H898k025859; Wed, 7 Mar 2018 17:08:09 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27H87YU025844; Wed, 7 Mar 2018 17:08:07 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201803071708.w27H87YU025844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Wed, 7 Mar 2018 17:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330610 - in head/sys: dev/vt/hw/ofwfb powerpc/aim powerpc/include powerpc/ofw powerpc/powerpc powerpc/ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys: dev/vt/hw/ofwfb powerpc/aim powerpc/include powerpc/ofw powerpc/powerpc powerpc/ps3 X-SVN-Commit-Revision: 330610 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:08:09 -0000 Author: nwhitehorn Date: Wed Mar 7 17:08:07 2018 New Revision: 330610 URL: https://svnweb.freebsd.org/changeset/base/330610 Log: Move the powerpc64 direct map base address from zero to high memory. This accomplishes a few things: - Makes NULL an invalid address in the kernel, which is useful for catching bugs. - Lays groundwork for radix-tree translation on POWER9, which requires the direct map be at high memory. - Similarly lays groundwork for a direct map on 64-bit Book-E. The new base address is chosen as the base of the fourth radix quadrant (the minimum kernel address in this translation mode) and because all supported CPUs ignore at least the first two bits of addresses in real mode, allowing direct-map addresses to be used in real-mode handlers. This is required by Linux and is part of the architecture standard starting in POWER ISA 3, so can be relied upon. Reviewed by: jhibbits, Breno Leitao Differential Revision: D14499 Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/aim/moea64_native.c head/sys/powerpc/aim/slb.c head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/include/sr.h head/sys/powerpc/include/vmparam.h head/sys/powerpc/ofw/ofw_machdep.c head/sys/powerpc/ofw/ofw_real.c head/sys/powerpc/powerpc/bus_machdep.c head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/mem.c head/sys/powerpc/powerpc/uma_machdep.c head/sys/powerpc/ps3/platform_ps3.c Modified: head/sys/dev/vt/hw/ofwfb/ofwfb.c ============================================================================== --- head/sys/dev/vt/hw/ofwfb/ofwfb.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/dev/vt/hw/ofwfb/ofwfb.c Wed Mar 7 17:08:07 2018 (r330610) @@ -489,7 +489,7 @@ ofwfb_init(struct vt_device *vd) #if defined(__powerpc__) OF_decode_addr(node, fb_phys, &sc->sc_memt, &sc->fb.fb_vbase, NULL); - sc->fb.fb_pbase = sc->fb.fb_vbase; /* 1:1 mapped */ + sc->fb.fb_pbase = sc->fb.fb_vbase & ~DMAP_BASE_ADDRESS; #ifdef __powerpc64__ /* Real mode under a hypervisor probably doesn't cover FB */ if (!(mfmsr() & (PSL_HV | PSL_DR))) Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/aim/aim_machdep.c Wed Mar 7 17:08:07 2018 (r330610) @@ -455,11 +455,33 @@ va_to_vsid(pmap_t pm, vm_offset_t va) #endif +/* + * These functions need to provide addresses that both (a) work in real mode + * (or whatever mode/circumstances the kernel is in in early boot (now)) and + * (b) can still, in principle, work once the kernel is going. Because these + * rely on existing mappings/real mode, unmap is a no-op. + */ vm_offset_t pmap_early_io_map(vm_paddr_t pa, vm_size_t size) { + KASSERT(!pmap_bootstrapped, ("Not available after PMAP started!")); - return (pa); + /* + * If we have the MMU up in early boot, assume it is 1:1. Otherwise, + * try to get the address in a memory region compatible with the + * direct map for efficiency later. + */ + if (mfmsr() & PSL_DR) + return (pa); + else + return (DMAP_BASE_ADDRESS + pa); +} + +void +pmap_early_io_unmap(vm_offset_t va, vm_size_t size) +{ + + KASSERT(!pmap_bootstrapped, ("Not available after PMAP started!")); } /* From p3-53 of the MPC7450 RISC Microprocessor Family Reference Manual */ Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/aim/mmu_oea64.c Wed Mar 7 17:08:07 2018 (r330610) @@ -551,7 +551,8 @@ moea64_add_ofw_mappings(mmu_t mmup, phandle_t mmu, siz /* If this address is direct-mapped, skip remapping */ if (hw_direct_map && translations[i].om_va == PHYS_TO_DMAP(pa_base) && - moea64_calc_wimg(pa_base + off, VM_MEMATTR_DEFAULT) == LPTE_M) + moea64_calc_wimg(pa_base + off, VM_MEMATTR_DEFAULT) + == LPTE_M) continue; PMAP_LOCK(kernel_pmap); @@ -664,25 +665,26 @@ moea64_setup_direct_map(mmu_t mmup, vm_offset_t kernel } } PMAP_UNLOCK(kernel_pmap); - } else { - size = moea64_bpvo_pool_size*sizeof(struct pvo_entry); - off = (vm_offset_t)(moea64_bpvo_pool); - for (pa = off; pa < off + size; pa += PAGE_SIZE) - moea64_kenter(mmup, pa, pa); + } - /* - * Map certain important things, like ourselves. - * - * NOTE: We do not map the exception vector space. That code is - * used only in real mode, and leaving it unmapped allows us to - * catch NULL pointer deferences, instead of making NULL a valid - * address. - */ + /* + * Make sure the kernel and BPVO pool stay mapped on systems either + * without a direct map or on which the kernel is not already executing + * out of the direct-mapped region. + */ + if (!hw_direct_map || kernelstart < DMAP_BASE_ADDRESS) { for (pa = kernelstart & ~PAGE_MASK; pa < kernelend; - pa += PAGE_SIZE) + pa += PAGE_SIZE) moea64_kenter(mmup, pa, pa); } + + if (!hw_direct_map) { + size = moea64_bpvo_pool_size*sizeof(struct pvo_entry); + off = (vm_offset_t)(moea64_bpvo_pool); + for (pa = off; pa < off + size; pa += PAGE_SIZE) + moea64_kenter(mmup, pa, pa); + } ENABLE_TRANS(msr); /* @@ -826,6 +828,11 @@ moea64_mid_bootstrap(mmu_t mmup, vm_offset_t kernelsta moea64_bpvo_pool_size*sizeof(struct pvo_entry), 0); moea64_bpvo_pool_index = 0; + /* Place at address usable through the direct map */ + if (hw_direct_map) + moea64_bpvo_pool = (struct pvo_entry *) + PHYS_TO_DMAP((uintptr_t)moea64_bpvo_pool); + /* * Make sure kernel vsid is allocated as well as VSID 0. */ @@ -898,12 +905,11 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelst Maxmem = max(Maxmem, powerpc_btop(phys_avail[i + 1])); /* - * Initialize MMU and remap early physical mappings + * Initialize MMU. */ MMU_CPU_BOOTSTRAP(mmup,0); mtmsr(mfmsr() | PSL_DR | PSL_IR); pmap_bootstrapped++; - bs_remap_earlyboot(); /* * Set the start and end of kva. @@ -920,6 +926,11 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelst #endif /* + * Remap any early IO mappings (console framebuffer, etc.) + */ + bs_remap_earlyboot(); + + /* * Figure out how far we can extend virtual_end into segment 16 * without running into existing mappings. Segment 16 is guaranteed * to contain neither RAM nor devices (at least on Apple hardware), @@ -1826,10 +1837,11 @@ moea64_kextract(mmu_t mmu, vm_offset_t va) /* * Shortcut the direct-mapped case when applicable. We never put - * anything but 1:1 mappings below VM_MIN_KERNEL_ADDRESS. + * anything but 1:1 (or 62-bit aliased) mappings below + * VM_MIN_KERNEL_ADDRESS. */ if (va < VM_MIN_KERNEL_ADDRESS) - return (va); + return (va & ~DMAP_BASE_ADDRESS); PMAP_LOCK(kernel_pmap); pvo = moea64_pvo_find_va(kernel_pmap, va); @@ -2565,12 +2577,15 @@ moea64_pvo_remove_from_page(mmu_t mmu, struct pvo_entr * Update vm about page writeability/executability if managed */ PV_LOCKASSERT(pvo->pvo_pte.pa & LPTE_RPGN); - pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN); + if (pvo->pvo_vaddr & PVO_MANAGED) { + pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.pa & LPTE_RPGN); - if ((pvo->pvo_vaddr & PVO_MANAGED) && pg != NULL) { - LIST_REMOVE(pvo, pvo_vlink); - if (LIST_EMPTY(vm_page_to_pvoh(pg))) - vm_page_aflag_clear(pg, PGA_WRITEABLE | PGA_EXECUTABLE); + if (pg != NULL) { + LIST_REMOVE(pvo, pvo_vlink); + if (LIST_EMPTY(vm_page_to_pvoh(pg))) + vm_page_aflag_clear(pg, + PGA_WRITEABLE | PGA_EXECUTABLE); + } } moea64_pvo_entries--; @@ -2677,8 +2692,12 @@ moea64_dev_direct_mapped(mmu_t mmu, vm_paddr_t pa, vm_ vm_offset_t ppa; int error = 0; + if (hw_direct_map && mem_valid(pa, size) == 0) + return (0); + PMAP_LOCK(kernel_pmap); - key.pvo_vaddr = ppa = pa & ~ADDR_POFF; + ppa = pa & ~ADDR_POFF; + key.pvo_vaddr = DMAP_BASE_ADDRESS + ppa; for (pvo = RB_FIND(pvo_tree, &kernel_pmap->pmap_pvo, &key); ppa < pa + size; ppa += PAGE_SIZE, pvo = RB_NEXT(pvo_tree, &kernel_pmap->pmap_pvo, pvo)) { Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/aim/moea64_native.c Wed Mar 7 17:08:07 2018 (r330610) @@ -401,7 +401,7 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap) */ __asm __volatile ("ptesync; mtsdr1 %0; isync" - :: "r"((uintptr_t)moea64_pteg_table + :: "r"(((uintptr_t)moea64_pteg_table & ~DMAP_BASE_ADDRESS) | (uintptr_t)(flsl(moea64_pteg_mask >> 11)))); tlbia(); } @@ -434,6 +434,9 @@ moea64_bootstrap_native(mmu_t mmup, vm_offset_t kernel */ moea64_pteg_table = (struct lpte *)moea64_bootstrap_alloc(size, size); + if (hw_direct_map) + moea64_pteg_table = + (struct lpte *)PHYS_TO_DMAP((vm_offset_t)moea64_pteg_table); DISABLE_TRANS(msr); bzero(__DEVOLATILE(void *, moea64_pteg_table), moea64_pteg_count * sizeof(struct lpteg)); Modified: head/sys/powerpc/aim/slb.c ============================================================================== --- head/sys/powerpc/aim/slb.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/aim/slb.c Wed Mar 7 17:08:07 2018 (r330610) @@ -207,13 +207,16 @@ kernel_va_to_slbv(vm_offset_t va) /* Set kernel VSID to deterministic value */ slbv = (KERNEL_VSID((uintptr_t)va >> ADDR_SR_SHFT)) << SLBV_VSID_SHIFT; - /* Figure out if this is a large-page mapping */ - if (hw_direct_map && va < VM_MIN_KERNEL_ADDRESS) { + /* + * Figure out if this is a large-page mapping. + */ + if (hw_direct_map && va > DMAP_BASE_ADDRESS && va < DMAP_MAX_ADDRESS) { /* * XXX: If we have set up a direct map, assumes * all physical memory is mapped with large pages. */ - if (mem_valid(va, 0) == 0) + + if (mem_valid(DMAP_TO_PHYS(va), 0) == 0) slbv |= SLBV_L; } Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/aim/trap_subr64.S Wed Mar 7 17:08:07 2018 (r330610) @@ -43,7 +43,9 @@ #define GET_CPUINFO(r) \ mfsprg0 r #define GET_TOCBASE(r) \ - li r,TRAP_TOCBASE; /* Magic address for TOC */ \ + lis r,DMAP_BASE_ADDRESS@highesta; /* To real-mode alias/dmap */ \ + sldi r,r,32; \ + ori r,r,TRAP_TOCBASE; /* Magic address for TOC */ \ ld r,0(r) /* Modified: head/sys/powerpc/include/sr.h ============================================================================== --- head/sys/powerpc/include/sr.h Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/include/sr.h Wed Mar 7 17:08:07 2018 (r330610) @@ -53,7 +53,7 @@ #define KERNEL2_SEGMENT (0xfffff0 + KERNEL2_SR) #define EMPTY_SEGMENT 0xfffff0 #ifdef __powerpc64__ -#define USER_ADDR 0xcffffffff0000000UL +#define USER_ADDR 0xeffffffff0000000UL #else #define USER_ADDR ((uintptr_t)USER_SR << ADDR_SR_SHFT) #endif Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/include/vmparam.h Wed Mar 7 17:08:07 2018 (r330610) @@ -83,11 +83,7 @@ #if !defined(LOCORE) #ifdef __powerpc64__ #define VM_MIN_ADDRESS (0x0000000000000000UL) -#ifdef AIM -#define VM_MAXUSER_ADDRESS (0xfffffffffffff000UL) -#else -#define VM_MAXUSER_ADDRESS (0x7ffffffffffff000UL) -#endif +#define VM_MAXUSER_ADDRESS (0x3ffffffffffff000UL) #define VM_MAX_ADDRESS (0xffffffffffffffffUL) #else #define VM_MIN_ADDRESS ((vm_offset_t)0) @@ -99,7 +95,7 @@ #ifdef BOOKE #define VM_MIN_ADDRESS 0 #ifdef __powerpc64__ -#define VM_MAXUSER_ADDRESS 0x7ffffffffffff000 +#define VM_MAXUSER_ADDRESS 0x3ffffffffffff000 #else #define VM_MAXUSER_ADDRESS 0x7ffff000 #endif @@ -110,8 +106,13 @@ #define FREEBSD32_USRSTACK FREEBSD32_SHAREDPAGE #ifdef __powerpc64__ +#ifdef AIM +#define VM_MIN_KERNEL_ADDRESS 0xe000000000000000UL +#define VM_MAX_KERNEL_ADDRESS 0xe0000001c7ffffffUL +#else #define VM_MIN_KERNEL_ADDRESS 0xc000000000000000UL #define VM_MAX_KERNEL_ADDRESS 0xc0000001c7ffffffUL +#endif #define VM_MAX_SAFE_KERNEL_ADDRESS VM_MAX_KERNEL_ADDRESS #endif @@ -243,14 +244,17 @@ struct pmap_physseg { /* * We (usually) have a direct map of all physical memory, so provide - * a macro to use to get the kernel VA address for a given PA. Returns - * 0 if the direct map is unavailable. The location of the direct map - * may not be 1:1 in future, so use of the macro is recommended. + * a macro to use to get the kernel VA address for a given PA. Check the + * value of PMAP_HAS_PMAP before using. */ +#ifndef LOCORE #ifdef __powerpc64__ -#define DMAP_BASE_ADDRESS 0x0000000000000000UL +#define DMAP_BASE_ADDRESS 0xc000000000000000UL +#define DMAP_MAX_ADDRESS 0xcfffffffffffffffUL #else #define DMAP_BASE_ADDRESS 0x00000000UL +#define DMAP_MAX_ADDRESS 0xbfffffffUL +#endif #endif #define PMAP_HAS_DMAP (hw_direct_map) Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/ofw/ofw_machdep.c Wed Mar 7 17:08:07 2018 (r330610) @@ -84,20 +84,21 @@ static int openfirmware(void *args); __inline void ofw_save_trap_vec(char *save_trap_vec) { - if (!ofw_real_mode) + if (!ofw_real_mode || !hw_direct_map) return; - bcopy((void *)EXC_RST, save_trap_vec, EXC_LAST - EXC_RST); + bcopy((void *)PHYS_TO_DMAP(EXC_RST), save_trap_vec, EXC_LAST - EXC_RST); } static __inline void ofw_restore_trap_vec(char *restore_trap_vec) { - if (!ofw_real_mode) + if (!ofw_real_mode || !hw_direct_map) return; - bcopy(restore_trap_vec, (void *)EXC_RST, EXC_LAST - EXC_RST); - __syncicache(EXC_RSVD, EXC_LAST - EXC_RSVD); + bcopy(restore_trap_vec, (void *)PHYS_TO_DMAP(EXC_RST), + EXC_LAST - EXC_RST); + __syncicache((void *)PHYS_TO_DMAP(EXC_RSVD), EXC_LAST - EXC_RSVD); } /* @@ -381,12 +382,6 @@ OF_initial_setup(void *fdt_ptr, void *junk, int (*open #endif fdt = fdt_ptr; - - #ifdef FDT_DTB_STATIC - /* Check for a statically included blob */ - if (fdt == NULL) - fdt = &fdt_static_dtb; - #endif } boolean_t @@ -414,13 +409,57 @@ OF_bootstrap() } else #endif if (fdt != NULL) { - status = OF_install(OFW_FDT, 0); +#ifdef AIM + bus_space_tag_t fdt_bt; + vm_offset_t tmp_fdt_ptr; + vm_size_t fdt_size; + uintptr_t fdt_va; +#endif + status = OF_install(OFW_FDT, 0); if (status != TRUE) return status; +#ifdef AIM /* AIM-only for now -- Book-E does this remapping in early init */ + /* Get the FDT size for mapping if we can */ + tmp_fdt_ptr = pmap_early_io_map((vm_paddr_t)fdt, PAGE_SIZE); + if (fdt_check_header((void *)tmp_fdt_ptr) != 0) { + pmap_early_io_unmap(tmp_fdt_ptr, PAGE_SIZE); + return FALSE; + } + fdt_size = fdt_totalsize((void *)tmp_fdt_ptr); + pmap_early_io_unmap(tmp_fdt_ptr, PAGE_SIZE); + + /* + * Map this for real. Use bus_space_map() to take advantage + * of its auto-remapping function once the kernel is loaded. + * This is a dirty hack, but what we have. + */ +#ifdef _LITTLE_ENDIAN + fdt_bt = &bs_le_tag; +#else + fdt_bt = &bs_be_tag; +#endif + bus_space_map(fdt_bt, (vm_paddr_t)fdt, fdt_size, 0, &fdt_va); + + err = OF_init((void *)fdt_va); +#else err = OF_init(fdt); +#endif } + + #ifdef FDT_DTB_STATIC + /* + * Check for a statically included blob already in the kernel and + * needing no mapping. + */ + else { + status = OF_install(OFW_FDT, 0); + if (status != TRUE) + return status; + err = OF_init(&fdt_static_dtb); + } + #endif if (err != 0) { OF_install(NULL, 0); Modified: head/sys/powerpc/ofw/ofw_real.c ============================================================================== --- head/sys/powerpc/ofw/ofw_real.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/ofw/ofw_real.c Wed Mar 7 17:08:07 2018 (r330610) @@ -223,7 +223,7 @@ ofw_real_bounce_alloc(void *junk) * we have a 32-bit virtual address to give OF. */ - if (!ofw_real_mode && !hw_direct_map) + if (!ofw_real_mode && (!hw_direct_map || DMAP_BASE_ADDRESS != 0)) pmap_kenter(of_bounce_phys, of_bounce_phys); mtx_unlock(&of_bounce_mtx); @@ -244,7 +244,7 @@ ofw_real_map(const void *buf, size_t len) * can use right now is memory mapped by firmware. */ if (!pmap_bootstrapped) - return (cell_t)(uintptr_t)buf; + return (cell_t)((uintptr_t)buf & ~DMAP_BASE_ADDRESS); /* * XXX: It is possible for us to get called before the VM has @@ -253,7 +253,8 @@ ofw_real_map(const void *buf, size_t len) * Copy into the emergency buffer, and reset at the end. */ of_bounce_virt = emergency_buffer; - of_bounce_phys = (vm_offset_t)of_bounce_virt; + of_bounce_phys = (vm_offset_t)of_bounce_virt & + ~DMAP_BASE_ADDRESS; of_bounce_size = sizeof(emergency_buffer); } @@ -261,7 +262,8 @@ ofw_real_map(const void *buf, size_t len) * Make sure the bounce page offset satisfies any reasonable * alignment constraint. */ - of_bounce_offset += sizeof(register_t) - (of_bounce_offset % sizeof(register_t)); + of_bounce_offset += sizeof(register_t) - + (of_bounce_offset % sizeof(register_t)); if (of_bounce_offset + len > of_bounce_size) { panic("Oversize Open Firmware call!"); Modified: head/sys/powerpc/powerpc/bus_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/bus_machdep.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/powerpc/bus_machdep.c Wed Mar 7 17:08:07 2018 (r330610) @@ -115,7 +115,9 @@ bs_remap_earlyboot(void) for (i = 0; i < earlyboot_map_idx; i++) { spa = earlyboot_mappings[i].addr; - if (spa == earlyboot_mappings[i].virt && + + if (hw_direct_map && + PHYS_TO_DMAP(spa) == earlyboot_mappings[i].virt && pmap_dev_direct_mapped(spa, earlyboot_mappings[i].size) == 0) continue; Modified: head/sys/powerpc/powerpc/genassym.c ============================================================================== --- head/sys/powerpc/powerpc/genassym.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/powerpc/genassym.c Wed Mar 7 17:08:07 2018 (r330610) @@ -222,6 +222,7 @@ ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); ASSYM(KERNBASE, KERNBASE); +ASSYM(DMAP_BASE_ADDRESS, DMAP_BASE_ADDRESS); ASSYM(MAXCOMLEN, MAXCOMLEN); #ifdef __powerpc64__ Modified: head/sys/powerpc/powerpc/mem.c ============================================================================== --- head/sys/powerpc/powerpc/mem.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/powerpc/mem.c Wed Mar 7 17:08:07 2018 (r330610) @@ -125,8 +125,9 @@ kmem_direct_mapped: v = uio->uio_offset; break; } - if (!pmap_dev_direct_mapped(v, cnt)) { - error = uiomove((void *)v, cnt, uio); + if (hw_direct_map && !pmap_dev_direct_mapped(v, cnt)) { + error = uiomove((void *)PHYS_TO_DMAP(v), cnt, + uio); } else { m.phys_addr = trunc_page(v); marr = &m; Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/powerpc/uma_machdep.c Wed Mar 7 17:08:07 2018 (r330610) @@ -94,7 +94,12 @@ uma_small_free(void *mem, vm_size_t size, u_int8_t fla pmap_remove(kernel_pmap,(vm_offset_t)mem, (vm_offset_t)mem + PAGE_SIZE); - m = PHYS_TO_VM_PAGE((vm_offset_t)mem); + if (hw_direct_map) + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)mem)); + else + m = PHYS_TO_VM_PAGE((vm_offset_t)mem); + KASSERT(m != NULL, + ("Freeing UMA block at %p with no associated page", mem)); vm_page_unwire_noq(m); vm_page_free(m); atomic_subtract_int(&hw_uma_mdpages, 1); Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Wed Mar 7 16:55:15 2018 (r330609) +++ head/sys/powerpc/ps3/platform_ps3.c Wed Mar 7 17:08:07 2018 (r330610) @@ -128,9 +128,6 @@ ps3_attach(platform_t plat) pmap_mmu_install("mmu_ps3", BUS_PROBE_SPECIFIC); cpu_idle_hook = ps3_cpu_idle; - /* Set a breakpoint to make NULL an invalid address */ - lv1_set_dabr(0x7 /* read and write, MMU on */, 2 /* kernel accesses */); - /* Record our PIR at boot for later */ ps3_boot_pir = mfspr(SPR_PIR); @@ -227,7 +224,8 @@ static int ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) { /* kernel is spinning on 0x40 == -1 right now */ - volatile uint32_t *secondary_spin_sem = (uint32_t *)PHYS_TO_DMAP(0x40); + volatile uint32_t *secondary_spin_sem = + (uint32_t *)PHYS_TO_DMAP((uintptr_t)0x40); int remote_pir = pc->pc_hwref; int timeout; From owner-svn-src-head@freebsd.org Wed Mar 7 17:09: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 E55BDF40BF3; Wed, 7 Mar 2018 17:09:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (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 863A181561; Wed, 7 Mar 2018 17:09:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f180.google.com with SMTP id 30so3825569iog.2; Wed, 07 Mar 2018 09:09:43 -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=jGeJ6Rfn5vWL4F/FV6ZBmMjlwsC5F7SMTtfUPmCWMnU=; b=QYsEdpphvM2QwJG5J7dmHXODrUein8nRDH0satVg5AaVFIKBZUj8twT5rIUCtUA3Rq OJ+M5PsWpgXsBm5N0DjFtZ8I0jf/OOITlf9E1UfTlFH934udp/jMuqptNRlzpuUIeE8y hxHGNXPQrJrj/VlPW8YhTEwQ03nwSfaPSHYZjC6dWx6hVVULU8b1wQZjsH8yHk2EKZrS IiPAWaCmorsPGBgN+Jl7uWT69Fnen9Sy59IN3earbAF7Z4B9RpVqJDNLbZhN5UoTGRh5 xk8v74qDsSSAV2c2jh/C7W9hvoDQM+dYvOWTvxI/LLC82s+tEmqIU2td1g0hiHhQZxhy S66A== X-Gm-Message-State: APf1xPA3Ykn1HCqiNr0fXtrL8682j/jKE1WBKknoFncLdCUqSQki7s9A fAmvEyXC1sp9dMO47bArbpbpvZoV X-Google-Smtp-Source: AG47ELsJ181zZ/+vstEbC4rQrlUKXMvOwCinKl72wlndJPbx02ASZwHQM8xPs7w+bjWVGllBfa96lg== X-Received: by 10.107.164.132 with SMTP id d4mr24668859ioj.287.1520442577445; Wed, 07 Mar 2018 09:09:37 -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 z73sm12644771ioi.76.2018.03.07.09.09.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 09:09:37 -0800 (PST) Received: by mail-io0-f175.google.com with SMTP id e7so3839539ioj.1; Wed, 07 Mar 2018 09:09:37 -0800 (PST) X-Received: by 10.107.161.79 with SMTP id k76mr27112063ioe.19.1520442577166; Wed, 07 Mar 2018 09:09:37 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Wed, 7 Mar 2018 09:09:36 -0800 (PST) In-Reply-To: <201803071523.w27FN7ii074325@repo.freebsd.org> References: <201803071523.w27FN7ii074325@repo.freebsd.org> From: Conrad Meyer Date: Wed, 7 Mar 2018 09:09:36 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330608 - in head/sys/dev/mlx5: . mlx5_core mlx5_en To: Hans Petter Selasky 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: Wed, 07 Mar 2018 17:09:44 -0000 On Wed, Mar 7, 2018 at 7:23 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Mar 7 15:23:07 2018 > New Revision: 330608 > URL: https://svnweb.freebsd.org/changeset/base/330608 > > Log: > Implement priority to traffic class mapping in mlx5core. > > Add support for mapping priority to traffic class via sysctl > > Submitted by: Slava Shwartsman Didn't we just give this guy a commit bit? You can get him committing his own changes :-). Best, Conrad From owner-svn-src-head@freebsd.org Wed Mar 7 17:17: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 2B71BF41C21; Wed, 7 Mar 2018 17:17:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8478820BA; Wed, 7 Mar 2018 17:17:20 +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 2D66110AFAD; Wed, 7 Mar 2018 12:17:14 -0500 (EST) From: John Baldwin To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330575 - in head/sys: conf dev/acpica dev/pci Date: Wed, 07 Mar 2018 09:01:20 -0800 Message-ID: <2340744.aoyHCQxNFB@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201803071047.w27AlRiY032946@repo.freebsd.org> References: <201803071047.w27AlRiY032946@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 Mar 2018 12:17:14 -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 Mar 2018 17:17:21 -0000 On Wednesday, March 07, 2018 10:47:27 AM Andrew Turner wrote: > Author: andrew > Date: Wed Mar 7 10:47:27 2018 > New Revision: 330575 > URL: https://svnweb.freebsd.org/changeset/base/330575 > > Log: > Add an acpi attachment to the pci_host_generic driver and have the ACPI > bus provide it with its needed memory resources. > > This allows us to use PCIe on the ThunderX2 and, with a previous version > of the patch, on the SoftIron 3000 with ACPI. > > Obtained from: ABT Systems Ltd > Sponsored by: The FreeBSD Foundation > Sponsored by: DARPA, AFRL > Sponsored by: Cavium (Hardware) > Differential Revision: https://reviews.freebsd.org/D8767 > > Added: > head/sys/dev/pci/pci_host_generic_acpi.c (contents, props changed) > Modified: > head/sys/conf/files.arm64 > head/sys/dev/acpica/acpi.c > > Modified: head/sys/conf/files.arm64 > ============================================================================== > --- head/sys/conf/files.arm64 Wed Mar 7 09:58:36 2018 (r330574) > +++ head/sys/conf/files.arm64 Wed Mar 7 10:47:27 2018 (r330575) > @@ -171,6 +171,8 @@ crypto/blowfish/bf_enc.c optional crypto | ipsec | ips > crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb > dev/acpica/acpi_bus_if.m optional acpi > dev/acpica/acpi_if.m optional acpi > +dev/acpica/acpi_pci_link.c optional acpi pci > +dev/acpica/acpi_pcib.c optional acpi pci > dev/ahci/ahci_generic.c optional ahci > dev/axgbe/if_axgbe.c optional axgbe > dev/axgbe/xgbe-desc.c optional axgbe > @@ -191,6 +193,7 @@ dev/neta/if_mvneta.c optional neta mdio mii > dev/ofw/ofw_cpu.c optional fdt > dev/ofw/ofwpci.c optional fdt pci > dev/pci/pci_host_generic.c optional pci > +dev/pci/pci_host_generic_acpi.c optional pci acpi > dev/pci/pci_host_generic_fdt.c optional pci fdt > dev/psci/psci.c optional psci > dev/psci/psci_arm64.S optional psci > > Modified: head/sys/dev/acpica/acpi.c > ============================================================================== > --- head/sys/dev/acpica/acpi.c Wed Mar 7 09:58:36 2018 (r330574) > +++ head/sys/dev/acpica/acpi.c Wed Mar 7 10:47:27 2018 (r330575) > @@ -1883,6 +1883,29 @@ acpi_enable_pcie(void) > alloc++; > } > } > +#elif defined(__aarch64__) > +static void > +acpi_enable_pcie(device_t child, int segment) > +{ > + ACPI_TABLE_HEADER *hdr; > + ACPI_MCFG_ALLOCATION *alloc, *end; > + ACPI_STATUS status; > + > + status = AcpiGetTable(ACPI_SIG_MCFG, 1, &hdr); > + if (ACPI_FAILURE(status)) > + return; > + > + end = (ACPI_MCFG_ALLOCATION *)((char *)hdr + hdr->Length); > + alloc = (ACPI_MCFG_ALLOCATION *)((ACPI_TABLE_MCFG *)hdr + 1); > + while (alloc < end) { > + if (alloc->PciSegment == segment) { > + bus_set_resource(child, SYS_RES_MEMORY, 0, > + alloc->Address, 0x10000000); > + return; > + } > + alloc++; > + } > +} > #endif > > /* > @@ -1974,6 +1997,9 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi > { > ACPI_DEVICE_INFO *devinfo; > struct acpi_device *ad; > +#ifdef __aarch64__ > + int segment; > +#endif > struct acpi_prw_data prw; > ACPI_OBJECT_TYPE type; > ACPI_HANDLE h; > @@ -2076,6 +2102,13 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, voi > ad->ad_cls_class = strtoul(devinfo->ClassCode.String, > NULL, 16); > } > +#ifdef __aarch64__ > + if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { > + if (ACPI_SUCCESS(acpi_GetInteger(handle, "_SEG", &segment))) { > + acpi_enable_pcie(child, segment); > + } > + } > +#endif > AcpiOsFree(devinfo); > } > break; This logic probably belongs in the attach routine of the pcib driver rather than in MD #ifdef's in acpi.c. I still think we should be using acpi_pcib_acpi.c on arm64. IIRC all that is required is using a layer of indirection for PCI config access (using the existing pcib_if.m methods in the parent of acpi0 would work for this). -- John Baldwin From owner-svn-src-head@freebsd.org Wed Mar 7 17:18: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 D8231F41FC9; Wed, 7 Mar 2018 17:18:46 +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 8B7EC823A2; Wed, 7 Mar 2018 17:18:46 +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 865E624AE1; Wed, 7 Mar 2018 17:18:46 +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 w27HIkla030722; Wed, 7 Mar 2018 17:18:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27HIkLe030721; Wed, 7 Mar 2018 17:18:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803071718.w27HIkLe030721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 17:18:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330612 - head/stand/ficl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/ficl X-SVN-Commit-Revision: 330612 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:18:47 -0000 Author: kevans Date: Wed Mar 7 17:18:46 2018 New Revision: 330612 URL: https://svnweb.freebsd.org/changeset/base/330612 Log: stand/ficl: Fix testmain testmain is a userland application intended to be built with standard headers and whatnot, which we broke. Fix it by having the testmain build clobber cflags, reducing it to just the set of defines/includes it needs to build. Discussed with: imp MFC after: 3 days Modified: head/stand/ficl/Makefile Modified: head/stand/ficl/Makefile ============================================================================== --- head/stand/ficl/Makefile Wed Mar 7 17:16:41 2018 (r330611) +++ head/stand/ficl/Makefile Wed Mar 7 17:18:46 2018 (r330612) @@ -13,7 +13,8 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES+= softcore.c testmain testmain.o .ifmake testmain -CFLAGS+= -DTESTMAIN -D_TESTMAIN +CFLAGS= -DTESTMAIN -D_TESTMAIN +CFLAGS+= -I${FICLSRC} -I${FICLSRC}/${FICL_CPUARCH} -I${LDRSRC} SRCS+= testmain.c PROG= testmain .include From owner-svn-src-head@freebsd.org Wed Mar 7 17:33: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 EB781F43356; Wed, 7 Mar 2018 17:33:41 +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 9E3188322C; Wed, 7 Mar 2018 17:33:41 +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 987A924E1D; Wed, 7 Mar 2018 17:33:41 +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 w27HXfNK040588; Wed, 7 Mar 2018 17:33:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27HXf4A040587; Wed, 7 Mar 2018 17:33:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803071733.w27HXf4A040587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 7 Mar 2018 17:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330613 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 330613 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:33:42 -0000 Author: emaste Date: Wed Mar 7 17:33:41 2018 New Revision: 330613 URL: https://svnweb.freebsd.org/changeset/base/330613 Log: Disable LLD_BOOTSTRAP under WITHOUT_CROSS_COMPILER LLD is a cross toolchain component. It shouldn't be built when requesting a build without building a cross compiler. (CROSS_COMPILER is somewhat unfortunately named; in any case, lld should be treated as GNU binutils here.) Submitted by: Dan McGregor MFC after: 1 week Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Mar 7 17:18:46 2018 (r330612) +++ head/share/mk/src.opts.mk Wed Mar 7 17:33:41 2018 (r330613) @@ -437,6 +437,7 @@ MK_BINUTILS_BOOTSTRAP:= no MK_CLANG_BOOTSTRAP:= no MK_ELFTOOLCHAIN_BOOTSTRAP:= no MK_GCC_BOOTSTRAP:= no +MK_LLD_BOOTSTRAP:= no .endif .if ${MK_TOOLCHAIN} == "no" From owner-svn-src-head@freebsd.org Wed Mar 7 17:37: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 25D54F437B8; Wed, 7 Mar 2018 17:37: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 CA11783511; Wed, 7 Mar 2018 17:37: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 C4DDC24E24; Wed, 7 Mar 2018 17:37: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 w27Hbait040766; Wed, 7 Mar 2018 17:37:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27HbaXM040765; Wed, 7 Mar 2018 17:37:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803071737.w27HbaXM040765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 7 Mar 2018 17:37:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330614 - 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: 330614 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:37:37 -0000 Author: emaste Date: Wed Mar 7 17:37:36 2018 New Revision: 330614 URL: https://svnweb.freebsd.org/changeset/base/330614 Log: Regen src.conf.5 after r330613 CROSS_TOOLCHAIN change Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Mar 7 17:33:41 2018 (r330613) +++ head/share/man/man5/src.conf.5 Wed Mar 7 17:37:36 2018 (r330614) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd March 1, 2018 +.Dd March 7, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -397,6 +397,8 @@ When set, it enforces these options: .Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP .It .Va WITHOUT_GCC_BOOTSTRAP +.It +.Va WITHOUT_LLD_BOOTSTRAP .El .It Va WITHOUT_CRYPT Set to not build any crypto code. From owner-svn-src-head@freebsd.org Wed Mar 7 18:03: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 160BAF45922; Wed, 7 Mar 2018 18:03:23 +0000 (UTC) (envelope-from tychon@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 BC3B684A26; Wed, 7 Mar 2018 18:03:22 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B7088252EB; Wed, 7 Mar 2018 18:03:22 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27I3Mvs055652; Wed, 7 Mar 2018 18:03:22 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27I3MSU055650; Wed, 7 Mar 2018 18:03:22 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201803071803.w27I3MSU055650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Wed, 7 Mar 2018 18:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330615 - in head/sys/amd64: include vmm/intel X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: in head/sys/amd64: include vmm/intel X-SVN-Commit-Revision: 330615 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:03:23 -0000 Author: tychon Date: Wed Mar 7 18:03:22 2018 New Revision: 330615 URL: https://svnweb.freebsd.org/changeset/base/330615 Log: Fix a lock recursion introduced in r327065. Reported by: kmacy Reviewed by: grehan, jhb Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14548 Modified: head/sys/amd64/include/vmm.h head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Wed Mar 7 17:37:36 2018 (r330614) +++ head/sys/amd64/include/vmm.h Wed Mar 7 18:03:22 2018 (r330615) @@ -636,6 +636,7 @@ struct vm_exit { } spinup_ap; struct { uint64_t rflags; + uint64_t intr_status; } hlt; struct { int vector; Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Wed Mar 7 17:37:36 2018 (r330614) +++ head/sys/amd64/vmm/intel/vmx.c Wed Mar 7 18:03:22 2018 (r330615) @@ -2282,6 +2282,11 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_ vmm_stat_incr(vmx->vm, vcpu, VMEXIT_HLT, 1); vmexit->exitcode = VM_EXITCODE_HLT; vmexit->u.hlt.rflags = vmcs_read(VMCS_GUEST_RFLAGS); + if (virtual_interrupt_delivery) + vmexit->u.hlt.intr_status = + vmcs_read(VMCS_GUEST_INTR_STATUS); + else + vmexit->u.hlt.intr_status = 0; break; case EXIT_REASON_MTF: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_MTRAP, 1); @@ -3267,12 +3272,13 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) * interrupt by reevaluating virtual interrupts * following Section 29.2.1 in the Intel SDM Volume 3. */ - uint64_t val; + struct vm_exit *vmexit; uint8_t rvi, ppr; - vmx_getreg(vlapic_vtx->vmx, vlapic->vcpuid, - VMCS_IDENT(VMCS_GUEST_INTR_STATUS), &val); - rvi = val & APIC_TPR_INT; + vmexit = vm_exitinfo(vlapic->vm, vlapic->vcpuid); + KASSERT(vmexit->exitcode == VM_EXITCODE_HLT, + ("vmx_pending_intr: exitcode not 'HLT'")); + rvi = vmexit->u.hlt.intr_status & APIC_TPR_INT; lapic = vlapic->apic_page; ppr = lapic->ppr & APIC_TPR_INT; if (rvi > ppr) { From owner-svn-src-head@freebsd.org Wed Mar 7 18:20: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 56A98F46EDE for ; Wed, 7 Mar 2018 18:20:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic311-36.consmr.mail.gq1.yahoo.com (sonic311-36.consmr.mail.gq1.yahoo.com [98.137.65.217]) (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 D662085A2A for ; Wed, 7 Mar 2018 18:20:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1520446813; bh=H2fpxJYxR8Y7gk7hMU0VtNiZW9ietHk0qKIgMrpv5A4=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=P7/1nrl/OYhB4I3yo1MnwuTM7bMFQ1a55KlDl7s7JKIwHNxQWc4BwYlvJZRwx+VBNgrnM2okfYP84C4XbiGaYME5tjmDQd+ZdfwgETyc57t6R0CGg5EV4/iyRog8cHIL5o17cyPsVGSi7/A0x4XNPWSKjq67MN5ZOqJYNFxX7guesF1dfzerMe97Qm5NFo8Rn2uq2zXhaz7zL8/5b73dTVaPv++HIABhXKMwnWH1yWKzUH9hDjK3343ZO+ztxeAtGI6mjObbqO74dbpJ/EdD0CGKVjVat3F009I/dJr53CtgRD7BqF/QGqlhNy2R3K68G0BCWCqcGYIB3BpfI06/lg== X-YMail-OSG: 5N5TbQkVM1ktYN5bwcaBWdrVm0jzAL2SsnRTolUISD3b1LGcaKqHpXM4YYLWXwV .o7ZhC6kCxMoire1n349jkmCd_l7hX89fmO6DVEevuhjUkOoeE7Map9gcMALbod757vbDTDYbd9b fgGBEb1.ZKCMEg1gMsN3PI8frNNvdSjLUXV9VVXiEwsY_aE1pa46SPHfegbgxMe_7VigcKXdjpjx .kjAIG7mbimphWjFTK7W7AxnfkotK_gA84nh3AoqJESgAqVlEMLxdwh5s.JfDNmyljwL5QuAUDZj dFG1sNf1_p3q2B4uKOvwhQf9Dq6p.qL_OHc3mZFTZ3vSsZLAI8LHMaaNbL1l5j1vG0LoV.QDlUZb YziuMWShZrjhmsARzohKZ5DNigdCsqr28yHs7tg9t9gfCrXgWxBqKmqpGeJ2eqkoItMYno04Bo_h 7g.pwak66eHAvvQLhMz_L9RDsMvggGE5uQ6UHS_aMDwZUXKcu19DwJOMlDDMFDL9r2aalvBY4WER 1K0e07KwTgtQ- Received: from sonic.gate.mail.ne1.yahoo.com by sonic311.consmr.mail.gq1.yahoo.com with HTTP; Wed, 7 Mar 2018 18:20:13 +0000 Received: from smtp103.rhel.mail.gq1.yahoo.com (EHLO [192.168.0.5]) ([68.180.227.11]) by smtp407.mail.gq1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 3fe462febc7181c785a57f1c1e7e35dd; Wed, 07 Mar 2018 18:20:13 +0000 (UTC) Subject: Re: svn commit: r330601 - head/sys/i386/ibcs2 To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803071444.w27EiWBV053244@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Wed, 7 Mar 2018 13:20:14 -0500 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: <201803071444.w27EiWBV053244@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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: Wed, 07 Mar 2018 18:20:20 -0000 FWIW ... ibcs2 is candidate for future removal. We tried to get some vendor interest in it but we failed and given this is very i386-specific it is probably not worth spending huge efforts on it. cloudabi seems to be, for all purposes, a better conceptual replacement. Pedro. On 07/03/2018 09:44, Eitan Adler wrote: > Author: eadler > Date: Wed Mar 7 14:44:32 2018 > New Revision: 330601 > URL: https://svnweb.freebsd.org/changeset/base/330601 > > Log: > sys: Fix a few potential infoleaks in cloudabi > > While there is no immediate leak, if the structure changes underneath > us, there might be in the future. > > Submitted by: Domagoj Stolfa > MFC After: 1 month > Sponsored by: DARPA/AFRL > > Modified: > head/sys/i386/ibcs2/ibcs2_ipc.c > > Modified: head/sys/i386/ibcs2/ibcs2_ipc.c > ============================================================================== > --- head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar 7 14:41:29 2018 (r330600) > +++ head/sys/i386/ibcs2/ibcs2_ipc.c Wed Mar 7 14:44:32 2018 (r330601) > @@ -135,6 +135,8 @@ ibcs2_msgctl(struct thread *td, void *v) > struct msqid_ds bs; > int error; > > + memset(&is, 0, sizeof(is)); > + > switch (uap->cmd) { > case IBCS2_IPC_STAT: > error = kern_msgctl(td, uap->msqid, IPC_STAT, &bs); > @@ -317,6 +319,8 @@ ibcs2_semctl(struct thread *td, void *v) > union semun semun; > register_t rval; > int error; > + > + memset(&is, 0, sizeof(is)); > > switch(uap->cmd) { > case IBCS2_IPC_STAT: > From owner-svn-src-head@freebsd.org Wed Mar 7 18:25: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 E2438F475D2; Wed, 7 Mar 2018 18:25:27 +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 900DE85FAB; Wed, 7 Mar 2018 18:25:27 +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 8ACDA25622; Wed, 7 Mar 2018 18:25:27 +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 w27IPR13065736; Wed, 7 Mar 2018 18:25:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27IPRov065734; Wed, 7 Mar 2018 18:25:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803071825.w27IPRov065734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 18:25:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330616 - in head/stand: liblua lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/stand: liblua lua X-SVN-Commit-Revision: 330616 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:25:28 -0000 Author: kevans Date: Wed Mar 7 18:25:27 2018 New Revision: 330616 URL: https://svnweb.freebsd.org/changeset/base/330616 Log: lualoader: Expose loader.parse and add cli_execute_unparsed This will be used for scenarios where the command to execute is coming in via the environment (from, for example, loader.conf(5)) and is thus not necessarily trusted. cli_execute_unparsed will immediately be used for handling module_{before,after,error} as well as menu_timeout_command. We still want to offer these variables the ability to execute Lua-intercepted loader commands, but we don't want them to be able to execute arbitrary Lua. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14580 Modified: head/stand/liblua/lutils.c head/stand/lua/cli.lua Modified: head/stand/liblua/lutils.c ============================================================================== --- head/stand/liblua/lutils.c Wed Mar 7 18:03:22 2018 (r330615) +++ head/stand/liblua/lutils.c Wed Mar 7 18:25:27 2018 (r330616) @@ -97,6 +97,24 @@ lua_interpret(lua_State *L) } static int +lua_parse(lua_State *L) +{ + int argc, nargc; + char **argv; + + if (parse(&argc, &argv, luaL_checkstring(L, 1)) == 0) { + for (nargc = 0; nargc < argc; ++nargc) { + lua_pushstring(L, argv[nargc]); + } + free(argv); + return nargc; + } + + lua_pushnil(L); + return 1; +} + +static int lua_getchar(lua_State *L) { @@ -325,6 +343,7 @@ static const struct luaL_Reg loaderlib[] = { REG_SIMPLE(delay), REG_SIMPLE(command), REG_SIMPLE(interpret), + REG_SIMPLE(parse), REG_SIMPLE(getenv), REG_SIMPLE(perform), /* Also registered as the global 'printc' */ Modified: head/stand/lua/cli.lua ============================================================================== --- head/stand/lua/cli.lua Wed Mar 7 18:03:22 2018 (r330615) +++ head/stand/lua/cli.lua Wed Mar 7 18:25:27 2018 (r330616) @@ -94,6 +94,10 @@ function cli_execute(...) end +function cli.execute_unparsed(str) + cli_execute(loader.parse(str)) +end + -- Module exports function cli.boot(...) From owner-svn-src-head@freebsd.org Wed Mar 7 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 7855CF479BB; Wed, 7 Mar 2018 18:28:42 +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 2BC8E861FE; Wed, 7 Mar 2018 18:28:42 +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 26B512562B; Wed, 7 Mar 2018 18:28:42 +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 w27ISgEj065877; Wed, 7 Mar 2018 18:28:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27ISgb8065876; Wed, 7 Mar 2018 18:28:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803071828.w27ISgb8065876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 18:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330617 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330617 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:28:42 -0000 Author: kevans Date: Wed Mar 7 18:28:41 2018 New Revision: 330617 URL: https://svnweb.freebsd.org/changeset/base/330617 Log: lualoader: Fix name, cli.execute_unparsed -> cli_execute_unparsed Modified: head/stand/lua/cli.lua Modified: head/stand/lua/cli.lua ============================================================================== --- head/stand/lua/cli.lua Wed Mar 7 18:25:27 2018 (r330616) +++ head/stand/lua/cli.lua Wed Mar 7 18:28:41 2018 (r330617) @@ -94,7 +94,7 @@ function cli_execute(...) end -function cli.execute_unparsed(str) +function cli_execute_unparsed(str) cli_execute(loader.parse(str)) end From owner-svn-src-head@freebsd.org Wed Mar 7 18:31: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 1D2D0F47D14; Wed, 7 Mar 2018 18:31:02 +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 BC8A086416; Wed, 7 Mar 2018 18:31:01 +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 B76D125651; Wed, 7 Mar 2018 18:31:01 +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 w27IV1ws066716; Wed, 7 Mar 2018 18:31:01 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27IV1L2066715; Wed, 7 Mar 2018 18:31:01 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803071831.w27IV1L2066715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 18:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330618 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330618 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:31:02 -0000 Author: kevans Date: Wed Mar 7 18:31:01 2018 New Revision: 330618 URL: https://svnweb.freebsd.org/changeset/base/330618 Log: lualoader: Use cli_execute_unparsed instead of loader.interpret loader.interpret should not be used for executing loader commands from an untrusted source (e.g. environment vars) as it will allow execution of arbitrary Lua. Replace it with a call to the recently introduced cli_execute_unparsed, which parses it out as a loader command and then dispatches it as a loader command. This effectively filters out arbitrary Lua. Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Wed Mar 7 18:28:41 2018 (r330617) +++ head/stand/lua/menu.lua Wed Mar 7 18:31:01 2018 (r330618) @@ -450,7 +450,7 @@ function menu.autoboot() until time <= 0 local cmd = loader.getenv("menu_timeout_command") or "boot" - loader.interpret(cmd) + cli_execute_unparsed(cmd) end return menu From owner-svn-src-head@freebsd.org Wed Mar 7 18:31: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 ADC0DF47E28; Wed, 7 Mar 2018 18:31:31 +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 56109865A7; Wed, 7 Mar 2018 18:31:31 +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 50E9D2567B; Wed, 7 Mar 2018 18:31:31 +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 w27IVVkT066772; Wed, 7 Mar 2018 18:31:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27IVVwA066771; Wed, 7 Mar 2018 18:31:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803071831.w27IVVwA066771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 7 Mar 2018 18:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330619 - 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: 330619 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:31:32 -0000 Author: cem Date: Wed Mar 7 18:31:31 2018 New Revision: 330619 URL: https://svnweb.freebsd.org/changeset/base/330619 Log: fpu_kern.9: Document fpu_kern_enter API change in r329878 While here, clean up some of the language. Reported by: delphij Sponsored by: Dell EMC Isilon Modified: head/share/man/man9/fpu_kern.9 Modified: head/share/man/man9/fpu_kern.9 ============================================================================== --- head/share/man/man9/fpu_kern.9 Wed Mar 7 18:31:01 2018 (r330618) +++ head/share/man/man9/fpu_kern.9 Wed Mar 7 18:31:31 2018 (r330619) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2016 +.Dd March 7, 2018 .Dt FPU_KERN 9 .Os .Sh NAME @@ -34,7 +34,7 @@ .Fn fpu_kern_alloc_ctx "u_int flags" .Ft void .Fn fpu_kern_free_ctx "struct fpu_kern_ctx *ctx" -.Ft int +.Ft void .Fn fpu_kern_enter "struct thread *td" "struct fpu_kern_ctx *ctx" "u_int flags" .Ft int .Fn fpu_kern_leave "struct thread *td" "struct fpu_kern_ctx *ctx" @@ -139,19 +139,15 @@ after the function returns, as well as after each cont On i386 and amd64 this will be the .Nm Device Not Available exception (see Intel Software Developer Manual for the reference). -Currently, no errors are defined which can be returned by -.Fn fpu_kern_enter -to the caller. .Pp The .Fn fpu_kern_leave function ends the region started by .Fn fpu_kern_enter . -The uses of FPU in the kernel after the call to -.Fn fpu_kern_leave -are erroneous until the next call to +It is erroneous to use the FPU in the kernel before .Fn fpu_kern_enter -is performed. +or after +.Fn fpu_kern_leave . The function takes the .Fa td thread argument, which currently must be @@ -161,9 +157,9 @@ and the context pointer, previously passed to .Fn fpu_kern_enter . After the function returns, the context may be freed or reused -by other invocation of +by another invocation of .Fn fpu_kern_enter . -There are no errors defined for the function, it always returns 0. +The function always returns 0. .Pp The .Fn fpu_kern_thread @@ -210,3 +206,9 @@ facitily and this manual page were written by .An Konstantin Belousov Aq Mt kib@FreeBSD.org . The arm64 support was added by .An Andrew Turner Aq Mt andrew@FreeBSD.org . +.Sh BUGS +.Fn fpu_kern_leave +should probably have type +.Ft void +(like +.Fn fpu_kern_enter ) . From owner-svn-src-head@freebsd.org Wed Mar 7 18:37: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 07DA5F4860A; Wed, 7 Mar 2018 18:37:04 +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 AA3CD86C71; Wed, 7 Mar 2018 18:37:04 +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 A5121257DF; Wed, 7 Mar 2018 18:37:04 +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 w27Ib4Sb070863; Wed, 7 Mar 2018 18:37:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27Ib40v070862; Wed, 7 Mar 2018 18:37:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803071837.w27Ib40v070862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 18:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330620 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330620 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:37:05 -0000 Author: kevans Date: Wed Mar 7 18:37:04 2018 New Revision: 330620 URL: https://svnweb.freebsd.org/changeset/base/330620 Log: lualoader: Use cli_execute_unparsed for commands passed in via loader.conf This applies to: - exec - [module]_before - [module]_error - [module]_after Before this commit, these used loader.perform to execute them as a pure, unsalted loader command. This means that they were not able to take advantage of any Lua-salted loader commands, like boot and autoboot, or pure Lua loader commands (functions attached to the 'cli' module). They now have access to the full arsenal, just shy of being able to execute arbitrary Lua. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Wed Mar 7 18:31:31 2018 (r330619) +++ head/stand/lua/config.lua Wed Mar 7 18:37:04 2018 (r330620) @@ -109,7 +109,7 @@ local pattern_table = { { str = "^%s*exec%s*=%s*\"([%w%s%p]-)\"%s*(.*)", process = function(k, _) - if loader.perform(k) ~= 0 then + if cli_execute_unparsed(k) ~= 0 then print(MSG_FAILEXEC:format(k)) end end, @@ -290,25 +290,25 @@ function config.loadmod(mod, silent) str = str .. k end if v.before ~= nil then - pstatus = loader.perform(v.before) == 0 + pstatus = cli_execute_unparsed(v.before) == 0 if not pstatus and not silent then print(MSG_FAILEXBEF:format(v.before, k)) end status = status and pstatus end - if loader.perform(str) ~= 0 then + if cli_execute_unparsed(str) ~= 0 then if not silent then print(MSG_FAILEXMOD:format(str)) end if v.error ~= nil then - loader.perform(v.error) + cli_execute_unparsed(v.error) end status = false end if v.after ~= nil then - pstatus = loader.perform(v.after) == 0 + pstatus = cli_execute_unparsed(v.after) == 0 if not pstatus and not silent then print(MSG_FAILEXAF:format(v.after, k)) end From owner-svn-src-head@freebsd.org Wed Mar 7 18: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 DA953F48CD5; Wed, 7 Mar 2018 18:41:16 +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 6EC5387129; Wed, 7 Mar 2018 18:41:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69D4425829; Wed, 7 Mar 2018 18:41:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w27IfGi5071065; Wed, 7 Mar 2018 18:41:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27IfGY3071064; Wed, 7 Mar 2018 18:41:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803071841.w27IfGY3071064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 18:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330621 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 330621 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:41:17 -0000 Author: kevans Date: Wed Mar 7 18:41:16 2018 New Revision: 330621 URL: https://svnweb.freebsd.org/changeset/base/330621 Log: lua-lint: Whitelist cli_execute_unparsed as a global Modified: head/tools/boot/lua-lint.sh Modified: head/tools/boot/lua-lint.sh ============================================================================== --- head/tools/boot/lua-lint.sh Wed Mar 7 18:37:04 2018 (r330620) +++ head/tools/boot/lua-lint.sh Wed Mar 7 18:41:16 2018 (r330621) @@ -16,4 +16,5 @@ LUACHECK=$(which luacheck) cd $(make -V SRCTOP)/stand ${LUACHECK} . --globals loader --globals lfs --globals io.getchar \ - --globals io.ischar --globals printc --globals cli_execute --std lua53 + --globals io.ischar --globals printc --globals cli_execute \ + --globals cli_execute_unparsed --std lua53 From owner-svn-src-head@freebsd.org Wed Mar 7 18:45: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 C54E0F49227; Wed, 7 Mar 2018 18:45:24 +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 786DD875EC; Wed, 7 Mar 2018 18:45:24 +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 733C625983; Wed, 7 Mar 2018 18:45:24 +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 w27IjOFB076222; Wed, 7 Mar 2018 18:45:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27IjO3X076221; Wed, 7 Mar 2018 18:45:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803071845.w27IjO3X076221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 18:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330622 - head/stand/defaults X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/defaults X-SVN-Commit-Revision: 330622 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:45:24 -0000 Author: kevans Date: Wed Mar 7 18:45:24 2018 New Revision: 330622 URL: https://svnweb.freebsd.org/changeset/base/330622 Log: loader.conf(5): Document some other settings These tend to have less coverage in other places and they don't have defaults as of yet, so mention them here: - fdt_overlays - kernels_autodetect (lualoader only) Modified: head/stand/defaults/loader.conf.5 Modified: head/stand/defaults/loader.conf.5 ============================================================================== --- head/stand/defaults/loader.conf.5 Wed Mar 7 18:41:16 2018 (r330621) +++ head/stand/defaults/loader.conf.5 Wed Mar 7 18:45:24 2018 (r330622) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 6, 2016 +.Dd March 7, 2018 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -277,6 +277,23 @@ See the entropy entries in .Pq Dq /boot/entropy The name of the very early boot-time entropy cache file. +.El +.Sh OTHER SETTINGS +Other settings that may be used in +.Nm +that have no default value: +.Bl -tag -width bootfile -offset indent +.It Va fdt_overlays +Specifies a comma-delimited list of FDT overlays to apply. +.Pa /boot/overlays +is created by default for overlays to be placed in. +.It Va kernels_autodetect +If set to +.Dq YES , +attempt to auto-detect kernels installed in +.Pa /boot . +This is an option specific to the Lua-based loader. +It is not available in the default Forth-based loader. .El .Sh FILES .Bl -tag -width /boot/defaults/loader.conf -compact From owner-svn-src-head@freebsd.org Wed Mar 7 18:46: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 6BDDCF493E1 for ; Wed, 7 Mar 2018 18:46:46 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (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 D1A31877A9 for ; Wed, 7 Mar 2018 18:46:45 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-lf0-f50.google.com with SMTP id t204-v6so4719828lff.9 for ; Wed, 07 Mar 2018 10:46:45 -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:cc; bh=JyhCtU6+xMTUFvJd7i46jdRq6cQYkSahuppEIfUNYB0=; b=TMbjBJUbiGE2vUTmmGJWIMQUCuA5bL5dLgMORmvzp9RwaKukljY4ARk0M30CLrjYOG f+V2pDSy1sUtZ9zw3whqnn93ivql217fygp33P/4s56gCmv8OmRTbFLF/w70HAgiSYlw B95AUN5ItjCqg/9ZKzCdc+OimC3IaDPCCgOygJFgMlvBkd5+E2KCGTZUgTp2ivu/RU14 bs5GT7kEWqt7t69okRqEptFKU4znw8zdNg+LdQs1Efn6ss0h0aN/W4DYgLMBX5NoK9ea mpw3fronpXG3sNlTpnan5vCojws1A/WFme3G36yNtsN3CTLNqKEFtK4qk0Ahh69kZjM4 mjqg== X-Gm-Message-State: AElRT7FDvQV09gNrXyjdlr+X4vnOEhxvPGdiSYhGlmYAduLCpLUNVOJq mQoPj8ZY7BCymohInfr0UgdE8ZnW X-Google-Smtp-Source: AG47ELuUoYkmPVKucNEN8rZ4KIVUNdAD32KbDCcf719cYAKXfdBQVlzmZN3Aut133/Ou/u/lWfnTNw== X-Received: by 10.25.16.66 with SMTP id f63mr14418074lfi.113.1520448403765; Wed, 07 Mar 2018 10:46:43 -0800 (PST) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com. [209.85.215.48]) by smtp.gmail.com with ESMTPSA id x66sm3807698lff.80.2018.03.07.10.46.43 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Mar 2018 10:46:43 -0800 (PST) Received: by mail-lf0-f48.google.com with SMTP id l191-v6so4742040lfe.1 for ; Wed, 07 Mar 2018 10:46:43 -0800 (PST) X-Received: by 10.46.87.72 with SMTP id r8mt18615813ljd.93.1520448403138; Wed, 07 Mar 2018 10:46:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.46.54.1 with HTTP; Wed, 7 Mar 2018 10:46:22 -0800 (PST) In-Reply-To: <201803071845.w27IjO3X076221@repo.freebsd.org> References: <201803071845.w27IjO3X076221@repo.freebsd.org> From: Kyle Evans Date: Wed, 7 Mar 2018 12:46:22 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330622 - head/stand/defaults 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: Wed, 07 Mar 2018 18:46:46 -0000 On Wed, Mar 7, 2018 at 12:45 PM, Kyle Evans wrote: > Author: kevans > Date: Wed Mar 7 18:45:24 2018 > New Revision: 330622 > URL: https://svnweb.freebsd.org/changeset/base/330622 > > Log: > loader.conf(5): Document some other settings > > These tend to have less coverage in other places and they don't have > defaults as of yet, so mention them here: > - fdt_overlays > - kernels_autodetect (lualoader only) > Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D14522 Whoops. =) From owner-svn-src-head@freebsd.org Wed Mar 7 20:42: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 B2E75F2EC6B; Wed, 7 Mar 2018 20:42:46 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 7786B6D3A2; Wed, 7 Mar 2018 20:42:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.101] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 4364C1A3927; Thu, 8 Mar 2018 07:42:37 +1100 (AEDT) Date: Thu, 8 Mar 2018 07:42:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Benjamin Kaduk cc: Ed Maste , Eitan Adler , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r330602 - head/sys/compat/cloudabi In-Reply-To: Message-ID: <20180308070722.R1227@besplex.bde.org> References: <201803071447.w27Elh7C053393@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=gcnCtRpcewpaml6cjn8A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 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 Mar 2018 20:42:46 -0000 On Wed, 7 Mar 2018, Benjamin Kaduk wrote: > On Wed, Mar 7, 2018 at 9:44 AM, Ed Maste wrote: > >> On 7 March 2018 at 09:47, Eitan Adler wrote: >>> ... >>> Log: >>> sys/cloudabi: Avoid relying on GNU specific extensions >>> >>> An empty initializer list is not technically valid C grammar. >>> >>> MFC After: 1 week >>> >>> - cloudabi_fdstat_t fsb = {}; >>> + cloudabi_fdstat_t fsb = {0}; >> >> In practice it appears initializing via { 0 } also zeros any padding >> in the struct, but I do not believe it's required by the C standard. >> Perhaps a language lawyer can weigh in? >> >> Commenting on this commit just because it's highlighted by this >> change; I do not believe there's a difference between the GNU >> extension { } and { 0 } here. It is also a style bug to initialize variables in declarations. It is interesting that this style bug gives other bugs that are more serious than when the style rule was new: - locking is often needed before complicated initializations. It would be an even larger style bug to write the lock acquisition in initializers, and C doesn't have finalizers so it is impossible to obfuscate the lock release by writing it in finalizers - this problem of initializing padding. Auto initializers also used to be good for pessimizations. Use them instead of static initializers for constant values. This asks the compiler to initialize them on every entry to the function. It was a typical implementation to keep the values in an unnamed static object and copy this to the stack at runtime. Now compilers are more likely to optimize away the copying, so the pessimization doesn't work so well. Copying from a static object tends to give zero padding, but optimizated variants should only give zero padding if that is optimal. > The C spec says that if an incomplete initializer is given, then all other > fields > of the structure are initialized to zero. The state of padding is > unspecified, > whether a complete or incomplete initializer is given. This seems to apply to static objects too. So initializing dynamic objects by copying them from static objects is insecure even if you copy using memcpy() (copying using struct assignment might skip the padding so shouldn't be used). A malicious compiler could initialize the padding with security-related info. non-malicious compiler might initialize the padding with stack garbage that happens to be security-related. Bruce From owner-svn-src-head@freebsd.org Wed Mar 7 20:55: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 08513F2FCE5; Wed, 7 Mar 2018 20:55:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 972EC6DED0; Wed, 7 Mar 2018 20:55:47 +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 055AD2602E8; Wed, 7 Mar 2018 21:55:39 +0100 (CET) Subject: Re: svn commit: r330608 - in head/sys/dev/mlx5: . mlx5_core mlx5_en To: cem@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803071523.w27FN7ii074325@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <710f24f5-a62b-b6d2-f176-dc59f43d5faf@selasky.org> Date: Wed, 7 Mar 2018 21:55:36 +0100 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: 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 Mar 2018 20:55:48 -0000 On 03/07/18 18:09, Conrad Meyer wrote: > On Wed, Mar 7, 2018 at 7:23 AM, Hans Petter Selasky > wrote: >> Author: hselasky >> Date: Wed Mar 7 15:23:07 2018 >> New Revision: 330608 >> URL: https://svnweb.freebsd.org/changeset/base/330608 >> >> Log: >> Implement priority to traffic class mapping in mlx5core. >> >> Add support for mapping priority to traffic class via sysctl >> >> Submitted by: Slava Shwartsman > > Didn't we just give this guy a commit bit? You can get him committing > his own changes :-). Next time there is a stand-alone patch, which doesn't have too many dependencies in the code I'll let him push it. Right now the upstreaming is a bit complicated - many patches in the queue which can only go in one order. --HPS From owner-svn-src-head@freebsd.org Wed Mar 7 21:20: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 479E9F31B9B; Wed, 7 Mar 2018 21:20:03 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C678C6F76C; Wed, 7 Mar 2018 21:20:02 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 0A9295A9F12; Wed, 7 Mar 2018 21:19:56 +0000 (UTC) Date: Wed, 7 Mar 2018 21:19:55 +0000 From: Brooks Davis To: Pedro Giffuni Cc: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330601 - head/sys/i386/ibcs2 Message-ID: <20180307211955.GA63140@spindle.one-eyed-alien.net> References: <201803071444.w27EiWBV053244@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) 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 Mar 2018 21:20:03 -0000 --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 07, 2018 at 01:20:14PM -0500, Pedro Giffuni wrote: > FWIW ... >=20 > ibcs2 is candidate for future removal. It is probably time again to see if actual users exist. ibcs2 has wasted a few hours of my time over the last few months so keeping it does have a non-zero cost. > We tried to get some vendor interest in it but we failed and given this= =20 > is very i386-specific it is probably not worth spending huge efforts on i= t. >=20 > cloudabi seems to be, for all purposes, a better conceptual replacement. This comment doesn't make much sense. iBCS is the Intel Binary Compatibility Standard, an obsolete ABI for i386 Unixes such as Xenix, SCO, and UnixWare. Cloudabi is, in a sense, taking Capsicum to its logical extreme and totally unrelated. -- Brooks --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJaoFd7AAoJEKzQXbSebgfAxBMH/j3s3MtNnRR4mJBGdy8VlrYv mR4kZ9ThLTzteCW0aRKJn2mOK3gZZemZbZ3B7q0Va2Srn+qDN1Gw3TUjm6wsqSdq WoeqGJnK/D35YbekgBYAUnv4fIoxXj+nw/19Nm0QMN0GdwJvUCE0hE8nK7R4EiOo 07AFggPmGU/3aLNeftRPsgy9pGPmASAVZV00YIh3vOtjV3rKItUhYFqJMcitQ/m8 fLn0XdBu3m45oA99tzH1PIB8XUH6HXNaXLH4MYDGE0uHk9dRaug3GspUKomOo/OI MQ/BUOED9EdCjios9eI7c5U1P6LwNZ2NlecNI3Wb8GxT4LZRziqmvoNw8SF84oM= =CPeF -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR-- From owner-svn-src-head@freebsd.org Wed Mar 7 22:04: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 B0C80F35F3E; Wed, 7 Mar 2018 22:04:28 +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 60E23725F9; Wed, 7 Mar 2018 22:04:28 +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 5BCA9279F3; Wed, 7 Mar 2018 22:04:28 +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 w27M4SFB077096; Wed, 7 Mar 2018 22:04:28 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27M4SoL077095; Wed, 7 Mar 2018 22:04:28 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201803072204.w27M4SoL077095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Wed, 7 Mar 2018 22:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330624 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 330624 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:04:28 -0000 Author: jeff Date: Wed Mar 7 22:04:27 2018 New Revision: 330624 URL: https://svnweb.freebsd.org/changeset/base/330624 Log: Don't assert that the domain free lock is held until we're certain that there is a valid reservation. This can trip erroneously when memory falls within a domain but doesn't have the reservation initialized because it does not meet size or alignment requirements. Reported by: pho, mjg Sponsored by: Netflix, Dell/EMC Isilon Modified: head/sys/vm/vm_reserv.c Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Wed Mar 7 20:50:28 2018 (r330623) +++ head/sys/vm/vm_reserv.c Wed Mar 7 22:04:27 2018 (r330624) @@ -1044,9 +1044,9 @@ vm_reserv_free_page(vm_page_t m) vm_reserv_t rv; rv = vm_reserv_from_page(m); - vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); if (rv->object == NULL) return (FALSE); + vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); vm_reserv_depopulate(rv, m - rv->pages); return (TRUE); } @@ -1093,9 +1093,9 @@ vm_reserv_is_page_free(vm_page_t m) vm_reserv_t rv; rv = vm_reserv_from_page(m); - vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); if (rv->object == NULL) return (false); + vm_domain_free_assert_locked(VM_DOMAIN(rv->domain)); return (popmap_is_clear(rv->popmap, m - rv->pages)); } From owner-svn-src-head@freebsd.org Wed Mar 7 22:05: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 4F2D7F36097; Wed, 7 Mar 2018 22:05:24 +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 00DC87275C; Wed, 7 Mar 2018 22:05:24 +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 EFEE8279F6; Wed, 7 Mar 2018 22:05:23 +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 w27M5NWs077176; Wed, 7 Mar 2018 22:05:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w27M5Nx9077175; Wed, 7 Mar 2018 22:05:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803072205.w27M5Nx9077175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 7 Mar 2018 22:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330625 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330625 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:05:24 -0000 Author: kevans Date: Wed Mar 7 22:05:23 2018 New Revision: 330625 URL: https://svnweb.freebsd.org/changeset/base/330625 Log: lualoader: Return status in cli_execute_unparsed properly cli_execute was changed to return the status, cascade that to cli_execute_unparsed. This fixes a lot of false "Failed to execute" errors following r330620; no failures actually occurred, but [module]_error would've then promptly executed (and also "failed") Modified: head/stand/lua/cli.lua Modified: head/stand/lua/cli.lua ============================================================================== --- head/stand/lua/cli.lua Wed Mar 7 22:04:27 2018 (r330624) +++ head/stand/lua/cli.lua Wed Mar 7 22:05:23 2018 (r330625) @@ -95,7 +95,7 @@ function cli_execute(...) end function cli_execute_unparsed(str) - cli_execute(loader.parse(str)) + return cli_execute(loader.parse(str)) end -- Module exports From owner-svn-src-head@freebsd.org Wed Mar 7 22:17: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 C7AFAF36F24; Wed, 7 Mar 2018 22:17:42 +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 45018730E5; Wed, 7 Mar 2018 22:17: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 w27MHVMa009372 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 8 Mar 2018 00:17:34 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w27MHVMa009372 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w27MHVeR009371; Thu, 8 Mar 2018 00:17:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 8 Mar 2018 00:17:31 +0200 From: Konstantin Belousov To: Brooks Davis Cc: Pedro Giffuni , Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330601 - head/sys/i386/ibcs2 Message-ID: <20180307221731.GH76926@kib.kiev.ua> References: <201803071444.w27EiWBV053244@repo.freebsd.org> <20180307211955.GA63140@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180307211955.GA63140@spindle.one-eyed-alien.net> User-Agent: Mutt/1.9.4 (2018-02-28) 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: Wed, 07 Mar 2018 22:17:42 -0000 On Wed, Mar 07, 2018 at 09:19:55PM +0000, Brooks Davis wrote: > On Wed, Mar 07, 2018 at 01:20:14PM -0500, Pedro Giffuni wrote: > > FWIW ... > > > > ibcs2 is candidate for future removal. > > It is probably time again to see if actual users exist. ibcs2 has wasted > a few hours of my time over the last few months so keeping it does have > a non-zero cost. There are users of it, I periodically (say two or three times per year) get a report of something appearing broken in it. Note that iBCS2 is disconnected from the build in HEAD in probably in stable/11. It seems that removing it from svn might be a reasonable change after all. > > > We tried to get some vendor interest in it but we failed and given this It was not a 'vendor interest'. It was an unability to get the confirmation that some patch which was written using information from the SCO headers, does not violate the license. > > is very i386-specific it is probably not worth spending huge efforts on it. > > > > cloudabi seems to be, for all purposes, a better conceptual replacement. > > This comment doesn't make much sense. iBCS is the Intel Binary > Compatibility Standard, an obsolete ABI for i386 Unixes such as Xenix, > SCO, and UnixWare. Cloudabi is, in a sense, taking Capsicum to its > logical extreme and totally unrelated. > > -- Brooks From owner-svn-src-head@freebsd.org Thu Mar 8 01:19: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 9CEB6F454FF; Thu, 8 Mar 2018 01:19:14 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wr0-x22d.google.com (mail-wr0-x22d.google.com [IPv6:2a00:1450:400c:c0c::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 1C0487AADA; Thu, 8 Mar 2018 01:19:14 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wr0-x22d.google.com with SMTP id w77so4042258wrc.6; Wed, 07 Mar 2018 17:19:14 -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=e2VxRTZwW8cnqJOt2KIslCg6KuC9JOemYnvwfXkfPBY=; b=pGkYXZ+F+pII5zSwvDafnXQHjR9xOb23g5BIeVXyVaMAfd78FDS+WNvzal0ssfRLuP L7GSivrH5i2xREieXnp7po4DmDNdDt1EokJtpIwf3HteBl+JWh8lykKHR7yG6hL1wlJ1 /hxe5b9IOM6uOpG/xIMfzsAGBTpOqNpvRomsrrmHeKE/FsLK9UCfx3UqwjheZbxJXsGm 3zlyOYX/UIRS0swnthY8sNzbxD5JhjPViuMDviUJi+k4xJgy9wFQU/7Xh5V5Bd4jjLn5 TBcBKMunc0P6NWjutgxW9ZYYTtjACx6Gsk5w73MBg+eEx6sHziIOSJBAIeetD2qUcR1w Ta0Q== 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=e2VxRTZwW8cnqJOt2KIslCg6KuC9JOemYnvwfXkfPBY=; b=RGvYyDVhaQKSEiVQBd7pteqmqvviZueKKfErzzvlBzNZ5+95+7fw97I/JQf86GySts ZZvpj73wFBV2HBIJHmsxvQTfSFPtlF4xn+rKiv/e19K6hxq157D/cRpqETQKDeRpgD5S KnJE/LVFkzBE4Ytx+SiSo6QeCnOWICExFNikOtXIhbwetowrvG5FSK8tyD91jvA2hKLI 6km4hM47gj2OmpTUYZExXLpD5+U50XPATl9A4voGeFd51mDHmC6kmEkRpPaxuigb+fIv wXuiYlU8BMCamII/ru6Wjxtcoq1KEu0g0C/pL0WxjDf+fOkKpOlOBx4e3xdIFp23X4G3 V2bw== X-Gm-Message-State: APf1xPCiyzaWEgRLAjlybKcgUiSKC40h5JL7v8gc9B7imDGbek1EBJTK W7bGqM8T+4IGGm41MCnacEAkcch47aumE5r2pVMDZA== X-Google-Smtp-Source: AG47ELtpyfEoOPnQBH88X5EnTyArArJPEKOlivsqNlTwKFRIOpDp0XnmiwGllTYTNaqLzFCEiQezZgf8tNZQbhNQY1c= X-Received: by 10.223.160.147 with SMTP id m19mr22335868wrm.32.1520471952416; Wed, 07 Mar 2018 17:19:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.192.2 with HTTP; Wed, 7 Mar 2018 17:19:12 -0800 (PST) In-Reply-To: References: <201803061428.w26EScwJ020926@repo.freebsd.org> From: Jonathan Looney Date: Wed, 7 Mar 2018 20:19:12 -0500 Message-ID: Subject: Re: svn commit: r330539 - in head/sys: amd64/amd64 amd64/include arm/include conf gdb i386/include mips/include powerpc/include sparc64/include To: Oliver Pinter Cc: "Jonathan T. Looney" , 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: Thu, 08 Mar 2018 01:19:14 -0000 On Tue, Mar 6, 2018 at 6:31 PM, Oliver Pinter wrote: > X-MFC-with: > > commit 27ac811b7acd31b1bdbf959fe49a957cdeabf780 > Author: bde > Date: Fri Mar 24 17:34:55 2017 +0000 > ACK. Thanks! Jonathan From owner-svn-src-head@freebsd.org Thu Mar 8 01:23: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 136B7F45DA2; Thu, 8 Mar 2018 01:23:27 +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 82E5B7B1C2; Thu, 8 Mar 2018 01:23:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.101] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 31FE4D4408C; Thu, 8 Mar 2018 12:23:17 +1100 (AEDT) Date: Thu, 8 Mar 2018 12:23:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Ian Lepore , Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330436 - head/bin/chflags In-Reply-To: <20180305140228.P935@besplex.bde.org> Message-ID: <20180308120343.E2426@besplex.bde.org> References: <201803050156.w251u7Y8020941@repo.freebsd.org> <1520215860.38056.3.camel@freebsd.org> <20180305140228.P935@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=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=4gYfcDbAvbXn5vcoyysA: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: Thu, 08 Mar 2018 01:23:27 -0000 On Mon, 5 Mar 2018, Bruce Evans wrote: > On Sun, 4 Mar 2018, Ian Lepore wrote: > >> On Mon, 2018-03-05 at 01:56 +0000, Bryan Drewery wrote: >>> >>> Log: >>> \xa0 chflags: Add -x option to not traverse mount points. >> >> Yay! \xa0One day later than I needed it, but still, yay! > > I recently noticed that find(1) needs an option to not look at mount > points at all, and further options to classify mount points so that > you can prune them. > > After reading the above and investigating further, I noticed that -x > is broken in most FreeBSD utilities, since POSIX requires not looking > at mount points at all for the few utilities that support -x. E.g., > for du in 2001 draft 7 POSIX: > ... This seems to be easy to fix by by skipping in callers of fts_read(). Fix for an old version of du: XX Index: du.c XX =================================================================== XX RCS file: /home/ncvs/src/usr.bin/du/du.c,v XX retrieving revision 1.34 XX diff -u -2 -r1.34 du.c XX --- du.c 2 Jun 2004 07:09:34 -0000 1.34 XX +++ du.c 8 Mar 2018 00:57:12 -0000 XX @@ -86,9 +86,11 @@ XX int listall; XX int depth; XX - int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag, hflag, ch, notused, rval; XX + int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag, hflag; XX + int xflag, ch, notused, rval; XX char **save; XX static char dot[] = "."; XX XX Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = 0; XX + xflag = 0; XX XX save = argv; XX @@ -148,4 +150,5 @@ XX break; XX case 'x': XX + xflag = 1; XX ftsoptions |= FTS_XDEV; XX break; XX @@ -219,4 +222,7 @@ XX break; XX case FTS_DP: XX + if (xflag && p->fts_statp->st_dev != XX + p->fts_parent->fts_statp->st_dev) XX + break; XX if (ignorep(p)) XX break; This patch won't apply cleanly in -current because -current has large changes in all areas touched by the patch (mainly to undo formatting away from KNF). Bruce From owner-svn-src-head@freebsd.org Thu Mar 8 03:08: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 752C1F29428 for ; Thu, 8 Mar 2018 03:08:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic317-49.consmr.mail.ne1.yahoo.com (sonic317-49.consmr.mail.ne1.yahoo.com [66.163.184.60]) (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 0BE2C805D4 for ; Thu, 8 Mar 2018 03:08:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1520478486; bh=rn+WcNPS3bLf5i9IkqccU+LBOyjEMLSlW8VUoLxHLZY=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=MN7053BpZR9T0oBX7oExBZSAuKXCUlBM1cXBcf330JfKRt4gi7nQ+wHyRVpBE3vkTgPS4qTppgqb7qgO+O/JQ2mAkZlS/xv4MMmDz4OkwGQMkYsO62avsIwu2Vuf0/rjb1TUzT6zL/HvnJPGyvyYS5FmKf+eRgRS/rOGEK1r3bJHAtbLdsiitVMBpIzPvyueiNMd1h1IsTcn/OGCSeqt3GELXy6suGDzwX/AHbOEQeCIw33E/ogh47fs3YgDnNxrflMFQwBnOZLmvd6ohGOO4AM+3SqUgH9F7qWyo/wRSML+Cha8H5HDflxKBKJhooS6z//hQceApDffwHIulcmjuA== X-YMail-OSG: g7E7L60VM1mfzY1948sMqFm5LUZfoGG8bfoNpxtqNBnYxMbbLwMVmweawUF3EOJ fHGIEQmXJjK6htdxiVUNX8Ie.P0j7zYLmArxh43VuDXdI3IZQ1ujF2jyjx4YPl8lwg2mHcqRfWzn ObG0FGFlPWrzZzXrF68IV4kVJW3dg4Y90_NCBIF9V1DE8puJujX603wxwxuSF.GqY1ypdmfEfcGs a04YxphbEJjdxF9Ku6MrhNqpQEhF3uxrBgGhl2gmKsFGScJ_Iw9eqnmz0_cTztZofXaHGs28OArT 6SFagXrKB3.dvhhoHZJ2mBjVFcYrL9yvaBrkaa2is6GSFLjkQlv9jBIyztcWlBrRVBxJSVbtF9Ng 3w2XDP8EwcInrDSvYBdbnfvC.oMwlKPo6hcP1RI1.BzLPWOOs3HCg5g9m3TzMeuHoh9n0l19P3Al sX.0ZBFvfe6j0vobJASNZtOpMyrxB1Z3Brgn973lqSLDX0vjvQFRuRTI.xZrK8494h7qz3w90b1o 2SL7MUeXQY7s- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Thu, 8 Mar 2018 03:08:06 +0000 Received: from smtp232.mail.ne1.yahoo.com (EHLO [192.168.0.5]) ([10.218.253.209]) by smtp415.mail.ne1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 8ac47896d75b8b22d21110794859aedd; Thu, 08 Mar 2018 02:47:50 +0000 (UTC) Subject: Re: svn commit: r330601 - head/sys/i386/ibcs2 To: Brooks Davis Cc: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803071444.w27EiWBV053244@repo.freebsd.org> <20180307211955.GA63140@spindle.one-eyed-alien.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <93cd021e-d652-4f57-df3b-268b3bdce0c2@FreeBSD.org> Date: Wed, 7 Mar 2018 21:47:48 -0500 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: <20180307211955.GA63140@spindle.one-eyed-alien.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Thu, 08 Mar 2018 03:08:08 -0000 On 07/03/2018 16:19, Brooks Davis wrote: > On Wed, Mar 07, 2018 at 01:20:14PM -0500, Pedro Giffuni wrote: >> FWIW ... >> >> ibcs2 is candidate for future removal. > It is probably time again to see if actual users exist. ibcs2 has wasted > a few hours of my time over the last few months so keeping it does have > a non-zero cost. FWIW, I used it long ago on FreeBSD with Unesco's ISIS database software but the software is not developed anymore. >> We tried to get some vendor interest in it but we failed and given this >> is very i386-specific it is probably not worth spending huge efforts on it. >> >> cloudabi seems to be, for all purposes, a better conceptual replacement. > This comment doesn't make much sense. iBCS is the Intel Binary > Compatibility Standard, an obsolete ABI for i386 Unixes such as Xenix, > SCO, and UnixWare. Cloudabi is, in a sense, taking Capsicum to its > logical extreme and totally unrelated. It is also a binary format (ELF-based) that can run on several platforms including Linux and FreeBSD. It clearly targets the cloud market, which makes more sense nowadays than the i386 use space which were common in the early 90s. Pedro. From owner-svn-src-head@freebsd.org Thu Mar 8 03:19: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 DA19DF2A161; Thu, 8 Mar 2018 03:19:04 +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 7D51480B60; Thu, 8 Mar 2018 03:19:04 +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 727D32F5C; Thu, 8 Mar 2018 03:19:04 +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 w283J4Is035031; Thu, 8 Mar 2018 03:19:04 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w283J4cZ035030; Thu, 8 Mar 2018 03:19:04 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803080319.w283J4cZ035030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 8 Mar 2018 03:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330627 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 330627 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 03:19:05 -0000 Author: asomers Date: Thu Mar 8 03:19:04 2018 New Revision: 330627 URL: https://svnweb.freebsd.org/changeset/base/330627 Log: g_bio(9): fix a documentation oversight from r163870 MFC after: 3 weeks Modified: head/share/man/man9/g_bio.9 Modified: head/share/man/man9/g_bio.9 ============================================================================== --- head/share/man/man9/g_bio.9 Thu Mar 8 01:03:26 2018 (r330626) +++ head/share/man/man9/g_bio.9 Thu Mar 8 03:19:04 2018 (r330627) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2016 +.Dd Mar 7, 2018 .Dt G_BIO 9 .Os .Sh NAME @@ -59,7 +59,7 @@ most important fields are described below: .Bl -tag -width ".Va bio_attribute" .It Va bio_cmd I/O request command. -There are four I/O requests available in GEOM: +There are five I/O requests available in GEOM: .Bl -tag -width ".Dv BIO_GETATTR" .It Dv BIO_READ A read request. From owner-svn-src-head@freebsd.org Thu Mar 8 05:28: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 B7976F3460C; Thu, 8 Mar 2018 05:28:43 +0000 (UTC) (envelope-from eadler@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 6980B860DE; Thu, 8 Mar 2018 05:28:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B4D048CB; Thu, 8 Mar 2018 05:28:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w285ShRt000444; Thu, 8 Mar 2018 05:28:43 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w285Shr4000443; Thu, 8 Mar 2018 05:28:43 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803080528.w285Shr4000443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 8 Mar 2018 05:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330628 - head/usr.bin/calendar/calendars X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/calendar/calendars X-SVN-Commit-Revision: 330628 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 05:28:44 -0000 Author: eadler Date: Thu Mar 8 05:28:43 2018 New Revision: 330628 URL: https://svnweb.freebsd.org/changeset/base/330628 Log: calendars: update Judaic calendar to 2018+ This was generated by ∴hebcal --years 10 -r 2018 | awk -F '[/\t]' '{print $3 "/" $1 "/" $2 "*\t" $4}' MFC After: 1 week Modified: head/usr.bin/calendar/calendars/calendar.judaic Modified: head/usr.bin/calendar/calendars/calendar.judaic ============================================================================== --- head/usr.bin/calendar/calendars/calendar.judaic Thu Mar 8 03:19:04 2018 (r330627) +++ head/usr.bin/calendar/calendars/calendar.judaic Thu Mar 8 05:28:43 2018 (r330628) @@ -1,694 +1,824 @@ /* - * Judaic Calendar. Maintained by Josef Grosch . + * Judaic Calendar. * * $FreeBSD$ * */ -/* - * $Id: calendar.judaic,v 1.45 2007/01/01 22:24:53 jgrosch Exp $ - */ - #ifndef _calendar_judaic_ #define _calendar_judaic_ /* * The calendar below has been obtained from the port deskutils/hebcal - * for the year of 2010 to 2015 and for the city of New York. + * for the year of 2018 to 2027 and for the city of New York. */ -2010/Jan/16* Rosh Chodesh Sh'vat -2010/Jan/30* Tu B'Shvat -2010/Feb/13* Shabbat Shekalim -2010/Feb/14* Rosh Chodesh Adar -2010/Feb/15* Rosh Chodesh Adar -2010/Feb/25* Ta'anit Esther -2010/Feb/27* Shabbat Zachor -2010/Feb/28* Purim -2010/Mar/1* Shushan Purim -2010/Mar/6* Shabbat Parah -2010/Mar/13* Shabbat HaChodesh -2010/Mar/16* Rosh Chodesh Nisan -2010/Mar/27* Shabbat HaGadol -2010/Mar/29* Ta'anit Bechorot -2010/Mar/29* Erev Pesach -2010/Mar/30* Pesach I -2010/Mar/31* Pesach II -2010/Apr/1* Pesach III (CH''M) -2010/Apr/2* Pesach IV (CH''M) -2010/Apr/3* Pesach V (CH''M) -2010/Apr/4* Pesach VI (CH''M) -2010/Apr/5* Pesach VII -2010/Apr/6* Pesach VIII -2010/Apr/11* Yom HaShoah -2010/Apr/14* Rosh Chodesh Iyyar -2010/Apr/15* Rosh Chodesh Iyyar -2010/Apr/19* Yom HaZikaron -2010/Apr/20* Yom HaAtzma'ut -2010/May/2* Lag B'Omer -2010/May/Dec* Yom Yerushalayim -2010/May/14* Rosh Chodesh Sivan -2010/May/18* Erev Shavuot -2010/May/19* Shavuot I -2010/May/20* Shavuot II -2010/Jun/Dec* Rosh Chodesh Tamuz -2010/Jun/13* Rosh Chodesh Tamuz -2010/Jun/29* Tzom Tammuz -2010/Jul/Dec* Rosh Chodesh Av -2010/Jul/17* Shabbat Hazon -2010/Jul/20* Tish'a B'Av -2010/Jul/24* Shabbat Nachamu -2010/Aug/Oct* Rosh Chodesh Elul -2010/Aug/11* Rosh Chodesh Elul -2010/Sep/8* Erev Rosh Hashana -2010/Sep/9* Rosh Hashana 5771 -2010/Sep/Oct* Rosh Hashana II -2010/Sep/11* Shabbat Shuva -2010/Sep/Dec* Tzom Gedaliah -2010/Sep/17* Erev Yom Kippur -2010/Sep/18* Yom Kippur -2010/Sep/22* Erev Sukkot -2010/Sep/23* Sukkot I -2010/Sep/24* Sukkot II -2010/Sep/25* Sukkot III (CH''M) -2010/Sep/26* Sukkot IV (CH''M) -2010/Sep/27* Sukkot V (CH''M) -2010/Sep/28* Sukkot VI (CH''M) -2010/Sep/29* Sukkot VII (Hoshana Raba) -2010/Sep/30* Shmini Atzeret -2010/Oct/1* Simchat Torah -2010/Oct/8* Rosh Chodesh Cheshvan -2010/Oct/9* Rosh Chodesh Cheshvan -2010/Nov/7* Rosh Chodesh Kislev -2010/Nov/8* Rosh Chodesh Kislev -2010/Dec/1* Chanukah: 1 Candle -2010/Dec/2* Chanukah: 2 Candles -2010/Dec/3* Chanukah: 3 Candles -2010/Dec/4* Chanukah: 4 Candles -2010/Dec/5* Chanukah: 5 Candles -2010/Dec/6* Chanukah: 6 Candles -2010/Dec/7* Rosh Chodesh Tevet -2010/Dec/7* Chanukah: 7 Candles -2010/Dec/8* Rosh Chodesh Tevet -2010/Dec/8* Chanukah: 8 Candles -2010/Dec/9* Chanukah: 8th Day -2010/Dec/16* Asara B'Tevet -2011/1/6* Rosh Chodesh Sh'vat -2011/1/20* Tu B'Shvat -2011/2/4* Rosh Chodesh Adar I -2011/2/5* Rosh Chodesh Adar I -2011/2/18* Purim Katan -2011/3/5* Shabbat Shekalim -2011/3/6* Rosh Chodesh Adar II -2011/3/7* Rosh Chodesh Adar II -2011/3/17* Ta'anit Esther -2011/3/19* Shabbat Zachor -2011/3/20* Purim -2011/3/21* Shushan Purim -2011/3/26* Shabbat Parah -2011/4/2* Shabbat HaChodesh -2011/4/5* Rosh Chodesh Nisan -2011/4/16* Shabbat HaGadol -2011/4/18* Ta'anit Bechorot -2011/4/18* Erev Pesach -2011/4/19* Pesach I -2011/4/20* Pesach II -2011/4/21* Pesach III (CH''M) -2011/4/22* Pesach IV (CH''M) -2011/4/23* Pesach V (CH''M) -2011/4/24* Pesach VI (CH''M) -2011/4/25* Pesach VII -2011/4/26* Pesach VIII -2011/5/1* Yom HaShoah -2011/5/4* Rosh Chodesh Iyyar -2011/5/5* Rosh Chodesh Iyyar -2011/5/9* Yom HaZikaron -2011/5/10* Yom HaAtzma'ut -2011/5/22* Lag B'Omer -2011/6/1* Yom Yerushalayim -2011/6/3* Rosh Chodesh Sivan -2011/6/7* Erev Shavuot -2011/6/8* Shavuot I -2011/6/9* Shavuot II -2011/7/2* Rosh Chodesh Tamuz -2011/7/3* Rosh Chodesh Tamuz -2011/7/19* Tzom Tammuz -2011/8/1* Rosh Chodesh Av -2011/8/6* Shabbat Hazon -2011/8/9* Tish'a B'Av -2011/8/13* Shabbat Nachamu -2011/8/30* Rosh Chodesh Elul -2011/8/31* Rosh Chodesh Elul -2011/9/28* Erev Rosh Hashana -2011/9/29* Rosh Hashana 5772 -2011/9/30* Rosh Hashana II -2011/10/1* Shabbat Shuva -2011/10/2* Tzom Gedaliah -2011/10/7* Erev Yom Kippur -2011/10/8* Yom Kippur -2011/10/12* Erev Sukkot -2011/10/13* Sukkot I -2011/10/14* Sukkot II -2011/10/15* Sukkot III (CH''M) -2011/10/16* Sukkot IV (CH''M) -2011/10/17* Sukkot V (CH''M) -2011/10/18* Sukkot VI (CH''M) -2011/10/19* Sukkot VII (Hoshana Raba) -2011/10/20* Shmini Atzeret -2011/10/21* Simchat Torah -2011/10/28* Rosh Chodesh Cheshvan -2011/10/29* Rosh Chodesh Cheshvan -2011/11/27* Rosh Chodesh Kislev -2011/12/20* Chanukah: 1 Candle -2011/12/21* Chanukah: 2 Candles -2011/12/22* Chanukah: 3 Candles -2011/12/23* Chanukah: 4 Candles -2011/12/24* Chanukah: 5 Candles -2011/12/25* Chanukah: 6 Candles -2011/12/26* Rosh Chodesh Tevet -2011/12/26* Chanukah: 7 Candles -2011/12/27* Rosh Chodesh Tevet -2011/12/27* Chanukah: 8 Candles -2011/12/28* Chanukah: 8th Day -2012/1/5* Asara B'Tevet -2012/1/25* Rosh Chodesh Sh'vat -2012/2/8* Tu B'Shvat -2012/2/18* Shabbat Shekalim -2012/2/23* Rosh Chodesh Adar -2012/2/24* Rosh Chodesh Adar -2012/3/3* Shabbat Zachor -2012/3/7* Ta'anit Esther -2012/3/8* Purim -2012/3/9* Shushan Purim -2012/3/17* Shabbat Parah -2012/3/24* Rosh Chodesh Nisan -2012/3/24* Shabbat HaChodesh -2012/3/31* Shabbat HaGadol -2012/4/5* Ta'anit Bechorot -2012/4/6* Erev Pesach -2012/4/7* Pesach I -2012/4/8* Pesach II -2012/4/9* Pesach III (CH''M) -2012/4/10* Pesach IV (CH''M) -2012/4/11* Pesach V (CH''M) -2012/4/12* Pesach VI (CH''M) -2012/4/13* Pesach VII -2012/4/14* Pesach VIII -2012/4/19* Yom HaShoah -2012/4/22* Rosh Chodesh Iyyar -2012/4/23* Rosh Chodesh Iyyar -2012/4/25* Yom HaZikaron -2012/4/26* Yom HaAtzma'ut -2012/5/10* Lag B'Omer -2012/5/20* Yom Yerushalayim -2012/5/22* Rosh Chodesh Sivan -2012/5/26* Erev Shavuot -2012/5/27* Shavuot I -2012/5/28* Shavuot II -2012/6/20* Rosh Chodesh Tamuz -2012/6/21* Rosh Chodesh Tamuz -2012/7/8* Tzom Tammuz -2012/7/20* Rosh Chodesh Av -2012/7/28* Shabbat Hazon -2012/7/29* Tish'a B'Av -2012/8/4* Shabbat Nachamu -2012/8/18* Rosh Chodesh Elul -2012/8/19* Rosh Chodesh Elul -2012/9/16* Erev Rosh Hashana -2012/9/17* Rosh Hashana 5773 -2012/9/18* Rosh Hashana II -2012/9/19* Tzom Gedaliah -2012/9/22* Shabbat Shuva -2012/9/25* Erev Yom Kippur -2012/9/26* Yom Kippur -2012/9/30* Erev Sukkot -2012/10/1* Sukkot I -2012/10/2* Sukkot II -2012/10/3* Sukkot III (CH''M) -2012/10/4* Sukkot IV (CH''M) -2012/10/5* Sukkot V (CH''M) -2012/10/6* Sukkot VI (CH''M) -2012/10/7* Sukkot VII (Hoshana Raba) -2012/10/8* Shmini Atzeret -2012/10/9* Simchat Torah -2012/10/16* Rosh Chodesh Cheshvan -2012/10/17* Rosh Chodesh Cheshvan -2012/11/15* Rosh Chodesh Kislev -2012/12/8* Chanukah: 1 Candle -2012/12/9* Chanukah: 2 Candles -2012/12/10* Chanukah: 3 Candles -2012/12/11* Chanukah: 4 Candles -2012/12/12* Chanukah: 5 Candles -2012/12/13* Chanukah: 6 Candles -2012/12/14* Rosh Chodesh Tevet -2012/12/14* Chanukah: 7 Candles -2012/12/15* Chanukah: 8 Candles -2012/12/16* Chanukah: 8th Day -2012/12/23* Asara B'Tevet -2013/1/12* Rosh Chodesh Sh'vat -2013/1/26* Tu B'Shvat -2013/2/9* Shabbat Shekalim -2013/2/10* Rosh Chodesh Adar -2013/2/11* Rosh Chodesh Adar -2013/2/21* Ta'anit Esther -2013/2/23* Shabbat Zachor -2013/2/24* Purim -2013/2/25* Shushan Purim -2013/3/2* Shabbat Parah -2013/3/9* Shabbat HaChodesh -2013/3/12* Rosh Chodesh Nisan -2013/3/23* Shabbat HaGadol -2013/3/25* Ta'anit Bechorot -2013/3/25* Erev Pesach -2013/3/26* Pesach I -2013/3/27* Pesach II -2013/3/28* Pesach III (CH''M) -2013/3/29* Pesach IV (CH''M) -2013/3/30* Pesach V (CH''M) -2013/3/31* Pesach VI (CH''M) -2013/4/1* Pesach VII -2013/4/2* Pesach VIII -2013/4/7* Yom HaShoah -2013/4/10* Rosh Chodesh Iyyar -2013/4/11* Rosh Chodesh Iyyar -2013/4/15* Yom HaZikaron -2013/4/16* Yom HaAtzma'ut -2013/4/28* Lag B'Omer -2013/5/8* Yom Yerushalayim -2013/5/10* Rosh Chodesh Sivan -2013/5/14* Erev Shavuot -2013/5/15* Shavuot I -2013/5/16* Shavuot II -2013/6/8* Rosh Chodesh Tamuz -2013/6/9* Rosh Chodesh Tamuz -2013/6/25* Tzom Tammuz -2013/7/8* Rosh Chodesh Av -2013/7/13* Shabbat Hazon -2013/7/16* Tish'a B'Av -2013/7/20* Shabbat Nachamu -2013/8/6* Rosh Chodesh Elul -2013/8/7* Rosh Chodesh Elul -2013/9/4* Erev Rosh Hashana -2013/9/5* Rosh Hashana 5774 -2013/9/6* Rosh Hashana II -2013/9/7* Shabbat Shuva -2013/9/8* Tzom Gedaliah -2013/9/13* Erev Yom Kippur -2013/9/14* Yom Kippur -2013/9/18* Erev Sukkot -2013/9/19* Sukkot I -2013/9/20* Sukkot II -2013/9/21* Sukkot III (CH''M) -2013/9/22* Sukkot IV (CH''M) -2013/9/23* Sukkot V (CH''M) -2013/9/24* Sukkot VI (CH''M) -2013/9/25* Sukkot VII (Hoshana Raba) -2013/9/26* Shmini Atzeret -2013/9/27* Simchat Torah -2013/10/4* Rosh Chodesh Cheshvan -2013/10/5* Rosh Chodesh Cheshvan -2013/11/3* Rosh Chodesh Kislev -2013/11/4* Rosh Chodesh Kislev -2013/11/27* Chanukah: 1 Candle -2013/11/28* Chanukah: 2 Candles -2013/11/29* Chanukah: 3 Candles -2013/11/30* Chanukah: 4 Candles -2013/12/1* Chanukah: 5 Candles -2013/12/2* Chanukah: 6 Candles -2013/12/3* Rosh Chodesh Tevet -2013/12/3* Chanukah: 7 Candles -2013/12/4* Rosh Chodesh Tevet -2013/12/4* Chanukah: 8 Candles -2013/12/5* Chanukah: 8th Day -2013/12/12* Asara B'Tevet -2014/1/2* Rosh Chodesh Sh'vat -2014/1/16* Tu B'Shvat -2014/1/31* Rosh Chodesh Adar I -2014/2/1* Rosh Chodesh Adar I -2014/2/14* Purim Katan -2014/3/1* Shabbat Shekalim -2014/3/2* Rosh Chodesh Adar II -2014/3/3* Rosh Chodesh Adar II -2014/3/13* Ta'anit Esther -2014/3/15* Shabbat Zachor -2014/3/16* Purim -2014/3/17* Shushan Purim -2014/3/22* Shabbat Parah -2014/3/29* Shabbat HaChodesh -2014/4/1* Rosh Chodesh Nisan -2014/4/12* Shabbat HaGadol -2014/4/14* Ta'anit Bechorot -2014/4/14* Erev Pesach -2014/4/15* Pesach I -2014/4/16* Pesach II -2014/4/17* Pesach III (CH''M) -2014/4/18* Pesach IV (CH''M) -2014/4/19* Pesach V (CH''M) -2014/4/20* Pesach VI (CH''M) -2014/4/21* Pesach VII -2014/4/22* Pesach VIII -2014/4/27* Yom HaShoah -2014/4/30* Rosh Chodesh Iyyar -2014/5/1* Rosh Chodesh Iyyar -2014/5/5* Yom HaZikaron -2014/5/6* Yom HaAtzma'ut -2014/5/18* Lag B'Omer -2014/5/28* Yom Yerushalayim -2014/5/30* Rosh Chodesh Sivan -2014/6/3* Erev Shavuot -2014/6/4* Shavuot I -2014/6/5* Shavuot II -2014/6/28* Rosh Chodesh Tamuz -2014/6/29* Rosh Chodesh Tamuz -2014/7/15* Tzom Tammuz -2014/7/28* Rosh Chodesh Av -2014/8/2* Shabbat Hazon -2014/8/5* Tish'a B'Av -2014/8/9* Shabbat Nachamu -2014/8/26* Rosh Chodesh Elul -2014/8/27* Rosh Chodesh Elul -2014/9/24* Erev Rosh Hashana -2014/9/25* Rosh Hashana 5775 -2014/9/26* Rosh Hashana II -2014/9/27* Shabbat Shuva -2014/9/28* Tzom Gedaliah -2014/10/3* Erev Yom Kippur -2014/10/4* Yom Kippur -2014/10/8* Erev Sukkot -2014/10/9* Sukkot I -2014/10/10* Sukkot II -2014/10/11* Sukkot III (CH''M) -2014/10/12* Sukkot IV (CH''M) -2014/10/13* Sukkot V (CH''M) -2014/10/14* Sukkot VI (CH''M) -2014/10/15* Sukkot VII (Hoshana Raba) -2014/10/16* Shmini Atzeret -2014/10/17* Simchat Torah -2014/10/24* Rosh Chodesh Cheshvan -2014/10/25* Rosh Chodesh Cheshvan -2014/11/23* Rosh Chodesh Kislev -2014/12/16* Chanukah: 1 Candle -2014/12/17* Chanukah: 2 Candles -2014/12/18* Chanukah: 3 Candles -2014/12/19* Chanukah: 4 Candles -2014/12/20* Chanukah: 5 Candles -2014/12/21* Chanukah: 6 Candles -2014/12/22* Rosh Chodesh Tevet -2014/12/22* Chanukah: 7 Candles -2014/12/23* Rosh Chodesh Tevet -2014/12/23* Chanukah: 8 Candles -2014/12/24* Chanukah: 8th Day -2015/1/1* Asara B'Tevet -2015/1/21* Rosh Chodesh Sh'vat -2015/2/4* Tu B'Shvat -2015/2/14* Shabbat Shekalim -2015/2/19* Rosh Chodesh Adar -2015/2/20* Rosh Chodesh Adar -2015/2/28* Shabbat Zachor -2015/3/4* Ta'anit Esther -2015/3/5* Purim -2015/3/6* Shushan Purim -2015/3/14* Shabbat Parah -2015/3/21* Rosh Chodesh Nisan -2015/3/21* Shabbat HaChodesh -2015/3/28* Shabbat HaGadol -2015/4/2* Ta'anit Bechorot -2015/4/3* Erev Pesach -2015/4/4* Pesach I -2015/4/5* Pesach II -2015/4/6* Pesach III (CH''M) -2015/4/7* Pesach IV (CH''M) -2015/4/8* Pesach V (CH''M) -2015/4/9* Pesach VI (CH''M) -2015/4/10* Pesach VII -2015/4/11* Pesach VIII -2015/4/16* Yom HaShoah -2015/4/19* Rosh Chodesh Iyyar -2015/4/20* Rosh Chodesh Iyyar -2015/4/22* Yom HaZikaron -2015/4/23* Yom HaAtzma'ut -2015/5/7* Lag B'Omer -2015/5/17* Yom Yerushalayim -2015/5/19* Rosh Chodesh Sivan -2015/5/23* Erev Shavuot -2015/5/24* Shavuot I -2015/5/25* Shavuot II -2015/6/17* Rosh Chodesh Tamuz -2015/6/18* Rosh Chodesh Tamuz -2015/7/5* Tzom Tammuz -2015/7/17* Rosh Chodesh Av -2015/7/25* Shabbat Hazon -2015/7/26* Tish'a B'Av -2015/8/1* Shabbat Nachamu -2015/8/15* Rosh Chodesh Elul -2015/8/16* Rosh Chodesh Elul -2015/9/13* Erev Rosh Hashana -2015/9/14* Rosh Hashana 5776 -2015/9/15* Rosh Hashana II -2015/9/16* Tzom Gedaliah -2015/9/19* Shabbat Shuva -2015/9/22* Erev Yom Kippur -2015/9/23* Yom Kippur -2015/9/27* Erev Sukkot -2015/9/28* Sukkot I -2015/9/29* Sukkot II -2015/9/30* Sukkot III (CH''M) -2015/10/1* Sukkot IV (CH''M) -2015/10/2* Sukkot V (CH''M) -2015/10/3* Sukkot VI (CH''M) -2015/10/4* Sukkot VII (Hoshana Raba) -2015/10/5* Shmini Atzeret -2015/10/6* Simchat Torah -2015/10/13* Rosh Chodesh Cheshvan -2015/10/14* Rosh Chodesh Cheshvan -2015/11/12* Rosh Chodesh Kislev -2015/11/13* Rosh Chodesh Kislev -2015/12/6* Chanukah: 1 Candle -2015/12/7* Chanukah: 2 Candles -2015/12/8* Chanukah: 3 Candles -2015/12/9* Chanukah: 4 Candles -2015/12/10* Chanukah: 5 Candles -2015/12/11* Chanukah: 6 Candles -2015/12/12* Rosh Chodesh Tevet -2015/12/12* Chanukah: 7 Candles -2015/12/13* Rosh Chodesh Tevet -2015/12/13* Chanukah: 8 Candles -2015/12/14* Chanukah: 8th Day -2015/12/22* Asara B'Tevet -/* - * The calendar data below was for 2007, so it is commented out. - */ +2018/1/17* Rosh Chodesh Sh'vat +2018/1/31* Tu BiShvat +2018/2/10* Shabbat Shekalim +2018/2/15* Rosh Chodesh Adar +2018/2/16* Rosh Chodesh Adar +2018/2/24* Shabbat Zachor +2018/2/28* Ta'anit Esther +2018/2/28* Erev Purim +2018/3/1* Purim +2018/3/2* Shushan Purim +2018/3/10* Shabbat Parah +2018/3/17* Rosh Chodesh Nisan +2018/3/17* Shabbat HaChodesh +2018/3/24* Shabbat HaGadol +2018/3/30* Ta'anit Bechorot +2018/3/30* Erev Pesach +2018/3/31* Pesach I +2018/4/1* Pesach II +2018/4/2* Pesach III (CH''M) +2018/4/3* Pesach IV (CH''M) +2018/4/4* Pesach V (CH''M) +2018/4/5* Pesach VI (CH''M) +2018/4/6* Pesach VII +2018/4/7* Pesach VIII +2018/4/12* Yom HaShoah +2018/4/15* Rosh Chodesh Iyyar +2018/4/16* Rosh Chodesh Iyyar +2018/4/18* Yom HaZikaron +2018/4/19* Yom HaAtzma'ut +2018/4/29* Pesach Sheni +2018/5/3* Lag BaOmer +2018/5/13* Yom Yerushalayim +2018/5/15* Rosh Chodesh Sivan +2018/5/19* Erev Shavuot +2018/5/20* Shavuot I +2018/5/21* Shavuot II +2018/6/13* Rosh Chodesh Tamuz +2018/6/14* Rosh Chodesh Tamuz +2018/7/1* Tzom Tammuz +2018/7/13* Rosh Chodesh Av +2018/7/21* Shabbat Chazon +2018/7/21* Erev Tish'a B'Av +2018/7/22* Tish'a B'Av +2018/7/27* Tu B'Av +2018/7/28* Shabbat Nachamu +2018/8/11* Rosh Chodesh Elul +2018/8/12* Rosh Chodesh Elul +2018/9/1* Leil Selichot +2018/9/9* Erev Rosh Hashana +2018/9/10* Rosh Hashana 5779 +2018/9/11* Rosh Hashana II +2018/9/12* Tzom Gedaliah +2018/9/15* Shabbat Shuva +2018/9/18* Erev Yom Kippur +2018/9/19* Yom Kippur +2018/9/23* Erev Sukkot +2018/9/24* Sukkot I +2018/9/25* Sukkot II +2018/9/26* Sukkot III (CH''M) +2018/9/27* Sukkot IV (CH''M) +2018/9/28* Sukkot V (CH''M) +2018/9/29* Sukkot VI (CH''M) +2018/9/30* Sukkot VII (Hoshana Raba) +2018/10/1* Shmini Atzeret +2018/10/2* Simchat Torah +2018/10/9* Rosh Chodesh Cheshvan +2018/10/10* Rosh Chodesh Cheshvan +2018/10/16* Yom HaAliyah +2018/11/7* Sigd +2018/11/8* Rosh Chodesh Kislev +2018/11/9* Rosh Chodesh Kislev +2018/12/2* Chanukah: 1 Candle +2018/12/3* Chanukah: 2 Candles +2018/12/4* Chanukah: 3 Candles +2018/12/5* Chanukah: 4 Candles +2018/12/6* Chanukah: 5 Candles +2018/12/7* Chanukah: 6 Candles +2018/12/8* Rosh Chodesh Tevet +2018/12/8* Chanukah: 7 Candles +2018/12/9* Rosh Chodesh Tevet +2018/12/9* Chanukah: 8 Candles +2018/12/10* Chanukah: 8th Day +2018/12/18* Asara B'Tevet +2019/1/7* Rosh Chodesh Sh'vat +2019/1/21* Tu BiShvat +2019/2/5* Rosh Chodesh Adar I +2019/2/6* Rosh Chodesh Adar I +2019/2/19* Purim Katan +2019/3/2* Shabbat Shekalim +2019/3/7* Rosh Chodesh Adar II +2019/3/8* Rosh Chodesh Adar II +2019/3/16* Shabbat Zachor +2019/3/20* Ta'anit Esther +2019/3/20* Erev Purim +2019/3/21* Purim +2019/3/22* Shushan Purim +2019/3/30* Shabbat Parah +2019/4/6* Rosh Chodesh Nisan +2019/4/6* Shabbat HaChodesh +2019/4/13* Shabbat HaGadol +2019/4/19* Ta'anit Bechorot +2019/4/19* Erev Pesach +2019/4/20* Pesach I +2019/4/21* Pesach II +2019/4/22* Pesach III (CH''M) +2019/4/23* Pesach IV (CH''M) +2019/4/24* Pesach V (CH''M) +2019/4/25* Pesach VI (CH''M) +2019/4/26* Pesach VII +2019/4/27* Pesach VIII +2019/5/2* Yom HaShoah +2019/5/5* Rosh Chodesh Iyyar +2019/5/6* Rosh Chodesh Iyyar +2019/5/8* Yom HaZikaron +2019/5/9* Yom HaAtzma'ut +2019/5/19* Pesach Sheni +2019/5/23* Lag BaOmer +2019/6/2* Yom Yerushalayim +2019/6/4* Rosh Chodesh Sivan +2019/6/8* Erev Shavuot +2019/6/9* Shavuot I +2019/6/10* Shavuot II +2019/7/3* Rosh Chodesh Tamuz +2019/7/4* Rosh Chodesh Tamuz +2019/7/21* Tzom Tammuz +2019/8/2* Rosh Chodesh Av +2019/8/10* Shabbat Chazon +2019/8/10* Erev Tish'a B'Av +2019/8/11* Tish'a B'Av +2019/8/16* Tu B'Av +2019/8/17* Shabbat Nachamu +2019/8/31* Rosh Chodesh Elul +2019/9/1* Rosh Chodesh Elul +2019/9/21* Leil Selichot +2019/9/29* Erev Rosh Hashana +2019/9/30* Rosh Hashana 5780 +2019/10/1* Rosh Hashana II +2019/10/2* Tzom Gedaliah +2019/10/5* Shabbat Shuva +2019/10/8* Erev Yom Kippur +2019/10/9* Yom Kippur +2019/10/13* Erev Sukkot +2019/10/14* Sukkot I +2019/10/15* Sukkot II +2019/10/16* Sukkot III (CH''M) +2019/10/17* Sukkot IV (CH''M) +2019/10/18* Sukkot V (CH''M) +2019/10/19* Sukkot VI (CH''M) +2019/10/20* Sukkot VII (Hoshana Raba) +2019/10/21* Shmini Atzeret +2019/10/22* Simchat Torah +2019/10/29* Rosh Chodesh Cheshvan +2019/10/30* Rosh Chodesh Cheshvan +2019/11/5* Yom HaAliyah +2019/11/27* Sigd +2019/11/28* Rosh Chodesh Kislev +2019/11/29* Rosh Chodesh Kislev +2019/12/22* Chanukah: 1 Candle +2019/12/23* Chanukah: 2 Candles +2019/12/24* Chanukah: 3 Candles +2019/12/25* Chanukah: 4 Candles +2019/12/26* Chanukah: 5 Candles +2019/12/27* Chanukah: 6 Candles +2019/12/28* Rosh Chodesh Tevet +2019/12/28* Chanukah: 7 Candles +2019/12/29* Rosh Chodesh Tevet +2019/12/29* Chanukah: 8 Candles +2019/12/30* Chanukah: 8th Day +2020/1/7* Asara B'Tevet +2020/1/27* Rosh Chodesh Sh'vat +2020/2/10* Tu BiShvat +2020/2/22* Shabbat Shekalim +2020/2/25* Rosh Chodesh Adar +2020/2/26* Rosh Chodesh Adar +2020/3/7* Shabbat Zachor +2020/3/9* Ta'anit Esther +2020/3/9* Erev Purim +2020/3/10* Purim +2020/3/11* Shushan Purim +2020/3/14* Shabbat Parah +2020/3/21* Shabbat HaChodesh +2020/3/26* Rosh Chodesh Nisan +2020/4/4* Shabbat HaGadol +2020/4/8* Ta'anit Bechorot +2020/4/8* Erev Pesach +2020/4/9* Pesach I +2020/4/10* Pesach II +2020/4/11* Pesach III (CH''M) +2020/4/12* Pesach IV (CH''M) +2020/4/13* Pesach V (CH''M) +2020/4/14* Pesach VI (CH''M) +2020/4/15* Pesach VII +2020/4/16* Pesach VIII +2020/4/21* Yom HaShoah +2020/4/24* Rosh Chodesh Iyyar +2020/4/25* Rosh Chodesh Iyyar +2020/4/28* Yom HaZikaron +2020/4/29* Yom HaAtzma'ut +2020/5/8* Pesach Sheni +2020/5/12* Lag BaOmer +2020/5/22* Yom Yerushalayim +2020/5/24* Rosh Chodesh Sivan +2020/5/28* Erev Shavuot +2020/5/29* Shavuot I +2020/5/30* Shavuot II +2020/6/22* Rosh Chodesh Tamuz +2020/6/23* Rosh Chodesh Tamuz +2020/7/9* Tzom Tammuz +2020/7/22* Rosh Chodesh Av +2020/7/25* Shabbat Chazon +2020/7/29* Erev Tish'a B'Av +2020/7/30* Tish'a B'Av +2020/8/1* Shabbat Nachamu +2020/8/5* Tu B'Av +2020/8/20* Rosh Chodesh Elul +2020/8/21* Rosh Chodesh Elul +2020/9/12* Leil Selichot +2020/9/18* Erev Rosh Hashana +2020/9/19* Rosh Hashana 5781 +2020/9/20* Rosh Hashana II +2020/9/21* Tzom Gedaliah +2020/9/26* Shabbat Shuva +2020/9/27* Erev Yom Kippur +2020/9/28* Yom Kippur +2020/10/2* Erev Sukkot +2020/10/3* Sukkot I +2020/10/4* Sukkot II +2020/10/5* Sukkot III (CH''M) +2020/10/6* Sukkot IV (CH''M) +2020/10/7* Sukkot V (CH''M) +2020/10/8* Sukkot VI (CH''M) +2020/10/9* Sukkot VII (Hoshana Raba) +2020/10/10* Shmini Atzeret +2020/10/11* Simchat Torah +2020/10/18* Rosh Chodesh Cheshvan +2020/10/19* Rosh Chodesh Cheshvan +2020/10/25* Yom HaAliyah +2020/11/16* Sigd +2020/11/17* Rosh Chodesh Kislev +2020/12/10* Chanukah: 1 Candle +2020/12/11* Chanukah: 2 Candles +2020/12/12* Chanukah: 3 Candles +2020/12/13* Chanukah: 4 Candles +2020/12/14* Chanukah: 5 Candles +2020/12/15* Chanukah: 6 Candles +2020/12/16* Rosh Chodesh Tevet +2020/12/16* Chanukah: 7 Candles +2020/12/17* Chanukah: 8 Candles +2020/12/18* Chanukah: 8th Day +2020/12/25* Asara B'Tevet +2021/1/14* Rosh Chodesh Sh'vat +2021/1/28* Tu BiShvat +2021/2/12* Rosh Chodesh Adar +2021/2/13* Rosh Chodesh Adar +2021/2/13* Shabbat Shekalim +2021/2/20* Shabbat Zachor +2021/2/25* Ta'anit Esther +2021/2/25* Erev Purim +2021/2/26* Purim +2021/2/28* Shushan Purim +2021/3/6* Shabbat Parah +2021/3/13* Shabbat HaChodesh +2021/3/14* Rosh Chodesh Nisan +2021/3/25* Ta'anit Bechorot +2021/3/27* Shabbat HaGadol +2021/3/27* Erev Pesach +2021/3/28* Pesach I +2021/3/29* Pesach II +2021/3/30* Pesach III (CH''M) +2021/3/31* Pesach IV (CH''M) +2021/4/1* Pesach V (CH''M) +2021/4/2* Pesach VI (CH''M) +2021/4/3* Pesach VII +2021/4/4* Pesach VIII +2021/4/8* Yom HaShoah +2021/4/12* Rosh Chodesh Iyyar +2021/4/13* Rosh Chodesh Iyyar +2021/4/14* Yom HaZikaron +2021/4/15* Yom HaAtzma'ut +2021/4/26* Pesach Sheni +2021/4/30* Lag BaOmer +2021/5/10* Yom Yerushalayim +2021/5/12* Rosh Chodesh Sivan +2021/5/16* Erev Shavuot +2021/5/17* Shavuot I +2021/5/18* Shavuot II +2021/6/10* Rosh Chodesh Tamuz +2021/6/11* Rosh Chodesh Tamuz +2021/6/27* Tzom Tammuz +2021/7/10* Rosh Chodesh Av +2021/7/17* Shabbat Chazon +2021/7/17* Erev Tish'a B'Av +2021/7/18* Tish'a B'Av +2021/7/24* Shabbat Nachamu +2021/7/24* Tu B'Av +2021/8/8* Rosh Chodesh Elul +2021/8/9* Rosh Chodesh Elul +2021/8/28* Leil Selichot +2021/9/6* Erev Rosh Hashana +2021/9/7* Rosh Hashana 5782 +2021/9/8* Rosh Hashana II +2021/9/9* Tzom Gedaliah +2021/9/11* Shabbat Shuva +2021/9/15* Erev Yom Kippur +2021/9/16* Yom Kippur +2021/9/20* Erev Sukkot +2021/9/21* Sukkot I +2021/9/22* Sukkot II +2021/9/23* Sukkot III (CH''M) +2021/9/24* Sukkot IV (CH''M) +2021/9/25* Sukkot V (CH''M) +2021/9/26* Sukkot VI (CH''M) +2021/9/27* Sukkot VII (Hoshana Raba) +2021/9/28* Shmini Atzeret +2021/9/29* Simchat Torah +2021/10/6* Rosh Chodesh Cheshvan +2021/10/7* Rosh Chodesh Cheshvan +2021/10/13* Yom HaAliyah +2021/11/4* Sigd +2021/11/5* Rosh Chodesh Kislev +2021/11/28* Chanukah: 1 Candle +2021/11/29* Chanukah: 2 Candles +2021/11/30* Chanukah: 3 Candles +2021/12/1* Chanukah: 4 Candles +2021/12/2* Chanukah: 5 Candles +2021/12/3* Chanukah: 6 Candles +2021/12/4* Rosh Chodesh Tevet +2021/12/4* Chanukah: 7 Candles +2021/12/5* Rosh Chodesh Tevet +2021/12/5* Chanukah: 8 Candles +2021/12/6* Chanukah: 8th Day +2021/12/14* Asara B'Tevet +2022/1/3* Rosh Chodesh Sh'vat +2022/1/17* Tu BiShvat +2022/2/1* Rosh Chodesh Adar I +2022/2/2* Rosh Chodesh Adar I +2022/2/15* Purim Katan +2022/2/26* Shabbat Shekalim +2022/3/3* Rosh Chodesh Adar II +2022/3/4* Rosh Chodesh Adar II +2022/3/12* Shabbat Zachor +2022/3/16* Ta'anit Esther +2022/3/16* Erev Purim +2022/3/17* Purim +2022/3/18* Shushan Purim +2022/3/26* Shabbat Parah +2022/4/2* Rosh Chodesh Nisan +2022/4/2* Shabbat HaChodesh +2022/4/9* Shabbat HaGadol +2022/4/15* Ta'anit Bechorot +2022/4/15* Erev Pesach +2022/4/16* Pesach I +2022/4/17* Pesach II +2022/4/18* Pesach III (CH''M) +2022/4/19* Pesach IV (CH''M) +2022/4/20* Pesach V (CH''M) +2022/4/21* Pesach VI (CH''M) +2022/4/22* Pesach VII +2022/4/23* Pesach VIII +2022/4/28* Yom HaShoah +2022/5/1* Rosh Chodesh Iyyar +2022/5/2* Rosh Chodesh Iyyar +2022/5/4* Yom HaZikaron +2022/5/5* Yom HaAtzma'ut +2022/5/15* Pesach Sheni +2022/5/19* Lag BaOmer +2022/5/29* Yom Yerushalayim +2022/5/31* Rosh Chodesh Sivan +2022/6/4* Erev Shavuot +2022/6/5* Shavuot I +2022/6/6* Shavuot II +2022/6/29* Rosh Chodesh Tamuz +2022/6/30* Rosh Chodesh Tamuz +2022/7/17* Tzom Tammuz +2022/7/29* Rosh Chodesh Av +2022/8/6* Shabbat Chazon +2022/8/6* Erev Tish'a B'Av +2022/8/7* Tish'a B'Av +2022/8/12* Tu B'Av +2022/8/13* Shabbat Nachamu +2022/8/27* Rosh Chodesh Elul +2022/8/28* Rosh Chodesh Elul +2022/9/17* Leil Selichot +2022/9/25* Erev Rosh Hashana +2022/9/26* Rosh Hashana 5783 +2022/9/27* Rosh Hashana II +2022/9/28* Tzom Gedaliah +2022/10/1* Shabbat Shuva +2022/10/4* Erev Yom Kippur +2022/10/5* Yom Kippur +2022/10/9* Erev Sukkot +2022/10/10* Sukkot I +2022/10/11* Sukkot II +2022/10/12* Sukkot III (CH''M) +2022/10/13* Sukkot IV (CH''M) +2022/10/14* Sukkot V (CH''M) +2022/10/15* Sukkot VI (CH''M) +2022/10/16* Sukkot VII (Hoshana Raba) +2022/10/17* Shmini Atzeret +2022/10/18* Simchat Torah +2022/10/25* Rosh Chodesh Cheshvan +2022/10/26* Rosh Chodesh Cheshvan +2022/11/1* Yom HaAliyah +2022/11/23* Sigd +2022/11/24* Rosh Chodesh Kislev +2022/11/25* Rosh Chodesh Kislev +2022/12/18* Chanukah: 1 Candle +2022/12/19* Chanukah: 2 Candles +2022/12/20* Chanukah: 3 Candles +2022/12/21* Chanukah: 4 Candles +2022/12/22* Chanukah: 5 Candles +2022/12/23* Chanukah: 6 Candles +2022/12/24* Rosh Chodesh Tevet +2022/12/24* Chanukah: 7 Candles +2022/12/25* Rosh Chodesh Tevet +2022/12/25* Chanukah: 8 Candles +2022/12/26* Chanukah: 8th Day +2023/1/3* Asara B'Tevet +2023/1/23* Rosh Chodesh Sh'vat +2023/2/6* Tu BiShvat +2023/2/18* Shabbat Shekalim +2023/2/21* Rosh Chodesh Adar +2023/2/22* Rosh Chodesh Adar +2023/3/4* Shabbat Zachor +2023/3/6* Ta'anit Esther +2023/3/6* Erev Purim +2023/3/7* Purim +2023/3/8* Shushan Purim +2023/3/11* Shabbat Parah +2023/3/18* Shabbat HaChodesh +2023/3/23* Rosh Chodesh Nisan +2023/4/1* Shabbat HaGadol +2023/4/5* Ta'anit Bechorot +2023/4/5* Erev Pesach +2023/4/6* Pesach I +2023/4/7* Pesach II +2023/4/8* Pesach III (CH''M) +2023/4/9* Pesach IV (CH''M) +2023/4/10* Pesach V (CH''M) +2023/4/11* Pesach VI (CH''M) +2023/4/12* Pesach VII +2023/4/13* Pesach VIII +2023/4/18* Yom HaShoah +2023/4/21* Rosh Chodesh Iyyar +2023/4/22* Rosh Chodesh Iyyar +2023/4/25* Yom HaZikaron +2023/4/26* Yom HaAtzma'ut +2023/5/5* Pesach Sheni +2023/5/9* Lag BaOmer +2023/5/19* Yom Yerushalayim +2023/5/21* Rosh Chodesh Sivan +2023/5/25* Erev Shavuot +2023/5/26* Shavuot I +2023/5/27* Shavuot II +2023/6/19* Rosh Chodesh Tamuz +2023/6/20* Rosh Chodesh Tamuz +2023/7/6* Tzom Tammuz +2023/7/19* Rosh Chodesh Av +2023/7/22* Shabbat Chazon +2023/7/26* Erev Tish'a B'Av +2023/7/27* Tish'a B'Av +2023/7/29* Shabbat Nachamu +2023/8/2* Tu B'Av +2023/8/17* Rosh Chodesh Elul +2023/8/18* Rosh Chodesh Elul +2023/9/9* Leil Selichot +2023/9/15* Erev Rosh Hashana +2023/9/16* Rosh Hashana 5784 +2023/9/17* Rosh Hashana II +2023/9/18* Tzom Gedaliah +2023/9/23* Shabbat Shuva +2023/9/24* Erev Yom Kippur +2023/9/25* Yom Kippur +2023/9/29* Erev Sukkot +2023/9/30* Sukkot I +2023/10/1* Sukkot II +2023/10/2* Sukkot III (CH''M) +2023/10/3* Sukkot IV (CH''M) +2023/10/4* Sukkot V (CH''M) +2023/10/5* Sukkot VI (CH''M) +2023/10/6* Sukkot VII (Hoshana Raba) +2023/10/7* Shmini Atzeret +2023/10/8* Simchat Torah +2023/10/15* Rosh Chodesh Cheshvan +2023/10/16* Rosh Chodesh Cheshvan +2023/10/22* Yom HaAliyah +2023/11/13* Sigd +2023/11/14* Rosh Chodesh Kislev +2023/12/7* Chanukah: 1 Candle +2023/12/8* Chanukah: 2 Candles +2023/12/9* Chanukah: 3 Candles +2023/12/10* Chanukah: 4 Candles +2023/12/11* Chanukah: 5 Candles +2023/12/12* Chanukah: 6 Candles +2023/12/13* Rosh Chodesh Tevet +2023/12/13* Chanukah: 7 Candles +2023/12/14* Chanukah: 8 Candles +2023/12/15* Chanukah: 8th Day +2023/12/22* Asara B'Tevet +2024/1/11* Rosh Chodesh Sh'vat +2024/1/25* Tu BiShvat +2024/2/9* Rosh Chodesh Adar I +2024/2/10* Rosh Chodesh Adar I +2024/2/23* Purim Katan +2024/3/9* Shabbat Shekalim +2024/3/10* Rosh Chodesh Adar II +2024/3/11* Rosh Chodesh Adar II +2024/3/21* Ta'anit Esther +2024/3/23* Shabbat Zachor +2024/3/23* Erev Purim +2024/3/24* Purim +2024/3/25* Shushan Purim +2024/3/30* Shabbat Parah +2024/4/6* Shabbat HaChodesh *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Mar 8 07:15: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 E65D6F3B091; Thu, 8 Mar 2018 07:15:14 +0000 (UTC) (envelope-from eadler@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 94ED76A98B; Thu, 8 Mar 2018 07:15:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FCE45A6C; Thu, 8 Mar 2018 07:15:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w287FEPE054922; Thu, 8 Mar 2018 07:15:14 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w287FEYu054921; Thu, 8 Mar 2018 07:15:14 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803080715.w287FEYu054921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 8 Mar 2018 07:15:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330635 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 330635 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 07:15:15 -0000 Author: eadler Date: Thu Mar 8 07:15:14 2018 New Revision: 330635 URL: https://svnweb.freebsd.org/changeset/base/330635 Log: Chase rename of rwho script in r290252 The script and associated variable was changed in r290252. Now just chase it. MFC With: r290252 Reported by: Aaron LI Modified: head/share/man/man5/periodic.conf.5 Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Thu Mar 8 07:05:19 2018 (r330634) +++ head/share/man/man5/periodic.conf.5 Thu Mar 8 07:15:14 2018 (r330635) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 31, 2017 +.Dd March 7, 2018 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -433,7 +433,7 @@ if you want to run without the .Fl n option (to do DNS lookups). -.It Va daily_status_rwho_enable +.It Va daily_status_uptime_enable .Pq Vt bool Set to .Dq Li YES From owner-svn-src-head@freebsd.org Thu Mar 8 07:59: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 162AEF3E609 for ; Thu, 8 Mar 2018 07:59:08 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 552306C94F for ; Thu, 8 Mar 2018 07:59:07 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x235.google.com with SMTP id w12so1672796ywa.8 for ; Wed, 07 Mar 2018 23:59:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dkcmZAtCBA3ndAgUn+Qj6AgA/XBgsakI8tLHdybuhG4=; b=t3DHf22QrsIqH1KtBN9mkN26M/9GAjbUoGwklCXC9priSD+By2ZcB05VPPyv2wPGou e26lB7iq8MdFGBF8FHMBMfshAc3UFY6MGvartWYs+EOiOPp1f7gHX3ppyb9AEravmKeQ oO/54stktbeCGgcQnDqz4lO/XYWuHSjBqcXVQ= 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=dkcmZAtCBA3ndAgUn+Qj6AgA/XBgsakI8tLHdybuhG4=; b=j1eSGHX7o6bUtvbo5JLlEGmsNQCrtIZM2jzb6vV9qUSsFEZWBNbx4W3fNambfdkoD5 bovngR5dDRKUMzY6XkZxr0h+Mb+SyFDm6oDUBQkzR2Jwg8avrQhMIrgRFSqVz2KNgRC0 dWoXqzG3JIdV8v+8f1jY+iF/5emLJBo33jOzMrwrFswL1ZspOU8IHNmQhuKVvkun5vGD plW44Mo05Z6LnpNQ8rhQau/YuXLYBwZxFsEy8G+KpQ0/nWxHDECbk1Edsl+DJZmjr+9H z/kKgn4BMjZduqEBKNe5ixwp5x9kf5E+17Xt5+jI/Shx7qQpG0q6NWwcQv8eVBjC61hh axcQ== X-Gm-Message-State: AElRT7H2GyNP/AfvSfcvDlw9WhSf5sUajuF0TfO4vskZmrkDr8fhDQg4 OOmqeJbnNFr5nhxbnvIdNi+OceIIjvX4ZvrpPfqhSg== X-Google-Smtp-Source: AG47ELtFrvKGxiSeudTic+9i0xpUdovGL5m7WVv3nTB61u+qBfMbV3wflkVVtoW/4YVJVli6Sx2BYhY6f1mp4WY9pS4= X-Received: by 10.13.214.214 with SMTP id y205mr15874050ywd.37.1520495946697; Wed, 07 Mar 2018 23:59:06 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:23d2:0:0:0:0:0 with HTTP; Wed, 7 Mar 2018 23:58:36 -0800 (PST) In-Reply-To: <201703181113.v2IBDs2T090790@repo.freebsd.org> References: <201703181113.v2IBDs2T090790@repo.freebsd.org> From: Eitan Adler Date: Wed, 7 Mar 2018 23:58:36 -0800 Message-ID: Subject: Re: svn commit: r315480 - in head/sys: dev/syscons dev/vt kern teken To: Bruce Evans 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: Thu, 08 Mar 2018 07:59:08 -0000 On 18 March 2017 at 04:13, Bruce Evans wrote: > Author: bde > Date: Sat Mar 18 11:13:54 2017 > New Revision: 315480 > URL: https://svnweb.freebsd.org/changeset/base/315480 > > Log: > Fix bright colors for syscons, and make them work for the first time > for vt. Restore syscons' rendering of background (bg) brightness as > foreground (fg) blinking and vice versa, and add rendering of blinking > as background brightness to vt. Is this one safe to MFC ? -- Eitan Adler From owner-svn-src-head@freebsd.org Thu Mar 8 09:47: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 4D23FF468F7; Thu, 8 Mar 2018 09:47:12 +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 1073E713EE; Thu, 8 Mar 2018 09:47:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 070A17255; Thu, 8 Mar 2018 09:47:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w289lAVd031160; Thu, 8 Mar 2018 09:47:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w289lArk031151; Thu, 8 Mar 2018 09:47:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803080947.w289lArk031151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 09:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330644 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 330644 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 09:47:12 -0000 Author: hselasky Date: Thu Mar 8 09:47:09 2018 New Revision: 330644 URL: https://svnweb.freebsd.org/changeset/base/330644 Log: Updates for PCI and health monitor recovery in mlx5core. This patch accumulates the following Linux commits: mlx5_health.c - 78ccb25861d76a8fc5c678d762180e6918834200 mlx5_core: Fix wrong name in struct - 171bb2c560f45c0427ca3776a4c8f4e26e559400 mlx5_core: Update health syndromes - 0144a95e2ad53a40c62148f44fb0c1f9d2a0d1e9 mlx5_core: Use accessor functions to read from device memory - ac6ea6e81a80172612e0c9ef93720f371b198918 mlx5_core: Use private health thread for each device - fd76ee4da55abb21babfc69310d321b9cb9a32e0 mlx5_core: Fix internal error detection conditions - 2241007b3d783cbdbaa78c30bdb1994278b6f9b9 mlx5: Clear health sick bit when starting health poll - 712bfef60912d91033cb25739f7444d5b8d8c59f mlx5: Fix version printout in case of health issue - 89d44f0a6c732db23b219be708e2fe1e03ee4842 mlx5_core: Add pci error handlers to mlx5_core driver mlx5_cmd.c - be87544de8df2b1eb34bcb5e32691287d96f9ec4 mlx5_core: Fix async commands return code - a31208b1e11df334d443ec8cace7636150bb8ce2 mlx5_core: New init and exit flow for mlx5_core - 020446e01eebc9dbe7eda038e570ab9c7ab13586 mlx5_core: Prepare cmd interface to system errors handling - 89d44f0a6c732db23b219be708e2fe1e03ee4842 mlx5_core: Add pci error handlers to mlx5_core driver - 0d834442cc247c7b3f3bd6019512ae03e96dd99a mlx5: Fix teardown errors that happen in pci error handler mlx5_main.c - 5fc7197d3a256d9c5de3134870304b24892a4908 mlx5: Add pci shutdown callback Submitted by: Matthew Finlay MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_cq.c head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_health.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_core/mlx5_mr.c head/sys/dev/mlx5/mlx5_core/mlx5_qp.c head/sys/dev/mlx5/mlx5_core/mlx5_srq.c Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Thu Mar 8 08:04:32 2018 (r330643) +++ head/sys/dev/mlx5/device.h Thu Mar 8 09:47:09 2018 (r330644) @@ -417,7 +417,7 @@ struct mlx5_health_buffer { __be32 rsvd2; u8 irisc_index; u8 synd; - __be16 ext_sync; + __be16 ext_synd; }; struct mlx5_init_seg { Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Thu Mar 8 08:04:32 2018 (r330643) +++ head/sys/dev/mlx5/driver.h Thu Mar 8 09:47:09 2018 (r330644) @@ -479,9 +479,11 @@ struct mlx5_core_health { struct mlx5_health_buffer __iomem *health; __be32 __iomem *health_counter; struct timer_list timer; - struct list_head list; u32 prev; int miss_counter; + bool sick; + struct workqueue_struct *wq; + struct work_struct work; }; #define MLX5_CQ_LINEAR_ARRAY_SIZE 1024 @@ -583,6 +585,17 @@ enum mlx5_device_state { MLX5_DEVICE_STATE_INTERNAL_ERROR, }; +enum mlx5_interface_state { + MLX5_INTERFACE_STATE_DOWN = BIT(0), + MLX5_INTERFACE_STATE_UP = BIT(1), + MLX5_INTERFACE_STATE_SHUTDOWN = BIT(2), +}; + +enum mlx5_pci_status { + MLX5_PCI_STATUS_DISABLED, + MLX5_PCI_STATUS_ENABLED, +}; + struct mlx5_special_contexts { int resd_lkey; }; @@ -590,6 +603,9 @@ struct mlx5_special_contexts { struct mlx5_flow_root_namespace; struct mlx5_core_dev { struct pci_dev *pdev; + /* sync pci state */ + struct mutex pci_status_mutex; + enum mlx5_pci_status pci_status; char board_id[MLX5_BOARD_ID_LEN]; struct mlx5_cmd cmd; struct mlx5_port_caps port_caps[MLX5_MAX_PORTS]; @@ -598,6 +614,9 @@ struct mlx5_core_dev { phys_addr_t iseg_base; struct mlx5_init_seg __iomem *iseg; enum mlx5_device_state state; + /* sync interface state */ + struct mutex intf_state_mutex; + unsigned long intf_state; void (*event) (struct mlx5_core_dev *dev, enum mlx5_dev_event event, unsigned long param); @@ -849,8 +868,8 @@ int mlx5_alloc_uuars(struct mlx5_core_dev *dev, struct int mlx5_free_uuars(struct mlx5_core_dev *dev, struct mlx5_uuar_info *uuari); int mlx5_alloc_map_uar(struct mlx5_core_dev *mdev, struct mlx5_uar *uar); void mlx5_unmap_free_uar(struct mlx5_core_dev *mdev, struct mlx5_uar *uar); -void mlx5_health_cleanup(void); -void __init mlx5_health_init(void); +void mlx5_health_cleanup(struct mlx5_core_dev *dev); +int mlx5_health_init(struct mlx5_core_dev *dev); void mlx5_start_health_poll(struct mlx5_core_dev *dev); void mlx5_stop_health_poll(struct mlx5_core_dev *dev); @@ -908,7 +927,6 @@ void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn void mlx5_srq_event(struct mlx5_core_dev *dev, u32 srqn, int event_type); struct mlx5_core_srq *mlx5_core_get_srq(struct mlx5_core_dev *dev, u32 srqn); void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, u32 vector); -void mlx5_trigger_cmd_completions(struct mlx5_core_dev *dev); void mlx5_cq_event(struct mlx5_core_dev *dev, u32 cqn, int event_type); int mlx5_create_map_eq(struct mlx5_core_dev *dev, struct mlx5_eq *eq, u8 vecidx, int nent, u64 mask, const char *name, struct mlx5_uar *uar); @@ -1026,6 +1044,10 @@ struct mlx5_profile { enum { MLX5_PCI_DEV_IS_VF = 1 << 0, +}; + +enum { + MLX5_TRIGGERED_CMD_COMP = (u64)1 << 32, }; static inline int mlx5_core_is_pf(struct mlx5_core_dev *dev) Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Mar 8 08:04:32 2018 (r330643) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Mar 8 09:47:09 2018 (r330644) @@ -295,6 +295,158 @@ static void dump_buf(void *buf, int size, int data_onl pr_debug("\n"); } +enum { + MLX5_DRIVER_STATUS_ABORTED = 0xfe, + MLX5_DRIVER_SYND = 0xbadd00de, +}; + +static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, + u32 *synd, u8 *status) +{ + *synd = 0; + *status = 0; + + switch (op) { + case MLX5_CMD_OP_TEARDOWN_HCA: + case MLX5_CMD_OP_DISABLE_HCA: + case MLX5_CMD_OP_MANAGE_PAGES: + case MLX5_CMD_OP_DESTROY_MKEY: + case MLX5_CMD_OP_DESTROY_EQ: + case MLX5_CMD_OP_DESTROY_CQ: + case MLX5_CMD_OP_DESTROY_QP: + case MLX5_CMD_OP_DESTROY_PSV: + case MLX5_CMD_OP_DESTROY_SRQ: + case MLX5_CMD_OP_DESTROY_XRC_SRQ: + case MLX5_CMD_OP_DESTROY_DCT: + case MLX5_CMD_OP_DEALLOC_Q_COUNTER: + case MLX5_CMD_OP_DEALLOC_PD: + case MLX5_CMD_OP_DEALLOC_UAR: + case MLX5_CMD_OP_DETACH_FROM_MCG: + case MLX5_CMD_OP_DEALLOC_XRCD: + case MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN: + case MLX5_CMD_OP_DELETE_VXLAN_UDP_DPORT: + case MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY: + case MLX5_CMD_OP_DESTROY_TIR: + case MLX5_CMD_OP_DESTROY_SQ: + case MLX5_CMD_OP_DESTROY_RQ: + case MLX5_CMD_OP_DESTROY_RMP: + case MLX5_CMD_OP_DESTROY_TIS: + case MLX5_CMD_OP_DESTROY_RQT: + case MLX5_CMD_OP_DESTROY_FLOW_TABLE: + case MLX5_CMD_OP_DESTROY_FLOW_GROUP: + case MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY: + case MLX5_CMD_OP_2ERR_QP: + case MLX5_CMD_OP_2RST_QP: + case MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT: + case MLX5_CMD_OP_MODIFY_FLOW_TABLE: + case MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY: + case MLX5_CMD_OP_SET_FLOW_TABLE_ROOT: + return MLX5_CMD_STAT_OK; + + case MLX5_CMD_OP_QUERY_HCA_CAP: + case MLX5_CMD_OP_QUERY_ADAPTER: + case MLX5_CMD_OP_INIT_HCA: + case MLX5_CMD_OP_ENABLE_HCA: + case MLX5_CMD_OP_QUERY_PAGES: + case MLX5_CMD_OP_SET_HCA_CAP: + case MLX5_CMD_OP_QUERY_ISSI: + case MLX5_CMD_OP_SET_ISSI: + case MLX5_CMD_OP_CREATE_MKEY: + case MLX5_CMD_OP_QUERY_MKEY: + case MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS: + case MLX5_CMD_OP_PAGE_FAULT_RESUME: + case MLX5_CMD_OP_CREATE_EQ: + case MLX5_CMD_OP_QUERY_EQ: + case MLX5_CMD_OP_GEN_EQE: + case MLX5_CMD_OP_CREATE_CQ: + case MLX5_CMD_OP_QUERY_CQ: + case MLX5_CMD_OP_MODIFY_CQ: + case MLX5_CMD_OP_CREATE_QP: + case MLX5_CMD_OP_RST2INIT_QP: + case MLX5_CMD_OP_INIT2RTR_QP: + case MLX5_CMD_OP_RTR2RTS_QP: + case MLX5_CMD_OP_RTS2RTS_QP: + case MLX5_CMD_OP_SQERR2RTS_QP: + case MLX5_CMD_OP_QUERY_QP: + case MLX5_CMD_OP_SQD_RTS_QP: + case MLX5_CMD_OP_INIT2INIT_QP: + case MLX5_CMD_OP_CREATE_PSV: + case MLX5_CMD_OP_CREATE_SRQ: + case MLX5_CMD_OP_QUERY_SRQ: + case MLX5_CMD_OP_ARM_RQ: + case MLX5_CMD_OP_CREATE_XRC_SRQ: + case MLX5_CMD_OP_QUERY_XRC_SRQ: + case MLX5_CMD_OP_ARM_XRC_SRQ: + case MLX5_CMD_OP_CREATE_DCT: + case MLX5_CMD_OP_DRAIN_DCT: + case MLX5_CMD_OP_QUERY_DCT: + case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION: + case MLX5_CMD_OP_QUERY_VPORT_STATE: + case MLX5_CMD_OP_MODIFY_VPORT_STATE: + case MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT: + case MLX5_CMD_OP_MODIFY_ESW_VPORT_CONTEXT: + case MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT: + case MLX5_CMD_OP_QUERY_ROCE_ADDRESS: + case MLX5_CMD_OP_SET_ROCE_ADDRESS: + case MLX5_CMD_OP_QUERY_HCA_VPORT_CONTEXT: + case MLX5_CMD_OP_MODIFY_HCA_VPORT_CONTEXT: + case MLX5_CMD_OP_QUERY_HCA_VPORT_GID: + case MLX5_CMD_OP_QUERY_HCA_VPORT_PKEY: + case MLX5_CMD_OP_QUERY_VPORT_COUNTER: + case MLX5_CMD_OP_ALLOC_Q_COUNTER: + case MLX5_CMD_OP_QUERY_Q_COUNTER: + case MLX5_CMD_OP_ALLOC_PD: + case MLX5_CMD_OP_ALLOC_UAR: + case MLX5_CMD_OP_CONFIG_INT_MODERATION: + case MLX5_CMD_OP_ACCESS_REG: + case MLX5_CMD_OP_ATTACH_TO_MCG: + case MLX5_CMD_OP_GET_DROPPED_PACKET_LOG: + case MLX5_CMD_OP_MAD_IFC: + case MLX5_CMD_OP_QUERY_MAD_DEMUX: + case MLX5_CMD_OP_SET_MAD_DEMUX: + case MLX5_CMD_OP_NOP: + case MLX5_CMD_OP_ALLOC_XRCD: + case MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN: + case MLX5_CMD_OP_QUERY_CONG_STATUS: + case MLX5_CMD_OP_MODIFY_CONG_STATUS: + case MLX5_CMD_OP_QUERY_CONG_PARAMS: + case MLX5_CMD_OP_MODIFY_CONG_PARAMS: + case MLX5_CMD_OP_QUERY_CONG_STATISTICS: + case MLX5_CMD_OP_ADD_VXLAN_UDP_DPORT: + case MLX5_CMD_OP_SET_L2_TABLE_ENTRY: + case MLX5_CMD_OP_QUERY_L2_TABLE_ENTRY: + case MLX5_CMD_OP_CREATE_TIR: + case MLX5_CMD_OP_MODIFY_TIR: + case MLX5_CMD_OP_QUERY_TIR: + case MLX5_CMD_OP_CREATE_SQ: + case MLX5_CMD_OP_MODIFY_SQ: + case MLX5_CMD_OP_QUERY_SQ: + case MLX5_CMD_OP_CREATE_RQ: + case MLX5_CMD_OP_MODIFY_RQ: + case MLX5_CMD_OP_QUERY_RQ: + case MLX5_CMD_OP_CREATE_RMP: + case MLX5_CMD_OP_MODIFY_RMP: + case MLX5_CMD_OP_QUERY_RMP: + case MLX5_CMD_OP_CREATE_TIS: + case MLX5_CMD_OP_MODIFY_TIS: + case MLX5_CMD_OP_QUERY_TIS: + case MLX5_CMD_OP_CREATE_RQT: + case MLX5_CMD_OP_MODIFY_RQT: + case MLX5_CMD_OP_QUERY_RQT: + case MLX5_CMD_OP_CREATE_FLOW_TABLE: + case MLX5_CMD_OP_QUERY_FLOW_TABLE: + case MLX5_CMD_OP_CREATE_FLOW_GROUP: + case MLX5_CMD_OP_QUERY_FLOW_GROUP: + case MLX5_CMD_OP_QUERY_FLOW_TABLE_ENTRY: + *status = MLX5_DRIVER_STATUS_ABORTED; + *synd = MLX5_DRIVER_SYND; + return -EIO; + default: + mlx5_core_err(dev, "Unknown FW command (%d)\n", op); + return -EINVAL; + } +} + const char *mlx5_command_str(int command) { #define MLX5_COMMAND_STR_CASE(__cmd) case MLX5_CMD_OP_ ## __cmd: return #__cmd @@ -743,6 +895,7 @@ static void complete_command(struct mlx5_cmd_work_ent mlx5_free_cmd_msg(dev, ent->out); free_msg(dev, ent->in); + err = err ? err : ent->status; free_cmd(ent); callback(err, context); } else { @@ -861,6 +1014,16 @@ static int wait_func(struct mlx5_core_dev *dev, struct return err; } +static __be32 *get_synd_ptr(struct mlx5_outbox_hdr *out) +{ + return &out->syndrome; +} + +static u8 *get_status_ptr(struct mlx5_outbox_hdr *out) +{ + return &out->status; +} + /* Notes: * 1. Callback functions may not sleep * 2. page queue commands do not support asynchrous completion @@ -1102,6 +1265,10 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, else ent->ret = 0; ent->status = ent->lay->status_own >> 1; + if (vector & MLX5_TRIGGERED_CMD_COMP) + ent->status = MLX5_DRIVER_STATUS_ABORTED; + else + ent->status = ent->lay->status_own >> 1; mlx5_core_dbg(dev, "FW command ret 0x%x, status %s(0x%x)\n", @@ -1115,33 +1282,6 @@ void mlx5_cmd_comp_handler(struct mlx5_core_dev *dev, } EXPORT_SYMBOL(mlx5_cmd_comp_handler); -void mlx5_trigger_cmd_completions(struct mlx5_core_dev *dev) -{ - unsigned long vector; - int i = 0; - unsigned long flags; - synchronize_irq(dev->priv.eq_table.cmd_eq.irqn); - spin_lock_irqsave(&dev->cmd.alloc_lock, flags); - vector = ~dev->cmd.bitmask & ((1ul << (1 << dev->cmd.log_sz)) - 1); - spin_unlock_irqrestore(&dev->cmd.alloc_lock, flags); - - if (!vector) - return; - - for (i = 0; i < (1 << dev->cmd.log_sz); i++) { - struct mlx5_cmd_work_ent *ent = dev->cmd.ent_arr[i]; - - if (!test_bit(i, &vector)) - continue; - - while (ent->busy) - usleep_range(1000, 1100); - free_ent(&dev->cmd, i); - complete_command(ent); - } -} -EXPORT_SYMBOL(mlx5_trigger_cmd_completions); - static int status_to_err(u8 status) { return status ? -1 : 0; /* TBD more meaningful codes */ @@ -1175,6 +1315,11 @@ static struct mlx5_cmd_msg *alloc_msg(struct mlx5_core return msg; } +static u16 opcode_from_in(struct mlx5_inbox_hdr *in) +{ + return be16_to_cpu(in->opcode); +} + static int is_manage_pages(struct mlx5_inbox_hdr *in) { return be16_to_cpu(in->opcode) == MLX5_CMD_OP_MANAGE_PAGES; @@ -1191,7 +1336,16 @@ static int cmd_exec_helper(struct mlx5_core_dev *dev, const gfp_t gfp = GFP_KERNEL; int err; u8 status = 0; + u32 drv_synd; + if (pci_channel_offline(dev->pdev) || + dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { + err = mlx5_internal_err_ret_value(dev, opcode_from_in(in), &drv_synd, &status); + *get_synd_ptr(out) = cpu_to_be32(drv_synd); + *get_status_ptr(out) = status; + return err; + } + pages_queue = is_manage_pages(in); inb = alloc_msg(dev, in_size, gfp); @@ -1377,6 +1531,7 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev) int err; int i; + memset(cmd, 0, sizeof(*cmd)); cmd_if_rev = cmdif_rev_get(dev); if (cmd_if_rev != CMD_IF_REV) { device_printf((&dev->pdev->dev)->bsddev, "ERR: ""Driver cmdif rev(%d) differs from firmware's(%d)\n", CMD_IF_REV, cmd_if_rev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Thu Mar 8 08:04:32 2018 (r330643) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Thu Mar 8 09:47:09 2018 (r330644) @@ -70,6 +70,10 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); int mlx5_cmd_init_hca(struct mlx5_core_dev *dev); int mlx5_cmd_teardown_hca(struct mlx5_core_dev *dev); +void mlx5_core_event(struct mlx5_core_dev *dev, enum mlx5_dev_event event, + unsigned long param); +void mlx5_enter_error_state(struct mlx5_core_dev *dev); +void mlx5_disable_device(struct mlx5_core_dev *dev); void mlx5e_init(void); void mlx5e_cleanup(void); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Mar 8 08:04:32 2018 (r330643) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cq.c Thu Mar 8 09:47:09 2018 (r330644) @@ -294,6 +294,7 @@ int mlx5_init_cq_table(struct mlx5_core_dev *dev) int err; int x; + memset(table, 0, sizeof(*table)); spin_lock_init(&table->lock); for (x = 0; x != MLX5_CQ_LINEAR_ARRAY_SIZE; x++) spin_lock_init(&table->linear_array[x].lock); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Thu Mar 8 08:04:32 2018 (r330643) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Thu Mar 8 09:47:09 2018 (r330644) @@ -398,6 +398,7 @@ int mlx5_create_map_eq(struct mlx5_core_dev *dev, stru int inlen; eq->nent = roundup_pow_of_two(nent + MLX5_NUM_SPARE_EQE); + eq->cons_index = 0; err = mlx5_buf_alloc(dev, eq->nent * MLX5_EQE_SIZE, 2 * PAGE_SIZE, &eq->buf); if (err) Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 08:04:32 2018 (r330643) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 09:47:09 2018 (r330644) @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include "mlx5_core.h" @@ -36,31 +37,113 @@ #define MLX5_HEALTH_POLL_INTERVAL (2 * HZ) #define MAX_MISSES 3 -static DEFINE_SPINLOCK(health_lock); -static LIST_HEAD(health_list); -static struct work_struct health_work; +enum { + MLX5_NIC_IFC_FULL = 0, + MLX5_NIC_IFC_DISABLED = 1, + MLX5_NIC_IFC_NO_DRAM_NIC = 2 +}; +static u8 get_nic_interface(struct mlx5_core_dev *dev) +{ + return (ioread32be(&dev->iseg->cmdq_addr_l_sz) >> 8) & 3; +} + +static void mlx5_trigger_cmd_completions(struct mlx5_core_dev *dev) +{ + unsigned long flags; + u64 vector; + + /* wait for pending handlers to complete */ + synchronize_irq(dev->priv.msix_arr[MLX5_EQ_VEC_CMD].vector); + spin_lock_irqsave(&dev->cmd.alloc_lock, flags); + vector = ~dev->cmd.bitmask & ((1ul << (1 << dev->cmd.log_sz)) - 1); + if (!vector) + goto no_trig; + + vector |= MLX5_TRIGGERED_CMD_COMP; + spin_unlock_irqrestore(&dev->cmd.alloc_lock, flags); + + mlx5_core_dbg(dev, "vector 0x%lx\n", vector); + mlx5_cmd_comp_handler(dev, vector); + return; + +no_trig: + spin_unlock_irqrestore(&dev->cmd.alloc_lock, flags); +} + +static int in_fatal(struct mlx5_core_dev *dev) +{ + struct mlx5_core_health *health = &dev->priv.health; + struct mlx5_health_buffer __iomem *h = health->health; + + if (get_nic_interface(dev) == MLX5_NIC_IFC_DISABLED) + return 1; + + if (ioread32be(&h->fw_ver) == 0xffffffff) + return 1; + + return 0; +} + +void mlx5_enter_error_state(struct mlx5_core_dev *dev) +{ + if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) + return; + + mlx5_core_err(dev, "start\n"); + if (pci_channel_offline(dev->pdev) || in_fatal(dev)) + dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; + + mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0); + mlx5_core_err(dev, "end\n"); +} + +static void mlx5_handle_bad_state(struct mlx5_core_dev *dev) +{ + u8 nic_interface = get_nic_interface(dev); + + switch (nic_interface) { + case MLX5_NIC_IFC_FULL: + mlx5_core_warn(dev, "Expected to see disabled NIC but it is full driver\n"); + break; + + case MLX5_NIC_IFC_DISABLED: + mlx5_core_warn(dev, "starting teardown\n"); + break; + + case MLX5_NIC_IFC_NO_DRAM_NIC: + mlx5_core_warn(dev, "Expected to see disabled NIC but it is no dram nic\n"); + break; + default: + mlx5_core_warn(dev, "Expected to see disabled NIC but it is has invalid value %d\n", + nic_interface); + } + + mlx5_disable_device(dev); +} + static void health_care(struct work_struct *work) { - struct mlx5_core_health *health, *n; + struct mlx5_core_health *health; struct mlx5_core_dev *dev; struct mlx5_priv *priv; - LIST_HEAD(tlist); - spin_lock_irq(&health_lock); - list_splice_init(&health_list, &tlist); + health = container_of(work, struct mlx5_core_health, work); + priv = container_of(health, struct mlx5_priv, health); + dev = container_of(priv, struct mlx5_core_dev, priv); + mlx5_core_warn(dev, "handling bad device here\n"); + mlx5_handle_bad_state(dev); +} - spin_unlock_irq(&health_lock); +static int get_next_poll_jiffies(void) +{ + unsigned long next; - list_for_each_entry_safe(health, n, &tlist, list) { - priv = container_of(health, struct mlx5_priv, health); - dev = container_of(priv, struct mlx5_core_dev, priv); - mlx5_core_warn(dev, "handling bad device here\n"); - /* nothing yet */ - spin_lock_irq(&health_lock); - list_del_init(&health->list); - spin_unlock_irq(&health_lock); - } + get_random_bytes(&next, sizeof(next)); + next %= HZ; + next += jiffies + MLX5_HEALTH_POLL_INTERVAL; + + return next; } static const char *hsynd_str(u8 synd) @@ -70,6 +153,8 @@ static const char *hsynd_str(u8 synd) return "firmware internal error"; case MLX5_HEALTH_SYNDR_IRISC_ERR: return "irisc not responding"; + case MLX5_HEALTH_SYNDR_HW_UNRECOVERABLE_ERR: + return "unrecoverable hardware error"; case MLX5_HEALTH_SYNDR_CRC_ERR: return "firmware CRC error"; case MLX5_HEALTH_SYNDR_FETCH_PCI_ERR: @@ -80,51 +165,59 @@ static const char *hsynd_str(u8 synd) return "async EQ buffer overrun"; case MLX5_HEALTH_SYNDR_EQ_ERR: return "EQ error"; + case MLX5_HEALTH_SYNDR_EQ_INV: + return "Invalid EQ referenced"; case MLX5_HEALTH_SYNDR_FFSER_ERR: return "FFSER error"; + case MLX5_HEALTH_SYNDR_HIGH_TEMP: + return "High temprature"; default: return "unrecognized error"; } } -static u16 read_be16(__be16 __iomem *p) -{ - return swab16(readl((__force u16 __iomem *) p)); -} - -static u32 read_be32(__be32 __iomem *p) -{ - return swab32(readl((__force u32 __iomem *) p)); -} - static void print_health_info(struct mlx5_core_dev *dev) { struct mlx5_core_health *health = &dev->priv.health; struct mlx5_health_buffer __iomem *h = health->health; + char fw_str[18]; + u32 fw; int i; + /* If the syndrom is 0, the device is OK and no need to print buffer */ + if (!ioread8(&h->synd)) + return; + for (i = 0; i < ARRAY_SIZE(h->assert_var); i++) - printf("mlx5_core: INFO: ""assert_var[%d] 0x%08x\n", i, read_be32(h->assert_var + i)); + printf("mlx5_core: INFO: ""assert_var[%d] 0x%08x\n", i, ioread32be(h->assert_var + i)); - printf("mlx5_core: INFO: ""assert_exit_ptr 0x%08x\n", read_be32(&h->assert_exit_ptr)); - printf("mlx5_core: INFO: ""assert_callra 0x%08x\n", read_be32(&h->assert_callra)); - printf("mlx5_core: INFO: ""fw_ver 0x%08x\n", read_be32(&h->fw_ver)); - printf("mlx5_core: INFO: ""hw_id 0x%08x\n", read_be32(&h->hw_id)); - printf("mlx5_core: INFO: ""irisc_index %d\n", readb(&h->irisc_index)); - printf("mlx5_core: INFO: ""synd 0x%x: %s\n", readb(&h->synd), hsynd_str(readb(&h->synd))); - printf("mlx5_core: INFO: ""ext_sync 0x%04x\n", read_be16(&h->ext_sync)); + printf("mlx5_core: INFO: ""assert_exit_ptr 0x%08x\n", ioread32be(&h->assert_exit_ptr)); + printf("mlx5_core: INFO: ""assert_callra 0x%08x\n", ioread32be(&h->assert_callra)); + snprintf(fw_str, sizeof(fw_str), "%d.%d.%d", fw_rev_maj(dev), fw_rev_min(dev), fw_rev_sub(dev)); + printf("mlx5_core: INFO: ""fw_ver %s\n", fw_str); + printf("mlx5_core: INFO: ""hw_id 0x%08x\n", ioread32be(&h->hw_id)); + printf("mlx5_core: INFO: ""irisc_index %d\n", ioread8(&h->irisc_index)); + printf("mlx5_core: INFO: ""synd 0x%x: %s\n", ioread8(&h->synd), hsynd_str(ioread8(&h->synd))); + printf("mlx5_core: INFO: ""ext_synd 0x%04x\n", ioread16be(&h->ext_synd)); + fw = ioread32be(&h->fw_ver); + printf("mlx5_core: INFO: ""raw fw_ver 0x%08x\n", fw); } static void poll_health(unsigned long data) { struct mlx5_core_dev *dev = (struct mlx5_core_dev *)data; struct mlx5_core_health *health = &dev->priv.health; - int next; u32 count; if (dev->state != MLX5_DEVICE_STATE_UP) return; + if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { + mlx5_trigger_cmd_completions(dev); + mod_timer(&health->timer, get_next_poll_jiffies()); + return; + } + count = ioread32be(health->health_counter); if (count == health->prev) ++health->miss_counter; @@ -133,28 +226,25 @@ static void poll_health(unsigned long data) health->prev = count; if (health->miss_counter == MAX_MISSES) { - mlx5_core_err(dev, "device's health compromised\n"); + mlx5_core_err(dev, "device's health compromised - reached miss count\n"); print_health_info(dev); - spin_lock_irq(&health_lock); - list_add_tail(&health->list, &health_list); - spin_unlock_irq(&health_lock); - - if (!queue_work(mlx5_core_wq, &health_work)) - mlx5_core_warn(dev, "failed to queue health work\n"); } else { - get_random_bytes(&next, sizeof(next)); - next %= HZ; - next += jiffies + MLX5_HEALTH_POLL_INTERVAL; - mod_timer(&health->timer, next); + mod_timer(&health->timer, get_next_poll_jiffies()); } + + if (in_fatal(dev) && !health->sick) { + health->sick = true; + print_health_info(dev); + queue_work(health->wq, &health->work); + } } void mlx5_start_health_poll(struct mlx5_core_dev *dev) { struct mlx5_core_health *health = &dev->priv.health; - INIT_LIST_HEAD(&health->list); init_timer(&health->timer); + health->sick = 0; health->health = &dev->iseg->health; health->health_counter = &dev->iseg->health_counter; @@ -168,19 +258,35 @@ void mlx5_stop_health_poll(struct mlx5_core_dev *dev) struct mlx5_core_health *health = &dev->priv.health; del_timer_sync(&health->timer); - - spin_lock_irq(&health_lock); - if (!list_empty(&health->list)) - list_del_init(&health->list); - spin_unlock_irq(&health_lock); } -void mlx5_health_cleanup(void) +void mlx5_health_cleanup(struct mlx5_core_dev *dev) { + struct mlx5_core_health *health = &dev->priv.health; + + destroy_workqueue(health->wq); } -void __init mlx5_health_init(void) +#define HEALTH_NAME "mlx5_health" +int mlx5_health_init(struct mlx5_core_dev *dev) { + struct mlx5_core_health *health; + char *name; + int len; - INIT_WORK(&health_work, health_care); + health = &dev->priv.health; + len = strlen(HEALTH_NAME) + strlen(dev_name(&dev->pdev->dev)); + name = kmalloc(len + 1, GFP_KERNEL); + if (!name) + return -ENOMEM; + + snprintf(name, len, "%s:%s", HEALTH_NAME, dev_name(&dev->pdev->dev)); + health->wq = create_singlethread_workqueue(name); + kfree(name); + if (!health->wq) + return -ENOMEM; + + INIT_WORK(&health->work, health_care); + + return 0; } Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Mar 8 08:04:32 2018 (r330643) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Mar 8 09:47:09 2018 (r330644) @@ -63,7 +63,6 @@ MODULE_PARM_DESC(prof_sel, "profile selector. Valid ra #define NUMA_NO_NODE -1 -struct workqueue_struct *mlx5_core_wq; static LIST_HEAD(intf_list); static LIST_HEAD(dev_list); static DEFINE_MUTEX(intf_mutex); @@ -186,6 +185,34 @@ static int set_dma_caps(struct pci_dev *pdev) return err; } +static int mlx5_pci_enable_device(struct mlx5_core_dev *dev) +{ + struct pci_dev *pdev = dev->pdev; + int err = 0; + + mutex_lock(&dev->pci_status_mutex); + if (dev->pci_status == MLX5_PCI_STATUS_DISABLED) { + err = pci_enable_device(pdev); + if (!err) + dev->pci_status = MLX5_PCI_STATUS_ENABLED; + } + mutex_unlock(&dev->pci_status_mutex); + + return err; +} + +static void mlx5_pci_disable_device(struct mlx5_core_dev *dev) +{ + struct pci_dev *pdev = dev->pdev; + + mutex_lock(&dev->pci_status_mutex); + if (dev->pci_status == MLX5_PCI_STATUS_ENABLED) { + pci_disable_device(pdev); + dev->pci_status = MLX5_PCI_STATUS_DISABLED; + } + mutex_unlock(&dev->pci_status_mutex); +} + static int request_bar(struct pci_dev *pdev) { int err = 0; @@ -680,12 +707,128 @@ static int wait_fw_init(struct mlx5_core_dev *dev, u32 return err; } -static int mlx5_dev_init(struct mlx5_core_dev *dev, struct pci_dev *pdev) +static void mlx5_add_device(struct mlx5_interface *intf, struct mlx5_priv *priv) { + struct mlx5_device_context *dev_ctx; + struct mlx5_core_dev *dev = container_of(priv, struct mlx5_core_dev, priv); + + dev_ctx = kzalloc(sizeof(*dev_ctx), GFP_KERNEL); + if (!dev_ctx) + return; + + dev_ctx->intf = intf; + CURVNET_SET_QUIET(vnet0); + dev_ctx->context = intf->add(dev); + CURVNET_RESTORE(); + + if (dev_ctx->context) { + spin_lock_irq(&priv->ctx_lock); + list_add_tail(&dev_ctx->list, &priv->ctx_list); + spin_unlock_irq(&priv->ctx_lock); + } else { + kfree(dev_ctx); + } +} + +static void mlx5_remove_device(struct mlx5_interface *intf, struct mlx5_priv *priv) +{ + struct mlx5_device_context *dev_ctx; + struct mlx5_core_dev *dev = container_of(priv, struct mlx5_core_dev, priv); + + list_for_each_entry(dev_ctx, &priv->ctx_list, list) + if (dev_ctx->intf == intf) { + spin_lock_irq(&priv->ctx_lock); + list_del(&dev_ctx->list); + spin_unlock_irq(&priv->ctx_lock); + + intf->remove(dev, dev_ctx->context); + kfree(dev_ctx); + return; + } +} + +static int mlx5_register_device(struct mlx5_core_dev *dev) +{ struct mlx5_priv *priv = &dev->priv; - int err; + struct mlx5_interface *intf; - dev->pdev = pdev; + mutex_lock(&intf_mutex); + list_add_tail(&priv->dev_list, &dev_list); + list_for_each_entry(intf, &intf_list, list) + mlx5_add_device(intf, priv); + mutex_unlock(&intf_mutex); + + return 0; +} + +static void mlx5_unregister_device(struct mlx5_core_dev *dev) +{ + struct mlx5_priv *priv = &dev->priv; + struct mlx5_interface *intf; + + mutex_lock(&intf_mutex); + list_for_each_entry(intf, &intf_list, list) + mlx5_remove_device(intf, priv); + list_del(&priv->dev_list); + mutex_unlock(&intf_mutex); +} + +int mlx5_register_interface(struct mlx5_interface *intf) +{ + struct mlx5_priv *priv; + + if (!intf->add || !intf->remove) + return -EINVAL; + + mutex_lock(&intf_mutex); + list_add_tail(&intf->list, &intf_list); + list_for_each_entry(priv, &dev_list, dev_list) + mlx5_add_device(intf, priv); + mutex_unlock(&intf_mutex); + + return 0; +} +EXPORT_SYMBOL(mlx5_register_interface); + +void mlx5_unregister_interface(struct mlx5_interface *intf) +{ + struct mlx5_priv *priv; + + mutex_lock(&intf_mutex); + list_for_each_entry(priv, &dev_list, dev_list) + mlx5_remove_device(intf, priv); + list_del(&intf->list); + mutex_unlock(&intf_mutex); +} +EXPORT_SYMBOL(mlx5_unregister_interface); + +void *mlx5_get_protocol_dev(struct mlx5_core_dev *mdev, int protocol) +{ + struct mlx5_priv *priv = &mdev->priv; + struct mlx5_device_context *dev_ctx; + unsigned long flags; + void *result = NULL; + + spin_lock_irqsave(&priv->ctx_lock, flags); + + list_for_each_entry(dev_ctx, &mdev->priv.ctx_list, list) + if ((dev_ctx->intf->protocol == protocol) && + dev_ctx->intf->get_dev) { + result = dev_ctx->intf->get_dev(dev_ctx->context); + break; + } + + spin_unlock_irqrestore(&priv->ctx_lock, flags); + + return result; +} +EXPORT_SYMBOL(mlx5_get_protocol_dev); + +static int mlx5_pci_init(struct mlx5_core_dev *dev, struct mlx5_priv *priv) +{ + struct pci_dev *pdev = dev->pdev; + int err = 0; + pci_set_drvdata(dev->pdev, dev); strncpy(priv->name, dev_name(&pdev->dev), MLX5_MAX_NAME_LEN); priv->name[MLX5_MAX_NAME_LEN - 1] = 0; @@ -696,7 +839,7 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st priv->numa_node = NUMA_NO_NODE; - err = pci_enable_device(pdev); + err = mlx5_pci_enable_device(dev); if (err) { device_printf((&pdev->dev)->bsddev, "ERR: ""Cannot enable PCI device, aborting\n"); goto err_dbg; @@ -723,6 +866,38 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st device_printf((&pdev->dev)->bsddev, "ERR: ""Failed mapping initialization segment, aborting\n"); goto err_clr_master; } + + return 0; + +err_clr_master: + pci_clear_master(dev->pdev); + release_bar(dev->pdev); +err_disable: + mlx5_pci_disable_device(dev); +err_dbg: + return err; +} + +static void mlx5_pci_close(struct mlx5_core_dev *dev, struct mlx5_priv *priv) +{ + iounmap(dev->iseg); + pci_clear_master(dev->pdev); + release_bar(dev->pdev); + mlx5_pci_disable_device(dev); +} + +static int mlx5_load_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv) +{ + struct pci_dev *pdev = dev->pdev; + int err; + + mutex_lock(&dev->intf_state_mutex); + if (test_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state)) { + dev_warn(&dev->pdev->dev, "%s: interface is up, NOP\n", + __func__); + goto out; + } + device_printf((&pdev->dev)->bsddev, "INFO: ""firmware version: %d.%d.%d\n", fw_rev_maj(dev), fw_rev_min(dev), fw_rev_sub(dev)); /* @@ -734,7 +909,7 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st err = mlx5_cmd_init(dev); if (err) { device_printf((&pdev->dev)->bsddev, "ERR: ""Failed initializing command interface, aborting\n"); - goto err_unmap; + goto out_err; } err = wait_fw_init(dev, FW_INIT_TIMEOUT_MILI); @@ -859,8 +1034,21 @@ static int mlx5_dev_init(struct mlx5_core_dev *dev, st goto err_init_tables; } + err = mlx5_register_device(dev); + if (err) { + dev_err(&pdev->dev, "mlx5_register_device failed %d\n", err); + goto err_reg_dev; + } + + clear_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state); + set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state); + +out: + mutex_unlock(&dev->intf_state_mutex); return 0; +err_reg_dev: + mlx5_cleanup_fs(dev); err_init_tables: mlx5_cleanup_mr_table(dev); mlx5_cleanup_srq_table(dev); @@ -884,7 +1072,7 @@ err_stop_poll: mlx5_stop_health_poll(dev); if (mlx5_cmd_teardown_hca(dev)) { device_printf((&dev->pdev->dev)->bsddev, "ERR: ""tear_down_hca failed, skip cleanup\n"); - return err; + goto out_err; } reclaim_boot_pages: @@ -898,28 +1086,29 @@ err_disable_hca: err_pagealloc_cleanup: mlx5_pagealloc_cleanup(dev); + err_cmd_cleanup: mlx5_cmd_cleanup(dev); -err_unmap: - iounmap(dev->iseg); - -err_clr_master: - pci_clear_master(dev->pdev); - release_bar(dev->pdev); - -err_disable: - pci_disable_device(dev->pdev); - -err_dbg: +out_err: dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; + mutex_unlock(&dev->intf_state_mutex); + return err; } -static void mlx5_dev_cleanup(struct mlx5_core_dev *dev) +static int mlx5_unload_one(struct mlx5_core_dev *dev, struct mlx5_priv *priv) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Mar 8 09:51: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 1EBF2F46E7E; Thu, 8 Mar 2018 09:51:34 +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 C8275718B7; Thu, 8 Mar 2018 09:51:33 +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 C305C7399; Thu, 8 Mar 2018 09:51:33 +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 w289pXOw032836; Thu, 8 Mar 2018 09:51:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w289pXdD032835; Thu, 8 Mar 2018 09:51:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803080951.w289pXdD032835@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 09:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330645 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 330645 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 09:51:34 -0000 Author: hselasky Date: Thu Mar 8 09:51:33 2018 New Revision: 330645 URL: https://svnweb.freebsd.org/changeset/base/330645 Log: Avoid calling sleeping function from the health poll thread in mlx5core. linux commit c1d4d2e92ad670168a17a57dfa182a5a5baa72d4 Submitted by: Matthew Finlay MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 09:47:09 2018 (r330644) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 09:51:33 2018 (r330645) @@ -87,15 +87,23 @@ static int in_fatal(struct mlx5_core_dev *dev) void mlx5_enter_error_state(struct mlx5_core_dev *dev) { - if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) + mutex_lock(&dev->intf_state_mutex); + if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { + goto unlock; return; + } mlx5_core_err(dev, "start\n"); - if (pci_channel_offline(dev->pdev) || in_fatal(dev)) + if (pci_channel_offline(dev->pdev) || in_fatal(dev)) { dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; + mlx5_trigger_cmd_completions(dev); + } mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0); mlx5_core_err(dev, "end\n"); + +unlock: + mutex_unlock(&dev->intf_state_mutex); } static void mlx5_handle_bad_state(struct mlx5_core_dev *dev) @@ -213,7 +221,6 @@ static void poll_health(unsigned long data) return; if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { - mlx5_trigger_cmd_completions(dev); mod_timer(&health->timer, get_next_poll_jiffies()); return; } From owner-svn-src-head@freebsd.org Thu Mar 8 09:58: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 47564F47761; Thu, 8 Mar 2018 09:58:42 +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 E7B0371E1C; Thu, 8 Mar 2018 09:58:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE3AC73E0; Thu, 8 Mar 2018 09:58:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w289wf5k036190; Thu, 8 Mar 2018 09:58:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w289wfeR036187; Thu, 8 Mar 2018 09:58:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803080958.w289wfeR036187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 09:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330646 - in head/sys/dev/mlx5: . mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 330646 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 09:58:42 -0000 Author: hselasky Date: Thu Mar 8 09:58:41 2018 New Revision: 330646 URL: https://svnweb.freebsd.org/changeset/base/330646 Log: Fix race between PCI error handlers and health work in mlx5core. linux commit 05ac2c0b7438ea08c5d54b48797acf9b22cb2f6f Submitted by: Matthew Finlay MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_health.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Thu Mar 8 09:51:33 2018 (r330645) +++ head/sys/dev/mlx5/driver.h Thu Mar 8 09:58:41 2018 (r330646) @@ -482,7 +482,10 @@ struct mlx5_core_health { u32 prev; int miss_counter; bool sick; + /* wq spinlock to synchronize draining */ + spinlock_t wq_lock; struct workqueue_struct *wq; + unsigned long flags; struct work_struct work; }; @@ -872,6 +875,7 @@ void mlx5_health_cleanup(struct mlx5_core_dev *dev); int mlx5_health_init(struct mlx5_core_dev *dev); void mlx5_start_health_poll(struct mlx5_core_dev *dev); void mlx5_stop_health_poll(struct mlx5_core_dev *dev); +void mlx5_drain_health_wq(struct mlx5_core_dev *dev); #define mlx5_buf_alloc_node(dev, size, direct, buf, node) \ mlx5_buf_alloc(dev, size, direct, buf) Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 09:51:33 2018 (r330645) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 09:58:41 2018 (r330646) @@ -43,6 +43,10 @@ enum { MLX5_NIC_IFC_NO_DRAM_NIC = 2 }; +enum { + MLX5_DROP_NEW_HEALTH_WORK, +}; + static u8 get_nic_interface(struct mlx5_core_dev *dev) { return (ioread32be(&dev->iseg->cmdq_addr_l_sz) >> 8) & 3; @@ -242,7 +246,13 @@ static void poll_health(unsigned long data) if (in_fatal(dev) && !health->sick) { health->sick = true; print_health_info(dev); - queue_work(health->wq, &health->work); + spin_lock(&health->wq_lock); + if (!test_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags)) + queue_work(health->wq, &health->work); + else + dev_err(&dev->pdev->dev, + "new health works are not permitted at this stage\n"); + spin_unlock(&health->wq_lock); } } @@ -252,6 +262,7 @@ void mlx5_start_health_poll(struct mlx5_core_dev *dev) init_timer(&health->timer); health->sick = 0; + clear_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags); health->health = &dev->iseg->health; health->health_counter = &dev->iseg->health_counter; @@ -267,6 +278,16 @@ void mlx5_stop_health_poll(struct mlx5_core_dev *dev) del_timer_sync(&health->timer); } +void mlx5_drain_health_wq(struct mlx5_core_dev *dev) +{ + struct mlx5_core_health *health = &dev->priv.health; + + spin_lock(&health->wq_lock); + set_bit(MLX5_DROP_NEW_HEALTH_WORK, &health->flags); + spin_unlock(&health->wq_lock); + cancel_work_sync(&health->work); +} + void mlx5_health_cleanup(struct mlx5_core_dev *dev) { struct mlx5_core_health *health = &dev->priv.health; @@ -293,6 +314,7 @@ int mlx5_health_init(struct mlx5_core_dev *dev) if (!health->wq) return -ENOMEM; + spin_lock_init(&health->wq_lock); INIT_WORK(&health->work, health_care); return 0; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Mar 8 09:51:33 2018 (r330645) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Mar 8 09:58:41 2018 (r330646) @@ -1243,7 +1243,12 @@ static pci_ers_result_t mlx5_pci_err_detected(struct p dev_info(&pdev->dev, "%s was called\n", __func__); mlx5_enter_error_state(dev); mlx5_unload_one(dev, priv); - mlx5_pci_disable_device(dev); + if (state) { + pci_save_state(pdev->dev.bsddev); + mlx5_drain_health_wq(dev); + mlx5_pci_disable_device(dev); + } + return state == pci_channel_io_perm_failure ? PCI_ERS_RESULT_DISCONNECT : PCI_ERS_RESULT_NEED_RESET; } From owner-svn-src-head@freebsd.org Thu Mar 8 10:43: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 39768F4AF8C; Thu, 8 Mar 2018 10:43:43 +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 DE8E273CDF; Thu, 8 Mar 2018 10:43:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D90117BFF; Thu, 8 Mar 2018 10:43:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28Ahg1V060910; Thu, 8 Mar 2018 10:43:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28Ahg6E060905; Thu, 8 Mar 2018 10:43:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081043.w28Ahg6E060905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 10:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330647 - in head/sys/dev/mlx5: . mlx5_core mlx5_en mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en mlx5_ib X-SVN-Commit-Revision: 330647 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 10:43:43 -0000 Author: hselasky Date: Thu Mar 8 10:43:42 2018 New Revision: 330647 URL: https://svnweb.freebsd.org/changeset/base/330647 Log: Use the autogenerated interface file for all commands in mlx5core. This patch accumulates the following Linux commits: - 90b3e38d048f09b22fb50bcd460cea65fd00b2d7 mlx5_core: Modify CQ moderation parameters - 09a7d9eca1a6cf5eb4f9abfdf8914db9dbd96f08 mlx5_core: QP/XRCD commands via mlx5 ifc - 1a412fb1caa2c1b77719ccb5ed8b0c3c2bc65da7 mlx5_core: Modify QP commands via mlx5 ifc - ec22eb53106be1472ba6573dc900943f52f8fd1e mlx5_core: MKey/PSV commands via mlx5 ifc - 73b626c182dff06867ceba996a819e8372c9b2ce mlx5_core: EQ commands via mlx5 ifc - 20ed51c643b6296789a48adc3bc2cc875a1612cf mlx5_core: Access register and MAD IFC commands via mlx5 ifc - a533ed5e179cd15512d40282617909d3482a771c mlx5_core: Pages management commands via mlx5 ifc - b8a4ddb2e8f44f872fb93bbda2d541b27079fd2b mlx5_core: Add MLX5_ARRAY_SET64 to fix BUILD_BUG_ON - af1ba291c5e498973cc325c501dd8da80b234571 mlx5_core: Refactor internal SRQ API - b06e7de8a9d8d1d540ec122bbdf2face2a211634 mlx5_core: Refactor device capability function - c4f287c4a6ac489c18afc4acc4353141a8c53070 mlx5_core: Unify and improve command interface Submitted by: Matthew Finlay MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/cq.h head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_cq.c head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_fs_cmd.c head/sys/dev/mlx5/mlx5_core/mlx5_fw.c head/sys/dev/mlx5/mlx5_core/mlx5_mad.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_core/mlx5_mcg.c head/sys/dev/mlx5/mlx5_core/mlx5_mr.c head/sys/dev/mlx5/mlx5_core/mlx5_pagealloc.c head/sys/dev/mlx5/mlx5_core/mlx5_pd.c head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_core/mlx5_qp.c head/sys/dev/mlx5/mlx5_core/mlx5_srq.c head/sys/dev/mlx5/mlx5_core/mlx5_transobj.c head/sys/dev/mlx5/mlx5_core/mlx5_uar.c head/sys/dev/mlx5/mlx5_core/mlx5_vport.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mr.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_srq.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/dev/mlx5/qp.h head/sys/dev/mlx5/srq.h Modified: head/sys/dev/mlx5/cq.h ============================================================================== --- head/sys/dev/mlx5/cq.h Thu Mar 8 09:58:41 2018 (r330646) +++ head/sys/dev/mlx5/cq.h Thu Mar 8 10:43:42 2018 (r330647) @@ -157,12 +157,12 @@ static inline void mlx5_cq_arm(struct mlx5_core_cq *cq int mlx5_init_cq_table(struct mlx5_core_dev *dev); void mlx5_cleanup_cq_table(struct mlx5_core_dev *dev); int mlx5_core_create_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, - struct mlx5_create_cq_mbox_in *in, int inlen); + u32 *in, int inlen); int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, - struct mlx5_query_cq_mbox_out *out); + u32 *out, int outlen); int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, - struct mlx5_modify_cq_mbox_in *in, int in_sz); + u32 *in, int inlen); int mlx5_core_modify_cq_moderation(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, u16 cq_period, u16 cq_max_count); Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Thu Mar 8 09:58:41 2018 (r330646) +++ head/sys/dev/mlx5/device.h Thu Mar 8 10:43:42 2018 (r330647) @@ -92,12 +92,21 @@ __mlx5_mask(typ, fld)) ___t; \ }) -#define MLX5_SET64(typ, p, fld, v) do { \ +#define __MLX5_SET64(typ, p, fld, v) do { \ BUILD_BUG_ON(__mlx5_bit_sz(typ, fld) != 64); \ - BUILD_BUG_ON(__mlx5_bit_off(typ, fld) % 64); \ *((__be64 *)(p) + __mlx5_64_off(typ, fld)) = cpu_to_be64(v); \ } while (0) +#define MLX5_SET64(typ, p, fld, v) do { \ + BUILD_BUG_ON(__mlx5_bit_off(typ, fld) % 64); \ + __MLX5_SET64(typ, p, fld, v); \ +} while (0) + +#define MLX5_ARRAY_SET64(typ, p, fld, idx, v) do { \ + BUILD_BUG_ON(__mlx5_bit_off(typ, fld) % 64); \ + __MLX5_SET64(typ, p, fld[idx], v); \ +} while (0) + #define MLX5_GET64(typ, p, fld) be64_to_cpu(*((__be64 *)(p) + __mlx5_64_off(typ, fld))) #define MLX5_GET64_BE(typ, p, fld) (*((__be64 *)(p) +\ @@ -366,30 +375,6 @@ enum { MLX5_MAX_SGE_RD = (512 - 16 - 16) / 16 }; -struct mlx5_inbox_hdr { - __be16 opcode; - u8 rsvd[4]; - __be16 opmod; -}; - -struct mlx5_outbox_hdr { - u8 status; - u8 rsvd[3]; - __be32 syndrome; -}; - -struct mlx5_cmd_set_dc_cnak_mbox_in { - struct mlx5_inbox_hdr hdr; - u8 enable; - u8 reserved[47]; - __be64 pa; -}; - -struct mlx5_cmd_set_dc_cnak_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; -}; - struct mlx5_cmd_layout { u8 type; u8 rsvd0[3]; @@ -405,7 +390,6 @@ struct mlx5_cmd_layout { u8 status_own; }; - struct mlx5_health_buffer { __be32 assert_var[5]; __be32 rsvd0[3]; @@ -736,211 +720,6 @@ struct mlx5_cqe128 { struct mlx5_cqe64 cqe64; }; -struct mlx5_srq_ctx { - u8 state_log_sz; - u8 rsvd0[3]; - __be32 flags_xrcd; - __be32 pgoff_cqn; - u8 rsvd1[4]; - u8 log_pg_sz; - u8 rsvd2[7]; - __be32 pd; - __be16 lwm; - __be16 wqe_cnt; - u8 rsvd3[8]; - __be64 db_record; -}; - -struct mlx5_create_srq_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 input_srqn; - u8 rsvd0[4]; - struct mlx5_srq_ctx ctx; - u8 rsvd1[208]; - __be64 pas[0]; -}; - -struct mlx5_create_srq_mbox_out { - struct mlx5_outbox_hdr hdr; - __be32 srqn; - u8 rsvd[4]; -}; - -struct mlx5_destroy_srq_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 srqn; - u8 rsvd[4]; -}; - -struct mlx5_destroy_srq_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; -}; - -struct mlx5_query_srq_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 srqn; - u8 rsvd0[4]; -}; - -struct mlx5_query_srq_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd0[8]; - struct mlx5_srq_ctx ctx; - u8 rsvd1[32]; - __be64 pas[0]; -}; - -struct mlx5_arm_srq_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 srqn; - __be16 rsvd; - __be16 lwm; -}; - -struct mlx5_arm_srq_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; -}; - -struct mlx5_cq_context { - u8 status; - u8 cqe_sz_flags; - u8 st; - u8 rsvd3; - u8 rsvd4[6]; - __be16 page_offset; - __be32 log_sz_usr_page; - __be16 cq_period; - __be16 cq_max_count; - __be16 rsvd20; - __be16 c_eqn; - u8 log_pg_sz; - u8 rsvd25[7]; - __be32 last_notified_index; - __be32 solicit_producer_index; - __be32 consumer_counter; - __be32 producer_counter; - u8 rsvd48[8]; - __be64 db_record_addr; -}; - -struct mlx5_create_cq_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 input_cqn; - u8 rsvdx[4]; - struct mlx5_cq_context ctx; - u8 rsvd6[192]; - __be64 pas[0]; -}; - -struct mlx5_create_cq_mbox_out { - struct mlx5_outbox_hdr hdr; - __be32 cqn; - u8 rsvd0[4]; -}; - -struct mlx5_destroy_cq_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 cqn; - u8 rsvd0[4]; -}; - -struct mlx5_destroy_cq_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd0[8]; -}; - -struct mlx5_query_cq_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 cqn; - u8 rsvd0[4]; -}; - -struct mlx5_query_cq_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd0[8]; - struct mlx5_cq_context ctx; - u8 rsvd6[16]; - __be64 pas[0]; -}; - -struct mlx5_modify_cq_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 cqn; - __be32 field_select; - struct mlx5_cq_context ctx; - u8 rsvd[192]; - __be64 pas[0]; -}; - -struct mlx5_modify_cq_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; -}; - -struct mlx5_eq_context { - u8 status; - u8 ec_oi; - u8 st; - u8 rsvd2[7]; - __be16 page_pffset; - __be32 log_sz_usr_page; - u8 rsvd3[7]; - u8 intr; - u8 log_page_size; - u8 rsvd4[15]; - __be32 consumer_counter; - __be32 produser_counter; - u8 rsvd5[16]; -}; - -struct mlx5_create_eq_mbox_in { - struct mlx5_inbox_hdr hdr; - u8 rsvd0[3]; - u8 input_eqn; - u8 rsvd1[4]; - struct mlx5_eq_context ctx; - u8 rsvd2[8]; - __be64 events_mask; - u8 rsvd3[176]; - __be64 pas[0]; -}; - -struct mlx5_create_eq_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd0[3]; - u8 eq_number; - u8 rsvd1[4]; -}; - -struct mlx5_map_eq_mbox_in { - struct mlx5_inbox_hdr hdr; - __be64 mask; - u8 mu; - u8 rsvd0[2]; - u8 eqn; - u8 rsvd1[24]; -}; - -struct mlx5_map_eq_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; -}; - -struct mlx5_query_eq_mbox_in { - struct mlx5_inbox_hdr hdr; - u8 rsvd0[3]; - u8 eqn; - u8 rsvd1[4]; -}; - -struct mlx5_query_eq_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; - struct mlx5_eq_context ctx; -}; - enum { MLX5_MKEY_STATUS_FREE = 1 << 6, }; @@ -967,121 +746,10 @@ struct mlx5_mkey_seg { u8 rsvd4[4]; }; -struct mlx5_query_special_ctxs_mbox_in { - struct mlx5_inbox_hdr hdr; - u8 rsvd[8]; -}; - -struct mlx5_query_special_ctxs_mbox_out { - struct mlx5_outbox_hdr hdr; - __be32 dump_fill_mkey; - __be32 reserved_lkey; -}; - -struct mlx5_create_mkey_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 input_mkey_index; - __be32 flags; - struct mlx5_mkey_seg seg; - u8 rsvd1[16]; - __be32 xlat_oct_act_size; - __be32 rsvd2; - u8 rsvd3[168]; - __be64 pas[0]; -}; - -struct mlx5_create_mkey_mbox_out { - struct mlx5_outbox_hdr hdr; - __be32 mkey; - u8 rsvd[4]; -}; - -struct mlx5_query_mkey_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 mkey; -}; - -struct mlx5_query_mkey_mbox_out { - struct mlx5_outbox_hdr hdr; - __be64 pas[0]; -}; - -struct mlx5_modify_mkey_mbox_in { - struct mlx5_inbox_hdr hdr; - __be32 mkey; - __be64 pas[0]; -}; - -struct mlx5_modify_mkey_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; -}; - -struct mlx5_dump_mkey_mbox_in { - struct mlx5_inbox_hdr hdr; -}; - -struct mlx5_dump_mkey_mbox_out { - struct mlx5_outbox_hdr hdr; - __be32 mkey; -}; - -struct mlx5_mad_ifc_mbox_in { - struct mlx5_inbox_hdr hdr; - __be16 remote_lid; - u8 rsvd0; - u8 port; - u8 rsvd1[4]; - u8 data[256]; -}; - -struct mlx5_mad_ifc_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; - u8 data[256]; -}; - -struct mlx5_access_reg_mbox_in { - struct mlx5_inbox_hdr hdr; - u8 rsvd0[2]; - __be16 register_id; - __be32 arg; - __be32 data[0]; -}; - -struct mlx5_access_reg_mbox_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; - __be32 data[0]; -}; - #define MLX5_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) enum { MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0 -}; - -struct mlx5_allocate_psv_in { - struct mlx5_inbox_hdr hdr; - __be32 npsv_pd; - __be32 rsvd_psv0; -}; - -struct mlx5_allocate_psv_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; - __be32 psv_idx[4]; -}; - -struct mlx5_destroy_psv_in { - struct mlx5_inbox_hdr hdr; - __be32 psv_number; - u8 rsvd[4]; -}; - -struct mlx5_destroy_psv_out { - struct mlx5_outbox_hdr hdr; - u8 rsvd[8]; }; static inline int mlx5_host_is_le(void) Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Thu Mar 8 09:58:41 2018 (r330646) +++ head/sys/dev/mlx5/driver.h Thu Mar 8 10:43:42 2018 (r330647) @@ -41,6 +41,7 @@ #include #include +#include #define MLX5_QCOUNTER_SETS_NETDEV 64 #define MLX5_MAX_NUMBER_OF_VFS 128 @@ -856,10 +857,8 @@ int mlx5_cmd_init(struct mlx5_core_dev *dev); void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); void mlx5_cmd_use_events(struct mlx5_core_dev *dev); void mlx5_cmd_use_polling(struct mlx5_core_dev *dev); -int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr); -int mlx5_cmd_status_to_err_v2(void *ptr); -int mlx5_core_get_caps(struct mlx5_core_dev *dev, enum mlx5_cap_type cap_type, - enum mlx5_cap_mode cap_mode); +void mlx5_cmd_mbox_status(void *out, u8 *status, u32 *syndrome); +int mlx5_core_get_caps(struct mlx5_core_dev *dev, enum mlx5_cap_type cap_type); int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, int out_size); int mlx5_cmd_exec_cb(struct mlx5_core_dev *dev, void *in, int in_size, @@ -883,23 +882,26 @@ int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size struct mlx5_buf *buf); void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_buf *buf); int mlx5_core_create_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, - struct mlx5_create_srq_mbox_in *in, int inlen, - int is_xrc); + struct mlx5_srq_attr *in); int mlx5_core_destroy_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq); int mlx5_core_query_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, - struct mlx5_query_srq_mbox_out *out); + struct mlx5_srq_attr *out); int mlx5_core_query_vendor_id(struct mlx5_core_dev *mdev, u32 *vendor_id); int mlx5_core_arm_srq(struct mlx5_core_dev *dev, struct mlx5_core_srq *srq, u16 lwm, int is_srq); void mlx5_init_mr_table(struct mlx5_core_dev *dev); void mlx5_cleanup_mr_table(struct mlx5_core_dev *dev); -int mlx5_core_create_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, - struct mlx5_create_mkey_mbox_in *in, int inlen, - mlx5_cmd_cbk_t callback, void *context, - struct mlx5_create_mkey_mbox_out *out); -int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr); -int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, - struct mlx5_query_mkey_mbox_out *out, int outlen); +int mlx5_core_create_mkey_cb(struct mlx5_core_dev *dev, + struct mlx5_core_mr *mkey, + u32 *in, int inlen, + u32 *out, int outlen, + mlx5_cmd_cbk_t callback, void *context); +int mlx5_core_create_mkey(struct mlx5_core_dev *dev, + struct mlx5_core_mr *mr, + u32 *in, int inlen); +int mlx5_core_destroy_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mkey); +int mlx5_core_query_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mkey, + u32 *out, int outlen); int mlx5_core_dump_fill_mkey(struct mlx5_core_dev *dev, struct mlx5_core_mr *mr, u32 *mkey); int mlx5_core_alloc_pd(struct mlx5_core_dev *dev, u32 *pdn); @@ -954,7 +956,7 @@ void mlx5_toggle_port_link(struct mlx5_core_dev *dev); int mlx5_debug_eq_add(struct mlx5_core_dev *dev, struct mlx5_eq *eq); void mlx5_debug_eq_remove(struct mlx5_core_dev *dev, struct mlx5_eq *eq); int mlx5_core_eq_query(struct mlx5_core_dev *dev, struct mlx5_eq *eq, - struct mlx5_query_eq_mbox_out *out, int outlen); + u32 *out, int outlen); int mlx5_eq_debugfs_init(struct mlx5_core_dev *dev); void mlx5_eq_debugfs_cleanup(struct mlx5_core_dev *dev); int mlx5_cq_debugfs_init(struct mlx5_core_dev *dev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Mar 8 09:58:41 2018 (r330646) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Mar 8 10:43:42 2018 (r330647) @@ -75,6 +75,26 @@ enum { MLX5_CMD_DELIVERY_STAT_CMD_DESCR_ERR = 0x10, }; +struct mlx5_ifc_mbox_out_bits { + u8 status[0x8]; + u8 reserved_at_8[0x18]; + + u8 syndrome[0x20]; + + u8 reserved_at_40[0x40]; +}; + +struct mlx5_ifc_mbox_in_bits { + u8 opcode[0x10]; + u8 reserved_at_10[0x10]; + + u8 reserved_at_20[0x10]; + u8 op_mod[0x10]; + + u8 reserved_at_40[0x40]; +}; + + static struct mlx5_cmd_work_ent *alloc_cmd(struct mlx5_cmd *cmd, struct mlx5_cmd_msg *in, int uin_size, @@ -588,11 +608,105 @@ const char *mlx5_command_str(int command) } } +static const char *cmd_status_str(u8 status) +{ + switch (status) { + case MLX5_CMD_STAT_OK: + return "OK"; + case MLX5_CMD_STAT_INT_ERR: + return "internal error"; + case MLX5_CMD_STAT_BAD_OP_ERR: + return "bad operation"; + case MLX5_CMD_STAT_BAD_PARAM_ERR: + return "bad parameter"; + case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: + return "bad system state"; + case MLX5_CMD_STAT_BAD_RES_ERR: + return "bad resource"; + case MLX5_CMD_STAT_RES_BUSY: + return "resource busy"; + case MLX5_CMD_STAT_LIM_ERR: + return "limits exceeded"; + case MLX5_CMD_STAT_BAD_RES_STATE_ERR: + return "bad resource state"; + case MLX5_CMD_STAT_IX_ERR: + return "bad index"; + case MLX5_CMD_STAT_NO_RES_ERR: + return "no resources"; + case MLX5_CMD_STAT_BAD_INP_LEN_ERR: + return "bad input length"; + case MLX5_CMD_STAT_BAD_OUTP_LEN_ERR: + return "bad output length"; + case MLX5_CMD_STAT_BAD_QP_STATE_ERR: + return "bad QP state"; + case MLX5_CMD_STAT_BAD_PKT_ERR: + return "bad packet (discarded)"; + case MLX5_CMD_STAT_BAD_SIZE_OUTS_CQES_ERR: + return "bad size too many outstanding CQEs"; + default: + return "unknown status"; + } +} + +static int cmd_status_to_err_helper(u8 status) +{ + switch (status) { + case MLX5_CMD_STAT_OK: return 0; + case MLX5_CMD_STAT_INT_ERR: return -EIO; + case MLX5_CMD_STAT_BAD_OP_ERR: return -EINVAL; + case MLX5_CMD_STAT_BAD_PARAM_ERR: return -EINVAL; + case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: return -EIO; + case MLX5_CMD_STAT_BAD_RES_ERR: return -EINVAL; + case MLX5_CMD_STAT_RES_BUSY: return -EBUSY; + case MLX5_CMD_STAT_LIM_ERR: return -ENOMEM; + case MLX5_CMD_STAT_BAD_RES_STATE_ERR: return -EINVAL; + case MLX5_CMD_STAT_IX_ERR: return -EINVAL; + case MLX5_CMD_STAT_NO_RES_ERR: return -EAGAIN; + case MLX5_CMD_STAT_BAD_INP_LEN_ERR: return -EIO; + case MLX5_CMD_STAT_BAD_OUTP_LEN_ERR: return -EIO; + case MLX5_CMD_STAT_BAD_QP_STATE_ERR: return -EINVAL; + case MLX5_CMD_STAT_BAD_PKT_ERR: return -EINVAL; + case MLX5_CMD_STAT_BAD_SIZE_OUTS_CQES_ERR: return -EINVAL; + default: return -EIO; + } +} + +void mlx5_cmd_mbox_status(void *out, u8 *status, u32 *syndrome) +{ + *status = MLX5_GET(mbox_out, out, status); + *syndrome = MLX5_GET(mbox_out, out, syndrome); +} + +static int mlx5_cmd_check(struct mlx5_core_dev *dev, void *in, void *out) +{ + u32 syndrome; + u8 status; + u16 opcode; + u16 op_mod; + + mlx5_cmd_mbox_status(out, &status, &syndrome); + if (!status) + return 0; + + opcode = MLX5_GET(mbox_in, in, opcode); + op_mod = MLX5_GET(mbox_in, in, op_mod); + + mlx5_core_err(dev, + "%s(0x%x) op_mod(0x%x) failed, status %s(0x%x), syndrome (0x%x)\n", + mlx5_command_str(opcode), + opcode, op_mod, + cmd_status_str(status), + status, + syndrome); + + return cmd_status_to_err_helper(status); +} + static void dump_command(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent, int input) { - u16 op = be16_to_cpu(((struct mlx5_inbox_hdr *)(ent->lay->in))->opcode); struct mlx5_cmd_msg *msg = input ? ent->in : ent->out; + u16 op = MLX5_GET(mbox_in, ent->lay->in, opcode); size_t i; int data_only; int offset = 0; @@ -654,9 +768,7 @@ static void dump_command(struct mlx5_core_dev *dev, static u16 msg_to_opcode(struct mlx5_cmd_msg *in) { - struct mlx5_inbox_hdr *hdr = (struct mlx5_inbox_hdr *)(in->first.data); - - return be16_to_cpu(hdr->opcode); + return MLX5_GET(mbox_in, in->first.data, opcode); } static void cb_timeout_handler(struct work_struct *work) @@ -676,173 +788,6 @@ static void cb_timeout_handler(struct work_struct *wor mlx5_cmd_comp_handler(dev, 1UL << ent->idx); } -static int set_internal_err_outbox(struct mlx5_core_dev *dev, u16 opcode, - struct mlx5_outbox_hdr *hdr) -{ - hdr->status = 0; - hdr->syndrome = 0; - - switch (opcode) { - case MLX5_CMD_OP_TEARDOWN_HCA: - case MLX5_CMD_OP_DISABLE_HCA: - case MLX5_CMD_OP_MANAGE_PAGES: - case MLX5_CMD_OP_DESTROY_MKEY: - case MLX5_CMD_OP_DESTROY_EQ: - case MLX5_CMD_OP_DESTROY_CQ: - case MLX5_CMD_OP_DESTROY_QP: - case MLX5_CMD_OP_DESTROY_PSV: - case MLX5_CMD_OP_DESTROY_SRQ: - case MLX5_CMD_OP_DESTROY_XRC_SRQ: - case MLX5_CMD_OP_DESTROY_DCT: - case MLX5_CMD_OP_DEALLOC_Q_COUNTER: - case MLX5_CMD_OP_DEALLOC_PD: - case MLX5_CMD_OP_DEALLOC_UAR: - case MLX5_CMD_OP_DETACH_FROM_MCG: - case MLX5_CMD_OP_DEALLOC_XRCD: - case MLX5_CMD_OP_DEALLOC_TRANSPORT_DOMAIN: - case MLX5_CMD_OP_DELETE_VXLAN_UDP_DPORT: - case MLX5_CMD_OP_DELETE_L2_TABLE_ENTRY: - case MLX5_CMD_OP_DESTROY_LAG: - case MLX5_CMD_OP_DESTROY_VPORT_LAG: - case MLX5_CMD_OP_DESTROY_TIR: - case MLX5_CMD_OP_DESTROY_SQ: - case MLX5_CMD_OP_DESTROY_RQ: - case MLX5_CMD_OP_DESTROY_RMP: - case MLX5_CMD_OP_DESTROY_TIS: - case MLX5_CMD_OP_DESTROY_RQT: - case MLX5_CMD_OP_DESTROY_FLOW_TABLE: - case MLX5_CMD_OP_DESTROY_FLOW_GROUP: - case MLX5_CMD_OP_DELETE_FLOW_TABLE_ENTRY: - case MLX5_CMD_OP_DEALLOC_FLOW_COUNTER: - case MLX5_CMD_OP_2ERR_QP: - case MLX5_CMD_OP_2RST_QP: - case MLX5_CMD_OP_MODIFY_NIC_VPORT_CONTEXT: - case MLX5_CMD_OP_MODIFY_FLOW_TABLE: - case MLX5_CMD_OP_SET_FLOW_TABLE_ENTRY: - case MLX5_CMD_OP_SET_FLOW_TABLE_ROOT: - case MLX5_CMD_OP_DEALLOC_ENCAP_HEADER: - case MLX5_CMD_OP_DESTROY_SCHEDULING_ELEMENT: - case MLX5_CMD_OP_DESTROY_QOS_PARA_VPORT: - case MLX5_CMD_OP_MODIFY_VPORT_STATE: - case MLX5_CMD_OP_MODIFY_SQ: - case MLX5_CMD_OP_MODIFY_RQ: - case MLX5_CMD_OP_MODIFY_TIS: - case MLX5_CMD_OP_MODIFY_LAG: - case MLX5_CMD_OP_MODIFY_TIR: - case MLX5_CMD_OP_MODIFY_RMP: - case MLX5_CMD_OP_MODIFY_RQT: - case MLX5_CMD_OP_MODIFY_SCHEDULING_ELEMENT: - case MLX5_CMD_OP_MODIFY_CONG_PARAMS: - case MLX5_CMD_OP_MODIFY_CONG_STATUS: - case MLX5_CMD_OP_MODIFY_CQ: - case MLX5_CMD_OP_MODIFY_ESW_VPORT_CONTEXT: - case MLX5_CMD_OP_MODIFY_HCA_VPORT_CONTEXT: - case MLX5_CMD_OP_MODIFY_OTHER_HCA_CAP: - case MLX5_CMD_OP_ACCESS_REG: - case MLX5_CMD_OP_DRAIN_DCT: - return 0; - - case MLX5_CMD_OP_ADD_VXLAN_UDP_DPORT: - case MLX5_CMD_OP_ALLOC_ENCAP_HEADER: - case MLX5_CMD_OP_ALLOC_FLOW_COUNTER: - case MLX5_CMD_OP_ALLOC_PD: - case MLX5_CMD_OP_ALLOC_Q_COUNTER: - case MLX5_CMD_OP_ALLOC_TRANSPORT_DOMAIN: - case MLX5_CMD_OP_ALLOC_UAR: - case MLX5_CMD_OP_ALLOC_XRCD: - case MLX5_CMD_OP_ARM_DCT_FOR_KEY_VIOLATION: - case MLX5_CMD_OP_ARM_RQ: - case MLX5_CMD_OP_ARM_XRC_SRQ: - case MLX5_CMD_OP_ATTACH_TO_MCG: - case MLX5_CMD_OP_CONFIG_INT_MODERATION: - case MLX5_CMD_OP_CREATE_CQ: - case MLX5_CMD_OP_CREATE_DCT: - case MLX5_CMD_OP_CREATE_EQ: - case MLX5_CMD_OP_CREATE_FLOW_GROUP: - case MLX5_CMD_OP_CREATE_FLOW_TABLE: - case MLX5_CMD_OP_CREATE_LAG: - case MLX5_CMD_OP_CREATE_MKEY: - case MLX5_CMD_OP_CREATE_PSV: - case MLX5_CMD_OP_CREATE_QOS_PARA_VPORT: - case MLX5_CMD_OP_CREATE_QP: - case MLX5_CMD_OP_CREATE_RMP: - case MLX5_CMD_OP_CREATE_RQ: - case MLX5_CMD_OP_CREATE_RQT: - case MLX5_CMD_OP_CREATE_SCHEDULING_ELEMENT: - case MLX5_CMD_OP_CREATE_SQ: - case MLX5_CMD_OP_CREATE_SRQ: - case MLX5_CMD_OP_CREATE_TIR: - case MLX5_CMD_OP_CREATE_TIS: - case MLX5_CMD_OP_CREATE_VPORT_LAG: - case MLX5_CMD_OP_CREATE_XRC_SRQ: - case MLX5_CMD_OP_ENABLE_HCA: - case MLX5_CMD_OP_GEN_EQE: - case MLX5_CMD_OP_GET_DROPPED_PACKET_LOG: - case MLX5_CMD_OP_INIT2INIT_QP: - case MLX5_CMD_OP_INIT2RTR_QP: - case MLX5_CMD_OP_INIT_HCA: - case MLX5_CMD_OP_MAD_IFC: - case MLX5_CMD_OP_NOP: - case MLX5_CMD_OP_PAGE_FAULT_RESUME: - case MLX5_CMD_OP_QUERY_ADAPTER: - case MLX5_CMD_OP_QUERY_CONG_PARAMS: - case MLX5_CMD_OP_QUERY_CONG_STATISTICS: - case MLX5_CMD_OP_QUERY_CONG_STATUS: - case MLX5_CMD_OP_QUERY_CQ: - case MLX5_CMD_OP_QUERY_DCT: - case MLX5_CMD_OP_QUERY_EQ: - case MLX5_CMD_OP_QUERY_ESW_VPORT_CONTEXT: - case MLX5_CMD_OP_QUERY_FLOW_COUNTER: - case MLX5_CMD_OP_QUERY_FLOW_GROUP: - case MLX5_CMD_OP_QUERY_FLOW_TABLE: - case MLX5_CMD_OP_QUERY_FLOW_TABLE_ENTRY: - case MLX5_CMD_OP_QUERY_HCA_CAP: - case MLX5_CMD_OP_QUERY_HCA_VPORT_CONTEXT: - case MLX5_CMD_OP_QUERY_HCA_VPORT_GID: - case MLX5_CMD_OP_QUERY_HCA_VPORT_PKEY: - case MLX5_CMD_OP_QUERY_ISSI: - case MLX5_CMD_OP_QUERY_L2_TABLE_ENTRY: - case MLX5_CMD_OP_QUERY_LAG: - case MLX5_CMD_OP_QUERY_MAD_DEMUX: - case MLX5_CMD_OP_QUERY_MKEY: - case MLX5_CMD_OP_QUERY_NIC_VPORT_CONTEXT: - case MLX5_CMD_OP_QUERY_OTHER_HCA_CAP: - case MLX5_CMD_OP_QUERY_PAGES: - case MLX5_CMD_OP_QUERY_QP: - case MLX5_CMD_OP_QUERY_Q_COUNTER: - case MLX5_CMD_OP_QUERY_RMP: - case MLX5_CMD_OP_QUERY_ROCE_ADDRESS: - case MLX5_CMD_OP_QUERY_RQ: - case MLX5_CMD_OP_QUERY_RQT: - case MLX5_CMD_OP_QUERY_SCHEDULING_ELEMENT: - case MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS: - case MLX5_CMD_OP_QUERY_SQ: - case MLX5_CMD_OP_QUERY_SRQ: - case MLX5_CMD_OP_QUERY_TIR: - case MLX5_CMD_OP_QUERY_TIS: - case MLX5_CMD_OP_QUERY_VPORT_COUNTER: - case MLX5_CMD_OP_QUERY_VPORT_STATE: - case MLX5_CMD_OP_QUERY_XRC_SRQ: - case MLX5_CMD_OP_RST2INIT_QP: - case MLX5_CMD_OP_RTR2RTS_QP: - case MLX5_CMD_OP_RTS2RTS_QP: - case MLX5_CMD_OP_SET_DC_CNAK_TRACE: - case MLX5_CMD_OP_SET_HCA_CAP: - case MLX5_CMD_OP_SET_ISSI: - case MLX5_CMD_OP_SET_L2_TABLE_ENTRY: - case MLX5_CMD_OP_SET_MAD_DEMUX: - case MLX5_CMD_OP_SET_ROCE_ADDRESS: - case MLX5_CMD_OP_SQD_RTS_QP: - case MLX5_CMD_OP_SQERR2RTS_QP: - hdr->status = MLX5_CMD_STAT_INT_ERR; - hdr->syndrome = 0xFFFFFFFF; - return -ECANCELED; - default: - mlx5_core_err(dev, "Unknown FW command (%d)\n", opcode); - return -EINVAL; - } -} - static void complete_command(struct mlx5_cmd_work_ent *ent) { struct mlx5_cmd *cmd = ent->cmd; @@ -863,15 +808,12 @@ static void complete_command(struct mlx5_cmd_work_ent sem = &cmd->sem; if (dev->state != MLX5_DEVICE_STATE_UP) { - struct mlx5_outbox_hdr *out_hdr = - (struct mlx5_outbox_hdr *)ent->out; - struct mlx5_inbox_hdr *in_hdr = - (struct mlx5_inbox_hdr *)(ent->in->first.data); - u16 opcode = be16_to_cpu(in_hdr->opcode); + u8 status = 0; + u32 drv_synd; - ent->ret = set_internal_err_outbox(dev, - opcode, - out_hdr); + ent->ret = mlx5_internal_err_ret_value(dev, msg_to_opcode(ent->in), &drv_synd, &status); + MLX5_SET(mbox_out, ent->out, status, status); + MLX5_SET(mbox_out, ent->out, syndrome, drv_synd); } if (ent->callback) { @@ -887,10 +829,14 @@ static void complete_command(struct mlx5_cmd_work_ent callback = ent->callback; context = ent->context; err = ent->ret; - if (!err) + if (!err) { err = mlx5_copy_from_msg(ent->uout, ent->out, ent->uout_size); + err = err ? err : mlx5_cmd_check(dev, + ent->in->first.data, + ent->uout); + } mlx5_free_cmd_msg(dev, ent->out); free_msg(dev, ent->in); @@ -1014,16 +960,6 @@ static int wait_func(struct mlx5_core_dev *dev, struct return err; } -static __be32 *get_synd_ptr(struct mlx5_outbox_hdr *out) -{ - return &out->syndrome; -} - -static u8 *get_status_ptr(struct mlx5_outbox_hdr *out) -{ - return &out->status; -} - /* Notes: * 1. Callback functions may not sleep * 2. page queue commands do not support asynchrous completion @@ -1070,7 +1006,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, goto out; ds = ent->ts2 - ent->ts1; - op = be16_to_cpu(((struct mlx5_inbox_hdr *)in->first.data)->opcode); + op = MLX5_GET(mbox_in, in->first.data, opcode); if (op < ARRAY_SIZE(cmd->stats)) { stats = &cmd->stats[op]; spin_lock_irq(&stats->lock); @@ -1315,16 +1251,11 @@ static struct mlx5_cmd_msg *alloc_msg(struct mlx5_core return msg; } -static u16 opcode_from_in(struct mlx5_inbox_hdr *in) +static int is_manage_pages(void *in) { - return be16_to_cpu(in->opcode); + return MLX5_GET(mbox_in, in, opcode) == MLX5_CMD_OP_MANAGE_PAGES; } -static int is_manage_pages(struct mlx5_inbox_hdr *in) -{ - return be16_to_cpu(in->opcode) == MLX5_CMD_OP_MANAGE_PAGES; -} - static int cmd_exec_helper(struct mlx5_core_dev *dev, void *in, int in_size, void *out, int out_size, @@ -1340,9 +1271,10 @@ static int cmd_exec_helper(struct mlx5_core_dev *dev, if (pci_channel_offline(dev->pdev) || dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) { - err = mlx5_internal_err_ret_value(dev, opcode_from_in(in), &drv_synd, &status); - *get_synd_ptr(out) = cpu_to_be32(drv_synd); - *get_status_ptr(out) = status; + u16 opcode = MLX5_GET(mbox_in, in, opcode); + err = mlx5_internal_err_ret_value(dev, opcode, &drv_synd, &status); + MLX5_SET(mbox_out, out, status, status); + MLX5_SET(mbox_out, out, syndrome, drv_synd); return err; } @@ -1396,7 +1328,10 @@ out_in: int mlx5_cmd_exec(struct mlx5_core_dev *dev, void *in, int in_size, void *out, int out_size) { - return cmd_exec_helper(dev, in, in_size, out, out_size, NULL, NULL); + int err; + + err = cmd_exec_helper(dev, in, in_size, out, out_size, NULL, NULL); + return err ? : mlx5_cmd_check(dev, in, out); } EXPORT_SYMBOL(mlx5_cmd_exec); @@ -1631,94 +1566,3 @@ void mlx5_cmd_cleanup(struct mlx5_core_dev *dev) free_cmd_page(dev, cmd); } EXPORT_SYMBOL(mlx5_cmd_cleanup); - -static const char *cmd_status_str(u8 status) -{ - switch (status) { - case MLX5_CMD_STAT_OK: - return "OK"; - case MLX5_CMD_STAT_INT_ERR: - return "internal error"; - case MLX5_CMD_STAT_BAD_OP_ERR: - return "bad operation"; - case MLX5_CMD_STAT_BAD_PARAM_ERR: - return "bad parameter"; - case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: - return "bad system state"; - case MLX5_CMD_STAT_BAD_RES_ERR: - return "bad resource"; - case MLX5_CMD_STAT_RES_BUSY: - return "resource busy"; - case MLX5_CMD_STAT_LIM_ERR: - return "limits exceeded"; - case MLX5_CMD_STAT_BAD_RES_STATE_ERR: - return "bad resource state"; - case MLX5_CMD_STAT_IX_ERR: - return "bad index"; - case MLX5_CMD_STAT_NO_RES_ERR: - return "no resources"; - case MLX5_CMD_STAT_BAD_INP_LEN_ERR: - return "bad input length"; - case MLX5_CMD_STAT_BAD_OUTP_LEN_ERR: - return "bad output length"; - case MLX5_CMD_STAT_BAD_QP_STATE_ERR: - return "bad QP state"; - case MLX5_CMD_STAT_BAD_PKT_ERR: - return "bad packet (discarded)"; - case MLX5_CMD_STAT_BAD_SIZE_OUTS_CQES_ERR: - return "bad size too many outstanding CQEs"; - default: - return "unknown status"; - } -} - -static int cmd_status_to_err_helper(u8 status) -{ - switch (status) { - case MLX5_CMD_STAT_OK: return 0; - case MLX5_CMD_STAT_INT_ERR: return -EIO; - case MLX5_CMD_STAT_BAD_OP_ERR: return -EINVAL; - case MLX5_CMD_STAT_BAD_PARAM_ERR: return -EINVAL; - case MLX5_CMD_STAT_BAD_SYS_STATE_ERR: return -EIO; - case MLX5_CMD_STAT_BAD_RES_ERR: return -EINVAL; - case MLX5_CMD_STAT_RES_BUSY: return -EBUSY; - case MLX5_CMD_STAT_LIM_ERR: return -ENOMEM; - case MLX5_CMD_STAT_BAD_RES_STATE_ERR: return -EINVAL; - case MLX5_CMD_STAT_IX_ERR: return -EINVAL; - case MLX5_CMD_STAT_NO_RES_ERR: return -EAGAIN; - case MLX5_CMD_STAT_BAD_INP_LEN_ERR: return -EIO; - case MLX5_CMD_STAT_BAD_OUTP_LEN_ERR: return -EIO; - case MLX5_CMD_STAT_BAD_QP_STATE_ERR: return -EINVAL; - case MLX5_CMD_STAT_BAD_PKT_ERR: return -EINVAL; - case MLX5_CMD_STAT_BAD_SIZE_OUTS_CQES_ERR: return -EINVAL; - default: return -EIO; - } -} - -/* this will be available till all the commands use set/get macros */ -int mlx5_cmd_status_to_err(struct mlx5_outbox_hdr *hdr) -{ - if (!hdr->status) - return 0; - - printf("mlx5_core: WARN: ""command failed, status %s(0x%x), syndrome 0x%x\n", cmd_status_str(hdr->status), hdr->status, be32_to_cpu(hdr->syndrome)); - - return cmd_status_to_err_helper(hdr->status); -} - -int mlx5_cmd_status_to_err_v2(void *ptr) -{ - u32 syndrome; - u8 status; - - status = be32_to_cpu(*(__be32 *)ptr) >> 24; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Mar 8 11:23: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 8A830F4D8EE; Thu, 8 Mar 2018 11:23:15 +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 2D75875427; Thu, 8 Mar 2018 11:23:15 +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 0A6511024E; Thu, 8 Mar 2018 11:23:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28BNFw9080567; Thu, 8 Mar 2018 11:23:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28BNE6M080559; Thu, 8 Mar 2018 11:23:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081123.w28BNE6M080559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 11:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330648 - in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_ib modules/mlx5ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core dev/mlx5/mlx5_ib modules/mlx5ib X-SVN-Commit-Revision: 330648 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:23:15 -0000 Author: hselasky Date: Thu Mar 8 11:23:14 2018 New Revision: 330648 URL: https://svnweb.freebsd.org/changeset/base/330648 Log: Add support for explicit congestion notification, ECN, to mlx5ib(4). ECN configuration and statistics is available through a set of sysctl(8) nodes under sys.class.infiniband.mlx5_X.cong . The ECN configuration nodes can also be used as loader tunables. MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/sys/dev/mlx5/cmd.h (contents, props changed) head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/modules/mlx5ib/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Mar 8 10:43:42 2018 (r330647) +++ head/sys/conf/files Thu Mar 8 11:23:14 2018 (r330648) @@ -4692,6 +4692,8 @@ dev/mlx4/mlx4_en/mlx4_en_tx.c optional mlx4en pci in dev/mlx5/mlx5_ib/mlx5_ib_ah.c optional mlx5ib pci ofed \ compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_cong.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" dev/mlx5/mlx5_ib/mlx5_ib_cq.c optional mlx5ib pci ofed \ compile-with "${OFED_C}" dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c optional mlx5ib pci ofed \ Added: head/sys/dev/mlx5/cmd.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/cmd.h Thu Mar 8 11:23:14 2018 (r330648) @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef MLX5_CMD_H +#define MLX5_CMD_H + +#include + +struct manage_pages_layout { + u64 ptr; + u32 reserved; + u16 num_entries; + u16 func_id; +}; + + +struct mlx5_cmd_alloc_uar_imm_out { + u32 rsvd[3]; + u32 uarn; +}; + +struct mlx5_core_dev; +int mlx5_cmd_query_cong_counter(struct mlx5_core_dev *dev, + bool reset, void *out, int out_size); +int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point, + void *out, int out_size); +int mlx5_cmd_modify_cong_params(struct mlx5_core_dev *mdev, + void *in, int in_size); +struct mlx5_core_dev; +int mlx5_cmd_query_cong_counter(struct mlx5_core_dev *dev, + bool reset, void *out, int out_size); +int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point, + void *out, int out_size); +int mlx5_cmd_modify_cong_params(struct mlx5_core_dev *mdev, + void *in, int in_size); +#endif /* MLX5_CMD_H */ Modified: head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Mar 8 10:43:42 2018 (r330647) +++ head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c Thu Mar 8 11:23:14 2018 (r330648) @@ -36,6 +36,7 @@ #include #include #include +#include #include "mlx5_core.h" @@ -1566,3 +1567,37 @@ void mlx5_cmd_cleanup(struct mlx5_core_dev *dev) free_cmd_page(dev, cmd); } EXPORT_SYMBOL(mlx5_cmd_cleanup); + +int mlx5_cmd_query_cong_counter(struct mlx5_core_dev *dev, + bool reset, void *out, int out_size) +{ + u32 in[MLX5_ST_SZ_DW(query_cong_statistics_in)] = { }; + + MLX5_SET(query_cong_statistics_in, in, opcode, + MLX5_CMD_OP_QUERY_CONG_STATISTICS); + MLX5_SET(query_cong_statistics_in, in, clear, reset); + return mlx5_cmd_exec(dev, in, sizeof(in), out, out_size); +} +EXPORT_SYMBOL(mlx5_cmd_query_cong_counter); + +int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point, + void *out, int out_size) +{ + u32 in[MLX5_ST_SZ_DW(query_cong_params_in)] = { }; + + MLX5_SET(query_cong_params_in, in, opcode, + MLX5_CMD_OP_QUERY_CONG_PARAMS); + MLX5_SET(query_cong_params_in, in, cong_protocol, cong_point); + + return mlx5_cmd_exec(dev, in, sizeof(in), out, out_size); +} +EXPORT_SYMBOL(mlx5_cmd_query_cong_params); + +int mlx5_cmd_modify_cong_params(struct mlx5_core_dev *dev, + void *in, int in_size) +{ + u32 out[MLX5_ST_SZ_DW(modify_cong_params_out)] = { }; + + return mlx5_cmd_exec(dev, in, in_size, out, sizeof(out)); +} +EXPORT_SYMBOL(mlx5_cmd_modify_cong_params); Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Thu Mar 8 10:43:42 2018 (r330647) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h Thu Mar 8 11:23:14 2018 (r330648) @@ -605,6 +605,56 @@ struct mlx5_roce { atomic_t next_port; }; +#define MLX5_IB_STATS_COUNT(a,b,c,d) a +#define MLX5_IB_STATS_VAR(a,b,c,d) b; +#define MLX5_IB_STATS_DESC(a,b,c,d) c, d, + +#define MLX5_IB_CONG_PARAMS(m) \ + /* ECN RP */ \ + m(+1, u64 rp_clamp_tgt_rate, "rp_clamp_tgt_rate", "If set, whenever a CNP is processed, the target rate is updated to be the current rate") \ + m(+1, u64 rp_clamp_tgt_rate_ati, "rp_clamp_tgt_rate_ati", "If set, when receiving a CNP, the target rate should be updated if the transission rate was increased due to the timer, and not only due to the byte counter") \ + m(+1, u64 rp_time_reset, "rp_time_reset", "Time in microseconds between rate increases if no CNPs are received") \ + m(+1, u64 rp_byte_reset, "rp_byte_reset", "Transmitted data in bytes between rate increases if no CNP's are received. A value of zero means disabled.") \ + m(+1, u64 rp_threshold, "rp_threshold", "The number of times rpByteStage or rpTimeStage can count before the RP rate control state machine advances states") \ + m(+1, u64 rp_ai_rate, "rp_ai_rate", "The rate, in Mbits per second, used to increase rpTargetRate in the active increase state") \ + m(+1, u64 rp_hai_rate, "rp_hai_rate", "The rate, in Mbits per second, used to increase rpTargetRate in the hyper increase state") \ + m(+1, u64 rp_min_dec_fac, "rp_min_dec_fac", "The minimum factor by which the current transmit rate can be changed when processing a CNP. Value is given as a percentage, [1 .. 100]") \ + m(+1, u64 rp_min_rate, "rp_min_rate", "The minimum value, in Mbps per second, for rate to limit") \ + m(+1, u64 rp_rate_to_set_on_first_cnp, "rp_rate_to_set_on_first_cnp", "The rate that is set for the flow when a rate limiter is allocated to it upon first CNP received, in Mbps. A value of zero means use full port speed") \ + m(+1, u64 rp_dce_tcp_g, "rp_dce_tcp_g", "Used to update the congestion estimator, alpha, once every dce_tcp_rtt once every dce_tcp_rtt microseconds") \ + m(+1, u64 rp_dce_tcp_rtt, "rp_dce_tcp_rtt", "The time between updates of the aolpha value, in microseconds") \ + m(+1, u64 rp_rate_reduce_monitor_period, "rp_rate_reduce_monitor_period", "The minimum time between two consecutive rate reductions for a single flow") \ + m(+1, u64 rp_initial_alpha_value, "rp_initial_alpha_value", "The initial value of alpha to use when receiving the first CNP for a flow") \ + m(+1, u64 rp_gd, "rp_gd", "If a CNP is received, the flow rate is reduced at the beginning of the next rate_reduce_monitor_period interval") \ + /* ECN NP */ \ + m(+1, u64 np_cnp_dscp, "np_cnp_dscp", "The DiffServ Code Point of the generated CNP for this port") \ + m(+1, u64 np_cnp_prio_mode, "np_cnp_prio_mode", "The 802.1p priority value of the generated CNP for this port") \ + m(+1, u64 np_cnp_prio, "np_cnp_prio", "The 802.1p priority value of the generated CNP for this port") + +#define MLX5_IB_CONG_PARAMS_NUM (0 MLX5_IB_CONG_PARAMS(MLX5_IB_STATS_COUNT)) + +#define MLX5_IB_CONG_STATS(m) \ + m(+1, u64 syndrome, "syndrome", "Syndrome number") \ + m(+1, u64 rp_cur_flows, "rp_cur_flows", "Number of flows limited") \ + m(+1, u64 sum_flows, "sum_flows", "Sum of the number of flows limited over time") \ + m(+1, u64 rp_cnp_ignored, "rp_cnp_ignored", "Number of CNPs and CNMs ignored") \ + m(+1, u64 rp_cnp_handled, "rp_cnp_handled", "Number of CNPs and CNMs successfully handled") \ + m(+1, u64 time_stamp, "time_stamp", "Time stamp in microseconds") \ + m(+1, u64 accumulators_period, "accumulators_period", "The value of X variable for accumulating counters") \ + m(+1, u64 np_ecn_marked_roce_packets, "np_ecn_marked_roce_packets", "Number of ECN marked packets seen") \ + m(+1, u64 np_cnp_sent, "np_cnp_sent", "Number of CNPs sent") + +#define MLX5_IB_CONG_STATS_NUM (0 MLX5_IB_CONG_STATS(MLX5_IB_STATS_COUNT)) + +struct mlx5_ib_congestion { + struct sysctl_ctx_list ctx; + struct sx lock; + struct delayed_work dwork; + u64 arg [0]; + MLX5_IB_CONG_PARAMS(MLX5_IB_STATS_VAR) + MLX5_IB_CONG_STATS(MLX5_IB_STATS_VAR) +}; + struct mlx5_ib_dev { struct ib_device ib_dev; struct mlx5_core_dev *mdev; @@ -638,6 +688,7 @@ struct mlx5_ib_dev { struct list_head qp_list; /* Array with num_ports elements */ struct mlx5_ib_port *port; + struct mlx5_ib_congestion congestion; }; static inline struct mlx5_ib_cq *to_mibcq(struct mlx5_core_cq *mcq) @@ -991,4 +1042,8 @@ static inline int get_srq_user_index(struct mlx5_ib_uc return verify_assign_uidx(cqe_version, ucmd->uidx, user_index); } + +void mlx5_ib_cleanup_congestion(struct mlx5_ib_dev *); +int mlx5_ib_init_congestion(struct mlx5_ib_dev *); + #endif /* MLX5_IB_H */ Added: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cong.c Thu Mar 8 11:23:14 2018 (r330648) @@ -0,0 +1,460 @@ +/*- + * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "mlx5_ib.h" + +#include + +static const char *mlx5_ib_cong_params_desc[] = { + MLX5_IB_CONG_PARAMS(MLX5_IB_STATS_DESC) +}; + +static const char *mlx5_ib_cong_stats_desc[] = { + MLX5_IB_CONG_STATS(MLX5_IB_STATS_DESC) +}; + +#define MLX5_IB_INDEX(field) (__offsetof(struct mlx5_ib_congestion, field) / sizeof(u64)) +#define MLX5_IB_FLD_MAX(type, field) ((1ULL << __mlx5_bit_sz(type, field)) - 1ULL) +#define MLX5_IB_SET_CLIPPED(type, ptr, field, var) do { \ + /* rangecheck */ \ + if ((var) > MLX5_IB_FLD_MAX(type, field)) \ + (var) = MLX5_IB_FLD_MAX(type, field); \ + /* set value */ \ + MLX5_SET(type, ptr, field, var); \ +} while (0) + +#define CONG_LOCK(dev) sx_xlock(&(dev)->congestion.lock) +#define CONG_UNLOCK(dev) sx_xunlock(&(dev)->congestion.lock) +#define CONG_LOCKED(dev) sx_xlocked(&(dev)->congestion.lock) + +#define MLX5_IB_RP_CLAMP_TGT_RATE_ATTR BIT(1) +#define MLX5_IB_RP_CLAMP_TGT_RATE_ATI_ATTR BIT(2) +#define MLX5_IB_RP_TIME_RESET_ATTR BIT(3) +#define MLX5_IB_RP_BYTE_RESET_ATTR BIT(4) +#define MLX5_IB_RP_THRESHOLD_ATTR BIT(5) +#define MLX5_IB_RP_AI_RATE_ATTR BIT(7) +#define MLX5_IB_RP_HAI_RATE_ATTR BIT(8) +#define MLX5_IB_RP_MIN_DEC_FAC_ATTR BIT(9) +#define MLX5_IB_RP_MIN_RATE_ATTR BIT(10) +#define MLX5_IB_RP_RATE_TO_SET_ON_FIRST_CNP_ATTR BIT(11) +#define MLX5_IB_RP_DCE_TCP_G_ATTR BIT(12) +#define MLX5_IB_RP_DCE_TCP_RTT_ATTR BIT(13) +#define MLX5_IB_RP_RATE_REDUCE_MONITOR_PERIOD_ATTR BIT(14) +#define MLX5_IB_RP_INITIAL_ALPHA_VALUE_ATTR BIT(15) +#define MLX5_IB_RP_GD_ATTR BIT(16) + +#define MLX5_IB_NP_CNP_DSCP_ATTR BIT(3) +#define MLX5_IB_NP_CNP_PRIO_MODE_ATTR BIT(4) + +enum mlx5_ib_cong_node_type { + MLX5_IB_RROCE_ECN_RP = 1, + MLX5_IB_RROCE_ECN_NP = 2, +}; + +static enum mlx5_ib_cong_node_type +mlx5_ib_param_to_node(u32 index) +{ + + if (index >= MLX5_IB_INDEX(rp_clamp_tgt_rate) && + index <= MLX5_IB_INDEX(rp_gd)) + return MLX5_IB_RROCE_ECN_RP; + else + return MLX5_IB_RROCE_ECN_NP; +} + +static u64 +mlx5_get_cc_param_val(void *field, u32 index) +{ + + switch (index) { + case MLX5_IB_INDEX(rp_clamp_tgt_rate): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + clamp_tgt_rate); + case MLX5_IB_INDEX(rp_clamp_tgt_rate_ati): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + clamp_tgt_rate_after_time_inc); + case MLX5_IB_INDEX(rp_time_reset): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rpg_time_reset); + case MLX5_IB_INDEX(rp_byte_reset): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rpg_byte_reset); + case MLX5_IB_INDEX(rp_threshold): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rpg_threshold); + case MLX5_IB_INDEX(rp_ai_rate): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rpg_ai_rate); + case MLX5_IB_INDEX(rp_hai_rate): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rpg_hai_rate); + case MLX5_IB_INDEX(rp_min_dec_fac): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rpg_min_dec_fac); + case MLX5_IB_INDEX(rp_min_rate): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rpg_min_rate); + case MLX5_IB_INDEX(rp_rate_to_set_on_first_cnp): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rate_to_set_on_first_cnp); + case MLX5_IB_INDEX(rp_dce_tcp_g): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + dce_tcp_g); + case MLX5_IB_INDEX(rp_dce_tcp_rtt): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + dce_tcp_rtt); + case MLX5_IB_INDEX(rp_rate_reduce_monitor_period): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rate_reduce_monitor_period); + case MLX5_IB_INDEX(rp_initial_alpha_value): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + initial_alpha_value); + case MLX5_IB_INDEX(rp_gd): + return MLX5_GET(cong_control_r_roce_ecn_rp, field, + rpg_gd); + case MLX5_IB_INDEX(np_cnp_dscp): + return MLX5_GET(cong_control_r_roce_ecn_np, field, + cnp_dscp); + case MLX5_IB_INDEX(np_cnp_prio_mode): + return MLX5_GET(cong_control_r_roce_ecn_np, field, + cnp_prio_mode); + case MLX5_IB_INDEX(np_cnp_prio): + return MLX5_GET(cong_control_r_roce_ecn_np, field, + cnp_802p_prio); + default: + return 0; + } +} + +static void +mlx5_ib_set_cc_param_mask_val(void *field, u32 index, + u64 var, u32 *attr_mask) +{ + + switch (index) { + case MLX5_IB_INDEX(rp_clamp_tgt_rate): + *attr_mask |= MLX5_IB_RP_CLAMP_TGT_RATE_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + clamp_tgt_rate, var); + break; + case MLX5_IB_INDEX(rp_clamp_tgt_rate_ati): + *attr_mask |= MLX5_IB_RP_CLAMP_TGT_RATE_ATI_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + clamp_tgt_rate_after_time_inc, var); + break; + case MLX5_IB_INDEX(rp_time_reset): + *attr_mask |= MLX5_IB_RP_TIME_RESET_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rpg_time_reset, var); + break; + case MLX5_IB_INDEX(rp_byte_reset): + *attr_mask |= MLX5_IB_RP_BYTE_RESET_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rpg_byte_reset, var); + break; + case MLX5_IB_INDEX(rp_threshold): + *attr_mask |= MLX5_IB_RP_THRESHOLD_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rpg_threshold, var); + break; + case MLX5_IB_INDEX(rp_ai_rate): + *attr_mask |= MLX5_IB_RP_AI_RATE_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rpg_ai_rate, var); + break; + case MLX5_IB_INDEX(rp_hai_rate): + *attr_mask |= MLX5_IB_RP_HAI_RATE_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rpg_hai_rate, var); + break; + case MLX5_IB_INDEX(rp_min_dec_fac): + *attr_mask |= MLX5_IB_RP_MIN_DEC_FAC_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rpg_min_dec_fac, var); + break; + case MLX5_IB_INDEX(rp_min_rate): + *attr_mask |= MLX5_IB_RP_MIN_RATE_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rpg_min_rate, var); + break; + case MLX5_IB_INDEX(rp_rate_to_set_on_first_cnp): + *attr_mask |= MLX5_IB_RP_RATE_TO_SET_ON_FIRST_CNP_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rate_to_set_on_first_cnp, var); + break; + case MLX5_IB_INDEX(rp_dce_tcp_g): + *attr_mask |= MLX5_IB_RP_DCE_TCP_G_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + dce_tcp_g, var); + break; + case MLX5_IB_INDEX(rp_dce_tcp_rtt): + *attr_mask |= MLX5_IB_RP_DCE_TCP_RTT_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + dce_tcp_rtt, var); + break; + case MLX5_IB_INDEX(rp_rate_reduce_monitor_period): + *attr_mask |= MLX5_IB_RP_RATE_REDUCE_MONITOR_PERIOD_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rate_reduce_monitor_period, var); + break; + case MLX5_IB_INDEX(rp_initial_alpha_value): + *attr_mask |= MLX5_IB_RP_INITIAL_ALPHA_VALUE_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + initial_alpha_value, var); + break; + case MLX5_IB_INDEX(rp_gd): + *attr_mask |= MLX5_IB_RP_GD_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_rp, field, + rpg_gd, var); + break; + case MLX5_IB_INDEX(np_cnp_dscp): + *attr_mask |= MLX5_IB_NP_CNP_DSCP_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_np, field, cnp_dscp, var); + break; + case MLX5_IB_INDEX(np_cnp_prio_mode): + *attr_mask |= MLX5_IB_NP_CNP_PRIO_MODE_ATTR; + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_np, field, cnp_prio_mode, var); + break; + case MLX5_IB_INDEX(np_cnp_prio): + *attr_mask |= MLX5_IB_NP_CNP_PRIO_MODE_ATTR; + MLX5_SET(cong_control_r_roce_ecn_np, field, cnp_prio_mode, 0); + MLX5_IB_SET_CLIPPED(cong_control_r_roce_ecn_np, field, cnp_802p_prio, var); + break; + default: + break; + } +} + +static int +mlx5_ib_get_all_cc_params(struct mlx5_ib_dev *dev) +{ + int outlen = MLX5_ST_SZ_BYTES(query_cong_params_out); + enum mlx5_ib_cong_node_type node = 0; + void *out; + void *field; + u32 x; + int err = 0; + + out = kzalloc(outlen, GFP_KERNEL); + if (!out) + return -ENOMEM; + + /* get the current values */ + for (x = 0; x != MLX5_IB_CONG_PARAMS_NUM; x++) { + if (node != mlx5_ib_param_to_node(x)) { + node = mlx5_ib_param_to_node(x); + + err = mlx5_cmd_query_cong_params(dev->mdev, node, out, outlen); + if (err) + break; + } + field = MLX5_ADDR_OF(query_cong_params_out, out, congestion_parameters); + dev->congestion.arg[x] = mlx5_get_cc_param_val(field, x); + } + kfree(out); + return err; +} + +static int +mlx5_ib_set_cc_params(struct mlx5_ib_dev *dev, u32 index, u64 var) +{ + int inlen = MLX5_ST_SZ_BYTES(modify_cong_params_in); + enum mlx5_ib_cong_node_type node; + u32 attr_mask = 0; + void *field; + void *in; + int err; + + in = kzalloc(inlen, GFP_KERNEL); + if (!in) + return -ENOMEM; + + MLX5_SET(modify_cong_params_in, in, opcode, + MLX5_CMD_OP_MODIFY_CONG_PARAMS); + + node = mlx5_ib_param_to_node(index); + MLX5_SET(modify_cong_params_in, in, cong_protocol, node); + + field = MLX5_ADDR_OF(modify_cong_params_in, in, congestion_parameters); + mlx5_ib_set_cc_param_mask_val(field, index, var, &attr_mask); + + field = MLX5_ADDR_OF(modify_cong_params_in, in, field_select); + MLX5_SET(field_select_r_roce_rp, field, field_select_r_roce_rp, + attr_mask); + + err = mlx5_cmd_modify_cong_params(dev->mdev, in, inlen); + kfree(in); + + return err; +} + +static int +mlx5_ib_cong_params_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5_ib_dev *dev = arg1; + u64 value; + int error; + + CONG_LOCK(dev); + value = dev->congestion.arg[arg2]; + if (req != NULL) { + error = sysctl_handle_64(oidp, &value, 0, req); + if (error || req->newptr == NULL || + value == dev->congestion.arg[arg2]) + goto done; + + /* assign new value */ + dev->congestion.arg[arg2] = value; + } else { + error = 0; + } + if (!MLX5_CAP_GEN(dev->mdev, cc_modify_allowed)) + error = EPERM; + else { + error = -mlx5_ib_set_cc_params(dev, MLX5_IB_INDEX(arg[arg2]), + dev->congestion.arg[arg2]); + } +done: + CONG_UNLOCK(dev); + + return (error); +} + +#define MLX5_GET_UNALIGNED_64(t,p,f) \ + (((u64)MLX5_GET(t,p,f##_high) << 32) | MLX5_GET(t,p,f##_low)) + +static void +mlx5_ib_read_cong_stats(struct work_struct *work) +{ + struct mlx5_ib_dev *dev = + container_of(work, struct mlx5_ib_dev, congestion.dwork.work); + const int outlen = MLX5_ST_SZ_BYTES(query_cong_statistics_out); + void *out; + + out = kzalloc(outlen, GFP_KERNEL); + if (!out) + goto done; + + CONG_LOCK(dev); + if (mlx5_cmd_query_cong_counter(dev->mdev, 0, out, outlen)) + memset(out, 0, outlen); + + dev->congestion.syndrome = + MLX5_GET(query_cong_statistics_out, out, syndrome); + dev->congestion.rp_cur_flows = + MLX5_GET(query_cong_statistics_out, out, rp_cur_flows); + dev->congestion.sum_flows = + MLX5_GET(query_cong_statistics_out, out, sum_flows); + dev->congestion.rp_cnp_ignored = + MLX5_GET_UNALIGNED_64(query_cong_statistics_out, out, rp_cnp_ignored); + dev->congestion.rp_cnp_handled = + MLX5_GET_UNALIGNED_64(query_cong_statistics_out, out, rp_cnp_handled); + dev->congestion.time_stamp = + MLX5_GET_UNALIGNED_64(query_cong_statistics_out, out, time_stamp); + dev->congestion.accumulators_period = + MLX5_GET(query_cong_statistics_out, out, accumulators_period); + dev->congestion.np_ecn_marked_roce_packets = + MLX5_GET_UNALIGNED_64(query_cong_statistics_out, out, np_ecn_marked_roce_packets); + dev->congestion.np_cnp_sent = + MLX5_GET_UNALIGNED_64(query_cong_statistics_out, out, np_cnp_sent); + + CONG_UNLOCK(dev); + kfree(out); + +done: + schedule_delayed_work(&dev->congestion.dwork, hz); +} + +void +mlx5_ib_cleanup_congestion(struct mlx5_ib_dev *dev) +{ + + cancel_delayed_work_sync(&dev->congestion.dwork); + sysctl_ctx_free(&dev->congestion.ctx); + sx_destroy(&dev->congestion.lock); +} + +int +mlx5_ib_init_congestion(struct mlx5_ib_dev *dev) +{ + struct sysctl_ctx_list *ctx; + struct sysctl_oid *parent; + struct sysctl_oid *node; + int err; + u32 x; + + ctx = &dev->congestion.ctx; + sysctl_ctx_init(ctx); + sx_init(&dev->congestion.lock, "mlx5ibcong"); + INIT_DELAYED_WORK(&dev->congestion.dwork, mlx5_ib_read_cong_stats); + + if (!MLX5_CAP_GEN(dev->mdev, cc_query_allowed)) + return (0); + + err = mlx5_ib_get_all_cc_params(dev); + if (err) + return (err); + + parent = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(dev->ib_dev.dev.kobj.oidp), + OID_AUTO, "cong", CTLFLAG_RW, NULL, "Congestion control"); + if (parent == NULL) + return (-ENOMEM); + + node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(parent), + OID_AUTO, "conf", CTLFLAG_RW, NULL, "Configuration"); + if (node == NULL) { + sysctl_ctx_free(&dev->congestion.ctx); + return (-ENOMEM); + } + + for (x = 0; x != MLX5_IB_CONG_PARAMS_NUM; x++) { + SYSCTL_ADD_PROC(ctx, + SYSCTL_CHILDREN(node), OID_AUTO, + mlx5_ib_cong_params_desc[2 * x], + CTLTYPE_U64 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, + dev, x, &mlx5_ib_cong_params_handler, "QU", + mlx5_ib_cong_params_desc[2 * x + 1]); + } + + node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(parent), + OID_AUTO, "stats", CTLFLAG_RD, NULL, "Statistics"); + if (node == NULL) { + sysctl_ctx_free(&dev->congestion.ctx); + return (-ENOMEM); + } + + for (x = 0; x != MLX5_IB_CONG_STATS_NUM; x++) { + /* read-only SYSCTLs */ + SYSCTL_ADD_U64(ctx, SYSCTL_CHILDREN(node), OID_AUTO, + mlx5_ib_cong_stats_desc[2 * x], + CTLFLAG_RD | CTLFLAG_MPSAFE, + &dev->congestion.arg[x + MLX5_IB_CONG_PARAMS_NUM], + 0, mlx5_ib_cong_stats_desc[2 * x + 1]); + } + schedule_delayed_work(&dev->congestion.dwork, hz); + return (0); +} Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Mar 8 10:43:42 2018 (r330647) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Thu Mar 8 11:23:14 2018 (r330648) @@ -3151,6 +3151,10 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) goto err_umrc; } + err = mlx5_ib_init_congestion(dev); + if (err) + goto err_umrc; + dev->ib_active = true; return dev; @@ -3190,6 +3194,7 @@ static void mlx5_ib_remove(struct mlx5_core_dev *mdev, struct mlx5_ib_dev *dev = context; enum rdma_link_layer ll = mlx5_ib_port_link_layer(&dev->ib_dev, 1); + mlx5_ib_cleanup_congestion(dev); mlx5_remove_roce_notifier(dev); ib_unregister_device(&dev->ib_dev); mlx5_ib_dealloc_q_counters(dev); Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Thu Mar 8 10:43:42 2018 (r330647) +++ head/sys/dev/mlx5/mlx5_ifc.h Thu Mar 8 11:23:14 2018 (r330648) @@ -4865,17 +4865,17 @@ struct mlx5_ifc_query_cong_statistics_out_bits { u8 reserved_1[0x40]; - u8 cur_flows[0x20]; + u8 rp_cur_flows[0x20]; u8 sum_flows[0x20]; - u8 cnp_ignored_high[0x20]; + u8 rp_cnp_ignored_high[0x20]; - u8 cnp_ignored_low[0x20]; + u8 rp_cnp_ignored_low[0x20]; - u8 cnp_handled_high[0x20]; + u8 rp_cnp_handled_high[0x20]; - u8 cnp_handled_low[0x20]; + u8 rp_cnp_handled_low[0x20]; u8 reserved_2[0x100]; @@ -4885,13 +4885,13 @@ struct mlx5_ifc_query_cong_statistics_out_bits { u8 accumulators_period[0x20]; - u8 ecn_marked_roce_packets_high[0x20]; + u8 np_ecn_marked_roce_packets_high[0x20]; - u8 ecn_marked_roce_packets_low[0x20]; + u8 np_ecn_marked_roce_packets_low[0x20]; - u8 cnps_sent_high[0x20]; + u8 np_cnp_sent_high[0x20]; - u8 cnps_sent_low[0x20]; + u8 np_cnp_sent_low[0x20]; u8 reserved_3[0x560]; }; Modified: head/sys/modules/mlx5ib/Makefile ============================================================================== --- head/sys/modules/mlx5ib/Makefile Thu Mar 8 10:43:42 2018 (r330647) +++ head/sys/modules/mlx5ib/Makefile Thu Mar 8 11:23:14 2018 (r330648) @@ -4,6 +4,7 @@ KMOD=mlx5ib SRCS= \ mlx5_ib_ah.c \ +mlx5_ib_cong.c \ mlx5_ib_cq.c \ mlx5_ib_doorbell.c \ mlx5_ib_gsi.c \ From owner-svn-src-head@freebsd.org Thu Mar 8 11:40: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 44F15F109D4; Thu, 8 Mar 2018 11:40:40 +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 E842975C28; Thu, 8 Mar 2018 11:40:39 +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 E3175103E1; Thu, 8 Mar 2018 11:40:39 +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 w28BednD086258; Thu, 8 Mar 2018 11:40:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28Bedd6086254; Thu, 8 Mar 2018 11:40:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081140.w28Bedd6086254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 11:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330649 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Commit-Revision: 330649 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:40:40 -0000 Author: hselasky Date: Thu Mar 8 11:40:39 2018 New Revision: 330649 URL: https://svnweb.freebsd.org/changeset/base/330649 Log: Add support for per priority flow control, PFC, to mlx5en(4). Add support for PFC and implement reading the per priority statistics using the sysctl(8) interface. PFC is used together with VLAN priority and can be enabled and disabled on a per priority basis. Global pause frames and PFC are incompatible features and surrounding logic has been added to warn the user about misconfiguration. Update relevant mlx5core APIs for PFC configuration. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/port.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_port.c Thu Mar 8 11:23:14 2018 (r330648) +++ head/sys/dev/mlx5/mlx5_core/mlx5_port.c Thu Mar 8 11:40:39 2018 (r330649) @@ -336,15 +336,26 @@ int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, } EXPORT_SYMBOL_GPL(mlx5_query_port_max_mtu); -int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 port, - u32 rx_pause, u32 tx_pause) +int mlx5_set_port_pause_and_pfc(struct mlx5_core_dev *dev, u32 port, + u8 rx_pause, u8 tx_pause, + u8 pfc_en_rx, u8 pfc_en_tx) { u32 in[MLX5_ST_SZ_DW(pfcc_reg)] = {0}; u32 out[MLX5_ST_SZ_DW(pfcc_reg)] = {0}; + if (pfc_en_rx || pfc_en_tx) { + /* PFC and global pauseframes are incompatible features */ + if (tx_pause || rx_pause) + return -EINVAL; + } + MLX5_SET(pfcc_reg, in, local_port, port); MLX5_SET(pfcc_reg, in, pptx, tx_pause); MLX5_SET(pfcc_reg, in, pprx, rx_pause); + MLX5_SET(pfcc_reg, in, pfctx, pfc_en_tx); + MLX5_SET(pfcc_reg, in, pfcrx, pfc_en_rx); + MLX5_SET(pfcc_reg, in, prio_mask_tx, pfc_en_tx); + MLX5_SET(pfcc_reg, in, prio_mask_rx, pfc_en_rx); return mlx5_core_access_reg(dev, in, sizeof(in), out, sizeof(out), MLX5_REG_PFCC, 0, 1); @@ -370,25 +381,9 @@ int mlx5_query_port_pause(struct mlx5_core_dev *dev, u return 0; } -int mlx5_set_port_pfc(struct mlx5_core_dev *dev, u8 pfc_en_tx, u8 pfc_en_rx) -{ - u32 in[MLX5_ST_SZ_DW(pfcc_reg)] = {0}; - u32 out[MLX5_ST_SZ_DW(pfcc_reg)]; - - MLX5_SET(pfcc_reg, in, local_port, 1); - MLX5_SET(pfcc_reg, in, pfctx, pfc_en_tx); - MLX5_SET(pfcc_reg, in, pfcrx, pfc_en_rx); - MLX5_SET_TO_ONES(pfcc_reg, in, prio_mask_tx); - MLX5_SET_TO_ONES(pfcc_reg, in, prio_mask_rx); - - return mlx5_core_access_reg(dev, in, sizeof(in), out, - sizeof(out), MLX5_REG_PFCC, 0, 1); -} -EXPORT_SYMBOL_GPL(mlx5_set_port_pfc); - int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 *pfc_en_rx) { - u32 in[MLX5_ST_SZ_DW(pfcc_reg)] = {0}; + u32 in[MLX5_ST_SZ_DW(pfcc_reg)] = {}; u32 out[MLX5_ST_SZ_DW(pfcc_reg)]; int err; @@ -398,12 +393,10 @@ int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 if (err) return err; - if (pfc_en_tx) + if (pfc_en_tx != NULL) *pfc_en_tx = MLX5_GET(pfcc_reg, out, pfctx); - - if (pfc_en_rx) + if (pfc_en_rx != NULL) *pfc_en_rx = MLX5_GET(pfcc_reg, out, pfcrx); - return 0; } EXPORT_SYMBOL_GPL(mlx5_query_port_pfc); Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Thu Mar 8 11:23:14 2018 (r330648) +++ head/sys/dev/mlx5/mlx5_en/en.h Thu Mar 8 11:40:39 2018 (r330649) @@ -276,13 +276,55 @@ struct mlx5e_vport_stats { m(+1, u64 rs_corrected_symbols_lane2, "rs_corrected_symbols_lane2", \ "FEC corrected symbol counter lane 2") \ m(+1, u64 rs_corrected_symbols_lane3, "rs_corrected_symbols_lane3", \ - "FEC corrected symbol counter lane 3") \ + "FEC corrected symbol counter lane 3") +/* Per priority statistics for PFC */ +#define MLX5E_PPORT_PER_PRIO_STATS_SUB(m,n,p) \ + m(n, p, +1, u64, rx_octets, "rx_octets", "Received octets") \ + m(n, p, +1, u64, reserved_0, "reserved_0", "Reserved") \ + m(n, p, +1, u64, reserved_1, "reserved_1", "Reserved") \ + m(n, p, +1, u64, reserved_2, "reserved_2", "Reserved") \ + m(n, p, +1, u64, rx_frames, "rx_frames", "Received frames") \ + m(n, p, +1, u64, tx_octets, "tx_octets", "Transmitted octets") \ + m(n, p, +1, u64, reserved_3, "reserved_3", "Reserved") \ + m(n, p, +1, u64, reserved_4, "reserved_4", "Reserved") \ + m(n, p, +1, u64, reserved_5, "reserved_5", "Reserved") \ + m(n, p, +1, u64, tx_frames, "tx_frames", "Transmitted frames") \ + m(n, p, +1, u64, rx_pause, "rx_pause", "Received pause frames") \ + m(n, p, +1, u64, rx_pause_duration, "rx_pause_duration", \ + "Received pause duration") \ + m(n, p, +1, u64, tx_pause, "tx_pause", "Transmitted pause frames") \ + m(n, p, +1, u64, tx_pause_duration, "tx_pause_duration", \ + "Transmitted pause duration") \ + m(n, p, +1, u64, rx_pause_transition, "rx_pause_transition", \ + "Received pause transitions") \ + m(n, p, +1, u64, rx_discards, "rx_discards", "Discarded received frames") \ + m(n, p, +1, u64, device_stall_minor_watermark, \ + "device_stall_minor_watermark", "Device stall minor watermark") \ + m(n, p, +1, u64, device_stall_critical_watermark, \ + "device_stall_critical_watermark", "Device stall critical watermark") + +#define MLX5E_PPORT_PER_PRIO_STATS_PREFIX(m,p,c,t,f,s,d) \ + m(c, t pri_##p##_##f, "prio" #p "_" s, "Priority " #p " - " d) + +#define MLX5E_PPORT_PER_PRIO_STATS_NUM_PRIO 8 + +#define MLX5E_PPORT_PER_PRIO_STATS(m) \ + MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,0) \ + MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,1) \ + MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,2) \ + MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,3) \ + MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,4) \ + MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,5) \ + MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,6) \ + MLX5E_PPORT_PER_PRIO_STATS_SUB(MLX5E_PPORT_PER_PRIO_STATS_PREFIX,m,7) + /* * Make sure to update mlx5e_update_pport_counters() * when adding a new MLX5E_PPORT_STATS block */ #define MLX5E_PPORT_STATS(m) \ + MLX5E_PPORT_PER_PRIO_STATS(m) \ MLX5E_PPORT_IEEE802_3_STATS(m) \ MLX5E_PPORT_RFC2819_STATS(m) @@ -298,6 +340,8 @@ struct mlx5e_vport_stats { #define MLX5E_PPORT_STATS_NUM \ (0 MLX5E_PPORT_STATS(MLX5E_STATS_COUNT)) +#define MLX5E_PPORT_PER_PRIO_STATS_NUM \ + (0 MLX5E_PPORT_PER_PRIO_STATS(MLX5E_STATS_COUNT)) #define MLX5E_PPORT_RFC2819_STATS_DEBUG_NUM \ (0 MLX5E_PPORT_RFC2819_STATS_DEBUG(MLX5E_STATS_COUNT)) #define MLX5E_PPORT_RFC2863_STATS_DEBUG_NUM \ @@ -391,8 +435,10 @@ struct mlx5e_params { bool cqe_zipping_en; u32 lro_wqe_sz; u16 rx_hash_log_tbl_sz; - u32 tx_pauseframe_control; - u32 rx_pauseframe_control; + u32 tx_pauseframe_control __aligned(4); + u32 rx_pauseframe_control __aligned(4); + u32 tx_priority_flow_control __aligned(4); + u32 rx_priority_flow_control __aligned(4); }; #define MLX5E_PARAMS(m) \ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Mar 8 11:23:14 2018 (r330648) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Mar 8 11:40:39 2018 (r330649) @@ -230,6 +230,32 @@ mlx5e_find_link_mode(u32 subtype) } static int +mlx5e_set_port_pause_and_pfc(struct mlx5e_priv *priv) +{ + return (mlx5_set_port_pause_and_pfc(priv->mdev, 1, + priv->params.rx_pauseframe_control, + priv->params.tx_pauseframe_control, + priv->params.rx_priority_flow_control, + priv->params.tx_priority_flow_control)); +} + +static int +mlx5e_set_port_pfc(struct mlx5e_priv *priv) +{ + int error; + + if (priv->params.rx_pauseframe_control || + priv->params.tx_pauseframe_control) { + if_printf(priv->ifp, + "Global pauseframes must be disabled before enabling PFC.\n"); + error = -EINVAL; + } else { + error = mlx5e_set_port_pause_and_pfc(priv); + } + return (error); +} + +static int mlx5e_media_change(struct ifnet *dev) { struct mlx5e_priv *priv = dev->if_softc; @@ -272,6 +298,15 @@ mlx5e_media_change(struct ifnet *dev) goto done; } } + if (priv->media.ifm_media & (IFM_ETH_RXPAUSE | IFM_ETH_TXPAUSE)) { + /* check if PFC is enabled */ + if (priv->params.rx_priority_flow_control || + priv->params.tx_priority_flow_control) { + if_printf(dev, "PFC must be disabled before enabling global pauseframes.\n"); + error = EINVAL; + goto done; + } + } /* update pauseframe control bits */ priv->params.rx_pauseframe_control = (priv->media.ifm_media & IFM_ETH_RXPAUSE) ? 1 : 0; @@ -284,9 +319,7 @@ mlx5e_media_change(struct ifnet *dev) /* reconfigure the hardware */ mlx5_set_port_status(mdev, MLX5_PORT_DOWN); mlx5_set_port_proto(mdev, link_mode, MLX5_PTYS_EN); - mlx5_set_port_pause(mdev, 1, - priv->params.rx_pauseframe_control, - priv->params.tx_pauseframe_control); + error = -mlx5e_set_port_pause_and_pfc(priv); if (was_opened) mlx5_set_port_status(mdev, MLX5_PORT_UP); @@ -326,6 +359,7 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv) unsigned sz = MLX5_ST_SZ_BYTES(ppcnt_reg); unsigned x; unsigned y; + unsigned z; /* allocate firmware request structures */ in = mlx5_vzalloc(sz); @@ -344,7 +378,8 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv) /* read IEEE802_3 counter group using predefined counter layout */ MLX5_SET(ppcnt_reg, in, grp, MLX5_IEEE_802_3_COUNTERS_GROUP); mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); - for (x = y = 0; x != MLX5E_PPORT_IEEE802_3_STATS_NUM; x++, y++) + for (x = 0, y = MLX5E_PPORT_PER_PRIO_STATS_NUM; + x != MLX5E_PPORT_IEEE802_3_STATS_NUM; x++, y++) s->arg[y] = be64toh(ptr[x]); /* read RFC2819 counter group using predefined counter layout */ @@ -367,6 +402,20 @@ mlx5e_update_pport_counters(struct mlx5e_priv *priv) mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); for (x = 0; x != MLX5E_PPORT_PHYSICAL_LAYER_STATS_DEBUG_NUM; x++, y++) s_debug->arg[y] = be64toh(ptr[x]); + + /* read per-priority counters */ + MLX5_SET(ppcnt_reg, in, grp, MLX5_PER_PRIORITY_COUNTERS_GROUP); + + /* iterate all the priorities */ + for (y = z = 0; z != MLX5E_PPORT_PER_PRIO_STATS_NUM_PRIO; z++) { + MLX5_SET(ppcnt_reg, in, prio_tc, z); + mlx5_core_access_reg(mdev, in, sz, out, sz, MLX5_REG_PPCNT, 0, 0); + + /* read per priority stats counter group using predefined counter layout */ + for (x = 0; x != (MLX5E_PPORT_PER_PRIO_STATS_NUM / + MLX5E_PPORT_PER_PRIO_STATS_NUM_PRIO); x++, y++) + s->arg[y] = be64toh(ptr[x]); + } free_out: /* free firmware request structures */ kvfree(in); @@ -3218,17 +3267,93 @@ mlx5e_add_hw_stats(struct mlx5e_priv *priv) "Board ID"); } +static int +mlx5e_sysctl_tx_priority_flow_control(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + uint32_t tx_pfc; + uint32_t value; + int error; + + PRIV_LOCK(priv); + + tx_pfc = priv->params.tx_priority_flow_control; + + /* get current value */ + value = (tx_pfc >> arg2) & 1; + + error = sysctl_handle_32(oidp, &value, 0, req); + + /* range check value */ + if (value != 0) + priv->params.tx_priority_flow_control |= (1 << arg2); + else + priv->params.tx_priority_flow_control &= ~(1 << arg2); + + /* check if update is required */ + if (error == 0 && priv->gone == 0 && + tx_pfc != priv->params.tx_priority_flow_control) { + error = -mlx5e_set_port_pfc(priv); + /* restore previous value */ + if (error != 0) + priv->params.tx_priority_flow_control= tx_pfc; + } + PRIV_UNLOCK(priv); + + return (error); +} + +static int +mlx5e_sysctl_rx_priority_flow_control(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + uint32_t rx_pfc; + uint32_t value; + int error; + + PRIV_LOCK(priv); + + rx_pfc = priv->params.rx_priority_flow_control; + + /* get current value */ + value = (rx_pfc >> arg2) & 1; + + error = sysctl_handle_32(oidp, &value, 0, req); + + /* range check value */ + if (value != 0) + priv->params.rx_priority_flow_control |= (1 << arg2); + else + priv->params.rx_priority_flow_control &= ~(1 << arg2); + + /* check if update is required */ + if (error == 0 && priv->gone == 0 && + rx_pfc != priv->params.rx_priority_flow_control) { + error = -mlx5e_set_port_pfc(priv); + /* restore previous value */ + if (error != 0) + priv->params.rx_priority_flow_control= rx_pfc; + } + PRIV_UNLOCK(priv); + + return (error); +} + static void mlx5e_setup_pauseframes(struct mlx5e_priv *priv) { -#if (__FreeBSD_version < 1100000) - char path[64]; + unsigned int x; + char path[96]; + int error; -#endif /* Only receiving pauseframes is enabled by default */ priv->params.tx_pauseframe_control = 0; priv->params.rx_pauseframe_control = 1; + /* disable ports flow control, PFC, by default */ + priv->params.tx_priority_flow_control = 0; + priv->params.rx_priority_flow_control = 0; + #if (__FreeBSD_version < 1100000) /* compute path for sysctl */ snprintf(path, sizeof(path), "dev.mce.%d.tx_pauseframe_control", @@ -3243,9 +3368,28 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv) /* try to fetch tunable, if any */ TUNABLE_INT_FETCH(path, &priv->params.rx_pauseframe_control); + + for (x = 0; x != 8; x++) { + + /* compute path for sysctl */ + snprintf(path, sizeof(path), "dev.mce.%d.tx_priority_flow_control_%u", + device_get_unit(priv->mdev->pdev->dev.bsddev), x); + + /* try to fetch tunable, if any */ + if (TUNABLE_INT_FETCH(path, &value) == 0 && value != 0) + priv->params.tx_priority_flow_control |= 1 << x; + + /* compute path for sysctl */ + snprintf(path, sizeof(path), "dev.mce.%d.rx_priority_flow_control_%u", + device_get_unit(priv->mdev->pdev->dev.bsddev), x); + + /* try to fetch tunable, if any */ + if (TUNABLE_INT_FETCH(path, &value) == 0 && value != 0) + priv->params.rx_priority_flow_control |= 1 << x; + } #endif - /* register pausframe SYSCTLs */ + /* register pauseframe SYSCTLs */ SYSCTL_ADD_INT(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, "tx_pauseframe_control", CTLFLAG_RDTUN, &priv->params.tx_pauseframe_control, 0, @@ -3256,6 +3400,25 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv) &priv->params.rx_pauseframe_control, 0, "Set to enable RX pause frames. Clear to disable."); + /* register priority_flow control, PFC, SYSCTLs */ + for (x = 0; x != 8; x++) { + snprintf(path, sizeof(path), "tx_priority_flow_control_%u", x); + + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), + OID_AUTO, path, CTLTYPE_UINT | CTLFLAG_RWTUN | + CTLFLAG_MPSAFE, priv, x, &mlx5e_sysctl_tx_priority_flow_control, "IU", + "Set to enable TX ports flow control frames for given priority. Clear to disable."); + + snprintf(path, sizeof(path), "rx_priority_flow_control_%u", x); + + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), + OID_AUTO, path, CTLTYPE_UINT | CTLFLAG_RWTUN | + CTLFLAG_MPSAFE, priv, x, &mlx5e_sysctl_rx_priority_flow_control, "IU", + "Set to enable RX ports flow control frames for given priority. Clear to disable."); + } + + PRIV_LOCK(priv); + /* range check */ priv->params.tx_pauseframe_control = priv->params.tx_pauseframe_control ? 1 : 0; @@ -3263,9 +3426,17 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv) priv->params.rx_pauseframe_control ? 1 : 0; /* update firmware */ - mlx5_set_port_pause(priv->mdev, 1, - priv->params.rx_pauseframe_control, - priv->params.tx_pauseframe_control); + error = mlx5e_set_port_pause_and_pfc(priv); + if (error == -EINVAL) { + if_printf(priv->ifp, + "Global pauseframes must be disabled before enabling PFC.\n"); + priv->params.rx_priority_flow_control = 0; + priv->params.tx_priority_flow_control = 0; + + /* update firmware */ + (void) mlx5e_set_port_pause_and_pfc(priv); + } + PRIV_UNLOCK(priv); } static void * Modified: head/sys/dev/mlx5/port.h ============================================================================== --- head/sys/dev/mlx5/port.h Thu Mar 8 11:23:14 2018 (r330648) +++ head/sys/dev/mlx5/port.h Thu Mar 8 11:40:39 2018 (r330649) @@ -127,11 +127,11 @@ int mlx5_set_port_status(struct mlx5_core_dev *dev, int mlx5_query_port_status(struct mlx5_core_dev *dev, u8 *status); int mlx5_query_port_admin_status(struct mlx5_core_dev *dev, enum mlx5_port_status *status); -int mlx5_set_port_pause(struct mlx5_core_dev *dev, u32 port, - u32 rx_pause, u32 tx_pause); +int mlx5_set_port_pause_and_pfc(struct mlx5_core_dev *dev, u32 port, + u8 rx_pause, u8 tx_pause, + u8 pfc_en_rx, u8 pfc_en_tx); int mlx5_query_port_pause(struct mlx5_core_dev *dev, u32 port, u32 *rx_pause, u32 *tx_pause); -int mlx5_set_port_pfc(struct mlx5_core_dev *dev, u8 pfc_en_tx, u8 pfc_en_rx); int mlx5_query_port_pfc(struct mlx5_core_dev *dev, u8 *pfc_en_tx, u8 *pfc_en_rx); int mlx5_set_port_mtu(struct mlx5_core_dev *dev, int mtu); From owner-svn-src-head@freebsd.org Thu Mar 8 11:58: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 0F4A1F292BF; Thu, 8 Mar 2018 11:58:28 +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 A97A376818; Thu, 8 Mar 2018 11:58:27 +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 9758010715; Thu, 8 Mar 2018 11:58:27 +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 w28BwRt1095646; Thu, 8 Mar 2018 11:58:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28BwRcU095645; Thu, 8 Mar 2018 11:58:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081158.w28BwRcU095645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 11:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330650 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 330650 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:58:28 -0000 Author: hselasky Date: Thu Mar 8 11:58:27 2018 New Revision: 330650 URL: https://svnweb.freebsd.org/changeset/base/330650 Log: Use device_printf() instead of printf() when printing warnings and errors to dmesg(8) in mlx5core. Submitted by: Matthew Finlay MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Thu Mar 8 11:40:39 2018 (r330649) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Thu Mar 8 11:58:27 2018 (r330650) @@ -49,14 +49,14 @@ do { \ mlx5_core_dbg(dev, format, ##__VA_ARGS__); \ } while (0) -#define mlx5_core_err(dev, format, ...) \ - printf("mlx5_core: ERR: ""%s:%s:%d:(pid %d): " format, \ - (dev)->priv.name, __func__, __LINE__, curthread->td_proc->p_pid, \ - ##__VA_ARGS__) +#define mlx5_core_err(_dev, format, ...) \ + device_printf((&(_dev)->pdev->dev)->bsddev, "ERR: ""%s:%d:(pid %d): " format, \ + __func__, __LINE__, curthread->td_proc->p_pid, \ + ##__VA_ARGS__) -#define mlx5_core_warn(dev, format, ...) \ - printf("mlx5_core: WARN: ""%s:%s:%d:(pid %d): " format, \ - (dev)->priv.name, __func__, __LINE__, curthread->td_proc->p_pid, \ +#define mlx5_core_warn(_dev, format, ...) \ + device_printf((&(_dev)->pdev->dev)->bsddev, "WARN: ""%s:%d:(pid %d): " format, \ + __func__, __LINE__, curthread->td_proc->p_pid, \ ##__VA_ARGS__) enum { From owner-svn-src-head@freebsd.org Thu Mar 8 11:59: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 0D30BF29415; Thu, 8 Mar 2018 11:59:49 +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 ACF8876992; Thu, 8 Mar 2018 11:59:48 +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 A783D10716; Thu, 8 Mar 2018 11:59:48 +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 w28Bxmxo095740; Thu, 8 Mar 2018 11:59:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28BxlVU095733; Thu, 8 Mar 2018 11:59:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081159.w28BxlVU095733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 11:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330651 - in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core modules/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: conf dev/mlx5 dev/mlx5/mlx5_core modules/mlx5 X-SVN-Commit-Revision: 330651 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:59:49 -0000 Author: hselasky Date: Thu Mar 8 11:59:47 2018 New Revision: 330651 URL: https://svnweb.freebsd.org/changeset/base/330651 Log: Add vendor specific capability interface support in mlx5core. Add the ability to access the vendor specific space gateway in order to support reading and writing data into the different configuration domains. Submitted by: Matthew Finlay MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/dev/mlx5/mlx5_ifc.h head/sys/modules/mlx5/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Mar 8 11:58:27 2018 (r330650) +++ head/sys/conf/files Thu Mar 8 11:59:47 2018 (r330651) @@ -4757,6 +4757,8 @@ dev/mlx5/mlx5_core/mlx5_uar.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_vport.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_vsc.c optional mlx5 pci \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_wq.c optional mlx5 pci \ compile-with "${OFED_C}" Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Thu Mar 8 11:58:27 2018 (r330650) +++ head/sys/dev/mlx5/device.h Thu Mar 8 11:59:47 2018 (r330651) @@ -138,6 +138,26 @@ __mlx5_mask(typ, fld)) MLX5_BY_PASS_NUM_DONT_TRAP_PRIOS +\ MLX5_BY_PASS_NUM_MULTICAST_PRIOS) +/* insert a value to a struct */ +#define MLX5_VSC_SET(typ, p, fld, v) do { \ + BUILD_BUG_ON(__mlx5_st_sz_bits(typ) % 32); \ + BUILD_BUG_ON(__mlx5_bit_sz(typ, fld) > 32); \ + *((__le32 *)(p) + __mlx5_dw_off(typ, fld)) = \ + cpu_to_le32((le32_to_cpu(*((__le32 *)(p) + __mlx5_dw_off(typ, fld))) & \ + (~__mlx5_dw_mask(typ, fld))) | (((v) & __mlx5_mask(typ, fld)) \ + << __mlx5_dw_bit_off(typ, fld))); \ +} while (0) + +#define MLX5_VSC_GET(typ, p, fld) ((le32_to_cpu(*((__le32 *)(p) +\ +__mlx5_dw_off(typ, fld))) >> __mlx5_dw_bit_off(typ, fld)) & \ +__mlx5_mask(typ, fld)) + +#define MLX5_VSC_GET_PR(typ, p, fld) ({ \ + u32 ___t = MLX5_VSC_GET(typ, p, fld); \ + pr_debug(#fld " = 0x%x\n", ___t); \ + ___t; \ +}) + enum { MLX5_MAX_COMMANDS = 32, MLX5_CMD_DATA_BLOCK_SIZE = 512, Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Thu Mar 8 11:58:27 2018 (r330650) +++ head/sys/dev/mlx5/driver.h Thu Mar 8 11:59:47 2018 (r330651) @@ -221,6 +221,16 @@ enum mlx5_link_mode { MLX5_LINK_MODES_NUMBER, }; +enum { + MLX5_VSC_SPACE_SUPPORTED = 0x1, + MLX5_VSC_SPACE_OFFSET = 0x4, + MLX5_VSC_COUNTER_OFFSET = 0x8, + MLX5_VSC_SEMA_OFFSET = 0xC, + MLX5_VSC_ADDR_OFFSET = 0x10, + MLX5_VSC_DATA_OFFSET = 0x14, + MLX5_VSC_MAX_RETRIES = 0x1000, +}; + #define MLX5_PROT_MASK(link_mode) (1 << link_mode) struct mlx5_uuar_info { @@ -627,6 +637,7 @@ struct mlx5_core_dev { struct mlx5_priv priv; struct mlx5_profile *profile; atomic_t num_qps; + u32 vsc_addr; u32 issi; struct mlx5_special_contexts special_contexts; unsigned int module_status[MLX5_MAX_PORTS]; @@ -1001,6 +1012,12 @@ int mlx5_set_diagnostic_params(struct mlx5_core_dev *m int mlx5_query_diagnostic_counters(struct mlx5_core_dev *mdev, u8 num_of_samples, u16 sample_index, void *out, int out_size); +int mlx5_vsc_find_cap(struct mlx5_core_dev *mdev); +int mlx5_vsc_lock(struct mlx5_core_dev *mdev); +void mlx5_vsc_unlock(struct mlx5_core_dev *mdev); +int mlx5_vsc_set_space(struct mlx5_core_dev *mdev, u16 space); +int mlx5_vsc_write(struct mlx5_core_dev *mdev, u32 addr, u32 *data); +int mlx5_vsc_read(struct mlx5_core_dev *mdev, u32 addr, u32 *data); static inline u32 mlx5_mkey_to_idx(u32 mkey) { return mkey >> 8; Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Mar 8 11:58:27 2018 (r330650) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Mar 8 11:59:47 2018 (r330651) @@ -846,6 +846,9 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, st goto err_clr_master; } + if (mlx5_vsc_find_cap(dev)) + dev_err(&pdev->dev, "Unable to find vendor specific capabilities\n"); + return 0; err_clr_master: @@ -1183,7 +1186,6 @@ static int init_one(struct pci_dev *pdev, device_printf((&pdev->dev)->bsddev, "ERR: ""mlx5_register_device failed %d\n", err); goto clean_health; } - return 0; Added: head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vsc.c Thu Mar 8 11:59:47 2018 (r330651) @@ -0,0 +1,204 @@ +/*- + * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +struct mlx5_ifc_vsc_space_bits { + u8 status[0x3]; + u8 reserved0[0xd]; + u8 space[0x10]; +}; + +struct mlx5_ifc_vsc_addr_bits { + u8 flag[0x1]; + u8 reserved0[0x1]; + u8 address[0x1e]; +}; + +int mlx5_vsc_lock(struct mlx5_core_dev *mdev) +{ + device_t dev = mdev->pdev->dev.bsddev; + int vsc_addr = mdev->vsc_addr; + int retries = 0; + u32 lock_val; + u32 counter; + + if (!vsc_addr) { + mlx5_core_warn(mdev, "Unable to acquire vsc lock, vsc_addr not initialized\n"); + return EINVAL; + } + + while (true) { + if (retries > MLX5_VSC_MAX_RETRIES) + return EBUSY; + + if (pci_read_config(dev, vsc_addr + MLX5_VSC_SEMA_OFFSET, 4)) { + retries++; + /* + * The PRM suggests random 0 - 10ms to prevent multiple + * waiters on the same interval in order to avoid starvation + */ + DELAY((random() % 11) * 1000); + continue; + } + + counter = pci_read_config(dev, vsc_addr + MLX5_VSC_COUNTER_OFFSET, 4); + pci_write_config(dev, vsc_addr + MLX5_VSC_SEMA_OFFSET, counter, 4); + lock_val = pci_read_config(dev, vsc_addr + MLX5_VSC_SEMA_OFFSET, 4); + + if (lock_val == counter) + break; + + retries++; + } + + return 0; +} + +void mlx5_vsc_unlock(struct mlx5_core_dev *mdev) +{ + device_t dev = mdev->pdev->dev.bsddev; + int vsc_addr = mdev->vsc_addr; + + if (!vsc_addr) { + mlx5_core_warn(mdev, "Unable to release vsc lock, vsc_addr not initialized\n"); + return; + } + + pci_write_config(dev, vsc_addr + MLX5_VSC_SEMA_OFFSET, 0, 4); +} + +static int mlx5_vsc_wait_on_flag(struct mlx5_core_dev *mdev, u32 expected) +{ + device_t dev = mdev->pdev->dev.bsddev; + int vsc_addr = mdev->vsc_addr; + int retries = 0; + u32 flag; + + while (true) { + if (retries > MLX5_VSC_MAX_RETRIES) + return EBUSY; + + flag = pci_read_config(dev, vsc_addr + MLX5_VSC_ADDR_OFFSET, 4); + if (expected == MLX5_VSC_GET(vsc_addr, &flag, flag)) + break; + + retries++; + DELAY(10); + } + + return 0; +} + +int mlx5_vsc_set_space(struct mlx5_core_dev *mdev, u16 space) +{ + device_t dev = mdev->pdev->dev.bsddev; + int vsc_addr = mdev->vsc_addr; + u32 vsc_space = 0; + + if (!vsc_addr) { + mlx5_core_warn(mdev, "Unable to set vsc space, vsc_addr not initialized\n"); + return EINVAL; + } + + MLX5_VSC_SET(vsc_space, &vsc_space, space, space); + pci_write_config(dev, vsc_addr + MLX5_VSC_SPACE_OFFSET, vsc_space, 4); + vsc_space = pci_read_config(dev, vsc_addr + MLX5_VSC_SPACE_OFFSET, 4); + + if (MLX5_VSC_GET(vsc_space, &vsc_space, status) != MLX5_VSC_SPACE_SUPPORTED) { + mlx5_core_warn(mdev, "Space 0x%x is not supported.\n", space); + return ENOTSUP; + } + + return 0; +} + +int mlx5_vsc_write(struct mlx5_core_dev *mdev, u32 addr, u32 *data) +{ + device_t dev = mdev->pdev->dev.bsddev; + int vsc_addr = mdev->vsc_addr; + u32 in = 0; + int err; + + if (!vsc_addr) { + mlx5_core_warn(mdev, "Unable to call vsc write, vsc_addr not initialized\n"); + return EINVAL; + } + + MLX5_VSC_SET(vsc_addr, &in, address, addr); + MLX5_VSC_SET(vsc_addr, &in, flag, 1); + pci_write_config(dev, vsc_addr + MLX5_VSC_DATA_OFFSET, *data, 4); + pci_write_config(dev, vsc_addr + MLX5_VSC_ADDR_OFFSET, in, 4); + + err = mlx5_vsc_wait_on_flag(mdev, 0); + if (err) + mlx5_core_warn(mdev, "Failed waiting for write flag!\n"); + + return err; +} + +int mlx5_vsc_read(struct mlx5_core_dev *mdev, u32 addr, u32 *data) +{ + device_t dev = mdev->pdev->dev.bsddev; + int vsc_addr = mdev->vsc_addr; + int err; + u32 in; + + if (!vsc_addr) { + mlx5_core_warn(mdev, "Unable to call vsc read, vsc_addr not initialized\n"); + return EINVAL; + } + + MLX5_VSC_SET(vsc_addr, &in, address, addr); + pci_write_config(dev, vsc_addr + MLX5_VSC_ADDR_OFFSET, in, 4); + + err = mlx5_vsc_wait_on_flag(mdev, 1); + if (err) { + mlx5_core_warn(mdev, "Failed waiting for read complete flag!\n"); + return err; + } + + *data = pci_read_config(dev, vsc_addr + MLX5_VSC_DATA_OFFSET, 4); + + return 0; +} + +int mlx5_vsc_find_cap(struct mlx5_core_dev *mdev) +{ + int *capreg = &mdev->vsc_addr; + int err; + + err = pci_find_cap(mdev->pdev->dev.bsddev, PCIY_VENDOR, capreg); + + if (err) + *capreg = 0; + + return err; +} + Modified: head/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- head/sys/dev/mlx5/mlx5_ifc.h Thu Mar 8 11:58:27 2018 (r330650) +++ head/sys/dev/mlx5/mlx5_ifc.h Thu Mar 8 11:59:47 2018 (r330651) @@ -9328,6 +9328,13 @@ struct mlx5_ifc_mtt_bits { u8 rd_en[0x1]; }; +/* Vendor Specific Capabilities, VSC */ +enum { + MLX5_VSC_DOMAIN_ICMD = 0x1, + MLX5_VSC_DOMAIN_PROTECTED_CRSPACE = 0x6, + MLX5_VSC_DOMAIN_SEMAPHORES = 0xA, +}; + struct mlx5_ifc_vendor_specific_cap_bits { u8 type[0x8]; u8 length[0x8]; Modified: head/sys/modules/mlx5/Makefile ============================================================================== --- head/sys/modules/mlx5/Makefile Thu Mar 8 11:58:27 2018 (r330650) +++ head/sys/modules/mlx5/Makefile Thu Mar 8 11:59:47 2018 (r330651) @@ -24,6 +24,7 @@ mlx5_srq.c \ mlx5_transobj.c \ mlx5_uar.c \ mlx5_vport.c \ +mlx5_vsc.c \ mlx5_wq.c \ device_if.h bus_if.h vnode_if.h pci_if.h \ opt_inet.h opt_inet6.h opt_rss.h From owner-svn-src-head@freebsd.org Thu Mar 8 12:42: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 16EB5F2DB25; Thu, 8 Mar 2018 12:42:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8D278996; Thu, 8 Mar 2018 12:42:43 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id A9907426FA2; Thu, 8 Mar 2018 23:42:34 +1100 (AEDT) Date: Thu, 8 Mar 2018 23:42:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r315480 - in head/sys: dev/syscons dev/vt kern teken In-Reply-To: Message-ID: <20180308225049.S1249@besplex.bde.org> References: <201703181113.v2IBDs2T090790@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=JqhwoUi6xzlgNkRkyysA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 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 Mar 2018 12:42:44 -0000 On Wed, 7 Mar 2018, Eitan Adler wrote: > On 18 March 2017 at 04:13, Bruce Evans wrote: >> Author: bde >> Date: Sat Mar 18 11:13:54 2017 >> New Revision: 315480 >> URL: https://svnweb.freebsd.org/changeset/base/315480 >> >> Log: >> Fix bright colors for syscons, and make them work for the first time >> for vt. Restore syscons' rendering of background (bg) brightness as >> foreground (fg) blinking and vice versa, and add rendering of blinking >> as background brightness to vt. > > Is this one safe to MFC ? Fairly safe, except it might depend on my previous changes in syscons. They were fairly carefully ordered. You probably want all of them except colorized kernel console output with default colors that not everyone would like. Syscons an be fixed much more easily by not using scteken (teken upper layers and scteken.c). scterm-sc.c from FreeBSD-7 requires only 46 lines of patches to work again. Known lost functionality in scteken will take an estimated 2000 lines of patches to fix. I have written about 1/3 of these. Bruce From owner-svn-src-head@freebsd.org Thu Mar 8 14:33: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 D3338F36D55; Thu, 8 Mar 2018 14:33:59 +0000 (UTC) (envelope-from slavash@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 7CCC47D16A; Thu, 8 Mar 2018 14:33:59 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 760D912065; Thu, 8 Mar 2018 14:33:59 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28EXxWB074724; Thu, 8 Mar 2018 14:33:59 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28EXxYJ074723; Thu, 8 Mar 2018 14:33:59 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201803081433.w28EXxYJ074723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Thu, 8 Mar 2018 14:33:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330652 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 330652 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:34:00 -0000 Author: slavash Date: Thu Mar 8 14:33:59 2018 New Revision: 330652 URL: https://svnweb.freebsd.org/changeset/base/330652 Log: Add myself and Hans Petter Selasky Approved by: hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Thu Mar 8 11:59:47 2018 (r330651) +++ head/share/misc/committers-src.dot Thu Mar 8 14:33:59 2018 (r330652) @@ -187,6 +187,7 @@ gshapiro [label="Gregory Shapiro\ngshapiro@FreeBSD.org harti [label="Hartmut Brandt\nharti@FreeBSD.org\n2003/01/29"] hiren [label="Hiren Panchasara\nhiren@FreeBSD.org\n2013/04/12"] hmp [label="Hiten Pandya\nhmp@FreeBSD.org\n2004/03/23"] +hselasky [label="Hans Petter Selasky\nhselasky@FreeBSD.org\n"] ian [label="Ian Lepore\nian@FreeBSD.org\n2013/01/07"] iedowse [label="Ian Dowse\niedowse@FreeBSD.org\n2000/12/01"] imp [label="Warner Losh\nimp@FreeBSD.org\n1996/09/20"] @@ -313,6 +314,7 @@ shurd [label="Stephen Hurd\nshurd@FreeBSD.org\n2017/09 simon [label="Simon L. Nielsen\nsimon@FreeBSD.org\n2006/03/07"] sjg [label="Simon J. Gerraty\nsjg@FreeBSD.org\n2012/10/23"] skra [label="Svatopluk Kraus\nskra@FreeBSD.org\n2015/10/28"] +slavash [label="Slava Shwartsman\nslavash@FreeBSD.org\n2018/02/08"] slm [label="Stephen McConnell\nslm@FreeBSD.org\n2014/05/07"] smh [label="Steven Hartland\nsmh@FreeBSD.org\n2012/11/12"] sobomax [label="Maxim Sobolev\nsobomax@FreeBSD.org\n2001/07/25"] @@ -524,6 +526,8 @@ grog -> edwin grog -> le grog -> peterj +hselasky -> slavash + imp -> akiyama imp -> ambrisko imp -> andrew @@ -640,6 +644,7 @@ kib -> rdivacky kib -> rmacklem kib -> rmh kib -> skra +kib -> slavash kib -> stas kib -> tijl kib -> trociny From owner-svn-src-head@freebsd.org Thu Mar 8 15:21: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 126E1F3AE98; Thu, 8 Mar 2018 15:21:58 +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 B760D7F1D4; Thu, 8 Mar 2018 15:21:57 +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 B229E12815; Thu, 8 Mar 2018 15:21:57 +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 w28FLvT0099477; Thu, 8 Mar 2018 15:21:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28FLudP099465; Thu, 8 Mar 2018 15:21:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081521.w28FLudP099465@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 15:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330653 - in head: etc/mtree include share/man/man4 share/man/man5 share/mk sys/conf sys/dev/mlx5 sys/dev/mlx5/mlx5_core sys/modules/mlx5 targets/pseudo/userland tools/build/options usr... X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: etc/mtree include share/man/man4 share/man/man5 share/mk sys/conf sys/dev/mlx5 sys/dev/mlx5/mlx5_core sys/modules/mlx5 targets/pseudo/userland tools/build/options usr.sbin usr.sbin/mlx5tool X-SVN-Commit-Revision: 330653 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:21:58 -0000 Author: hselasky Date: Thu Mar 8 15:21:56 2018 New Revision: 330653 URL: https://svnweb.freebsd.org/changeset/base/330653 Log: Add kernel and userspace code to dump the firmware state of supported ConnectX-4/5 devices in mlx5core. The dump is obtained by reading a predefined register map from the non-destructive crspace, accessible by the vendor-specific PCIe capability (VSC). The dump is stored in preallocated kernel memory and managed by the mlx5tool(8), which communicates with the driver using a character device node. The utility allows to store the dump in format
into a file, to reset the dump content, and to manually initiate the dump. A call to mlx5_fwdump() should be added at the places where a dump must be fetched automatically. The most likely place is right before a firmware reset request. Submitted by: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies Added: head/share/man/man4/mlx5io.4 (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_fwdump_regmaps.c (contents, props changed) head/sys/dev/mlx5/mlx5io.h (contents, props changed) head/tools/build/options/WITHOUT_MLX5TOOL (contents, props changed) head/tools/build/options/WITH_MLX5TOOL (contents, props changed) head/usr.sbin/mlx5tool/ head/usr.sbin/mlx5tool/Makefile (contents, props changed) head/usr.sbin/mlx5tool/mlx5tool.8 (contents, props changed) head/usr.sbin/mlx5tool/mlx5tool.c (contents, props changed) Modified: head/etc/mtree/BSD.include.dist head/include/Makefile head/share/man/man4/Makefile head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk head/sys/conf/files head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_main.c head/sys/modules/mlx5/Makefile head/targets/pseudo/userland/Makefile.depend head/usr.sbin/Makefile Modified: head/etc/mtree/BSD.include.dist ============================================================================== --- head/etc/mtree/BSD.include.dist Thu Mar 8 14:33:59 2018 (r330652) +++ head/etc/mtree/BSD.include.dist Thu Mar 8 15:21:56 2018 (r330653) @@ -132,6 +132,8 @@ .. mfi .. + mlx5 + .. mmc .. mpt Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Thu Mar 8 14:33:59 2018 (r330652) +++ head/include/Makefile Thu Mar 8 15:21:56 2018 (r330653) @@ -255,6 +255,11 @@ copies: .PHONY .META ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nvpair.h \ ${SDESTDIR}${INCLUDEDIR}/sys .endif +.if ${MK_MLX5TOOL} != "no" + cd ${SRCTOP}/sys/dev/mlx5; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 mlx5io.h \ + ${SDESTDIR}${INCLUDEDIR}/dev/mlx5 +.endif symlinks: .PHONY .META @${ECHO} "Setting up symlinks to kernel source tree..." @@ -384,6 +389,10 @@ symlinks: .PHONY .META ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/rpc/$$h \ ${SDESTDIR}${INCLUDEDIR}/rpc; \ done +.if ${MK_MLX5TOOL} != "no" + ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/mlx5/mlx5io.h \ + ${SDESTDIR}${INCLUDEDIR}/dev/mlx5 +.endif .include Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Mar 8 14:33:59 2018 (r330652) +++ head/share/man/man4/Makefile Thu Mar 8 15:21:56 2018 (r330653) @@ -928,6 +928,10 @@ MAN+= mlx4ib.4 MAN+= mlx5ib.4 .endif +.if ${MK_MLX5TOOL} != "no" +MAN+= mlx5io.4 +.endif + .if ${MK_TESTS} != "no" ATF= ${SRCTOP}/contrib/atf .PATH: ${ATF}/doc Added: head/share/man/man4/mlx5io.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mlx5io.4 Thu Mar 8 15:21:56 2018 (r330653) @@ -0,0 +1,142 @@ +.\" +.\" Copyright (c) 2018 Mellanox Technologies +.\" 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 20, 2018 +.Dt mlx5io 4 +.Os +.Sh NAME +.Nm mlx5io +.Nd IOCTL interface to manage Connect-X 4/5 Mellanox network adapters +.Sh SYNOPSIS +.In dev/mlx5/mlx5io.h +.Sh DESCRIPTION +The +.Nm +interface is provided for management of the Connect-X 4 and 5 network adapters +in the aspects not covered by the generic network configuration, +mostly related to the PCIe attachment and internal card working. +Interface consists of the commands, which are passed by means of +.Xr ioctl 2 +on the file descriptor, opened from the +.Pa /dev/mlx5ctl +device node. +.Pp +The following commands are implemented: +.Bl -tag -width indent +.It Dv MLX5_FWDUMP_FORCE +Take the snapshot of the firmware registers state and store it in the +kernel buffer. +The buffer must be empty, in other words, no dumps should be written so +far, or existing dump cleared with the +.Dv MLX5_FWDUMP_RESET +command for the specified device. +The argument for the command should point to the +.Vt struct mlx5_fwdump_addr +structure, containing the PCIe bus address of the device. +.Bd -literal +struct mlx5_fwdump_addr { + uint32_t domain; + uint8_t bus; + uint8_t slot; + uint8_t func; +}; +.Ed +.It Dv MLX5_FWDUMP_RESET +Clear the stored firmware dump, preparing the kernel buffer for +the next dump. +The argument for the command should point to the +.Vt struct mlx5_fwdump_addr +structure, containing the PCIe bus address of the device. +.It Dv MLX5_FWDUMP_GET +Fetch the stored firmware dump into the user memory. +The argument to the command should point to the input/output +.Vt struct mlx5_fwdump_get +structure. +Its +.Dv devaddr +field specifies the address of the device, the +.Dv buf +fields points to the array of +.Vt struct mlx5_fwdump_reg +of records of the registers values, the size of the array is specified +in the +.Dv reg_cnt +field. +.Bd -literal +struct mlx5_fwdump_get { + struct mlx5_fwdump_addr devaddr; + struct mlx5_fwdump_reg *buf; + size_t reg_cnt; + size_t reg_filled; /* out */ +}; +.Ed +.Pp +On successfull return, the +.Dv reg_filled +field reports the number of the +.Dv buf +array elements actually filled with the registers values. +If +.Dv buf +contains the +.Dv NULL +pointer, no registers are filled, but +.Dv reg_filled +still contains the number of registers that should be passed for +the complete dump. +.Pp +The +.Vt struct mlx5_fwdump_reg +element contains the address of the register in the field +.Dv addr , +and its value in the field +.Dv val . +.Bd -literal +struct mlx5_fwdump_reg { + uint32_t addr; + uint32_t val; +}; +.Ed +.El +.Sh FILES +The +.Pa /dev/mlx5ctl +.Xr devfs 5 +node is used to pass commands to the driver. +.Sh RETURN VALUES +If successful, the IOCTL returns zero. +Otherwise, -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh SEE ALSO +.Xr errno 2 , +.Xr ioctl 2 , +.Xr mlx5en 4 , +.Xr mlx5ib 4 , +.Xr mlx5tool 8 +and +.Xr pci 9 . Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Mar 8 14:33:59 2018 (r330652) +++ head/share/man/man5/src.conf.5 Thu Mar 8 15:21:56 2018 (r330653) @@ -436,12 +436,18 @@ Set to not build CUSE-related programs and libraries. .It Va WITHOUT_CXGBETOOL Set to not build .Xr cxgbetool 8 +.It Va WITHOUT_MLX5TOOL +Set to not build +.Xr mlx5tool 8 .Pp This is a default setting on arm/arm, arm/armeb, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 +.It Va WITH_MLX5TOOL +Set to build +.Xr mlx5tool 8 .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and sparc64/sparc64. Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Thu Mar 8 14:33:59 2018 (r330652) +++ head/share/mk/src.opts.mk Thu Mar 8 15:21:56 2018 (r330653) @@ -320,8 +320,10 @@ BROKEN_OPTIONS+=PROFILE .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ ${__T} == "powerpc64" || ${__T} == "sparc64" __DEFAULT_YES_OPTIONS+=CXGBETOOL +__DEFAULT_YES_OPTIONS+=MLX5TOOL .else __DEFAULT_NO_OPTIONS+=CXGBETOOL +__DEFAULT_NO_OPTIONS+=MLX5TOOL .endif .include Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Mar 8 14:33:59 2018 (r330652) +++ head/sys/conf/files Thu Mar 8 15:21:56 2018 (r330653) @@ -4731,6 +4731,10 @@ dev/mlx5/mlx5_core/mlx5_fs_tree.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_fw.c optional mlx5 pci \ compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_fwdump.c optional mlx5 pci \ + compile-with "${OFED_C}" +dev/mlx5/mlx5_core/mlx5_fwdump_regmaps.c optional mlx5 pci \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_health.c optional mlx5 pci \ compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_mad.c optional mlx5 pci \ Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Thu Mar 8 14:33:59 2018 (r330652) +++ head/sys/dev/mlx5/driver.h Thu Mar 8 15:21:56 2018 (r330653) @@ -615,6 +615,7 @@ struct mlx5_special_contexts { }; struct mlx5_flow_root_namespace; +struct mlx5_dump_data; struct mlx5_core_dev { struct pci_dev *pdev; /* sync pci state */ @@ -648,6 +649,7 @@ struct mlx5_core_dev { struct mlx5_flow_root_namespace *sniffer_rx_root_ns; struct mlx5_flow_root_namespace *sniffer_tx_root_ns; u32 num_q_counter_allocated[MLX5_INTERFACE_NUMBER]; + struct mlx5_dump_data *dump_data; }; enum { Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Thu Mar 8 14:33:59 2018 (r330652) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Thu Mar 8 15:21:56 2018 (r330653) @@ -80,4 +80,17 @@ void mlx5e_cleanup(void); int mlx5_rename_eq(struct mlx5_core_dev *dev, int eq_ix, char *name); +int mlx5_fwdump_init(void); +void mlx5_fwdump_fini(void); +int mlx5_fwdump_prep(struct mlx5_core_dev *mdev); +void mlx5_fwdump(struct mlx5_core_dev *mdev); +void mlx5_fwdump_clean(struct mlx5_core_dev *mdev); + +struct mlx5_crspace_regmap { + uint32_t addr; + unsigned cnt; +}; + +extern struct pci_driver mlx5_core_driver; + #endif /* __MLX5_CORE_H__ */ Added: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Thu Mar 8 15:21:56 2018 (r330653) @@ -0,0 +1,308 @@ +/*- + * Copyright (c) 2018, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +extern const struct mlx5_crspace_regmap mlx5_crspace_regmap_mt4117[]; +extern const struct mlx5_crspace_regmap mlx5_crspace_regmap_mt4115[]; +extern const struct mlx5_crspace_regmap mlx5_crspace_regmap_connectx5[]; + +struct mlx5_dump_data { + const struct mlx5_crspace_regmap *rege; + uint32_t *dump; + unsigned dump_size; + int dump_valid; + struct mtx dump_lock; +}; + +static MALLOC_DEFINE(M_MLX5_DUMP, "MLX5DUMP", "MLX5 Firmware dump"); + +static unsigned +mlx5_fwdump_getsize(const struct mlx5_crspace_regmap *rege) +{ + const struct mlx5_crspace_regmap *r; + unsigned sz; + + for (sz = 0, r = rege; r->cnt != 0; r++) + sz += r->cnt; + return (sz); +} + +static void +mlx5_fwdump_destroy_dd(struct mlx5_dump_data *dd) +{ + + mtx_destroy(&dd->dump_lock); + free(dd->dump, M_MLX5_DUMP); + free(dd, M_MLX5_DUMP); +} + +int +mlx5_fwdump_prep(struct mlx5_core_dev *mdev) +{ + struct mlx5_dump_data *dd; + int error; + + error = mlx5_vsc_find_cap(mdev); + if (error != 0) + return (error); + dd = malloc(sizeof(struct mlx5_dump_data), M_MLX5_DUMP, M_WAITOK); + switch (pci_get_device(mdev->pdev->dev.bsddev)) { + case 0x1013: + dd->rege = mlx5_crspace_regmap_mt4115; + break; + case 0x1015: + dd->rege = mlx5_crspace_regmap_mt4117; + break; + case 0x1017: + case 0x1019: + dd->rege = mlx5_crspace_regmap_connectx5; + break; + default: + free(dd, M_MLX5_DUMP); + return (0); /* silently fail to not prevent driver attach */ + } + dd->dump_size = mlx5_fwdump_getsize(dd->rege); + dd->dump = malloc(dd->dump_size * sizeof(uint32_t), M_MLX5_DUMP, + M_WAITOK | M_ZERO); + dd->dump_valid = 0; + mtx_init(&dd->dump_lock, "mlx5dmp", NULL, MTX_DEF | MTX_NEW); + if (atomic_cmpset_rel_ptr((uintptr_t *)&mdev->dump_data, 0, + (uintptr_t)dd) == 0) + mlx5_fwdump_destroy_dd(dd); + return (0); +} + +void +mlx5_fwdump(struct mlx5_core_dev *mdev) +{ + struct mlx5_dump_data *dd; + const struct mlx5_crspace_regmap *r; + uint32_t i, ri; + int error; + + dd = (struct mlx5_dump_data *)atomic_load_acq_ptr((uintptr_t *) + &mdev->dump_data); + if (dd == NULL) + return; + mtx_lock(&dd->dump_lock); + if (dd->dump_valid) + /* only one dump */ + goto failed; + + /* mlx5_vsc already warns, be silent. */ + error = mlx5_vsc_lock(mdev); + if (error != 0) + goto failed; + error = mlx5_vsc_set_space(mdev, MLX5_VSC_DOMAIN_PROTECTED_CRSPACE); + if (error != 0) + goto unlock_vsc; + for (i = 0, r = dd->rege; r->cnt != 0; r++) { + for (ri = 0; ri < r->cnt; ri++) { + error = mlx5_vsc_read(mdev, r->addr + ri * 4, + &dd->dump[i]); + if (error != 0) + goto unlock_vsc; + i++; + } + } + atomic_store_rel_int(&dd->dump_valid, 1); +unlock_vsc: + mlx5_vsc_unlock(mdev); +failed: + mtx_unlock(&dd->dump_lock); +} + +void +mlx5_fwdump_clean(struct mlx5_core_dev *mdev) +{ + struct mlx5_dump_data *dd; + + for (;;) { + dd = mdev->dump_data; + if (dd == NULL) + return; + if (atomic_cmpset_ptr((uintptr_t *)&mdev->dump_data, + (uintptr_t)dd, 0) == 1) { + mlx5_fwdump_destroy_dd(dd); + return; + } + } +} + +static int +mlx5_dbsf_to_core(const struct mlx5_fwdump_addr *devaddr, + struct mlx5_core_dev **mdev) +{ + device_t dev; + struct pci_dev *pdev; + + dev = pci_find_dbsf(devaddr->domain, devaddr->bus, devaddr->slot, + devaddr->func); + if (dev == NULL) + return (ENOENT); + if (device_get_devclass(dev) != mlx5_core_driver.bsdclass) + return (EINVAL); + pdev = device_get_softc(dev); + *mdev = pci_get_drvdata(pdev); + if (*mdev == NULL) + return (ENOENT); + return (0); +} + +static int +mlx5_fwdump_copyout(struct mlx5_dump_data *dd, struct mlx5_fwdump_get *fwg) +{ + const struct mlx5_crspace_regmap *r; + struct mlx5_fwdump_reg rv, *urv; + uint32_t i, ri; + int error; + + if (dd == NULL) + return (ENOENT); + if (fwg->buf == NULL) { + fwg->reg_filled = dd->dump_size; + return (0); + } + if (atomic_load_acq_int(&dd->dump_valid) == 0) + return (ENOENT); + + urv = fwg->buf; + for (i = 0, r = dd->rege; r->cnt != 0; r++) { + for (ri = 0; ri < r->cnt; ri++) { + if (i >= fwg->reg_cnt) + goto out; + rv.addr = r->addr + ri * 4; + rv.val = dd->dump[i]; + error = copyout(&rv, urv, sizeof(rv)); + if (error != 0) + return (error); + urv++; + i++; + } + } +out: + fwg->reg_filled = i; + return (0); +} + +static int +mlx5_fwdump_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, + struct thread *td) +{ + struct mlx5_core_dev *mdev; + struct mlx5_fwdump_get *fwg; + struct mlx5_fwdump_addr *devaddr; + struct mlx5_dump_data *dd; + int error; + + error = 0; + switch (cmd) { + case MLX5_FWDUMP_GET: + if ((fflag & FREAD) == 0) { + error = EBADF; + break; + } + fwg = (struct mlx5_fwdump_get *)data; + devaddr = &fwg->devaddr; + error = mlx5_dbsf_to_core(devaddr, &mdev); + if (error != 0) + break; + error = mlx5_fwdump_copyout(mdev->dump_data, fwg); + break; + case MLX5_FWDUMP_RESET: + if ((fflag & FWRITE) == 0) { + error = EBADF; + break; + } + devaddr = (struct mlx5_fwdump_addr *)data; + error = mlx5_dbsf_to_core(devaddr, &mdev); + if (error != 0) + break; + dd = mdev->dump_data; + if (dd != NULL) + atomic_store_rel_int(&dd->dump_valid, 0); + else + error = ENOENT; + break; + case MLX5_FWDUMP_FORCE: + if ((fflag & FWRITE) == 0) { + error = EBADF; + break; + } + devaddr = (struct mlx5_fwdump_addr *)data; + error = mlx5_dbsf_to_core(devaddr, &mdev); + if (error != 0) + break; + mlx5_fwdump(mdev); + break; + default: + error = ENOTTY; + break; + } + return (error); +} + +static struct cdevsw mlx5_fwdump_devsw = { + .d_version = D_VERSION, + .d_ioctl = mlx5_fwdump_ioctl, +}; + +static struct cdev *mlx5_fwdump_dev; + +int +mlx5_fwdump_init(void) +{ + struct make_dev_args mda; + int error; + + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_WAITOK | MAKEDEV_CHECKNAME; + mda.mda_devsw = &mlx5_fwdump_devsw; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_OPERATOR; + mda.mda_mode = 0640; + error = make_dev_s(&mda, &mlx5_fwdump_dev, "mlx5ctl"); + return (-error); +} + +void +mlx5_fwdump_fini(void) +{ + + if (mlx5_fwdump_dev != NULL) + destroy_dev(mlx5_fwdump_dev); + +} Added: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump_regmaps.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump_regmaps.c Thu Mar 8 15:21:56 2018 (r330653) @@ -0,0 +1,11187 @@ +/*- + * Copyright (c) 2018, Mellanox Technologies, Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS `AS IS' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +const struct mlx5_crspace_regmap mlx5_crspace_regmap_mt4117[] = { + {0x000000, 16388}, + {0x010084, 1}, + {0x01008c, 2}, + {0x010180, 6}, + {0x01019c, 9}, + {0x010304, 1}, + {0x0103bc, 52}, + {0x010500, 35}, + {0x010604, 1}, + {0x01060c, 1}, + {0x010624, 1}, + {0x01062c, 1}, + {0x010644, 1}, + {0x01064c, 3}, + {0x010800, 1}, + {0x010814, 3}, + {0x010844, 1}, + {0x01084c, 4}, + {0x011000, 32}, + {0x011200, 32}, + {0x011400, 32}, + {0x011600, 32}, + {0x011800, 32}, + {0x011a00, 5}, + {0x011a24, 1}, + {0x011a2c, 1}, + {0x011a34, 3}, + {0x011a44, 1}, + {0x011a4c, 2}, + {0x012000, 20}, + {0x012088, 22}, + {0x012100, 18}, + {0x012200, 36}, + {0x012300, 3}, + {0x012310, 1}, + {0x012320, 1}, + {0x012330, 1}, + {0x012340, 1}, + {0x012350, 1}, + {0x012360, 1}, + {0x012370, 1}, + {0x012400, 166}, + {0x0126a0, 1}, + {0x012700, 32}, + {0x012800, 1}, + {0x012808, 1}, + {0x012810, 1}, + {0x012818, 1}, + {0x012820, 1}, + {0x012828, 1}, + {0x012830, 1}, + {0x012838, 1}, + {0x012850, 1}, + {0x012858, 1}, + {0x012860, 1}, + {0x012868, 1}, + {0x012870, 1}, + {0x012878, 1}, + {0x012880, 1}, + {0x012888, 1}, + {0x012890, 5}, + {0x012900, 10}, + {0x012940, 6}, + {0x012960, 6}, + {0x012980, 5}, + {0x012a00, 6}, + {0x012a40, 5}, + {0x012a80, 9}, + {0x012ac0, 19}, + {0x012b10, 2}, + {0x014000, 1}, + {0x014010, 10}, + {0x014104, 1}, + {0x01410c, 4}, + {0x014200, 1}, + {0x014210, 4}, + {0x014300, 4}, + {0x014400, 3}, + {0x014410, 1}, + {0x014444, 1}, + {0x01444c, 4}, + {0x014480, 2}, + {0x014500, 35}, + {0x014590, 1}, + {0x014600, 32}, + {0x014704, 1}, + {0x01470c, 1}, + {0x014804, 2}, + {0x014814, 3}, + {0x014824, 2}, + {0x014834, 3}, + {0x014844, 2}, + {0x014854, 5}, + {0x014a00, 4}, + {0x014a14, 2}, + {0x015004, 1}, + {0x01500c, 4}, + {0x015204, 1}, + {0x015214, 4}, + {0x015228, 1}, + {0x015244, 1}, + {0x015250, 4}, + {0x015274, 1}, + {0x01527c, 1}, + {0x0152a4, 1}, + {0x015300, 4}, + {0x015314, 1}, + {0x01531c, 3}, + {0x015404, 2}, + {0x015430, 20}, + {0x015484, 2}, + {0x015498, 5}, + {0x0154bc, 1}, + {0x0154c8, 1}, + {0x0154d4, 2}, + {0x01550c, 3}, + {0x015524, 3}, + {0x015608, 3}, + {0x015618, 4}, + {0x015680, 16}, + {0x015704, 2}, + {0x015730, 20}, + {0x015784, 3}, + {0x015794, 3}, + {0x0157c0, 6}, + {0x015800, 52}, + {0x0158d4, 1}, + {0x0158dc, 1}, + {0x0158e4, 3}, + {0x0158f4, 1}, + {0x0158fc, 52}, + {0x015b04, 2}, + {0x015b14, 3}, + {0x015b24, 2}, + {0x015b38, 6}, + {0x015b60, 5}, + {0x015c04, 1}, + {0x015cb8, 18}, + {0x015d98, 1}, + {0x015e00, 1}, + {0x015e08, 1}, + {0x015e10, 1}, + {0x016000, 32}, + {0x016100, 7}, + {0x016120, 2}, + {0x016144, 3}, + {0x016204, 1}, + {0x01620c, 1}, + {0x016224, 1}, + {0x01622c, 1}, + {0x016234, 1}, + {0x01623c, 1}, + {0x016244, 1}, + {0x01624c, 1}, + {0x016254, 1}, + {0x01625c, 2}, + {0x016270, 1}, + {0x016280, 1}, + {0x016290, 1}, + {0x0162a0, 1}, + {0x0162b0, 1}, + {0x0162c0, 1}, + {0x0162d0, 1}, + {0x0162e0, 1}, + {0x0162f0, 1}, + {0x016300, 1}, + {0x016310, 1}, + {0x016320, 1}, + {0x016330, 1}, + {0x016340, 32}, + {0x016400, 19}, + {0x016454, 7}, + {0x016484, 1}, + {0x01648c, 1}, + {0x016800, 9}, + {0x016840, 16}, + {0x017800, 1}, + {0x017828, 1}, + {0x017850, 1}, + {0x017878, 1}, + {0x0178a0, 12}, + {0x0179ac, 1}, + {0x0179d8, 4}, + {0x017a00, 6}, + {0x017a20, 6}, + {0x017a40, 3}, + {0x017c00, 6}, + {0x017c20, 6}, + {0x017c40, 6}, + {0x017c60, 6}, + {0x017c80, 6}, + {0x017ca0, 6}, + {0x017cc0, 6}, + {0x017ce0, 6}, + {0x017d00, 3}, + {0x017d10, 6}, + {0x018400, 11}, + {0x018430, 2}, + {0x018440, 4}, + {0x018604, 1}, + {0x018618, 2}, + {0x018640, 4}, + {0x018660, 2}, + {0x018800, 1}, + {0x018810, 4}, + {0x018844, 1}, + {0x01884c, 4}, + {0x018880, 2}, + {0x01a400, 12}, + {0x01a444, 1}, + {0x01a44c, 1}, + {0x01a800, 1}, + {0x01a814, 3}, + {0x01a844, 1}, + {0x01a84c, 4}, + {0x01c400, 7}, + {0x01c500, 8}, + {0x01c544, 1}, + {0x01c554, 3}, + {0x01c564, 3}, + {0x01c574, 3}, + {0x01c604, 1}, + {0x01c60c, 3}, + {0x01c800, 1}, + {0x01c814, 3}, + {0x01c844, 1}, + {0x01c84c, 4}, + {0x01f000, 1}, + {0x01f400, 1}, + {0x01f408, 4}, + {0x01f41c, 3}, + {0x01f500, 2}, + {0x01f800, 1}, + {0x01f814, 3}, + {0x01f844, 1}, + {0x01f84c, 4}, + {0x01f880, 3}, + {0x020004, 1}, + {0x02000c, 4}, + {0x020080, 3}, + {0x020090, 5}, + {0x020800, 16}, + {0x020900, 192}, + {0x021004, 1}, + {0x02100c, 4}, + {0x021400, 5}, + {0x021418, 5}, + {0x021480, 1}, + {0x021704, 2}, + {0x02173c, 17}, + {0x0217fc, 2}, + {0x021844, 1}, + {0x022280, 12}, + {0x022408, 6}, + {0x022444, 1}, + {0x022454, 3}, + {0x022504, 1}, + {0x02250c, 4}, + {0x022624, 1}, + {0x02262c, 3}, + {0x02263c, 1}, + {0x022804, 1}, + {0x02280c, 4}, + {0x022904, 4}, + {0x022924, 4}, + {0x024000, 36}, + {0x0240c0, 21}, + {0x024120, 11}, + {0x024200, 5}, + {0x024220, 1}, + {0x024230, 8}, + {0x024258, 1}, + {0x024260, 1}, + {0x024270, 9}, + {0x0242a0, 1}, + {0x0242b0, 4}, + {0x0242c8, 2}, + {0x024300, 5}, + {0x024318, 2}, + {0x02439c, 25}, + {0x024424, 4}, + {0x024464, 13}, + {0x0244a4, 1}, + {0x0244ac, 3}, + {0x0244c0, 2}, + {0x0244d0, 3}, + {0x0244e0, 3}, + {0x0244f0, 3}, + {0x024500, 3}, + {0x024510, 3}, + {0x024520, 3}, + {0x024530, 3}, + {0x024884, 11}, + {0x0248b4, 3}, + {0x0248c4, 1}, + {0x0248cc, 1}, + {0x0248d4, 1}, + {0x0248dc, 1}, + {0x0248f0, 2}, + {0x024908, 6}, + {0x024928, 6}, + {0x024968, 6}, + {0x024984, 3}, + {0x024994, 1}, + {0x02499c, 6}, + {0x0249b8, 7}, + {0x024a08, 6}, + {0x024a28, 6}, + {0x024a68, 6}, + {0x024a84, 1}, + {0x024a8c, 1}, + {0x024a94, 1}, + {0x024a9c, 13}, + {0x024ae0, 6}, + {0x024b00, 7}, + {0x024b20, 6}, + {0x024b40, 8}, + {0x024c00, 2}, + {0x024c24, 3}, + {0x024c34, 3}, + {0x025004, 6}, + {0x025800, 37}, + {0x025904, 1}, + {0x02590c, 1}, + {0x026000, 99}, + {0x026200, 1}, + {0x026800, 7}, + {0x026824, 6}, + {0x026840, 2}, + {0x026864, 1}, + {0x02686c, 1}, + {0x026874, 3}, + {0x026884, 1}, + {0x0268a4, 7}, + {0x026904, 1}, + {0x02690c, 4}, + {0x026940, 1}, + {0x026980, 33}, + {0x026a0c, 7}, + {0x026a30, 1}, + {0x026a44, 4}, + {0x026a60, 1}, + {0x026a70, 1}, + {0x026b00, 9}, + {0x026b44, 2}, + {0x026b68, 6}, + {0x026b84, 2}, + {0x026ba8, 14}, + {0x026c00, 16}, + {0x026c44, 1}, + {0x026c4c, 1}, + {0x026c84, 1}, + {0x026c8c, 4}, + {0x026cc4, 1}, + {0x026ccc, 4}, + {0x026d00, 2}, + {0x028800, 2}, + {0x028844, 1}, + {0x02884c, 4}, + {0x029004, 7}, + {0x029b30, 2}, + {0x029b50, 4}, + {0x02a004, 1}, + {0x02a00c, 4}, + {0x02a040, 6}, + {0x02a200, 1}, + {0x02a210, 11}, + {0x02a240, 8}, + {0x02a484, 1}, + {0x02a4c0, 16}, + {0x02a780, 1}, + {0x02a7a0, 4}, + {0x02a7c0, 1}, + {0x02a900, 1}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Mar 8 15:28: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 39811F3B7AE; Thu, 8 Mar 2018 15:28:14 +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 E06817F870; Thu, 8 Mar 2018 15:28:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB6C712850; Thu, 8 Mar 2018 15:28:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28FSDj9001079; Thu, 8 Mar 2018 15:28:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28FSD4M001078; Thu, 8 Mar 2018 15:28:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081528.w28FSD4M001078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 15:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330654 - head/usr.sbin/mlx5tool X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/usr.sbin/mlx5tool X-SVN-Commit-Revision: 330654 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:28:14 -0000 Author: hselasky Date: Thu Mar 8 15:28:13 2018 New Revision: 330654 URL: https://svnweb.freebsd.org/changeset/base/330654 Log: Check that the address is specified in mlx5tool(8). Submitted by: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/usr.sbin/mlx5tool/mlx5tool.c Modified: head/usr.sbin/mlx5tool/mlx5tool.c ============================================================================== --- head/usr.sbin/mlx5tool/mlx5tool.c Thu Mar 8 15:21:56 2018 (r330653) +++ head/usr.sbin/mlx5tool/mlx5tool.c Thu Mar 8 15:28:13 2018 (r330654) @@ -47,6 +47,10 @@ parse_pci_addr(const char *addrstr, struct mlx5_fwdump unsigned long selarr[4]; int i; + if (addrstr == NULL) { + warnx("no pci address specified"); + return (1); + } if (strncmp(addrstr, "pci", 3) == 0) { addrstr += 3; i = 0; From owner-svn-src-head@freebsd.org Thu Mar 8 15:37: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 A3B72F3C4ED; Thu, 8 Mar 2018 15:37:10 +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 4F9848005D; Thu, 8 Mar 2018 15:37:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A5A3129F1; Thu, 8 Mar 2018 15:37:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28FbAhs005816; Thu, 8 Mar 2018 15:37:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28FbAxk005815; Thu, 8 Mar 2018 15:37:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081537.w28FbAxk005815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 15:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330655 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 330655 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:37:10 -0000 Author: hselasky Date: Thu Mar 8 15:37:09 2018 New Revision: 330655 URL: https://svnweb.freebsd.org/changeset/base/330655 Log: Remove duplicate prototypes. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/cmd.h Modified: head/sys/dev/mlx5/cmd.h ============================================================================== --- head/sys/dev/mlx5/cmd.h Thu Mar 8 15:28:13 2018 (r330654) +++ head/sys/dev/mlx5/cmd.h Thu Mar 8 15:37:09 2018 (r330655) @@ -50,11 +50,4 @@ int mlx5_cmd_query_cong_params(struct mlx5_core_dev *d void *out, int out_size); int mlx5_cmd_modify_cong_params(struct mlx5_core_dev *mdev, void *in, int in_size); -struct mlx5_core_dev; -int mlx5_cmd_query_cong_counter(struct mlx5_core_dev *dev, - bool reset, void *out, int out_size); -int mlx5_cmd_query_cong_params(struct mlx5_core_dev *dev, int cong_point, - void *out, int out_size); -int mlx5_cmd_modify_cong_params(struct mlx5_core_dev *mdev, - void *in, int in_size); #endif /* MLX5_CMD_H */ From owner-svn-src-head@freebsd.org Thu Mar 8 15:43: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 DA328F3D17F; Thu, 8 Mar 2018 15:43:41 +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 8C391811C6; Thu, 8 Mar 2018 15:43:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 871D712BA1; Thu, 8 Mar 2018 15:43:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28FhfQe012152; Thu, 8 Mar 2018 15:43:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28FhfL3012151; Thu, 8 Mar 2018 15:43:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081543.w28FhfL3012151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 15:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330656 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 330656 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:43:42 -0000 Author: hselasky Date: Thu Mar 8 15:43:41 2018 New Revision: 330656 URL: https://svnweb.freebsd.org/changeset/base/330656 Log: Use the device unit number for naming the ifnet interface in mlx5en(4). Currently the ifnet interface is named mceX, where X is a monotonically incremented value. If the device is reset due to a fatal error, then the interface name will change. Using the device unit number will keep the naming consistent across the reset logic. Submitted by: Matthew Finlay MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Mar 8 15:37:09 2018 (r330655) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Mar 8 15:43:41 2018 (r330656) @@ -3442,7 +3442,6 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv) static void * mlx5e_create_ifp(struct mlx5_core_dev *mdev) { - static volatile int mlx5_en_unit; struct ifnet *ifp; struct mlx5e_priv *priv; u8 dev_addr[ETHER_ADDR_LEN] __aligned(4); @@ -3466,7 +3465,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) goto err_free_priv; } ifp->if_softc = priv; - if_initname(ifp, "mce", atomic_fetchadd_int(&mlx5_en_unit, 1)); + if_initname(ifp, "mce", device_get_unit(mdev->pdev->dev.bsddev)); ifp->if_mtu = ETHERMTU; ifp->if_init = mlx5e_open; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; From owner-svn-src-head@freebsd.org Thu Mar 8 15:47: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 E6EB6F3D558; Thu, 8 Mar 2018 15:47:18 +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 9661E813D9; Thu, 8 Mar 2018 15:47:18 +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 7168E12BA3; Thu, 8 Mar 2018 15:47:18 +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 w28FlI7Q012380; Thu, 8 Mar 2018 15:47:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28FlIFT012379; Thu, 8 Mar 2018 15:47:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081547.w28FlIFT012379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 15:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330657 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 330657 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:47:19 -0000 Author: hselasky Date: Thu Mar 8 15:47:17 2018 New Revision: 330657 URL: https://svnweb.freebsd.org/changeset/base/330657 Log: Use vport rather than physical-port MTU in mlx5en(4). Set and report vport MTU rather than physical MTU, The driver will set both vport and physical port mtu and will rely on the query of vport mtu. SRIOV VFs have to report their MTU to their vport manager (PF), and this will allow them to work with any MTU they need without failing the request. Also for some cases where the PF is not a port owner, PF can work with MTU less than the physical port mtu if set physical port mtu didn't take effect. Based on Linux upstream commit: cd255efff9baadd654d6160e52d17ae7c568c9d3 Submitted by: Meny Yossefi MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Mar 8 15:43:41 2018 (r330656) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Mar 8 15:47:17 2018 (r330657) @@ -2442,15 +2442,29 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp, int sw_mtu) int hw_mtu; int err; - err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); + hw_mtu = MLX5E_SW2HW_MTU(sw_mtu); + + err = mlx5_set_port_mtu(mdev, hw_mtu); if (err) { if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", __func__, sw_mtu, err); return (err); } + /* Update vport context MTU */ + err = mlx5_set_vport_mtu(mdev, hw_mtu); + if (err) { + if_printf(ifp, "%s: Failed updating vport context with MTU size, err=%d\n", + __func__, err); + } + ifp->if_mtu = sw_mtu; - err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); + + err = mlx5_query_vport_mtu(mdev, &hw_mtu); + if (err || !hw_mtu) { + /* fallback to port oper mtu */ + err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); + } if (err) { if_printf(ifp, "Query port MTU, after setting new " "MTU value, failed\n"); From owner-svn-src-head@freebsd.org Thu Mar 8 15:53: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 55D59F3DEF6; Thu, 8 Mar 2018 15:53:05 +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 042FC81A85; Thu, 8 Mar 2018 15:53:05 +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 D957012D2A; Thu, 8 Mar 2018 15:53:04 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28Fr49R017273; Thu, 8 Mar 2018 15:53:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28Fr418017272; Thu, 8 Mar 2018 15:53:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081553.w28Fr418017272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 15:53:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330658 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 330658 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:53:05 -0000 Author: hselasky Date: Thu Mar 8 15:53:04 2018 New Revision: 330658 URL: https://svnweb.freebsd.org/changeset/base/330658 Log: Fix mlx5en(4) driver to properly call m_defrag(). When the mlx5en(4) driver was converted to using BUSDMA(9) the call to m_defrag() was moved after the part of the TX routine that strips the header from the mbuf chain. Before it called m_defrag it first trimmed off the now-empty mbufs from the start of the chain. This has the side effect of also removing the head of the chain that has M_PKTHDR set. m_defrag() will not defrag a chain that does not have M_PKTHDR set, thus it was effectively never defragging the mbuf chains. As it turns out, trimming the mbufs in this fashion is unnecessary since the call to bus_dmamap_load_mbuf_sg doesn't map empty mbufs anyway, so remove it. Differential Revision: https://reviews.freebsd.org/D12050 Submitted by: mjoras@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Mar 8 15:47:17 2018 (r330657) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Mar 8 15:53:04 2018 (r330658) @@ -311,22 +311,9 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struct mbuf **mbp) } dseg = ((struct mlx5_wqe_data_seg *)&wqe->ctrl) + ds_cnt; - /* Trim off empty mbufs */ - while (mb->m_len == 0) { - mb = m_free(mb); - /* Check if all data has been inlined */ - if (mb == NULL) - goto skip_dma; - } - err = bus_dmamap_load_mbuf_sg(sq->dma_tag, sq->mbuf[pi].dma_map, mb, segs, &nsegs, BUS_DMA_NOWAIT); if (err == EFBIG) { - /* - * Update *mbp before defrag in case it was trimmed in the - * loop above - */ - *mbp = mb; /* Update statistics */ sq->stats.defragged++; /* Too many mbuf fragments */ @@ -343,6 +330,17 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struct mbuf **mbp) if (err != 0) goto tx_drop; + /* Make sure all mbuf data, if any, is written to RAM */ + if (nsegs != 0) { + bus_dmamap_sync(sq->dma_tag, sq->mbuf[pi].dma_map, + BUS_DMASYNC_PREWRITE); + } else { + /* All data was inlined, free the mbuf. */ + bus_dmamap_unload(sq->dma_tag, sq->mbuf[pi].dma_map); + m_freem(mb); + mb = NULL; + } + for (x = 0; x != nsegs; x++) { if (segs[x].ds_len == 0) continue; @@ -351,7 +349,7 @@ mlx5e_sq_xmit(struct mlx5e_sq *sq, struct mbuf **mbp) dseg->byte_count = cpu_to_be32((uint32_t)segs[x].ds_len); dseg++; } -skip_dma: + ds_cnt = (dseg - ((struct mlx5_wqe_data_seg *)&wqe->ctrl)); wqe->ctrl.opmod_idx_opcode = cpu_to_be32((sq->pc << 8) | opcode); @@ -368,10 +366,6 @@ skip_dma: sq->mbuf[pi].mbuf = mb; sq->mbuf[pi].num_wqebbs = DIV_ROUND_UP(ds_cnt, MLX5_SEND_WQEBB_NUM_DS); sq->pc += sq->mbuf[pi].num_wqebbs; - - /* Make sure all mbuf data is written to RAM */ - if (mb != NULL) - bus_dmamap_sync(sq->dma_tag, sq->mbuf[pi].dma_map, BUS_DMASYNC_PREWRITE); sq->stats.packets++; *mbp = NULL; /* safety clear */ From owner-svn-src-head@freebsd.org Thu Mar 8 15:58: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 33697F3E5A5; Thu, 8 Mar 2018 15:58:31 +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 D9A5981D78; Thu, 8 Mar 2018 15:58:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D495912D34; Thu, 8 Mar 2018 15:58:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28FwUY4017513; Thu, 8 Mar 2018 15:58:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28FwUw9017510; Thu, 8 Mar 2018 15:58:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081558.w28FwUw9017510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 15:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330659 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 330659 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:58:31 -0000 Author: hselasky Date: Thu Mar 8 15:58:30 2018 New Revision: 330659 URL: https://svnweb.freebsd.org/changeset/base/330659 Log: Avoid more LFENCE/SFENCe on x86 in mlx5en(4), by using the FreeBSD native fences. Submitted by: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Mar 8 15:53:04 2018 (r330658) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Thu Mar 8 15:58:30 2018 (r330659) @@ -1361,7 +1361,7 @@ mlx5e_sq_send_nops_locked(struct mlx5e_sq *sq, int can } /* send a single NOP */ mlx5e_send_nop(sq, 1); - wmb(); + atomic_thread_fence_rel(); } done: /* Check if we need to write the doorbell */ Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Mar 8 15:53:04 2018 (r330658) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Thu Mar 8 15:58:30 2018 (r330659) @@ -429,7 +429,7 @@ mlx5e_poll_tx_cq(struct mlx5e_sq *sq, int budget) mlx5_cqwq_update_db_record(&sq->cq.wq); /* Ensure cq space is freed before enabling more cqes */ - wmb(); + atomic_thread_fence_rel(); sq->cc = sqcc; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Thu Mar 8 15:53:04 2018 (r330658) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_txrx.c Thu Mar 8 15:58:30 2018 (r330659) @@ -38,7 +38,7 @@ mlx5e_get_cqe(struct mlx5e_cq *cq) return (NULL); /* ensure cqe content is read after cqe ownership bit */ - rmb(); + atomic_thread_fence_acq(); return (cqe); } From owner-svn-src-head@freebsd.org Thu Mar 8 16:19: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 0A562F404CE; Thu, 8 Mar 2018 16:19:02 +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 B3EED830EF; Thu, 8 Mar 2018 16:19:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AED07130A6; Thu, 8 Mar 2018 16:19:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28GJ1Z4027395; Thu, 8 Mar 2018 16:19:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28GJ1Bh027391; Thu, 8 Mar 2018 16:19:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081619.w28GJ1Bh027391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 16:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330660 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 330660 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 16:19:02 -0000 Author: hselasky Date: Thu Mar 8 16:19:01 2018 New Revision: 330660 URL: https://svnweb.freebsd.org/changeset/base/330660 Log: Add call to setup firmware data dump structure during device load in mlx5core. Do not consider the inability to create a firmware dump fatal, but inform about the situation and allow the driver to attach. The device might not implement the needed VSC, or we might not know the layout of the registers map. In either case, only firmware dump functionality is limited, the network operations should be fine. Submitted by: kib@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c head/sys/dev/mlx5/mlx5_core/mlx5_main.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_core.h Thu Mar 8 15:58:30 2018 (r330659) +++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h Thu Mar 8 16:19:01 2018 (r330660) @@ -82,7 +82,7 @@ int mlx5_rename_eq(struct mlx5_core_dev *dev, int eq_i int mlx5_fwdump_init(void); void mlx5_fwdump_fini(void); -int mlx5_fwdump_prep(struct mlx5_core_dev *mdev); +void mlx5_fwdump_prep(struct mlx5_core_dev *mdev); void mlx5_fwdump(struct mlx5_core_dev *mdev); void mlx5_fwdump_clean(struct mlx5_core_dev *mdev); Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Thu Mar 8 15:58:30 2018 (r330659) +++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c Thu Mar 8 16:19:01 2018 (r330660) @@ -69,15 +69,19 @@ mlx5_fwdump_destroy_dd(struct mlx5_dump_data *dd) free(dd, M_MLX5_DUMP); } -int +void mlx5_fwdump_prep(struct mlx5_core_dev *mdev) { struct mlx5_dump_data *dd; int error; error = mlx5_vsc_find_cap(mdev); - if (error != 0) - return (error); + if (error != 0) { + /* Inability to create a firmware dump is not fatal. */ + device_printf((&mdev->pdev->dev)->bsddev, "WARN: " + "mlx5_fwdump_prep failed %d\n", error); + return; + } dd = malloc(sizeof(struct mlx5_dump_data), M_MLX5_DUMP, M_WAITOK); switch (pci_get_device(mdev->pdev->dev.bsddev)) { case 0x1013: @@ -92,7 +96,7 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) break; default: free(dd, M_MLX5_DUMP); - return (0); /* silently fail to not prevent driver attach */ + return; /* silently fail, do not prevent driver attach */ } dd->dump_size = mlx5_fwdump_getsize(dd->rege); dd->dump = malloc(dd->dump_size * sizeof(uint32_t), M_MLX5_DUMP, @@ -102,7 +106,6 @@ mlx5_fwdump_prep(struct mlx5_core_dev *mdev) if (atomic_cmpset_rel_ptr((uintptr_t *)&mdev->dump_data, 0, (uintptr_t)dd) == 0) mlx5_fwdump_destroy_dd(dd); - return (0); } void Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Mar 8 15:58:30 2018 (r330659) +++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c Thu Mar 8 16:19:01 2018 (r330660) @@ -1022,6 +1022,8 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, st goto err_reg_dev; } + mlx5_fwdump_prep(dev); + clear_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state); set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state); From owner-svn-src-head@freebsd.org Thu Mar 8 16:27: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 87354F412DB; Thu, 8 Mar 2018 16:27:32 +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 3C2DB83C4D; Thu, 8 Mar 2018 16:27:32 +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 1D14C13246; Thu, 8 Mar 2018 16:27:32 +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 w28GRVs1032341; Thu, 8 Mar 2018 16:27:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28GRVuN032340; Thu, 8 Mar 2018 16:27:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803081627.w28GRVuN032340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 8 Mar 2018 16:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330662 - head/sys/dev/mlx5/mlx5_ib X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_ib X-SVN-Commit-Revision: 330662 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 16:27:32 -0000 Author: hselasky Date: Thu Mar 8 16:27:31 2018 New Revision: 330662 URL: https://svnweb.freebsd.org/changeset/base/330662 Log: Set correct SL in completion for RoCE in mlx5ib(4). There is a difference when parsing a completion entry between Ethernet and IB ports. When link layer is Ethernet the bits describe the type of L3 header in the packet. In the case when link layer is Ethernet and VLAN header is present the value of SL is equal to the 3 UP bits in the VLAN header. If VLAN header is not present then the SL is undefined and consumer of the completion should check if IB_WC_WITH_VLAN is set. While that, this patch also fills the vlan_id field in the completion if present. linux commit 12f8fedef2ec94c783f929126b20440a01512c14 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c Modified: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c Thu Mar 8 16:26:49 2018 (r330661) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c Thu Mar 8 16:27:31 2018 (r330662) @@ -167,6 +167,8 @@ static void handle_responder(struct ib_wc *wc, struct struct mlx5_ib_srq *srq; struct mlx5_ib_wq *wq; u16 wqe_ctr; + u8 roce_packet_type; + bool vlan_present; u8 g; if (qp->ibqp.srq || qp->ibqp.xrcd) { @@ -218,7 +220,6 @@ static void handle_responder(struct ib_wc *wc, struct break; } wc->slid = be16_to_cpu(cqe->slid); - wc->sl = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0xf; wc->src_qp = be32_to_cpu(cqe->flags_rqpn) & 0xffffff; wc->dlid_path_bits = cqe->ml_path; g = (be32_to_cpu(cqe->flags_rqpn) >> 28) & 3; @@ -232,10 +233,22 @@ static void handle_responder(struct ib_wc *wc, struct wc->pkey_index = 0; } - if (ll != IB_LINK_LAYER_ETHERNET) + if (ll != IB_LINK_LAYER_ETHERNET) { + wc->sl = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0xf; return; + } - switch (wc->sl & 0x3) { + vlan_present = cqe_has_vlan(cqe); + roce_packet_type = (be32_to_cpu(cqe->flags_rqpn) >> 24) & 0x3; + if (vlan_present) { + wc->vlan_id = (be16_to_cpu(cqe->vlan_info)) & 0xfff; + wc->sl = (be16_to_cpu(cqe->vlan_info) >> 13) & 0x7; + wc->wc_flags |= IB_WC_WITH_VLAN; + } else { + wc->sl = 0; + } + + switch (roce_packet_type) { case MLX5_CQE_ROCE_L3_HEADER_TYPE_GRH: wc->network_hdr_type = RDMA_NETWORK_IB; break; From owner-svn-src-head@freebsd.org Thu Mar 8 17:04: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 07AEDF443CE; Thu, 8 Mar 2018 17:04:37 +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 B1E5C85E7D; Thu, 8 Mar 2018 17:04:36 +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 A8A01139FD; Thu, 8 Mar 2018 17:04:36 +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 w28H4a83052057; Thu, 8 Mar 2018 17:04:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28H4aQx052056; Thu, 8 Mar 2018 17:04:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201803081704.w28H4aQx052056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 8 Mar 2018 17:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330663 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330663 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:04:37 -0000 Author: markj Date: Thu Mar 8 17:04:36 2018 New Revision: 330663 URL: https://svnweb.freebsd.org/changeset/base/330663 Log: Return E2BIG if we run out of space writing a compressed kernel dump. ENOSPC causes the MD kernel dump code to retry the dump, but this is undesirable in the case where we legitimately ran out of space. Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu Mar 8 16:27:31 2018 (r330662) +++ head/sys/kern/kern_shutdown.c Thu Mar 8 17:04:36 2018 (r330663) @@ -1115,6 +1115,12 @@ dump_check_bounds(struct dumperinfo *di, off_t offset, if (length != 0 && (offset < di->mediaoffset || offset - di->mediaoffset + length > di->mediasize)) { + if (di->kdcomp != NULL && offset >= di->mediaoffset) { + printf( + "Compressed dump failed to fit in device boundaries.\n"); + return (E2BIG); + } + printf("Attempt to write outside dump device boundaries.\n" "offset(%jd), mediaoffset(%jd), length(%ju), mediasize(%jd).\n", (intmax_t)offset, (intmax_t)di->mediaoffset, From owner-svn-src-head@freebsd.org Thu Mar 8 17:23: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 6F731F45A6D; Thu, 8 Mar 2018 17:23:19 +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 258AC86E77; Thu, 8 Mar 2018 17:23:19 +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 2078F13E02; Thu, 8 Mar 2018 17:23:19 +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 w28HNJGx062181; Thu, 8 Mar 2018 17:23:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28HNJYP062180; Thu, 8 Mar 2018 17:23:19 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803081723.w28HNJYP062180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 8 Mar 2018 17:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330665 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 330665 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:23:19 -0000 Author: cem Date: Thu Mar 8 17:23:18 2018 New Revision: 330665 URL: https://svnweb.freebsd.org/changeset/base/330665 Log: ipfw(8): Fix endianness for Legacy and Ipv4 table hostname values The lookup_host() helper subroutine emits a struct in_addr value in network byte order via caller passed pointer. However, the table value is expected to be stored in host byte order. On little-endian machines, this produced a reversed endian table value for Legacy or IPv4 table types when the value was a hostname (instead of a plain IP address). Fix by using ntohl() on the output 32-bit address. While here, avoid some aliasing violations by storing the lookup_host() output in an intermediate object of the correct type. PR: 226429 Reported by: bugs.freebsd.org AT mx.zzux.com (also: Tested by) Security: ipfw hostname table rules could potentially not act as admin intended Sponsored by: Dell EMC Isilon Modified: head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Thu Mar 8 17:14:16 2018 (r330664) +++ head/sbin/ipfw/tables.c Thu Mar 8 17:23:18 2018 (r330665) @@ -1471,6 +1471,7 @@ tentry_fill_value(ipfw_obj_header *oh, ipfw_obj_tentry uint32_t i; int dval; char *comma, *e, *etype, *n, *p; + struct in_addr ipaddr; v = &tent->v.value; @@ -1487,8 +1488,8 @@ tentry_fill_value(ipfw_obj_header *oh, ipfw_obj_tentry return; } /* Try hostname */ - if (lookup_host(arg, (struct in_addr *)&val) == 0) { - set_legacy_value(val, v); + if (lookup_host(arg, &ipaddr) == 0) { + set_legacy_value(ntohl(ipaddr.s_addr), v); return; } errx(EX_OSERR, "Unable to parse value %s", arg); @@ -1557,8 +1558,10 @@ tentry_fill_value(ipfw_obj_header *oh, ipfw_obj_tentry v->nh4 = ntohl(a4); break; } - if (lookup_host(n, (struct in_addr *)&v->nh4) == 0) + if (lookup_host(n, &ipaddr) == 0) { + v->nh4 = ntohl(ipaddr.s_addr); break; + } etype = "ipv4"; break; case IPFW_VTYPE_DSCP: From owner-svn-src-head@freebsd.org Thu Mar 8 18:42: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 472E4F4B1E3; Thu, 8 Mar 2018 18:42:24 +0000 (UTC) (envelope-from avos@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 C09CA69ED4; Thu, 8 Mar 2018 18:42:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BB73314AFE; Thu, 8 Mar 2018 18:42:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28IgNVQ001801; Thu, 8 Mar 2018 18:42:23 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28IgNHX001800; Thu, 8 Mar 2018 18:42:23 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803081842.w28IgNHX001800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 8 Mar 2018 18:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330666 - head/sys/dev/iwi X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/iwi X-SVN-Commit-Revision: 330666 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:42:24 -0000 Author: avos Date: Thu Mar 8 18:42:23 2018 New Revision: 330666 URL: https://svnweb.freebsd.org/changeset/base/330666 Log: iwi(4): factor out rateset setup into iwi_set_rateset(). No functional change intended. Modified: head/sys/dev/iwi/if_iwi.c Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Thu Mar 8 17:23:18 2018 (r330665) +++ head/sys/dev/iwi/if_iwi.c Thu Mar 8 18:42:23 2018 (r330666) @@ -2550,11 +2550,36 @@ iwi_setwepkeys(struct iwi_softc *sc, struct ieee80211v } static int +iwi_set_rateset(struct iwi_softc *sc, const struct ieee80211_rateset *net_rs, + int mode, int type) +{ + struct iwi_rateset rs; + int i; + + memset(&rs, 0, sizeof(rs)); + rs.mode = mode; + rs.type = type; + rs.nrates = net_rs->rs_nrates; + if (rs.nrates > nitems(rs.rates)) { + DPRINTF(("Truncating negotiated rate set from %u\n", + rs.nrates)); + rs.nrates = nitems(rs.rates); + } + memcpy(rs.rates, net_rs->rs_rates, rs.nrates); + DPRINTF(("Setting .11%c%s %s rates (%u)\n", + mode == IWI_MODE_11A ? 'a' : 'b', + mode == IWI_MODE_11G ? "g" : "", + type == IWI_RATESET_TYPE_SUPPORTED ? "supported" : "negotiated", + rs.nrates)); + + return (iwi_cmd(sc, IWI_CMD_SET_RATES, &rs, sizeof(rs))); +} + +static int iwi_config(struct iwi_softc *sc) { struct ieee80211com *ic = &sc->sc_ic; struct iwi_configuration config; - struct iwi_rateset rs; struct iwi_txpower power; uint32_t data; int error, i; @@ -2603,25 +2628,13 @@ iwi_config(struct iwi_softc *sc) return error; } - memset(&rs, 0, sizeof rs); - rs.mode = IWI_MODE_11G; - rs.type = IWI_RATESET_TYPE_SUPPORTED; - rs.nrates = ic->ic_sup_rates[IEEE80211_MODE_11G].rs_nrates; - memcpy(rs.rates, ic->ic_sup_rates[IEEE80211_MODE_11G].rs_rates, - rs.nrates); - DPRINTF(("Setting .11bg supported rates (%u)\n", rs.nrates)); - error = iwi_cmd(sc, IWI_CMD_SET_RATES, &rs, sizeof rs); + error = iwi_set_rateset(sc, &ic->ic_sup_rates[IEEE80211_MODE_11G], + IWI_MODE_11G, IWI_RATESET_TYPE_SUPPORTED); if (error != 0) return error; - memset(&rs, 0, sizeof rs); - rs.mode = IWI_MODE_11A; - rs.type = IWI_RATESET_TYPE_SUPPORTED; - rs.nrates = ic->ic_sup_rates[IEEE80211_MODE_11A].rs_nrates; - memcpy(rs.rates, ic->ic_sup_rates[IEEE80211_MODE_11A].rs_rates, - rs.nrates); - DPRINTF(("Setting .11a supported rates (%u)\n", rs.nrates)); - error = iwi_cmd(sc, IWI_CMD_SET_RATES, &rs, sizeof rs); + error = iwi_set_rateset(sc, &ic->ic_sup_rates[IEEE80211_MODE_11A], + IWI_MODE_11A, IWI_RATESET_TYPE_SUPPORTED); if (error != 0) return error; @@ -2815,7 +2828,6 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ieee80 struct ieee80211_node *ni; struct iwi_configuration config; struct iwi_associate *assoc = &sc->assoc; - struct iwi_rateset rs; uint16_t capinfo; uint32_t data; int error, mode; @@ -2885,18 +2897,8 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ieee80 goto done; /* the rate set has already been "negotiated" */ - memset(&rs, 0, sizeof rs); - rs.mode = mode; - rs.type = IWI_RATESET_TYPE_NEGOTIATED; - rs.nrates = ni->ni_rates.rs_nrates; - if (rs.nrates > IWI_RATESET_SIZE) { - DPRINTF(("Truncating negotiated rate set from %u\n", - rs.nrates)); - rs.nrates = IWI_RATESET_SIZE; - } - memcpy(rs.rates, ni->ni_rates.rs_rates, rs.nrates); - DPRINTF(("Setting negotiated rates (%u)\n", rs.nrates)); - error = iwi_cmd(sc, IWI_CMD_SET_RATES, &rs, sizeof rs); + error = iwi_set_rateset(sc, &ni->ni_rates, mode, + IWI_RATESET_TYPE_NEGOTIATED); if (error != 0) goto done; From owner-svn-src-head@freebsd.org Thu Mar 8 18: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 B1BC9F4BECE; Thu, 8 Mar 2018 18:52:47 +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 644046A85B; Thu, 8 Mar 2018 18:52:47 +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 5F14C14CC5; Thu, 8 Mar 2018 18:52:47 +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 w28IqlGW006941; Thu, 8 Mar 2018 18:52:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28Iqluj006940; Thu, 8 Mar 2018 18:52:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803081852.w28Iqluj006940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 8 Mar 2018 18:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330667 - head/sys/dev/asmc X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/asmc X-SVN-Commit-Revision: 330667 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:52:47 -0000 Author: emaste Date: Thu Mar 8 18:52:47 2018 New Revision: 330667 URL: https://svnweb.freebsd.org/changeset/base/330667 Log: asmc: update temperature sensor name/description PR: 225911 Submitted by: Trev MFC after: 1 week Modified: head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Thu Mar 8 18:42:23 2018 (r330666) +++ head/sys/dev/asmc/asmcvar.h Thu Mar 8 18:52:47 2018 (r330667) @@ -311,7 +311,7 @@ struct asmc_softc { "cpu0_proximity", "hdd_bay", \ "northbridge_die", \ "northbridge_proximity", \ - "wireless_module", } + "wireless_proximity", } #define ASMC_MM31_TEMPDESCS { "CPU0 Die Core Temperature", \ "CPU0 Heatsink Temperature", \ @@ -319,7 +319,7 @@ struct asmc_softc { "HDD Bay Temperature", \ "Northbridge Die Core Temperature", \ "Northbridge Proximity Temperature", \ - "Wireless Module Temperature", } + "Wireless Module Proximity Temperature", } #define ASMC_MP_TEMPS { "TA0P", "TCAG", "TCAH", "TCBG", "TCBH", \ "TC0C", "TC0D", "TC0P", "TC1C", "TC1D", \ From owner-svn-src-head@freebsd.org Thu Mar 8 19:24: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 62635F270D4; Thu, 8 Mar 2018 19:24:11 +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 111AB6C1EB; Thu, 8 Mar 2018 19:24:11 +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 0ABDD151A8; Thu, 8 Mar 2018 19:24:11 +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 w28JOACc022100; Thu, 8 Mar 2018 19:24:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28JOArd022099; Thu, 8 Mar 2018 19:24:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201803081924.w28JOArd022099@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 8 Mar 2018 19:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330668 - head/sys/dev/bktr X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/bktr X-SVN-Commit-Revision: 330668 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:24:11 -0000 Author: emaste Date: Thu Mar 8 19:24:10 2018 New Revision: 330668 URL: https://svnweb.freebsd.org/changeset/base/330668 Log: bktr: correct Japan IF frequency PR: 36451 Submitted by: Hijiri Umemoto MFC after: 2 weeks Modified: head/sys/dev/bktr/bktr_tuner.c Modified: head/sys/dev/bktr/bktr_tuner.c ============================================================================== --- head/sys/dev/bktr/bktr_tuner.c Thu Mar 8 18:52:47 2018 (r330667) +++ head/sys/dev/bktr/bktr_tuner.c Thu Mar 8 19:24:10 2018 (r330668) @@ -566,12 +566,10 @@ static int weurope[] = { * 8: 193.25MHz - 12: 217.25MHz (VHF) * 13: 471.25MHz - 62: 765.25MHz (UHF) * - * IF freq: 45.75 mHz - * OR * IF freq: 58.75 mHz */ #define OFFSET 6.00 -#define IF_FREQ 45.75 +#define IF_FREQ 58.75 static int jpnbcst[] = { 62, (int)(IF_FREQ * FREQFACTOR), 0, 13, (int)(471.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), @@ -593,10 +591,10 @@ static int jpnbcst[] = { * 22: 165.25MHz * 23: 223.25MHz - 63: 463.25MHz * - * IF freq: 45.75 mHz + * IF freq: 58.75 mHz */ #define OFFSET 6.00 -#define IF_FREQ 45.75 +#define IF_FREQ 58.75 static int jpncable[] = { 63, (int)(IF_FREQ * FREQFACTOR), 0, 23, (int)(223.25 * FREQFACTOR), (int)(OFFSET * FREQFACTOR), From owner-svn-src-head@freebsd.org Thu Mar 8 21:58: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 6ED8FF3433D; Thu, 8 Mar 2018 21:58:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (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 03CDD726CE; Thu, 8 Mar 2018 21:58:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x242.google.com with SMTP id d71so1365604iog.4; Thu, 08 Mar 2018 13:58:07 -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=5/Os8dzUISeGSUBq1XXNGmthG1EKFRkIK08+pNMI8AE=; b=QDjwFiHVJadOD6DMANJPtPrPsvR+z1TmsN0Gxq3Kbab9h9jggCYlHOP2YOu1UuSmRb +LY1WuTwH/nJi4qIAPTPakbMPYXSJx3tXQ5O2/ugHr4g4GEdU8WBPULko9R8H5P73FLT lgnrZJtbk7ZlAUFhJ4xmqFQIgI2GdyeE/6Id1pLlrDQCFhvvCBUjhja3RbGcnph10Y5s 9419JcQRYXiIi9PV89RT4fFjOy2v7D394XMkRKDh6UAXezFcIvpETvvXIZOBIJoCLpgN Fhftr/nsTThZ8hlo6bJQ6WWQUxvsfxEVQLt/Qf0pNVz6s/4crtKfyNVFcY0EmgEvSOpt l5ZA== 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=5/Os8dzUISeGSUBq1XXNGmthG1EKFRkIK08+pNMI8AE=; b=g7KMujc0vLVuzurJ36bpWNBHIb7VNLfsK5EvGbIhJm90RH/AJDx16ul2Iy6kdLmpGY WrMB011OQou/1J2q3cbY1LnaWSswKsPa2ZY8eM2A4pJoKhYbHzI1f+5wWeN5lABb6GS7 U9X+h86R/CgJBBvyA20jK5/0cBynmpcKYtqBkYk+MjJnniQ6D6NugBPSScXJ5ZIsvKop qLwonbt3FX5W9oSbn5KVUJ1kJ8yV2G/jPmlXJ8yKkF8Pak92DEIlhphf2mCNVrJ5HIyu bO0Gsq2TP0et7upRSBSuPjeMJ+Z0fSyse+KMCXzKvQGjPCQ/ay+Q2+/+cG7zT/ku8SQ0 fT9Q== X-Gm-Message-State: APf1xPCcLuGDqelMflTVyc7U0Zf38I2b1kd2pi3ip9R1QHLiupycyR5G b1Ij708gHSabvh8fNcWMmJBOOS3dGtObZlXU2hOpBQ== X-Google-Smtp-Source: AG47ELuaw/mTNf6eq7qsNI5TYwjNrZQ13m8G0/IzJGb6+G4z5khMKHzVDFMxfEqULoGYUNKg1QZ8evI+5UXlKceCToQ= X-Received: by 10.107.141.12 with SMTP id p12mr33507713iod.288.1520546287267; Thu, 08 Mar 2018 13:58:07 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.163.13 with HTTP; Thu, 8 Mar 2018 13:57:46 -0800 (PST) In-Reply-To: <201801151837.w0FIb3R7098459@repo.freebsd.org> References: <201801151837.w0FIb3R7098459@repo.freebsd.org> From: Ed Maste Date: Thu, 8 Mar 2018 16:57:46 -0500 X-Google-Sender-Auth: L8_welenpRbhi9S5DhNUzdCgWkI Message-ID: Subject: Re: svn commit: r328011 - in head/sys/amd64/vmm: amd intel To: Tycho Nightingale 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: Thu, 08 Mar 2018 21:58:08 -0000 On 15 January 2018 at 13:37, Tycho Nightingale wrote: > Author: tychon > Date: Mon Jan 15 18:37:03 2018 > New Revision: 328011 > URL: https://svnweb.freebsd.org/changeset/base/328011 > > Log: > Provide some mitigation against CVE-2017-5715 by clearing registers > upon returning from the guest which aren't immediately clobbered by > the host. This eradicates any remaining guest contents limiting their > usefulness in an exploit gadget. Will you MFC this to stable/11? From owner-svn-src-head@freebsd.org Thu Mar 8 22:03: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 E4324F34C72; Thu, 8 Mar 2018 22:03:43 +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 996AD72DDB; Thu, 8 Mar 2018 22:03:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9451516AE0; Thu, 8 Mar 2018 22:03:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28M3hXN018325; Thu, 8 Mar 2018 22:03:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28M3hnF018324; Thu, 8 Mar 2018 22:03:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803082203.w28M3hnF018324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Mar 2018 22:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330670 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 330670 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:03:44 -0000 Author: kib Date: Thu Mar 8 22:03:43 2018 New Revision: 330670 URL: https://svnweb.freebsd.org/changeset/base/330670 Log: Make mlx5 compilable on ILP32 arches. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 21:33:52 2018 (r330669) +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Thu Mar 8 22:03:43 2018 (r330670) @@ -67,7 +67,7 @@ static void mlx5_trigger_cmd_completions(struct mlx5_c vector |= MLX5_TRIGGERED_CMD_COMP; spin_unlock_irqrestore(&dev->cmd.alloc_lock, flags); - mlx5_core_dbg(dev, "vector 0x%lx\n", vector); + mlx5_core_dbg(dev, "vector 0x%jx\n", (uintmax_t)vector); mlx5_cmd_comp_handler(dev, vector); return; From owner-svn-src-head@freebsd.org Thu Mar 8 22:04: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 8F9E1F34E10; Thu, 8 Mar 2018 22:04:55 +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 42DA172F74; Thu, 8 Mar 2018 22:04:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DE3416AE2; Thu, 8 Mar 2018 22:04:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28M4tEc018408; Thu, 8 Mar 2018 22:04:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28M4tjp018407; Thu, 8 Mar 2018 22:04:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803082204.w28M4tjp018407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 8 Mar 2018 22:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330671 - head/sys/dev/iwi X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/iwi X-SVN-Commit-Revision: 330671 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:04:55 -0000 Author: kib Date: Thu Mar 8 22:04:54 2018 New Revision: 330671 URL: https://svnweb.freebsd.org/changeset/base/330671 Log: Remove unused variable. Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iwi/if_iwi.c Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Thu Mar 8 22:03:43 2018 (r330670) +++ head/sys/dev/iwi/if_iwi.c Thu Mar 8 22:04:54 2018 (r330671) @@ -2554,7 +2554,6 @@ iwi_set_rateset(struct iwi_softc *sc, const struct iee int mode, int type) { struct iwi_rateset rs; - int i; memset(&rs, 0, sizeof(rs)); rs.mode = mode; From owner-svn-src-head@freebsd.org Thu Mar 8 22:07: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 99B97F3529D for ; Thu, 8 Mar 2018 22:07:34 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw0-x236.google.com (mail-yw0-x236.google.com [IPv6:2607:f8b0:4002:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51C8673290 for ; Thu, 8 Mar 2018 22:07:34 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw0-x236.google.com with SMTP id d205so492388ywe.2 for ; Thu, 08 Mar 2018 14:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/9VaNltj2HvVMvqQj2WbkPvqBKehowCLzVjbEMwiIoY=; b=lMKA25eWwNYSV7bbBJ+YpOKvS2qMHjvJLZ9BlI9YbyyShJ4Dk6bI5qERFStv/JnvcG PesMfns+pili+Go1mVCHjf84pHeH09V85SHvFjb2zIrSupFAiydB5zt00M5Y/BiFCoi8 z2tNj31YvCILThOZw9CX9Djjmyd1TUzWGOyWVXU9MjIIhwP7ouyIR7oQ3XO77u8892dz DeRV8HOoT/lf2nJP/Luyvs1Df7w/6VrgNYNbwfJxKoRva6xkzBVLhl3mG2AVYoa6YJFH AAWsAogitIiwLwt+49HOSnYWCFfgu9o9DHN10s0gkE8Py6Iok0V/HRbDnUpMbRJOJFXV Sbpw== 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=/9VaNltj2HvVMvqQj2WbkPvqBKehowCLzVjbEMwiIoY=; b=YXqy3qL47UgJhWOnTeBcKRIDMquwGzIAY+aOnDoUsmeFBvstQcOubd2M+4RtbCQagv jI/tCPEkmM3bqr6G/HDi7k4FDJ6rl6SgYZCZY14VO5JMczJFBG7yIAC8wIMeUQRxFV/c fMOoEXsbdbZvsyxfJrZGO0tAJN8skSJcHCS2o6srqOeyN6BZ+bHjDaYlh7ArVX+yB85h meyepDgwD9CrGfYMMJyNnFCqRkwv5u4/PipnRYMsGXB/SXg1EK/b3RB//HWdjvOly9dw 3KZ04Qdc1DqyqyzMCLB2khuevVoV8lo4T/ktIvn3hbNVcMuGZR910HxoEVnbT49Myi99 Q66g== X-Gm-Message-State: APf1xPDbETkPEqx9F3+/CJjgP9W3x09//JOeGXfUmVCEgz4Z3SoQKApL cy8xGZ/ROAhC7fZqk2ZcT1nG/XjyRWsY24PZ6+J3vg== X-Google-Smtp-Source: AG47ELsA0THcGEND0x6rMO2gT8vNgEEGr4j/olJbhqkFV4TJn0YlFL3Z51KWZpFFTMAg6NVOg1NdiJJXWG/TASJcCYw= X-Received: by 10.129.89.137 with SMTP id n131mr17856034ywb.41.1520546853728; Thu, 08 Mar 2018 14:07:33 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:5f41:0:0:0:0:0 with HTTP; Thu, 8 Mar 2018 14:07:33 -0800 (PST) In-Reply-To: <201607112125.u6BLPSfT084346@repo.freebsd.org> References: <201607112125.u6BLPSfT084346@repo.freebsd.org> From: Oliver Pinter Date: Thu, 8 Mar 2018 23:07:33 +0100 Message-ID: Subject: Re: svn commit: r302595 - in head/sys: kern net To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, emaste@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: Thu, 08 Mar 2018 22:07:34 -0000 On 7/11/16, Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Mon Jul 11 21:25:28 2016 > New Revision: 302595 > URL: https://svnweb.freebsd.org/changeset/base/302595 > > Log: > Remove assumptions in MI code that the BSP is CPU 0. > > MFC after: 2 weeks Please MFC this commit to 11-STABLE, since without them, we encounter boot issues with enabled EARLY_AP_STARTUP. Thanks, Oliver > > Modified: > head/sys/kern/init_main.c > head/sys/net/netisr.c > > Modified: head/sys/kern/init_main.c > ============================================================================== > --- head/sys/kern/init_main.c Mon Jul 11 21:23:50 2016 (r302594) > +++ head/sys/kern/init_main.c Mon Jul 11 21:25:28 2016 (r302595) > @@ -495,7 +495,7 @@ proc0_init(void *dummy __unused) > td->td_lend_user_pri = PRI_MAX; > td->td_priority = PVM; > td->td_base_pri = PVM; > - td->td_oncpu = 0; > + td->td_oncpu = curcpu; > td->td_flags = TDF_INMEM; > td->td_pflags = TDP_KTHREAD; > td->td_cpuset = cpuset_thread0(); > > Modified: head/sys/net/netisr.c > ============================================================================== > --- head/sys/net/netisr.c Mon Jul 11 21:23:50 2016 (r302594) > +++ head/sys/net/netisr.c Mon Jul 11 21:25:28 2016 (r302595) > @@ -1273,8 +1273,6 @@ netisr_init(void *arg) > struct pcpu *pc; > #endif > > - KASSERT(curcpu == 0, ("%s: not on CPU 0", __func__)); > - > NETISR_LOCK_INIT(); > if (netisr_maxthreads == 0 || netisr_maxthreads < -1 ) > netisr_maxthreads = 1; /* default behavior */ > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Thu Mar 8 22:32: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 75330F373AF; Thu, 8 Mar 2018 22:32:19 +0000 (UTC) (envelope-from dteske@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 BC51274620; Thu, 8 Mar 2018 22:32:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B74EB16E80; Thu, 8 Mar 2018 22:32:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w28MWIcF033217; Thu, 8 Mar 2018 22:32:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28MWItd033216; Thu, 8 Mar 2018 22:32:18 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201803082232.w28MWItd033216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 8 Mar 2018 22:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330672 - head/cddl/usr.sbin/dwatch/libexec X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/cddl/usr.sbin/dwatch/libexec X-SVN-Commit-Revision: 330672 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:32:19 -0000 Author: dteske Date: Thu Mar 8 22:32:18 2018 New Revision: 330672 URL: https://svnweb.freebsd.org/changeset/base/330672 Log: Fix display of wrong pid from dtrace_sched(4) Fix a comment while here. Sponsored by: Smule, Inc. Modified: head/cddl/usr.sbin/dwatch/libexec/sched Modified: head/cddl/usr.sbin/dwatch/libexec/sched ============================================================================== --- head/cddl/usr.sbin/dwatch/libexec/sched Thu Mar 8 22:04:54 2018 (r330671) +++ head/cddl/usr.sbin/dwatch/libexec/sched Thu Mar 8 22:32:18 2018 (r330672) @@ -66,7 +66,7 @@ sched:::enqueue /* probe ID $(( $ID + 2 )) */ sched:::change-pri, sched:::lend-pri /* probe ID $(( $ID + 3 )) */ {${TRACE:+ printf("<$(( $ID + 3 ))>");} - /* details = " -> arg2" */ + /* details = " -> " */ this->details = strjoin(lltostr(this->curprio), strjoin("->", lltostr((uint8_t)arg2))); } @@ -85,7 +85,7 @@ $PROBE /* probe ID $(( $ID + 5 )) */ /* details += " pid -- " */ this->details = strjoin(this->details, this->details == "" ? "" : " "); this->details = strjoin(this->details, strjoin( - strjoin("pid ", lltostr(this->pid_sched)), + strjoin("pid ", lltostr(this->pid)), strjoin(" -- ", this->args))); } EOF From owner-svn-src-head@freebsd.org Thu Mar 8 22:49: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 80D6FF38B6D; Thu, 8 Mar 2018 22:49:37 +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 3333275434; Thu, 8 Mar 2018 22:49:37 +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 298AC1710D; Thu, 8 Mar 2018 22:49:37 +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 w28MnaxB038725; Thu, 8 Mar 2018 22:49:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28Mnapr038723; Thu, 8 Mar 2018 22:49:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803082249.w28Mnapr038723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 8 Mar 2018 22:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330673 - in head/sys: arm/nvidia dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm/nvidia dev/sdhci X-SVN-Commit-Revision: 330673 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:49:37 -0000 Author: manu Date: Thu Mar 8 22:49:36 2018 New Revision: 330673 URL: https://svnweb.freebsd.org/changeset/base/330673 Log: Fix build when option MMCCAM is defined. Modified: head/sys/arm/nvidia/tegra_sdhci.c head/sys/dev/sdhci/sdhci_fdt.c Modified: head/sys/arm/nvidia/tegra_sdhci.c ============================================================================== --- head/sys/arm/nvidia/tegra_sdhci.c Thu Mar 8 22:32:18 2018 (r330672) +++ head/sys/arm/nvidia/tegra_sdhci.c Thu Mar 8 22:49:36 2018 (r330673) @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include "sdhci_if.h" +#include "opt_mmccam.h" + /* Tegra SDHOST controller vendor register definitions */ #define SDMMC_VENDOR_CLOCK_CNTRL 0x100 #define VENDOR_CLOCK_CNTRL_CLK_SHIFT 8 @@ -463,5 +465,7 @@ static DEFINE_CLASS_0(sdhci, tegra_sdhci_driver, tegra sizeof(struct tegra_sdhci_softc)); DRIVER_MODULE(sdhci_tegra, simplebus, tegra_sdhci_driver, tegra_sdhci_devclass, NULL, NULL); +#ifndef MMCCAM MODULE_DEPEND(sdhci_tegra, sdhci, 1, 1, 1); MMC_DECLARE_BRIDGE(sdhci); +#endif Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Thu Mar 8 22:32:18 2018 (r330672) +++ head/sys/dev/sdhci/sdhci_fdt.c Thu Mar 8 22:49:36 2018 (r330673) @@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$"); #include "mmcbr_if.h" #include "sdhci_if.h" +#include "opt_mmccam.h" + #define MAX_SLOTS 6 #define SDHCI_FDT_ARMADA38X 1 #define SDHCI_FDT_GENERIC 2 @@ -351,5 +353,7 @@ static devclass_t sdhci_fdt_devclass; DRIVER_MODULE(sdhci_fdt, simplebus, sdhci_fdt_driver, sdhci_fdt_devclass, NULL, NULL); +#ifndef MMCCAM MODULE_DEPEND(sdhci_fdt, sdhci, 1, 1, 1); MMC_DECLARE_BRIDGE(sdhci_fdt); +#endif From owner-svn-src-head@freebsd.org Thu Mar 8 22:54: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 D4983F391A1; Thu, 8 Mar 2018 22:54:50 +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 8ACB475AC3; Thu, 8 Mar 2018 22:54:50 +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 81CCB172AD; Thu, 8 Mar 2018 22:54:50 +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 w28MsoZX043327; Thu, 8 Mar 2018 22:54:50 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w28Msopg043326; Thu, 8 Mar 2018 22:54:50 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803082254.w28Msopg043326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 8 Mar 2018 22:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330674 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 330674 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:54:51 -0000 Author: manu Date: Thu Mar 8 22:54:50 2018 New Revision: 330674 URL: https://svnweb.freebsd.org/changeset/base/330674 Log: arm: Add GENERIC-MMCCAM kernel config MMCCAM is the new mmc stack currently developped by kibab@, add a kernel configuration file that include GENERIC so it's easier to test for people. Added: head/sys/arm/conf/GENERIC-MMCCAM (contents, props changed) Added: head/sys/arm/conf/GENERIC-MMCCAM ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/GENERIC-MMCCAM Thu Mar 8 22:54:50 2018 (r330674) @@ -0,0 +1,22 @@ +# +# GEMERIC-MMCCAM +# +# Custom kernel for GENERIC plus MMCCAM as opposed to the prior MMC stack. +# +# $FreeBSD$ + +include GENERIC + +ident GENERIC-MMCCAM + +options MMCCAM + +# Add CAMDEBUG stuff +options CAMDEBUG +options CAM_DEBUG_FLAGS=(CAM_DEBUG_INFO|CAM_DEBUG_PROBE|CAM_DEBUG_PERIPH) + +# pass(4) device +device pass + +nodevice mmc +nodevice mmcsd From owner-svn-src-head@freebsd.org Fri Mar 9 00: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 2E69CF3EA6D; Fri, 9 Mar 2018 00:08:44 +0000 (UTC) (envelope-from sbruno@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 D8E7378553; Fri, 9 Mar 2018 00:08:43 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3B5517D93; Fri, 9 Mar 2018 00:08:43 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2908h24078102; Fri, 9 Mar 2018 00:08:43 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2908hUf078100; Fri, 9 Mar 2018 00:08:43 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201803090008.w2908hUf078100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 9 Mar 2018 00:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330675 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 330675 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 00:08:44 -0000 Author: sbruno Date: Fri Mar 9 00:08:43 2018 New Revision: 330675 URL: https://svnweb.freebsd.org/changeset/base/330675 Log: Update tcp_lro with tested bugfixes from Netflix and LLNW: rrs - Lets make the LRO code look for true dup-acks and window update acks fly on through and combine. rrs - Make the LRO engine a bit more aware of ack-only seq space. Lets not have it incorrectly wipe out newer acks for older acks when we have out-of-order acks (common in wifi environments). jeggleston - LRO eating window updates Based on all of the above I think we are RFC compliant doing it this way: https://tools.ietf.org/html/rfc1122 section 4.2.2.16 "Note that TCP has a heuristic to select the latest window update despite possible datagram reordering; as a result, it may ignore a window update with a smaller window than previously offered if neither the sequence number nor the acknowledgment number is increased." Submitted by: Kevin Bowling Reviewed by: rstone gallatin Sponsored by: NetFlix and Limelight Networks Differential Revision: https://reviews.freebsd.org/D14540 Modified: head/sys/netinet/tcp_lro.c head/sys/netinet/tcp_seq.h Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu Mar 8 22:54:50 2018 (r330674) +++ head/sys/netinet/tcp_lro.c Fri Mar 9 00:08:43 2018 (r330675) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -794,7 +795,9 @@ tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, uint3 /* Try to append the new segment. */ if (__predict_false(seq != le->next_seq || - (tcp_data_len == 0 && le->ack_seq == th->th_ack))) { + (tcp_data_len == 0 && + le->ack_seq == th->th_ack && + le->window == th->th_win))) { /* Out of order packet or duplicate ACK. */ tcp_lro_active_remove(le); tcp_lro_flush(lc, le); @@ -811,12 +814,20 @@ tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, uint3 le->tsval = tsval; le->tsecr = *(ts_ptr + 2); } - - le->next_seq += tcp_data_len; - le->ack_seq = th->th_ack; - le->window = th->th_win; - le->append_cnt++; - + if (tcp_data_len || SEQ_GT(ntohl(th->th_ack), ntohl(le->ack_seq))) { + le->next_seq += tcp_data_len; + le->ack_seq = th->th_ack; + le->window = th->th_win; + le->append_cnt++; + } else if (th->th_ack == le->ack_seq) { + le->window = WIN_MAX(le->window, th->th_win); + le->append_cnt++; + } else { + /* no data and old ack */ + le->append_cnt++; + m_freem(m); + return (0); + } #ifdef TCP_LRO_UPDATE_CSUM le->ulp_csum += tcp_lro_rx_csum_fixup(le, l3hdr, th, tcp_data_len, ~csum); Modified: head/sys/netinet/tcp_seq.h ============================================================================== --- head/sys/netinet/tcp_seq.h Thu Mar 8 22:54:50 2018 (r330674) +++ head/sys/netinet/tcp_seq.h Fri Mar 9 00:08:43 2018 (r330675) @@ -47,6 +47,14 @@ #define SEQ_MIN(a, b) ((SEQ_LT(a, b)) ? (a) : (b)) #define SEQ_MAX(a, b) ((SEQ_GT(a, b)) ? (a) : (b)) +#define WIN_LT(a,b) ((short)(ntohs(a)-ntohs(b)) < 0) +#define WIN_LEQ(a,b) ((short)(ntohs(a)-ntohs(b)) <= 0) +#define WIN_GT(a,b) ((short)(ntohs(a)-ntohs(b)) > 0) +#define WIN_GEQ(a,b) ((short)(ntohs(a)-ntohs(b)) >= 0) + +#define WIN_MIN(a, b) ((WIN_LT(a, b)) ? (a) : (b)) +#define WIN_MAX(a, b) ((WIN_GT(a, b)) ? (a) : (b)) + /* for modulo comparisons of timestamps */ #define TSTMP_LT(a,b) ((int)((a)-(b)) < 0) #define TSTMP_GT(a,b) ((int)((a)-(b)) > 0) From owner-svn-src-head@freebsd.org Fri Mar 9 00:50: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 09B8AF41F13; Fri, 9 Mar 2018 00:50:41 +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 AFEE479FD8; Fri, 9 Mar 2018 00:50:40 +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 AA42B18409; Fri, 9 Mar 2018 00:50:40 +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 w290oevf098445; Fri, 9 Mar 2018 00:50:40 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w290oebi098444; Fri, 9 Mar 2018 00:50:40 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803090050.w290oebi098444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Fri, 9 Mar 2018 00:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330676 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330676 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 00:50:41 -0000 Author: brooks Date: Fri Mar 9 00:50:40 2018 New Revision: 330676 URL: https://svnweb.freebsd.org/changeset/base/330676 Log: Copyout a whole int to cpuset_domain's policy pointer. The previous code only copied 16-bits and corrupted the target int. Reviewed by: kib, markj Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14611 Modified: head/sys/kern/kern_cpuset.c Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Fri Mar 9 00:08:43 2018 (r330675) +++ head/sys/kern/kern_cpuset.c Fri Mar 9 00:50:40 2018 (r330676) @@ -1972,8 +1972,8 @@ kern_cpuset_getdomain(struct thread *td, cpulevel_t le if (error == 0) error = copyout(mask, maskp, domainsetsize); if (error == 0) - error = copyout(&outset.ds_policy, policyp, - sizeof(outset.ds_policy)); + if (suword32(policyp, outset.ds_policy) != 0) + error = EFAULT; out: free(mask, M_TEMP); return (error); From owner-svn-src-head@freebsd.org Fri Mar 9 02:58: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 C0F80F4A52C; Fri, 9 Mar 2018 02:58:25 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (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 3AB237E936; Fri, 9 Mar 2018 02:58:25 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id j2so756952pff.10; Thu, 08 Mar 2018 18:58:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=EkVLu1f+wq7uD0we0KaCwg7KI1AFmDG/gzZaqJL6fpw=; b=U0Jo8xidQe8w5aaCnOoBUKKwMJ1J4g0sFyRvzCxNQYkp86w/Jmof2T0pReFqxyoIeA UlAiNPkCVI378dUEX8dSlIQCUs2gG4XohMnNxZOKVO/n5FUiUpudHT5dfGVBdiAhTMif IrlfDJzI5MxY694uHtF4FO0XZzFTMzShhI1qQNysYXa9MEU4/twNtg+YXDNcC+SX26ZL 9+eTyWNpLfELb6Ikrowi9AemYkWPSqKUri0igL/s0BFFrGYYjWtnVm7QhmA1GKt4r79g A1PN+5GT4esxfuub/i2j84HiaqkuCwjJCQL8oa1msvCNu02nkBIL8T2uPYyIE5eNaiJb NQXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=EkVLu1f+wq7uD0we0KaCwg7KI1AFmDG/gzZaqJL6fpw=; b=iABbcLdxb3dxuA7oeAaB6ei5eUBpP9ttqACMEIMvAnCj6TRzTAsTAZ25Fe58KhIdl2 0VemqZCGD2tBR/axYt22IQbbtazHymG52b+TPEVV5fXoypPnB+nSVw6NqvQtZb+ZQTkX eUJuUAd5OKoWm7mLjLfzH3BOoVUmYgSC6HaEULMvvUUKCtdIlTFxPkOB355Taz9xLhIo ExhUnPjFs9E7NlTNK/gkj9mG9pSgCg3DnP+OzCBFQZDH6jFsBYDHn/eKQdHYgaEZTf28 y8LFTmUae1TYNh8ZC7B+yd95zpb7QMWI2TOaWG716VWIduMji0DDuqo661SwGYBkAZsW l4+w== X-Gm-Message-State: APf1xPAP1BflAaCmnUS9wswdU2KzR9c4qai6joK7/1nfTeJM7FxUdyE7 dXtwv/Ot26okywFRuRlLi7uucPoi X-Google-Smtp-Source: AG47ELsCC3wQJnK+nE/0oBtEdIFeHPB42nuwjsdW8rowlHMmRGMBgrQokBbccPMd5XDcoF6f/lkzXQ== X-Received: by 10.99.99.2 with SMTP id x2mr23099986pgb.406.1520564304135; Thu, 08 Mar 2018 18:58:24 -0800 (PST) Received: from [192.168.1.105] (152.94.214.218.sta.wbroadband.net.au. [218.214.94.152]) by smtp.gmail.com with ESMTPSA id n26sm116887pfk.94.2018.03.08.18.58.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 18:58:23 -0800 (PST) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r328011 - in head/sys/amd64/vmm: amd intel To: Ed Maste , FreeBSD Security Team Cc: Tycho Nightingale , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers References: <201801151837.w0FIb3R7098459@repo.freebsd.org> From: Kubilay Kocak Message-ID: Date: Fri, 9 Mar 2018 13:57:46 +1100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-AU 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: Fri, 09 Mar 2018 02:58:26 -0000 On 9/03/2018 8:57 am, Ed Maste wrote: > On 15 January 2018 at 13:37, Tycho Nightingale wrote: >> Author: tychon >> Date: Mon Jan 15 18:37:03 2018 >> New Revision: 328011 >> URL: https://svnweb.freebsd.org/changeset/base/328011 >> >> Log: >> Provide some mitigation against CVE-2017-5715 by clearing registers >> upon returning from the guest which aren't immediately clobbered by >> the host. This eradicates any remaining guest contents limiting their >> usefulness in an exploit gadget. > > Will you MFC this to stable/11? Mitigations and related MFC's and SA's, etc for vulnerabilities, are presumably all being coordinated and handled by secteam, with associated (explicit) messaging when fixes don't apply to particular branches/versions, no? From owner-svn-src-head@freebsd.org Fri Mar 9 04: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 AC8B4F2B012; Fri, 9 Mar 2018 04:42:16 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 2F47A823AB; Fri, 9 Mar 2018 04:42:15 +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 mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 2F77F1A2661; Fri, 9 Mar 2018 15:42:06 +1100 (AEDT) Date: Fri, 9 Mar 2018 15:42:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mark Johnston cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330663 - head/sys/kern In-Reply-To: <201803081704.w28H4aQx052056@repo.freebsd.org> Message-ID: <20180309150402.X950@besplex.bde.org> References: <201803081704.w28H4aQx052056@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=IXfSM6YwnFqPYyAIxbIA:9 a=7064yCuboU82dyd_:21 a=PYkMtr5hiBaTbJBV:21 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: Fri, 09 Mar 2018 04:42:17 -0000 On Thu, 8 Mar 2018, Mark Johnston wrote: > Log: > Return E2BIG if we run out of space writing a compressed kernel dump. E2BIG a very wrong errno. It means "Argment list too long". It is broken as designed, with "too" encrypted as "2" and no indication of what is too big. EFBIG is not so wrong. It means "File too large". > ENOSPC causes the MD kernel dump code to retry the dump, but this is > undesirable in the case where we legitimately ran out of space. ENOSPC is the correct errno. It means "[really] No space left on device". The bug was either retrying or possibly abusing ENOSPC instead of EAGAIN to mean "transiently out of space for something". > > Modified: > head/sys/kern/kern_shutdown.c > > Modified: head/sys/kern/kern_shutdown.c > ============================================================================== > --- head/sys/kern/kern_shutdown.c Thu Mar 8 16:27:31 2018 (r330662) > +++ head/sys/kern/kern_shutdown.c Thu Mar 8 17:04:36 2018 (r330663) > @@ -1115,6 +1115,12 @@ dump_check_bounds(struct dumperinfo *di, off_t offset, > > if (length != 0 && (offset < di->mediaoffset || > offset - di->mediaoffset + length > di->mediasize)) { > + if (di->kdcomp != NULL && offset >= di->mediaoffset) { > + printf( > + "Compressed dump failed to fit in device boundaries.\n"); > + return (E2BIG); > + } > + Style bug: extra blank line. Even the outer if statements in this function are missing this error. > printf("Attempt to write outside dump device boundaries.\n" > "offset(%jd), mediaoffset(%jd), length(%ju), mediasize(%jd).\n", > (intmax_t)offset, (intmax_t)di->mediaoffset, ENOSPC is still returned for this error. The problem is that this function shouldn't decide the caller's retry policy or error handling policy. It should just return ENOSPC or EINVAL without printing anything. Then the caller may retry for ENOSPC if it has alternative method(s) that take less space. Then the caller should print the failure message if nothing works. Other style bugs: - capitalization of error messages - termination of error messages with a period - no prefix for the error messages. Normal kernel error messages look like "dump: No space left on device". Here the error messages are English sentences which have to be parsed to find the subsystem that generated the error. Since the error messages here are fairly well written sentences, this is possible, but it often saves space to not write full sentences and it is always clearer to start with a prefix. Here you had to outdent the messages to get them to fit. Use of the err() family in userland gives a more uniform style in which it is impossible to terminate the message with a period (since err() prints the final word in sterror(errno) and doesn't print a period after it, but prints a newline so you can't print the period after it). Bruce From owner-svn-src-head@freebsd.org Fri Mar 9 04:45: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 28E34F2B471; Fri, 9 Mar 2018 04:45:25 +0000 (UTC) (envelope-from ume@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 CB548825FB; Fri, 9 Mar 2018 04:45:24 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C64F21A9CE; Fri, 9 Mar 2018 04:45:24 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w294jOfe017379; Fri, 9 Mar 2018 04:45:24 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w294jOi6017378; Fri, 9 Mar 2018 04:45:24 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201803090445.w294jOi6017378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Fri, 9 Mar 2018 04:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330681 - head/sys/fs/fdescfs X-SVN-Group: head X-SVN-Commit-Author: ume X-SVN-Commit-Paths: head/sys/fs/fdescfs X-SVN-Commit-Revision: 330681 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 04:45:25 -0000 Author: ume Date: Fri Mar 9 04:45:24 2018 New Revision: 330681 URL: https://svnweb.freebsd.org/changeset/base/330681 Log: Fix Bad file descriptor error. MFC after: 1 week Modified: head/sys/fs/fdescfs/fdesc_vnops.c Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Fri Mar 9 02:55:27 2018 (r330680) +++ head/sys/fs/fdescfs/fdesc_vnops.c Fri Mar 9 04:45:24 2018 (r330681) @@ -415,6 +415,8 @@ fdesc_pathconf(struct vop_pathconf_args *ap) *ap->a_retval = 1; return (0); default: + if (VTOFDESC(vp)->fd_type == Froot) + return (vop_stdpathconf(ap)); vref(vp); VOP_UNLOCK(vp, 0); error = kern_fpathconf(curthread, VTOFDESC(vp)->fd_fd, From owner-svn-src-head@freebsd.org Fri Mar 9 06:51: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 DA054F31976; Fri, 9 Mar 2018 06:51:04 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) (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 7794686DC3; Fri, 9 Mar 2018 06:51:03 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f46.google.com with SMTP id u5-v6so1651553itc.1; Thu, 08 Mar 2018 22:51:03 -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=CUVrkfr91OtOGlK3UCzmYNParbgvLwrIVNB/iKGiusE=; b=VoxUx0yvC0tJljlhld9eey6xpZeCN9k/KA2FXCeR2SFmqqvJxAQVEX3Hbzq5SGlaZ2 39C5D/PrPy6Hl9gtehXXbPqxhPNFDgbwRIYHeNCREhXa1L8qCkEK0zK59HgtbObPMi5u PSn22Cz2spufraDKEqyEGzJ1BSZzIoj4EhzYm+d0hLJT7OEtQdyvvcJZ7Jqm/nrkPOJm usNSFRB9V396z5oCQj8VRoBLkyoTDMr2a+MZ2kSLW0l1+wYqpoatE8LzE8pQ0IY2EZsG MnZ5j2ke19X2JkG/I20KGLATJIfL0BAizjCWpswWK16ddnfweOXOwy71h6EKARyWGH6Q CoOQ== X-Gm-Message-State: AElRT7FqsrJXKEzZ5upVlqdPgVmDJDfEgFo5aVbRy9tSLhKoTEgBb6lB 0E+7OuistA7hw6h8ezo3p056nB6z X-Google-Smtp-Source: AG47ELsgpZsQe+NkaB+8QwWBLqAzoI308eSNEXEyWt2u7ItvRIFglaIqQjVA8TYuKVdqMOje3Pmdsw== X-Received: by 2002:a24:2e4e:: with SMTP id i75-v6mr2011432ita.96.1520578262946; Thu, 08 Mar 2018 22:51:02 -0800 (PST) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id e102sm313071ioj.87.2018.03.08.22.51.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 22:51:02 -0800 (PST) Received: by mail-it0-f45.google.com with SMTP id u66so1603582ith.1; Thu, 08 Mar 2018 22:51:02 -0800 (PST) X-Received: by 10.36.161.2 with SMTP id y2mr2073453ite.53.1520578261880; Thu, 08 Mar 2018 22:51:01 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Thu, 8 Mar 2018 22:51:01 -0800 (PST) In-Reply-To: <20180309150402.X950@besplex.bde.org> References: <201803081704.w28H4aQx052056@repo.freebsd.org> <20180309150402.X950@besplex.bde.org> From: Conrad Meyer Date: Thu, 8 Mar 2018 22:51:01 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330663 - head/sys/kern To: Bruce Evans Cc: Mark Johnston , 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 Mar 2018 06:51:05 -0000 On Thu, Mar 8, 2018 at 8:42 PM, Bruce Evans wrote: > On Thu, 8 Mar 2018, Mark Johnston wrote: >> ... >> +++ head/sys/kern/kern_shutdown.c Thu Mar 8 17:04:36 2018 >> (r330663) >> @@ -1115,6 +1115,12 @@ dump_check_bounds(struct dumperinfo *di, off_t >> offset, >> >> if (length != 0 && (offset < di->mediaoffset || >> offset - di->mediaoffset + length > di->mediasize)) { >> + if (di->kdcomp != NULL && offset >= di->mediaoffset) { >> + printf( >> + "Compressed dump failed to fit in device >> boundaries.\n"); >> + return (E2BIG); >> + } >> + > > Style bug: extra blank line. Even the outer if statements in this function > are missing this error. No. Style(9) does not and should not require the complete absence of blank lines. Committers are free to use their best judgement on how to separate blocks of code. I think Mark's decision is eminently reasonable. >> printf("Attempt to write outside dump device >> boundaries.\n" >> "offset(%jd), mediaoffset(%jd), length(%ju), >> mediasize(%jd).\n", >> (intmax_t)offset, (intmax_t)di->mediaoffset, > ... > > Other style bugs: > - capitalization of error messages > - termination of error messages with a period Why do you think these are style bugs? Conrad From owner-svn-src-head@freebsd.org Fri Mar 9 09:21: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 3B26EF3B629; Fri, 9 Mar 2018 09:21:23 +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 E2B826C9E1; Fri, 9 Mar 2018 09:21:22 +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 DDB461D5B2; Fri, 9 Mar 2018 09:21:22 +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 w299LMfJ057252; Fri, 9 Mar 2018 09:21:22 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w299LMjj057251; Fri, 9 Mar 2018 09:21:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201803090921.w299LMjj057251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 9 Mar 2018 09:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330686 - head/contrib/llvm/lib/Target/ARM X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/Target/ARM X-SVN-Commit-Revision: 330686 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 09:21:23 -0000 Author: dim Date: Fri Mar 9 09:21:22 2018 New Revision: 330686 URL: https://svnweb.freebsd.org/changeset/base/330686 Log: Pull in r326882 from upstream llvm trunk (by Sjoerd Meijer): [ARM] Fix for PR36577 Don't PerformSHLSimplify if the given node is used by a node that also uses a constant because we may get stuck in an infinite combine loop. bugzilla: https://bugs.llvm.org/show_bug.cgi?id=36577 Patch by Sam Parker. Differential Revision: https://reviews.llvm.org/D44097 This fixes a hang when compiling one particular file in java/openjdk8 for armv6 and armv7. Reported by: swills PR: 226388 Modified: head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Modified: head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Fri Mar 9 05:55:53 2018 (r330685) +++ head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp Fri Mar 9 09:21:22 2018 (r330686) @@ -10201,7 +10201,14 @@ static SDValue PerformSHLSimplify(SDNode *N, case ISD::XOR: case ISD::SETCC: case ARMISD::CMP: - // Check that its not already using a shl. + // Check that the user isn't already using a constant because there + // aren't any instructions that support an immediate operand and a + // shifted operand. + if (isa(U->getOperand(0)) || + isa(U->getOperand(1))) + return SDValue(); + + // Check that it's not already using a shift. if (U->getOperand(0).getOpcode() == ISD::SHL || U->getOperand(1).getOpcode() == ISD::SHL) return SDValue(); @@ -10223,8 +10230,6 @@ static SDValue PerformSHLSimplify(SDNode *N, if (!C1ShlC2 || !C2) return SDValue(); - DEBUG(dbgs() << "Trying to simplify shl: "; N->dump()); - APInt C2Int = C2->getAPIntValue(); APInt C1Int = C1ShlC2->getAPIntValue(); @@ -10238,12 +10243,12 @@ static SDValue PerformSHLSimplify(SDNode *N, C1Int.lshrInPlace(C2Int); // The immediates are encoded as an 8-bit value that can be rotated. - unsigned Zeros = C1Int.countLeadingZeros() + C1Int.countTrailingZeros(); - if (C1Int.getBitWidth() - Zeros > 8) - return SDValue(); + auto LargeImm = [](const APInt &Imm) { + unsigned Zeros = Imm.countLeadingZeros() + Imm.countTrailingZeros(); + return Imm.getBitWidth() - Zeros > 8; + }; - Zeros = C2Int.countLeadingZeros() + C2Int.countTrailingZeros(); - if (C2Int.getBitWidth() - Zeros > 8) + if (LargeImm(C1Int) || LargeImm(C2Int)) return SDValue(); SelectionDAG &DAG = DCI.DAG; @@ -10253,6 +10258,10 @@ static SDValue PerformSHLSimplify(SDNode *N, DAG.getConstant(C1Int, dl, MVT::i32)); // Shift left to compensate for the lshr of C1Int. SDValue Res = DAG.getNode(ISD::SHL, dl, MVT::i32, BinOp, SHL.getOperand(1)); + + DEBUG(dbgs() << "Simplify shl use:\n"; SHL.getOperand(0).dump(); SHL.dump(); + N->dump()); + DEBUG(dbgs() << "Into:\n"; X.dump(); BinOp.dump(); Res.dump()); DAG.ReplaceAllUsesWith(SDValue(N, 0), Res); return SDValue(N, 0); From owner-svn-src-head@freebsd.org Fri Mar 9 09: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 3842DF3DB2B; Fri, 9 Mar 2018 09:50:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 7E8D96DCDA; Fri, 9 Mar 2018 09:50:35 +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 mail108.syd.optusnet.com.au (Postfix) with ESMTPS id A12871A2D65; Fri, 9 Mar 2018 20:50:33 +1100 (AEDT) Date: Fri, 9 Mar 2018 20:50:32 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: Bruce Evans , Mark Johnston , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330663 - head/sys/kern In-Reply-To: Message-ID: <20180309194900.F2122@besplex.bde.org> References: <201803081704.w28H4aQx052056@repo.freebsd.org> <20180309150402.X950@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=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=EVY10kfv5RHgi_n90qYA:9 a=fUBJKX1s9cisX-TV:21 a=W0ZdzM6i1VXaRkF-:21 a=SskPc2CMMsG2m25c:21 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: Fri, 09 Mar 2018 09:50:37 -0000 On Thu, 8 Mar 2018, Conrad Meyer wrote: > On Thu, Mar 8, 2018 at 8:42 PM, Bruce Evans wrote: >> On Thu, 8 Mar 2018, Mark Johnston wrote: >>> ... >>> +++ head/sys/kern/kern_shutdown.c Thu Mar 8 17:04:36 2018 >>> (r330663) >>> @@ -1115,6 +1115,12 @@ dump_check_bounds(struct dumperinfo *di, off_t >>> offset, >>> >>> if (length != 0 && (offset < di->mediaoffset || >>> offset - di->mediaoffset + length > di->mediasize)) { >>> + if (di->kdcomp != NULL && offset >= di->mediaoffset) { >>> + printf( >>> + "Compressed dump failed to fit in device >>> boundaries.\n"); >>> + return (E2BIG); >>> + } >>> + >> >> Style bug: extra blank line. Even the outer if statements in this function >> are missing this error. > > No. Style(9) does not and should not require the complete absence of > blank lines. Committers are free to use their best judgement on how > to separate blocks of code. I think Mark's decision is eminently > reasonable. style(9) does require this. This is hard to see since the style guide has been mangled by converting it into a man page, with markup in non C-code and lots of blank lines to separate the markup. See /usr/src/admin/style/style in 4.4BSD or /usr/src/share/misc/style in NetBSD for non-mangled versions. These are pure C code which give many rules implicitly by example. All versions give 2 or 3 rules for leaving a blank line between groups of header files. These rules are somewhat needed since leaving blank lines is so unusual. It is also the default for indent(1) (indent -sob). indent removes far too many blank lines by default. I like to have optional blank lines only before blocks of code headed by a comment (with the blank line before the comment). But is more common in KNF code to not have a blank line before a block comment (since the "/*" for the first line of the comment is an adequate separator). Blank lines might be used to separate sections of code, but the above blank line is a very large style bug since it separates related code, while the style nearby is to not separate even unrelated code. kern_shutdown.c has very few extra blank lines. indent only wants to remove 2. I see a few more: - the include of sys/signalvar.h is separated from all other includes by a blank line (and more so by not sorting it into the sys includes section) - similarly for the include of machine/stdarg.h. This has an attached comment about K&R support that wasn't needed even when K&R was supported. - boot() has an extra blank line between initializing waittime() and calling sync(). These are unrelated, but the code is so simple (just 2 statements) that splitting it up is not useful. Elsewhere, boot() uses lots of little sections headed by comments with a block line before the comments except for some block comments. - panic() has a blank line before a va_start() but no blank line after the matching va_end(), then blank line after the next statement. The second blank line is correct for matching the first one since the next statement is related (it completes printing a message). - kproc_shutdown() has a bogus blank line after a return statement, and a nonsense blank line to separate checking of 'error' from setting it. - kthread() copies the bad style of kproc_shutdown() perfectly. Dumper code had no extra blank lines. This is easy enough since it is small (less than 10% of the file). >>> printf("Attempt to write outside dump device >>> boundaries.\n" >>> "offset(%jd), mediaoffset(%jd), length(%ju), >>> mediasize(%jd).\n", >>> (intmax_t)offset, (intmax_t)di->mediaoffset, >> ... >> >> Other style bugs: >> - capitalization of error messages >> - termination of error messages with a period > > Why do you think these are style bugs? Because they are. Error messages are conventionally not capitalized or terminated with a period. You snipped my partial explanation by example that err(3) almost enforces this in userland by not supporting it. Userland messages look like "foo: bar: Bad style", where 'foo' is the program name and it would be unUnix-like to capitalize it; 'bar' might be a function name and it would be Unix-like to capitalize that too, or it might be an English word and then it is unclear whose style rules apply (IIRC, capitalization after a colon only depends on style); and "Bad style" is strerror(ESTYLE) -- for some reason, strings returned by strerror() are always capitalized so they match some style rules for colons, and then using different style rules for 'bar' is either a bug or a feature. There is not much enforcement of this in the kernel. panic() is a bit like err(). Using device_printf() gives a uniform style for the first word in device driver messages. It would be unUnix-line to capitalize device names, so this gives uncapitalized messages if the style rule used for capitalization after colons is to not capitalize. Bruce From owner-svn-src-head@freebsd.org Fri Mar 9 10:34: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 753F3F41156; Fri, 9 Mar 2018 10:34:45 +0000 (UTC) (envelope-from andrew@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 29E826F692; Fri, 9 Mar 2018 10:34:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 24B601E108; Fri, 9 Mar 2018 10:34:45 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w29AYjFo093352; Fri, 9 Mar 2018 10:34:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29AYj9G093351; Fri, 9 Mar 2018 10:34:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201803091034.w29AYj9G093351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 9 Mar 2018 10:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330687 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 330687 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 10:34:45 -0000 Author: andrew Date: Fri Mar 9 10:34:44 2018 New Revision: 330687 URL: https://svnweb.freebsd.org/changeset/base/330687 Log: Use the correct address to write back to memory in the GICv3 ITS driver. This seems to no be needed on supported hardware as they are cache-coherent, however this may not be the case on all platforms. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/gicv3_its.c Modified: head/sys/arm64/arm64/gicv3_its.c ============================================================================== --- head/sys/arm64/arm64/gicv3_its.c Fri Mar 9 09:21:22 2018 (r330686) +++ head/sys/arm64/arm64/gicv3_its.c Fri Mar 9 10:34:44 2018 (r330687) @@ -567,7 +567,7 @@ gicv3_its_pendtables_init(struct gicv3_its_softc *sc) 0, LPI_PENDTAB_MAX_ADDR, LPI_PENDTAB_ALIGN, 0); /* Flush so the ITS can see the memory */ - cpu_dcache_wb_range((vm_offset_t)sc->sc_pend_base, + cpu_dcache_wb_range((vm_offset_t)sc->sc_pend_base[i], LPI_PENDTAB_SIZE); } } From owner-svn-src-head@freebsd.org Fri Mar 9 11:33: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 F04FCF45104; Fri, 9 Mar 2018 11:33:57 +0000 (UTC) (envelope-from avos@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 93E5371D2F; Fri, 9 Mar 2018 11:33:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8E4641EA40; Fri, 9 Mar 2018 11:33:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w29BXvXS023089; Fri, 9 Mar 2018 11:33:57 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29BXuTg023081; Fri, 9 Mar 2018 11:33:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803091133.w29BXuTg023081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 9 Mar 2018 11:33:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330688 - in head/sys: dev/bwn dev/ral dev/usb/wlan net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: dev/bwn dev/ral dev/usb/wlan net80211 X-SVN-Commit-Revision: 330688 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 11:33:58 -0000 Author: avos Date: Fri Mar 9 11:33:56 2018 New Revision: 330688 URL: https://svnweb.freebsd.org/changeset/base/330688 Log: net80211: wrap protection frame allocation into ieee80211_alloc_prot() Move copy-pasted code for RTS/CTS frame allocation into net80211. While here, add stat / debug message for allocation failures (copied from run(4)) + return error here in bwn(4). Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D14628 Modified: head/sys/dev/bwn/if_bwn.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_ural.c head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Fri Mar 9 10:34:44 2018 (r330687) +++ head/sys/dev/bwn/if_bwn.c Fri Mar 9 11:33:56 2018 (r330688) @@ -6401,15 +6401,14 @@ bwn_set_txhdr(struct bwn_mac *mac, struct ieee80211_no struct bwn_softc *sc = mac->mac_sc; struct ieee80211_frame *wh; struct ieee80211_frame *protwh; - struct ieee80211_frame_cts *cts; - struct ieee80211_frame_rts *rts; const struct ieee80211_txparam *tp = ni->ni_txparms; struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = &sc->sc_ic; struct mbuf *mprot; + uint8_t *prot_ptr; unsigned int len; uint32_t macctl = 0; - int protdur, rts_rate, rts_rate_fb, ismcast, isshort, rix, type; + int rts_rate, rts_rate_fb, ismcast, isshort, rix, type; uint16_t phyctl = 0; uint8_t rate, rate_fb; int fill_phy_ctl1 = 0; @@ -6528,7 +6527,8 @@ bwn_set_txhdr(struct bwn_mac *mac, struct ieee80211_no m->m_pkthdr.len + IEEE80211_CRC_LEN > vap->iv_rtsthreshold) macctl |= BWN_TX_MAC_LONGFRAME; - if (ic->ic_flags & IEEE80211_F_USEPROT) { + if ((ic->ic_flags & IEEE80211_F_USEPROT) && + ic->ic_protmode != IEEE80211_PROT_NONE) { /* Note: don't fall back to CCK rates for 5G */ if (phy->gmode) rts_rate = BWN_CCK_RATE_1MB; @@ -6537,60 +6537,34 @@ bwn_set_txhdr(struct bwn_mac *mac, struct ieee80211_no rts_rate_fb = bwn_get_fbrate(rts_rate); /* XXX 'rate' here is hardware rate now, not the net80211 rate */ - protdur = ieee80211_compute_duration(ic->ic_rt, - m->m_pkthdr.len, rate, isshort) + - + ieee80211_ack_duration(ic->ic_rt, rate, isshort); + mprot = ieee80211_alloc_prot(ni, m, rate, ic->ic_protmode); + if (mprot == NULL) { + if_inc_counter(vap->iv_ifp, IFCOUNTER_OERRORS, 1); + device_printf(sc->sc_dev, + "could not allocate mbuf for protection mode %d\n", + ic->ic_protmode); + return (ENOBUFS); + } - if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) { + switch (mac->mac_fw.fw_hdr_format) { + case BWN_FW_HDR_351: + prot_ptr = txhdr->body.r351.rts_frame; + break; + case BWN_FW_HDR_410: + prot_ptr = txhdr->body.r410.rts_frame; + break; + case BWN_FW_HDR_598: + prot_ptr = txhdr->body.r598.rts_frame; + break; + } - switch (mac->mac_fw.fw_hdr_format) { - case BWN_FW_HDR_351: - cts = (struct ieee80211_frame_cts *) - txhdr->body.r351.rts_frame; - break; - case BWN_FW_HDR_410: - cts = (struct ieee80211_frame_cts *) - txhdr->body.r410.rts_frame; - break; - case BWN_FW_HDR_598: - cts = (struct ieee80211_frame_cts *) - txhdr->body.r598.rts_frame; - break; - } + bcopy(mtod(mprot, uint8_t *), prot_ptr, mprot->m_pkthdr.len); + m_freem(mprot); - mprot = ieee80211_alloc_cts(ic, ni->ni_vap->iv_myaddr, - protdur); - KASSERT(mprot != NULL, ("failed to alloc mbuf\n")); - bcopy(mtod(mprot, uint8_t *), (uint8_t *)cts, - mprot->m_pkthdr.len); - m_freem(mprot); + if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) { macctl |= BWN_TX_MAC_SEND_CTSTOSELF; len = sizeof(struct ieee80211_frame_cts); } else { - switch (mac->mac_fw.fw_hdr_format) { - case BWN_FW_HDR_351: - rts = (struct ieee80211_frame_rts *) - txhdr->body.r351.rts_frame; - break; - case BWN_FW_HDR_410: - rts = (struct ieee80211_frame_rts *) - txhdr->body.r410.rts_frame; - break; - case BWN_FW_HDR_598: - rts = (struct ieee80211_frame_rts *) - txhdr->body.r598.rts_frame; - break; - } - - /* XXX rate/rate_fb is the hardware rate */ - protdur += ieee80211_ack_duration(ic->ic_rt, rate, - isshort); - mprot = ieee80211_alloc_rts(ic, wh->i_addr1, - wh->i_addr2, protdur); - KASSERT(mprot != NULL, ("failed to alloc mbuf\n")); - bcopy(mtod(mprot, uint8_t *), (uint8_t *)rts, - mprot->m_pkthdr.len); - m_freem(mprot); macctl |= BWN_TX_MAC_SEND_RTSCTS; len = sizeof(struct ieee80211_frame_rts); } Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Fri Mar 9 10:34:44 2018 (r330687) +++ head/sys/dev/ral/rt2560.c Fri Mar 9 11:33:56 2018 (r330688) @@ -1594,38 +1594,18 @@ rt2560_sendprot(struct rt2560_softc *sc, const struct mbuf *m, struct ieee80211_node *ni, int prot, int rate) { struct ieee80211com *ic = ni->ni_ic; - const struct ieee80211_frame *wh; struct rt2560_tx_desc *desc; struct rt2560_tx_data *data; struct mbuf *mprot; - int protrate, ackrate, pktlen, flags, isshort, error; - uint16_t dur; + int protrate, flags, error; bus_dma_segment_t segs[RT2560_MAX_SCATTER]; int nsegs; - KASSERT(prot == IEEE80211_PROT_RTSCTS || prot == IEEE80211_PROT_CTSONLY, - ("protection %d", prot)); - - wh = mtod(m, const struct ieee80211_frame *); - pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; - - protrate = ieee80211_ctl_rate(ic->ic_rt, rate); - ackrate = ieee80211_ack_rate(ic->ic_rt, rate); - - isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) - + ieee80211_ack_duration(ic->ic_rt, rate, isshort); - flags = RT2560_TX_MORE_FRAG; - if (prot == IEEE80211_PROT_RTSCTS) { - /* NB: CTS is the same size as an ACK */ - dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); - flags |= RT2560_TX_ACK; - mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); - } else { - mprot = ieee80211_alloc_cts(ic, ni->ni_vap->iv_myaddr, dur); - } + mprot = ieee80211_alloc_prot(ni, m, rate, prot); if (mprot == NULL) { - /* XXX stat + msg */ + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + device_printf(sc->sc_dev, + "could not allocate mbuf for protection mode %d\n", prot); return ENOBUFS; } @@ -1645,6 +1625,11 @@ rt2560_sendprot(struct rt2560_softc *sc, data->ni = ieee80211_ref_node(ni); /* ctl frames are not taken into account for amrr */ data->rix = IEEE80211_FIXED_RATE_NONE; + + protrate = ieee80211_ctl_rate(ic->ic_rt, rate); + flags = RT2560_TX_MORE_FRAG; + if (prot == IEEE80211_PROT_RTSCTS) + flags |= RT2560_TX_ACK; rt2560_setup_tx_desc(sc, desc, flags, mprot->m_pkthdr.len, protrate, 1, segs->ds_addr); Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Fri Mar 9 10:34:44 2018 (r330687) +++ head/sys/dev/ral/rt2661.c Fri Mar 9 11:33:56 2018 (r330688) @@ -1361,38 +1361,18 @@ rt2661_sendprot(struct rt2661_softc *sc, int ac, { struct ieee80211com *ic = ni->ni_ic; struct rt2661_tx_ring *txq = &sc->txq[ac]; - const struct ieee80211_frame *wh; struct rt2661_tx_desc *desc; struct rt2661_tx_data *data; struct mbuf *mprot; - int protrate, ackrate, pktlen, flags, isshort, error; - uint16_t dur; + int protrate, flags, error; bus_dma_segment_t segs[RT2661_MAX_SCATTER]; int nsegs; - KASSERT(prot == IEEE80211_PROT_RTSCTS || prot == IEEE80211_PROT_CTSONLY, - ("protection %d", prot)); - - wh = mtod(m, const struct ieee80211_frame *); - pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; - - protrate = ieee80211_ctl_rate(ic->ic_rt, rate); - ackrate = ieee80211_ack_rate(ic->ic_rt, rate); - - isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) - + ieee80211_ack_duration(ic->ic_rt, rate, isshort); - flags = RT2661_TX_MORE_FRAG; - if (prot == IEEE80211_PROT_RTSCTS) { - /* NB: CTS is the same size as an ACK */ - dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); - flags |= RT2661_TX_NEED_ACK; - mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); - } else { - mprot = ieee80211_alloc_cts(ic, ni->ni_vap->iv_myaddr, dur); - } + mprot = ieee80211_alloc_prot(ni, m, rate, prot); if (mprot == NULL) { - /* XXX stat + msg */ + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + device_printf(sc->sc_dev, + "could not allocate mbuf for protection mode %d\n", prot); return ENOBUFS; } @@ -1412,6 +1392,11 @@ rt2661_sendprot(struct rt2661_softc *sc, int ac, data->ni = ieee80211_ref_node(ni); /* ctl frames are not taken into account for amrr */ data->rix = IEEE80211_FIXED_RATE_NONE; + + protrate = ieee80211_ctl_rate(ic->ic_rt, rate); + flags = RT2661_TX_MORE_FRAG; + if (prot == IEEE80211_PROT_RTSCTS) + flags |= RT2661_TX_NEED_ACK; rt2661_setup_tx_desc(sc, desc, flags, 0, mprot->m_pkthdr.len, protrate, segs, 1, ac); Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Fri Mar 9 10:34:44 2018 (r330687) +++ head/sys/dev/usb/wlan/if_rum.c Fri Mar 9 11:33:56 2018 (r330688) @@ -1419,37 +1419,25 @@ rum_sendprot(struct rum_softc *sc, const struct mbuf *m, struct ieee80211_node *ni, int prot, int rate) { struct ieee80211com *ic = ni->ni_ic; - const struct ieee80211_frame *wh; struct rum_tx_data *data; struct mbuf *mprot; - int protrate, pktlen, flags, isshort; - uint16_t dur; + int protrate, flags; RUM_LOCK_ASSERT(sc); - KASSERT(prot == IEEE80211_PROT_RTSCTS || prot == IEEE80211_PROT_CTSONLY, - ("protection %d", prot)); - wh = mtod(m, const struct ieee80211_frame *); - pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; + mprot = ieee80211_alloc_prot(ni, m, rate, prot); + if (mprot == NULL) { + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + device_printf(sc->sc_dev, + "could not allocate mbuf for protection mode %d\n", prot); + return (ENOBUFS); + } protrate = ieee80211_ctl_rate(ic->ic_rt, rate); - - isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) - + ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags = 0; - if (prot == IEEE80211_PROT_RTSCTS) { - /* NB: CTS is the same size as an ACK */ - dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); + if (prot == IEEE80211_PROT_RTSCTS) flags |= RT2573_TX_NEED_ACK; - mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); - } else { - mprot = ieee80211_alloc_cts(ic, ni->ni_vap->iv_myaddr, dur); - } - if (mprot == NULL) { - /* XXX stat + msg */ - return (ENOBUFS); - } + data = STAILQ_FIRST(&sc->tx_free); STAILQ_REMOVE_HEAD(&sc->tx_free, next); sc->tx_nfree--; Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Mar 9 10:34:44 2018 (r330687) +++ head/sys/dev/usb/wlan/if_run.c Fri Mar 9 11:33:56 2018 (r330688) @@ -3543,56 +3543,34 @@ run_sendprot(struct run_softc *sc, const struct mbuf *m, struct ieee80211_node *ni, int prot, int rate) { struct ieee80211com *ic = ni->ni_ic; - struct ieee80211_frame *wh; struct run_tx_data *data; struct rt2870_txd *txd; struct rt2860_txwi *txwi; struct mbuf *mprot; int ridx; int protrate; - int ackrate; - int pktlen; - int isshort; - uint16_t dur; - uint8_t type; uint8_t wflags = 0; uint8_t xflags = 0; RUN_LOCK_ASSERT(sc, MA_OWNED); - KASSERT(prot == IEEE80211_PROT_RTSCTS || prot == IEEE80211_PROT_CTSONLY, - ("protection %d", prot)); - - wh = mtod(m, struct ieee80211_frame *); - pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; - type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - - protrate = ieee80211_ctl_rate(ic->ic_rt, rate); - ackrate = ieee80211_ack_rate(ic->ic_rt, rate); - - isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) - + ieee80211_ack_duration(ic->ic_rt, rate, isshort); - wflags = RT2860_TX_FRAG; - /* check that there are free slots before allocating the mbuf */ if (sc->sc_epq[0].tx_nfree == 0) /* let caller free mbuf */ return (ENOBUFS); - if (prot == IEEE80211_PROT_RTSCTS) { - /* NB: CTS is the same size as an ACK */ - dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); - xflags |= RT2860_TX_ACK; - mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); - } else { - mprot = ieee80211_alloc_cts(ic, ni->ni_vap->iv_myaddr, dur); - } + mprot = ieee80211_alloc_prot(ni, m, rate, prot); if (mprot == NULL) { if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); RUN_DPRINTF(sc, RUN_DEBUG_XMIT, "could not allocate mbuf\n"); return (ENOBUFS); } + + protrate = ieee80211_ctl_rate(ic->ic_rt, rate); + wflags = RT2860_TX_FRAG; + xflags = 0; + if (prot == IEEE80211_PROT_RTSCTS) + xflags |= RT2860_TX_ACK; data = STAILQ_FIRST(&sc->sc_epq[0].tx_fh); STAILQ_REMOVE_HEAD(&sc->sc_epq[0].tx_fh, next); Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Fri Mar 9 10:34:44 2018 (r330687) +++ head/sys/dev/usb/wlan/if_ural.c Fri Mar 9 11:33:56 2018 (r330688) @@ -1130,37 +1130,23 @@ ural_sendprot(struct ural_softc *sc, const struct mbuf *m, struct ieee80211_node *ni, int prot, int rate) { struct ieee80211com *ic = ni->ni_ic; - const struct ieee80211_frame *wh; struct ural_tx_data *data; struct mbuf *mprot; - int protrate, ackrate, pktlen, flags, isshort; - uint16_t dur; + int protrate, flags; - KASSERT(prot == IEEE80211_PROT_RTSCTS || prot == IEEE80211_PROT_CTSONLY, - ("protection %d", prot)); + mprot = ieee80211_alloc_prot(ni, m, rate, prot); + if (mprot == NULL) { + if_inc_counter(ni->ni_vap->iv_ifp, IFCOUNTER_OERRORS, 1); + device_printf(sc->sc_dev, + "could not allocate mbuf for protection mode %d\n", prot); + return ENOBUFS; + } - wh = mtod(m, const struct ieee80211_frame *); - pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; - protrate = ieee80211_ctl_rate(ic->ic_rt, rate); - ackrate = ieee80211_ack_rate(ic->ic_rt, rate); - - isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; - dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) - + ieee80211_ack_duration(ic->ic_rt, rate, isshort); flags = RAL_TX_RETRY(7); - if (prot == IEEE80211_PROT_RTSCTS) { - /* NB: CTS is the same size as an ACK */ - dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); + if (prot == IEEE80211_PROT_RTSCTS) flags |= RAL_TX_ACK; - mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); - } else { - mprot = ieee80211_alloc_cts(ic, ni->ni_vap->iv_myaddr, dur); - } - if (mprot == NULL) { - /* XXX stat + msg */ - return ENOBUFS; - } + data = STAILQ_FIRST(&sc->tx_free); STAILQ_REMOVE_HEAD(&sc->tx_free, next); sc->tx_nfree--; Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Fri Mar 9 10:34:44 2018 (r330687) +++ head/sys/net80211/ieee80211_output.c Fri Mar 9 11:33:56 2018 (r330688) @@ -3088,6 +3088,39 @@ ieee80211_alloc_cts(struct ieee80211com *ic, return m; } +/* + * Wrapper for CTS/RTS frame allocation. + */ +struct mbuf * +ieee80211_alloc_prot(struct ieee80211_node *ni, const struct mbuf *m, + uint8_t rate, int prot) +{ + struct ieee80211com *ic = ni->ni_ic; + const struct ieee80211_frame *wh; + struct mbuf *mprot; + uint16_t dur; + int pktlen, isshort; + + KASSERT(prot == IEEE80211_PROT_RTSCTS || + prot == IEEE80211_PROT_CTSONLY, + ("wrong protection type %d", prot)); + + wh = mtod(m, const struct ieee80211_frame *); + pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN; + isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0; + dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort) + + ieee80211_ack_duration(ic->ic_rt, rate, isshort); + + if (prot == IEEE80211_PROT_RTSCTS) { + /* NB: CTS is the same size as an ACK */ + dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort); + mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur); + } else + mprot = ieee80211_alloc_cts(ic, ni->ni_vap->iv_myaddr, dur); + + return (mprot); +} + static void ieee80211_tx_mgt_timeout(void *arg) { Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Fri Mar 9 10:34:44 2018 (r330687) +++ head/sys/net80211/ieee80211_proto.h Fri Mar 9 11:33:56 2018 (r330688) @@ -140,6 +140,8 @@ struct mbuf *ieee80211_alloc_rts(struct ieee80211com * const uint8_t [IEEE80211_ADDR_LEN], uint16_t); struct mbuf *ieee80211_alloc_cts(struct ieee80211com *, const uint8_t [IEEE80211_ADDR_LEN], uint16_t); +struct mbuf *ieee80211_alloc_prot(struct ieee80211_node *, + const struct mbuf *, uint8_t, int); uint8_t *ieee80211_add_rates(uint8_t *, const struct ieee80211_rateset *); uint8_t *ieee80211_add_xrates(uint8_t *, const struct ieee80211_rateset *); From owner-svn-src-head@freebsd.org Fri Mar 9 12:16: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 2620EF48F05; Fri, 9 Mar 2018 12:16:56 +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 CD05674115; Fri, 9 Mar 2018 12:16:55 +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 C398B1F087; Fri, 9 Mar 2018 12:16:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w29CGtOL043666; Fri, 9 Mar 2018 12:16:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29CGtif043665; Fri, 9 Mar 2018 12:16:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803091216.w29CGtif043665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 9 Mar 2018 12:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330689 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 330689 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 12:16:56 -0000 Author: hselasky Date: Fri Mar 9 12:16:55 2018 New Revision: 330689 URL: https://svnweb.freebsd.org/changeset/base/330689 Log: Implement proper support for complete_all() in the LinuxKPI. When complete_all() is called there might be multiple waiters. The current implementation could only handle one waiter. Make sure the completion is sticky when complete_all() is called to be compatible with Linux. Found by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Mar 9 11:33:56 2018 (r330688) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Mar 9 12:16:55 2018 (r330689) @@ -1779,11 +1779,14 @@ linux_complete_common(struct completion *c, int all) int wakeup_swapper; sleepq_lock(c); - c->done++; - if (all) + if (all) { + c->done = UINT_MAX; wakeup_swapper = sleepq_broadcast(c, SLEEPQ_SLEEP, 0, 0); - else + } else { + if (c->done != UINT_MAX) + c->done++; wakeup_swapper = sleepq_signal(c, SLEEPQ_SLEEP, 0, 0); + } sleepq_release(c); if (wakeup_swapper) kick_proc0(); @@ -1825,7 +1828,8 @@ linux_wait_for_common(struct completion *c, int flags) } else sleepq_wait(c, 0); } - c->done--; + if (c->done != UINT_MAX) + c->done--; sleepq_release(c); intr: @@ -1878,7 +1882,8 @@ linux_wait_for_timeout_common(struct completion *c, in goto done; } } - c->done--; + if (c->done != UINT_MAX) + c->done--; sleepq_release(c); /* return how many jiffies are left */ @@ -1894,12 +1899,10 @@ linux_try_wait_for_completion(struct completion *c) { int isdone; - isdone = 1; sleepq_lock(c); - if (c->done) + isdone = (c->done != 0); + if (c->done != 0 && c->done != UINT_MAX) c->done--; - else - isdone = 0; sleepq_release(c); return (isdone); } @@ -1909,10 +1912,8 @@ linux_completion_done(struct completion *c) { int isdone; - isdone = 1; sleepq_lock(c); - if (c->done == 0) - isdone = 0; + isdone = (c->done != 0); sleepq_release(c); return (isdone); } From owner-svn-src-head@freebsd.org Fri Mar 9 14:16: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 D2735F2BAB2; Fri, 9 Mar 2018 14:16:33 +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 8630878A15; Fri, 9 Mar 2018 14:16:33 +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 80EE520314; Fri, 9 Mar 2018 14:16:33 +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 w29EGXdF005295; Fri, 9 Mar 2018 14:16:33 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29EGXDF005294; Fri, 9 Mar 2018 14:16:33 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803091416.w29EGXDF005294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 9 Mar 2018 14:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330690 - head/stand X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 330690 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:16:34 -0000 Author: kevans Date: Fri Mar 9 14:16:33 2018 New Revision: 330690 URL: https://svnweb.freebsd.org/changeset/base/330690 Log: stand: Fix copy-paste-o, unbreaks libi386 lualoader build The 32-bit version of liblua is, in fact, NOT libficl. =) Reported by: emaste Modified: head/stand/loader.mk Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Fri Mar 9 12:16:55 2018 (r330689) +++ head/stand/loader.mk Fri Mar 9 14:16:33 2018 (r330690) @@ -149,7 +149,7 @@ LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a LIBLUA= ${BOOTOBJ}/liblua/liblua.a .if ${MACHINE} == "i386" -LIBLUA32= ${LIBFICL} +LIBLUA32= ${LIBLUA} .else LIBLUA32= ${BOOTOBJ}/liblua32/liblua.a .endif From owner-svn-src-head@freebsd.org Fri Mar 9 14:27: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 E9C88F2C87B; Fri, 9 Mar 2018 14:27:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7915D79108; Fri, 9 Mar 2018 14:27:02 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x241.google.com with SMTP id v6so3714591iog.7; Fri, 09 Mar 2018 06:27:02 -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=xRN/2P36X4H8wKGPX58koS+k6eRNsAteVTboKweL49c=; b=HVo6phendWmD32eLQ1CFXZQ8+vbpt78PONFHglsfoYCmmFVdQdBbmnnKSsHgCL/41e fz61/mFcT3SmBYUdcFTD37Q3bbXpLOVOcVnzwFM/MTflM3XNM6YvGx4FSMdU9qtPskot ThL8RE1/4Opv7OCe5J92mio0rBcl4efHuc/O56KRZk8ATIGUO2zNMyUkKlO+9MonaUA/ PU17dQP3ka6ZyLlGVscVbKmo7dF8pJLG/le95kUSQv1f/VPdhqyxBXxqKaOVRZ9NVAqK Th207bRnqfJLmWp/AOJAxDh/WzyMOMVte7Tqk+9GxeoqRQ4WIfx6XNj+eFmZlBJ/WM9y fLmw== 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=xRN/2P36X4H8wKGPX58koS+k6eRNsAteVTboKweL49c=; b=lTMoTotUg7z23kHKviHl55J1qDgTr79gPmvhQbDNdprT53UITsJ4TGXUlg3O/FlVkF u1lsQT1fJ7lCilhZEzDFCLTHMkS1QuFbljFMw4zLQKzUcqU5aF4f2UUCYcwPaSnbiXW7 ZpmEgrwva0MdJ7gl7sCpXGIbXt+9uPlzhCRIpyY0xehGQrwp7jGdp/K90GSXjq8Mot+H eAd3k9s7lSdbGlvjcfDolJcturG80amxVZnbHvbt5+MZLpn7KlTr/FGrmRl3F9y4U2xV vvtqN9hsSiy01CC72nbpVbggwTvAGNaIMDikrdIffRhum1TlzjrJUC1rTS5zJ8dCUvpp biJw== X-Gm-Message-State: AElRT7GvMVHiJ29SZTIiMVDIBfQw0evUyovrkiWYtl+UmqYqk30ygN+8 vJuA2JibeYpElma/JLNXezRLwndi/L0CEalszt6Jlg== X-Google-Smtp-Source: AG47ELuR5+lBpceVO3kwYcO4VWiDpxSapnf1SLBfAxRupyPrcXtWnac3buNzqLL9pXjLHWWw4eqlAImtehsL7x05yHw= X-Received: by 10.107.134.95 with SMTP id i92mr35399438iod.210.1520605621683; Fri, 09 Mar 2018 06:27:01 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.163.13 with HTTP; Fri, 9 Mar 2018 06:26:40 -0800 (PST) In-Reply-To: References: <201801151837.w0FIb3R7098459@repo.freebsd.org> From: Ed Maste Date: Fri, 9 Mar 2018 09:26:40 -0500 X-Google-Sender-Auth: BzPNyiL6d6ZmFUfxcmOi0dPGV2Q Message-ID: Subject: Re: svn commit: r328011 - in head/sys/amd64/vmm: amd intel To: Kubilay Kocak Cc: FreeBSD Security Team , Tycho Nightingale , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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 Mar 2018 14:27:03 -0000 On 8 March 2018 at 21:57, Kubilay Kocak wrote: > On 9/03/2018 8:57 am, Ed Maste wrote: >> On 15 January 2018 at 13:37, Tycho Nightingale wrote: >>> Author: tychon >>> Date: Mon Jan 15 18:37:03 2018 >>> New Revision: 328011 >>> URL: https://svnweb.freebsd.org/changeset/base/328011 >>> >>> Log: >>> Provide some mitigation against CVE-2017-5715 by clearing registers >>> upon returning from the guest which aren't immediately clobbered by >>> the host. This eradicates any remaining guest contents limiting their >>> usefulness in an exploit gadget. >> >> Will you MFC this to stable/11? > > Mitigations and related MFC's and SA's, etc for vulnerabilities, are > presumably all being coordinated and handled by secteam, with associated > (explicit) messaging when fixes don't apply to particular > branches/versions, no? Embargoed patches to address specific security vulnerabilities are handled by secteam, and are committed to all branches simultaneously. For cases like this, where it's a mitigation or other improvement that is already committed to CURRENT, it's best if the domain expert / original committer handles the merge. That said, I'm happy to take care of the merge if desired. From owner-svn-src-head@freebsd.org Fri Mar 9 14:36: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 F0BF5F2D694; Fri, 9 Mar 2018 14:36:49 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DE0479A2E; Fri, 9 Mar 2018 14:36:49 +0000 (UTC) (envelope-from tychon@freebsd.org) Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id B8A77DC824; Fri, 9 Mar 2018 09:36:41 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=content-type :mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=sasl; bh= +RW4R4nYyphtbmEc9b3QO85NQB4=; b=uGK1E7TiD9EtoJyxe0EehHjDdYTjv1vi RJQKAisLJgLjP2nwAh+ahChNzvbX4B3Jj7+QekvhM7rK6YTJyoTQR28hp6rUN6fK 58oFkTaAJ5lU/830VOIXRgbDlmbu1IyigRiItAt7Ac2hQuJ8gOoQFnusM/9rkXEb OLm9KgeC3NY= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id AF847DC823; Fri, 9 Mar 2018 09:36:41 -0500 (EST) Received: from [10.0.1.195] (unknown [146.115.68.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 11BBCDC821; Fri, 9 Mar 2018 09:36:41 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r328011 - in head/sys/amd64/vmm: amd intel From: Tycho Nightingale In-Reply-To: Date: Fri, 9 Mar 2018 09:36:40 -0500 Cc: Kubilay Kocak , FreeBSD Security Team , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Transfer-Encoding: quoted-printable Message-Id: References: <201801151837.w0FIb3R7098459@repo.freebsd.org> To: Ed Maste X-Mailer: Apple Mail (2.3445.5.20) X-Pobox-Relay-ID: 482CC228-23A7-11E8-B669-44CE1968708C-09779102!pb-smtp1.pobox.com 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 Mar 2018 14:36:50 -0000 > On Mar 9, 2018, at 9:26 AM, Ed Maste wrote: >=20 > On 8 March 2018 at 21:57, Kubilay Kocak wrote: >> On 9/03/2018 8:57 am, Ed Maste wrote: >>> On 15 January 2018 at 13:37, Tycho Nightingale = wrote: >>>> Author: tychon >>>> Date: Mon Jan 15 18:37:03 2018 >>>> New Revision: 328011 >>>> URL: https://svnweb.freebsd.org/changeset/base/328011 >>>>=20 >>>> Log: >>>> Provide some mitigation against CVE-2017-5715 by clearing = registers >>>> upon returning from the guest which aren't immediately clobbered = by >>>> the host. This eradicates any remaining guest contents limiting = their >>>> usefulness in an exploit gadget. >>>=20 >>> Will you MFC this to stable/11? >>=20 >> Mitigations and related MFC's and SA's, etc for vulnerabilities, are >> presumably all being coordinated and handled by secteam, with = associated >> (explicit) messaging when fixes don't apply to particular >> branches/versions, no? >=20 > Embargoed patches to address specific security vulnerabilities are > handled by secteam, and are committed to all branches simultaneously. >=20 > For cases like this, where it's a mitigation or other improvement that > is already committed to CURRENT, it's best if the domain expert / > original committer handles the merge. That said, I'm happy to take > care of the merge if desired. No worries, I will merge this and r329162 too. Tycho From owner-svn-src-head@freebsd.org Fri Mar 9 15: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 0184AF31B65; Fri, 9 Mar 2018 15:30:21 +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 A5ED27C525; Fri, 9 Mar 2018 15:30:20 +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 9C0F020DFB; Fri, 9 Mar 2018 15:30:20 +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 w29FUKFe041286; Fri, 9 Mar 2018 15:30:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29FUKin041283; Fri, 9 Mar 2018 15:30:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803091530.w29FUKin041283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 9 Mar 2018 15:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330696 - in head/libexec/tftpd: . tests X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/libexec/tftpd: . tests X-SVN-Commit-Revision: 330696 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 15:30:21 -0000 Author: asomers Date: Fri Mar 9 15:30:20 2018 New Revision: 330696 URL: https://svnweb.freebsd.org/changeset/base/330696 Log: Add some functional tests for tftpd(8) tftpd(8) is difficult to test in isolation due to its relationship with inetd. Create a test program that mimics the behavior of tftp(1) and inetd(8) and verifies tftpd's response in several different scenarios. These test cases cover all of the basic TFTP protocol, but not the optional parts. PR: 157700 PR: 225996 PR: 226004 PR: 226005 MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D14310 Added: head/libexec/tftpd/tests/ head/libexec/tftpd/tests/Makefile (contents, props changed) head/libexec/tftpd/tests/functional.c (contents, props changed) Modified: head/libexec/tftpd/Makefile Modified: head/libexec/tftpd/Makefile ============================================================================== --- head/libexec/tftpd/Makefile Fri Mar 9 14:45:47 2018 (r330695) +++ head/libexec/tftpd/Makefile Fri Mar 9 15:30:20 2018 (r330696) @@ -14,4 +14,7 @@ CFLAGS+= -DLIBWRAP LIBADD= wrap .endif +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Added: head/libexec/tftpd/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/tftpd/tests/Makefile Fri Mar 9 15:30:20 2018 (r330696) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.include + +# Skip on GCC 4.2, because it lacks __COUNTER__ +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40300 +ATF_TESTS_C= functional +TEST_METADATA.functional+= timeout=15 +.endif + +LIBADD= util +WARNS?= 6 + +.include Added: head/libexec/tftpd/tests/functional.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/libexec/tftpd/tests/functional.c Fri Mar 9 15:30:20 2018 (r330696) @@ -0,0 +1,1006 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Alan Somers. All rights reserved. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include +#include + +static const uint16_t BASEPORT = 6969; +static const char pidfile[] = "tftpd.pid"; +static int protocol = PF_UNSPEC; +static int s = -1; /* tftp client socket */ +static struct sockaddr_storage addr; /* Destination address for the client */ +static bool s_flag = false; /* Pass -s to tftpd */ +static bool w_flag = false; /* Pass -w to tftpd */ + +/* Helper functions*/ +static void require_bufeq(const char *expected, ssize_t expected_len, + const char *actual, ssize_t len); + +/* + * Receive a response from tftpd + * @param hdr The reply's expected header, as a char array + * @param contents The reply's expected contents, as a char array + * @param contents_len Length of contents + */ +#define RECV(hdr, contents, contents_len) do { \ + char buffer[1024]; \ + struct sockaddr_storage from; \ + socklen_t fromlen = sizeof(from); \ + ssize_t r = recvfrom(s, buffer, sizeof(buffer), 0, \ + (struct sockaddr*)&from, &fromlen); \ + ATF_REQUIRE(r > 0); \ + require_bufeq((hdr), sizeof(hdr), buffer, \ + MIN(r, (ssize_t)sizeof(hdr))); \ + require_bufeq((const char*) (contents), (contents_len), \ + &buffer[sizeof(hdr)], r - sizeof(hdr)); \ + if (protocol == PF_INET) { \ + ((struct sockaddr_in*)&addr)->sin_port = \ + ((struct sockaddr_in*)&from)->sin_port; \ + } else { \ + ((struct sockaddr_in6*)&addr)->sin6_port = \ + ((struct sockaddr_in6*)&from)->sin6_port; \ + } \ +} while(0) + +static void +recv_ack(uint16_t blocknum) +{ + char hdr[] = {0, 4, blocknum >> 8, blocknum & 0xFF}; + RECV(hdr, NULL, 0); +} + +/* + * Receive a data packet from tftpd + * @param blocknum Expected block number to be received + * @param contents Pointer to expected contents + * @param contents_len Length of contents expected to receive + */ +static void +recv_data(uint16_t blocknum, const char* contents, size_t contents_len) +{ + char hdr[] = {0, 3, blocknum >> 8, blocknum & 0xFF}; + RECV(hdr, contents, contents_len); +} + +#define RECV_ERROR(code, msg) do { \ + char hdr[] = {0, 5, code >> 8, code & 0xFF}; \ + RECV(hdr, msg, sizeof(msg)); \ +} while (0) + +/* + * send a command to tftpd. + * @param cmd Command to send, as a char array + */ +static void +send_bytes(const void* cmd, ssize_t len) +{ + ssize_t r; + + r = sendto(s, cmd, len, 0, (struct sockaddr*)(&addr), addr.ss_len); + ATF_REQUIRE_EQ(r, len); +} + +static void +send_data(uint16_t blocknum, const char* contents, size_t contents_len) +{ + char buffer[1024]; + + buffer[0] = 0; /* DATA opcode high byte */ + buffer[1] = 3; /* DATA opcode low byte */ + buffer[2] = blocknum >> 8; + buffer[3] = blocknum & 0xFF; + memmove(&buffer[4], contents, contents_len); + send_bytes(buffer, 4 + contents_len); +} + +/* + * send a command to tftpd. + * @param cmd Command to send, as a const string + * (terminating NUL will be ignored) + */ +#define SEND_STR(cmd) ATF_REQUIRE_EQ( \ + sendto(s, (cmd), sizeof(cmd) - 1, 0, (struct sockaddr*)(&addr), \ + addr.ss_len), \ + sizeof(cmd) - 1) + +/* + * Acknowledge block blocknum + */ +static void +send_ack(uint16_t blocknum) +{ + char packet[] = { + 0, 4, /* ACK opcode in BE */ + blocknum >> 8, + blocknum & 0xFF + }; + + send_bytes(packet, sizeof(packet)); + +} + +/* + * send a read request to tftpd. + * @param filename filename as a string, absolute or relative + * @param mode either "octet" or "netascii" + */ +#define SEND_RRQ(filename, mode) SEND_STR("\0\001" filename "\0" mode "\0") + +/* + * send a write request to tftpd. + * @param filename filename as a string, absolute or relative + * @param mode either "octet" or "netascii" + */ +#define SEND_WRQ(filename, mode) SEND_STR("\0\002" filename "\0" mode "\0") + +/* Define a test case, for both IPv4 and IPv6 */ +#define TFTPD_TC_DEFINE(name, head, ...) \ +static void \ +name ## _body(void); \ +ATF_TC_WITH_CLEANUP(name ## _v4); \ +ATF_TC_HEAD(name ## _v4, tc) \ +{ \ + head \ +} \ +ATF_TC_BODY(name ## _v4, tc) \ +{ \ + __VA_ARGS__; \ + protocol = AF_INET; \ + s = setup(&addr, __COUNTER__); \ + name ## _body(); \ + close(s); \ +} \ +ATF_TC_CLEANUP(name ## _v4, tc) \ +{ \ + cleanup(); \ +} \ +ATF_TC_WITH_CLEANUP(name ## _v6); \ +ATF_TC_HEAD(name ## _v6, tc) \ +{ \ + head \ +} \ +ATF_TC_BODY(name ## _v6, tc) \ +{ \ + __VA_ARGS__; \ + protocol = AF_INET6; \ + s = setup(&addr, __COUNTER__); \ + name ## _body(); \ + close(s); \ +} \ +ATF_TC_CLEANUP(name ## _v6, tc) \ +{ \ + cleanup(); \ +} \ +static void \ +name ## _body(void) + +/* Add the IPv4 and IPv6 versions of a test case */ +#define TFTPD_TC_ADD(tp, name ) \ +do { \ + ATF_TP_ADD_TC(tp, name ## _v4); \ + ATF_TP_ADD_TC(tp, name ## _v6); \ +} while (0) + +/* Standard cleanup used by all testcases */ +static void +cleanup(void) +{ + int fd = -1; + char buffer[80] = {0}; + pid_t pid; + + fd = open(pidfile, O_RDONLY); + if (fd < 0) + return; + if (read(fd, buffer, sizeof(buffer)) > 0) { + sscanf(buffer, "%d", &pid); + kill(pid, SIGTERM); + waitpid(pid, NULL, 0); + } + close(fd); + unlink(pidfile); +} + +/* Assert that two binary buffers are identical */ +static void +require_bufeq(const char *expected, ssize_t expected_len, const char *actual, + ssize_t len) +{ + ssize_t i; + + ATF_REQUIRE_EQ_MSG(expected_len, len, + "Expected %ld bytes but got %ld", expected_len, len); + for (i = 0; i < len; i++) { + ATF_REQUIRE_EQ_MSG(actual[i], expected[i], + "Expected %#hhx at position %ld; got %hhx instead", + expected[i], i, actual[i]); + } +} + +/* + * Start tftpd and return its communicating socket + * @param to Will be filled in for use with sendto + * @param idx Unique identifier of the test case + * @return Socket ready to use + */ +static int +setup(struct sockaddr_storage *to, uint16_t idx) +{ + int client_s, server_s, pid, argv_idx; + char execname[] = "/usr/libexec/tftpd"; + char s_flag_str[] = "-s"; + char w_flag_str[] = "-w"; + char pwd[MAXPATHLEN]; + char *argv[10]; + struct sockaddr_in addr4; + struct sockaddr_in6 addr6; + struct sockaddr *server_addr; + struct pidfh *pfh; + uint16_t port = BASEPORT + idx; + socklen_t len; + + if (protocol == PF_INET) { + len = sizeof(addr4); + bzero(&addr4, len); + addr4.sin_len = len; + addr4.sin_family = PF_INET; + addr4.sin_port = htons(port); + server_addr = (struct sockaddr*)&addr4; + } else { + len = sizeof(addr6); + bzero(&addr6, len); + addr6.sin6_len = len; + addr6.sin6_family = PF_INET6; + addr6.sin6_port = htons(port); + server_addr = (struct sockaddr*)&addr6; + } + + ATF_REQUIRE_EQ(getcwd(pwd, sizeof(pwd)), pwd); + + /* Must bind(2) pre-fork so it happens before the client's send(2) */ + ATF_REQUIRE((server_s = socket(protocol, SOCK_DGRAM, 0)) > 0); + ATF_REQUIRE_EQ_MSG(bind(server_s, server_addr, len), 0, + "bind failed with error %s", strerror(errno)); + + pid = fork(); + switch (pid) { + case -1: + atf_tc_fail("fork failed"); + break; + case 0: + /* In child */ + pfh = pidfile_open(pidfile, 0644, NULL); + ATF_REQUIRE_MSG(pfh != NULL, + "pidfile_open: %s", strerror(errno)); + ATF_REQUIRE_EQ(pidfile_write(pfh), 0); + ATF_REQUIRE_EQ(pidfile_close(pfh), 0); + + bzero(argv, sizeof(argv)); + argv[0] = execname; + argv_idx = 1; + if (w_flag) + argv[argv_idx++] = w_flag_str; + if (s_flag) + argv[argv_idx++] = s_flag_str; + argv[argv_idx++] = pwd; + ATF_REQUIRE_EQ(dup2(server_s, STDOUT_FILENO), STDOUT_FILENO); + ATF_REQUIRE_EQ(dup2(server_s, STDIN_FILENO), STDIN_FILENO); + ATF_REQUIRE_EQ(dup2(server_s, STDERR_FILENO), STDERR_FILENO); + execv(execname, argv); + atf_tc_fail("exec failed"); + break; + default: + /* In parent */ + bzero(to, sizeof(*to)); + if (protocol == PF_INET) { + struct sockaddr_in *to4 = (struct sockaddr_in*)to; + to4->sin_len = sizeof(*to4); + to4->sin_family = PF_INET; + to4->sin_port = htons(port); + to4->sin_addr.s_addr = htonl(INADDR_LOOPBACK); + } else { + struct in6_addr loopback = IN6ADDR_LOOPBACK_INIT; + struct sockaddr_in6 *to6 = (struct sockaddr_in6*)to; + to6->sin6_len = sizeof(*to6); + to6->sin6_family = PF_INET6; + to6->sin6_port = htons(port); + to6->sin6_addr = loopback; + } + + close(server_s); + ATF_REQUIRE((client_s = socket(protocol, SOCK_DGRAM, 0)) > 0); + break; + } + return (client_s); +} + +/* Like write(2), but never returns less than the requested length */ +static void +write_all(int fd, const void *buf, size_t nbytes) +{ + ssize_t r; + + while (nbytes > 0) { + r = write(fd, buf, nbytes); + ATF_REQUIRE(r > 0); + nbytes -= r; + buf = (const char*)buf + r; + } +} + + +/* + * Test Cases + */ + +/* + * Read a file, specified by absolute pathname. + */ +TFTPD_TC_DEFINE(abspath,) +{ + int fd; + char command[1024]; + size_t pathlen; + char suffix[] = {'\0', 'o', 'c', 't', 'e', 't', '\0'}; + + command[0] = 0; /* RRQ high byte */ + command[1] = 1; /* RRQ low byte */ + ATF_REQUIRE(getcwd(&command[2], sizeof(command) - 2) != NULL); + pathlen = strlcat(&command[2], "/abspath.txt", sizeof(command) - 2); + ATF_REQUIRE(pathlen + sizeof(suffix) < sizeof(command) - 2); + memmove(&command[2 + pathlen], suffix, sizeof(suffix)); + + fd = open("abspath.txt", O_CREAT | O_RDONLY, 0644); + ATF_REQUIRE(fd >= 0); + close(fd); + + send_bytes(command, 2 + pathlen + sizeof(suffix)); + recv_data(1, NULL, 0); + send_ack(1); +} + +/* + * Attempt to read a file outside of the allowed directory(ies) + */ +TFTPD_TC_DEFINE(dotdot,) +{ + ATF_REQUIRE_EQ(mkdir("subdir", 0777), 0); + SEND_RRQ("../disallowed.txt", "octet"); + RECV_ERROR(2, "Access violation"); + s = setup(&addr, __COUNTER__); \ + SEND_RRQ("subdir/../../disallowed.txt", "octet"); + RECV_ERROR(2, "Access violation"); + s = setup(&addr, __COUNTER__); \ + SEND_RRQ("/etc/passwd", "octet"); + RECV_ERROR(2, "Access violation"); +} + +/* + * With "-s", tftpd should chroot to the specified directory + */ +TFTPD_TC_DEFINE(s_flag, atf_tc_set_md_var(tc, "require.user", "root");, + s_flag = true) +{ + int fd; + char contents[] = "small"; + + fd = open("small.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + write_all(fd, contents, strlen(contents) + 1); + close(fd); + + SEND_RRQ("/small.txt", "octet"); + recv_data(1, contents, strlen(contents) + 1); + send_ack(1); +} + +/* + * Read a file, and simulate a dropped ACK packet + */ +TFTPD_TC_DEFINE(rrq_dropped_ack,) +{ + int fd; + char contents[] = "small"; + + fd = open("small.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + write_all(fd, contents, strlen(contents) + 1); + close(fd); + + SEND_RRQ("small.txt", "octet"); + recv_data(1, contents, strlen(contents) + 1); + /* + * client "sends" the ack, but network drops it + * Eventually, tftpd should resend the data packet + */ + recv_data(1, contents, strlen(contents) + 1); + send_ack(1); +} + +/* + * Read a file, and simulate a dropped DATA packet + */ +TFTPD_TC_DEFINE(rrq_dropped_data,) +{ + int fd; + size_t i; + uint32_t contents[192]; + char buffer[1024]; + + for (i = 0; i < nitems(contents); i++) + contents[i] = i; + + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + write_all(fd, contents, sizeof(contents)); + close(fd); + + SEND_RRQ("medium.txt", "octet"); + recv_data(1, (const char*)&contents[0], 512); + send_ack(1); + (void) recvfrom(s, buffer, sizeof(buffer), 0, NULL, NULL); + /* + * server "sends" the data, but network drops it + * Eventually, client should resend the last ACK + */ + send_ack(1); + recv_data(2, (const char*)&contents[128], 256); + send_ack(2); +} + +/* + * Read a medium file, and simulate a duplicated ACK packet + */ +TFTPD_TC_DEFINE(rrq_duped_ack,) +{ + int fd; + size_t i; + uint32_t contents[192]; + + for (i = 0; i < nitems(contents); i++) + contents[i] = i; + + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + write_all(fd, contents, sizeof(contents)); + close(fd); + + SEND_RRQ("medium.txt", "octet"); + recv_data(1, (const char*)&contents[0], 512); + send_ack(1); + send_ack(1); /* Dupe an ACK packet */ + recv_data(2, (const char*)&contents[128], 256); + recv_data(2, (const char*)&contents[128], 256); + send_ack(2); +} + + +/* + * Attempt to read a file without read permissions + */ +TFTPD_TC_DEFINE(rrq_eaccess,) +{ + int fd; + + fd = open("empty.txt", O_CREAT | O_RDONLY, 0000); + ATF_REQUIRE(fd >= 0); + close(fd); + + SEND_RRQ("empty.txt", "octet"); + RECV_ERROR(2, "Access violation"); +} + +/* + * Read an empty file + */ +TFTPD_TC_DEFINE(rrq_empty,) +{ + int fd; + + fd = open("empty.txt", O_CREAT | O_RDONLY, 0644); + ATF_REQUIRE(fd >= 0); + close(fd); + + SEND_RRQ("empty.txt", "octet"); + recv_data(1, NULL, 0); + send_ack(1); +} + +/* + * Read a medium file of more than one block + */ +TFTPD_TC_DEFINE(rrq_medium,) +{ + int fd; + size_t i; + uint32_t contents[192]; + + for (i = 0; i < nitems(contents); i++) + contents[i] = i; + + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + write_all(fd, contents, sizeof(contents)); + close(fd); + + SEND_RRQ("medium.txt", "octet"); + recv_data(1, (const char*)&contents[0], 512); + send_ack(1); + recv_data(2, (const char*)&contents[128], 256); + send_ack(2); +} + +/* + * Read a file in netascii format + */ +TFTPD_TC_DEFINE(rrq_netascii,) +{ + int fd; + char contents[] = "foo\nbar\rbaz\n"; + /* + * Weirdly, RFC-764 says that CR must be followed by NUL if a line feed + * is not intended + */ + char expected[] = "foo\r\nbar\r\0baz\r\n"; + + fd = open("unix.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + write_all(fd, contents, strlen(contents) + 1); + close(fd); + + SEND_RRQ("unix.txt", "netascii"); + recv_data(1, expected, sizeof(expected)); + send_ack(1); +} + +/* + * Read a file that doesn't exist + */ +TFTPD_TC_DEFINE(rrq_nonexistent,) +{ + SEND_RRQ("nonexistent.txt", "octet"); + RECV_ERROR(1, "File not found"); +} + +/* + * Attempt to read a file whose name exceeds PATH_MAX + */ +TFTPD_TC_DEFINE(rrq_path_max,) +{ +#define AReallyBigFileName \ + "AReallyBigFileNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ + ".txt" + ATF_REQUIRE_MSG(strlen(AReallyBigFileName) > PATH_MAX, + "Somebody increased PATH_MAX. Update the test"); + SEND_RRQ(AReallyBigFileName, "octet"); + RECV_ERROR(4, "Illegal TFTP operation"); +} + +/* + * Read a small file of less than one block + */ +TFTPD_TC_DEFINE(rrq_small,) +{ + int fd; + char contents[] = "small"; + + fd = open("small.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + write_all(fd, contents, strlen(contents) + 1); + close(fd); + + SEND_RRQ("small.txt", "octet"); + recv_data(1, contents, strlen(contents) + 1); + send_ack(1); +} + +/* + * Try to transfer a file with an unknown mode. + */ +TFTPD_TC_DEFINE(unknown_modes,) +{ + SEND_RRQ("foo.txt", "ascii"); /* Misspelling of "ascii" */ + RECV_ERROR(4, "Illegal TFTP operation"); + s = setup(&addr, __COUNTER__); \ + SEND_RRQ("foo.txt", "binary"); /* Obsolete. Use "octet" instead */ + RECV_ERROR(4, "Illegal TFTP operation"); + s = setup(&addr, __COUNTER__); \ + SEND_RRQ("foo.txt", "en_US.UTF-8"); + RECV_ERROR(4, "Illegal TFTP operation"); + s = setup(&addr, __COUNTER__); \ + SEND_RRQ("foo.txt", "mail"); /* Obsolete in RFC-1350 */ + RECV_ERROR(4, "Illegal TFTP operation"); +} + +/* + * Send an unknown opcode. tftpd should respond with the appropriate error + */ +TFTPD_TC_DEFINE(unknown_opcode,) +{ + /* Looks like an RRQ or WRQ request, but with a bad opcode */ + SEND_STR("\0\007foo.txt\0octet\0"); + atf_tc_expect_timeout("PR 226005 tftpd ignores bad opcodes but doesn't reject them"); + RECV_ERROR(4, "Illegal TFTP operation"); +} + +/* + * Invoke tftpd with "-w" and write to a nonexistent file. + */ +TFTPD_TC_DEFINE(w_flag,, w_flag = 1;) +{ + int fd; + ssize_t r; + char contents[] = "small"; + char buffer[1024]; + size_t contents_len; + + contents_len = strlen(contents) + 1; + SEND_WRQ("small.txt", "octet"); + recv_ack(0); + send_data(1, contents, contents_len); + recv_ack(1); + + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); + fd = open("small.txt", O_RDONLY); + r = read(fd, buffer, sizeof(buffer)); + close(fd); + require_bufeq(contents, contents_len, buffer, r); +} + +/* + * Write a medium file, and simulate a dropped ACK packet + */ +TFTPD_TC_DEFINE(wrq_dropped_ack,) +{ + int fd; + size_t i; + ssize_t r; + uint32_t contents[192]; + char buffer[1024]; + + for (i = 0; i < nitems(contents); i++) + contents[i] = i; + + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + close(fd); + + SEND_WRQ("medium.txt", "octet"); + recv_ack(0); + send_data(1, (const char*)&contents[0], 512); + /* + * Servers "sends" an ACK packet, but network drops it. + * Eventually, server should resend the last ACK + */ + (void) recvfrom(s, buffer, sizeof(buffer), 0, NULL, NULL); + recv_ack(1); + send_data(2, (const char*)&contents[128], 256); + recv_ack(2); + + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); + fd = open("medium.txt", O_RDONLY); + r = read(fd, buffer, sizeof(buffer)); + close(fd); + require_bufeq((const char*)contents, 768, buffer, r); +} + +/* + * Write a small file, and simulate a dropped DATA packet + */ +TFTPD_TC_DEFINE(wrq_dropped_data,) +{ + int fd; + ssize_t r; + char contents[] = "small"; + size_t contents_len; + char buffer[1024]; + + fd = open("small.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + close(fd); + contents_len = strlen(contents) + 1; + + SEND_WRQ("small.txt", "octet"); + recv_ack(0); + /* + * Client "sends" a DATA packet, but network drops it. + * Eventually, server should resend the last ACK + */ + recv_ack(0); + send_data(1, contents, contents_len); + recv_ack(1); + + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); + fd = open("small.txt", O_RDONLY); + r = read(fd, buffer, sizeof(buffer)); + close(fd); + require_bufeq(contents, contents_len, buffer, r); +} + +/* + * Write a medium file, and simulate a duplicated DATA packet + */ +TFTPD_TC_DEFINE(wrq_duped_data,) +{ + int fd; + size_t i; + ssize_t r; + uint32_t contents[192]; + char buffer[1024]; + + for (i = 0; i < nitems(contents); i++) + contents[i] = i; + + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); + ATF_REQUIRE(fd >= 0); + close(fd); + + SEND_WRQ("medium.txt", "octet"); + recv_ack(0); + send_data(1, (const char*)&contents[0], 512); + send_data(1, (const char*)&contents[0], 512); + recv_ack(1); + recv_ack(1); + send_data(2, (const char*)&contents[128], 256); + recv_ack(2); + + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); + fd = open("medium.txt", O_RDONLY); + r = read(fd, buffer, sizeof(buffer)); + close(fd); + require_bufeq((const char*)contents, 768, buffer, r); +} + +/* + * Attempt to write a file without write permissions + */ +TFTPD_TC_DEFINE(wrq_eaccess,) +{ + int fd; + + fd = open("empty.txt", O_CREAT | O_RDONLY, 0440); + ATF_REQUIRE(fd >= 0); + close(fd); + + SEND_WRQ("empty.txt", "octet"); + atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access " + "violation"); + RECV_ERROR(2, "Access violation"); +} + +/* + * Attempt to write a file without world write permissions, but with world + * read permissions + */ +TFTPD_TC_DEFINE(wrq_eaccess_world_readable,) +{ + int fd; + + fd = open("empty.txt", O_CREAT | O_RDONLY, 0444); + ATF_REQUIRE(fd >= 0); + close(fd); + + SEND_WRQ("empty.txt", "octet"); + atf_tc_expect_fail("PR 226004 with relative pathnames, tftpd doesn't validate world writability"); + RECV_ERROR(2, "Access violation"); +} + + +/* + * Write a medium file of more than one block + */ +TFTPD_TC_DEFINE(wrq_medium,) +{ + int fd; + size_t i; + ssize_t r; + uint32_t contents[192]; + char buffer[1024]; + + for (i = 0; i < nitems(contents); i++) + contents[i] = i; + + fd = open("medium.txt", O_RDWR | O_CREAT, 0666); + ATF_REQUIRE(fd >= 0); + close(fd); + + SEND_WRQ("medium.txt", "octet"); + recv_ack(0); + send_data(1, (const char*)&contents[0], 512); + recv_ack(1); + send_data(2, (const char*)&contents[128], 256); + recv_ack(2); + + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); + fd = open("medium.txt", O_RDONLY); + r = read(fd, buffer, sizeof(buffer)); + close(fd); + require_bufeq((const char*)contents, 768, buffer, r); +} + +/* + * Write a file in netascii format + */ +TFTPD_TC_DEFINE(wrq_netascii,) +{ + int fd; + ssize_t r; + /* + * Weirdly, RFC-764 says that CR must be followed by NUL if a line feed + * is not intended + */ + char contents[] = "foo\r\nbar\r\0baz\r\n"; + char expected[] = "foo\nbar\rbaz\n"; + size_t contents_len; + char buffer[1024]; + + fd = open("unix.txt", O_RDWR | O_CREAT, 0666); + ATF_REQUIRE(fd >= 0); + close(fd); + contents_len = strlen(contents) + 1; + + SEND_WRQ("unix.txt", "netascii"); + recv_ack(0); + send_data(1, contents, contents_len); + recv_ack(1); + + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); + fd = open("unix.txt", O_RDONLY); + r = read(fd, buffer, sizeof(buffer)); + close(fd); + require_bufeq(expected, sizeof(expected), buffer, r); +} + +/* + * Attempt to write to a nonexistent file. With the default options, this + * isn't allowed. + */ +TFTPD_TC_DEFINE(wrq_nonexistent,) +{ + SEND_WRQ("nonexistent.txt", "octet"); + atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access " + "violation"); + RECV_ERROR(1, "File not found"); +} + +/* + * Write a small file of less than one block + */ +TFTPD_TC_DEFINE(wrq_small,) +{ + int fd; + ssize_t r; + char contents[] = "small"; + size_t contents_len; + char buffer[1024]; + + fd = open("small.txt", O_RDWR | O_CREAT, 0666); + ATF_REQUIRE(fd >= 0); + close(fd); + contents_len = strlen(contents) + 1; + + SEND_WRQ("small.txt", "octet"); + recv_ack(0); + send_data(1, contents, contents_len); + recv_ack(1); + + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); + fd = open("small.txt", O_RDONLY); + r = read(fd, buffer, sizeof(buffer)); + close(fd); + require_bufeq(contents, contents_len, buffer, r); +} + +/* + * Write an empty file over a non-empty one + */ +TFTPD_TC_DEFINE(wrq_truncate,) +{ + int fd; + char contents[] = "small"; + struct stat sb; + + fd = open("small.txt", O_RDWR | O_CREAT, 0666); + ATF_REQUIRE(fd >= 0); + write_all(fd, contents, strlen(contents) + 1); + close(fd); + + SEND_WRQ("small.txt", "octet"); + recv_ack(0); + send_data(1, NULL, 0); + recv_ack(1); + + ATF_REQUIRE_EQ(stat("small.txt", &sb), 0); + ATF_REQUIRE_EQ(sb.st_size, 0); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Mar 9 15:52: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 58DDDF33861; Fri, 9 Mar 2018 15:52: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 4B65F7D5F9; Fri, 9 Mar 2018 15:52:12 +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 w29FqAc3065078; Fri, 9 Mar 2018 07:52:10 -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 w29FqAWo065077; Fri, 9 Mar 2018 07:52:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803091552.w29FqAWo065077@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r330696 - in head/libexec/tftpd: . tests In-Reply-To: <201803091530.w29FUKin041283@repo.freebsd.org> To: Alan Somers Date: Fri, 9 Mar 2018 07:52:10 -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 Mar 2018 15:52:13 -0000 > Author: asomers > Date: Fri Mar 9 15:30:20 2018 > New Revision: 330696 > URL: https://svnweb.freebsd.org/changeset/base/330696 > > Log: > Add some functional tests for tftpd(8) > > tftpd(8) is difficult to test in isolation due to its relationship with > inetd. Create a test program that mimics the behavior of tftp(1) and > inetd(8) and verifies tftpd's response in several different scenarios. At one time I thought it was possible to run all of the external "inetd" daemons as standalone daemons without inetd involved. I do not recall if tftpd was included in that, but believe it was. I am sure that telnetd and ftpd would run standalone. Have we lost some useful functionality here that maybe we want back? > These test cases cover all of the basic TFTP protocol, but not the optional > parts. > > PR: 157700 > PR: 225996 > PR: 226004 > PR: 226005 > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D14310 ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Mar 9 15:55: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 00B8FF33C7C; Fri, 9 Mar 2018 15:55:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FFA67D966; Fri, 9 Mar 2018 15:55:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x236.google.com with SMTP id q69-v6so13807447lfi.10; Fri, 09 Mar 2018 07:55:34 -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=cz06ZBHFuhUWZOubHXeM6cq/Qb/vM7yBLT0zWCpbT0Y=; b=f+5diI7klxd5do8Q5gNdnDqyFzH/uOIUk9Uvi6Yg8aywoahsoi8MRRTkhkWdVVyJIb uqI2D5ZM49pPHye20p+biXtzgAWkSg1FsUrUMWKpllENujF40KIiOGeZX6vH4a190cwn Db6DB7Dpc2LMXL+kOKMQ8nyfYRx0GSn+k+GWFmty7kvZFoFXgjIfQjPORzVEoSuZSnky mZG8PdapHtGBGWebG6GJEPcuATu/PWI/20On2qdzg4e60pj+uTAx1/azoHkDDPcbNPo4 qBQBYfWHubhSwyIUNpX1xEmu3Dk1qC9zd4IrfXi8DrgqTTDxXA/BT0aSZwXOgGLoQFuu 9wtw== 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=cz06ZBHFuhUWZOubHXeM6cq/Qb/vM7yBLT0zWCpbT0Y=; b=teLKdCjtFRPQSir+IFMvCRHIseHk35T0IQTySbLLgsBLfPeSvLUxASjas5TPEt0Yvi AYSR7BbOWI3vsd4JlaqMJJzzyNAsSvfy8F9PbsO334dJKt7SD+q6/AOwZ8CV+O0+YRvJ xA+A9j2Oz3A+chOk0TO/MFz3tcVmpYrmRwnPVeHwqVZyvs7bH7TMiGSCR4Ma8SNlZTAq +n7KBuhdQWBcGs6f2IIFFCuMbjv/lf9FsWL0NF0d/jImoWD0i56q4zOmdmwFdYJf/dDE Hr95CkBxEMB4RfjoaKAT2febSbCkq02Nl5dZzjkYxjERJ2jWlRNZBTF7DeFJ5NmqJZK0 e6Dg== X-Gm-Message-State: AElRT7GoSxZU30wT3wsEoolvK1zsAzu1kUvQTQy+BoJ1CHEe4WUUzcOa o5Cn98kM85rFD5Wpk7ocBNc+f+HdDbrB7zbrRZA= X-Google-Smtp-Source: AG47ELuLDcs4b73s+RoE4rmMnsxve4dqpLprGWIiz6m3e+3tWKHGAp4MFw5nFxB/Z+r3wmEF2RmUTApDb9yPI/eDoGg= X-Received: by 10.46.50.16 with SMTP id y16mr20431053ljy.53.1520610932308; Fri, 09 Mar 2018 07:55:32 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Fri, 9 Mar 2018 07:55:31 -0800 (PST) In-Reply-To: <201803091552.w29FqAWo065077@pdx.rh.CN85.dnsmgr.net> References: <201803091530.w29FUKin041283@repo.freebsd.org> <201803091552.w29FqAWo065077@pdx.rh.CN85.dnsmgr.net> From: Alan Somers Date: Fri, 9 Mar 2018 08:55:31 -0700 X-Google-Sender-Auth: I7wCurvgUT6brxz9TY9jBGe754A Message-ID: Subject: Re: svn commit: r330696 - in head/libexec/tftpd: . tests To: rgrimes@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.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 Mar 2018 15:55:35 -0000 On Fri, Mar 9, 2018 at 8:52 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: asomers > > Date: Fri Mar 9 15:30:20 2018 > > New Revision: 330696 > > URL: https://svnweb.freebsd.org/changeset/base/330696 > > > > Log: > > Add some functional tests for tftpd(8) > > > > tftpd(8) is difficult to test in isolation due to its relationship with > > inetd. Create a test program that mimics the behavior of tftp(1) and > > inetd(8) and verifies tftpd's response in several different scenarios. > > At one time I thought it was possible to run all of the external "inetd" > daemons as standalone daemons without inetd involved. > I do not recall if tftpd was included in that, but believe it was. > I am sure that telnetd and ftpd would run standalone. > > Have we lost some useful functionality here that maybe we want back? > Some daemons support that, but others don't. It's not in common code. sprayd and ftpd can do it. It looks like telnetd cannot. I'm not sure which others can. -Alan From owner-svn-src-head@freebsd.org Fri Mar 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 A2283F3503F; Fri, 9 Mar 2018 16:08:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 346D27E545; Fri, 9 Mar 2018 16:08:58 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id m22so4037353iob.12; Fri, 09 Mar 2018 08:08:58 -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:in-reply-to:user-agent; bh=umXhokMmeKfDlqke/5OKJzh39Kh77z6WEIGwUWY6+AU=; b=VHq7CWT7at7A1BrPEvWnSqYt/UsKdJtT5W/eBtxKZQrtQUE4T4wkLuKNNThA6bx2of grGECIbpb9BwqrpurgOC10JDcjAzmn1EM18UyDcW8b3hQn/6txfRAd+59oLqweY1Cng0 8fkWt3+6Hjb+rqz/y8z3xQmDtqlW8oy94rAkawFJ0aRFcxmy6YWtoh2JJ3/nzP2gdqPQ MjQkMh+ZrLlKaR6MboPGcGSEHxSpH+85h9HnvTnbiQ8r8bLHC8DPcw+g2pOZo3edK1GS TOZfeZZp5+onAbmL+phv4rD+oxyNW2o7mo+rupfFvm3X+A/+hY1qxMOTGS9vJHFkgpgz uppA== 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:in-reply-to:user-agent; bh=umXhokMmeKfDlqke/5OKJzh39Kh77z6WEIGwUWY6+AU=; b=mLeN+CQRDeR7ujKJCi6ItD1EfA0W3brcUlR9INK2HO1XDDyuJHL9g/8lVIJprpOa0n tiZf4ku3QtU3LP0q8byWn/56ErnQvLXskOnU6EbnAcu97OR1Z44h5GPl6ejwRh2gd6vz psbcPJAjG9zNHN6h/W8+azyYATQuStQtiMmIoQfrRJCMMHktYL/2Hp4Ddzlf0iN9LYks OP3AygUS1Wd/o+7ANKblkEtR72zf7WgmtM/43EFEl+Hp3MGpeu8NqSGUv+VT4fMPthPj 6WCxT1/Za5cQEoPBb1Rn0U6N2uBDxQuOoVavCmN9MrhaNmeoqi5c4Wy8e3CO49tG7NWf AZkg== X-Gm-Message-State: AElRT7E5ikeUWWBVUvPe1yxRf74s3RqUSlUEJQMkx6E2UrzALp6v7lIY YlamHgVyUb1F9+9Q5d9Tbbk= X-Google-Smtp-Source: AG47ELvJ0K1eB1cCpJzfnL8JnL+/dnJjG+SPzmGBGSyOqPwH+nJXK3usSyFGgAU8VBL769dgkfasFQ== X-Received: by 10.107.21.3 with SMTP id 3mr36025625iov.148.1520611737511; Fri, 09 Mar 2018 08:08:57 -0800 (PST) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id b99sm1066544ioj.82.2018.03.09.08.08.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 08:08:56 -0800 (PST) Sender: Mark Johnston Date: Fri, 9 Mar 2018 11:08:54 -0500 From: Mark Johnston To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330663 - head/sys/kern Message-ID: <20180309160854.GC6174@raichu> References: <201803081704.w28H4aQx052056@repo.freebsd.org> <20180309150402.X950@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180309150402.X950@besplex.bde.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: Fri, 09 Mar 2018 16:08:58 -0000 On Fri, Mar 09, 2018 at 03:42:05PM +1100, Bruce Evans wrote: > On Thu, 8 Mar 2018, Mark Johnston wrote: > > > Log: > > Return E2BIG if we run out of space writing a compressed kernel dump. > > E2BIG a very wrong errno. It means "Argment list too long". It is broken > as designed, with "too" encrypted as "2" and no indication of what is too > big. EFBIG is not so wrong. It means "File too large". There is explicit handling for E2BIG most of the (mini)dumpsys() implementations, which is why I chose it. In particular, amd64's minidumpsys() retries the dump upon receiving ENOSPC from the MI code, but E2BIG simply causes the dump to fail: 443 else if (error == E2BIG) 444 printf("Dump failed. Partition too small.\n"); > > ENOSPC causes the MD kernel dump code to retry the dump, but this is > > undesirable in the case where we legitimately ran out of space. > > ENOSPC is the correct errno. It means "[really] No space left on device". > The bug was either retrying or possibly abusing ENOSPC instead of EAGAIN > to mean "transiently out of space for something". When writing an uncompressed dump, the starting offset is chosen so that the end of the dump lines up with the end of the dump device. If we attempt to write past the end of the dump, the presumption is that something caused pages to be added to the dump map during the dump, and we should retry with a different starting offset. EAGAIN seems like a reasonable error number for this case, but it's somewhat unsatisfying since these checks were originally meant to stop programming errors from scribbling over a filesystem. I wonder if the retry logic in amd64's minidumpsys() is really useful at all. It was added in r215133 and copied to arm64, but isn't present in any other MD dump code. I've never seen a kernel dump succeed after a retry; for instance, the problem addressed in r329521 simply caused us to retry a number of times before giving up. The description for Differential D8254 also suggests that the retry logic is of questionable value. From owner-svn-src-head@freebsd.org Fri Mar 9 17:44: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 9AB9AF3D0E3 for ; Fri, 9 Mar 2018 17:44:20 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 180D283301 for ; Fri, 9 Mar 2018 17:44:19 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 5d329c00-23c1-11e8-b951-f99fef315fd9 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 outbound2.ore.mailhop.org (Halon) with ESMTPSA id 5d329c00-23c1-11e8-b951-f99fef315fd9; Fri, 09 Mar 2018 17:43:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w29HiBC8008208; Fri, 9 Mar 2018 10:44:11 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520617451.84937.21.camel@freebsd.org> Subject: Re: svn commit: r330663 - head/sys/kern From: Ian Lepore To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 09 Mar 2018 10:44:11 -0700 In-Reply-To: <20180309194900.F2122@besplex.bde.org> References: <201803081704.w28H4aQx052056@repo.freebsd.org> <20180309150402.X950@besplex.bde.org> <20180309194900.F2122@besplex.bde.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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 Mar 2018 17:44:20 -0000 On Fri, 2018-03-09 at 20:50 +1100, Bruce Evans wrote: > style(9) does require this. This is hard to see since the style > guide > has been mangled by converting it into a man page, with markup in non > C-code and lots of blank lines to separate the markup. See > /usr/src/admin/style/style in 4.4BSD or /usr/src/share/misc/style in > NetBSD for non-mangled versions. These are pure C code which give > many rules implicitly by example. All versions give 2 or 3 rules for > leaving a blank line between groups of header files. These rules are > somewhat needed since leaving blank lines is so unusual. I feel pretty certain that freebsd code does not have to conform to the style document in 4.4BSD, so I intend to waste absolutely none of my life reading it. If you feel that the 4.4BSD rules about blank lines need to be part of freebsd's style(9), then submit patches to make it so, and we'll run it through the voting process like we do other style changes. -- Ian From owner-svn-src-head@freebsd.org Fri Mar 9 17:54: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 0059FF3DE06; Fri, 9 Mar 2018 17:54:14 +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 86DA683CBC; Fri, 9 Mar 2018 17:54:14 +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 7B889225C1; Fri, 9 Mar 2018 17:54:14 +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 w29HsEVw017606; Fri, 9 Mar 2018 17:54:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29HsE7Q017605; Fri, 9 Mar 2018 17:54:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803091754.w29HsE7Q017605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Mar 2018 17:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330699 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 330699 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 17:54:15 -0000 Author: imp Date: Fri Mar 9 17:54:14 2018 New Revision: 330699 URL: https://svnweb.freebsd.org/changeset/base/330699 Log: Remove K&R stuff: never use it in new code. Remove how to format K&R stuff. The project hasn't been using it in new code for a long time. It's so obsolete, we don't need a statement to never use it. Add a statement requesting that comments about parameters be preserved when converting to ASNI style, per Kirk. Differential Revision: https://reviews.freebsd.org/D14051 Modified: head/share/man/man9/style.9 Modified: head/share/man/man9/style.9 ============================================================================== --- head/share/man/man9/style.9 Fri Mar 9 16:35:49 2018 (r330698) +++ head/share/man/man9/style.9 Fri Mar 9 17:54:14 2018 (r330699) @@ -763,17 +763,9 @@ do not roll your own. } .Ed .Pp -Old-style function declarations look like this: -.Bd -literal -static char * -function(a1, a2, fl, a4) - int a1, a2; /* Declare ints, too, do not default them. */ - float fl; /* Beware double vs. float prototype differences. */ - int a4; /* List in order declared. */ -{ -.Ed +When converting K&R style declarations to ANSI style, preserve +any comments about parameters. .Pp -Use ANSI function declarations unless you explicitly need K&R compatibility. Long parameter lists are wrapped with a normal four space indent. .Pp Variable numbers of arguments should look like this: From owner-svn-src-head@freebsd.org Fri Mar 9 18: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 F3AE5F41ED5; Fri, 9 Mar 2018 18:45: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 9ECB286628; Fri, 9 Mar 2018 18:45: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 99CB322DAD; Fri, 9 Mar 2018 18:45: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 w29IjD1T043609; Fri, 9 Mar 2018 18:45:13 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29IjDUN043608; Fri, 9 Mar 2018 18:45:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803091845.w29IjDUN043608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 9 Mar 2018 18:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330701 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330701 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:45:14 -0000 Author: kevans Date: Fri Mar 9 18:45:13 2018 New Revision: 330701 URL: https://svnweb.freebsd.org/changeset/base/330701 Log: lualoader: Don't redraw the autoboot message every .05s Modified: head/stand/lua/menu.lua Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Fri Mar 9 17:59:22 2018 (r330700) +++ head/stand/lua/menu.lua Fri Mar 9 18:45:13 2018 (r330701) @@ -425,14 +425,17 @@ function menu.autoboot() local endtime = loader.time() + ab local time - + local last repeat time = endtime - loader.time() - screen.setcursor(x, y) - print("Autoboot in " .. time .. - " seconds, hit [Enter] to boot" .. - " or any other key to stop ") - screen.defcursor() + if last == nil or last ~= time then + last = time + screen.setcursor(x, y) + print("Autoboot in " .. time .. + " seconds, hit [Enter] to boot" .. + " or any other key to stop ") + screen.defcursor() + end if io.ischar() then local ch = io.getchar() if ch == core.KEY_ENTER then From owner-svn-src-head@freebsd.org Fri Mar 9 18:51: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 C44E5F4267E; Fri, 9 Mar 2018 18:51:24 +0000 (UTC) (envelope-from bdrewery@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 7938886C05; Fri, 9 Mar 2018 18:51:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7445F22DF0; Fri, 9 Mar 2018 18:51:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w29IpOXD045579; Fri, 9 Mar 2018 18:51:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29IpOrR045578; Fri, 9 Mar 2018 18:51:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803091851.w29IpOrR045578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 9 Mar 2018 18:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330702 - head/lib/libmagic X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/lib/libmagic X-SVN-Commit-Revision: 330702 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:51:24 -0000 Author: bdrewery Date: Fri Mar 9 18:51:24 2018 New Revision: 330702 URL: https://svnweb.freebsd.org/changeset/base/330702 Log: LIB32: Avoid linking in unneeded (and invalid lib32) libz for libmagic build tool. Usually this is just ignored: /usr/bin/ld: skipping incompatible /scratch/obj/root/git/freebsd/amd64.amd64/obj-lib32/lib/libz/libz.so when searching for -lz /usr/bin/ld: skipping incompatible /scratch/obj/root/git/freebsd/amd64.amd64/obj-lib32/lib/libz/libz.a when searching for -lz However some combination of newer toolchains simply fail here instead: /usr/bin/ld: error: /home/dstolfa/obj/home/dstolfa/cadets/amd64.amd64/obj-lib32/lib/libz/libz.so is incompatible with /usr/lib/crt1.o Libz is not needed for mkmagic so just exclude it. Reported by: Domagoj Stolfa MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/lib/libmagic/Makefile Modified: head/lib/libmagic/Makefile ============================================================================== --- head/lib/libmagic/Makefile Fri Mar 9 18:45:13 2018 (r330701) +++ head/lib/libmagic/Makefile Fri Mar 9 18:51:24 2018 (r330702) @@ -8,7 +8,9 @@ CONTRDIR= ${SRCTOP}/contrib/file LIB= magic SHLIB_MAJOR= 4 +.if !make(build-tools) LIBADD= z +.endif MAN= libmagic.3 magic.5 SRCS= apprentice.c apptype.c ascmagic.c cdf.c cdf_time.c compress.c \ From owner-svn-src-head@freebsd.org Fri Mar 9 19:04: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 BB1C2F43725; Fri, 9 Mar 2018 19:04:07 +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 59A3487586; Fri, 9 Mar 2018 19:04:07 +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 4F0E7230F4; Fri, 9 Mar 2018 19:04:07 +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 w29J47a7053718; Fri, 9 Mar 2018 19:04:07 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29J47KY053716; Fri, 9 Mar 2018 19:04:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803091904.w29J47KY053716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 9 Mar 2018 19:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330703 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330703 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 19:04:08 -0000 Author: kevans Date: Fri Mar 9 19:04:06 2018 New Revision: 330703 URL: https://svnweb.freebsd.org/changeset/base/330703 Log: lualoader: Cache kernel list With autodetection turned on, hitting the filesystem everytime we need to calculate choices for the kernel carousel is kind of slow. Cache once on the first listing and reload it anytime the config is reloaded in case any of the loader.conf(5) changes that affect this (kernel, kernels, kernels_autodetect) have changed. This also picks up the case where we've changed currdev and the autodetected kernels could change. Modified: head/stand/lua/config.lua head/stand/lua/core.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Fri Mar 9 18:51:24 2018 (r330702) +++ head/stand/lua/config.lua Fri Mar 9 19:04:06 2018 (r330703) @@ -497,6 +497,7 @@ function config.reload(file) modules = {} config.restoreEnv() config.load(file) + core.configReloaded() end function config.loadelf() Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Fri Mar 9 18:51:24 2018 (r330702) +++ head/stand/lua/core.lua Fri Mar 9 19:04:06 2018 (r330703) @@ -138,7 +138,18 @@ function core.setSafeMode(safe_mode) core.sm = safe_mode end +function core.configReloaded() + -- Clear the kernel cache on config changes, autodetect might have + -- changed or if we've switched boot environments then we could have + -- a new kernel set. + core.cached_kernels = nil +end + function core.kernelList() + if core.cached_kernels ~= nil then + return core.cached_kernels + end + local k = loader.getenv("kernel") local v = loader.getenv("kernels") local autodetect = loader.getenv("kernels_autodetect") or "" @@ -166,7 +177,8 @@ function core.kernelList() -- setting, kernels_autodetect. If it's set to 'yes', we'll add -- any kernels we detect based on the criteria described. if autodetect:lower() ~= "yes" then - return kernels + core.cached_kernels = kernels + return core.cached_kernels end -- Automatically detect other bootable kernel directories using a @@ -195,7 +207,8 @@ function core.kernelList() ::continue:: end - return kernels + core.cached_kernels = kernels + return core.cached_kernels end function core.bootenvDefault() From owner-svn-src-head@freebsd.org Fri Mar 9 19:22: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 3B93CF44A4F; Fri, 9 Mar 2018 19:22:27 +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 0B434680FB; Fri, 9 Mar 2018 19:22:27 +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 EDF7A10A87D; Fri, 9 Mar 2018 14:22:25 -0500 (EST) From: John Baldwin To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330338 - head/sys/amd64/amd64 Date: Fri, 09 Mar 2018 11:22:19 -0800 Message-ID: <2557369.6nFzd3kAUm@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201803031510.w23FAbeC065867@repo.freebsd.org> References: <201803031510.w23FAbeC065867@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 Mar 2018 14:22:26 -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 Mar 2018 19:22:27 -0000 On Saturday, March 03, 2018 03:10:37 PM Andriy Gapon wrote: > Author: avg > Date: Sat Mar 3 15:10:37 2018 > New Revision: 330338 > URL: https://svnweb.freebsd.org/changeset/base/330338 > > Log: > db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common > > Since that change the system call stack traces look like this: > ... > sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe0028e13ac0 > amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe0028e13bf0 > fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0028e13bf0 > So, db_nextframe() stopped recognizing the system call frame. > This commit should fix that. > > Reviewed by: kib > MFC after: 4 days > > Modified: > head/sys/amd64/amd64/db_trace.c > > Modified: head/sys/amd64/amd64/db_trace.c > ============================================================================== > --- head/sys/amd64/amd64/db_trace.c Sat Mar 3 13:20:44 2018 (r330337) > +++ head/sys/amd64/amd64/db_trace.c Sat Mar 3 15:10:37 2018 (r330338) > @@ -212,7 +212,9 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s > strcmp(name, "Xcpususpend") == 0 || > strcmp(name, "Xrendezvous") == 0) > frame_type = INTERRUPT; > - else if (strcmp(name, "Xfast_syscall") == 0) > + else if (strcmp(name, "Xfast_syscall") == 0 || > + strcmp(name, "Xfast_syscall_pti") == 0 || > + strcmp(name, "fast_syscall_common") == 0) > frame_type = SYSCALL; I think you actually just want to replace Xfast_syscall with fast_syscall_common. Neither Xfast_syscall nor Xfast_syscall_pti call any functions before jumping to the common label, so when unwinding from a system call you should always get the common label. (That is, I think we should remove Xfast_syscall and Xfast_syscall_pti here. Any stack trace that happens to find those symbols during unwinding won't have a valid SYSCALL frame to unwind.) -- John Baldwin From owner-svn-src-head@freebsd.org Fri Mar 9 20:41: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 C4F1DF49E9C; Fri, 9 Mar 2018 20:41:41 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 18F4D6B4D0; Fri, 9 Mar 2018 20:41:40 +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 mail104.syd.optusnet.com.au (Postfix) with ESMTPS id E80F9429C1B; Sat, 10 Mar 2018 07:41:30 +1100 (AEDT) Date: Sat, 10 Mar 2018 07:41:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330338 - head/sys/amd64/amd64 In-Reply-To: <2557369.6nFzd3kAUm@ralph.baldwin.cx> Message-ID: <20180310070452.P5919@besplex.bde.org> References: <201803031510.w23FAbeC065867@repo.freebsd.org> <2557369.6nFzd3kAUm@ralph.baldwin.cx> 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=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=V4blWmsMqxuLYuRTueAA:9 a=934a5VvCigGelsVO:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 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 Mar 2018 20:41:42 -0000 On Fri, 9 Mar 2018, John Baldwin wrote: > On Saturday, March 03, 2018 03:10:37 PM Andriy Gapon wrote: >> Author: avg >> Date: Sat Mar 3 15:10:37 2018 >> New Revision: 330338 >> URL: https://svnweb.freebsd.org/changeset/base/330338 >> >> Log: >> db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common >> >> Since that change the system call stack traces look like this: >> ... >> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe0028e13ac0 >> amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe0028e13bf0 >> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0028e13bf0 >> So, db_nextframe() stopped recognizing the system call frame. >> This commit should fix that. >> >> Reviewed by: kib >> MFC after: 4 days >> >> Modified: >> head/sys/amd64/amd64/db_trace.c >> >> Modified: head/sys/amd64/amd64/db_trace.c >> ============================================================================== >> --- head/sys/amd64/amd64/db_trace.c Sat Mar 3 13:20:44 2018 (r330337) >> +++ head/sys/amd64/amd64/db_trace.c Sat Mar 3 15:10:37 2018 (r330338) >> @@ -212,7 +212,9 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s >> strcmp(name, "Xcpususpend") == 0 || >> strcmp(name, "Xrendezvous") == 0) >> frame_type = INTERRUPT; >> - else if (strcmp(name, "Xfast_syscall") == 0) >> + else if (strcmp(name, "Xfast_syscall") == 0 || >> + strcmp(name, "Xfast_syscall_pti") == 0 || >> + strcmp(name, "fast_syscall_common") == 0) >> frame_type = SYSCALL; > > I think you actually just want to replace Xfast_syscall with > fast_syscall_common. Neither Xfast_syscall nor Xfast_syscall_pti call any > functions before jumping to the common label, so when unwinding from a system > call you should always get the common label. (That is, I think we should > remove Xfast_syscall and Xfast_syscall_pti here. Any stack trace that > happens to find those symbols during unwinding won't have a valid SYSCALL > frame to unwind.) No, it needs these symbols to decode the frame after reaching a point where the frame is actually set up. Also, in uncommitted fixes I add some decoding of the non-frame between the entry point and when the frame is set up. Then the frame register is still the user's for the syscall case, so should not even be accessed. The i386 output looks like this: current: XX12: Breakpoint at Xint0x80_syscall: pushl $0x2 XX12: db> t XX12: Tracing pid 1 tid 100001 td 0xc6fad000 XX12: Xint0x80_syscall(33,282,bfbfee0c,3b,0,...) at Xint0x80_syscall/frame 0xd1d05bd8 XX12: kernload(2,bfbfeec4,bfbfeed0,804812b,80a3d64,...) at 0x805188f/frame 0xbfbfee7c fixed: XX12F: Breakpoint at Xint0x80_syscall: pushl $0x2 XX12F: db> t XX12F: Tracing pid 1 tid 100001 td 0xd4c23000 XX12F: Xint0x80_syscall(2,bfbfeec4,bfbfeed0,804812b,80a3d64,...) at Xint0x80_syscall/frame 0xbfbfee7c XX12F: --- unknown trap, ebp = 0xbfbfee7c, sp = 0xd3399bdc, ks = 0xd3398000, kse = 0xd339a000 --- where most of the values on the last line are for debugging (ebp is the user stack pointer which will become inaccessible, sp is the local variable sp and [ks, kse - 1] is the thread's kernel stack range (sp must be in this else the backtrace stops). Jumps and labels with names inside functions complicate things. I think fast_syscall_common needs to be in the list too, and the many alltraps labels should have been there. This will be more useful with my fix. The label calltrap has always been in the list. This works right since the frame has been set up then -- IIRC it is the first place where the frame has been set up, and label it more for gdb than for ddb, and decode the frame for ddb (presumably gdb decodes the frame too). Bruce From owner-svn-src-head@freebsd.org Fri Mar 9 20:57: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 089B0F4AE93; Fri, 9 Mar 2018 20:57:42 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 7B3F66C056; Fri, 9 Mar 2018 20:57:40 +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 mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 8343910171B; Sat, 10 Mar 2018 07:57:32 +1100 (AEDT) Date: Sat, 10 Mar 2018 07:57:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: John Baldwin , Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330338 - head/sys/amd64/amd64 In-Reply-To: <20180310070452.P5919@besplex.bde.org> Message-ID: <20180310074320.S6000@besplex.bde.org> References: <201803031510.w23FAbeC065867@repo.freebsd.org> <2557369.6nFzd3kAUm@ralph.baldwin.cx> <20180310070452.P5919@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=VJytp5HX c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=Z0mnDzNeAm6wlDpW9RcA:9 a=nTHrAxpj3QkipIiO:21 a=JVfJ45zcLPeVcv5e:21 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: Fri, 09 Mar 2018 20:57:42 -0000 On Sat, 10 Mar 2018, Bruce Evans wrote: > On Fri, 9 Mar 2018, John Baldwin wrote: >> >> I think you actually just want to replace Xfast_syscall with >> fast_syscall_common. Neither Xfast_syscall nor Xfast_syscall_pti call any >> functions before jumping to the common label, so when unwinding from a >> system >> call you should always get the common label. (That is, I think we should >> remove Xfast_syscall and Xfast_syscall_pti here. Any stack trace that >> happens to find those symbols during unwinding won't have a valid SYSCALL >> frame to unwind.) > > No, it needs these symbols to decode the frame after reaching a point where > the frame is actually set up. > > Also, in uncommitted fixes I add some decoding of the non-frame between > the entry point and when the frame is set up. Then the frame register > ... > Jumps and labels with names inside functions complicate things. I think > fast_syscall_common needs to be in the list too, and the many alltraps > labels should have been there. This will be more useful with my fix. > The label calltrap has always been in the list. This works right since > the frame has been set up then -- IIRC it is the first place where the > frame has been set up, and label it more for gdb than for ddb, and decode > the frame for ddb (presumably gdb decodes the frame too). Actually, internal labels like alltraps just break finding the entry point. Cross-jumping to such labels also breaks finding the entry point. The calltrap label is a work around for this problem -- it is too hard to trace back to the entry point (e.g., Xpage) or even to alltraps, so the single fake entry point calltrap is used. Syscalls and interrupts are more important, or at least easier to handle, so the problem was avoided for them by not using cross jumps or too many internal labels (though I don't like unnamed labels). This is quite broken for amd64 now. Cross-jumps also complicate mcounting. (The non-traps are easier to handle since they are not multiplexed through trap(). The multiplexing can be thought of as making all traps enter at trap() with a trap code giving the trap number, so no label for the entry point is needed. The trap code is an arg, so it is printed in the stack trace on i386.) Bruce From owner-svn-src-head@freebsd.org Fri Mar 9 21:32: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 B2E58F4D273; Fri, 9 Mar 2018 21:32: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 6906F6D8EC; Fri, 9 Mar 2018 21:32: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 63BD724866; Fri, 9 Mar 2018 21:32: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 w29LW8Kk030491; Fri, 9 Mar 2018 21:32:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29LW8QD030490; Fri, 9 Mar 2018 21:32:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803092132.w29LW8QD030490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 9 Mar 2018 21:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330705 - head/sbin/mount X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/mount X-SVN-Commit-Revision: 330705 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 21:32:08 -0000 Author: imp Date: Fri Mar 9 21:32:07 2018 New Revision: 330705 URL: https://svnweb.freebsd.org/changeset/base/330705 Log: Remove decade's old whine about msdos vs msdosfs. Retain the compatibility silently though. Reviewed by: cem@, kevans@, emaste@ (and many others in the past) Modified: head/sbin/mount/mount.c Modified: head/sbin/mount/mount.c ============================================================================== --- head/sbin/mount/mount.c Fri Mar 9 19:39:08 2018 (r330704) +++ head/sbin/mount/mount.c Fri Mar 9 21:32:07 2018 (r330705) @@ -589,11 +589,8 @@ mountfs(const char *vfstype, const char *spec, const c optbuf = catopt(optbuf, "update"); /* Compatibility glue. */ - if (strcmp(vfstype, "msdos") == 0) { - warnx( - "Using \"-t msdosfs\", since \"-t msdos\" is deprecated."); + if (strcmp(vfstype, "msdos") == 0) vfstype = "msdosfs"; - } /* Construct the name of the appropriate mount command */ (void)snprintf(execname, sizeof(execname), "mount_%s", vfstype); From owner-svn-src-head@freebsd.org Fri Mar 9 22:09: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 AB8FAF2A065; Fri, 9 Mar 2018 22:09:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48794701F4; Fri, 9 Mar 2018 22:09:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x231.google.com with SMTP id o74so1550311iod.6; Fri, 09 Mar 2018 14:09:45 -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:in-reply-to:user-agent; bh=/vsfZ6Y9rbDNOeuIR0hu2q6Is7+ngj+5m1v9LUH0+2A=; b=kO20dSuFGZtHxPgL98oMGfMEyfh56burmCJSHMpfBmPpSXjd1kIlM4s9qL7ScLTBuj ks6Hj7LzU7FUynI4zLcOD+N6oR+SeHgtJloimJ3nAj7B1pwdOlsByyYt5QYBBE5gbCij oRkJ7xXD1YKCN5JzO0a9EabE3Jf1GzQVaJJkj8+Yqm9LK1+NdQ1WTLvcy+u+YdgA5j6H BAh78VQxd/qXW2LCfLCWvCA4V+NDh9BASxjOJcv3JEtuexFx5a+gxApxIQc3cpi9atWb BenMdQMgaCsw466SYh2t9qfGB2Dg8QJgg5nFSyS65S1uFZuxkx8LOcCbEh2UDQWgB1v5 HGJA== 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:in-reply-to:user-agent; bh=/vsfZ6Y9rbDNOeuIR0hu2q6Is7+ngj+5m1v9LUH0+2A=; b=BGqH0ygXmwAhbVJxG3Y/kvEzIi2lJWUXik2S80KdcmoErvbpAYSbggLeEDZ97LzPPX OU5sYJ/EkBhc4TXh+oKnQucEge3dcJrgLKB+NntSA3BerddEZNoA23G4JXH8Tey46Pzf ThFkmqZDs93u1prsHEMTSDPgWYX2ApnDap+UEkwMYUvc1PLT13NVfhWk4X1RvSwX4rhb +m/gfHCZYMY1xOZy/siJN2Yw/rEsLNWTkOAVzJ/xvCR8/2xv5I9+fCW99lBU1w1yeKuP K99tAl/oNnELo2G38FE4tLX8QuN5agcWLCgjVqGDumpD8ZqCi/NN/eC3/bNg9SRlGQAF IlXA== X-Gm-Message-State: AElRT7HPM4KymMzjWA57MJT1vPCIcJKWyrweW25MYUQYQ6zUcI4DJekX ZDhMX8UK/Go/sXa5PU9MbpUMyulo X-Google-Smtp-Source: AG47ELunmN+/+dUw3o9jlbciuAJY5UWdaZOVRcKdAiQsraXKyn/ShA0OmAthA6B+Wd/u3APe6ea+vg== X-Received: by 10.107.213.72 with SMTP id x8mr46547ioc.60.1520633384184; Fri, 09 Mar 2018 14:09:44 -0800 (PST) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id 33sm1505739ioj.71.2018.03.09.14.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 14:09:43 -0800 (PST) Sender: Mark Johnston Date: Fri, 9 Mar 2018 17:09:40 -0500 From: Mark Johnston To: David Bright Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs Message-ID: <20180309220940.GG6174@raichu> References: <201801151925.w0FJPCKA019434@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201801151925.w0FJPCKA019434@repo.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: Fri, 09 Mar 2018 22:09:45 -0000 On Mon, Jan 15, 2018 at 07:25:11PM +0000, David Bright wrote: > Author: dab > Date: Mon Jan 15 19:25:11 2018 > New Revision: 328013 > URL: https://svnweb.freebsd.org/changeset/base/328013 > > Log: > Exit fsck_ffs with non-zero status when file system is not repaired. > > When the fsck_ffs program cannot fully repair a file system, it will > output the message PLEASE RERUN FSCK. However, it does not exit with a > non-zero status in this case (contradicting the man page claim that it > "exits with 0 on success, and >0 if an error occurs." The fsck > rc-script (when running "fsck -y") tests the status from fsck (which > passes along the exit status from fsck_ffs) and issues a "stop_boot" > if the status fails. However, this is not effective since fsck_ffs can > return zero even on (some) errors. Effectively, it is left to a later > step in the boot process when the file systems are mounted to detect > the still-unclean file system and stop the boot. > > This change modifies fsck_ffs so that when it cannot fully repair the > file system and issues the PLEASE RERUN FSCK message it also exits > with a non-zero status. > > While here, the fsck_ffs man page has also been updated to document > the failing exit status codes used by fsck_ffs. Previously, only exit > status 7 was documented. Some of these exit statuses are tested for in > the fsck rc-script, so they are clearly depended upon and deserve > documentation. etc/rc.d/fsck doesn't know how to interpret the new exit code and now just drops to a single-user shell when it is encountered. This is happening to me semi-regularly when my test systems crash, especially when I test kernel panic handling. :) Is there any reason etc/rc.d/fsck shouldn't automatically retry (up to some configurable number of retries) when the new error code is seen? The patch below seems to do the trick for me: diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 584e842bba2c..63d2fcc0be8d 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -95,6 +95,7 @@ root_rw_mount="YES" # Set to NO to inhibit remounting root read-write. root_hold_delay="30" # Time to wait for root mount hold release. fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y +fsck_retries="3" # Number of times to retry fsck before giving up. background_fsck="YES" # Attempt to run fsck in the background where possible. background_fsck_delay="60" # Time to wait (seconds) before starting the fsck. growfs_enable="NO" # Set to YES to attempt to grow the root filesystem on boot diff --git a/etc/rc.d/fsck b/etc/rc.d/fsck index bd3122a20110..708d92228e3d 100755 --- a/etc/rc.d/fsck +++ b/etc/rc.d/fsck @@ -14,8 +14,82 @@ desc="Run file system checks" start_cmd="fsck_start" stop_cmd=":" +_fsck_run() +{ + local err + + if checkyesno background_fsck; then + fsck -F -p + else + fsck -p + fi + + err=$? + if [ ${err} -eq 3 ]; then + echo "Warning! Some of the devices might not be" \ + "available; retrying" + root_hold_wait + check_startmsgs && echo "Restarting file system checks:" + if checkyesno background_fsck; then + fsck -F -p + else + fsck -p + fi + err=$? + fi + + case ${err} in + 0) + ;; + 2) + stop_boot + ;; + 4) + echo "Rebooting..." + reboot + echo "Reboot failed; help!" + stop_boot + ;; + 8) + if checkyesno fsck_y_enable; then + echo "File system preen failed, trying fsck -y ${fsck_y_flags}" + fsck -y ${fsck_y_flags} + case $? in + 0) + ;; + *) + echo "Automatic file system check failed; help!" + stop_boot + ;; + esac + else + echo "Automatic file system check failed; help!" + stop_boot + fi + ;; + 12) + echo "Boot interrupted." + stop_boot + ;; + 16) + echo "File system check retry requested." + ;; + 130) + stop_boot + ;; + *) + echo "Unknown error ${err}; help!" + stop_boot + ;; + esac + + return $err +} + fsck_start() { + local err tries + if [ "$autoboot" = no ]; then echo "Fast boot: skipping disk checks." elif [ ! -r /etc/fstab ]; then @@ -25,67 +99,13 @@ fsck_start() trap : 3 check_startmsgs && echo "Starting file system checks:" - if checkyesno background_fsck; then - fsck -F -p - else - fsck -p - fi - - err=$? - if [ ${err} -eq 3 ]; then - echo "Warning! Some of the devices might not be" \ - "available; retrying" - root_hold_wait - check_startmsgs && echo "Restarting file system checks:" - if checkyesno background_fsck; then - fsck -F -p - else - fsck -p - fi + tries=$fsck_retries + while [ $tries -gt 0 ]; do + _fsck_run err=$? - fi - - case ${err} in - 0) - ;; - 2) - stop_boot - ;; - 4) - echo "Rebooting..." - reboot - echo "Reboot failed; help!" - stop_boot - ;; - 8) - if checkyesno fsck_y_enable; then - echo "File system preen failed, trying fsck -y ${fsck_y_flags}" - fsck -y ${fsck_y_flags} - case $? in - 0) - ;; - *) - echo "Automatic file system check failed; help!" - stop_boot - ;; - esac - else - echo "Automatic file system check failed; help!" - stop_boot - fi - ;; - 12) - echo "Boot interrupted." - stop_boot - ;; - 130) - stop_boot - ;; - *) - echo "Unknown error ${err}; help!" - stop_boot - ;; - esac + [ $err -eq 16 ] || break + tries=$(($tries - 1)) + done fi } diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index c27a2134e6bc..c9a16ca9f65c 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2018 +.Dd March 9, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -2053,6 +2053,11 @@ will be run with the .Fl y flag if the initial preen of the file systems fails. +.It Va fsck_retries +.Pq Vt int +Maximum number of times to re-run +.Xr fsck 8 +if its exit status indicates that a re-run is required. .It Va background_fsck .Pq Vt bool If set to From owner-svn-src-head@freebsd.org Fri Mar 9 22:31: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 77E86F2BD61 for ; Fri, 9 Mar 2018 22:31:33 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F300A7128E for ; Fri, 9 Mar 2018 22:31:32 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 7fdbfb70-23e9-11e8-b951-f99fef315fd9 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 outbound2.ore.mailhop.org (Halon) with ESMTPSA id 7fdbfb70-23e9-11e8-b951-f99fef315fd9; Fri, 09 Mar 2018 22:30:42 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w29MVUBl008952; Fri, 9 Mar 2018 15:31:30 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520634689.84937.74.camel@freebsd.org> Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs From: Ian Lepore To: Mark Johnston , David Bright Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 09 Mar 2018 15:31:29 -0700 In-Reply-To: <20180309220940.GG6174@raichu> References: <201801151925.w0FJPCKA019434@repo.freebsd.org> <20180309220940.GG6174@raichu> 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: Fri, 09 Mar 2018 22:31:33 -0000 On Fri, 2018-03-09 at 17:09 -0500, Mark Johnston wrote: > On Mon, Jan 15, 2018 at 07:25:11PM +0000, David Bright wrote: > > > > Author: dab > > Date: Mon Jan 15 19:25:11 2018 > > New Revision: 328013 > > URL: https://svnweb.freebsd.org/changeset/base/328013 > > > > Log: > > Exit fsck_ffs with non-zero status when file system is not repaired. > > > > [...] > etc/rc.d/fsck doesn't know how to interpret the new exit code and now > just drops to a single-user shell when it is encountered. This is > happening to me semi-regularly when my test systems crash, especially > when I test kernel panic handling. :) > > Is there any reason etc/rc.d/fsck shouldn't automatically retry (up to > some configurable number of retries) when the new error code is seen? > The patch below seems to do the trick for me: > fsck_ffs already has a -R flag to automatically retry, wouldn't that be a better mechanism for handling this new type of retry? -- Ian From owner-svn-src-head@freebsd.org Fri Mar 9 22:58: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 244E0F2D9F5; Fri, 9 Mar 2018 22:58:06 +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 CDCBA721D9; Fri, 9 Mar 2018 22:58:05 +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 C043225502; Fri, 9 Mar 2018 22:58:05 +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 w29Mw5R4073797; Fri, 9 Mar 2018 22:58:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29Mw5jk073796; Fri, 9 Mar 2018 22:58:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803092258.w29Mw5jk073796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 9 Mar 2018 22:58:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330708 - head/gnu/usr.bin/gdb/kgdb X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/gnu/usr.bin/gdb/kgdb X-SVN-Commit-Revision: 330708 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:58:06 -0000 Author: jhb Date: Fri Mar 9 22:58:05 2018 New Revision: 330708 URL: https://svnweb.freebsd.org/changeset/base/330708 Log: Use the trapframe unwinder for "fast_syscall_common". MFC after: 3 days Modified: head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Modified: head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Fri Mar 9 22:52:52 2018 (r330707) +++ head/gnu/usr.bin/gdb/kgdb/trgt_amd64.c Fri Mar 9 22:58:05 2018 (r330708) @@ -189,6 +189,7 @@ kgdb_trgt_trapframe_sniffer(struct frame_info *next_fr if (pname == NULL) return (NULL); if (strcmp(pname, "calltrap") == 0 || + strcmp(pname, "fast_syscall_common") == 0 || strcmp(pname, "mchk_calltrap") == 0 || strcmp(pname, "nmi_calltrap") == 0 || (pname[0] == 'X' && pname[1] != '_')) From owner-svn-src-head@freebsd.org Fri Mar 9 23:17: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 C522AF2F0A6; Fri, 9 Mar 2018 23:17:29 +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 79F2172CB3; Fri, 9 Mar 2018 23:17:29 +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 7075225810; Fri, 9 Mar 2018 23:17:29 +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 w29NHTOG083934; Fri, 9 Mar 2018 23:17:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29NHTfi083933; Fri, 9 Mar 2018 23:17:29 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803092317.w29NHTfi083933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 9 Mar 2018 23:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330709 - head/etc/mtree X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/etc/mtree X-SVN-Commit-Revision: 330709 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 23:17:29 -0000 Author: asomers Date: Fri Mar 9 23:17:29 2018 New Revision: 330709 URL: https://svnweb.freebsd.org/changeset/base/330709 Log: Commit missing file from r330696 MFC after: 3 weeks X-MFC-With: 330696 Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Fri Mar 9 22:58:05 2018 (r330708) +++ head/etc/mtree/BSD.tests.dist Fri Mar 9 23:17:29 2018 (r330709) @@ -382,6 +382,8 @@ .. rtld-elf .. + tftpd + .. .. sbin dhclient From owner-svn-src-head@freebsd.org Fri Mar 9 23:25: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 8AD7BF2FA51; Fri, 9 Mar 2018 23:25:19 +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 29BCE73303; Fri, 9 Mar 2018 23:25:19 +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 2099D259AA; Fri, 9 Mar 2018 23:25:19 +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 w29NPIc3088628; Fri, 9 Mar 2018 23:25:18 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29NPIwP088624; Fri, 9 Mar 2018 23:25:18 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803092325.w29NPIwP088624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 9 Mar 2018 23:25:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330710 - in head: libexec/tftpd libexec/tftpd/tests usr.bin/tftp X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: libexec/tftpd libexec/tftpd/tests usr.bin/tftp X-SVN-Commit-Revision: 330710 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 23:25:19 -0000 Author: asomers Date: Fri Mar 9 23:25:18 2018 New Revision: 330710 URL: https://svnweb.freebsd.org/changeset/base/330710 Log: tftpd: Flush files as soon as they are fully received On an RRQ, tftpd doesn't exit as soon as it's finished receiving a file. Instead, it waits five seconds just in case the client didn't receive the server's last ACK and decides to resend the final DATA packet. Unfortunately, this created a 5 second delay from when the client thinks it's done sending the file, and when the file is available for other processes. Fix this bug by closing the file as soon as receipt is finished. PR: 157700 Reported by: Barry Mishler MFC after: 3 weeks Modified: head/libexec/tftpd/tests/functional.c head/libexec/tftpd/tftp-transfer.c head/libexec/tftpd/tftpd.c head/usr.bin/tftp/tftp.c Modified: head/libexec/tftpd/tests/functional.c ============================================================================== --- head/libexec/tftpd/tests/functional.c Fri Mar 9 23:17:29 2018 (r330709) +++ head/libexec/tftpd/tests/functional.c Fri Mar 9 23:25:18 2018 (r330710) @@ -694,7 +694,6 @@ TFTPD_TC_DEFINE(w_flag,, w_flag = 1;) send_data(1, contents, contents_len); recv_ack(1); - atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); fd = open("small.txt", O_RDONLY); r = read(fd, buffer, sizeof(buffer)); close(fd); @@ -731,7 +730,6 @@ TFTPD_TC_DEFINE(wrq_dropped_ack,) send_data(2, (const char*)&contents[128], 256); recv_ack(2); - atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); fd = open("medium.txt", O_RDONLY); r = read(fd, buffer, sizeof(buffer)); close(fd); @@ -764,7 +762,6 @@ TFTPD_TC_DEFINE(wrq_dropped_data,) send_data(1, contents, contents_len); recv_ack(1); - atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); fd = open("small.txt", O_RDONLY); r = read(fd, buffer, sizeof(buffer)); close(fd); @@ -798,7 +795,6 @@ TFTPD_TC_DEFINE(wrq_duped_data,) send_data(2, (const char*)&contents[128], 256); recv_ack(2); - atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); fd = open("medium.txt", O_RDONLY); r = read(fd, buffer, sizeof(buffer)); close(fd); @@ -865,7 +861,6 @@ TFTPD_TC_DEFINE(wrq_medium,) send_data(2, (const char*)&contents[128], 256); recv_ack(2); - atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); fd = open("medium.txt", O_RDONLY); r = read(fd, buffer, sizeof(buffer)); close(fd); @@ -891,14 +886,13 @@ TFTPD_TC_DEFINE(wrq_netascii,) fd = open("unix.txt", O_RDWR | O_CREAT, 0666); ATF_REQUIRE(fd >= 0); close(fd); - contents_len = strlen(contents) + 1; + contents_len = sizeof(contents); SEND_WRQ("unix.txt", "netascii"); recv_ack(0); send_data(1, contents, contents_len); recv_ack(1); - atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); fd = open("unix.txt", O_RDONLY); r = read(fd, buffer, sizeof(buffer)); close(fd); @@ -938,7 +932,6 @@ TFTPD_TC_DEFINE(wrq_small,) send_data(1, contents, contents_len); recv_ack(1); - atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); fd = open("small.txt", O_RDONLY); r = read(fd, buffer, sizeof(buffer)); close(fd); Modified: head/libexec/tftpd/tftp-transfer.c ============================================================================== --- head/libexec/tftpd/tftp-transfer.c Fri Mar 9 23:17:29 2018 (r330709) +++ head/libexec/tftpd/tftp-transfer.c Fri Mar 9 23:25:18 2018 (r330710) @@ -304,6 +304,8 @@ send_ack: gettimeofday(&(ts->tstop), NULL); } while (n_data == segsize); + write_close(); + /* Don't do late packet management for the client implementation */ if (acting_as_client) return; Modified: head/libexec/tftpd/tftpd.c ============================================================================== --- head/libexec/tftpd/tftpd.c Fri Mar 9 23:17:29 2018 (r330709) +++ head/libexec/tftpd/tftpd.c Fri Mar 9 23:25:18 2018 (r330710) @@ -823,7 +823,6 @@ tftp_recvfile(int peer, const char *mode) block = 0; tftp_receive(peer, &block, &ts, NULL, 0); - write_close(); gettimeofday(&now2, NULL); if (debug&DEBUG_SIMPLE) { Modified: head/usr.bin/tftp/tftp.c ============================================================================== --- head/usr.bin/tftp/tftp.c Fri Mar 9 23:17:29 2018 (r330709) +++ head/usr.bin/tftp/tftp.c Fri Mar 9 23:25:18 2018 (r330710) @@ -265,7 +265,6 @@ recvfile(int peer, char *port, int fd, char *name, cha tftp_receive(peer, &block, &tftp_stats, rp, n); } - write_close(); if (tftp_stats.amount > 0) printstats("Received", verbose, &tftp_stats); return; From owner-svn-src-head@freebsd.org Fri Mar 9 23:37: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 869D6F3087C; Fri, 9 Mar 2018 23:37:20 +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 350ED739FF; Fri, 9 Mar 2018 23:37:20 +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 2E38D25B39; Fri, 9 Mar 2018 23:37:20 +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 w29NbKOH093828; Fri, 9 Mar 2018 23:37:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29NbJSX093826; Fri, 9 Mar 2018 23:37:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803092337.w29NbJSX093826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 9 Mar 2018 23:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330711 - head/sbin/sysctl X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sbin/sysctl X-SVN-Commit-Revision: 330711 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 23:37:20 -0000 Author: jhb Date: Fri Mar 9 23:37:19 2018 New Revision: 330711 URL: https://svnweb.freebsd.org/changeset/base/330711 Log: Permit sysctl(8) to set an array of numeric values for a single node. Most sysctl nodes only return a single value, but some nodes return an array of values (e.g. kern.cp_time). sysctl(8) understand how to display the values of a node that returns multiple values (it prints out each numeric value separated by spaces). However, until now sysctl(8) has only been able to set sysctl nodes to a single value. This change allows sysctl to accept a new value for a numeric sysctl node that contains multiple values separated by either spaces or commas. sysctl(8) parses this list into an array of values and passes the array as the "new" value to sysctl(2). Reviewed by: rpokala MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D14569 Modified: head/sbin/sysctl/sysctl.8 head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Fri Mar 9 23:25:18 2018 (r330710) +++ head/sbin/sysctl/sysctl.8 Fri Mar 9 23:37:19 2018 (r330711) @@ -28,7 +28,7 @@ .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd December 10, 2015 +.Dd March 9, 2018 .Dt SYSCTL 8 .Os .Sh NAME @@ -39,7 +39,7 @@ .Op Fl bdehiNnoRTtqx .Op Fl B Ar bufsize .Op Fl f Ar filename -.Ar name Ns Op = Ns Ar value +.Ar name Ns Op = Ns Ar value Ns Op , Ns Ar value .Ar ... .Nm .Op Fl bdehNnoRTtqx Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Fri Mar 9 23:25:18 2018 (r330710) +++ head/sbin/sysctl/sysctl.c Fri Mar 9 23:37:19 2018 (r330711) @@ -65,6 +65,7 @@ static const char rcsid[] = #include #include #include +#include #include #include #include @@ -234,16 +235,17 @@ main(int argc, char **argv) } /* - * Parse a name into a MIB entry. - * Lookup and print out the MIB entry if it exists. - * Set a new value if requested. + * Parse a single numeric value, append it to 'newbuf', and update + * 'newsize'. Returns true if the value was parsed and false if the + * value was invalid. Non-numeric types (strings) are handled + * directly in parse(). */ -static int -parse(const char *string, int lineno) +static bool +parse_numeric(const char *newvalstr, const char *fmt, u_int kind, + void **newbufp, size_t *newsizep) { - int len, i, j; + void *newbuf; const void *newval; - const char *newvalstr = NULL; int8_t i8val; uint8_t u8val; int16_t i16val; @@ -254,11 +256,111 @@ parse(const char *string, int lineno) unsigned int uintval; long longval; unsigned long ulongval; - size_t newsize = Bflag; int64_t i64val; uint64_t u64val; + size_t valsize; + char *endptr = NULL; + + errno = 0; + + switch (kind & CTLTYPE) { + case CTLTYPE_INT: + if (strncmp(fmt, "IK", 2) == 0) + intval = strIKtoi(newvalstr, &endptr, fmt); + else + intval = (int)strtol(newvalstr, &endptr, 0); + newval = &intval; + valsize = sizeof(intval); + break; + case CTLTYPE_UINT: + uintval = (int) strtoul(newvalstr, &endptr, 0); + newval = &uintval; + valsize = sizeof(uintval); + break; + case CTLTYPE_LONG: + longval = strtol(newvalstr, &endptr, 0); + newval = &longval; + valsize = sizeof(longval); + break; + case CTLTYPE_ULONG: + ulongval = strtoul(newvalstr, &endptr, 0); + newval = &ulongval; + valsize = sizeof(ulongval); + break; + case CTLTYPE_S8: + i8val = (int8_t)strtol(newvalstr, &endptr, 0); + newval = &i8val; + valsize = sizeof(i8val); + break; + case CTLTYPE_S16: + i16val = (int16_t)strtol(newvalstr, &endptr, 0); + newval = &i16val; + valsize = sizeof(i16val); + break; + case CTLTYPE_S32: + i32val = (int32_t)strtol(newvalstr, &endptr, 0); + newval = &i32val; + valsize = sizeof(i32val); + break; + case CTLTYPE_S64: + i64val = strtoimax(newvalstr, &endptr, 0); + newval = &i64val; + valsize = sizeof(i64val); + break; + case CTLTYPE_U8: + u8val = (uint8_t)strtoul(newvalstr, &endptr, 0); + newval = &u8val; + valsize = sizeof(u8val); + break; + case CTLTYPE_U16: + u16val = (uint16_t)strtoul(newvalstr, &endptr, 0); + newval = &u16val; + valsize = sizeof(u16val); + break; + case CTLTYPE_U32: + u32val = (uint32_t)strtoul(newvalstr, &endptr, 0); + newval = &u32val; + valsize = sizeof(u32val); + break; + case CTLTYPE_U64: + u64val = strtoumax(newvalstr, &endptr, 0); + newval = &u64val; + valsize = sizeof(u64val); + break; + default: + /* NOTREACHED */ + abort(); + } + + if (errno != 0 || endptr == newvalstr || + (endptr != NULL && *endptr != '\0')) + return (false); + + newbuf = realloc(*newbufp, *newsizep + valsize); + if (newbuf == NULL) + err(1, "out of memory"); + memcpy((char *)newbuf + *newsizep, newval, valsize); + *newbufp = newbuf; + *newsizep += valsize; + + return (true); +} + +/* + * Parse a name into a MIB entry. + * Lookup and print out the MIB entry if it exists. + * Set a new value if requested. + */ +static int +parse(const char *string, int lineno) +{ + int len, i, j; + const void *newval; + char *newvalstr = NULL; + void *newbuf; + size_t newsize = Bflag; int mib[CTL_MAXNAME]; - char *cp, *bufp, buf[BUFSIZ], *endptr = NULL, fmt[BUFSIZ], line[BUFSIZ]; + char *cp, *bufp, buf[BUFSIZ], fmt[BUFSIZ], line[BUFSIZ]; u_int kind; if (lineno) @@ -377,94 +479,33 @@ parse(const char *string, int lineno) return (1); } - errno = 0; + newbuf = NULL; switch (kind & CTLTYPE) { - case CTLTYPE_INT: - if (strncmp(fmt, "IK", 2) == 0) - intval = strIKtoi(newvalstr, &endptr, fmt); - else - intval = (int)strtol(newvalstr, &endptr, - 0); - newval = &intval; - newsize = sizeof(intval); - break; - case CTLTYPE_UINT: - uintval = (int) strtoul(newvalstr, &endptr, 0); - newval = &uintval; - newsize = sizeof(uintval); - break; - case CTLTYPE_LONG: - longval = strtol(newvalstr, &endptr, 0); - newval = &longval; - newsize = sizeof(longval); - break; - case CTLTYPE_ULONG: - ulongval = strtoul(newvalstr, &endptr, 0); - newval = &ulongval; - newsize = sizeof(ulongval); - break; - case CTLTYPE_STRING: - newval = newvalstr; - break; - case CTLTYPE_S8: - i8val = (int8_t)strtol(newvalstr, &endptr, 0); - newval = &i8val; - newsize = sizeof(i8val); - break; - case CTLTYPE_S16: - i16val = (int16_t)strtol(newvalstr, &endptr, - 0); - newval = &i16val; - newsize = sizeof(i16val); - break; - case CTLTYPE_S32: - i32val = (int32_t)strtol(newvalstr, &endptr, - 0); - newval = &i32val; - newsize = sizeof(i32val); - break; - case CTLTYPE_S64: - i64val = strtoimax(newvalstr, &endptr, 0); - newval = &i64val; - newsize = sizeof(i64val); - break; - case CTLTYPE_U8: - u8val = (uint8_t)strtoul(newvalstr, &endptr, 0); - newval = &u8val; - newsize = sizeof(u8val); - break; - case CTLTYPE_U16: - u16val = (uint16_t)strtoul(newvalstr, &endptr, - 0); - newval = &u16val; - newsize = sizeof(u16val); - break; - case CTLTYPE_U32: - u32val = (uint32_t)strtoul(newvalstr, &endptr, - 0); - newval = &u32val; - newsize = sizeof(u32val); - break; - case CTLTYPE_U64: - u64val = strtoumax(newvalstr, &endptr, 0); - newval = &u64val; - newsize = sizeof(u64val); - break; - default: - /* NOTREACHED */ - abort(); + case CTLTYPE_STRING: + newval = newvalstr; + break; + default: + newsize = 0; + while ((cp = strsep(&newvalstr, " ,")) != NULL) { + if (*cp == '\0') + continue; + if (!parse_numeric(cp, fmt, kind, &newbuf, + &newsize)) { + warnx("invalid %s '%s'%s", + ctl_typename[kind & CTLTYPE], + cp, line); + free(newbuf); + return (1); + } + } + newval = newbuf; + break; } - if (errno != 0 || endptr == newvalstr || - (endptr != NULL && *endptr != '\0')) { - warnx("invalid %s '%s'%s", ctl_typename[kind & CTLTYPE], - newvalstr, line); - return (1); - } - i = show_var(mib, len); if (sysctl(mib, len, 0, 0, newval, newsize) == -1) { + free(newbuf); if (!i && !bflag) putchar('\n'); switch (errno) { @@ -485,6 +526,7 @@ parse(const char *string, int lineno) return (1); } } + free(newbuf); if (!bflag) printf(" -> "); i = nflag; From owner-svn-src-head@freebsd.org Sat Mar 10 00:10: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 25A3FF32DFB; Sat, 10 Mar 2018 00:10:48 +0000 (UTC) (envelope-from karels@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 BA4CF74CF9; Sat, 10 Mar 2018 00:10:47 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9BA7E2602A; Sat, 10 Mar 2018 00:10:47 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2A0Al3a008787; Sat, 10 Mar 2018 00:10:47 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A0AlkF008785; Sat, 10 Mar 2018 00:10:47 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201803100010.w2A0AlkF008785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sat, 10 Mar 2018 00:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330712 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 330712 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 00:10:48 -0000 Author: karels Date: Sat Mar 10 00:10:47 2018 New Revision: 330712 URL: https://svnweb.freebsd.org/changeset/base/330712 Log: Change ps(1) output width to unlimited if not interactive Apply patch submitted with PR 217159 to make ps use unlimited width when not associated with a terminal (i.e., none of stdout, stdin, or stderr is a tty). Update comments and man page correspondingly. This change was requested to work around lack of -ww in scripts from third-party packages, including Hadoop, and adds a small measure of Linux compatibility. Hopefully few if any non-interactive scripts depend on the old default of 79. PR: 217159 Submitted by: n.deepak at gmail.com Reviewed by: vangyzen jhb Differential Revision: https://reviews.freebsd.org/D14614 Modified: head/bin/ps/ps.1 head/bin/ps/ps.c Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Fri Mar 9 23:37:19 2018 (r330711) +++ head/bin/ps/ps.1 Sat Mar 10 00:10:47 2018 (r330712) @@ -101,6 +101,14 @@ The default output format includes, for each process, controlling terminal, state, CPU time (including both user and system time) and associated command. .Pp +If the +.Nm +process is associated with a terminal, the default output width is that of the +terminal; otherwise the output width is unlimited. +See also the +.Fl w +option. +.Pp The options are as follows: .Bl -tag -width indent .It Fl -libxo @@ -257,13 +265,15 @@ option implies the .Fl m option. .It Fl w -Use 132 columns to display information, instead of the default which -is your window size. +Use at least 132 columns to display information, instead of the default which +is the window size if +.Nm +is associated with a terminal. If the .Fl w option is specified more than once, .Nm -will use as many columns as necessary without regard for your window size. +will use as many columns as necessary without regard for the window size. Note that this option has no effect if the .Dq command column is not the last column displayed. Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Fri Mar 9 23:37:19 2018 (r330711) +++ head/bin/ps/ps.c Sat Mar 10 00:10:47 2018 (r330712) @@ -202,6 +202,11 @@ main(int argc, char *argv[]) * any of stdout, stderr, or stdin is a terminal. The intent * is that "ps", "ps | more", and "ps | grep" all use the same * default line length unless -w is specified. + * + * If not interactive, the default length was traditionally 79. + * It has been changed to unlimited. This is mostly for the + * benefit of non-interactive scripts, which arguably should + * use -ww, but is compatible with Linux. */ if ((cols = getenv("COLUMNS")) != NULL && *cols != '\0') termwidth = atoi(cols); @@ -209,7 +214,7 @@ main(int argc, char *argv[]) ioctl(STDERR_FILENO, TIOCGWINSZ, (char *)&ws) == -1 && ioctl(STDIN_FILENO, TIOCGWINSZ, (char *)&ws) == -1) || ws.ws_col == 0) - termwidth = 79; + termwidth = UNLIMITED; else termwidth = ws.ws_col - 1; From owner-svn-src-head@freebsd.org Sat Mar 10 00:41: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 B57EBF35993; Sat, 10 Mar 2018 00:41:47 +0000 (UTC) (envelope-from dexuan.bsd@gmail.com) Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::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 0F2B07620B; Sat, 10 Mar 2018 00:41:47 +0000 (UTC) (envelope-from dexuan.bsd@gmail.com) Received: by mail-lf0-x244.google.com with SMTP id e28-v6so6624752lfc.3; Fri, 09 Mar 2018 16:41:47 -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=t/g85Ex4mphkP1x6PdSEfZlPsarOkdB8Nf9yNGBRQfc=; b=dfxDsy1ViytbPiOX/jE5rpyrA5Bx4wISEHNuMaFRYBQY48pGmBSdboUQk8KRq/WK9X 8oLio6pgCKqlz4qetzySva6X88eJkFRpXll3BS5rFSccYyPquZ6AuPZ3jAzQESXGpflp tW9wMfjVkoRJk5idxGqyHucvnroVqc56WK18FFaDd7nOqSLzrZzH0Afofk9W5CKUh2L1 +MN2eAFD8KUyRFw3cqYLbBhY/Mp9PkNmS2qDl8C/imgTQDqT3kb521J15caiU4yu+3vK +sO/yqCjGpLSEPYaGOmr/o4hFt3ScX5U689RiSoJ3AFRu13p2MfMse7HJoSi6PvGo/EU Hd/g== 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=t/g85Ex4mphkP1x6PdSEfZlPsarOkdB8Nf9yNGBRQfc=; b=QJb3ckoyFSbZX9JfvglpBLnZ8sNk9xIC+nnYQxK4YW7Dfulij2iJMn/1gh38+bnQH7 UdovaCj7x2klFOhop8MEw0u7toosdbHaj6IYxIHeQmswFBBE4kc2WmfgxDkOoEjoqncE tU2HyQOQgJl3TeT7+ZyUIibafEK0w5oosKu98y0pfEsFRWqeAKTQXLvQhunyy8f/hJvG yG9Su0KF4tWMJe9xtk8LyXbO/Jb/jL9sqGofNvafL708YHerQrF6xbg0bczbFnInSUcI n4J9AV0yACHxoMZpg4RJrp6QjGNlJtRaN/Z0MFEwdGuT59ZMMVRNcKYDVi3lR3lbxtWk I9Ag== X-Gm-Message-State: AElRT7Hf62Coo+R+QZJN0G+Sqoz8rnBenBGTwbwcvDc6yCO7+g32H4+l mAwMW5Vv8RbXVBIorrTaLenejJdWkAshzkz8kT7dug== X-Google-Smtp-Source: AG47ELvyhJyNsgh6PN2rtisZfL6LCdY7MhLJBxF6pjfp6YxtZrNJCW6C89sd9CIg3zmBzuTSsnZG8AAwgV4ZwGlPOGI= X-Received: by 10.46.7.26 with SMTP id 26mr229802ljh.122.1520642504472; Fri, 09 Mar 2018 16:41:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.216.232 with HTTP; Fri, 9 Mar 2018 16:41:43 -0800 (PST) In-Reply-To: <201801311436.w0VEaRrZ030839@repo.freebsd.org> References: <201801311436.w0VEaRrZ030839@repo.freebsd.org> From: Dexuan-BSD Cui Date: Fri, 9 Mar 2018 16:41:43 -0800 Message-ID: Subject: Re: svn commit: r328625 - in head/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl i386/i386 x86/include x86/x86 To: Konstantin Belousov , Dexuan Cui Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.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 Mar 2018 00:41:48 -0000 Hi, In my FreeBSD 11.1 VM, I'm getting this build failure and it looks this revision causes the failure: cc -target x86_64-unknown-freebsd12.0 --sysroot=/usr/obj/root/bsd.git/amd64.amd64/tmp -B/usr/obj/root/bsd.git/amd64.amd64/tmp/usr/bin -c -x assembler-with-cpp -DLOCORE -O2 -pipe -fno-strict-aliasing -g -nostdinc -I. -I/root/bsd.git/sys -I/root/bsd.git/sys/contrib/libfdt -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -MD -MF.depend.support.o -MTsupport.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-error-address-of-packed-member -mno-aes -mno-avx -std=iso9899:1999 -Werror /root/bsd.git/sys/amd64/amd64/support.S --- ptrace_machdep.o --- ctfconvert -L VERSION -g ptrace_machdep.o --- support.o --- /root/bsd.git/sys/amd64/amd64/support.S:855:2: error: unknown directive .altmacro ^ Should I upgrade my cc/as? [root@bsd11-39 ~/bsd.git]# cc --version FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0) Target: x86_64-unknown-freebsd11.1 Thread model: posix InstalledDir: /usr/bin [root@bsd11-39 ~/bsd.git]# as --version GNU assembler 2.17.50 [FreeBSD] 2007-07-03 Copyright 2007 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. This assembler was configured for a target of `x86_64-unknown-freebsd'. It looks -fno-integrated-as might fix the failure for me according to: https://stackoverflow.com/questions/47938599/unknown-directive-altmacro-error-happens-when-using-android-ndk-standalone-tool But when I tried: export CC="clang -no-integrated-as" make I got a different error: --- all_subdir_accf_data --- /tmp/accf_data-013c70.s: Assembler messages: /tmp/accf_data-013c70.s:33: Error: unknown pseudo-op: `.cfi_sections' clang: error: assembler command failed with exit code 1 (use -v to see invocation) *** [accf_data.o] Error code 1 Any insight? Thanks! -- Dexuan On Wed, Jan 31, 2018 at 6:36 AM, Konstantin Belousov wrote: > Author: kib > Date: Wed Jan 31 14:36:27 2018 > New Revision: 328625 > URL: https://svnweb.freebsd.org/changeset/base/328625 > > Log: > IBRS support, AKA Spectre hardware mitigation. > > It is coded according to the Intel document 336996-001, reading of the > patches posted on lkml, and some additional consultations with Intel. > > For existing processors, you need a microcode update which adds IBRS > CPU features, and to manually enable it by setting the tunable/sysctl > hw.ibrs_disable to 0. Current status can be checked in sysctl > hw.ibrs_active. The mitigation might be inactive if the CPU feature > is not patched in, or if CPU reports that IBRS use is not required, by > IA32_ARCH_CAP_IBRS_ALL bit. > > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D14029 > > Modified: > head/sys/amd64/amd64/exception.S > head/sys/amd64/amd64/genassym.c > head/sys/amd64/amd64/initcpu.c > head/sys/amd64/amd64/machdep.c > head/sys/amd64/amd64/support.S > head/sys/amd64/ia32/ia32_exception.S > head/sys/amd64/include/md_var.h > head/sys/amd64/include/pcpu.h > head/sys/dev/cpuctl/cpuctl.c > head/sys/i386/i386/support.s > head/sys/x86/include/specialreg.h > head/sys/x86/include/x86_var.h > head/sys/x86/x86/cpu_machdep.c > > Modified: head/sys/amd64/amd64/exception.S > ============================================================================== > --- head/sys/amd64/amd64/exception.S Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/amd64/amd64/exception.S Wed Jan 31 14:36:27 2018 (r328625) > @@ -171,21 +171,22 @@ X\l: > alltraps: > movq %rdi,TF_RDI(%rsp) > testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ > - jz alltraps_segs /* already running with kernel GS.base */ > + jz 1f /* already running with kernel GS.base */ > swapgs > movq PCPU(CURPCB),%rdi > andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) > -alltraps_segs: > - SAVE_SEGS > - testl $PSL_I,TF_RFLAGS(%rsp) > - jz alltraps_pushregs_no_rdi > - sti > -alltraps_pushregs_no_rdi: > +1: SAVE_SEGS > movq %rdx,TF_RDX(%rsp) > movq %rax,TF_RAX(%rsp) > + movq %rcx,TF_RCX(%rsp) > + testb $SEL_RPL_MASK,TF_CS(%rsp) > + jz 2f > + call handle_ibrs_entry > +2: testl $PSL_I,TF_RFLAGS(%rsp) > + jz alltraps_pushregs_no_rax > + sti > alltraps_pushregs_no_rax: > movq %rsi,TF_RSI(%rsp) > - movq %rcx,TF_RCX(%rsp) > movq %r8,TF_R8(%rsp) > movq %r9,TF_R9(%rsp) > movq %rbx,TF_RBX(%rsp) > @@ -243,13 +244,18 @@ calltrap: > alltraps_noen: > movq %rdi,TF_RDI(%rsp) > testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ > - jz alltraps_noen_segs /* already running with kernel GS.base */ > + jz 1f /* already running with kernel GS.base */ > swapgs > movq PCPU(CURPCB),%rdi > andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) > -alltraps_noen_segs: > - SAVE_SEGS > - jmp alltraps_pushregs_no_rdi > +1: SAVE_SEGS > + movq %rdx,TF_RDX(%rsp) > + movq %rax,TF_RAX(%rsp) > + movq %rcx,TF_RCX(%rsp) > + testb $SEL_RPL_MASK,TF_CS(%rsp) > + jz alltraps_pushregs_no_rax > + call handle_ibrs_entry > + jmp alltraps_pushregs_no_rax > > IDTVEC(dblfault) > subq $TF_ERR,%rsp > @@ -301,12 +307,14 @@ IDTVEC(page_pti) > movq %rdi,TF_RDI(%rsp) > movq %rax,TF_RAX(%rsp) > movq %rdx,TF_RDX(%rsp) > + movq %rcx,TF_RCX(%rsp) > jmp page_u > IDTVEC(page) > subq $TF_ERR,%rsp > movq %rdi,TF_RDI(%rsp) /* free up GP registers */ > movq %rax,TF_RAX(%rsp) > movq %rdx,TF_RDX(%rsp) > + movq %rcx,TF_RCX(%rsp) > testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ > jz page_cr2 /* already running with kernel GS.base */ > swapgs > @@ -314,6 +322,7 @@ page_u: movq PCPU(CURPCB),%rdi > andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) > movq PCPU(SAVED_UCR3),%rax > movq %rax,PCB_SAVED_UCR3(%rdi) > + call handle_ibrs_entry > page_cr2: > movq %cr2,%rdi /* preserve %cr2 before .. */ > movq %rdi,TF_ADDR(%rsp) /* enabling interrupts. */ > @@ -371,6 +380,7 @@ prot_addrf: > movq %rdi,TF_RDI(%rsp) /* free up a GP register */ > movq %rax,TF_RAX(%rsp) > movq %rdx,TF_RDX(%rsp) > + movq %rcx,TF_RCX(%rsp) > movw %fs,TF_FS(%rsp) > movw %gs,TF_GS(%rsp) > leaq doreti_iret(%rip),%rdi > @@ -396,7 +406,8 @@ prot_addrf: > 3: cmpw $KUG32SEL,TF_GS(%rsp) > jne 4f > movq %rdx,PCB_GSBASE(%rdi) > -4: orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) /* always full iret from GPF */ > +4: call handle_ibrs_entry > + orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) /* always full iret from GPF */ > movw %es,TF_ES(%rsp) > movw %ds,TF_DS(%rsp) > testl $PSL_I,TF_RFLAGS(%rsp) > @@ -440,7 +451,9 @@ fast_syscall_common: > movq %r11,TF_RSP(%rsp) /* user stack pointer */ > movq PCPU(SCRATCH_RAX),%rax > movq %rax,TF_RAX(%rsp) /* syscall number */ > + movq %rdx,TF_RDX(%rsp) /* arg 3 */ > SAVE_SEGS > + call handle_ibrs_entry > movq PCPU(CURPCB),%r11 > andl $~PCB_FULL_IRET,PCB_FLAGS(%r11) > sti > @@ -449,7 +462,6 @@ fast_syscall_common: > movq $2,TF_ERR(%rsp) > movq %rdi,TF_RDI(%rsp) /* arg 1 */ > movq %rsi,TF_RSI(%rsp) /* arg 2 */ > - movq %rdx,TF_RDX(%rsp) /* arg 3 */ > movq %r10,TF_RCX(%rsp) /* arg 4 */ > movq %r8,TF_R8(%rsp) /* arg 5 */ > movq %r9,TF_R9(%rsp) /* arg 6 */ > @@ -475,6 +487,7 @@ fast_syscall_common: > movq PCPU(CURTHREAD),%rax > testl $TDF_ASTPENDING | TDF_NEEDRESCHED,TD_FLAGS(%rax) > jne 3f > + call handle_ibrs_exit > /* Restore preserved registers. */ > MEXITCOUNT > movq TF_RDI(%rsp),%rdi /* bonus; preserve arg 1 */ > @@ -561,8 +574,8 @@ IDTVEC(nmi) > testb $SEL_RPL_MASK,TF_CS(%rsp) > jnz nmi_fromuserspace > /* > - * We've interrupted the kernel. Preserve GS.base in %r12 > - * and %cr3 in %r13. > + * We've interrupted the kernel. Preserve GS.base in %r12, > + * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d. > */ > movl $MSR_GSBASE,%ecx > rdmsr > @@ -577,8 +590,14 @@ IDTVEC(nmi) > movq %cr3,%r13 > movq PCPU(KCR3),%rax > cmpq $~0,%rax > - je nmi_calltrap > + je 1f > movq %rax,%cr3 > +1: testl $CPUID_STDEXT3_IBPB,cpu_stdext_feature3(%rip) > + je nmi_calltrap > + movl $MSR_IA32_SPEC_CTRL,%ecx > + rdmsr > + movl %eax,%r14d > + call handle_ibrs_entry > jmp nmi_calltrap > nmi_fromuserspace: > incl %ebx > @@ -588,7 +607,8 @@ nmi_fromuserspace: > cmpq $~0,%rax > je 1f > movq %rax,%cr3 > -1: movq PCPU(CURPCB),%rdi > +1: call handle_ibrs_entry > + movq PCPU(CURPCB),%rdi > testq %rdi,%rdi > jz 3f > orl $PCB_FULL_IRET,PCB_FLAGS(%rdi) > @@ -683,9 +703,18 @@ nocallchain: > testl %ebx,%ebx /* %ebx == 0 => return to userland */ > jnz doreti_exit > /* > + * Restore speculation control MSR, if preserved. > + */ > + testl $CPUID_STDEXT3_IBPB,cpu_stdext_feature3(%rip) > + je 1f > + movl %r14d,%eax > + xorl %edx,%edx > + movl $MSR_IA32_SPEC_CTRL,%ecx > + wrmsr > + /* > * Put back the preserved MSR_GSBASE value. > */ > - movl $MSR_GSBASE,%ecx > +1: movl $MSR_GSBASE,%ecx > movq %r12,%rdx > movl %edx,%eax > shrq $32,%rdx > @@ -743,8 +772,8 @@ IDTVEC(mchk) > testb $SEL_RPL_MASK,TF_CS(%rsp) > jnz mchk_fromuserspace > /* > - * We've interrupted the kernel. Preserve GS.base in %r12 > - * and %cr3 in %r13. > + * We've interrupted the kernel. Preserve GS.base in %r12, > + * %cr3 in %r13, and possibly lower half of MSR_IA32_SPEC_CTL in %r14d. > */ > movl $MSR_GSBASE,%ecx > rdmsr > @@ -759,8 +788,14 @@ IDTVEC(mchk) > movq %cr3,%r13 > movq PCPU(KCR3),%rax > cmpq $~0,%rax > - je mchk_calltrap > + je 1f > movq %rax,%cr3 > +1: testl $CPUID_STDEXT3_IBPB,cpu_stdext_feature3(%rip) > + je mchk_calltrap > + movl $MSR_IA32_SPEC_CTRL,%ecx > + rdmsr > + movl %eax,%r14d > + call handle_ibrs_entry > jmp mchk_calltrap > mchk_fromuserspace: > incl %ebx > @@ -770,7 +805,7 @@ mchk_fromuserspace: > cmpq $~0,%rax > je 1f > movq %rax,%cr3 > -1: > +1: call handle_ibrs_entry > /* Note: this label is also used by ddb and gdb: */ > mchk_calltrap: > FAKE_MCOUNT(TF_RIP(%rsp)) > @@ -780,9 +815,18 @@ mchk_calltrap: > testl %ebx,%ebx /* %ebx == 0 => return to userland */ > jnz doreti_exit > /* > + * Restore speculation control MSR, if preserved. > + */ > + testl $CPUID_STDEXT3_IBPB,cpu_stdext_feature3(%rip) > + je 1f > + movl %r14d,%eax > + xorl %edx,%edx > + movl $MSR_IA32_SPEC_CTRL,%ecx > + wrmsr > + /* > * Put back the preserved MSR_GSBASE value. > */ > - movl $MSR_GSBASE,%ecx > +1: movl $MSR_GSBASE,%ecx > movq %r12,%rdx > movl %edx,%eax > shrq $32,%rdx > @@ -960,6 +1004,7 @@ ld_regs: > testb $SEL_RPL_MASK,TF_CS(%rsp) /* Did we come from kernel? */ > jz 2f /* keep running with kernel GS.base */ > cli > + call handle_ibrs_exit_rs > cmpb $0,pti > je 1f > pushq %rdx > @@ -1011,6 +1056,10 @@ set_segs: > .globl doreti_iret_fault > doreti_iret_fault: > subq $TF_RIP,%rsp /* space including tf_err, tf_trapno */ > + movq %rax,TF_RAX(%rsp) > + movq %rdx,TF_RDX(%rsp) > + movq %rcx,TF_RCX(%rsp) > + call handle_ibrs_entry > testb $SEL_RPL_MASK,TF_CS(%rsp) > jz 1f > sti > @@ -1019,11 +1068,8 @@ doreti_iret_fault: > movl $TF_HASSEGS,TF_FLAGS(%rsp) > movq %rdi,TF_RDI(%rsp) > movq %rsi,TF_RSI(%rsp) > - movq %rdx,TF_RDX(%rsp) > - movq %rcx,TF_RCX(%rsp) > movq %r8,TF_R8(%rsp) > movq %r9,TF_R9(%rsp) > - movq %rax,TF_RAX(%rsp) > movq %rbx,TF_RBX(%rsp) > movq %rbp,TF_RBP(%rsp) > movq %r10,TF_R10(%rsp) > > Modified: head/sys/amd64/amd64/genassym.c > ============================================================================== > --- head/sys/amd64/amd64/genassym.c Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/amd64/amd64/genassym.c Wed Jan 31 14:36:27 2018 (r328625) > @@ -228,6 +228,7 @@ ASSYM(PC_UCR3, offsetof(struct pcpu, pc_ucr3)); > ASSYM(PC_SAVED_UCR3, offsetof(struct pcpu, pc_saved_ucr3)); > ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack)); > ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ); > +ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set)); > > ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); > ASSYM(LA_ISR, LAPIC_ISR0 * LAPIC_MEM_MUL); > > Modified: head/sys/amd64/amd64/initcpu.c > ============================================================================== > --- head/sys/amd64/amd64/initcpu.c Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/amd64/amd64/initcpu.c Wed Jan 31 14:36:27 2018 (r328625) > @@ -223,6 +223,7 @@ initializecpu(void) > wrmsr(MSR_EFER, msr); > pg_nx = PG_NX; > } > + hw_ibrs_recalculate(); > switch (cpu_vendor_id) { > case CPU_VENDOR_AMD: > init_amd(); > > Modified: head/sys/amd64/amd64/machdep.c > ============================================================================== > --- head/sys/amd64/amd64/machdep.c Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/amd64/amd64/machdep.c Wed Jan 31 14:36:27 2018 (r328625) > @@ -1826,6 +1826,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) > #endif > thread0.td_critnest = 0; > > + TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable); > + > TSEXIT(); > > /* Location of kernel stack for locore */ > > Modified: head/sys/amd64/amd64/support.S > ============================================================================== > --- head/sys/amd64/amd64/support.S Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/amd64/amd64/support.S Wed Jan 31 14:36:27 2018 (r328625) > @@ -33,6 +33,7 @@ > #include "opt_ddb.h" > > #include > +#include > #include > > #include "assym.s" > @@ -850,3 +851,67 @@ ENTRY(pmap_pti_pcid_invlrng) > movq %rsi,%cr3 /* back to kernel */ > popfq > retq > + > + .altmacro > + .macro ibrs_seq_label l > +handle_ibrs_\l: > + .endm > + .macro ibrs_call_label l > + call handle_ibrs_\l > + .endm > + .macro ibrs_seq count > + ll=1 > + .rept \count > + ibrs_call_label %(ll) > + nop > + ibrs_seq_label %(ll) > + addq $8,%rsp > + ll=ll+1 > + .endr > + .endm > + > +/* all callers already saved %rax, %rdx, and %rcx */ > +ENTRY(handle_ibrs_entry) > + cmpb $0,hw_ibrs_active(%rip) > + je 1f > + movl $MSR_IA32_SPEC_CTRL,%ecx > + movl $IA32_SPEC_CTRL_IBRS,%eax > + movl $IA32_SPEC_CTRL_IBRS>>32,%edx > + wrmsr > + movb $1,PCPU(IBPB_SET) > + testl $CPUID_STDEXT_SMEP,cpu_stdext_feature(%rip) > + jne 1f > + ibrs_seq 32 > +1: ret > +END(handle_ibrs_entry) > + > +ENTRY(handle_ibrs_exit) > + cmpb $0,PCPU(IBPB_SET) > + je 1f > + movl $MSR_IA32_SPEC_CTRL,%ecx > + xorl %eax,%eax > + xorl %edx,%edx > + wrmsr > + movb $0,PCPU(IBPB_SET) > +1: ret > +END(handle_ibrs_exit) > + > +/* registers-neutral version, but needs stack */ > +ENTRY(handle_ibrs_exit_rs) > + cmpb $0,PCPU(IBPB_SET) > + je 1f > + pushq %rax > + pushq %rdx > + pushq %rcx > + movl $MSR_IA32_SPEC_CTRL,%ecx > + xorl %eax,%eax > + xorl %edx,%edx > + wrmsr > + popq %rcx > + popq %rdx > + popq %rax > + movb $0,PCPU(IBPB_SET) > +1: ret > +END(handle_ibrs_exit_rs) > + > + .noaltmacro > > Modified: head/sys/amd64/ia32/ia32_exception.S > ============================================================================== > --- head/sys/amd64/ia32/ia32_exception.S Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/amd64/ia32/ia32_exception.S Wed Jan 31 14:36:27 2018 (r328625) > @@ -53,13 +53,14 @@ int0x80_syscall_common: > movq PCPU(CURPCB),%rdi > andl $~PCB_FULL_IRET,PCB_FLAGS(%rdi) > SAVE_SEGS > - sti > - movq %rsi,TF_RSI(%rsp) > + movq %rax,TF_RAX(%rsp) > movq %rdx,TF_RDX(%rsp) > movq %rcx,TF_RCX(%rsp) > + call handle_ibrs_entry > + sti > + movq %rsi,TF_RSI(%rsp) > movq %r8,TF_R8(%rsp) > movq %r9,TF_R9(%rsp) > - movq %rax,TF_RAX(%rsp) > movq %rbx,TF_RBX(%rsp) > movq %rbp,TF_RBP(%rsp) > movq %r10,TF_R10(%rsp) > > Modified: head/sys/amd64/include/md_var.h > ============================================================================== > --- head/sys/amd64/include/md_var.h Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/amd64/include/md_var.h Wed Jan 31 14:36:27 2018 (r328625) > @@ -38,6 +38,7 @@ > > extern uint64_t *vm_page_dump; > extern int hw_lower_amd64_sharedpage; > +extern int hw_ibrs_disable; > > /* > * The file "conf/ldscript.amd64" defines the symbol "kernphys". Its > > Modified: head/sys/amd64/include/pcpu.h > ============================================================================== > --- head/sys/amd64/include/pcpu.h Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/amd64/include/pcpu.h Wed Jan 31 14:36:27 2018 (r328625) > @@ -74,7 +74,8 @@ > uint32_t pc_pcid_next; \ > uint32_t pc_pcid_gen; \ > uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ > - char __pad[224] /* be divisor of PAGE_SIZE \ > + uint32_t pc_ibpb_set; \ > + char __pad[216] /* be divisor of PAGE_SIZE \ > after cache alignment */ > > #define PC_DBREG_CMD_NONE 0 > > Modified: head/sys/dev/cpuctl/cpuctl.c > ============================================================================== > --- head/sys/dev/cpuctl/cpuctl.c Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/dev/cpuctl/cpuctl.c Wed Jan 31 14:36:27 2018 (r328625) > @@ -527,6 +527,7 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td > set_cpu(cpu, td); > identify_cpu1(); > identify_cpu2(); > + hw_ibrs_recalculate(); > restore_cpu(oldcpu, is_bound, td); > printcpuinfo(); > return (0); > > Modified: head/sys/i386/i386/support.s > ============================================================================== > --- head/sys/i386/i386/support.s Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/i386/i386/support.s Wed Jan 31 14:36:27 2018 (r328625) > @@ -827,3 +827,11 @@ msr_onfault: > movl $0,PCB_ONFAULT(%ecx) > movl $EFAULT,%eax > ret > + > +ENTRY(handle_ibrs_entry) > + ret > +END(handle_ibrs_entry) > + > +ENTRY(handle_ibrs_exit) > + ret > +END(handle_ibrs_exit) > > Modified: head/sys/x86/include/specialreg.h > ============================================================================== > --- head/sys/x86/include/specialreg.h Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/x86/include/specialreg.h Wed Jan 31 14:36:27 2018 (r328625) > @@ -697,6 +697,10 @@ > #define IA32_MISC_EN_xTPRD 0x0000000000800000ULL > #define IA32_MISC_EN_XDD 0x0000000400000000ULL > > +/* > + * IA32_SPEC_CTRL and IA32_PRED_CMD MSRs are described in the Intel' > + * document 336996-001 Speculative Execution Side Channel Mitigations. > + */ > /* MSR IA32_SPEC_CTRL */ > #define IA32_SPEC_CTRL_IBRS 0x0000000000000001ULL > #define IA32_SPEC_CTRL_STIBP 0x0000000000000002ULL > > Modified: head/sys/x86/include/x86_var.h > ============================================================================== > --- head/sys/x86/include/x86_var.h Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/x86/include/x86_var.h Wed Jan 31 14:36:27 2018 (r328625) > @@ -131,6 +131,9 @@ bool fix_cpuid(void); > void fillw(int /*u_short*/ pat, void *base, size_t cnt); > int is_physical_memory(vm_paddr_t addr); > int isa_nmi(int cd); > +void handle_ibrs_entry(void); > +void handle_ibrs_exit(void); > +void hw_ibrs_recalculate(void); > void nmi_call_kdb(u_int cpu, u_int type, struct trapframe *frame); > void nmi_call_kdb_smp(u_int type, struct trapframe *frame); > void nmi_handle_intr(u_int type, struct trapframe *frame); > > Modified: head/sys/x86/x86/cpu_machdep.c > ============================================================================== > --- head/sys/x86/x86/cpu_machdep.c Wed Jan 31 14:25:42 2018 (r328624) > +++ head/sys/x86/x86/cpu_machdep.c Wed Jan 31 14:36:27 2018 (r328625) > @@ -142,6 +142,12 @@ acpi_cpu_idle_mwait(uint32_t mwait_hint) > int *state; > > /* > + * A comment in Linux patch claims that 'CPUs run faster with > + * speculation protection disabled. All CPU threads in a core > + * must disable speculation protection for it to be > + * disabled. Disable it while we are idle so the other > + * hyperthread can run fast.' > + * > * XXXKIB. Software coordination mode should be supported, > * but all Intel CPUs provide hardware coordination. > */ > @@ -150,9 +156,11 @@ acpi_cpu_idle_mwait(uint32_t mwait_hint) > KASSERT(*state == STATE_SLEEPING, > ("cpu_mwait_cx: wrong monitorbuf state")); > *state = STATE_MWAIT; > + handle_ibrs_entry(); > cpu_monitor(state, 0, 0); > if (*state == STATE_MWAIT) > cpu_mwait(MWAIT_INTRBREAK, mwait_hint); > + handle_ibrs_exit(); > > /* > * We should exit on any event that interrupts mwait, because > @@ -569,3 +577,47 @@ nmi_handle_intr(u_int type, struct trapframe *frame) > nmi_call_kdb(PCPU_GET(cpuid), type, frame); > #endif > } > + > +int hw_ibrs_active; > +int hw_ibrs_disable = 1; > + > +SYSCTL_INT(_hw, OID_AUTO, ibrs_active, CTLFLAG_RD, &hw_ibrs_active, 0, > + "IBRS active"); > + > +void > +hw_ibrs_recalculate(void) > +{ > + uint64_t v; > + > + if ((cpu_ia32_arch_caps & IA32_ARCH_CAP_IBRS_ALL) != 0) { > + if (hw_ibrs_disable) { > + v= rdmsr(MSR_IA32_SPEC_CTRL); > + v &= ~IA32_SPEC_CTRL_IBRS; > + wrmsr(MSR_IA32_SPEC_CTRL, v); > + } else { > + v= rdmsr(MSR_IA32_SPEC_CTRL); > + v |= IA32_SPEC_CTRL_IBRS; > + wrmsr(MSR_IA32_SPEC_CTRL, v); > + } > + return; > + } > + hw_ibrs_active = (cpu_stdext_feature3 & CPUID_STDEXT3_IBPB) != 0 && > + !hw_ibrs_disable; > +} > + > +static int > +hw_ibrs_disable_handler(SYSCTL_HANDLER_ARGS) > +{ > + int error, val; > + > + val = hw_ibrs_disable; > + error = sysctl_handle_int(oidp, &val, 0, req); > + if (error != 0 || req->newptr == NULL) > + return (error); > + hw_ibrs_disable = val != 0; > + hw_ibrs_recalculate(); > + return (0); > +} > +SYSCTL_PROC(_hw, OID_AUTO, ibrs_disable, CTLTYPE_INT | CTLFLAG_RWTUN | > + CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, NULL, 0, hw_ibrs_disable_handler, "I", > + "Disable IBRS"); > From owner-svn-src-head@freebsd.org Sat Mar 10 00:59: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 A436BF36EEA; Sat, 10 Mar 2018 00:59:49 +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 4FB6276E57; Sat, 10 Mar 2018 00:59:49 +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 46638267E6; Sat, 10 Mar 2018 00:59:49 +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 w2A0xnWv033609; Sat, 10 Mar 2018 00:59:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A0xnax033608; Sat, 10 Mar 2018 00:59:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803100059.w2A0xnax033608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Mar 2018 00:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330714 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 330714 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 00:59:49 -0000 Author: cem Date: Sat Mar 10 00:59:48 2018 New Revision: 330714 URL: https://svnweb.freebsd.org/changeset/base/330714 Log: mlx5(4): Remove redundant declaration of mlx5_enter_error_state Broken in r330644. Sponsored by: Dell EMC Isilon Modified: head/sys/dev/mlx5/driver.h Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Sat Mar 10 00:44:33 2018 (r330713) +++ head/sys/dev/mlx5/driver.h Sat Mar 10 00:59:48 2018 (r330714) @@ -865,7 +865,6 @@ static inline u32 mlx5_base_mkey(const u32 key) return key & 0xffffff00u; } -void mlx5_enter_error_state(struct mlx5_core_dev *dev); int mlx5_cmd_init(struct mlx5_core_dev *dev); void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); void mlx5_cmd_use_events(struct mlx5_core_dev *dev); From owner-svn-src-head@freebsd.org Sat Mar 10 01:01: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 05C88F371DC; Sat, 10 Mar 2018 01:01:02 +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 ABF367703C; Sat, 10 Mar 2018 01:01:01 +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 A6DD726806; Sat, 10 Mar 2018 01:01:01 +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 w2A111Js034441; Sat, 10 Mar 2018 01:01:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A1116E034440; Sat, 10 Mar 2018 01:01:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803100101.w2A1116E034440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Mar 2018 01:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330715 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330715 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:01:02 -0000 Author: cem Date: Sat Mar 10 01:01:01 2018 New Revision: 330715 URL: https://svnweb.freebsd.org/changeset/base/330715 Log: subr_gtaskqueue: Fix minor leak of tq_name in error case Reported by: cppcheck Sponsored by: Dell EMC Isilon Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Sat Mar 10 00:59:48 2018 (r330714) +++ head/sys/kern/subr_gtaskqueue.c Sat Mar 10 01:01:01 2018 (r330715) @@ -134,8 +134,10 @@ _gtaskqueue_create(const char *name, int mflags, snprintf(tq_name, TASKQUEUE_NAMELEN, "%s", (name) ? name : "taskqueue"); queue = malloc(sizeof(struct gtaskqueue), M_GTASKQUEUE, mflags | M_ZERO); - if (!queue) + if (!queue) { + free(queue->tq_name, M_GTASKQUEUE); return (NULL); + } STAILQ_INIT(&queue->tq_queue); TAILQ_INIT(&queue->tq_active); From owner-svn-src-head@freebsd.org Sat Mar 10 01:07: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 7AA47F377CA; Sat, 10 Mar 2018 01:07:31 +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 308C377797; Sat, 10 Mar 2018 01:07:31 +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 1354B269A3; Sat, 10 Mar 2018 01:07:31 +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 w2A17Uvc038432; Sat, 10 Mar 2018 01:07:30 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A17UQT038431; Sat, 10 Mar 2018 01:07:30 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201803100107.w2A17UQT038431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 10 Mar 2018 01:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330716 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 330716 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:07:31 -0000 Author: brooks Date: Sat Mar 10 01:07:30 2018 New Revision: 330716 URL: https://svnweb.freebsd.org/changeset/base/330716 Log: Remove obsolete dataacq.h. Nothing includes this file, lists it in a Makefile, or uses any of the ioctl definitions. Deleted: head/sys/sys/dataacq.h From owner-svn-src-head@freebsd.org Sat Mar 10 01:28: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 D3DAFF396B6; Sat, 10 Mar 2018 01:28:55 +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 81C3B78AEF; Sat, 10 Mar 2018 01:28:55 +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 7CAC426D4C; Sat, 10 Mar 2018 01:28:55 +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 w2A1StNw048969; Sat, 10 Mar 2018 01:28:55 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A1StTF048968; Sat, 10 Mar 2018 01:28:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803100128.w2A1StTF048968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Mar 2018 01:28:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330717 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 330717 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:28:56 -0000 Author: cem Date: Sat Mar 10 01:28:55 2018 New Revision: 330717 URL: https://svnweb.freebsd.org/changeset/base/330717 Log: nvme_da: Fix minor memory leak in error case Reported by: cppcheck Sponsored by: Dell EMC Isilon Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Sat Mar 10 01:07:30 2018 (r330716) +++ head/sys/cam/nvme/nvme_da.c Sat Mar 10 01:28:55 2018 (r330717) @@ -695,6 +695,7 @@ ndaregister(struct cam_periph *periph, void *arg) if (cam_iosched_init(&softc->cam_iosched, periph) != 0) { printf("ndaregister: Unable to probe new device. " "Unable to allocate iosched memory\n"); + free(softc, M_DEVBUF); return(CAM_REQ_CMP_ERR); } From owner-svn-src-head@freebsd.org Sat Mar 10 01:31: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 D9C2FF39B35; Sat, 10 Mar 2018 01:31:49 +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 614D878F2E; Sat, 10 Mar 2018 01:31:49 +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 453BA10AC13; Fri, 9 Mar 2018 20:31:48 -0500 (EST) From: John Baldwin To: Bruce Evans Cc: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330338 - head/sys/amd64/amd64 Date: Fri, 09 Mar 2018 15:33:37 -0800 Message-ID: <1997852.rATkjh2guz@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <20180310070452.P5919@besplex.bde.org> References: <201803031510.w23FAbeC065867@repo.freebsd.org> <2557369.6nFzd3kAUm@ralph.baldwin.cx> <20180310070452.P5919@besplex.bde.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 Mar 2018 20:31:48 -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: Sat, 10 Mar 2018 01:31:50 -0000 On Saturday, March 10, 2018 07:41:30 AM Bruce Evans wrote: > On Fri, 9 Mar 2018, John Baldwin wrote: > > > On Saturday, March 03, 2018 03:10:37 PM Andriy Gapon wrote: > >> Author: avg > >> Date: Sat Mar 3 15:10:37 2018 > >> New Revision: 330338 > >> URL: https://svnweb.freebsd.org/changeset/base/330338 > >> > >> Log: > >> db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common > >> > >> Since that change the system call stack traces look like this: > >> ... > >> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe0028e13ac0 > >> amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe0028e13bf0 > >> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0028e13bf0 > >> So, db_nextframe() stopped recognizing the system call frame. > >> This commit should fix that. > >> > >> Reviewed by: kib > >> MFC after: 4 days > >> > >> Modified: > >> head/sys/amd64/amd64/db_trace.c > >> > >> Modified: head/sys/amd64/amd64/db_trace.c > >> ============================================================================== > >> --- head/sys/amd64/amd64/db_trace.c Sat Mar 3 13:20:44 2018 (r330337) > >> +++ head/sys/amd64/amd64/db_trace.c Sat Mar 3 15:10:37 2018 (r330338) > >> @@ -212,7 +212,9 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s > >> strcmp(name, "Xcpususpend") == 0 || > >> strcmp(name, "Xrendezvous") == 0) > >> frame_type = INTERRUPT; > >> - else if (strcmp(name, "Xfast_syscall") == 0) > >> + else if (strcmp(name, "Xfast_syscall") == 0 || > >> + strcmp(name, "Xfast_syscall_pti") == 0 || > >> + strcmp(name, "fast_syscall_common") == 0) > >> frame_type = SYSCALL; > > > > I think you actually just want to replace Xfast_syscall with > > fast_syscall_common. Neither Xfast_syscall nor Xfast_syscall_pti call any > > functions before jumping to the common label, so when unwinding from a system > > call you should always get the common label. (That is, I think we should > > remove Xfast_syscall and Xfast_syscall_pti here. Any stack trace that > > happens to find those symbols during unwinding won't have a valid SYSCALL > > frame to unwind.) > > No, it needs these symbols to decode the frame after reaching a point where > the frame is actually set up. My point is that during the instructions from Xfast_syscall to fast_syscall_common there isn't a valid frame. Xfast_syscall has two instructions and hasn't yet decremented %rsp to create room for the trapframe for example. If you wanted to handle the special case of stepping through those functions you'd have to create a new type of frame that used register values from the saved frame for the debug trap. You can't assume that there's a 'struct trapframe' at 'rbp + 16'. > Also, in uncommitted fixes I add some decoding of the non-frame between > the entry point and when the frame is set up. Then the frame register > is still the user's for the syscall case, so should not even be accessed. > The i386 output looks like this: > > current: > XX12: Breakpoint at Xint0x80_syscall: pushl $0x2 > XX12: db> t > XX12: Tracing pid 1 tid 100001 td 0xc6fad000 > XX12: Xint0x80_syscall(33,282,bfbfee0c,3b,0,...) at Xint0x80_syscall/frame 0xd1d05bd8 > XX12: kernload(2,bfbfeec4,bfbfeed0,804812b,80a3d64,...) at 0x805188f/frame 0xbfbfee7c > > fixed: > XX12F: Breakpoint at Xint0x80_syscall: pushl $0x2 > XX12F: db> t > XX12F: Tracing pid 1 tid 100001 td 0xd4c23000 > XX12F: Xint0x80_syscall(2,bfbfeec4,bfbfeed0,804812b,80a3d64,...) at Xint0x80_syscall/frame 0xbfbfee7c > XX12F: --- unknown trap, ebp = 0xbfbfee7c, sp = 0xd3399bdc, ks = 0xd3398000, kse = 0xd339a000 --- > > where most of the values on the last line are for debugging (ebp is the user > stack pointer which will become inaccessible, sp is the local variable sp > and [ks, kse - 1] is the thread's kernel stack range (sp must be in this > else the backtrace stops). Yes, both of these symbols would only be found instructions for this type of special frame. Using the 'SYSCALL' frame type for the Xfast_syscall* symbols would always be wrong. Until such time as we have the new frame type we should just ignore them. > Jumps and labels with names inside functions complicate things. I think > fast_syscall_common needs to be in the list too, and the many alltraps > labels should have been there. This will be more useful with my fix. > The label calltrap has always been in the list. This works right since > the frame has been set up then -- IIRC it is the first place where the > frame has been set up, and label it more for gdb than for ddb, and decode > the frame for ddb (presumably gdb decodes the frame too). gdb does depend on the names, and I was looking at this commit again to see if I needed to update gdb. I thought I didn't, but now I see that gdb was depending on the 'X' prefix for the old Xfast_syscall name and it now needs to check for fast_syscall_common directly. -- John Baldwin From owner-svn-src-head@freebsd.org Sat Mar 10 01:35: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 E2AF8F3A032; Sat, 10 Mar 2018 01:35:26 +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 910E279197; Sat, 10 Mar 2018 01:35:26 +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 8AE4826EDC; Sat, 10 Mar 2018 01:35:26 +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 w2A1ZQ5u053987; Sat, 10 Mar 2018 01:35:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A1ZQTt053985; Sat, 10 Mar 2018 01:35:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803100135.w2A1ZQTt053985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 10 Mar 2018 01:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330718 - in head/libexec/tftpd: . tests X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/libexec/tftpd: . tests X-SVN-Commit-Revision: 330718 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:35:27 -0000 Author: asomers Date: Sat Mar 10 01:35:26 2018 New Revision: 330718 URL: https://svnweb.freebsd.org/changeset/base/330718 Log: tftpd: Verify world-writability for WRQ when using relative paths tftpd(8) says that files may only be written if they already exist and are publicly writable. tftpd.c verifies that a file is publicly writable if it uses an absolute pathname. However, if the pathname is relative, that check is skipped. Fix it. Note that this is not a security vulnerability, because the transfer ultimately doesn't work unless the file already exists and is owned by user nobody. Also, this bug does not affect the default configuration, because the default uses the "-s" option which makes all pathnames absolute. PR: 226004 MFC after: 3 weeks Modified: head/libexec/tftpd/tests/functional.c head/libexec/tftpd/tftpd.c Modified: head/libexec/tftpd/tests/functional.c ============================================================================== --- head/libexec/tftpd/tests/functional.c Sat Mar 10 01:28:55 2018 (r330717) +++ head/libexec/tftpd/tests/functional.c Sat Mar 10 01:35:26 2018 (r330718) @@ -350,6 +350,10 @@ setup(struct sockaddr_storage *to, uint16_t idx) ATF_REQUIRE((client_s = socket(protocol, SOCK_DGRAM, 0)) > 0); break; } + + /* Clear the client's umask. Test cases will specify exact modes */ + umask(0000); + return (client_s); } @@ -714,7 +718,7 @@ TFTPD_TC_DEFINE(wrq_dropped_ack,) for (i = 0; i < nitems(contents); i++) contents[i] = i; - fd = open("medium.txt", O_RDWR | O_CREAT, 0644); + fd = open("medium.txt", O_RDWR | O_CREAT, 0666); ATF_REQUIRE(fd >= 0); close(fd); @@ -747,7 +751,7 @@ TFTPD_TC_DEFINE(wrq_dropped_data,) size_t contents_len; char buffer[1024]; - fd = open("small.txt", O_RDWR | O_CREAT, 0644); + fd = open("small.txt", O_RDWR | O_CREAT, 0666); ATF_REQUIRE(fd >= 0); close(fd); contents_len = strlen(contents) + 1; @@ -782,7 +786,7 @@ TFTPD_TC_DEFINE(wrq_duped_data,) for (i = 0; i < nitems(contents); i++) contents[i] = i; - fd = open("medium.txt", O_RDWR | O_CREAT, 0644); + fd = open("medium.txt", O_RDWR | O_CREAT, 0666); ATF_REQUIRE(fd >= 0); close(fd); @@ -831,7 +835,8 @@ TFTPD_TC_DEFINE(wrq_eaccess_world_readable,) close(fd); SEND_WRQ("empty.txt", "octet"); - atf_tc_expect_fail("PR 226004 with relative pathnames, tftpd doesn't validate world writability"); + atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access " + "violation"); RECV_ERROR(2, "Access violation"); } Modified: head/libexec/tftpd/tftpd.c ============================================================================== --- head/libexec/tftpd/tftpd.c Sat Mar 10 01:28:55 2018 (r330717) +++ head/libexec/tftpd/tftpd.c Sat Mar 10 01:35:26 2018 (r330718) @@ -743,8 +743,12 @@ validate_access(int peer, char **filep, int mode) dirp->name, filename); if (stat(pathname, &stbuf) == 0 && (stbuf.st_mode & S_IFMT) == S_IFREG) { - if ((stbuf.st_mode & S_IROTH) != 0) { - break; + if (mode == RRQ) { + if ((stbuf.st_mode & S_IROTH) != 0) + break; + } else { + if ((stbuf.st_mode & S_IWOTH) != 0) + break; } err = EACCESS; } @@ -752,6 +756,8 @@ validate_access(int peer, char **filep, int mode) if (dirp->name != NULL) *filep = filename = pathname; else if (mode == RRQ) + return (err); + else if (err != ENOTFOUND || !create_new) return (err); } From owner-svn-src-head@freebsd.org Sat Mar 10 01:43: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 7EDFFF3AD8E; Sat, 10 Mar 2018 01:43:56 +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 31C677995B; Sat, 10 Mar 2018 01:43: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 2CB8727078; Sat, 10 Mar 2018 01:43: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 w2A1huUB059015; Sat, 10 Mar 2018 01:43:56 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A1htCx059013; Sat, 10 Mar 2018 01:43:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803100143.w2A1htCx059013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 10 Mar 2018 01:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330719 - in head/libexec/tftpd: . tests X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/libexec/tftpd: . tests X-SVN-Commit-Revision: 330719 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:43:56 -0000 Author: asomers Date: Sat Mar 10 01:43:55 2018 New Revision: 330719 URL: https://svnweb.freebsd.org/changeset/base/330719 Log: tftpd: Abort on an WRQ access violation On a WRQ (write request) tftpd checks whether the client has access permission for the file in question. If not, then the write is prevented. However, tftpd doesn't reply with an ERROR packet, nor does it abort. Instead, it tries to receive the packet anyway. The symptom is slightly different depending on the nature of the error. If the target file is nonexistent and tftpd lacks permission to create it, then tftpd will willingly receive the file, but not write it anywhere. If the file exists but is not writable, then tftpd will fail to ACK to WRQ. PR: 225996 MFC after: 3 weeks Modified: head/libexec/tftpd/tests/functional.c head/libexec/tftpd/tftpd.c Modified: head/libexec/tftpd/tests/functional.c ============================================================================== --- head/libexec/tftpd/tests/functional.c Sat Mar 10 01:35:26 2018 (r330718) +++ head/libexec/tftpd/tests/functional.c Sat Mar 10 01:43:55 2018 (r330719) @@ -817,8 +817,6 @@ TFTPD_TC_DEFINE(wrq_eaccess,) close(fd); SEND_WRQ("empty.txt", "octet"); - atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access " - "violation"); RECV_ERROR(2, "Access violation"); } @@ -835,8 +833,6 @@ TFTPD_TC_DEFINE(wrq_eaccess_world_readable,) close(fd); SEND_WRQ("empty.txt", "octet"); - atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access " - "violation"); RECV_ERROR(2, "Access violation"); } @@ -911,8 +907,6 @@ TFTPD_TC_DEFINE(wrq_netascii,) TFTPD_TC_DEFINE(wrq_nonexistent,) { SEND_WRQ("nonexistent.txt", "octet"); - atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access " - "violation"); RECV_ERROR(1, "File not found"); } Modified: head/libexec/tftpd/tftpd.c ============================================================================== --- head/libexec/tftpd/tftpd.c Sat Mar 10 01:35:26 2018 (r330718) +++ head/libexec/tftpd/tftpd.c Sat Mar 10 01:43:55 2018 (r330719) @@ -545,6 +545,10 @@ tftp_wrq(int peer, char *recvbuffer, ssize_t size) filename, errtomsg(ecode)); } + if (ecode) { + send_error(peer, ecode); + exit(1); + } tftp_recvfile(peer, mode); exit(0); } From owner-svn-src-head@freebsd.org Sat Mar 10 01:50: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 A9255F3BAD2; Sat, 10 Mar 2018 01:50:44 +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 5A4A679DD0; Sat, 10 Mar 2018 01:50:44 +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 554BD2709A; Sat, 10 Mar 2018 01:50:44 +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 w2A1oiut059333; Sat, 10 Mar 2018 01:50:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A1oivg059331; Sat, 10 Mar 2018 01:50:44 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803100150.w2A1oivg059331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 10 Mar 2018 01:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330720 - in head/libexec/tftpd: . tests X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/libexec/tftpd: . tests X-SVN-Commit-Revision: 330720 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:50:44 -0000 Author: asomers Date: Sat Mar 10 01:50:43 2018 New Revision: 330720 URL: https://svnweb.freebsd.org/changeset/base/330720 Log: tftpd: reject unknown opcodes If tftpd receives a command with an unknown opcode, it simply exits 1. It doesn't send an ERROR packet, and the client will hang waiting for one. Fix it. PR: 226005 MFC after: 3 weeks Modified: head/libexec/tftpd/tests/functional.c head/libexec/tftpd/tftpd.c Modified: head/libexec/tftpd/tests/functional.c ============================================================================== --- head/libexec/tftpd/tests/functional.c Sat Mar 10 01:43:55 2018 (r330719) +++ head/libexec/tftpd/tests/functional.c Sat Mar 10 01:50:43 2018 (r330720) @@ -677,7 +677,6 @@ TFTPD_TC_DEFINE(unknown_opcode,) { /* Looks like an RRQ or WRQ request, but with a bad opcode */ SEND_STR("\0\007foo.txt\0octet\0"); - atf_tc_expect_timeout("PR 226005 tftpd ignores bad opcodes but doesn't reject them"); RECV_ERROR(4, "Illegal TFTP operation"); } Modified: head/libexec/tftpd/tftpd.c ============================================================================== --- head/libexec/tftpd/tftpd.c Sat Mar 10 01:43:55 2018 (r330719) +++ head/libexec/tftpd/tftpd.c Sat Mar 10 01:50:43 2018 (r330720) @@ -421,8 +421,7 @@ main(int argc, char *argv[]) "%s read access denied", peername); exit(1); } - } - if (tp->th_opcode == WRQ) { + } else if (tp->th_opcode == WRQ) { if (allow_wo) tftp_wrq(peer, tp->th_stuff, n - 1); else { @@ -430,7 +429,8 @@ main(int argc, char *argv[]) "%s write access denied", peername); exit(1); } - } + } else + send_error(peer, EBADOP); exit(1); } From owner-svn-src-head@freebsd.org Sat Mar 10 01:53: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 3D5EDF3BFE9; Sat, 10 Mar 2018 01:53:43 +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 E1C097A2A3; Sat, 10 Mar 2018 01:53:42 +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 DA50E27238; Sat, 10 Mar 2018 01:53:42 +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 w2A1rg0V064023; Sat, 10 Mar 2018 01:53:42 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A1rgIB064022; Sat, 10 Mar 2018 01:53:42 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803100153.w2A1rgIB064022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 10 Mar 2018 01:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330721 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330721 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 01:53:43 -0000 Author: cem Date: Sat Mar 10 01:53:42 2018 New Revision: 330721 URL: https://svnweb.freebsd.org/changeset/base/330721 Log: subr_gtaskqueue: Fix braino from r330715 Submitted by: markj Sponsored by: Dell EMC Isilon Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c ============================================================================== --- head/sys/kern/subr_gtaskqueue.c Sat Mar 10 01:50:43 2018 (r330720) +++ head/sys/kern/subr_gtaskqueue.c Sat Mar 10 01:53:42 2018 (r330721) @@ -135,7 +135,7 @@ _gtaskqueue_create(const char *name, int mflags, queue = malloc(sizeof(struct gtaskqueue), M_GTASKQUEUE, mflags | M_ZERO); if (!queue) { - free(queue->tq_name, M_GTASKQUEUE); + free(tq_name, M_GTASKQUEUE); return (NULL); } From owner-svn-src-head@freebsd.org Sat Mar 10 01:58: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 7088DF3C692; Sat, 10 Mar 2018 01:58:16 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA3267A5F7; Sat, 10 Mar 2018 01:58:15 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x243.google.com with SMTP id k135so4908842ite.2; Fri, 09 Mar 2018 17:58:15 -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=FECY+iF4sRjFl4KHExIecgf71XtjF/I1HBY6lF9K4bM=; b=GeBPPPZi1PSXnqDPykRWXoXZekjOcB587tUSxSsqJ+RjrhMCDCNhJmRCOGe+yWu3hn Z0pnSWLUBkAWDCSTVYo6w1ifcXShP3l0k1WY+RPSiUzsVcm7BGiXese5NuNLCUHbzJDi 2PV/dZ3U2w16ShDm1ppvmarSkKvRUYAKOQAvcuA2J2FxPDYtn2myKF8leFGBnF+EiSt0 Pv30cUpU1y1SrysKpYP/gxGcX5qRbrzIU0OzOQLC4mTv6713m8xs7LaqvpURkYbUqcEA Y+EehqhgX4T9YeMqoWmSX+Z5upc2DmRdQSHvjbpjROG4n1LizDLt6Nlyy7QDHzPUeFSm V1kw== 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=FECY+iF4sRjFl4KHExIecgf71XtjF/I1HBY6lF9K4bM=; b=cUZTcubodYXRJi8tYj2rwN1UviSjK3RK+4ZksXgP0e4EOErjRQgbwYxCpWGgxoxliB vQ4kZKQ/K2ab+LZ4OvHJgHDtHG49l3nfBugundr9yo8oQVVcawag7Z03bO1tNpJPc4AY w7S8rkuSfeh/cO+IEPyhSZU+KFivRcWfrtqD2WkJ06CF7cdqWL79KsM/ri1km3yXUfFF lDJwErwW0P7xuoggIF2bftQ8xJ4a/9TNVBA1p2EV/LqTZ9yU/y2CJ8DLx8+rsGfBSK1U fJ7+K6UkrZWasSSxDsFJd6nKmvS2kL5P/gFMr+m9l/Khm83jmJuTiuzwOYaBtq3H1kzH A+QA== X-Gm-Message-State: AElRT7EtdCpA5n4hq0r8+SH70Txi6HvmYLuWG6QtMh1J+Mt0KsYAoSDR uoc8vxpS08S7AEpJfiz15dpc00+bWbg5hNfb4b0= X-Google-Smtp-Source: AG47ELt56sYEycI2HVX3AHxetQ4kMIA41LJ0rwwwcUTRvvtqCM3v5XbzjWYt/TJGRwxmeCnVjCZMBYWtNXl1BOWvhho= X-Received: by 10.36.7.198 with SMTP id f189mr57020itf.114.1520647095217; Fri, 09 Mar 2018 17:58:15 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.163.13 with HTTP; Fri, 9 Mar 2018 17:57:54 -0800 (PST) In-Reply-To: References: <201801311436.w0VEaRrZ030839@repo.freebsd.org> From: Ed Maste Date: Fri, 9 Mar 2018 20:57:54 -0500 X-Google-Sender-Auth: 3dHsfoPpmR6mW0WJELV3BhgTnDM Message-ID: Subject: Re: svn commit: r328625 - in head/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl i386/i386 x86/include x86/x86 To: Dexuan-BSD Cui Cc: Konstantin Belousov , Dexuan Cui , 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 Mar 2018 01:58:16 -0000 On 9 March 2018 at 19:41, Dexuan-BSD Cui wrote: > Hi, > > In my FreeBSD 11.1 VM, I'm getting this build failure and it looks > this revision causes the failure: > > /root/bsd.git/sys/amd64/amd64/support.S:855:2: error: unknown directive > .altmacro > ^ Are you trying to build a head kernel using the toolchain in 11.1? That won't work (because of missing .altmacro support). Building kernel-toolchain first should get a working toolchain. > It looks -fno-integrated-as might fix the failure for me according to: Avoiding the integrated assembler is indeed the workaround for this issue, but you'll want to apply it only to the affected file. Kostik's 11.1 merge candidate patch adds to sys/conf/Makefile.amd64 ASM_CFLAGS.support.S= ${CLANG_NO_IAS} From owner-svn-src-head@freebsd.org Sat Mar 10 02: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 4D32AF3D8FE; Sat, 10 Mar 2018 02:10:28 +0000 (UTC) (envelope-from bdrewery@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 5B67F7B094; Sat, 10 Mar 2018 02:10:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD48F27405; Sat, 10 Mar 2018 02:10:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2A2AQjQ069127; Sat, 10 Mar 2018 02:10:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A2AQYO069126; Sat, 10 Mar 2018 02:10:26 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803100210.w2A2AQYO069126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 10 Mar 2018 02:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330724 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 330724 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:10:28 -0000 Author: bdrewery Date: Sat Mar 10 02:10:26 2018 New Revision: 330724 URL: https://svnweb.freebsd.org/changeset/base/330724 Log: Don't skip reading depend for 'make obj' unless it is alone. This was effectively done in bsd.dep.mk quite some time ago. MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sat Mar 10 02:10:19 2018 (r330723) +++ head/sys/conf/kern.post.mk Sat Mar 10 02:10:26 2018 (r330724) @@ -200,8 +200,9 @@ _meta_filemon= 1 # Also skip generating or including .depend.* files if in meta+filemon mode # since it will track dependencies itself. OBJS_DEPEND_GUESS is still used # for _meta_filemon but not for _SKIP_DEPEND. -.if !defined(NO_SKIP_DEPEND) && (make(*obj) || \ +.if !defined(NO_SKIP_DEPEND) && \ (!empty(.MAKEFLAGS:M-V) && empty(.MAKEFLAGS:M*DEP*)) || \ + (${.TARGETS:M*obj} == ${.TARGETS} || \ ${.TARGETS:M*clean*} == ${.TARGETS} || \ ${.TARGETS:M*install*} == ${.TARGETS}) _SKIP_DEPEND= 1 From owner-svn-src-head@freebsd.org Sat Mar 10 02:09: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 2E105F3D76B; Sat, 10 Mar 2018 02:09:37 +0000 (UTC) (envelope-from bdrewery@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 D2A327AE6E; Sat, 10 Mar 2018 02:09:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC976273FC; Sat, 10 Mar 2018 02:09:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2A29aJW068980; Sat, 10 Mar 2018 02:09:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A29aZ6068978; Sat, 10 Mar 2018 02:09:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803100209.w2A29aZ6068978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 10 Mar 2018 02:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330722 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 330722 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:09:37 -0000 Author: bdrewery Date: Sat Mar 10 02:09:36 2018 New Revision: 330722 URL: https://svnweb.freebsd.org/changeset/base/330722 Log: Reduce overhead for simple 'make -V' lookups by avoiding 'find sys/'. Setting -DNO_SKIP_MPATH can be used for debugging. Reported by: bde MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/sys/conf/config.mk head/sys/conf/kern.pre.mk Modified: head/sys/conf/config.mk ============================================================================== --- head/sys/conf/config.mk Sat Mar 10 01:53:42 2018 (r330721) +++ head/sys/conf/config.mk Sat Mar 10 02:09:36 2018 (r330722) @@ -50,7 +50,8 @@ KERN_OPTS!=cat ${KERNBUILDDIR}/opt*.h | awk '{print $$ .export KERN_OPTS .endif -.if !defined(NO_MODULES) && !defined(__MPATH) +.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \ + (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH)) __MPATH!=find ${SYSDIR:tA}/ -name \*_if.m .export __MPATH .endif Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Sat Mar 10 01:53:42 2018 (r330721) +++ head/sys/conf/kern.pre.mk Sat Mar 10 02:09:36 2018 (r330722) @@ -214,7 +214,8 @@ SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compil SYSTEM_DEP+= ${LDSCRIPT} # Calculate path for .m files early, if needed. -.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) +.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \ + (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH)) __MPATH!=find ${S:tA}/ -name \*_if.m .endif From owner-svn-src-head@freebsd.org Sat Mar 10 02:10: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 7B4A5F3D897; Sat, 10 Mar 2018 02:10:20 +0000 (UTC) (envelope-from bdrewery@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 31E017AFC7; Sat, 10 Mar 2018 02:10:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CDAC27403; Sat, 10 Mar 2018 02:10:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2A2AKAL069080; Sat, 10 Mar 2018 02:10:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A2AKqH069079; Sat, 10 Mar 2018 02:10:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803100210.w2A2AKqH069079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 10 Mar 2018 02:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330723 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 330723 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:10:20 -0000 Author: bdrewery Date: Sat Mar 10 02:10:19 2018 New Revision: 330723 URL: https://svnweb.freebsd.org/changeset/base/330723 Log: Skip reading depend files with -V unless looking up a depend variable. This speeds up some simple -V lookups significantly. Reported by: bde MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sat Mar 10 02:09:36 2018 (r330722) +++ head/sys/conf/kern.post.mk Sat Mar 10 02:10:19 2018 (r330723) @@ -201,6 +201,7 @@ _meta_filemon= 1 # since it will track dependencies itself. OBJS_DEPEND_GUESS is still used # for _meta_filemon but not for _SKIP_DEPEND. .if !defined(NO_SKIP_DEPEND) && (make(*obj) || \ + (!empty(.MAKEFLAGS:M-V) && empty(.MAKEFLAGS:M*DEP*)) || \ ${.TARGETS:M*clean*} == ${.TARGETS} || \ ${.TARGETS:M*install*} == ${.TARGETS}) _SKIP_DEPEND= 1 From owner-svn-src-head@freebsd.org Sat Mar 10 02:13: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 1C1F6F3DF62; Sat, 10 Mar 2018 02:13:49 +0000 (UTC) (envelope-from bdrewery@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 BE79E7B60F; Sat, 10 Mar 2018 02:13:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9579275A6; Sat, 10 Mar 2018 02:13:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2A2Dmit073930; Sat, 10 Mar 2018 02:13:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A2Dm8K073929; Sat, 10 Mar 2018 02:13:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201803100213.w2A2Dm8K073929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 10 Mar 2018 02:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330725 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 330725 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:13:49 -0000 Author: bdrewery Date: Sat Mar 10 02:13:48 2018 New Revision: 330725 URL: https://svnweb.freebsd.org/changeset/base/330725 Log: Fix rebase mismerge in r330724. X-MFC-With: r330724 MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/sys/conf/kern.post.mk Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Sat Mar 10 02:10:26 2018 (r330724) +++ head/sys/conf/kern.post.mk Sat Mar 10 02:13:48 2018 (r330725) @@ -201,8 +201,8 @@ _meta_filemon= 1 # since it will track dependencies itself. OBJS_DEPEND_GUESS is still used # for _meta_filemon but not for _SKIP_DEPEND. .if !defined(NO_SKIP_DEPEND) && \ - (!empty(.MAKEFLAGS:M-V) && empty(.MAKEFLAGS:M*DEP*)) || \ - (${.TARGETS:M*obj} == ${.TARGETS} || \ + ((!empty(.MAKEFLAGS:M-V) && empty(.MAKEFLAGS:M*DEP*)) || \ + ${.TARGETS:M*obj} == ${.TARGETS} || \ ${.TARGETS:M*clean*} == ${.TARGETS} || \ ${.TARGETS:M*install*} == ${.TARGETS}) _SKIP_DEPEND= 1 From owner-svn-src-head@freebsd.org Sat Mar 10 02:49: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 EA9B4F4131B; Sat, 10 Mar 2018 02:49:58 +0000 (UTC) (envelope-from gonzo@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 A03D17CDC7; Sat, 10 Mar 2018 02:49:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9B15E27ACA; Sat, 10 Mar 2018 02:49:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2A2nw9Y089225; Sat, 10 Mar 2018 02:49:58 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2A2nwjo089222; Sat, 10 Mar 2018 02:49:58 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201803100249.w2A2nwjo089222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 10 Mar 2018 02:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330727 - in head/sys: arm/broadcom/bcm2835 dts/arm X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 dts/arm X-SVN-Commit-Revision: 330727 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 02:49:59 -0000 Author: gonzo Date: Sat Mar 10 02:49:58 2018 New Revision: 330727 URL: https://svnweb.freebsd.org/changeset/base/330727 Log: [rpi] remove IRQ support for BCM233x RNG Upstream DTBs don't provide IRQ lines for the RNG. Moreover, harvesting bytes as often as the RNG interrupt is triggered (87 times per sec) is an overkill. For these reasons, get rid of the interrupt mode and make callout mode the default, with random bits harvested every 4 seconds. Submitted by: Sylvain Garrigues Reviewed by: ian, imp, manu, mmel Approved by: emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D14541 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_rng.c head/sys/dts/arm/rpi.dts head/sys/dts/arm/rpi2.dts Modified: head/sys/arm/broadcom/bcm2835/bcm2835_rng.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_rng.c Sat Mar 10 02:15:45 2018 (r330726) +++ head/sys/arm/broadcom/bcm2835/bcm2835_rng.c Sat Mar 10 02:49:58 2018 (r330727) @@ -51,10 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(BCM2835_RNG_USE_CALLOUT) -#define BCM2835_RNG_USE_INTERRUPT -#endif - static device_attach_t bcm2835_rng_attach; static device_detach_t bcm2835_rng_detach; static device_probe_t bcm2835_rng_probe; @@ -92,18 +88,15 @@ static device_probe_t bcm2835_rng_probe; #define RNG_NUM_OSCILLATORS 6 #define RNG_STALL_COUNT_DEFAULT 10 +#define RNG_CALLOUT_TICKS (hz * 4) + struct bcm2835_rng_softc { device_t sc_dev; struct resource * sc_mem_res; struct resource * sc_irq_res; void * sc_intr_hdl; -#if defined(BCM2835_RNG_USE_CALLOUT) || defined(BCM2835_RNG_USE_INTERRUPT) uint32_t sc_buf[RNG_FIFO_WORDS]; -#endif -#if defined(BCM2835_RNG_USE_CALLOUT) struct callout sc_rngto; - int sc_rnghz; -#endif int sc_stall_count; int sc_rbg2x; long sc_underrun; @@ -214,20 +207,7 @@ bcm2835_rng_disable_intr(struct bcm2835_rng_softc *sc) bcm2835_rng_write4(sc, RNG_INT_MASK, mask); } -#if defined(BCM2835_RNG_USE_INTERRUPT) static void -bcm2835_rng_enable_intr(struct bcm2835_rng_softc *sc) -{ - uint32_t mask; - - /* Clear the interrupt off bit in the interrupt mask register */ - mask = bcm2835_rng_read4(sc, RNG_INT_MASK); - mask &= ~RNG_INT_OFF_BIT; - bcm2835_rng_write4(sc, RNG_INT_MASK, mask); -} -#endif - -static void bcm2835_rng_start(struct bcm2835_rng_softc *sc) { uint32_t ctrl; @@ -244,11 +224,6 @@ bcm2835_rng_start(struct bcm2835_rng_softc *sc) if (sc->sc_rbg2x) ctrl |= RNG_RBG2X; bcm2835_rng_write4(sc, RNG_CTRL, ctrl); - -#if defined(BCM2835_RNG_USE_INTERRUPT) - /* Enable the interrupt */ - bcm2835_rng_enable_intr(sc); -#endif } static void @@ -263,12 +238,13 @@ bcm2835_rng_stop(struct bcm2835_rng_softc *sc) } static void -bcm2835_rng_harvest(struct bcm2835_rng_softc *sc) +bcm2835_rng_harvest(void *arg) { uint32_t *dest; uint32_t status; u_int cnt, nread, num_avail, num_words; int seen_underrun, num_stalls; + struct bcm2835_rng_softc *sc = arg; dest = sc->sc_buf; nread = num_words = 0; @@ -316,9 +292,7 @@ bcm2835_rng_harvest(struct bcm2835_rng_softc *sc) random_harvest_queue(sc->sc_buf, cnt, cnt * NBBY / 2, RANDOM_PURE_BROADCOM); -#if defined(BCM2835_RNG_USE_CALLOUT) - callout_reset(&sc->sc_rngto, sc->sc_rnghz, bcm2835_rng_harvest, sc); -#endif + callout_reset(&sc->sc_rngto, RNG_CALLOUT_TICKS, bcm2835_rng_harvest, sc); } static int @@ -390,10 +364,10 @@ bcm2835_rng_attach(device_t dev) sc = device_get_softc(dev); sc->sc_dev = dev; sc->sc_stall_count = RNG_STALL_COUNT_DEFAULT; -#ifdef BCM2835_RNG_USE_CALLOUT + /* Initialize callout */ callout_init(&sc->sc_rngto, CALLOUT_MPSAFE); -#endif + TUNABLE_INT_FETCH("bcmrng.2xspeed", &sc->sc_rbg2x); TUNABLE_INT_FETCH("bcmrng.stall_count", &sc->sc_stall_count); @@ -406,27 +380,6 @@ bcm2835_rng_attach(device_t dev) return (ENXIO); } -#if defined(BCM2835_RNG_USE_INTERRUPT) - /* Allocate interrupt resource */ - rid = 0; - sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, - RF_SHAREABLE | RF_ACTIVE); - if (sc->sc_irq_res == NULL) { - bcm2835_rng_detach(dev); - return (ENXIO); - } - - /* Set up the interrupt handler */ - error = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - NULL, (driver_intr_t *)bcm2835_rng_harvest, sc, &sc->sc_intr_hdl); - if (error) { - device_printf(dev, "Failed to set up IRQ\n"); - sc->sc_intr_hdl = NULL; - bcm2835_rng_detach(dev); - return (error); - } -#endif - /* Start the RNG */ bcm2835_rng_start(sc); @@ -461,14 +414,11 @@ bcm2835_rng_attach(device_t dev) sysctl_bcm2835_rng_dump, "S", "Dump RNG registers"); #endif -#if defined(BCM2835_RNG_USE_CALLOUT) - /* Reset callout */ - if (hz >= 100) - sc->sc_rnghz = hz / 100; - else - sc->sc_rnghz = 1; - callout_reset(&sc->sc_rngto, sc->sc_rnghz, bcm2835_rng_harvest, sc); -#endif + /* + * Schedule the initial harvesting one second from now, which should give the + * hardware RNG plenty of time to generate the first random bytes. + */ + callout_reset(&sc->sc_rngto, hz, bcm2835_rng_harvest, sc); return (0); } @@ -477,9 +427,6 @@ static int bcm2835_rng_detach(device_t dev) { struct bcm2835_rng_softc *sc; -#if defined(BCM2835_RNG_USE_INTERRUPT) - int error; -#endif sc = device_get_softc(dev); @@ -487,27 +434,7 @@ bcm2835_rng_detach(device_t dev) bcm2835_rng_stop(sc); /* Drain the callout it */ -#if defined(BCM2835_RNG_USE_CALLOUT) callout_drain(&sc->sc_rngto); -#endif - -#if defined(BCM2835_RNG_USE_INTERRUPT) - /* Tear down the interrupt */ - if (sc->sc_irq_res && sc->sc_intr_hdl) { - error = bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intr_hdl); - if (error != 0) { - device_printf(dev, "could not tear down IRQ\n"); - return (error); - } - sc->sc_intr_hdl = NULL; - } - - /* Release interrupt resource */ - if (sc->sc_irq_res) { - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); - sc->sc_irq_res = NULL; - } -#endif /* Release memory resource */ if (sc->sc_mem_res != NULL) Modified: head/sys/dts/arm/rpi.dts ============================================================================== --- head/sys/dts/arm/rpi.dts Sat Mar 10 02:15:45 2018 (r330726) +++ head/sys/dts/arm/rpi.dts Sat Mar 10 02:49:58 2018 (r330727) @@ -51,10 +51,6 @@ status = "okay"; }; - rng@7e104000 { - interrupts = <2 29>; - } - spi@7e204000 { status = "okay"; }; Modified: head/sys/dts/arm/rpi2.dts ============================================================================== --- head/sys/dts/arm/rpi2.dts Sat Mar 10 02:15:45 2018 (r330726) +++ head/sys/dts/arm/rpi2.dts Sat Mar 10 02:49:58 2018 (r330727) @@ -51,10 +51,6 @@ status = "okay"; }; - rng@7e104000 { - interrupts = <2 29>; - } - spi@7e204000 { status = "okay"; }; From owner-svn-src-head@freebsd.org Sat Mar 10 03:01: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 B862FF424BF for ; Sat, 10 Mar 2018 03:01:04 +0000 (UTC) (envelope-from dab@freebsd.org) Received: from qproxy6-pub.mail.unifiedlayer.com (qproxy6-pub.mail.unifiedlayer.com [69.89.23.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 349617D839 for ; Sat, 10 Mar 2018 03:01:04 +0000 (UTC) (envelope-from dab@freebsd.org) Received: from CMOut01 (unknown [10.0.90.82]) by qproxy6.mail.unifiedlayer.com (Postfix) with ESMTP id 69F41140638 for ; Fri, 9 Mar 2018 19:36:32 -0700 (MST) Received: from host305.hostmonster.com ([74.220.215.105]) by CMOut01 with id L2cT1x00b2H155E012cWWT; Fri, 09 Mar 2018 19:36:32 -0700 X-Authority-Analysis: v=2.2 cv=ft6sXBwf c=1 sm=1 tr=0 a=oRSXaeV14bi+UgmAP6q2Hg==:117 a=oRSXaeV14bi+UgmAP6q2Hg==:17 a=IkcTkHD0fZMA:10 a=v2DPQv5-lfwA:10 a=6I5d2MoRAAAA:8 a=GOsVCeYTcul28fUrr7wA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 Received: from d192-24-6-24.try.wideopenwest.com ([24.192.24.6]:60592 helo=[192.168.1.122]) by host305.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1euUN1-003Txt-IE; Fri, 09 Mar 2018 19:36:27 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs From: David Bright In-Reply-To: <1520634689.84937.74.camel@freebsd.org> Date: Fri, 9 Mar 2018 21:36:25 -0500 Cc: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201801151925.w0FJPCKA019434@repo.freebsd.org> <20180309220940.GG6174@raichu> <1520634689.84937.74.camel@freebsd.org> To: Ian Lepore 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 - host305.hostmonster.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - FreeBSD.org X-BWhitelist: no X-Source-IP: 24.192.24.6 X-Exim-ID: 1euUN1-003Txt-IE X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: d192-24-6-24.try.wideopenwest.com ([192.168.1.122]) [24.192.24.6]:60592 X-Source-Auth: david@bright-family.net X-Email-Count: 1 X-Source-Cap: YnJpZ2h0ZmE7YnJpZ2h0ZmE7aG9zdDMwNS5ob3N0bW9uc3Rlci5jb20= X-Local-Domain: no 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 Mar 2018 03:01:05 -0000 On Mar 9, 2018, at 17:31, Ian Lepore wrote: >=20 > On Fri, 2018-03-09 at 17:09 -0500, Mark Johnston wrote: >>=20 >> etc/rc.d/fsck doesn't know how to interpret the new exit code and now >> just drops to a single-user shell when it is encountered. [=E2=80=A6] >>=20 >> Is there any reason etc/rc.d/fsck shouldn't automatically retry (up = to This is, in fact, the reason that I made the change I did. I was trying = to put in a retry loop to rc.d/fsck, but found that I couldn=E2=80=99t = get it to work because fsck and fsck_ffs were not exiting with non-zero = status. The drop to single user is not really due to the specific (new) = error code of 16, it is due to the fact that fsck_ffs is now exiting = with a non-zero status when it hasn=E2=80=99t completely cleaned the = file system; /any/ non-zero status would cause the current rc.d/fsck = script to go to single user. Prior to my change, fsck_ffs was exiting = with a zero status even though it had not completely cleaned the = filesystem and told the user to run it again. >=20 > fsck_ffs already has a -R flag to automatically retry, wouldn't that = be > a better mechanism for handling this new type of retry? That=E2=80=99s true; however, there is currently no way to pass that = flag through the filesystem-agnostic fsck wrapper called from rc.d/fsck = to the filesystem-specific fsck_ffs program that it calls. One could = implement a similar flag on the fsck wrapper to be passed along to the = filesystem-specific checker, but I think fsck_ffs is the only one that = currently implements such a flag.=20 --=20 David Bright dab@FreeBSD.org From owner-svn-src-head@freebsd.org Sat Mar 10 03:14: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 E699AF43921; Sat, 10 Mar 2018 03:14:05 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22f.google.com (mail-lf0-x22f.google.com [IPv6:2a00:1450:4010:c07::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 4D73A7E7E6; Sat, 10 Mar 2018 03:14:05 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22f.google.com with SMTP id l191-v6so15840833lfe.1; Fri, 09 Mar 2018 19:14:05 -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=+dAu5ld8LyfQ2LUVBp1Wwn6d5t3ybNXFvCYKv2avVEk=; b=sVz8eGtGtGPDiE2XZMZS02Xkakjk6lLsdIJ3g5nY0fqZ9Yo5n7E3jHr7s7/RD6Zr0Y HMPAUwQCpZJ0v6A5JyV1nWyYOBkBz540PaFBIAwLymwSLOL7Dm8luY57sVMDi3znorTp csTlb/jBG7PK6XZbLelqcxAd6m0axM/iufKYVn8gR05KZYcMujZZvhymrIfvvAstPB+P 0lcYjJcCc4l4wnNuuo6YvrCYOIu4NP2t1I6F2LQsf46f8Qwza5hhqX6iiJKEUAfrqkHZ HJsLfV1S7r4QZlTpiIPUh16A9WAjdXFv6mlLCefKTR76DQ3DHWHqc/TLy6cLwgA/EkeY Q4ig== 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=+dAu5ld8LyfQ2LUVBp1Wwn6d5t3ybNXFvCYKv2avVEk=; b=Y85hg9rnSnQIQOJJF3QWbenfYoXGSt+ru1aMkQwOwXC49GRwMdrCUZ+j3Ckr8nO3Xs UPQ44aQrw8UBpLdzkkCUKKY92ekoHZPXD1BVJzZuiSdNoukLMpFwbR6/NReP8WEiAgmD 3s7u8kGdATM+66TGxJ6dik2P3DcWArGo2C1fDHo/VbM4TAnmMWpCb70UvT+Ggk9K6p1s muSxVqzGwCsAmy1rRrUvv4E01okC/t3EyhdNKzcqLe+4Ej1PsdKL5VG7FhCerYYxlMSM Ptk4cyHbwQb7K4121N3PK2AE+FwgseJ6obCGzHMbpWpYaL/bTCxLz9g+Wv8sYitTtJS6 rbwQ== X-Gm-Message-State: AElRT7HVFxLryV7yOxbBG0FRkZn1/pb5DM7ls1i2Hl7rg/MFq2d1sXCm M7N5hudPmWe0biP045AA1byC2RwtLz1m0/C3/EgXKQ== X-Google-Smtp-Source: AG47ELu1cWT0PB9vA53fwsbqoYfXjVJqbT2L3kqSQtK9aTb07umGs6LYXZu93hyut6WpytGLWyglrZ6ccHInTELqVNA= X-Received: by 10.46.27.211 with SMTP id c80mr444757ljf.46.1520651643675; Fri, 09 Mar 2018 19:14:03 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Fri, 9 Mar 2018 19:14:03 -0800 (PST) In-Reply-To: <201803080947.w289lArk031151@repo.freebsd.org> References: <201803080947.w289lArk031151@repo.freebsd.org> From: Alan Somers Date: Fri, 9 Mar 2018 20:14:03 -0700 X-Google-Sender-Auth: IXMX7KlWPRDAhUnvXM59sNF_N5w Message-ID: Subject: Re: svn commit: r330644 - in head/sys/dev/mlx5: . mlx5_core To: Hans Petter Selasky Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.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: Sat, 10 Mar 2018 03:14:06 -0000 On Thu, Mar 8, 2018 at 2:47 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Thu Mar 8 09:47:09 2018 > New Revision: 330644 > URL: https://svnweb.freebsd.org/changeset/base/330644 > > Log: > Updates for PCI and health monitor recovery in mlx5core. > This patch accumulates the following Linux commits: > > mlx5_health.c > - 78ccb25861d76a8fc5c678d762180e6918834200 > mlx5_core: Fix wrong name in struct > - 171bb2c560f45c0427ca3776a4c8f4e26e559400 > mlx5_core: Update health syndromes > - 0144a95e2ad53a40c62148f44fb0c1f9d2a0d1e9 > mlx5_core: Use accessor functions to read from device memory > - ac6ea6e81a80172612e0c9ef93720f371b198918 > mlx5_core: Use private health thread for each device > - fd76ee4da55abb21babfc69310d321b9cb9a32e0 > mlx5_core: Fix internal error detection conditions > - 2241007b3d783cbdbaa78c30bdb1994278b6f9b9 > mlx5: Clear health sick bit when starting health poll > - 712bfef60912d91033cb25739f7444d5b8d8c59f > mlx5: Fix version printout in case of health issue > - 89d44f0a6c732db23b219be708e2fe1e03ee4842 > mlx5_core: Add pci error handlers to mlx5_core driver > > mlx5_cmd.c > - be87544de8df2b1eb34bcb5e32691287d96f9ec4 > mlx5_core: Fix async commands return code > - a31208b1e11df334d443ec8cace7636150bb8ce2 > mlx5_core: New init and exit flow for mlx5_core > - 020446e01eebc9dbe7eda038e570ab9c7ab13586 > mlx5_core: Prepare cmd interface to system errors handling > - 89d44f0a6c732db23b219be708e2fe1e03ee4842 > mlx5_core: Add pci error handlers to mlx5_core driver > - 0d834442cc247c7b3f3bd6019512ae03e96dd99a > mlx5: Fix teardown errors that happen in pci error handler > > mlx5_main.c > - 5fc7197d3a256d9c5de3134870304b24892a4908 > mlx5: Add pci shutdown callback > > Submitted by: Matthew Finlay > MFC after: 1 week > Sponsored by: Mellanox Technologies > > Modified: > > It looks like this commit broke the build with GCC6. Could you please take a look? https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/4790/ From owner-svn-src-head@freebsd.org Sat Mar 10 03:31: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 B3E8DF44E1F; Sat, 10 Mar 2018 03:31:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f196.google.com (mail-io0-f196.google.com [209.85.223.196]) (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 4E43E7F3E7; Sat, 10 Mar 2018 03:31:12 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f196.google.com with SMTP id m22so5649226iob.12; Fri, 09 Mar 2018 19:31:12 -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=W0mzS5/37Y9UlVlPRzWhMapLja1jQxNPkIBhXHrvudw=; b=UBDkgrrkMKbVEXd8Dk+ycanxzY6GyKwLQ0vaEMQE3GxSmnt3uaVy75aLxaq84pQqpc esV9T3JUgirnFP+1dPbF+0eSUProJlc0gxU2ZbnucyGca8jX9ZTq01pOqvwE0W2euz44 pnLljlDWhMRkeOxnGtV1/gh6Bmj2AVunGxba7YUianiq7YE/c9PEnmbkCP5jVp+baJO6 XS6leshzH+tK4/+I2N2MjinSgC+lTq5rsMteDKcpEEtHBr0CNr31tKUAXXbZhWJ9zUOc WRRTeOrrrnz0AwGETCDRDvK1q9pjVhtYBcrGT+KshhIZwDQ9WFlgFpjrzQG/X1AVsJHr buKA== X-Gm-Message-State: AElRT7EAm1BEDGkqwb2v1MjsFku8aBRG0L/0RslJGg61XoSeb8cBd3ss Z4RxV1NkcjAgE8ekNkxfspXMs8AO X-Google-Smtp-Source: AG47ELtFpmoFIepBiBrIi8v9aRDHqtstjcJROT9d/QzBua8iIUUmiaoZsDXez0Qhp5mFyg+ZpL7L0w== X-Received: by 10.107.9.138 with SMTP id 10mr739904ioj.257.1520652334990; Fri, 09 Mar 2018 19:25:34 -0800 (PST) Received: from mail-it0-f45.google.com (mail-it0-f45.google.com. [209.85.214.45]) by smtp.gmail.com with ESMTPSA id z84sm98592itf.21.2018.03.09.19.25.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 19:25:34 -0800 (PST) Received: by mail-it0-f45.google.com with SMTP id k79-v6so5214970ita.2; Fri, 09 Mar 2018 19:25:34 -0800 (PST) X-Received: by 10.36.161.2 with SMTP id y2mr236165ite.53.1520652334416; Fri, 09 Mar 2018 19:25:34 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Fri, 9 Mar 2018 19:25:33 -0800 (PST) In-Reply-To: References: <201803080947.w289lArk031151@repo.freebsd.org> From: Conrad Meyer Date: Fri, 9 Mar 2018 19:25:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r330644 - in head/sys/dev/mlx5: . mlx5_core To: Alan Somers Cc: Hans Petter Selasky , 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 Mar 2018 03:31:13 -0000 Hi Alan, I think I fixed it in r330714, if you want to update to that revision. Best, Conrad On Fri, Mar 9, 2018 at 7:14 PM, Alan Somers wrote: > On Thu, Mar 8, 2018 at 2:47 AM, Hans Petter Selasky > wrote: >> >> Author: hselasky >> Date: Thu Mar 8 09:47:09 2018 >> New Revision: 330644 >> URL: https://svnweb.freebsd.org/changeset/base/330644 >> >> Log: >> Updates for PCI and health monitor recovery in mlx5core. >> This patch accumulates the following Linux commits: >> >> mlx5_health.c >> - 78ccb25861d76a8fc5c678d762180e6918834200 >> mlx5_core: Fix wrong name in struct >> - 171bb2c560f45c0427ca3776a4c8f4e26e559400 >> mlx5_core: Update health syndromes >> - 0144a95e2ad53a40c62148f44fb0c1f9d2a0d1e9 >> mlx5_core: Use accessor functions to read from device memory >> - ac6ea6e81a80172612e0c9ef93720f371b198918 >> mlx5_core: Use private health thread for each device >> - fd76ee4da55abb21babfc69310d321b9cb9a32e0 >> mlx5_core: Fix internal error detection conditions >> - 2241007b3d783cbdbaa78c30bdb1994278b6f9b9 >> mlx5: Clear health sick bit when starting health poll >> - 712bfef60912d91033cb25739f7444d5b8d8c59f >> mlx5: Fix version printout in case of health issue >> - 89d44f0a6c732db23b219be708e2fe1e03ee4842 >> mlx5_core: Add pci error handlers to mlx5_core driver >> >> mlx5_cmd.c >> - be87544de8df2b1eb34bcb5e32691287d96f9ec4 >> mlx5_core: Fix async commands return code >> - a31208b1e11df334d443ec8cace7636150bb8ce2 >> mlx5_core: New init and exit flow for mlx5_core >> - 020446e01eebc9dbe7eda038e570ab9c7ab13586 >> mlx5_core: Prepare cmd interface to system errors handling >> - 89d44f0a6c732db23b219be708e2fe1e03ee4842 >> mlx5_core: Add pci error handlers to mlx5_core driver >> - 0d834442cc247c7b3f3bd6019512ae03e96dd99a >> mlx5: Fix teardown errors that happen in pci error handler >> >> mlx5_main.c >> - 5fc7197d3a256d9c5de3134870304b24892a4908 >> mlx5: Add pci shutdown callback >> >> Submitted by: Matthew Finlay >> MFC after: 1 week >> Sponsored by: Mellanox Technologies >> >> Modified: >> > > It looks like this commit broke the build with GCC6. Could you please take > a look? > > https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/4790/ > From owner-svn-src-head@freebsd.org Sat Mar 10 03:38: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 393BAF458B2; Sat, 10 Mar 2018 03:38:52 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com [IPv6:2a00:1450:4010:c07::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 733877FAF2; Sat, 10 Mar 2018 03:38:51 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id m69-v6so15836084lfe.8; Fri, 09 Mar 2018 19:38:51 -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=WikMZxDtgGz/WPYAwp7PIqaLkyc0FK02vjRYdZfc98A=; b=FEHcVTXMFqr0EHzZjEGP4c3mMdvdF7anohUQeqSayZxITVdi7XNhJtWGd3PFXa5KKT pVdJiUUofOVWIMOi8IueocZoZhgYV7ED8bBlJNwx5y9bqD2bxXG4y3/UQuoWaMK4llVg rhz6LTPgBZeKq9Wm6w5I/gyoiHagbg9RHdfDkWjR/e/kfNhxgZRQ8AaLMP4sE+Aw8dpQ 5oSXD44f4ITCj20jtEOMkm+STQ9bSj2rn1J7WhrjKFfREEU7vda0ZDjadGxRLzbzsKfL 5drx+zT1BfHvygSZAAenLi/Ba2GKxuh4hhqcSWGX9rzpr7hDUuyx62FYa/rgpQfCmyhh HnvQ== 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=WikMZxDtgGz/WPYAwp7PIqaLkyc0FK02vjRYdZfc98A=; b=StHbu8h22xhntjUCjnLGYxlXj6prf34oW4d9qer6v6VehuFKtxtej+NcWu9OXykx+L GCpqCBV0F3yBu50Y3J14AVm/OqXftQWYf4bj7er74AO7zLCWnWc3BAN2FHNDBaViPjJ1 RmRW3GbuP9G5a0fqNzVooGcmxtnkoM1v/1xImyNQKP/6QzLrCXzmoz4KjirY9Ii2RRSR pM9Ac++GUEAq3JyRXzUE5jPpRVprAT5fFTFeAStfMHPAjtQyNOt0aVI8zM5k8rBQZvN+ ZQs238RTkBgUbe9/eURXy6rOm4Q8DlhZfeFXIcbPTU4AFhDTRZNKl2NNPuSd65PjKLRb xFPg== X-Gm-Message-State: AElRT7EJB2uGZ7Y+nDq8YdY6HB5Ru0nbwP7V7fPOWEcWuYldWQ9DOSQW bbi5xO6RRJbxwvgxt2S0tWeguVM2LoalDfIZPgc= X-Google-Smtp-Source: AG47ELvtJQHL0vFtMLaO5DuGRUph6t5tMTffsr4bnxSsCOHJwImTNBFLDiXjkzzc3thTO4ITu2BTbfuvyDrHTbJD8xA= X-Received: by 2002:a19:505c:: with SMTP id z28-v6mr424807lfj.34.1520653129729; Fri, 09 Mar 2018 19:38:49 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Fri, 9 Mar 2018 19:38:49 -0800 (PST) In-Reply-To: References: <201803080947.w289lArk031151@repo.freebsd.org> From: Alan Somers Date: Fri, 9 Mar 2018 20:38:49 -0700 X-Google-Sender-Auth: ozeXgw8Y0mI_Z-g5wPcNJ3IaJXQ Message-ID: Subject: Re: svn commit: r330644 - in head/sys/dev/mlx5: . mlx5_core To: "Conrad E. Meyer" Cc: Hans Petter Selasky , 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: Sat, 10 Mar 2018 03:38:52 -0000 Yeah, looks like it's working now. Thanks. On Fri, Mar 9, 2018 at 8:25 PM, Conrad Meyer wrote: > Hi Alan, > > I think I fixed it in r330714, if you want to update to that revision. > > Best, > Conrad > > On Fri, Mar 9, 2018 at 7:14 PM, Alan Somers wrote: > > On Thu, Mar 8, 2018 at 2:47 AM, Hans Petter Selasky < > hselasky@freebsd.org> > > wrote: > >> > >> Author: hselasky > >> Date: Thu Mar 8 09:47:09 2018 > >> New Revision: 330644 > >> URL: https://svnweb.freebsd.org/changeset/base/330644 > >> > >> Log: > >> Updates for PCI and health monitor recovery in mlx5core. > >> This patch accumulates the following Linux commits: > >> > >> mlx5_health.c > >> - 78ccb25861d76a8fc5c678d762180e6918834200 > >> mlx5_core: Fix wrong name in struct > >> - 171bb2c560f45c0427ca3776a4c8f4e26e559400 > >> mlx5_core: Update health syndromes > >> - 0144a95e2ad53a40c62148f44fb0c1f9d2a0d1e9 > >> mlx5_core: Use accessor functions to read from device memory > >> - ac6ea6e81a80172612e0c9ef93720f371b198918 > >> mlx5_core: Use private health thread for each device > >> - fd76ee4da55abb21babfc69310d321b9cb9a32e0 > >> mlx5_core: Fix internal error detection conditions > >> - 2241007b3d783cbdbaa78c30bdb1994278b6f9b9 > >> mlx5: Clear health sick bit when starting health poll > >> - 712bfef60912d91033cb25739f7444d5b8d8c59f > >> mlx5: Fix version printout in case of health issue > >> - 89d44f0a6c732db23b219be708e2fe1e03ee4842 > >> mlx5_core: Add pci error handlers to mlx5_core driver > >> > >> mlx5_cmd.c > >> - be87544de8df2b1eb34bcb5e32691287d96f9ec4 > >> mlx5_core: Fix async commands return code > >> - a31208b1e11df334d443ec8cace7636150bb8ce2 > >> mlx5_core: New init and exit flow for mlx5_core > >> - 020446e01eebc9dbe7eda038e570ab9c7ab13586 > >> mlx5_core: Prepare cmd interface to system errors handling > >> - 89d44f0a6c732db23b219be708e2fe1e03ee4842 > >> mlx5_core: Add pci error handlers to mlx5_core driver > >> - 0d834442cc247c7b3f3bd6019512ae03e96dd99a > >> mlx5: Fix teardown errors that happen in pci error handler > >> > >> mlx5_main.c > >> - 5fc7197d3a256d9c5de3134870304b24892a4908 > >> mlx5: Add pci shutdown callback > >> > >> Submitted by: Matthew Finlay > >> MFC after: 1 week > >> Sponsored by: Mellanox Technologies > >> > >> Modified: > >> > > > > It looks like this commit broke the build with GCC6. Could you please > take > > a look? > > > > https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/4790/ > > > From owner-svn-src-head@freebsd.org Sat Mar 10 03:47: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 5394EF46458; Sat, 10 Mar 2018 03:47:20 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C090380288; Sat, 10 Mar 2018 03:47:19 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w2A3l6WM069900 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 10 Mar 2018 04:47:07 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jhb@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w2A3kvkb069422 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 10 Mar 2018 10:46:57 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r330711 - head/sbin/sysctl To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803092337.w29NbJSX093826@repo.freebsd.org> From: Eugene Grosbein Message-ID: <5AA3552D.5080203@grosbein.net> Date: Sat, 10 Mar 2018 10:46:53 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201803092337.w29NbJSX093826@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net 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 Mar 2018 03:47:20 -0000 10.03.2018 6:37, John Baldwin wrote: > Author: jhb > Date: Fri Mar 9 23:37:19 2018 > New Revision: 330711 > URL: https://svnweb.freebsd.org/changeset/base/330711 > > Log: > Permit sysctl(8) to set an array of numeric values for a single node. > > Most sysctl nodes only return a single value, but some nodes return an > array of values (e.g. kern.cp_time). sysctl(8) understand how to display > the values of a node that returns multiple values (it prints out each > numeric value separated by spaces). However, until now sysctl(8) has > only been able to set sysctl nodes to a single value. This change > allows sysctl to accept a new value for a numeric sysctl node that contains > multiple values separated by either spaces or commas. sysctl(8) parses > this list into an array of values and passes the array as the "new" value > to sysctl(2). Note well: we already have some examples of complex sysctl comma-separated "list" values such as: security.mac.portacl.rules=uid:53:tcp:53,uid:53:udp:53 From owner-svn-src-head@freebsd.org Sat Mar 10 06:18: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 07083F276D2; Sat, 10 Mar 2018 06:18:19 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 4D05A85724; Sat, 10 Mar 2018 06:18:17 +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 mail105.syd.optusnet.com.au (Postfix) with ESMTPS id E1B0D1049B04; Sat, 10 Mar 2018 16:56:18 +1100 (AEDT) Date: Sat, 10 Mar 2018 16:56:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330338 - head/sys/amd64/amd64 In-Reply-To: <1997852.rATkjh2guz@ralph.baldwin.cx> Message-ID: <20180310154454.D971@besplex.bde.org> References: <201803031510.w23FAbeC065867@repo.freebsd.org> <2557369.6nFzd3kAUm@ralph.baldwin.cx> <20180310070452.P5919@besplex.bde.org> <1997852.rATkjh2guz@ralph.baldwin.cx> 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=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=hNusopO0UmrS9mlNGgQA:9 a=5wjp8Tm52k4UfIQL:21 a=R6By-DyKjgHlol7m:21 a=VGjOnp0SFQuy57pt:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 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 Mar 2018 06:18:19 -0000 On Fri, 9 Mar 2018, John Baldwin wrote: > On Saturday, March 10, 2018 07:41:30 AM Bruce Evans wrote: >> On Fri, 9 Mar 2018, John Baldwin wrote: >> >>> On Saturday, March 03, 2018 03:10:37 PM Andriy Gapon wrote: >>>> Author: avg >>>> Date: Sat Mar 3 15:10:37 2018 >>>> New Revision: 330338 >>>> URL: https://svnweb.freebsd.org/changeset/base/330338 >>>> >>>> Log: >>>> db_nextframe/amd64: catch up with r328083 to recognize fast_syscall_common >>>> >>>> Since that change the system call stack traces look like this: >>>> ... >>>> sys___sysctl() at sys___sysctl+0x5f/frame 0xfffffe0028e13ac0 >>>> amd64_syscall() at amd64_syscall+0x79b/frame 0xfffffe0028e13bf0 >>>> fast_syscall_common() at fast_syscall_common+0x101/frame 0xfffffe0028e13bf0 >>>> So, db_nextframe() stopped recognizing the system call frame. >>>> This commit should fix that. >>>> >>>> Reviewed by: kib >>>> MFC after: 4 days >>>> >>>> Modified: >>>> head/sys/amd64/amd64/db_trace.c >>>> >>>> Modified: head/sys/amd64/amd64/db_trace.c >>>> ============================================================================== >>>> --- head/sys/amd64/amd64/db_trace.c Sat Mar 3 13:20:44 2018 (r330337) >>>> +++ head/sys/amd64/amd64/db_trace.c Sat Mar 3 15:10:37 2018 (r330338) >>>> @@ -212,7 +212,9 @@ db_nextframe(struct amd64_frame **fp, db_addr_t *ip, s >>>> strcmp(name, "Xcpususpend") == 0 || >>>> strcmp(name, "Xrendezvous") == 0) >>>> frame_type = INTERRUPT; >>>> - else if (strcmp(name, "Xfast_syscall") == 0) >>>> + else if (strcmp(name, "Xfast_syscall") == 0 || >>>> + strcmp(name, "Xfast_syscall_pti") == 0 || >>>> + strcmp(name, "fast_syscall_common") == 0) >>>> frame_type = SYSCALL; >>> >>> I think you actually just want to replace Xfast_syscall with >>> fast_syscall_common. Neither Xfast_syscall nor Xfast_syscall_pti call any >>> functions before jumping to the common label, so when unwinding from a system >>> call you should always get the common label. (That is, I think we should >>> remove Xfast_syscall and Xfast_syscall_pti here. Any stack trace that >>> happens to find those symbols during unwinding won't have a valid SYSCALL >>> frame to unwind.) >> >> No, it needs these symbols to decode the frame after reaching a point where >> the frame is actually set up. > > My point is that during the instructions from Xfast_syscall to fast_syscall_common > there isn't a valid frame. I know. > Xfast_syscall has two instructions and hasn't yet > decremented %rsp to create room for the trapframe for example. If you wanted to > handle the special case of stepping through those functions you'd have to create > a new type of frame that used register values from the saved frame for the > debug trap. You can't assume that there's a 'struct trapframe' at 'rbp + 16'. In my version (only written for i386 so far), the strcmp()s are not even reached for syscalls since t is known and discovered that there is no trapframe at [er]bp + 16 (since that is not in the kernel stack). For nested exceptions, [er]bp + 16 is on the kernel stack and the trap printing for the reentry is bogus before the frame is set up, but ebp is now a usually-good frame for the interrupted context and the backtrace continues (as in -current) back to the top frame with no further problems except for a wrong name at the top level caused by cross-jumping. >> Also, in uncommitted fixes I add some decoding of the non-frame between >> the entry point and when the frame is set up. Then the frame register >> is still the user's for the syscall case, so should not even be accessed. >> The i386 output looks like this: >> >> current: >> XX12: Breakpoint at Xint0x80_syscall: pushl $0x2 >> XX12: db> t >> XX12: Tracing pid 1 tid 100001 td 0xc6fad000 >> XX12: Xint0x80_syscall(33,282,bfbfee0c,3b,0,...) at Xint0x80_syscall/frame 0xd1d05bd8 >> XX12: kernload(2,bfbfeec4,bfbfeed0,804812b,80a3d64,...) at 0x805188f/frame 0xbfbfee7c >> >> fixed: >> XX12F: Breakpoint at Xint0x80_syscall: pushl $0x2 >> XX12F: db> t >> XX12F: Tracing pid 1 tid 100001 td 0xd4c23000 >> XX12F: Xint0x80_syscall(2,bfbfeec4,bfbfeed0,804812b,80a3d64,...) at Xint0x80_syscall/frame 0xbfbfee7c >> XX12F: --- unknown trap, ebp = 0xbfbfee7c, sp = 0xd3399bdc, ks = 0xd3398000, kse = 0xd339a000 --- >> >> where most of the values on the last line are for debugging (ebp is the user >> stack pointer which will become inaccessible, sp is the local variable sp >> and [ks, kse - 1] is the thread's kernel stack range (sp must be in this >> else the backtrace stops). > > Yes, both of these symbols would only be found instructions for this type of > special frame. Using the 'SYSCALL' frame type for the Xfast_syscall* symbols > would always be wrong. Until such time as we have the new frame type we should > just ignore them. It's to have to have a new frame type. Setting up the frame takes 20-50 or more instructions and there is a different frame type at every instruction, possibly multiplied by different setups for different entries (similarly for doreti except it clearly has only one exit). (i386 is still optimized for the original i386 or possibly 8088's so it sets up the frame using lots of pushls and the offsets from esp change at every step. amd64 reserves space for the frame, but the frame contains garbage intil it is filled in and the order is unlikely to be to fill in ebp first so that the frame is usable for tracing early.) It is the cross-jump targets like fast_syscall_common that should be ignorded. This is easy to do by obfuscating their names as 1: or .Lfoo. This hides the name of one of the entry points for Xfast_syscall* instead of both. Xfast_syscall is last, so it is Xfast_syscall_pti that is hidden. This is least worst. The difference is small unless you are debugging pti and then all hidings of names are equally bad. Cross-jumping also breaks mcounting. mcount() follows the [er]bp chain in an even simpler way than backtrace. It knows nothing of frames and uses a different buggy method of determining kernel (instruction pointer) addresses: it checks the kernel's low and high pc recorded in the data where backtrace use INKERNEL(). Both assume a single flat address space for the kernel and user. I fixed this for backtrace by checking stack addresses instead of instruction pointer addresses. mcount() looks up the instruction pointer at each step so currently finds the cross-jump target fast_syscall_common instead of either actual entry point. ALTENTRY() has complications to separate the entry points for function calls, and CROSSJUMP*() is supposed to be used for cross-jumps, but CROSSJUMP*() is no useable before the frame is set up. CROSSJUMP*() is hard to use. It is better to not use cross jumps. Most uses were for the idle loop and went away when that was moved to C. All uses went away, although i386 needs at least 1 and amd64 probably needs many. I fixed 1 on i386 in some trees, but couldn't use CROSSJMP*() since it isn't general/complicated enough. >> Jumps and labels with names inside functions complicate things. I think >> fast_syscall_common needs to be in the list too, and the many alltraps >> labels should have been there. This will be more useful with my fix. >> ... See my other reply. It said that alltraps indeed causes problems for backtraces. > gdb does depend on the names, and I was looking at this commit again to see if > I needed to update gdb. I thought I didn't, but now I see that gdb was depending > on the 'X' prefix for the old Xfast_syscall name and it now needs to check for > fast_syscall_common directly. The X checks are dangerously general, but show another problem: the names of all entry points and pseudo-entry points should begin with X so that all versions of kgdb can find them. calltrap is handled quite differently on amd64 and i386. On amd64, it is treated like a normal entry point while on i386 it is treated like a double fault. i386 also uses calltrap to detect the change of the frame arg of trap() from direct to indirect. amd64 has the same change, but kgdb doesn't seem to detect it. Detecting it using the same method would be difficult since args are hard to find on amd64. Cross-jumps can be avoided using function calls, but that would be a bit slower. This method is already essentially used for interrupts -- call something and then do not much cleanup before jumping to doreti. Optimizations to avoid this call are not attempted. Bruce From owner-svn-src-head@freebsd.org Sat Mar 10 06:35: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 1B5E8F292F0; Sat, 10 Mar 2018 06:35:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 77E478605B; Sat, 10 Mar 2018 06:35:57 +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 mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 2872B1049F85; Sat, 10 Mar 2018 17:35:56 +1100 (AEDT) Date: Sat, 10 Mar 2018 17:35:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Mike Karels cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330712 - head/bin/ps In-Reply-To: <201803100010.w2A0AlkF008785@repo.freebsd.org> Message-ID: <20180310171525.R971@besplex.bde.org> References: <201803100010.w2A0AlkF008785@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VJytp5HX c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=eLFt2R2capelzvn5pO4A:9 a=J6VmII6G4GYPtRYm:21 a=EOEuclWW4B7WC7QA:21 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: Sat, 10 Mar 2018 06:35:59 -0000 On Sat, 10 Mar 2018, Mike Karels wrote: > ... > Log: > Change ps(1) output width to unlimited if not interactive > ... > Modified: head/bin/ps/ps.1 > ============================================================================== > --- head/bin/ps/ps.1 Fri Mar 9 23:37:19 2018 (r330711) > +++ head/bin/ps/ps.1 Sat Mar 10 00:10:47 2018 (r330712) > @@ -101,6 +101,14 @@ The default output format includes, for each process, > controlling terminal, state, CPU time (including both user and system time) > and associated command. > .Pp > +If the > +.Nm > +process is associated with a terminal, the default output width is that of the > +terminal; otherwise the output width is unlimited. It is unclear how a process is assocated with a terminal and thus what this width is. For ps, unlike for most programs, a process is associated with a terminal iff any of the 3 standard file descriptors is a terminal that supports the TIOCGWINSZ ioctl, and the width of the preferred one is not 0. The preferred one is the first of STDOUT_FILENO, STDERR_FILENO and STDIN_FILENO that supports the ioctl. BUGS: if the first one somehow has width 0, then the process is considered as not being associated with a terminal even of a later one has a nonzero width. > ... > Modified: head/bin/ps/ps.c > ============================================================================== > --- head/bin/ps/ps.c Fri Mar 9 23:37:19 2018 (r330711) > +++ head/bin/ps/ps.c Sat Mar 10 00:10:47 2018 (r330712) > @@ -202,6 +202,11 @@ main(int argc, char *argv[]) > * any of stdout, stderr, or stdin is a terminal. The intent > * is that "ps", "ps | more", and "ps | grep" all use the same > * default line length unless -w is specified. > + * > + * If not interactive, the default length was traditionally 79. > + * It has been changed to unlimited. This is mostly for the > + * benefit of non-interactive scripts, which arguably should > + * use -ww, but is compatible with Linux. > */ This belongs in the HOSTORY section of the man page, with version info for the change. Bruce From owner-svn-src-head@freebsd.org Sat Mar 10 06:49: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 7715AF29C4E for ; Sat, 10 Mar 2018 06:49:46 +0000 (UTC) (envelope-from ilya@bakulin.de) Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com [IPv6:2a00:1450:4010:c07::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2EE686770 for ; Sat, 10 Mar 2018 06:49:45 +0000 (UTC) (envelope-from ilya@bakulin.de) Received: by mail-lf0-x230.google.com with SMTP id m69-v6so16158405lfe.8 for ; Fri, 09 Mar 2018 22:49:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bakulin-de.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MWLAUHNPwpFNpLF4Rv9L5oZrptorCBJ4Sh+iJhlbeqY=; b=BO8LBwjqi9LnQEGR+BuVgiN5j4qulP82iZvkX+bnRAO3YTXzKe8pbQ+fdldcoRQb98 u6F8AFFcNEVX+kVvwf3YdUyd8ZiZ1ySjOSUj1mfnxwLMHSxbxP1PkqrV0/vG4bMNp52Y OSVmqk7wLYdeoSY/bWwSoaNcAboFkx3zJxpPKk3VnwgUN1BTQrFB5pTCeaiZsRcUtPlJ FM5V7yAMaQ1rv/smDb/i8aTYf51L3XCUajBjk8Yrf6umx2M6bKOfgDqgLw15ufCsayKD BLeivjD720U/y+h9FwllxxpAXp5k9LUJyzvhzApaB0t2QtltYr+QqXTJWQSO6ii+6oXT GEag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MWLAUHNPwpFNpLF4Rv9L5oZrptorCBJ4Sh+iJhlbeqY=; b=ihz4FYsk0XnmBfxvLboOweKWOVjdZeWF+HUrqqW410bbT4hCxTVajeMC37Eff0qVVQ Y63tjYlfTZpqF62HeViJ+yop9reD+DI6GS+IVguX4bJoskKlBWB+TMbWegD7GyVgtq2P XJz5IsK9CmF4E5N3V1E616RaIaDepmUbi+mPMRAG64yqsNhwQob9oVSmbOSBh1q0mj/N u7tQTX0UxM8lB9VMmPxO0XSaVgYto6JQcoMxaWGjQDwHS0/swADggZigNv0aBK3JAQpK jYTJgzC8ukOjT79q5T5gnWLJ9ptp0QZyvs42Lq0evd4NWdePa6u/bNCe+UARorJ6i4O1 PTFA== X-Gm-Message-State: AElRT7HXBD7QkUYomVASvSQXGOo7XkJo/8VyMlvZRa6rFEWuHL0T3t5t 9CwfIyYzY5GR1lIuBxUMpn5kJP4YUF+xG+iGeC9FFg== X-Google-Smtp-Source: AG47ELuZ0Bq1U2A/7zOk371yyIYPnbEYEG8HVuHt+TW+bXMrw0gAyaS6053Mg1AlPEpDlqNeREXAPNTA6c7JNkphqo0= X-Received: by 10.46.16.74 with SMTP id j71mr656817lje.139.1520664583970; Fri, 09 Mar 2018 22:49:43 -0800 (PST) MIME-Version: 1.0 References: <201803091530.w29FUKin041283@repo.freebsd.org> In-Reply-To: <201803091530.w29FUKin041283@repo.freebsd.org> From: Ilya Bakulin Date: Sat, 10 Mar 2018 06:49:33 +0000 Message-ID: Subject: Re: svn commit: r330696 - in head/libexec/tftpd: . tests To: Alan Somers 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: Sat, 10 Mar 2018 06:49:47 -0000 This broke build for at least ARM. Fix: diff --git a/libexec/tftpd/tests/functional.c b/libexec/tftpd/tests/functional.c index fea6870cac59..c467dfee3ba0 100644 --- a/libexec/tftpd/tests/functional.c +++ b/libexec/tftpd/tests/functional.c @@ -248,10 +248,10 @@ require_bufeq(const char *expected, ssize_t expected_len, const char *actual, ssize_t i; ATF_REQUIRE_EQ_MSG(expected_len, len, - "Expected %ld bytes but got %ld", expected_len, len); + "Expected %zd bytes but got %zd", expected_len, len); for (i = 0; i < len; i++) { ATF_REQUIRE_EQ_MSG(actual[i], expected[i], - "Expected %#hhx at position %ld; got %hhx instead", + "Expected %#hhx at position %zd; got %hhx instead", expected[i], i, actual[i]); } } On Sat, Mar 10, 2018 at 12:30 AM Alan Somers wrote: > Author: asomers > Date: Fri Mar 9 15:30:20 2018 > New Revision: 330696 > URL: https://svnweb.freebsd.org/changeset/base/330696 > > Log: > Add some functional tests for tftpd(8) > > tftpd(8) is difficult to test in isolation due to its relationship with > inetd. Create a test program that mimics the behavior of tftp(1) and > inetd(8) and verifies tftpd's response in several different scenarios. > > These test cases cover all of the basic TFTP protocol, but not the > optional > parts. > > PR: 157700 > PR: 225996 > PR: 226004 > PR: 226005 > MFC after: 3 weeks > Differential Revision: https://reviews.freebsd.org/D14310 > > Added: > head/libexec/tftpd/tests/ > head/libexec/tftpd/tests/Makefile (contents, props changed) > head/libexec/tftpd/tests/functional.c (contents, props changed) > Modified: > head/libexec/tftpd/Makefile > > Modified: head/libexec/tftpd/Makefile > > ============================================================================== > --- head/libexec/tftpd/Makefile Fri Mar 9 14:45:47 2018 (r330695) > +++ head/libexec/tftpd/Makefile Fri Mar 9 15:30:20 2018 (r330696) > @@ -14,4 +14,7 @@ CFLAGS+= -DLIBWRAP > LIBADD= wrap > .endif > > +HAS_TESTS= > +SUBDIR.${MK_TESTS}+= tests > + > .include > > Added: head/libexec/tftpd/tests/Makefile > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/libexec/tftpd/tests/Makefile Fri Mar 9 15:30:20 2018 > (r330696) > @@ -0,0 +1,14 @@ > +# $FreeBSD$ > + > +.include > + > +# Skip on GCC 4.2, because it lacks __COUNTER__ > +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40300 > +ATF_TESTS_C= functional > +TEST_METADATA.functional+= timeout=15 > +.endif > + > +LIBADD= util > +WARNS?= 6 > + > +.include > > Added: head/libexec/tftpd/tests/functional.c > > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/libexec/tftpd/tests/functional.c Fri Mar 9 15:30:20 2018 > (r330696) > @@ -0,0 +1,1006 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2018 Alan Somers. All rights reserved. > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND > + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE > + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR > PURPOSE > + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE > + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR > CONSEQUENTIAL > + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS > + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) > + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, > STRICT > + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY > WAY > + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF > + * SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > + > +#include > + > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +static const uint16_t BASEPORT = 6969; > +static const char pidfile[] = "tftpd.pid"; > +static int protocol = PF_UNSPEC; > +static int s = -1; /* tftp client socket */ > +static struct sockaddr_storage addr; /* Destination address for the > client */ > +static bool s_flag = false; /* Pass -s to tftpd */ > +static bool w_flag = false; /* Pass -w to tftpd */ > + > +/* Helper functions*/ > +static void require_bufeq(const char *expected, ssize_t expected_len, > + const char *actual, ssize_t len); > + > +/* > + * Receive a response from tftpd > + * @param hdr The reply's expected header, as a char > array > + * @param contents The reply's expected contents, as a char > array > + * @param contents_len Length of contents > + */ > +#define RECV(hdr, contents, contents_len) do { \ > + char buffer[1024]; \ > + struct sockaddr_storage from; \ > + socklen_t fromlen = sizeof(from); \ > + ssize_t r = recvfrom(s, buffer, sizeof(buffer), 0, \ > + (struct sockaddr*)&from, &fromlen); \ > + ATF_REQUIRE(r > 0); \ > + require_bufeq((hdr), sizeof(hdr), buffer, \ > + MIN(r, (ssize_t)sizeof(hdr))); \ > + require_bufeq((const char*) (contents), (contents_len), \ > + &buffer[sizeof(hdr)], r - sizeof(hdr)); \ > + if (protocol == PF_INET) { \ > + ((struct sockaddr_in*)&addr)->sin_port = \ > + ((struct sockaddr_in*)&from)->sin_port; \ > + } else { \ > + ((struct sockaddr_in6*)&addr)->sin6_port = \ > + ((struct sockaddr_in6*)&from)->sin6_port; \ > + } \ > +} while(0) > + > +static void > +recv_ack(uint16_t blocknum) > +{ > + char hdr[] = {0, 4, blocknum >> 8, blocknum & 0xFF}; > + RECV(hdr, NULL, 0); > +} > + > +/* > + * Receive a data packet from tftpd > + * @param blocknum Expected block number to be received > + * @param contents Pointer to expected contents > + * @param contents_len Length of contents expected to receive > + */ > +static void > +recv_data(uint16_t blocknum, const char* contents, size_t contents_len) > +{ > + char hdr[] = {0, 3, blocknum >> 8, blocknum & 0xFF}; > + RECV(hdr, contents, contents_len); > +} > + > +#define RECV_ERROR(code, msg) do { \ > + char hdr[] = {0, 5, code >> 8, code & 0xFF}; \ > + RECV(hdr, msg, sizeof(msg)); \ > +} while (0) > + > +/* > + * send a command to tftpd. > + * @param cmd Command to send, as a char array > + */ > +static void > +send_bytes(const void* cmd, ssize_t len) > +{ > + ssize_t r; > + > + r = sendto(s, cmd, len, 0, (struct sockaddr*)(&addr), addr.ss_len); > + ATF_REQUIRE_EQ(r, len); > +} > + > +static void > +send_data(uint16_t blocknum, const char* contents, size_t contents_len) > +{ > + char buffer[1024]; > + > + buffer[0] = 0; /* DATA opcode high byte */ > + buffer[1] = 3; /* DATA opcode low byte */ > + buffer[2] = blocknum >> 8; > + buffer[3] = blocknum & 0xFF; > + memmove(&buffer[4], contents, contents_len); > + send_bytes(buffer, 4 + contents_len); > +} > + > +/* > + * send a command to tftpd. > + * @param cmd Command to send, as a const string > + * (terminating NUL will be ignored) > + */ > +#define SEND_STR(cmd) ATF_REQUIRE_EQ( \ > + sendto(s, (cmd), sizeof(cmd) - 1, 0, (struct sockaddr*)(&addr), \ > + addr.ss_len), \ > + sizeof(cmd) - 1) > + > +/* > + * Acknowledge block blocknum > + */ > +static void > +send_ack(uint16_t blocknum) > +{ > + char packet[] = { > + 0, 4, /* ACK opcode in BE */ > + blocknum >> 8, > + blocknum & 0xFF > + }; > + > + send_bytes(packet, sizeof(packet)); > + > +} > + > +/* > + * send a read request to tftpd. > + * @param filename filename as a string, absolute or relative > + * @param mode either "octet" or "netascii" > + */ > +#define SEND_RRQ(filename, mode) SEND_STR("\0\001" filename "\0" mode > "\0") > + > +/* > + * send a write request to tftpd. > + * @param filename filename as a string, absolute or relative > + * @param mode either "octet" or "netascii" > + */ > +#define SEND_WRQ(filename, mode) SEND_STR("\0\002" filename "\0" mode > "\0") > + > +/* Define a test case, for both IPv4 and IPv6 */ > +#define TFTPD_TC_DEFINE(name, head, ...) \ > +static void \ > +name ## _body(void); \ > +ATF_TC_WITH_CLEANUP(name ## _v4); \ > +ATF_TC_HEAD(name ## _v4, tc) \ > +{ \ > + head \ > +} \ > +ATF_TC_BODY(name ## _v4, tc) \ > +{ \ > + __VA_ARGS__; \ > + protocol = AF_INET; \ > + s = setup(&addr, __COUNTER__); \ > + name ## _body(); \ > + close(s); \ > +} \ > +ATF_TC_CLEANUP(name ## _v4, tc) \ > +{ \ > + cleanup(); \ > +} \ > +ATF_TC_WITH_CLEANUP(name ## _v6); \ > +ATF_TC_HEAD(name ## _v6, tc) \ > +{ \ > + head \ > +} \ > +ATF_TC_BODY(name ## _v6, tc) \ > +{ \ > + __VA_ARGS__; \ > + protocol = AF_INET6; \ > + s = setup(&addr, __COUNTER__); \ > + name ## _body(); \ > + close(s); \ > +} \ > +ATF_TC_CLEANUP(name ## _v6, tc) \ > +{ \ > + cleanup(); \ > +} \ > +static void \ > +name ## _body(void) > + > +/* Add the IPv4 and IPv6 versions of a test case */ > +#define TFTPD_TC_ADD(tp, name ) \ > +do { \ > + ATF_TP_ADD_TC(tp, name ## _v4); \ > + ATF_TP_ADD_TC(tp, name ## _v6); \ > +} while (0) > + > +/* Standard cleanup used by all testcases */ > +static void > +cleanup(void) > +{ > + int fd = -1; > + char buffer[80] = {0}; > + pid_t pid; > + > + fd = open(pidfile, O_RDONLY); > + if (fd < 0) > + return; > + if (read(fd, buffer, sizeof(buffer)) > 0) { > + sscanf(buffer, "%d", &pid); > + kill(pid, SIGTERM); > + waitpid(pid, NULL, 0); > + } > + close(fd); > + unlink(pidfile); > +} > + > +/* Assert that two binary buffers are identical */ > +static void > +require_bufeq(const char *expected, ssize_t expected_len, const char > *actual, > + ssize_t len) > +{ > + ssize_t i; > + > + ATF_REQUIRE_EQ_MSG(expected_len, len, > + "Expected %ld bytes but got %ld", expected_len, len); > + for (i = 0; i < len; i++) { > + ATF_REQUIRE_EQ_MSG(actual[i], expected[i], > + "Expected %#hhx at position %ld; got %hhx instead", > + expected[i], i, actual[i]); > + } > +} > + > +/* > + * Start tftpd and return its communicating socket > + * @param to Will be filled in for use with sendto > + * @param idx Unique identifier of the test case > + * @return Socket ready to use > + */ > +static int > +setup(struct sockaddr_storage *to, uint16_t idx) > +{ > + int client_s, server_s, pid, argv_idx; > + char execname[] = "/usr/libexec/tftpd"; > + char s_flag_str[] = "-s"; > + char w_flag_str[] = "-w"; > + char pwd[MAXPATHLEN]; > + char *argv[10]; > + struct sockaddr_in addr4; > + struct sockaddr_in6 addr6; > + struct sockaddr *server_addr; > + struct pidfh *pfh; > + uint16_t port = BASEPORT + idx; > + socklen_t len; > + > + if (protocol == PF_INET) { > + len = sizeof(addr4); > + bzero(&addr4, len); > + addr4.sin_len = len; > + addr4.sin_family = PF_INET; > + addr4.sin_port = htons(port); > + server_addr = (struct sockaddr*)&addr4; > + } else { > + len = sizeof(addr6); > + bzero(&addr6, len); > + addr6.sin6_len = len; > + addr6.sin6_family = PF_INET6; > + addr6.sin6_port = htons(port); > + server_addr = (struct sockaddr*)&addr6; > + } > + > + ATF_REQUIRE_EQ(getcwd(pwd, sizeof(pwd)), pwd); > + > + /* Must bind(2) pre-fork so it happens before the client's send(2) > */ > + ATF_REQUIRE((server_s = socket(protocol, SOCK_DGRAM, 0)) > 0); > + ATF_REQUIRE_EQ_MSG(bind(server_s, server_addr, len), 0, > + "bind failed with error %s", strerror(errno)); > + > + pid = fork(); > + switch (pid) { > + case -1: > + atf_tc_fail("fork failed"); > + break; > + case 0: > + /* In child */ > + pfh = pidfile_open(pidfile, 0644, NULL); > + ATF_REQUIRE_MSG(pfh != NULL, > + "pidfile_open: %s", strerror(errno)); > + ATF_REQUIRE_EQ(pidfile_write(pfh), 0); > + ATF_REQUIRE_EQ(pidfile_close(pfh), 0); > + > + bzero(argv, sizeof(argv)); > + argv[0] = execname; > + argv_idx = 1; > + if (w_flag) > + argv[argv_idx++] = w_flag_str; > + if (s_flag) > + argv[argv_idx++] = s_flag_str; > + argv[argv_idx++] = pwd; > + ATF_REQUIRE_EQ(dup2(server_s, STDOUT_FILENO), > STDOUT_FILENO); > + ATF_REQUIRE_EQ(dup2(server_s, STDIN_FILENO), STDIN_FILENO); > + ATF_REQUIRE_EQ(dup2(server_s, STDERR_FILENO), > STDERR_FILENO); > + execv(execname, argv); > + atf_tc_fail("exec failed"); > + break; > + default: > + /* In parent */ > + bzero(to, sizeof(*to)); > + if (protocol == PF_INET) { > + struct sockaddr_in *to4 = (struct sockaddr_in*)to; > + to4->sin_len = sizeof(*to4); > + to4->sin_family = PF_INET; > + to4->sin_port = htons(port); > + to4->sin_addr.s_addr = htonl(INADDR_LOOPBACK); > + } else { > + struct in6_addr loopback = IN6ADDR_LOOPBACK_INIT; > + struct sockaddr_in6 *to6 = (struct > sockaddr_in6*)to; > + to6->sin6_len = sizeof(*to6); > + to6->sin6_family = PF_INET6; > + to6->sin6_port = htons(port); > + to6->sin6_addr = loopback; > + } > + > + close(server_s); > + ATF_REQUIRE((client_s = socket(protocol, SOCK_DGRAM, 0)) > > 0); > + break; > + } > + return (client_s); > +} > + > +/* Like write(2), but never returns less than the requested length */ > +static void > +write_all(int fd, const void *buf, size_t nbytes) > +{ > + ssize_t r; > + > + while (nbytes > 0) { > + r = write(fd, buf, nbytes); > + ATF_REQUIRE(r > 0); > + nbytes -= r; > + buf = (const char*)buf + r; > + } > +} > + > + > +/* > + * Test Cases > + */ > + > +/* > + * Read a file, specified by absolute pathname. > + */ > +TFTPD_TC_DEFINE(abspath,) > +{ > + int fd; > + char command[1024]; > + size_t pathlen; > + char suffix[] = {'\0', 'o', 'c', 't', 'e', 't', '\0'}; > + > + command[0] = 0; /* RRQ high byte */ > + command[1] = 1; /* RRQ low byte */ > + ATF_REQUIRE(getcwd(&command[2], sizeof(command) - 2) != NULL); > + pathlen = strlcat(&command[2], "/abspath.txt", sizeof(command) - > 2); > + ATF_REQUIRE(pathlen + sizeof(suffix) < sizeof(command) - 2); > + memmove(&command[2 + pathlen], suffix, sizeof(suffix)); > + > + fd = open("abspath.txt", O_CREAT | O_RDONLY, 0644); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + > + send_bytes(command, 2 + pathlen + sizeof(suffix)); > + recv_data(1, NULL, 0); > + send_ack(1); > +} > + > +/* > + * Attempt to read a file outside of the allowed directory(ies) > + */ > +TFTPD_TC_DEFINE(dotdot,) > +{ > + ATF_REQUIRE_EQ(mkdir("subdir", 0777), 0); > + SEND_RRQ("../disallowed.txt", "octet"); > + RECV_ERROR(2, "Access violation"); > + s = setup(&addr, __COUNTER__); \ > + SEND_RRQ("subdir/../../disallowed.txt", "octet"); > + RECV_ERROR(2, "Access violation"); > + s = setup(&addr, __COUNTER__); \ > + SEND_RRQ("/etc/passwd", "octet"); > + RECV_ERROR(2, "Access violation"); > +} > + > +/* > + * With "-s", tftpd should chroot to the specified directory > + */ > +TFTPD_TC_DEFINE(s_flag, atf_tc_set_md_var(tc, "require.user", "root");, > + s_flag = true) > +{ > + int fd; > + char contents[] = "small"; > + > + fd = open("small.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + write_all(fd, contents, strlen(contents) + 1); > + close(fd); > + > + SEND_RRQ("/small.txt", "octet"); > + recv_data(1, contents, strlen(contents) + 1); > + send_ack(1); > +} > + > +/* > + * Read a file, and simulate a dropped ACK packet > + */ > +TFTPD_TC_DEFINE(rrq_dropped_ack,) > +{ > + int fd; > + char contents[] = "small"; > + > + fd = open("small.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + write_all(fd, contents, strlen(contents) + 1); > + close(fd); > + > + SEND_RRQ("small.txt", "octet"); > + recv_data(1, contents, strlen(contents) + 1); > + /* > + * client "sends" the ack, but network drops it > + * Eventually, tftpd should resend the data packet > + */ > + recv_data(1, contents, strlen(contents) + 1); > + send_ack(1); > +} > + > +/* > + * Read a file, and simulate a dropped DATA packet > + */ > +TFTPD_TC_DEFINE(rrq_dropped_data,) > +{ > + int fd; > + size_t i; > + uint32_t contents[192]; > + char buffer[1024]; > + > + for (i = 0; i < nitems(contents); i++) > + contents[i] = i; > + > + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + write_all(fd, contents, sizeof(contents)); > + close(fd); > + > + SEND_RRQ("medium.txt", "octet"); > + recv_data(1, (const char*)&contents[0], 512); > + send_ack(1); > + (void) recvfrom(s, buffer, sizeof(buffer), 0, NULL, NULL); > + /* > + * server "sends" the data, but network drops it > + * Eventually, client should resend the last ACK > + */ > + send_ack(1); > + recv_data(2, (const char*)&contents[128], 256); > + send_ack(2); > +} > + > +/* > + * Read a medium file, and simulate a duplicated ACK packet > + */ > +TFTPD_TC_DEFINE(rrq_duped_ack,) > +{ > + int fd; > + size_t i; > + uint32_t contents[192]; > + > + for (i = 0; i < nitems(contents); i++) > + contents[i] = i; > + > + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + write_all(fd, contents, sizeof(contents)); > + close(fd); > + > + SEND_RRQ("medium.txt", "octet"); > + recv_data(1, (const char*)&contents[0], 512); > + send_ack(1); > + send_ack(1); /* Dupe an ACK packet */ > + recv_data(2, (const char*)&contents[128], 256); > + recv_data(2, (const char*)&contents[128], 256); > + send_ack(2); > +} > + > + > +/* > + * Attempt to read a file without read permissions > + */ > +TFTPD_TC_DEFINE(rrq_eaccess,) > +{ > + int fd; > + > + fd = open("empty.txt", O_CREAT | O_RDONLY, 0000); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + > + SEND_RRQ("empty.txt", "octet"); > + RECV_ERROR(2, "Access violation"); > +} > + > +/* > + * Read an empty file > + */ > +TFTPD_TC_DEFINE(rrq_empty,) > +{ > + int fd; > + > + fd = open("empty.txt", O_CREAT | O_RDONLY, 0644); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + > + SEND_RRQ("empty.txt", "octet"); > + recv_data(1, NULL, 0); > + send_ack(1); > +} > + > +/* > + * Read a medium file of more than one block > + */ > +TFTPD_TC_DEFINE(rrq_medium,) > +{ > + int fd; > + size_t i; > + uint32_t contents[192]; > + > + for (i = 0; i < nitems(contents); i++) > + contents[i] = i; > + > + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + write_all(fd, contents, sizeof(contents)); > + close(fd); > + > + SEND_RRQ("medium.txt", "octet"); > + recv_data(1, (const char*)&contents[0], 512); > + send_ack(1); > + recv_data(2, (const char*)&contents[128], 256); > + send_ack(2); > +} > + > +/* > + * Read a file in netascii format > + */ > +TFTPD_TC_DEFINE(rrq_netascii,) > +{ > + int fd; > + char contents[] = "foo\nbar\rbaz\n"; > + /* > + * Weirdly, RFC-764 says that CR must be followed by NUL if a line > feed > + * is not intended > + */ > + char expected[] = "foo\r\nbar\r\0baz\r\n"; > + > + fd = open("unix.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + write_all(fd, contents, strlen(contents) + 1); > + close(fd); > + > + SEND_RRQ("unix.txt", "netascii"); > + recv_data(1, expected, sizeof(expected)); > + send_ack(1); > +} > + > +/* > + * Read a file that doesn't exist > + */ > +TFTPD_TC_DEFINE(rrq_nonexistent,) > +{ > + SEND_RRQ("nonexistent.txt", "octet"); > + RECV_ERROR(1, "File not found"); > +} > + > +/* > + * Attempt to read a file whose name exceeds PATH_MAX > + */ > +TFTPD_TC_DEFINE(rrq_path_max,) > +{ > +#define AReallyBigFileName \ > + > "AReallyBigFileNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + > "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"\ > + ".txt" > + ATF_REQUIRE_MSG(strlen(AReallyBigFileName) > PATH_MAX, > + "Somebody increased PATH_MAX. Update the test"); > + SEND_RRQ(AReallyBigFileName, "octet"); > + RECV_ERROR(4, "Illegal TFTP operation"); > +} > + > +/* > + * Read a small file of less than one block > + */ > +TFTPD_TC_DEFINE(rrq_small,) > +{ > + int fd; > + char contents[] = "small"; > + > + fd = open("small.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + write_all(fd, contents, strlen(contents) + 1); > + close(fd); > + > + SEND_RRQ("small.txt", "octet"); > + recv_data(1, contents, strlen(contents) + 1); > + send_ack(1); > +} > + > +/* > + * Try to transfer a file with an unknown mode. > + */ > +TFTPD_TC_DEFINE(unknown_modes,) > +{ > + SEND_RRQ("foo.txt", "ascii"); /* Misspelling of "ascii" */ > + RECV_ERROR(4, "Illegal TFTP operation"); > + s = setup(&addr, __COUNTER__); \ > + SEND_RRQ("foo.txt", "binary"); /* Obsolete. Use "octet" instead > */ > + RECV_ERROR(4, "Illegal TFTP operation"); > + s = setup(&addr, __COUNTER__); \ > + SEND_RRQ("foo.txt", "en_US.UTF-8"); > + RECV_ERROR(4, "Illegal TFTP operation"); > + s = setup(&addr, __COUNTER__); \ > + SEND_RRQ("foo.txt", "mail"); /* Obsolete in RFC-1350 */ > + RECV_ERROR(4, "Illegal TFTP operation"); > +} > + > +/* > + * Send an unknown opcode. tftpd should respond with the appropriate > error > + */ > +TFTPD_TC_DEFINE(unknown_opcode,) > +{ > + /* Looks like an RRQ or WRQ request, but with a bad opcode */ > + SEND_STR("\0\007foo.txt\0octet\0"); > + atf_tc_expect_timeout("PR 226005 tftpd ignores bad opcodes but > doesn't reject them"); > + RECV_ERROR(4, "Illegal TFTP operation"); > +} > + > +/* > + * Invoke tftpd with "-w" and write to a nonexistent file. > + */ > +TFTPD_TC_DEFINE(w_flag,, w_flag = 1;) > +{ > + int fd; > + ssize_t r; > + char contents[] = "small"; > + char buffer[1024]; > + size_t contents_len; > + > + contents_len = strlen(contents) + 1; > + SEND_WRQ("small.txt", "octet"); > + recv_ack(0); > + send_data(1, contents, contents_len); > + recv_ack(1); > + > + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); > + fd = open("small.txt", O_RDONLY); > + r = read(fd, buffer, sizeof(buffer)); > + close(fd); > + require_bufeq(contents, contents_len, buffer, r); > +} > + > +/* > + * Write a medium file, and simulate a dropped ACK packet > + */ > +TFTPD_TC_DEFINE(wrq_dropped_ack,) > +{ > + int fd; > + size_t i; > + ssize_t r; > + uint32_t contents[192]; > + char buffer[1024]; > + > + for (i = 0; i < nitems(contents); i++) > + contents[i] = i; > + > + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + > + SEND_WRQ("medium.txt", "octet"); > + recv_ack(0); > + send_data(1, (const char*)&contents[0], 512); > + /* > + * Servers "sends" an ACK packet, but network drops it. > + * Eventually, server should resend the last ACK > + */ > + (void) recvfrom(s, buffer, sizeof(buffer), 0, NULL, NULL); > + recv_ack(1); > + send_data(2, (const char*)&contents[128], 256); > + recv_ack(2); > + > + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); > + fd = open("medium.txt", O_RDONLY); > + r = read(fd, buffer, sizeof(buffer)); > + close(fd); > + require_bufeq((const char*)contents, 768, buffer, r); > +} > + > +/* > + * Write a small file, and simulate a dropped DATA packet > + */ > +TFTPD_TC_DEFINE(wrq_dropped_data,) > +{ > + int fd; > + ssize_t r; > + char contents[] = "small"; > + size_t contents_len; > + char buffer[1024]; > + > + fd = open("small.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + contents_len = strlen(contents) + 1; > + > + SEND_WRQ("small.txt", "octet"); > + recv_ack(0); > + /* > + * Client "sends" a DATA packet, but network drops it. > + * Eventually, server should resend the last ACK > + */ > + recv_ack(0); > + send_data(1, contents, contents_len); > + recv_ack(1); > + > + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); > + fd = open("small.txt", O_RDONLY); > + r = read(fd, buffer, sizeof(buffer)); > + close(fd); > + require_bufeq(contents, contents_len, buffer, r); > +} > + > +/* > + * Write a medium file, and simulate a duplicated DATA packet > + */ > +TFTPD_TC_DEFINE(wrq_duped_data,) > +{ > + int fd; > + size_t i; > + ssize_t r; > + uint32_t contents[192]; > + char buffer[1024]; > + > + for (i = 0; i < nitems(contents); i++) > + contents[i] = i; > + > + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + > + SEND_WRQ("medium.txt", "octet"); > + recv_ack(0); > + send_data(1, (const char*)&contents[0], 512); > + send_data(1, (const char*)&contents[0], 512); > + recv_ack(1); > + recv_ack(1); > + send_data(2, (const char*)&contents[128], 256); > + recv_ack(2); > + > + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); > + fd = open("medium.txt", O_RDONLY); > + r = read(fd, buffer, sizeof(buffer)); > + close(fd); > + require_bufeq((const char*)contents, 768, buffer, r); > +} > + > +/* > + * Attempt to write a file without write permissions > + */ > +TFTPD_TC_DEFINE(wrq_eaccess,) > +{ > + int fd; > + > + fd = open("empty.txt", O_CREAT | O_RDONLY, 0440); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + > + SEND_WRQ("empty.txt", "octet"); > + atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access " > + "violation"); > + RECV_ERROR(2, "Access violation"); > +} > + > +/* > + * Attempt to write a file without world write permissions, but with world > + * read permissions > + */ > +TFTPD_TC_DEFINE(wrq_eaccess_world_readable,) > +{ > + int fd; > + > + fd = open("empty.txt", O_CREAT | O_RDONLY, 0444); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + > + SEND_WRQ("empty.txt", "octet"); > + atf_tc_expect_fail("PR 226004 with relative pathnames, tftpd > doesn't validate world writability"); > + RECV_ERROR(2, "Access violation"); > +} > + > + > +/* > + * Write a medium file of more than one block > + */ > +TFTPD_TC_DEFINE(wrq_medium,) > +{ > + int fd; > + size_t i; > + ssize_t r; > + uint32_t contents[192]; > + char buffer[1024]; > + > + for (i = 0; i < nitems(contents); i++) > + contents[i] = i; > + > + fd = open("medium.txt", O_RDWR | O_CREAT, 0666); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + > + SEND_WRQ("medium.txt", "octet"); > + recv_ack(0); > + send_data(1, (const char*)&contents[0], 512); > + recv_ack(1); > + send_data(2, (const char*)&contents[128], 256); > + recv_ack(2); > + > + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); > + fd = open("medium.txt", O_RDONLY); > + r = read(fd, buffer, sizeof(buffer)); > + close(fd); > + require_bufeq((const char*)contents, 768, buffer, r); > +} > + > +/* > + * Write a file in netascii format > + */ > +TFTPD_TC_DEFINE(wrq_netascii,) > +{ > + int fd; > + ssize_t r; > + /* > + * Weirdly, RFC-764 says that CR must be followed by NUL if a line > feed > + * is not intended > + */ > + char contents[] = "foo\r\nbar\r\0baz\r\n"; > + char expected[] = "foo\nbar\rbaz\n"; > + size_t contents_len; > + char buffer[1024]; > + > + fd = open("unix.txt", O_RDWR | O_CREAT, 0666); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + contents_len = strlen(contents) + 1; > + > + SEND_WRQ("unix.txt", "netascii"); > + recv_ack(0); > + send_data(1, contents, contents_len); > + recv_ack(1); > + > + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); > + fd = open("unix.txt", O_RDONLY); > + r = read(fd, buffer, sizeof(buffer)); > + close(fd); > + require_bufeq(expected, sizeof(expected), buffer, r); > +} > + > +/* > + * Attempt to write to a nonexistent file. With the default options, this > + * isn't allowed. > + */ > +TFTPD_TC_DEFINE(wrq_nonexistent,) > +{ > + SEND_WRQ("nonexistent.txt", "octet"); > + atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access " > + "violation"); > + RECV_ERROR(1, "File not found"); > +} > + > +/* > + * Write a small file of less than one block > + */ > +TFTPD_TC_DEFINE(wrq_small,) > +{ > + int fd; > + ssize_t r; > + char contents[] = "small"; > + size_t contents_len; > + char buffer[1024]; > + > + fd = open("small.txt", O_RDWR | O_CREAT, 0666); > + ATF_REQUIRE(fd >= 0); > + close(fd); > + contents_len = strlen(contents) + 1; > + > + SEND_WRQ("small.txt", "octet"); > + recv_ack(0); > + send_data(1, contents, contents_len); > + recv_ack(1); > + > + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); > + fd = open("small.txt", O_RDONLY); > + r = read(fd, buffer, sizeof(buffer)); > + close(fd); > + require_bufeq(contents, contents_len, buffer, r); > +} > + > +/* > + * Write an empty file over a non-empty one > + */ > +TFTPD_TC_DEFINE(wrq_truncate,) > +{ > + int fd; > + char contents[] = "small"; > + struct stat sb; > + > + fd = open("small.txt", O_RDWR | O_CREAT, 0666); > + ATF_REQUIRE(fd >= 0); > + write_all(fd, contents, strlen(contents) + 1); > + close(fd); > + > + SEND_WRQ("small.txt", "octet"); > + recv_ack(0); > + send_data(1, NULL, 0); > + recv_ack(1); > + > + ATF_REQUIRE_EQ(stat("small.txt", &sb), 0); > + ATF_REQUIRE_EQ(sb.st_size, 0); > +} > + > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > From owner-svn-src-head@freebsd.org Sat Mar 10 06:56: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 CAB15F2A162; Sat, 10 Mar 2018 06:56:49 +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 0454F86C3E; Sat, 10 Mar 2018 06:56:48 +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 CC62CD4ADA2; Sat, 10 Mar 2018 17:56:38 +1100 (AEDT) Date: Sat, 10 Mar 2018 17:56:36 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bryan Drewery cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330722 - head/sys/conf In-Reply-To: <201803100209.w2A29aZ6068978@repo.freebsd.org> Message-ID: <20180310175603.A1308@besplex.bde.org> References: <201803100209.w2A29aZ6068978@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VJytp5HX c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=OktE5W1Amtd_KkKttNcA: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: Sat, 10 Mar 2018 06:56:50 -0000 On Sat, 10 Mar 2018, Bryan Drewery wrote: > Log: > Reduce overhead for simple 'make -V' lookups by avoiding 'find sys/'. > > Setting -DNO_SKIP_MPATH can be used for debugging. > > Reported by: bde Thanks. Bruce From owner-svn-src-head@freebsd.org Sat Mar 10 07: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 12D1DF2B15C for ; Sat, 10 Mar 2018 07:29:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x242.google.com (mail-yw0-x242.google.com [IPv6:2607:f8b0:4002:c05::242]) (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 A729387BE1 for ; Sat, 10 Mar 2018 07:29:15 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x242.google.com with SMTP id g198so2393891ywb.3 for ; Fri, 09 Mar 2018 23:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=RX5LswTUFS0Mlz9dkyYI6Krmb9Fm6KJG9nCJ2C+0GHY=; b=GT8jMs6VsqzRyhGPIPBMxyi9MTe+LpmKHIPTdqEvJDkahaR/+pE/wwXlsqC4N/EkPc oFlFR/fYS2WRu+nO29t11qpE+YxYjahhFPnpU5lkPhsyyoOLfexdFFBqXQIBsX/6gi6j 5slJAfn5fnwfE7uya07HwDMItv0bpzCDfzgjU= 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=RX5LswTUFS0Mlz9dkyYI6Krmb9Fm6KJG9nCJ2C+0GHY=; b=Zxk+Se1/6l5qDZ3hV4kAElsAlcwU6vsgBgBLjOnxQC/oBNUUlWRfKdWmVTJjI1aark uvnBjVGUe6uPq1von7Im+Bch2d4hPmRlnWUwYn/PJPmVRmo4EazKl0kfXmtwBMnPJrIA z9XCOOSfUcufT6m1+kLs6A3R0VeLilWJptBhOnDoia88xq6jrWKXgywXVvBERSJKHuDZ O/XjfwCgXJysDoHX5sd/F41+R023/N2YxtttTo3iofuaZn6Cn8RO+7TqwBmbB7WJdDTJ KF8g9WE9oUarO9UBTFH5ObtL46HwxvA27V6uz8Cj1Lx4SunmF2FlYyrTJOuYIdU4KHd3 Ip9g== X-Gm-Message-State: AElRT7G1d+LyzftBwLA4EQ1GPGPN0Oq1MIbAzPq4uiafcyylR7Fcp9Ca 1NcrylCJkBF7UyH29fivny6YnE8iV0OUZMWJ1DFP3Q== X-Google-Smtp-Source: AG47ELtUyZYQL5ayceQGDcOa3+aHY2Nujf2J9Bv1liw2krAQdv/sEpMVRJSdNwUm8VxHo+L6ZaQWT+xTn9/uME+R874= X-Received: by 2002:a25:accd:: with SMTP id x13-v6mr622490ybd.194.1520666954752; Fri, 09 Mar 2018 23:29:14 -0800 (PST) MIME-Version: 1.0 Received: by 2002:a25:23d2:0:0:0:0:0 with HTTP; Fri, 9 Mar 2018 23:28:44 -0800 (PST) In-Reply-To: References: <201801151925.w0FJPCKA019434@repo.freebsd.org> <20180309220940.GG6174@raichu> <1520634689.84937.74.camel@freebsd.org> From: Eitan Adler Date: Fri, 9 Mar 2018 23:28:44 -0800 Message-ID: Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs To: David Bright Cc: Ian Lepore , Mark Johnston , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-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 Mar 2018 07:29:16 -0000 On 9 March 2018 at 18:36, David Bright wrote: > On Mar 9, 2018, at 17:31, Ian Lepore wrote: >> >> On Fri, 2018-03-09 at 17:09 -0500, Mark Johnston wrote: >>> >>> etc/rc.d/fsck doesn't know how to interpret the new exit code and now >>> just drops to a single-user shell when it is encountered. [=E2=80=A6] >>> >>> Is there any reason etc/rc.d/fsck shouldn't automatically retry (up to > > This is, in fact, the reason that I made the change I did. I was trying t= o put in a retry loop to rc.d/fsck, but found that I couldn=E2=80=99t get i= t to work because fsck and fsck_ffs were not exiting with non-zero status. = The drop to single user is not really due to the specific (new) error code = of 16, it is due to the fact that fsck_ffs is now exiting with a non-zero s= tatus when it hasn=E2=80=99t completely cleaned the file system; /any/ non-= zero status would cause the current rc.d/fsck script to go to single user. = Prior to my change, fsck_ffs was exiting with a zero status even though it = had not completely cleaned the filesystem and told the user to run it again= . > >> >> fsck_ffs already has a -R flag to automatically retry, wouldn't that be >> a better mechanism for handling this new type of retry? > > That=E2=80=99s true; however, there is currently no way to pass that flag= through the filesystem-agnostic fsck wrapper called from rc.d/fsck to the = filesystem-specific fsck_ffs program that it calls. One could implement a s= imilar flag on the fsck wrapper to be passed along to the filesystem-specif= ic checker, but I think fsck_ffs is the only one that currently implements = such a flag. Why does it need to be filesystem specific? Can't the retry happen in the wrapper itself? --=20 Eitan Adler From owner-svn-src-head@freebsd.org Sat Mar 10 08:08: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 9D91BF2C727; Sat, 10 Mar 2018 08:08:36 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from APC01-PU1-obe.outbound.protection.outlook.com (mail-pu1apc01on0122.outbound.protection.outlook.com [104.47.126.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT TLS CA 4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5ECE1691F2; Sat, 10 Mar 2018 08:08:35 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM (10.170.167.17) by KL1P15301MB0039.APCP153.PROD.OUTLOOK.COM (10.170.168.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.9; Sat, 10 Mar 2018 08:08:17 +0000 Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) by KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) with mapi id 15.20.0588.008; Sat, 10 Mar 2018 08:08:17 +0000 From: Dexuan Cui To: Ed Maste , Dexuan-BSD Cui CC: Konstantin Belousov , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: RE: svn commit: r328625 - in head/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl i386/i386 x86/include x86/x86 Thread-Topic: svn commit: r328625 - in head/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl i386/i386 x86/include x86/x86 Thread-Index: AQHTuBNDhcc79JhUek+qyDjid1KkGaPJHNaw Date: Sat, 10 Mar 2018 08:08:17 +0000 Message-ID: References: <201801311436.w0VEaRrZ030839@repo.freebsd.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=decui@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2018-03-10T08:08:12.3768733Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General x-originating-ip: [2601:600:a27f:df20:5552:156f:4633:2a34] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; KL1P15301MB0039; 7:m7a4E/nZaMSdAxr7+p6ZDRdFfxB2OIX1E+Gz/+SmqEnESsJ+r2J9zeaNUOxqgfpvMOpbYwIxLVw02MwqBSTudulEPUoWNq1z0uGoCQbg276NX/Rboz1XAZRkhzmZn0mDaPhh6w8MaKu9jpHXVQwOTswKKjGN84E5mP19juV53+H71VtSDXu8RkKmN9MjAhXRDQKgDaDLoAPJOQsy5nYshTX+3ivavHjMDI7VCVDxdilGoryvtyCa9QuBmDIwihSz; 20:RsqCFpCf3Bm5rE3w6NHtxzxGF3B1oXIwsAAUroA3ndmUF4uX2HWHXaIc5KWzkbedogID4CbPNLxAvJXvY3iyvzKrdT6Ialtu/t7sHI/5JDY+g7wIOblVHmUh+Whd1r3mk2FGdcTJsiPYsyiwu2VfQWt5teKZKsDVSRSUtRJbOxY= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 56558a5d-3df3-4f23-bd31-08d5865e14d7 x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020); SRVR:KL1P15301MB0039; x-ms-traffictypediagnostic: KL1P15301MB0039: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231220)(944501244)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041310)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011); SRVR:KL1P15301MB0039; BCL:0; PCL:0; RULEID:; SRVR:KL1P15301MB0039; x-forefront-prvs: 06070568C5 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(396003)(376002)(366004)(346002)(39380400002)(39860400002)(189003)(51914003)(199004)(10090500001)(2900100001)(110136005)(59450400001)(76176011)(86612001)(46003)(5660300001)(97736004)(2906002)(7696005)(9686003)(6116002)(10290500003)(316002)(86362001)(99286004)(3280700002)(478600001)(186003)(22452003)(54906003)(229853002)(4326008)(2950100002)(6246003)(53546011)(6506007)(8676002)(81156014)(8936002)(33656002)(53936002)(39060400002)(55016002)(6436002)(68736007)(77096007)(105586002)(305945005)(7736002)(3660700001)(106356001)(14454004)(8990500004)(102836004)(74316002)(81166006)(25786009); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1P15301MB0039; H:KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: /ZfwplysqGzMgKAdMbnAMmW6qQGi/Wwc4SaoTDTriMX86nFmnHtd/REEm5SGBezaa/t37GVLD79KbzUlru911gGqWCA3W00Y/sNc9nkkpSnZwOo56ZvxLIAj2BVgfXadulZUHXr7qGFAtr/61lTns7fOvZohiehDFQQAeabHyVPVZCuXeSOTx+++MgrdHp4l47cl2pMu6mF6iBz+NzJnqWtqVIiEQg95xdWVXWQa9GE3mdPADbRPCDCSXhst6hVFDCquw9p8ZICp91qWuuTwUFLS2kReP3CS0IDO/r8aKtclWMzPbpfLblaohrztt/5HP9Wb+BBrkRxN932GU8B8RA== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56558a5d-3df3-4f23-bd31-08d5865e14d7 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Mar 2018 08:08:17.3520 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0039 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 Mar 2018 08:08:37 -0000 PiBGcm9tOiBjYXJwZWRkaWVtQGdtYWlsLmNvbSA8Y2FycGVkZGllbUBnbWFpbC5jb20+IE9uIEJl aGFsZiBPZiBFZA0KPiBNYXN0ZQ0KPiBTZW50OiBGcmlkYXksIE1hcmNoIDksIDIwMTggMTc6NTgN Cj4gT24gOSBNYXJjaCAyMDE4IGF0IDE5OjQxLCBEZXh1YW4tQlNEIEN1aSA8ZGV4dWFuLmJzZEBn bWFpbC5jb20+IHdyb3RlOg0KPiA+IEhpLA0KPiA+DQo+ID4gSW4gbXkgRnJlZUJTRCAxMS4xIFZN LCBJJ20gZ2V0dGluZyB0aGlzIGJ1aWxkIGZhaWx1cmUgYW5kIGl0IGxvb2tzDQo+ID4gdGhpcyBy ZXZpc2lvbiBjYXVzZXMgdGhlIGZhaWx1cmU6DQo+ID4NCj4gPiAvcm9vdC9ic2QuZ2l0L3N5cy9h bWQ2NC9hbWQ2NC9zdXBwb3J0LlM6ODU1OjI6IGVycm9yOiB1bmtub3duIGRpcmVjdGl2ZQ0KPiA+ ICAuYWx0bWFjcm8NCj4gPiAgXg0KPiANCj4gQXJlIHlvdSB0cnlpbmcgdG8gYnVpbGQgYSBoZWFk IGtlcm5lbCB1c2luZyB0aGUgdG9vbGNoYWluIGluIDExLjE/DQoNClllcy4NCg0KPiBUaGF0IHdv bid0IHdvcmsgKGJlY2F1c2Ugb2YgbWlzc2luZyAuYWx0bWFjcm8gc3VwcG9ydCkuIEJ1aWxkaW5n DQo+IGtlcm5lbC10b29sY2hhaW4gZmlyc3Qgc2hvdWxkIGdldCBhIHdvcmtpbmcgdG9vbGNoYWlu Lg0KDQoibWFrZSBrZXJuZWwtdG9vbGNoYWluIiBmaXJzdCB3b3JrcyBmb3IgbWUhIDotKQ0KDQpU aGFuayB5b3UsIEVkIQ0KIA0KPiA+IEl0IGxvb2tzIC1mbm8taW50ZWdyYXRlZC1hcyBtaWdodCBm aXggdGhlIGZhaWx1cmUgZm9yIG1lIGFjY29yZGluZyB0bzoNCj4gDQo+IEF2b2lkaW5nIHRoZSBp bnRlZ3JhdGVkIGFzc2VtYmxlciBpcyBpbmRlZWQgdGhlIHdvcmthcm91bmQgZm9yIHRoaXMNCj4g aXNzdWUsIGJ1dCB5b3UnbGwgd2FudCB0byBhcHBseSBpdCBvbmx5IHRvIHRoZSBhZmZlY3RlZCBm aWxlLg0KPiANCj4gS29zdGlrJ3MgMTEuMSBtZXJnZSBjYW5kaWRhdGUgcGF0Y2ggYWRkcyB0byBz eXMvY29uZi9NYWtlZmlsZS5hbWQ2NA0KPiBBU01fQ0ZMQUdTLnN1cHBvcnQuUz0gJHtDTEFOR19O T19JQVN9DQoNClRoYW5rcyBmb3IgdGhlIGV4cGxhbmF0aW9uLiBHb29kIHRvIGtub3cgdGhpcyEN Cg0KVGhhbmtzLA0KLS0gRGV4dWFuDQo= From owner-svn-src-head@freebsd.org Sat Mar 10 08:43: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 8238DF2D773; Sat, 10 Mar 2018 08:43:33 +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 3A40B6A497; Sat, 10 Mar 2018 08:43:33 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 19F0A1CC5D; Sat, 10 Mar 2018 08:43:33 +0000 (UTC) Date: Sat, 10 Mar 2018 08:43:33 +0000 From: Alexey Dokuchaev To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r330705 - head/sbin/mount Message-ID: <20180310084333.GC18340@FreeBSD.org> References: <201803092132.w29LW8QD030490@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201803092132.w29LW8QD030490@repo.freebsd.org> 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: Sat, 10 Mar 2018 08:43:33 -0000 On Fri, Mar 09, 2018 at 09:32:08PM +0000, Warner Losh wrote: > New Revision: 330705 > URL: https://svnweb.freebsd.org/changeset/base/330705 > > Log: > Remove decade's old whine about msdos vs msdosfs. > > Retain the compatibility silently though. Shouldn't it be the other way around? That is, after a decade of whining people would've updated their configs/scripts and old (deprecated) gimmick can now be removed? That's what usually implied by "deprecated", right? ./danfe > Modified: head/sbin/mount/mount.c > ... > @@ -589,11 +589,8 @@ mountfs(const char *vfstype, const char *spec, const c > optbuf = catopt(optbuf, "update"); > > /* Compatibility glue. */ > - if (strcmp(vfstype, "msdos") == 0) { > - warnx( > - "Using \"-t msdosfs\", since \"-t msdos\" is deprecated."); > + if (strcmp(vfstype, "msdos") == 0) > vfstype = "msdosfs"; > - } From owner-svn-src-head@freebsd.org Sat Mar 10 09:49: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 0A667F2F9EF; Sat, 10 Mar 2018 09:49:32 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A076C6C87C; Sat, 10 Mar 2018 09:49:31 +0000 (UTC) (envelope-from hselasky@freebsd.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 23307260042; Sat, 10 Mar 2018 10:49:24 +0100 (CET) Subject: Re: svn commit: r330644 - in head/sys/dev/mlx5: . mlx5_core To: Alan Somers , "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803080947.w289lArk031151@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Sat, 10 Mar 2018 10:49:20 +0100 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: 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: Sat, 10 Mar 2018 09:49:32 -0000 On 03/10/18 04:38, Alan Somers wrote: > Yeah, looks like it's working now. Thanks. > No problem. Thanks for handling! --HPS From owner-svn-src-head@freebsd.org Sat Mar 10 09:49: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 966E3F2FA19; Sat, 10 Mar 2018 09:49:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35F266C980; Sat, 10 Mar 2018 09:49:53 +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 704BA260042; Sat, 10 Mar 2018 10:49:52 +0100 (CET) Subject: Re: svn commit: r330644 - in head/sys/dev/mlx5: . mlx5_core To: Alan Somers , "Conrad E. Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803080947.w289lArk031151@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <8761469f-6d20-a676-5482-b4dcf49bf80e@selasky.org> Date: Sat, 10 Mar 2018 10:49:49 +0100 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: 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: Sat, 10 Mar 2018 09:49:54 -0000 On 03/10/18 04:38, Alan Somers wrote: > Yeah, looks like it's working now. Thanks. > No problem, thanks for handling. --HPS From owner-svn-src-head@freebsd.org Sat Mar 10 13:48: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 420CCF38D3C; Sat, 10 Mar 2018 13:48:08 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr0-x243.google.com (mail-wr0-x243.google.com [IPv6:2a00:1450:400c:c0c::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8FAA74030; Sat, 10 Mar 2018 13:48:07 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr0-x243.google.com with SMTP id f14so11502320wre.8; Sat, 10 Mar 2018 05:48:07 -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:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=IX5UlUbmctDBEeEQ8FaOsuoqxDWP1vN9eIAEuGN2064=; b=ujUlWL0ALAK1OyVjQKi671OqyF9/wLVgj1D2DQoOl/llogMJSss5zjbklnhNL4OwPG OFclmyFWinyGkh6LQBWwaVuU/P1V79aR8ugmBOzuhj7qpGPTXoSe9elHVxpXYo4hnLqi z/idTnsvl2p0TgTngU7rW742xiKfGhac2zsHL/nt4mu8vhY9C8YgamV4N5VkrAx6nrds fi4m+QY6NgUiMgz6iar0+ZDnn1hkeBTZ9I6eFXrMNw+AtSV9Pv9xWLd0sbWKvyBjt+1h FJnNY9Ye+MXiu/JI/xYuJCDxu/GHAphoTtx+ykilmgGJjdgzrkRoxKE8dGV/pOvF+ZSR XHdg== 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 :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=IX5UlUbmctDBEeEQ8FaOsuoqxDWP1vN9eIAEuGN2064=; b=XXp+uSG7pSelChoKsQM2FJbwPaAt70UpRA/HK84G5aNYQcVwXmQ3e0r0O9/X3nsnJb WulmGDIU9Z8LG65+TWyNI4U2VI/FYrv37rnb7+Z6qLAhhubUVsmp3mYgA8SC/mgjoddz i1XPfORw8Te7x7qGQVb65iFafut/wASd2f5D3hLX2fzaZAlWr/akZ1laq4gs75ipWREz gMRidi9W25FVuS04ijTe26Uo0VNKoKYkmxHn4/FFjfLbcfoZ9kP3l/XTHvxiL24mXldq LLTFmyUdyVF8AhK2qSlnjck8noeGCrlmnI3VXQUXVe5yOd539FR+ddLc9Yn8lBYGLKA7 7bmQ== X-Gm-Message-State: AElRT7F1oj0tcfs4tpmG8P3l/LME1jHPum+P3ih1F6pHVDW/DbnrNZc/ +HdzdAwprRhtdaCFgLKWuJWVDg== X-Google-Smtp-Source: AG47ELtKYcDrHnMaz9KqwLPSYksXBzhN3W4IGfOEyIsPpn3tO6w/nNfHxYWWsg7tubqCDizADT2+Lg== X-Received: by 10.223.195.204 with SMTP id d12mr1699202wrg.116.1520689686255; Sat, 10 Mar 2018 05:48:06 -0800 (PST) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id l11sm2895892wrg.71.2018.03.10.05.48.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Mar 2018 05:48:05 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sat, 10 Mar 2018 13:48:02 +0000 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: David Bright Cc: Ian Lepore , Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs Message-ID: <20180310134802.GA7708@brick> Mail-Followup-To: David Bright , Ian Lepore , Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801151925.w0FJPCKA019434@repo.freebsd.org> <20180309220940.GG6174@raichu> <1520634689.84937.74.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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: Sat, 10 Mar 2018 13:48:08 -0000 On 0309T2136, David Bright wrote: > On Mar 9, 2018, at 17:31, Ian Lepore wrote: > > > > On Fri, 2018-03-09 at 17:09 -0500, Mark Johnston wrote: > >> > >> etc/rc.d/fsck doesn't know how to interpret the new exit code and now > >> just drops to a single-user shell when it is encountered. […] > >> > >> Is there any reason etc/rc.d/fsck shouldn't automatically retry (up to > > This is, in fact, the reason that I made the change I did. I was trying to put in a retry loop to rc.d/fsck, but found that I couldn’t get it to work because fsck and fsck_ffs were not exiting with non-zero status. The drop to single user is not really due to the specific (new) error code of 16, it is due to the fact that fsck_ffs is now exiting with a non-zero status when it hasn’t completely cleaned the file system; /any/ non-zero status would cause the current rc.d/fsck script to go to single user. Prior to my change, fsck_ffs was exiting with a zero status even though it had not completely cleaned the filesystem and told the user to run it again. > > > > > fsck_ffs already has a -R flag to automatically retry, wouldn't that be > > a better mechanism for handling this new type of retry? > > That’s true; however, there is currently no way to pass that flag through the filesystem-agnostic fsck wrapper called from rc.d/fsck to the filesystem-specific fsck_ffs program that it calls. One could implement a similar flag on the fsck wrapper to be passed along to the filesystem-specific checker, but I think fsck_ffs is the only one that currently implements such a flag. Sure there is. See /etc/defaults/rc.conf: fsck_y_flags="-T ffs:-R -T ufs:-R" # Additional flags for fsck -y From owner-svn-src-head@freebsd.org Sat Mar 10 14:10: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 301CDF3A991 for ; Sat, 10 Mar 2018 14:10:21 +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 A8E7774D17 for ; Sat, 10 Mar 2018 14:10:20 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: c1424ca3-246c-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 c1424ca3-246c-11e8-91c6-33ffc249f3e8; Sat, 10 Mar 2018 14:10:16 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2AEABHB010938; Sat, 10 Mar 2018 07:10:11 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520691011.84937.115.camel@freebsd.org> Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs From: Ian Lepore To: David Bright Cc: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 10 Mar 2018 07:10:11 -0700 In-Reply-To: References: <201801151925.w0FJPCKA019434@repo.freebsd.org> <20180309220940.GG6174@raichu> <1520634689.84937.74.camel@freebsd.org> Content-Type: text/plain; charset="windows-1251" 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: Sat, 10 Mar 2018 14:10:21 -0000 On Fri, 2018-03-09 at 21:36 -0500, David Bright wrote: > On Mar 9, 2018, at 17:31, Ian Lepore wrote: > > > > > > On Fri, 2018-03-09 at 17:09 -0500, Mark Johnston wrote: > > > > > > > > > etc/rc.d/fsck doesn't know how to interpret the new exit code and > > > now > > > just drops to a single-user shell when it is encountered. [] > > > > > > Is there any reason etc/rc.d/fsck shouldn't automatically retry > > > (up to > This is, in fact, the reason that I made the change I did. I was > trying to put in a retry loop to rc.d/fsck, but found that I couldnt > get it to work because fsck and fsck_ffs were not exiting with non- > zero status. The drop to single user is not really due to the > specific (new) error code of 16, it is due to the fact that fsck_ffs > is now exiting with a non-zero status when it hasnt completely > cleaned the file system; /any/ non-zero status would cause the > current rc.d/fsck script to go to single user. Prior to my change, > fsck_ffs was exiting with a zero status even though it had not > completely cleaned the filesystem and told the user to run it again. > > > > > > > fsck_ffs already has a -R flag to automatically retry, wouldn't > > that be > > a better mechanism for handling this new type of retry? > Thats true; however, there is currently no way to pass that flag > through the filesystem-agnostic fsck wrapper called from rc.d/fsck to > the filesystem-specific fsck_ffs program that it calls. One could > implement a similar flag on the fsck wrapper to be passed along to > the filesystem-specific checker, but I think fsck_ffs is the only one > that currently implements such a flag. > > fsck -T ffs:-R -- Ian From owner-svn-src-head@freebsd.org Sat Mar 10 14:21: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 20C98F3BBE6; Sat, 10 Mar 2018 14:21:38 +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 C3272755BF; Sat, 10 Mar 2018 14:21:37 +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 BE0F37133; Sat, 10 Mar 2018 14:21:37 +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 w2AELb10039108; Sat, 10 Mar 2018 14:21:37 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2AELbPO039089; Sat, 10 Mar 2018 14:21:37 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803101421.w2AELbPO039089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 10 Mar 2018 14:21:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330740 - head/sys/dev/iscsi X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/dev/iscsi X-SVN-Commit-Revision: 330740 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:21:38 -0000 Author: trasz Date: Sat Mar 10 14:21:37 2018 New Revision: 330740 URL: https://svnweb.freebsd.org/changeset/base/330740 Log: Check for duplicates when modifying an iSCSI session. Previously we did this check on open, but "iscsictl -M", or an iSCSI redirect received by iscsid(8) could end up with two sessions with the same target name and portal. MFC after: 2 weeks Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sat Mar 10 09:17:52 2018 (r330739) +++ head/sys/dev/iscsi/iscsi.c Sat Mar 10 14:21:37 2018 (r330740) @@ -1983,6 +1983,7 @@ iscsi_ioctl_session_modify(struct iscsi_softc *sc, struct iscsi_session_modify *ism) { struct iscsi_session *is; + const struct iscsi_session *is2; iscsi_sanitize_session_conf(&ism->ism_conf); if (iscsi_valid_session_conf(&ism->ism_conf) == false) @@ -1991,14 +1992,42 @@ iscsi_ioctl_session_modify(struct iscsi_softc *sc, sx_xlock(&sc->sc_lock); TAILQ_FOREACH(is, &sc->sc_sessions, is_next) { ISCSI_SESSION_LOCK(is); - if (is->is_id == ism->ism_session_id) + if (is->is_id == ism->ism_session_id) { + /* Note that the session remains locked. */ break; + } ISCSI_SESSION_UNLOCK(is); } if (is == NULL) { sx_xunlock(&sc->sc_lock); return (ESRCH); } + + /* + * Prevent duplicates. + */ + TAILQ_FOREACH(is2, &sc->sc_sessions, is_next) { + if (is == is2) + continue; + + if (!!ism->ism_conf.isc_discovery != + !!is2->is_conf.isc_discovery) + continue; + + if (strcmp(ism->ism_conf.isc_target_addr, + is2->is_conf.isc_target_addr) != 0) + continue; + + if (ism->ism_conf.isc_discovery == 0 && + strcmp(ism->ism_conf.isc_target, + is2->is_conf.isc_target) != 0) + continue; + + ISCSI_SESSION_UNLOCK(is); + sx_xunlock(&sc->sc_lock); + return (EBUSY); + } + sx_xunlock(&sc->sc_lock); memcpy(&is->is_conf, &ism->ism_conf, sizeof(is->is_conf)); From owner-svn-src-head@freebsd.org Sat Mar 10 14:33: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 99A71F3CD05; Sat, 10 Mar 2018 14:33:01 +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 3BD9D75EBC; Sat, 10 Mar 2018 14:33:01 +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 35BA87312; Sat, 10 Mar 2018 14:33:01 +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 w2AEX0A6045791; Sat, 10 Mar 2018 14:33:00 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2AEX0sa045790; Sat, 10 Mar 2018 14:33:00 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201803101433.w2AEX0sa045790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 10 Mar 2018 14:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330741 - head/usr.bin/iscsictl X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.bin/iscsictl X-SVN-Commit-Revision: 330741 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 14:33:01 -0000 Author: trasz Date: Sat Mar 10 14:33:00 2018 New Revision: 330741 URL: https://svnweb.freebsd.org/changeset/base/330741 Log: Make iscsictl(1) display "Disabled" status for disabled sessions. MFC after: 2 weeks Modified: head/usr.bin/iscsictl/iscsictl.c Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Sat Mar 10 14:21:37 2018 (r330740) +++ head/usr.bin/iscsictl/iscsictl.c Sat Mar 10 14:33:00 2018 (r330741) @@ -605,7 +605,8 @@ kernel_list(int iscsi_fd, const struct target *targ __ xo_emit("{V:name/%-36s/%s} {V:portal/%-16s/%s} ", conf->isc_target, conf->isc_target_addr); - if (state->iss_reason[0] != '\0') { + if (state->iss_reason[0] != '\0' && + conf->isc_enable != 0) { xo_emit("{V:state/%s}\n", state->iss_reason); } else { if (conf->isc_discovery) { From owner-svn-src-head@freebsd.org Sat Mar 10 14:36: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 A826CF3D24D for ; Sat, 10 Mar 2018 14:36:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (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 3F58B76165 for ; Sat, 10 Mar 2018 14:36:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x232.google.com with SMTP id u66so6031381ith.1 for ; Sat, 10 Mar 2018 06:36:18 -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=jCUdP2C8Lwn2SoR5036EqJYn3tC4YArryirbMBoiy58=; b=WDoRk+yQVqfKcxkm+X5mQqqyTqzKCGZi4z9fY3CMVVPE/AVhvHPTvLzHajF+h1DW5T nhhhzARwJ54Lf9y/7LoT6barWP7gAGCDNxoeoaPhvTZPJ+SPLmDuFI7LTJadtYnnBMqL eHdzFMH8dDizguJK1JP/kHgk/IFC78IaP29CouvKHPwbEjo6m9CVFGFOEoVzOoFL7A// RgYjVBqW+pBIBHTpprQjscNXmzKiSg/K86K9W9hDYDyinqxRiItAk0qNOMrlq6MZ1RLS WRJMPbUymaWVookMDYi0FGxeNnjJ+ybmALSAuNW8pmIc3IXVD1RncaYTAFF0qGOOY/co jfDA== 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=jCUdP2C8Lwn2SoR5036EqJYn3tC4YArryirbMBoiy58=; b=ek8WIGYkUdNTzWLG0wW0ZywZCHxOxS6FJoPnapLmrIMTYS4qLbxCeU6ijIgDYv8wXO yK/knJsbEwYDJ6uNRBHQSZTg2ZBreTqs6EXrQMtGaAtgWVT+e0kMeobm0LM4SVJj52Z9 DfeI7OaHhb0uuotIxM/IBuIC/8pBARt+TU5i5mKl9offUQIJIGYQOtJp8TFflX1rG3qo mkJoMpQdT8mbWA1AY6FshamPT8mNTSiSoVVZrFg/kPVHD6I8cbQbYZFDT0S7KLQm+EHV 0wbsQgzuweduOlZ/uXD7zV8A4Xpoa1uAXZCvnBlUD/xM9nzrMBniHd4SKAOvegE8BP4v msOA== X-Gm-Message-State: AElRT7HplFlP/9ySq/j2oW+HtvYYTSasMG+QYNr7yxOz937yDuJqerec tklSaOZkUUp6HaOOwWUDzRGaK8Wf2ZsaJMn2pcTOHQ== X-Google-Smtp-Source: AG47ELvx6K0JWkss8cmoT94mhbZvAcM40tT851mhzMLKl13QGhOm3ShV3pCXjDoEA41u2myMrVk/tr7pmw0Ax4M/lHo= X-Received: by 10.36.148.204 with SMTP id j195mr1912063ite.1.1520692577283; Sat, 10 Mar 2018 06:36:17 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Sat, 10 Mar 2018 06:36:16 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <20180310084333.GC18340@FreeBSD.org> References: <201803092132.w29LW8QD030490@repo.freebsd.org> <20180310084333.GC18340@FreeBSD.org> From: Warner Losh Date: Sat, 10 Mar 2018 07:36:16 -0700 X-Google-Sender-Auth: C3FSSJvFL5gKZVB9G0obR2L9Om4 Message-ID: Subject: Re: svn commit: r330705 - head/sbin/mount To: Alexey Dokuchaev 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: Sat, 10 Mar 2018 14:36:19 -0000 On Sat, Mar 10, 2018 at 1:43 AM, Alexey Dokuchaev wrote: > On Fri, Mar 09, 2018 at 09:32:08PM +0000, Warner Losh wrote: > > New Revision: 330705 > > URL: https://svnweb.freebsd.org/changeset/base/330705 > > > > Log: > > Remove decade's old whine about msdos vs msdosfs. > > > > Retain the compatibility silently though. > > Shouldn't it be the other way around? That is, after a decade of whining > people would've updated their configs/scripts and old (deprecated) gimmick > can now be removed? That's what usually implied by "deprecated", right? > Nope. We accept both because even after a decade, people's fingers haven't changed. The original change was poorly socialized and met with scorn at the time. It's better to just accept both as some people have changed and others haven't. The 'deprecated' part never took hold, so I just removed the warning because the consensus is we are never going to stop accepting both. Warner > ./danfe > > > Modified: head/sbin/mount/mount.c > > ... > > @@ -589,11 +589,8 @@ mountfs(const char *vfstype, const char *spec, > const c > > optbuf = catopt(optbuf, "update"); > > > > /* Compatibility glue. */ > > - if (strcmp(vfstype, "msdos") == 0) { > > - warnx( > > - "Using \"-t msdosfs\", since \"-t msdos\" is > deprecated."); > > + if (strcmp(vfstype, "msdos") == 0) > > vfstype = "msdosfs"; > > - } > From owner-svn-src-head@freebsd.org Sat Mar 10 16:17: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 3212DF45040; Sat, 10 Mar 2018 16:17:08 +0000 (UTC) (envelope-from markjdb@gmail.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 B55C079531; Sat, 10 Mar 2018 16:17:07 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x244.google.com with SMTP id c11so6204053ith.4; Sat, 10 Mar 2018 08:17:07 -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=oEzYCbTZx2M25e8uryn4V6B1YmIDY8xCs9ZzBe+uksM=; b=ZBE8vpvm4wz8HYfLKk5O4lnwowzsM0oygwcyqlHS0vAJvsRH6Bh9PzEWrzsKCAuNfH DAenuKGy33MQSmcLUawkFJeyspL20eBFIJHnvhuAD99xDx3ADeh+faB4hXjGeYAwMSXf A3qtNT7ZXRF/OP6Hw9JhdIbjSseB/VOPAXTf8eg5V2yEN3drNZlDXIYczfBpnRZz0frm RP1YbmPozPmQvQFQjrMozft+ejsXHjy03XC/GeSv+w6PtFXr+Ww4x8lmLc7AjW+wDnnj dkglu3lTLabELYuAVUkqby9WNWqvdRLPIiBm9lzjsBK7yocsw++h/W41CdsblhuTgU1I sIfw== 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=oEzYCbTZx2M25e8uryn4V6B1YmIDY8xCs9ZzBe+uksM=; b=Ajpzf9pgxGs5Ocg7YsPFodyuDNnSWhDet/MDPgQkSKF5iaUAbyfu5yUWb7EesyQfjz Uzhzc2fMM0JitDcN6x9nXpoMCkmxp9blVuv5flExZ1TmBvHDBYigJznLpKPztm2TBYHn wfats8UiQ9p3mmKszLBIZXqIXRdQDes82HjrHW54q5p8I0boEaJinZIkabhaIKXZgXwA Weqrq0siqAT9jteGzds6wFsTXkva6yWIxm+cEwTYzP6ZyjVW+nxcZDAMQjGUoTEmAXHH v9ZdkikPgz/cMJOyDUePvSjkNvArZY2wF8WeA9yIT3I921ieXNkY/p2PLNOLwQJhmOdN UkOg== X-Gm-Message-State: AElRT7FP3CTh2yaRtSNCCXzNF25QikCKGdxKMvhR5F3HL8WFkJV98YCM Z/L9odOprMxfGVjneB0J9CihlQ== X-Google-Smtp-Source: AG47ELun5+DRh277+6WrawQ23giNrZzgEo4hbp/S6OBLlSKulQDMieYOdPK8vInk+X+uAYgoHixOgQ== X-Received: by 10.36.101.194 with SMTP id u185mr2174110itb.124.1520698626812; Sat, 10 Mar 2018 08:17:06 -0800 (PST) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id s1sm2451387ioe.79.2018.03.10.08.17.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Mar 2018 08:17:05 -0800 (PST) Sender: Mark Johnston Date: Sat, 10 Mar 2018 11:17:01 -0500 From: Mark Johnston To: David Bright Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs Message-ID: <20180310161701.GA73335@raichu> References: <201801151925.w0FJPCKA019434@repo.freebsd.org> <20180309220940.GG6174@raichu> <1520634689.84937.74.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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 Mar 2018 16:17:08 -0000 On Fri, Mar 09, 2018 at 09:36:25PM -0500, David Bright wrote: > On Mar 9, 2018, at 17:31, Ian Lepore wrote: > > > > On Fri, 2018-03-09 at 17:09 -0500, Mark Johnston wrote: > >> > >> etc/rc.d/fsck doesn't know how to interpret the new exit code and now > >> just drops to a single-user shell when it is encountered. […] > >> > >> Is there any reason etc/rc.d/fsck shouldn't automatically retry (up to > > This is, in fact, the reason that I made the change I did. I was trying to put in a retry loop to rc.d/fsck, but found that I couldn’t get it to work because fsck and fsck_ffs were not exiting with non-zero status. The drop to single user is not really due to the specific (new) error code of 16, it is due to the fact that fsck_ffs is now exiting with a non-zero status when it hasn’t completely cleaned the file system; Sure, but that's a regression IMO: before, I believe we'd successfully mount the FS even without retrying fsck, and continue booting. > /any/ non-zero status would cause the current rc.d/fsck script to go to single user. Prior to my change, fsck_ffs was exiting with a zero status even though it had not completely cleaned the filesystem and told the user to run it again. > > > > > fsck_ffs already has a -R flag to automatically retry, wouldn't that be > > a better mechanism for handling this new type of retry? > > That’s true; however, there is currently no way to pass that flag through the filesystem-agnostic fsck wrapper called from rc.d/fsck to the filesystem-specific fsck_ffs program that it calls. One could implement a similar flag on the fsck wrapper to be passed along to the filesystem-specific checker, but I think fsck_ffs is the only one that currently implements such a flag. As was pointed out by others, this isn't true. In my experience it's fsck -p that is exiting with status 16. It thus seems like it would be desirable to add "-T ffs:-R" to the initial fsck invocation in rc.d/fsck. From owner-svn-src-head@freebsd.org Sat Mar 10 16:44: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 0AAE5F46F6B; Sat, 10 Mar 2018 16:44:14 +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 553427A5AB; Sat, 10 Mar 2018 16:44:12 +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 w2AGiALV070243; Sat, 10 Mar 2018 08:44:10 -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 w2AGiA0x070242; Sat, 10 Mar 2018 08:44:10 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803101644.w2AGiA0x070242@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs In-Reply-To: <20180310161701.GA73335@raichu> To: Mark Johnston Date: Sat, 10 Mar 2018 08:44:10 -0800 (PST) CC: David Bright , Ian Lepore , 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: Sat, 10 Mar 2018 16:44:14 -0000 [ Charset UTF-8 unsupported, converting... ] > On Fri, Mar 09, 2018 at 09:36:25PM -0500, David Bright wrote: > > On Mar 9, 2018, at 17:31, Ian Lepore wrote: > > > > > > On Fri, 2018-03-09 at 17:09 -0500, Mark Johnston wrote: > > >> > > >> etc/rc.d/fsck doesn't know how to interpret the new exit code and now > > >> just drops to a single-user shell when it is encountered. [?] > > >> > > >> Is there any reason etc/rc.d/fsck shouldn't automatically retry (up to > > > > This is, in fact, the reason that I made the change I did. I was trying to put in a retry loop to rc.d/fsck, but found that I couldn?t get it to work because fsck and fsck_ffs were not exiting with non-zero status. The drop to single user is not really due to the specific (new) error code of 16, it is due to the fact that fsck_ffs is now exiting with a non-zero status when it hasn?t completely cleaned the file system; > > Sure, but that's a regression IMO: before, I believe we'd successfully > mount the FS even without retrying fsck, and continue booting. > > > /any/ non-zero status would cause the current rc.d/fsck script to go to single user. Prior to my change, fsck_ffs was exiting with a zero status even though it had not completely cleaned the filesystem and told the user to run it again. > > > > > > > > fsck_ffs already has a -R flag to automatically retry, wouldn't that be > > > a better mechanism for handling this new type of retry? > > > > That?s true; however, there is currently no way to pass that flag through the filesystem-agnostic fsck wrapper called from rc.d/fsck to the filesystem-specific fsck_ffs program that it calls. One could implement a similar flag on the fsck wrapper to be passed along to the filesystem-specific checker, but I think fsck_ffs is the only one that currently implements such a flag. > > As was pointed out by others, this isn't true. In my experience it's > fsck -p that is exiting with status 16. It thus seems like it would be > desirable to add "-T ffs:-R" to the initial fsck invocation in > rc.d/fsck. Please do not do that, if fsck -p fails YOU may optionally wish to continue, or do retries, but please do not make this a hardcoded situation. At most make it a controllable knob that defaults to the old behavior please. Thanks you, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Mar 10 16:56: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 269F8F47DDF for ; Sat, 10 Mar 2018 16:56:49 +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 A28A47ACA7 for ; Sat, 10 Mar 2018 16:56:48 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 029c809c-2484-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 029c809c-2484-11e8-91c6-33ffc249f3e8; Sat, 10 Mar 2018 16:56:44 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2AGudHw011178; Sat, 10 Mar 2018 09:56:39 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520700999.84937.119.camel@freebsd.org> Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs From: Ian Lepore To: rgrimes@freebsd.org, Mark Johnston Cc: David Bright , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 10 Mar 2018 09:56:39 -0700 In-Reply-To: <201803101644.w2AGiA0x070242@pdx.rh.CN85.dnsmgr.net> References: <201803101644.w2AGiA0x070242@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: Sat, 10 Mar 2018 16:56:49 -0000 On Sat, 2018-03-10 at 08:44 -0800, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] > > > > On Fri, Mar 09, 2018 at 09:36:25PM -0500, David Bright wrote: > > > > > > On Mar 9, 2018, at 17:31, Ian Lepore wrote: > > > > > > > > > > > > On Fri, 2018-03-09 at 17:09 -0500, Mark Johnston wrote: > > > > > > > > > > > > > > > etc/rc.d/fsck doesn't know how to interpret the new exit code and now > > > > > just drops to a single-user shell when it is encountered. [?] > > > > > > > > > > Is there any reason etc/rc.d/fsck shouldn't automatically retry (up to > > > This is, in fact, the reason that I made the change I did. I was trying to put in a retry loop to rc.d/fsck, but found that I couldn?t get it to work because fsck and fsck_ffs were not exiting with non-zero status. The drop to single user is not really due to the specific (new) error code of 16, it is due to the fact that fsck_ffs is now exiting with a non-zero status when it hasn?t completely cleaned the file system; > > Sure, but that's a regression IMO: before, I believe we'd successfully > > mount the FS even without retrying fsck, and continue booting. > > > > > > > > /any/ non-zero status would cause the current rc.d/fsck script to go to single user. Prior to my change, fsck_ffs was exiting with a zero status even though it had not completely cleaned the filesystem and told the user to run it again. > > > > > > > > > > > > > > > fsck_ffs already has a -R flag to automatically retry, wouldn't that be > > > > a better mechanism for handling this new type of retry? > > > That?s true; however, there is currently no way to pass that flag through the filesystem-agnostic fsck wrapper called from rc.d/fsck to the filesystem-specific fsck_ffs program that it calls. One could implement a similar flag on the fsck wrapper to be passed along to the filesystem-specific checker, but I think fsck_ffs is the only one that currently implements such a flag. > > As was pointed out by others, this isn't true. In my experience it's > > fsck -p that is exiting with status 16. It thus seems like it would be > > desirable to add "-T ffs:-R" to the initial fsck invocation in > > rc.d/fsck. > Please do not do that, if fsck -p fails YOU may optionally > wish to continue, or do retries, but please do not make this > a hardcoded situation.At most make it a controllable knob > that defaults to the old behavior please. > > Thanks you, This whole situation with fsck retries is just very strange. How many other tools in the base system exhibit this behavior: I didn't do everything you asked, even though I am completely capable of doing so. If you'd like to actually do the thing you asked for, please run this program again. If there is some reason why fsck should do less than a complete job under some circumstances, isn't THAT the exceptional situation that should need a special flag to make it happen? -- Ian From owner-svn-src-head@freebsd.org Sat Mar 10 17:02: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 AEA63F4873C; Sat, 10 Mar 2018 17:02:58 +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 3A2967B33E; Sat, 10 Mar 2018 17:02:57 +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 w2AH2uir070388; Sat, 10 Mar 2018 09:02:56 -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 w2AH2uW6070387; Sat, 10 Mar 2018 09:02:56 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803101702.w2AH2uW6070387@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs In-Reply-To: <1520700999.84937.119.camel@freebsd.org> To: Ian Lepore Date: Sat, 10 Mar 2018 09:02:56 -0800 (PST) CC: rgrimes@freebsd.org, Mark Johnston , David Bright , 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: Sat, 10 Mar 2018 17:02:58 -0000 > On Sat, 2018-03-10 at 08:44 -0800, Rodney W. Grimes wrote: > > [ Charset UTF-8 unsupported, converting... ] > > > > > > On Fri, Mar 09, 2018 at 09:36:25PM -0500, David Bright wrote: > > > > > > > > On Mar 9, 2018, at 17:31, Ian Lepore wrote: > > > > > > > > > > > > > > > On Fri, 2018-03-09 at 17:09 -0500, Mark Johnston wrote: > > > > > > > > > > > > > > > > > > etc/rc.d/fsck doesn't know how to interpret the new exit code and now > > > > > > just drops to a single-user shell when it is encountered. [?] > > > > > > > > > > > > Is there any reason etc/rc.d/fsck shouldn't automatically retry (up to > > > > This is, in fact, the reason that I made the change I did. I was trying to put in a retry loop to rc.d/fsck, but found that I couldn?t get it to work because fsck and fsck_ffs were not exiting with non-zero status. The drop to single user is not really due to the specific (new) error code of 16, it is due to the fact that fsck_ffs is now exiting with a non-zero status when it hasn?t completely cleaned the file system; > > > Sure, but that's a regression IMO: before, I believe we'd successfully > > > mount the FS even without retrying fsck, and continue booting. > > > > > > > > > > > /any/ non-zero status would cause the current rc.d/fsck script to go to single user. Prior to my change, fsck_ffs was exiting with a zero status even though it had not completely cleaned the filesystem and told the user to run it again. > > > > > > > > > > > > > > > > > > > fsck_ffs already has a -R flag to automatically retry, wouldn't that be > > > > > a better mechanism for handling this new type of retry? > > > > That?s true; however, there is currently no way to pass that flag through the filesystem-agnostic fsck wrapper called from rc.d/fsck to the filesystem-specific fsck_ffs program that it calls. One could implement a similar flag on the fsck wrapper to be passed along to the filesystem-specific checker, but I think fsck_ffs is the only one that currently implements such a flag.? > > > As was pointed out by others, this isn't true. In my experience it's > > > fsck -p that is exiting with status 16. It thus seems like it would be > > > desirable to add "-T ffs:-R" to the initial fsck invocation in > > > rc.d/fsck. > > Please do not do that, if fsck -p fails YOU may optionally > > wish to continue, or do retries, but please do not make this > > a hardcoded situation.??At most make it a controllable knob > > that defaults to the old behavior please. > > > > Thanks you, > > This whole situation with fsck retries is just very strange. ?How many > other tools in the base system exhibit this behavior:? > > I didn't do everything you asked, even though I am completely > capable of doing so. ?If you'd like to actually do the thing you > asked for, please run this program again. > > If there is some reason why fsck should do less than a complete job > under some circumstances, isn't THAT the exceptional situation that > should need a special flag to make it happen? The job is "make sure my data is ok, keep my data at all costs, do not however do something that may damange my data". The job is NOT "do everything you can to bring the file system to a consistent state, even if you have to screw my data all up". -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Mar 10 17:26: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 BAF27F4A2F2 for ; Sat, 10 Mar 2018 17:26:52 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48EBF7C006 for ; Sat, 10 Mar 2018 17:26:52 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 228c21c3-2488-11e8-bb8e-b35b57339d60 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.ore.mailhop.org (Halon) with ESMTPSA id 228c21c3-2488-11e8-bb8e-b35b57339d60; Sat, 10 Mar 2018 17:26:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2AHQgTO011245; Sat, 10 Mar 2018 10:26:42 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1520702802.84937.126.camel@freebsd.org> Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs From: Ian Lepore To: rgrimes@freebsd.org Cc: Mark Johnston , David Bright , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 10 Mar 2018 10:26:42 -0700 In-Reply-To: <201803101702.w2AH2uW6070387@pdx.rh.CN85.dnsmgr.net> References: <201803101702.w2AH2uW6070387@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: Sat, 10 Mar 2018 17:26:52 -0000 On Sat, 2018-03-10 at 09:02 -0800, Rodney W. Grimes wrote: > > > > On Sat, 2018-03-10 at 08:44 -0800, Rodney W. Grimes wrote: > > > [...] > > > > add "-T ffs:-R" to the initial fsck invocation in rc.d/fsck. > > > Please do not do that, if fsck -p fails YOU may optionally > > > wish to continue, or do retries, but please do not make this > > > a hardcoded situation.??At most make it a controllable knob > > > that defaults to the old behavior please. > > > > > > Thanks you, > > This whole situation with fsck retries is just very strange. ?How > > many other tools in the base system exhibit this behavior:? > > > > I didn't do everything you asked, even though I am completely > > capable of doing so. ?If you'd like to actually do the thing > > you asked for, please run this program again. > > > > If there is some reason why fsck should do less than a complete job > > under some circumstances, isn't THAT the exceptional situation that > > should need a special flag to make it happen? > The job is "make sure my data is ok, keep my data at all costs, do > not however do something that may damange my data". > > The job is NOT "do everything you can to bring the file system to > a consistent state, even if you have to screw my data all up". > I'm not sure why you think the -R flag is some sort of "ruin my data" request. Maybe because all of this stuff is so scantily documented in the manpage? -R Instruct fsck_ffs to restart itself if it encounters certain errors that warrant another run. Who knows what "certain errors" means? Looking at the code, it appears -R has no effect if you're in preen mode. Hmmm, what's "preen mode" again? Don't bother looking in the man page, you'll just find a bunch of mentions of the word preen that say "see the -p flag" and then, surrealistically, when you look at the -p flag it says "Preen file systems (see above)". Of course, what was above was all the places that told you to see -p. So, I guess I'll just keep using fsck_y_enable=YES and relying on the fact that by default that now includes the -R option. -- Ian From owner-svn-src-head@freebsd.org Sat Mar 10 17:32: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 8D8B6F4AAA9 for ; Sat, 10 Mar 2018 17:32:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DA3F7C60F for ; Sat, 10 Mar 2018 17:32:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id v6so6924464iog.7 for ; Sat, 10 Mar 2018 09:32:27 -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=6FpKmWKB54NmMVxlzjpPfjamloACNJI+bj+HGzvEgs4=; b=zaLc8ThwWLTVZt8FboYScw8S9zVY5rfu4jGYVuLBrK64rFwz9S9mRGfPqhvg6tw++H didOZmRR25Hkl21TWSPQPSJyH6xsGAr+tYG4jRzBzXDC5lYrYTGuCAKOIsLrP+gnqDL+ FyATelfiB1knjCWNxBmSHNhmSTYqO9XC/bDZSsfKwXo4ply1DQ6u5wFq3jQbBeK8otVs 4C/Tg7zaQ27+qQv8FAy8jE2rr5ujppLs1cKZXtMs3VAKmp2CleYYby2ytIPaTrUbxiEk lclmPmFNe1EUTIZk1EAj+9uShoZc3bqErHobrkUNI9AcYbz0iudgFHjxn90DY20bCJ4U uPng== 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=6FpKmWKB54NmMVxlzjpPfjamloACNJI+bj+HGzvEgs4=; b=SOQ75jmt9EjkDqHNQQaazO9nw/FPNP5h/koeI1E9KtVKZ2UflDG+hAdtu0twDldIUx Tm3F4vglzRbgSXykSllshpn7UGrqi9gn1IwnqiXkmqAV95UvUagX1RebPP1CY756Juan 2R2pOHQNyguyd/OuMDhv6pmQHmEJlo1YIJhtvV7cJcxzSGYI05CTVA5YMexhshp5xfRh ggl6CnRDLPwfFQLE7VhJN5LrHgyzio+zrIL3bBNJZp4ErcY8cCv6potRCTGnciwvA4ya o9plKsvreIyisvmn4spol9F/GPkY1QZR8yk4zjTwlcp7JB9kMIlJ444eqJRltI3vrGVK +MkQ== X-Gm-Message-State: AElRT7Gl/vUIgJFWlUeyq9AkbmbYsJvrkj5j25wrG6c+bYri0GlL8YzJ rV3jPhVdvcPUJNZvXF9X4SnDyr3fMJ8k4pbcCnVbWQ== X-Google-Smtp-Source: AG47ELsi0zdudY68rIV/Aub3mfm56C56c+nzLXS1egSQ8YzNGXHMyxrykfOWxKDeQzrdWBS2TQErOrdebeat8b0SQX4= X-Received: by 10.107.175.77 with SMTP id y74mr3013670ioe.37.1520703146387; Sat, 10 Mar 2018 09:32:26 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Sat, 10 Mar 2018 09:32:25 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:18a2:a4f7:170:8dd9] In-Reply-To: <1520702802.84937.126.camel@freebsd.org> References: <201803101702.w2AH2uW6070387@pdx.rh.CN85.dnsmgr.net> <1520702802.84937.126.camel@freebsd.org> From: Warner Losh Date: Sat, 10 Mar 2018 10:32:25 -0700 X-Google-Sender-Auth: 9qam31eKIv1q3FQhI83qAtwcYC8 Message-ID: Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs To: Ian Lepore Cc: "Rodney W. Grimes" , Mark Johnston , David Bright , 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: Sat, 10 Mar 2018 17:32:27 -0000 On Sat, Mar 10, 2018 at 10:26 AM, Ian Lepore wrote: > On Sat, 2018-03-10 at 09:02 -0800, Rodney W. Grimes wrote: > > > > > > On Sat, 2018-03-10 at 08:44 -0800, Rodney W. Grimes wrote: > > > > > [...] > > > > > add "-T ffs:-R" to the initial fsck invocation in rc.d/fsck. > > > > Please do not do that, if fsck -p fails YOU may optionally > > > > wish to continue, or do retries, but please do not make this > > > > a hardcoded situation.??At most make it a controllable knob > > > > that defaults to the old behavior please. > > > > > > > > Thanks you, > > > This whole situation with fsck retries is just very strange. ?How > > > many other tools in the base system exhibit this behavior:? > > > > > > I didn't do everything you asked, even though I am completely > > > capable of doing so. ?If you'd like to actually do the thing > > > you asked for, please run this program again. > > > > > > If there is some reason why fsck should do less than a complete job > > > under some circumstances, isn't THAT the exceptional situation that > > > should need a special flag to make it happen? > > The job is "make sure my data is ok, keep my data at all costs, do > > not however do something that may damange my data". > > > > The job is NOT "do everything you can to bring the file system to > > a consistent state, even if you have to screw my data all up". > > > > I'm not sure why you think the -R flag is some sort of "ruin my data" > request. Maybe because all of this stuff is so scantily documented in > the manpage? > > -R Instruct fsck_ffs to restart itself if it encounters certain > errors that warrant another run. > > Who knows what "certain errors" means? > There are some classes of errors that fsck correct that it must recompute a large amount of state to make sure it is consistent. Rather than doing that, it exits with a message saying to re-run fsck to make sure that there aren't more errors that were hidden by the now-corrected errors from the past pass. > Looking at the code, it appears -R has no effect if you're in preen > mode. Hmmm, what's "preen mode" again? Don't bother looking in the > man page, you'll just find a bunch of mentions of the word preen that > say "see the -p flag" and then, surrealistically, when you look at the > -p flag it says "Preen file systems (see above)". Of course, what was > above was all the places that told you to see -p. > The man page could use some improvement. Preen mode means 'fix all the stupid inconsistencies that crop up that never result in data loss'. non-preen mode means to do that, and ask if you want to correct other errors that usually don't cause data loss, but might and some modicum of human intelligence is required to tell the two apart. Eg, I usually give up hitting 'y' after a dozen or so times in FSCK unless I have a specific reason to keep going. fsck -y has no such nuance. Warner > So, I guess I'll just keep using fsck_y_enable=YES and relying on the > fact that by default that now includes the -R option. > > -- Ian > > > From owner-svn-src-head@freebsd.org Sat Mar 10 17:51: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 5FB85F4C03C; Sat, 10 Mar 2018 17:51:48 +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 B6B657D3AE; Sat, 10 Mar 2018 17:51:47 +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 w2AHphcK070579; Sat, 10 Mar 2018 09:51:43 -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 w2AHphph070578; Sat, 10 Mar 2018 09:51:43 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803101751.w2AHphph070578@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs In-Reply-To: To: Warner Losh Date: Sat, 10 Mar 2018 09:51:43 -0800 (PST) CC: Ian Lepore , "Rodney W. Grimes" , Mark Johnston , David Bright , src-committers , 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: Sat, 10 Mar 2018 17:51:48 -0000 > On Sat, Mar 10, 2018 at 10:26 AM, Ian Lepore wrote: > > > On Sat, 2018-03-10 at 09:02 -0800, Rodney W. Grimes wrote: > > > > > > > > On Sat, 2018-03-10 at 08:44 -0800, Rodney W. Grimes wrote: > > > > > > > [...] > > > > > > add "-T ffs:-R" to the initial fsck invocation in rc.d/fsck. > > > > > Please do not do that, if fsck -p fails YOU may optionally > > > > > wish to continue, or do retries, but please do not make this > > > > > a hardcoded situation.??At most make it a controllable knob > > > > > that defaults to the old behavior please. > > > > > > > > > > Thanks you, > > > > This whole situation with fsck retries is just very strange. ?How > > > > many other tools in the base system exhibit this behavior:? > > > > > > > > I didn't do everything you asked, even though I am completely > > > > capable of doing so. ?If you'd like to actually do the thing > > > > you asked for, please run this program again. > > > > > > > > If there is some reason why fsck should do less than a complete job > > > > under some circumstances, isn't THAT the exceptional situation that > > > > should need a special flag to make it happen? > > > The job is "make sure my data is ok, keep my data at all costs, do > > > not however do something that may damange my data". > > > > > > The job is NOT "do everything you can to bring the file system to > > > a consistent state, even if you have to screw my data all up". > > > > > > > I'm not sure why you think the -R flag is some sort of "ruin my data" > > request. Maybe because all of this stuff is so scantily documented in > > the manpage? > > > > -R Instruct fsck_ffs to restart itself if it encounters certain > > errors that warrant another run. > > > > Who knows what "certain errors" means? > > > > There are some classes of errors that fsck correct that it must recompute a > large amount of state to make sure it is consistent. Rather than doing > that, it exits with a message saying to re-run fsck to make sure that there > aren't more errors that were hidden by the now-corrected errors from the > past pass. > > > > Looking at the code, it appears -R has no effect if you're in preen > > mode. Hmmm, what's "preen mode" again? Don't bother looking in the > > man page, you'll just find a bunch of mentions of the word preen that > > say "see the -p flag" and then, surrealistically, when you look at the > > -p flag it says "Preen file systems (see above)". Of course, what was > > above was all the places that told you to see -p. > > > > The man page could use some improvement. Preen mode means 'fix all the > stupid inconsistencies that crop up that never result in data loss'. > non-preen mode means to do that, and ask if you want to correct other > errors that usually don't cause data loss, but might and some modicum of > human intelligence is required to tell the two apart. Eg, I usually give up > hitting 'y' after a dozen or so times in FSCK unless I have a specific > reason to keep going. fsck -y has no such nuance. I do not believe that normal mode has any intellegnce to as if data loss will or will not occur. It will gladly ask you if you want to clear an inode that is the root of a rather large tree, and you end up with either data loss, or a huge lost+found, sometimes even over flowing the size of lost+found (though that may of been fixed in ufs2). It simply runs along and if it finds an error it asks if you want to correct it or not. Y is not always the correct answer, but most people are oblivious to what the questions imply with respect to the file system, and hence answer Y. fsck does do thing in a sequence that tries to make Y the correct answer, but as you say human intelligence may do better. Some times if you had answered N at the right question you would not of gotten all of the other 11 questions that lead you to giving up, sometimes the N answer maybe 100's of Y's in, often to a clear inode question. When I get a preen failure my usual next step is to run a logged fsck -n to see what that says so I can evaluate the extent of fs damage, especially if this is a critical file system containing very valuable data. > Warner > > > > So, I guess I'll just keep using fsck_y_enable=YES and relying on the > > fact that by default that now includes the -R option. And if your running ufs2 with soft updates your in a pretty safe place. I would not recommend doing this on ufs1 or without soft updates enabled. One must try to remeber that fsck -p during /etc/rc processing can run into many different file systems, some more resilent to running things like fsck -R -y, some not. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Mar 10 17:54: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 84061F4C3D0; Sat, 10 Mar 2018 17:54:15 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id A9EEF7D5FE; Sat, 10 Mar 2018 17:54:14 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id uih8eZXamYxCTuihAeT7N6; Sat, 10 Mar 2018 10:54:12 -0700 X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=8nJEP1OIZ-IA:10 a=v2DPQv5-lfwA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=VZMtDPgJqhoKK3BJdpwA:9 a=wPNLvfGTeEIA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A22F610F6; Sat, 10 Mar 2018 09:54:10 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w2AHsATJ038450; Sat, 10 Mar 2018 09:54:10 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w2AHsA2l038446; Sat, 10 Mar 2018 09:54:10 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201803101754.w2AHsA2l038446@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Ian Lepore cc: rgrimes@freebsd.org, Mark Johnston , David Bright , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs In-Reply-To: Message from Ian Lepore of "Sat, 10 Mar 2018 10:26:42 -0700." <1520702802.84937.126.camel@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Sat, 10 Mar 2018 09:54:09 -0800 X-CMAE-Envelope: MS4wfOq7dyTWM4z8DrjMvRDhU5Mxp/n9SuDNoigL+OZRcBJugoCSSRgq4sO3zl81TDttbCMK8ZDKE+t8UQ1AJp2LEnXE6VFQnVPOJcyW/GGxmIxODGGzrKT7 v41hlhy4y2JpazTeOhaMwInd6YyD6WRfkiNyupC4c0TU4unvV6cCsUUcgtrO/3XjdpAvvFaIlaROgtI+4kMRw7vONs4yP/IdueSNmW3RiOhZ8IjF4E5p9Lu0 XqSNe2Ol9f6EM1ztM9X3GwpFA1tgpo66THA72bxHdWL6r4x0kc/UXlSh4k+5TBSDDpeMPsRYrqpypoDfy2ltStugbXz0N6ikUtCi6GpR/31he1+UUrij6SK1 hrn9zFyUMeI38dCR/BHs8LUz43oXSljre4PB3P0y12MVcIqiC9E= 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 Mar 2018 17:54:15 -0000 In message <1520702802.84937.126.camel@freebsd.org>, Ian Lepore writes: > On Sat, 2018-03-10 at 09:02 -0800, Rodney W. Grimes wrote: > > > > > > On Sat, 2018-03-10 at 08:44 -0800, Rodney W. Grimes wrote: > > > > > [...] > > > > > add "-T ffs:-R" to the initial fsck invocation in rc.d/fsck. > > > > Please do not do that, if fsck -p fails YOU may optionally > > > > wish to continue, or do retries, but please do not make this > > > > a hardcoded situation.??At most make it a controllable knob > > > > that defaults to the old behavior please. > > > > > > > > Thanks you, > > > This whole situation with fsck retries is just very strange. ?How > > > many other tools in the base system exhibit this behavior:? > > > > > >     I didn't do everything you asked, even though I am completely > > >     capable of doing so. ?If you'd like to actually do the thing > > >     you asked for, please run this program again. > > > > > > If there is some reason why fsck should do less than a complete job > > > under some circumstances, isn't THAT the exceptional situation that > > > should need a special flag to make it happen? > > The job is "make sure my data is ok, keep my data at all costs, do > > not however do something that may damange my data". > > > > The job is NOT "do everything you can to bring the file system to > > a consistent state, even if you have to screw my data all up". > > > > I'm not sure why you think the -R flag is some sort of "ruin my data" > request.  Maybe because all of this stuff is so scantily documented in > the manpage? > > -R Instruct fsck_ffs to restart itself if it encounters certain   >  errors that warrant another run. > > Who knows what "certain errors" means?   > > Looking at the code, it appears -R has no effect if you're in preen > mode.  Hmmm, what's "preen mode" again?  Don't bother looking in the > man page, you'll just find a bunch of mentions of the word preen that > say "see the -p flag" and then, surrealistically, when you look at the > -p flag it says "Preen file systems (see above)".  Of course, what was > above was all the places that told you to see -p. > > So, I guess I'll just keep using fsck_y_enable=YES and relying on the > fact that by default that now includes the -R option. That's how I've set up my firewall/gateway. For it I'm much more concerned to have it successfully boot than data loss. The reason is if I'm remote I want to be able to ssh back in. So, I'm willing to take the risk to be able to do so. Having said that, I maintain backup slices on an alternate disk in case of loss should the primary slice fail to boot. In that case data loss is tolerable to allow a better chance I can remotely ssh in. (Of course there's no 100% guarantee if there's data loss but it's better than 0% if the gateway dropped into single user state from the get-go.) With my other gear using UFS I want a failing fsck to fall to single user as I can get in using a console server to examine the damage decide for myself. Long story short, it depends. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Mar 10 18:07: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 CAA44F4D283; Sat, 10 Mar 2018 18:07:31 +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 7D3E47DCDA; Sat, 10 Mar 2018 18:07:31 +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 780A411465; Sat, 10 Mar 2018 18:07:31 +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 w2AI7Vel073969; Sat, 10 Mar 2018 18:07:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2AI7Vt4073968; Sat, 10 Mar 2018 18:07:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201803101807.w2AI7Vt4073968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sat, 10 Mar 2018 18:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330742 - head/libexec/tftpd/tests X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/libexec/tftpd/tests X-SVN-Commit-Revision: 330742 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 18:07:32 -0000 Author: asomers Date: Sat Mar 10 18:07:31 2018 New Revision: 330742 URL: https://svnweb.freebsd.org/changeset/base/330742 Log: tftpd: fix the build of tests on i386 after 330696 It's those darn printf format specifiers again Reported by: cy, kibab MFC after: 20 days X-MFC-With: 330696 Modified: head/libexec/tftpd/tests/functional.c Modified: head/libexec/tftpd/tests/functional.c ============================================================================== --- head/libexec/tftpd/tests/functional.c Sat Mar 10 14:33:00 2018 (r330741) +++ head/libexec/tftpd/tests/functional.c Sat Mar 10 18:07:31 2018 (r330742) @@ -248,10 +248,10 @@ require_bufeq(const char *expected, ssize_t expected_l ssize_t i; ATF_REQUIRE_EQ_MSG(expected_len, len, - "Expected %ld bytes but got %ld", expected_len, len); + "Expected %zd bytes but got %zd", expected_len, len); for (i = 0; i < len; i++) { ATF_REQUIRE_EQ_MSG(actual[i], expected[i], - "Expected %#hhx at position %ld; got %hhx instead", + "Expected %#hhx at position %zd; got %hhx instead", expected[i], i, actual[i]); } } From owner-svn-src-head@freebsd.org Sat Mar 10 18:08: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 0C650F4D3A9; Sat, 10 Mar 2018 18:08:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 396B57DE3A; Sat, 10 Mar 2018 18:08:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id uiute19yJXziTuiuvePYIm; Sat, 10 Mar 2018 11:08:25 -0700 X-Authority-Analysis: v=2.3 cv=X6B81lbe c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=v2DPQv5-lfwA:10 a=iKhvJSA4AAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=3tXnQLfBrKYg1UqCfHUA:9 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id A2596113C; Sat, 10 Mar 2018 10:08:23 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id w2AI8NAE038594; Sat, 10 Mar 2018 10:08:23 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id w2AI8Ntn038591; Sat, 10 Mar 2018 10:08:23 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201803101808.w2AI8Ntn038591@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: rgrimes@freebsd.org cc: Warner Losh , Ian Lepore , Mark Johnston , David Bright , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs In-Reply-To: Message from "Rodney W. Grimes" of "Sat, 10 Mar 2018 09:51:43 -0800." <201803101751.w2AHphph070578@pdx.rh.CN85.dnsmgr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 10 Mar 2018 10:08:23 -0800 X-CMAE-Envelope: MS4wfPGkohg/cEn19TRWJLXdU9gEdLpuAvCa+EZ56bzIPpGlTTv0GLNzEhA1xXCwj+1QQq8Oi7c9nCObAMq8bgSbe9V9dszKiVf0RwO6BF4M70iLZlN3Wrge sKLnRpG/EbuqG42DGC0OtsNWxekyT9Jn8FtxDqarF2wzuLy6Ks1RyrPcY2IMOVBsAPipeAIimyw54esp+0hWZzqZeHxdjLy4EO5XXZk112Tfe5F4YYhjexqr fudYqpDZo2YIBClYuZPIRO4B02WB0ZeBeW1Hb+HxQHjL9AkI9JfKIuXTsV/GwZKR0WbMp20XJ+zQDETl+fakkwThd8/sHnD43t7EarUmBdX27IRK5ftBsotn ZZtCNBbVlbJm3uqakMabME2/B1U+tKxzMGLJsCa30DDEnelzEX7S3DM1cXSxDYg7bBAM+ExzfCnj5qoJS7HnwLEYIna8dQ== 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 Mar 2018 18:08:34 -0000 In message <201803101751.w2AHphph070578@pdx.rh.CN85.dnsmgr.net>, "Rodney W. Gri mes" writes: > > On Sat, Mar 10, 2018 at 10:26 AM, Ian Lepore wrote: > > > > > On Sat, 2018-03-10 at 09:02 -0800, Rodney W. Grimes wrote: > > > > > > > > > > On Sat, 2018-03-10 at 08:44 -0800, Rodney W. Grimes wrote: > > > > > > > > > [...] > > > > > > > add "-T ffs:-R" to the initial fsck invocation in rc.d/fsck. > > > > > > Please do not do that, if fsck -p fails YOU may optionally > > > > > > wish to continue, or do retries, but please do not make this > > > > > > a hardcoded situation.??At most make it a controllable knob > > > > > > that defaults to the old behavior please. > > > > > > > > > > > > Thanks you, > > > > > This whole situation with fsck retries is just very strange. ?How > > > > > many other tools in the base system exhibit this behavior:? > > > > > > > > > > I didn't do everything you asked, even though I am completely > > > > > capable of doing so. ?If you'd like to actually do the thing > > > > > you asked for, please run this program again. > > > > > > > > > > If there is some reason why fsck should do less than a complete job > > > > > under some circumstances, isn't THAT the exceptional situation that > > > > > should need a special flag to make it happen? > > > > The job is "make sure my data is ok, keep my data at all costs, do > > > > not however do something that may damange my data". > > > > > > > > The job is NOT "do everything you can to bring the file system to > > > > a consistent state, even if you have to screw my data all up". > > > > > > > > > > I'm not sure why you think the -R flag is some sort of "ruin my data" > > > request. Maybe because all of this stuff is so scantily documented in > > > the manpage? > > > > > > -R Instruct fsck_ffs to restart itself if it encounters certain > > > errors that warrant another run. > > > > > > Who knows what "certain errors" means? > > > > > > > There are some classes of errors that fsck correct that it must recompute a > > large amount of state to make sure it is consistent. Rather than doing > > that, it exits with a message saying to re-run fsck to make sure that there > > aren't more errors that were hidden by the now-corrected errors from the > > past pass. > > > > > > > Looking at the code, it appears -R has no effect if you're in preen > > > mode. Hmmm, what's "preen mode" again? Don't bother looking in the > > > man page, you'll just find a bunch of mentions of the word preen that > > > say "see the -p flag" and then, surrealistically, when you look at the > > > -p flag it says "Preen file systems (see above)". Of course, what was > > > above was all the places that told you to see -p. > > > > > > > The man page could use some improvement. Preen mode means 'fix all the > > stupid inconsistencies that crop up that never result in data loss'. > > non-preen mode means to do that, and ask if you want to correct other > > errors that usually don't cause data loss, but might and some modicum of > > human intelligence is required to tell the two apart. Eg, I usually give up > > hitting 'y' after a dozen or so times in FSCK unless I have a specific > > reason to keep going. fsck -y has no such nuance. > > I do not believe that normal mode has any intellegnce to as if data > loss will or will not occur. It will gladly ask you if you want to > clear an inode that is the root of a rather large tree, and you end > up with either data loss, or a huge lost+found, sometimes even over > flowing the size of lost+found (though that may of been fixed in ufs2). > > It simply runs along and if it finds an error it asks if you want > to correct it or not. Y is not always the correct answer, but > most people are oblivious to what the questions imply with respect > to the file system, and hence answer Y. fsck does do thing in > a sequence that tries to make Y the correct answer, but as you > say human intelligence may do better. > > Some times if you had answered N at the right question you would not > of gotten all of the other 11 questions that lead you to giving up, > sometimes the N answer maybe 100's of Y's in, often to a clear > inode question. > > When I get a preen failure my usual next step is to run a logged > fsck -n to see what that says so I can evaluate the extent of fs > damage, especially if this is a critical file system containing > very valuable data. > > > Warner > > > > > > > So, I guess I'll just keep using fsck_y_enable=YES and relying on the > > > fact that by default that now includes the -R option. > > And if your running ufs2 with soft updates your in a > pretty safe place. I would not recommend doing this on ufs1 > or without soft updates enabled. > > One must try to remeber that fsck -p during /etc/rc processing can > run into many different file systems, some more resilent to running > things like fsck -R -y, some not. Having been in this situation with FreeBSD, Solaris, Linux, and many other operating systems, if you have more than a reasonable number of inodes that need to be cleared and if time constrained, as a person usually is in a system down situation, you're better off simply recovering from backup. In those situations data loss is usually unrecoverable. In my experience it comes down to: do I bite the bullet now or do I continue to waste precious time? Having said that, if you have the time and recovery is too expensiveyou can use a binary editor avoid data loss. A co-worker and I spent 28 hours on five mainframe filesystems once. The reason management chose this was that even though there were backups the customer would have lost 24 hours of transactions. This was partially successful as all data except for one customer database were recovered. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sat Mar 10 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 8E39DF4D39B; Sat, 10 Mar 2018 18:08:31 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::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 B34E37DE27; Sat, 10 Mar 2018 18:08:30 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x22d.google.com with SMTP id i80-v6so17563184lfg.5; Sat, 10 Mar 2018 10:08:30 -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=5/nzZhjh1QOnMsOU7z2VDUl/ilXragolZBrsrvkynrU=; b=I+Lacq7xCWsm6JJWgWfKrj6e6tlKCdkasteD2T04N/9/KHKoQunArOjSfr7eHD05/K PM90h23IRnpvmKiaFF67CUd1In/82+5mk9lczkASHiN6uObyZ/pPJAZdbDo+wsKUlGls 4L4n5baOhb7SQE0yYeaB73q3G3QuBzCJYkHukkbHLz7fNRlns7RS8feV7C1okE02AEs7 rMBONemte/Hfp1rdrPz1W1Fm9eEpTIJ4t/HZGDxBjwWK1ZIYVQdM+ZEmbqZ9/Ap3qRN6 XtY5QSqlU+67qDFfCBRuftg7nID7G5UDUcu+7EICYwg1a6PGBxSfBYVRp2d8NWNGNegj miQg== 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=5/nzZhjh1QOnMsOU7z2VDUl/ilXragolZBrsrvkynrU=; b=uJyFbi7fPoxuK3gHCAxnD3Oqs8Grrf37Wh8vIc+oT+Br5uDST2kal7uw0SsvO5t6o2 ZQaed2Zabh1br4altR1Ww86zWk6JJQvqmro8Knc2d7y/EftT3GD4pvWo4xmo0dOIoFSj oniw52Vyf5E/fuKKIZVjH2RNIszwmbmNEnxoHocmV2y+8LKPgMelU0XNf55gMT8H0f/g MBk2mtPYe8VlyJsNCjbj61Fw7mJVsgvR7MRT+VjX84T6WASEDY1B1covGirbyoBLqzKQ b01UjzA4jFKdlGCvV6ELHlal6G2YeFuFnFr5p4tuH1RZza9QmGB06sEiBpOosrz3PG+Z ZP+w== X-Gm-Message-State: AElRT7F7nBGWxl46T10+bd18/uncl9vILT/B63+Ykgar52O9/uoQT5nR TCie9nW9O1EBohd2gxQM3x5rnY9HTtTJ8U1fuGMppw== X-Google-Smtp-Source: AG47ELtZ4HC2dstRt6Jvh12EIUQUezLrKSeWlbkOxeGL52tQxl60KIYkl5/AHA0uWU4e/KKATgdXgG4y7ZkDMquqK4Q= X-Received: by 10.46.86.201 with SMTP id k70mr1695523lje.16.1520705309021; Sat, 10 Mar 2018 10:08:29 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.2.195 with HTTP; Sat, 10 Mar 2018 10:08:28 -0800 (PST) In-Reply-To: References: <201803091530.w29FUKin041283@repo.freebsd.org> From: Alan Somers Date: Sat, 10 Mar 2018 11:08:28 -0700 X-Google-Sender-Auth: n1XRnaNF1HiFoF6iPPAG-RBuwf8 Message-ID: Subject: Re: svn commit: r330696 - in head/libexec/tftpd: . tests To: Ilya Bakulin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.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: Sat, 10 Mar 2018 18:08:32 -0000 Sorry, should be fixed by 330742. On Fri, Mar 9, 2018 at 11:49 PM, Ilya Bakulin wrote: > This broke build for at least ARM. > Fix: > diff --git a/libexec/tftpd/tests/functional.c b/libexec/tftpd/tests/ > functional.c > index fea6870cac59..c467dfee3ba0 100644 > --- a/libexec/tftpd/tests/functional.c > +++ b/libexec/tftpd/tests/functional.c > @@ -248,10 +248,10 @@ require_bufeq(const char *expected, ssize_t > expected_len, const char *actual, > ssize_t i; > > ATF_REQUIRE_EQ_MSG(expected_len, len, > - "Expected %ld bytes but got %ld", expected_len, len); > + "Expected %zd bytes but got %zd", expected_len, len); > for (i = 0; i < len; i++) { > ATF_REQUIRE_EQ_MSG(actual[i], expected[i], > - "Expected %#hhx at position %ld; got %hhx instead", > + "Expected %#hhx at position %zd; got %hhx instead", > expected[i], i, actual[i]); > } > } > > On Sat, Mar 10, 2018 at 12:30 AM Alan Somers wrote: > >> Author: asomers >> Date: Fri Mar 9 15:30:20 2018 >> New Revision: 330696 >> URL: https://svnweb.freebsd.org/changeset/base/330696 >> >> Log: >> Add some functional tests for tftpd(8) >> >> tftpd(8) is difficult to test in isolation due to its relationship with >> inetd. Create a test program that mimics the behavior of tftp(1) and >> inetd(8) and verifies tftpd's response in several different scenarios. >> >> These test cases cover all of the basic TFTP protocol, but not the >> optional >> parts. >> >> PR: 157700 >> PR: 225996 >> PR: 226004 >> PR: 226005 >> MFC after: 3 weeks >> Differential Revision: https://reviews.freebsd.org/D14310 >> >> Added: >> head/libexec/tftpd/tests/ >> head/libexec/tftpd/tests/Makefile (contents, props changed) >> head/libexec/tftpd/tests/functional.c (contents, props changed) >> Modified: >> head/libexec/tftpd/Makefile >> >> Modified: head/libexec/tftpd/Makefile >> ============================================================ >> ================== >> --- head/libexec/tftpd/Makefile Fri Mar 9 14:45:47 2018 (r330695) >> +++ head/libexec/tftpd/Makefile Fri Mar 9 15:30:20 2018 (r330696) >> @@ -14,4 +14,7 @@ CFLAGS+= -DLIBWRAP >> LIBADD= wrap >> .endif >> >> +HAS_TESTS= >> +SUBDIR.${MK_TESTS}+= tests >> + >> .include >> >> Added: head/libexec/tftpd/tests/Makefile >> ============================================================ >> ================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/libexec/tftpd/tests/Makefile Fri Mar 9 15:30:20 2018 >> (r330696) >> @@ -0,0 +1,14 @@ >> +# $FreeBSD$ >> + >> +.include >> + >> +# Skip on GCC 4.2, because it lacks __COUNTER__ >> +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40300 >> +ATF_TESTS_C= functional >> +TEST_METADATA.functional+= timeout=15 >> +.endif >> + >> +LIBADD= util >> +WARNS?= 6 >> + >> +.include >> >> Added: head/libexec/tftpd/tests/functional.c >> ============================================================ >> ================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/libexec/tftpd/tests/functional.c Fri Mar 9 15:30:20 >> 2018 (r330696) >> @@ -0,0 +1,1006 @@ >> +/*- >> + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD >> + * >> + * Copyright (c) 2018 Alan Somers. All rights reserved. >> + * Redistribution and use in source and binary forms, with or without >> + * modification, are permitted provided that the following conditions >> + * are met: >> + * 1. Redistributions of source code must retain the above copyright >> + * notice, this list of conditions and the following disclaimer. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + * notice, this list of conditions and the following disclaimer in the >> + * documentation and/or other materials provided with the >> distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND >> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >> PURPOSE >> + * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE >> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >> CONSEQUENTIAL >> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE >> GOODS >> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) >> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, >> STRICT >> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY >> WAY >> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF >> + * SUCH DAMAGE. >> + */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include >> +#include >> + >> +static const uint16_t BASEPORT = 6969; >> +static const char pidfile[] = "tftpd.pid"; >> +static int protocol = PF_UNSPEC; >> +static int s = -1; /* tftp client socket */ >> +static struct sockaddr_storage addr; /* Destination address for the >> client */ >> +static bool s_flag = false; /* Pass -s to tftpd */ >> +static bool w_flag = false; /* Pass -w to tftpd */ >> + >> +/* Helper functions*/ >> +static void require_bufeq(const char *expected, ssize_t expected_len, >> + const char *actual, ssize_t len); >> + >> +/* >> + * Receive a response from tftpd >> + * @param hdr The reply's expected header, as a char >> array >> + * @param contents The reply's expected contents, as a char >> array >> + * @param contents_len Length of contents >> + */ >> +#define RECV(hdr, contents, contents_len) do { \ >> + char buffer[1024]; \ >> + struct sockaddr_storage from; \ >> + socklen_t fromlen = sizeof(from); \ >> + ssize_t r = recvfrom(s, buffer, sizeof(buffer), 0, \ >> + (struct sockaddr*)&from, &fromlen); \ >> + ATF_REQUIRE(r > 0); \ >> + require_bufeq((hdr), sizeof(hdr), buffer, \ >> + MIN(r, (ssize_t)sizeof(hdr))); \ >> + require_bufeq((const char*) (contents), (contents_len), \ >> + &buffer[sizeof(hdr)], r - sizeof(hdr)); \ >> + if (protocol == PF_INET) { \ >> + ((struct sockaddr_in*)&addr)->sin_port = \ >> + ((struct sockaddr_in*)&from)->sin_port; \ >> + } else { \ >> + ((struct sockaddr_in6*)&addr)->sin6_port = \ >> + ((struct sockaddr_in6*)&from)->sin6_port; \ >> + } \ >> +} while(0) >> + >> +static void >> +recv_ack(uint16_t blocknum) >> +{ >> + char hdr[] = {0, 4, blocknum >> 8, blocknum & 0xFF}; >> + RECV(hdr, NULL, 0); >> +} >> + >> +/* >> + * Receive a data packet from tftpd >> + * @param blocknum Expected block number to be received >> + * @param contents Pointer to expected contents >> + * @param contents_len Length of contents expected to receive >> + */ >> +static void >> +recv_data(uint16_t blocknum, const char* contents, size_t contents_len) >> +{ >> + char hdr[] = {0, 3, blocknum >> 8, blocknum & 0xFF}; >> + RECV(hdr, contents, contents_len); >> +} >> + >> +#define RECV_ERROR(code, msg) do { \ >> + char hdr[] = {0, 5, code >> 8, code & 0xFF}; \ >> + RECV(hdr, msg, sizeof(msg)); \ >> +} while (0) >> + >> +/* >> + * send a command to tftpd. >> + * @param cmd Command to send, as a char array >> + */ >> +static void >> +send_bytes(const void* cmd, ssize_t len) >> +{ >> + ssize_t r; >> + >> + r = sendto(s, cmd, len, 0, (struct sockaddr*)(&addr), >> addr.ss_len); >> + ATF_REQUIRE_EQ(r, len); >> +} >> + >> +static void >> +send_data(uint16_t blocknum, const char* contents, size_t contents_len) >> +{ >> + char buffer[1024]; >> + >> + buffer[0] = 0; /* DATA opcode high byte */ >> + buffer[1] = 3; /* DATA opcode low byte */ >> + buffer[2] = blocknum >> 8; >> + buffer[3] = blocknum & 0xFF; >> + memmove(&buffer[4], contents, contents_len); >> + send_bytes(buffer, 4 + contents_len); >> +} >> + >> +/* >> + * send a command to tftpd. >> + * @param cmd Command to send, as a const string >> + * (terminating NUL will be ignored) >> + */ >> +#define SEND_STR(cmd) ATF_REQUIRE_EQ( \ >> + sendto(s, (cmd), sizeof(cmd) - 1, 0, (struct sockaddr*)(&addr), \ >> + addr.ss_len), \ >> + sizeof(cmd) - 1) >> + >> +/* >> + * Acknowledge block blocknum >> + */ >> +static void >> +send_ack(uint16_t blocknum) >> +{ >> + char packet[] = { >> + 0, 4, /* ACK opcode in BE */ >> + blocknum >> 8, >> + blocknum & 0xFF >> + }; >> + >> + send_bytes(packet, sizeof(packet)); >> + >> +} >> + >> +/* >> + * send a read request to tftpd. >> + * @param filename filename as a string, absolute or relative >> + * @param mode either "octet" or "netascii" >> + */ >> +#define SEND_RRQ(filename, mode) SEND_STR("\0\001" filename "\0" mode >> "\0") >> + >> +/* >> + * send a write request to tftpd. >> + * @param filename filename as a string, absolute or relative >> + * @param mode either "octet" or "netascii" >> + */ >> +#define SEND_WRQ(filename, mode) SEND_STR("\0\002" filename "\0" mode >> "\0") >> + >> +/* Define a test case, for both IPv4 and IPv6 */ >> +#define TFTPD_TC_DEFINE(name, head, ...) \ >> +static void \ >> +name ## _body(void); \ >> +ATF_TC_WITH_CLEANUP(name ## _v4); \ >> +ATF_TC_HEAD(name ## _v4, tc) \ >> +{ \ >> + head \ >> +} \ >> +ATF_TC_BODY(name ## _v4, tc) \ >> +{ \ >> + __VA_ARGS__; \ >> + protocol = AF_INET; \ >> + s = setup(&addr, __COUNTER__); \ >> + name ## _body(); \ >> + close(s); \ >> +} \ >> +ATF_TC_CLEANUP(name ## _v4, tc) \ >> +{ \ >> + cleanup(); \ >> +} \ >> +ATF_TC_WITH_CLEANUP(name ## _v6); \ >> +ATF_TC_HEAD(name ## _v6, tc) \ >> +{ \ >> + head \ >> +} \ >> +ATF_TC_BODY(name ## _v6, tc) \ >> +{ \ >> + __VA_ARGS__; \ >> + protocol = AF_INET6; \ >> + s = setup(&addr, __COUNTER__); \ >> + name ## _body(); \ >> + close(s); \ >> +} \ >> +ATF_TC_CLEANUP(name ## _v6, tc) \ >> +{ \ >> + cleanup(); \ >> +} \ >> +static void \ >> +name ## _body(void) >> + >> +/* Add the IPv4 and IPv6 versions of a test case */ >> +#define TFTPD_TC_ADD(tp, name ) \ >> +do { \ >> + ATF_TP_ADD_TC(tp, name ## _v4); \ >> + ATF_TP_ADD_TC(tp, name ## _v6); \ >> +} while (0) >> + >> +/* Standard cleanup used by all testcases */ >> +static void >> +cleanup(void) >> +{ >> + int fd = -1; >> + char buffer[80] = {0}; >> + pid_t pid; >> + >> + fd = open(pidfile, O_RDONLY); >> + if (fd < 0) >> + return; >> + if (read(fd, buffer, sizeof(buffer)) > 0) { >> + sscanf(buffer, "%d", &pid); >> + kill(pid, SIGTERM); >> + waitpid(pid, NULL, 0); >> + } >> + close(fd); >> + unlink(pidfile); >> +} >> + >> +/* Assert that two binary buffers are identical */ >> +static void >> +require_bufeq(const char *expected, ssize_t expected_len, const char >> *actual, >> + ssize_t len) >> +{ >> + ssize_t i; >> + >> + ATF_REQUIRE_EQ_MSG(expected_len, len, >> + "Expected %ld bytes but got %ld", expected_len, len); >> + for (i = 0; i < len; i++) { >> + ATF_REQUIRE_EQ_MSG(actual[i], expected[i], >> + "Expected %#hhx at position %ld; got %hhx instead", >> + expected[i], i, actual[i]); >> + } >> +} >> + >> +/* >> + * Start tftpd and return its communicating socket >> + * @param to Will be filled in for use with sendto >> + * @param idx Unique identifier of the test case >> + * @return Socket ready to use >> + */ >> +static int >> +setup(struct sockaddr_storage *to, uint16_t idx) >> +{ >> + int client_s, server_s, pid, argv_idx; >> + char execname[] = "/usr/libexec/tftpd"; >> + char s_flag_str[] = "-s"; >> + char w_flag_str[] = "-w"; >> + char pwd[MAXPATHLEN]; >> + char *argv[10]; >> + struct sockaddr_in addr4; >> + struct sockaddr_in6 addr6; >> + struct sockaddr *server_addr; >> + struct pidfh *pfh; >> + uint16_t port = BASEPORT + idx; >> + socklen_t len; >> + >> + if (protocol == PF_INET) { >> + len = sizeof(addr4); >> + bzero(&addr4, len); >> + addr4.sin_len = len; >> + addr4.sin_family = PF_INET; >> + addr4.sin_port = htons(port); >> + server_addr = (struct sockaddr*)&addr4; >> + } else { >> + len = sizeof(addr6); >> + bzero(&addr6, len); >> + addr6.sin6_len = len; >> + addr6.sin6_family = PF_INET6; >> + addr6.sin6_port = htons(port); >> + server_addr = (struct sockaddr*)&addr6; >> + } >> + >> + ATF_REQUIRE_EQ(getcwd(pwd, sizeof(pwd)), pwd); >> + >> + /* Must bind(2) pre-fork so it happens before the client's >> send(2) */ >> + ATF_REQUIRE((server_s = socket(protocol, SOCK_DGRAM, 0)) > 0); >> + ATF_REQUIRE_EQ_MSG(bind(server_s, server_addr, len), 0, >> + "bind failed with error %s", strerror(errno)); >> + >> + pid = fork(); >> + switch (pid) { >> + case -1: >> + atf_tc_fail("fork failed"); >> + break; >> + case 0: >> + /* In child */ >> + pfh = pidfile_open(pidfile, 0644, NULL); >> + ATF_REQUIRE_MSG(pfh != NULL, >> + "pidfile_open: %s", strerror(errno)); >> + ATF_REQUIRE_EQ(pidfile_write(pfh), 0); >> + ATF_REQUIRE_EQ(pidfile_close(pfh), 0); >> + >> + bzero(argv, sizeof(argv)); >> + argv[0] = execname; >> + argv_idx = 1; >> + if (w_flag) >> + argv[argv_idx++] = w_flag_str; >> + if (s_flag) >> + argv[argv_idx++] = s_flag_str; >> + argv[argv_idx++] = pwd; >> + ATF_REQUIRE_EQ(dup2(server_s, STDOUT_FILENO), >> STDOUT_FILENO); >> + ATF_REQUIRE_EQ(dup2(server_s, STDIN_FILENO), >> STDIN_FILENO); >> + ATF_REQUIRE_EQ(dup2(server_s, STDERR_FILENO), >> STDERR_FILENO); >> + execv(execname, argv); >> + atf_tc_fail("exec failed"); >> + break; >> + default: >> + /* In parent */ >> + bzero(to, sizeof(*to)); >> + if (protocol == PF_INET) { >> + struct sockaddr_in *to4 = (struct sockaddr_in*)to; >> + to4->sin_len = sizeof(*to4); >> + to4->sin_family = PF_INET; >> + to4->sin_port = htons(port); >> + to4->sin_addr.s_addr = htonl(INADDR_LOOPBACK); >> + } else { >> + struct in6_addr loopback = IN6ADDR_LOOPBACK_INIT; >> + struct sockaddr_in6 *to6 = (struct >> sockaddr_in6*)to; >> + to6->sin6_len = sizeof(*to6); >> + to6->sin6_family = PF_INET6; >> + to6->sin6_port = htons(port); >> + to6->sin6_addr = loopback; >> + } >> + >> + close(server_s); >> + ATF_REQUIRE((client_s = socket(protocol, SOCK_DGRAM, 0)) >> > 0); >> + break; >> + } >> + return (client_s); >> +} >> + >> +/* Like write(2), but never returns less than the requested length */ >> +static void >> +write_all(int fd, const void *buf, size_t nbytes) >> +{ >> + ssize_t r; >> + >> + while (nbytes > 0) { >> + r = write(fd, buf, nbytes); >> + ATF_REQUIRE(r > 0); >> + nbytes -= r; >> + buf = (const char*)buf + r; >> + } >> +} >> + >> + >> +/* >> + * Test Cases >> + */ >> + >> +/* >> + * Read a file, specified by absolute pathname. >> + */ >> +TFTPD_TC_DEFINE(abspath,) >> +{ >> + int fd; >> + char command[1024]; >> + size_t pathlen; >> + char suffix[] = {'\0', 'o', 'c', 't', 'e', 't', '\0'}; >> + >> + command[0] = 0; /* RRQ high byte */ >> + command[1] = 1; /* RRQ low byte */ >> + ATF_REQUIRE(getcwd(&command[2], sizeof(command) - 2) != NULL); >> + pathlen = strlcat(&command[2], "/abspath.txt", sizeof(command) - >> 2); >> + ATF_REQUIRE(pathlen + sizeof(suffix) < sizeof(command) - 2); >> + memmove(&command[2 + pathlen], suffix, sizeof(suffix)); >> + >> + fd = open("abspath.txt", O_CREAT | O_RDONLY, 0644); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + >> + send_bytes(command, 2 + pathlen + sizeof(suffix)); >> + recv_data(1, NULL, 0); >> + send_ack(1); >> +} >> + >> +/* >> + * Attempt to read a file outside of the allowed directory(ies) >> + */ >> +TFTPD_TC_DEFINE(dotdot,) >> +{ >> + ATF_REQUIRE_EQ(mkdir("subdir", 0777), 0); >> + SEND_RRQ("../disallowed.txt", "octet"); >> + RECV_ERROR(2, "Access violation"); >> + s = setup(&addr, __COUNTER__); \ >> + SEND_RRQ("subdir/../../disallowed.txt", "octet"); >> + RECV_ERROR(2, "Access violation"); >> + s = setup(&addr, __COUNTER__); \ >> + SEND_RRQ("/etc/passwd", "octet"); >> + RECV_ERROR(2, "Access violation"); >> +} >> + >> +/* >> + * With "-s", tftpd should chroot to the specified directory >> + */ >> +TFTPD_TC_DEFINE(s_flag, atf_tc_set_md_var(tc, "require.user", "root");, >> + s_flag = true) >> +{ >> + int fd; >> + char contents[] = "small"; >> + >> + fd = open("small.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + write_all(fd, contents, strlen(contents) + 1); >> + close(fd); >> + >> + SEND_RRQ("/small.txt", "octet"); >> + recv_data(1, contents, strlen(contents) + 1); >> + send_ack(1); >> +} >> + >> +/* >> + * Read a file, and simulate a dropped ACK packet >> + */ >> +TFTPD_TC_DEFINE(rrq_dropped_ack,) >> +{ >> + int fd; >> + char contents[] = "small"; >> + >> + fd = open("small.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + write_all(fd, contents, strlen(contents) + 1); >> + close(fd); >> + >> + SEND_RRQ("small.txt", "octet"); >> + recv_data(1, contents, strlen(contents) + 1); >> + /* >> + * client "sends" the ack, but network drops it >> + * Eventually, tftpd should resend the data packet >> + */ >> + recv_data(1, contents, strlen(contents) + 1); >> + send_ack(1); >> +} >> + >> +/* >> + * Read a file, and simulate a dropped DATA packet >> + */ >> +TFTPD_TC_DEFINE(rrq_dropped_data,) >> +{ >> + int fd; >> + size_t i; >> + uint32_t contents[192]; >> + char buffer[1024]; >> + >> + for (i = 0; i < nitems(contents); i++) >> + contents[i] = i; >> + >> + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + write_all(fd, contents, sizeof(contents)); >> + close(fd); >> + >> + SEND_RRQ("medium.txt", "octet"); >> + recv_data(1, (const char*)&contents[0], 512); >> + send_ack(1); >> + (void) recvfrom(s, buffer, sizeof(buffer), 0, NULL, NULL); >> + /* >> + * server "sends" the data, but network drops it >> + * Eventually, client should resend the last ACK >> + */ >> + send_ack(1); >> + recv_data(2, (const char*)&contents[128], 256); >> + send_ack(2); >> +} >> + >> +/* >> + * Read a medium file, and simulate a duplicated ACK packet >> + */ >> +TFTPD_TC_DEFINE(rrq_duped_ack,) >> +{ >> + int fd; >> + size_t i; >> + uint32_t contents[192]; >> + >> + for (i = 0; i < nitems(contents); i++) >> + contents[i] = i; >> + >> + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + write_all(fd, contents, sizeof(contents)); >> + close(fd); >> + >> + SEND_RRQ("medium.txt", "octet"); >> + recv_data(1, (const char*)&contents[0], 512); >> + send_ack(1); >> + send_ack(1); /* Dupe an ACK packet */ >> + recv_data(2, (const char*)&contents[128], 256); >> + recv_data(2, (const char*)&contents[128], 256); >> + send_ack(2); >> +} >> + >> + >> +/* >> + * Attempt to read a file without read permissions >> + */ >> +TFTPD_TC_DEFINE(rrq_eaccess,) >> +{ >> + int fd; >> + >> + fd = open("empty.txt", O_CREAT | O_RDONLY, 0000); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + >> + SEND_RRQ("empty.txt", "octet"); >> + RECV_ERROR(2, "Access violation"); >> +} >> + >> +/* >> + * Read an empty file >> + */ >> +TFTPD_TC_DEFINE(rrq_empty,) >> +{ >> + int fd; >> + >> + fd = open("empty.txt", O_CREAT | O_RDONLY, 0644); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + >> + SEND_RRQ("empty.txt", "octet"); >> + recv_data(1, NULL, 0); >> + send_ack(1); >> +} >> + >> +/* >> + * Read a medium file of more than one block >> + */ >> +TFTPD_TC_DEFINE(rrq_medium,) >> +{ >> + int fd; >> + size_t i; >> + uint32_t contents[192]; >> + >> + for (i = 0; i < nitems(contents); i++) >> + contents[i] = i; >> + >> + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + write_all(fd, contents, sizeof(contents)); >> + close(fd); >> + >> + SEND_RRQ("medium.txt", "octet"); >> + recv_data(1, (const char*)&contents[0], 512); >> + send_ack(1); >> + recv_data(2, (const char*)&contents[128], 256); >> + send_ack(2); >> +} >> + >> +/* >> + * Read a file in netascii format >> + */ >> +TFTPD_TC_DEFINE(rrq_netascii,) >> +{ >> + int fd; >> + char contents[] = "foo\nbar\rbaz\n"; >> + /* >> + * Weirdly, RFC-764 says that CR must be followed by NUL if a >> line feed >> + * is not intended >> + */ >> + char expected[] = "foo\r\nbar\r\0baz\r\n"; >> + >> + fd = open("unix.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + write_all(fd, contents, strlen(contents) + 1); >> + close(fd); >> + >> + SEND_RRQ("unix.txt", "netascii"); >> + recv_data(1, expected, sizeof(expected)); >> + send_ack(1); >> +} >> + >> +/* >> + * Read a file that doesn't exist >> + */ >> +TFTPD_TC_DEFINE(rrq_nonexistent,) >> +{ >> + SEND_RRQ("nonexistent.txt", "octet"); >> + RECV_ERROR(1, "File not found"); >> +} >> + >> +/* >> + * Attempt to read a file whose name exceeds PATH_MAX >> + */ >> +TFTPD_TC_DEFINE(rrq_path_max,) >> +{ >> +#define AReallyBigFileName \ >> + "AReallyBigFileNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX >> XXXX"\ >> + ".txt" >> + ATF_REQUIRE_MSG(strlen(AReallyBigFileName) > PATH_MAX, >> + "Somebody increased PATH_MAX. Update the test"); >> + SEND_RRQ(AReallyBigFileName, "octet"); >> + RECV_ERROR(4, "Illegal TFTP operation"); >> +} >> + >> +/* >> + * Read a small file of less than one block >> + */ >> +TFTPD_TC_DEFINE(rrq_small,) >> +{ >> + int fd; >> + char contents[] = "small"; >> + >> + fd = open("small.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + write_all(fd, contents, strlen(contents) + 1); >> + close(fd); >> + >> + SEND_RRQ("small.txt", "octet"); >> + recv_data(1, contents, strlen(contents) + 1); >> + send_ack(1); >> +} >> + >> +/* >> + * Try to transfer a file with an unknown mode. >> + */ >> +TFTPD_TC_DEFINE(unknown_modes,) >> +{ >> + SEND_RRQ("foo.txt", "ascii"); /* Misspelling of "ascii" */ >> + RECV_ERROR(4, "Illegal TFTP operation"); >> + s = setup(&addr, __COUNTER__); \ >> + SEND_RRQ("foo.txt", "binary"); /* Obsolete. Use "octet" instead >> */ >> + RECV_ERROR(4, "Illegal TFTP operation"); >> + s = setup(&addr, __COUNTER__); \ >> + SEND_RRQ("foo.txt", "en_US.UTF-8"); >> + RECV_ERROR(4, "Illegal TFTP operation"); >> + s = setup(&addr, __COUNTER__); \ >> + SEND_RRQ("foo.txt", "mail"); /* Obsolete in RFC-1350 */ >> + RECV_ERROR(4, "Illegal TFTP operation"); >> +} >> + >> +/* >> + * Send an unknown opcode. tftpd should respond with the appropriate >> error >> + */ >> +TFTPD_TC_DEFINE(unknown_opcode,) >> +{ >> + /* Looks like an RRQ or WRQ request, but with a bad opcode */ >> + SEND_STR("\0\007foo.txt\0octet\0"); >> + atf_tc_expect_timeout("PR 226005 tftpd ignores bad opcodes but >> doesn't reject them"); >> + RECV_ERROR(4, "Illegal TFTP operation"); >> +} >> + >> +/* >> + * Invoke tftpd with "-w" and write to a nonexistent file. >> + */ >> +TFTPD_TC_DEFINE(w_flag,, w_flag = 1;) >> +{ >> + int fd; >> + ssize_t r; >> + char contents[] = "small"; >> + char buffer[1024]; >> + size_t contents_len; >> + >> + contents_len = strlen(contents) + 1; >> + SEND_WRQ("small.txt", "octet"); >> + recv_ack(0); >> + send_data(1, contents, contents_len); >> + recv_ack(1); >> + >> + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); >> + fd = open("small.txt", O_RDONLY); >> + r = read(fd, buffer, sizeof(buffer)); >> + close(fd); >> + require_bufeq(contents, contents_len, buffer, r); >> +} >> + >> +/* >> + * Write a medium file, and simulate a dropped ACK packet >> + */ >> +TFTPD_TC_DEFINE(wrq_dropped_ack,) >> +{ >> + int fd; >> + size_t i; >> + ssize_t r; >> + uint32_t contents[192]; >> + char buffer[1024]; >> + >> + for (i = 0; i < nitems(contents); i++) >> + contents[i] = i; >> + >> + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + >> + SEND_WRQ("medium.txt", "octet"); >> + recv_ack(0); >> + send_data(1, (const char*)&contents[0], 512); >> + /* >> + * Servers "sends" an ACK packet, but network drops it. >> + * Eventually, server should resend the last ACK >> + */ >> + (void) recvfrom(s, buffer, sizeof(buffer), 0, NULL, NULL); >> + recv_ack(1); >> + send_data(2, (const char*)&contents[128], 256); >> + recv_ack(2); >> + >> + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); >> + fd = open("medium.txt", O_RDONLY); >> + r = read(fd, buffer, sizeof(buffer)); >> + close(fd); >> + require_bufeq((const char*)contents, 768, buffer, r); >> +} >> + >> +/* >> + * Write a small file, and simulate a dropped DATA packet >> + */ >> +TFTPD_TC_DEFINE(wrq_dropped_data,) >> +{ >> + int fd; >> + ssize_t r; >> + char contents[] = "small"; >> + size_t contents_len; >> + char buffer[1024]; >> + >> + fd = open("small.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + contents_len = strlen(contents) + 1; >> + >> + SEND_WRQ("small.txt", "octet"); >> + recv_ack(0); >> + /* >> + * Client "sends" a DATA packet, but network drops it. >> + * Eventually, server should resend the last ACK >> + */ >> + recv_ack(0); >> + send_data(1, contents, contents_len); >> + recv_ack(1); >> + >> + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); >> + fd = open("small.txt", O_RDONLY); >> + r = read(fd, buffer, sizeof(buffer)); >> + close(fd); >> + require_bufeq(contents, contents_len, buffer, r); >> +} >> + >> +/* >> + * Write a medium file, and simulate a duplicated DATA packet >> + */ >> +TFTPD_TC_DEFINE(wrq_duped_data,) >> +{ >> + int fd; >> + size_t i; >> + ssize_t r; >> + uint32_t contents[192]; >> + char buffer[1024]; >> + >> + for (i = 0; i < nitems(contents); i++) >> + contents[i] = i; >> + >> + fd = open("medium.txt", O_RDWR | O_CREAT, 0644); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + >> + SEND_WRQ("medium.txt", "octet"); >> + recv_ack(0); >> + send_data(1, (const char*)&contents[0], 512); >> + send_data(1, (const char*)&contents[0], 512); >> + recv_ack(1); >> + recv_ack(1); >> + send_data(2, (const char*)&contents[128], 256); >> + recv_ack(2); >> + >> + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); >> + fd = open("medium.txt", O_RDONLY); >> + r = read(fd, buffer, sizeof(buffer)); >> + close(fd); >> + require_bufeq((const char*)contents, 768, buffer, r); >> +} >> + >> +/* >> + * Attempt to write a file without write permissions >> + */ >> +TFTPD_TC_DEFINE(wrq_eaccess,) >> +{ >> + int fd; >> + >> + fd = open("empty.txt", O_CREAT | O_RDONLY, 0440); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + >> + SEND_WRQ("empty.txt", "octet"); >> + atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access >> " >> + "violation"); >> + RECV_ERROR(2, "Access violation"); >> +} >> + >> +/* >> + * Attempt to write a file without world write permissions, but with >> world >> + * read permissions >> + */ >> +TFTPD_TC_DEFINE(wrq_eaccess_world_readable,) >> +{ >> + int fd; >> + >> + fd = open("empty.txt", O_CREAT | O_RDONLY, 0444); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + >> + SEND_WRQ("empty.txt", "octet"); >> + atf_tc_expect_fail("PR 226004 with relative pathnames, tftpd >> doesn't validate world writability"); >> + RECV_ERROR(2, "Access violation"); >> +} >> + >> + >> +/* >> + * Write a medium file of more than one block >> + */ >> +TFTPD_TC_DEFINE(wrq_medium,) >> +{ >> + int fd; >> + size_t i; >> + ssize_t r; >> + uint32_t contents[192]; >> + char buffer[1024]; >> + >> + for (i = 0; i < nitems(contents); i++) >> + contents[i] = i; >> + >> + fd = open("medium.txt", O_RDWR | O_CREAT, 0666); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + >> + SEND_WRQ("medium.txt", "octet"); >> + recv_ack(0); >> + send_data(1, (const char*)&contents[0], 512); >> + recv_ack(1); >> + send_data(2, (const char*)&contents[128], 256); >> + recv_ack(2); >> + >> + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); >> + fd = open("medium.txt", O_RDONLY); >> + r = read(fd, buffer, sizeof(buffer)); >> + close(fd); >> + require_bufeq((const char*)contents, 768, buffer, r); >> +} >> + >> +/* >> + * Write a file in netascii format >> + */ >> +TFTPD_TC_DEFINE(wrq_netascii,) >> +{ >> + int fd; >> + ssize_t r; >> + /* >> + * Weirdly, RFC-764 says that CR must be followed by NUL if a >> line feed >> + * is not intended >> + */ >> + char contents[] = "foo\r\nbar\r\0baz\r\n"; >> + char expected[] = "foo\nbar\rbaz\n"; >> + size_t contents_len; >> + char buffer[1024]; >> + >> + fd = open("unix.txt", O_RDWR | O_CREAT, 0666); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + contents_len = strlen(contents) + 1; >> + >> + SEND_WRQ("unix.txt", "netascii"); >> + recv_ack(0); >> + send_data(1, contents, contents_len); >> + recv_ack(1); >> + >> + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); >> + fd = open("unix.txt", O_RDONLY); >> + r = read(fd, buffer, sizeof(buffer)); >> + close(fd); >> + require_bufeq(expected, sizeof(expected), buffer, r); >> +} >> + >> +/* >> + * Attempt to write to a nonexistent file. With the default options, >> this >> + * isn't allowed. >> + */ >> +TFTPD_TC_DEFINE(wrq_nonexistent,) >> +{ >> + SEND_WRQ("nonexistent.txt", "octet"); >> + atf_tc_expect_fail("PR 225996 tftpd doesn't abort on a WRQ access >> " >> + "violation"); >> + RECV_ERROR(1, "File not found"); >> +} >> + >> +/* >> + * Write a small file of less than one block >> + */ >> +TFTPD_TC_DEFINE(wrq_small,) >> +{ >> + int fd; >> + ssize_t r; >> + char contents[] = "small"; >> + size_t contents_len; >> + char buffer[1024]; >> + >> + fd = open("small.txt", O_RDWR | O_CREAT, 0666); >> + ATF_REQUIRE(fd >= 0); >> + close(fd); >> + contents_len = strlen(contents) + 1; >> + >> + SEND_WRQ("small.txt", "octet"); >> + recv_ack(0); >> + send_data(1, contents, contents_len); >> + recv_ack(1); >> + >> + atf_tc_expect_fail("PR 157700 tftpd expects more data after EOF"); >> + fd = open("small.txt", O_RDONLY); >> + r = read(fd, buffer, sizeof(buffer)); >> + close(fd); >> + require_bufeq(contents, contents_len, buffer, r); >> +} >> + >> +/* >> + * Write an empty file over a non-empty one >> + */ >> +TFTPD_TC_DEFINE(wrq_truncate,) >> +{ >> + int fd; >> + char contents[] = "small"; >> + struct stat sb; >> + >> + fd = open("small.txt", O_RDWR | O_CREAT, 0666); >> + ATF_REQUIRE(fd >= 0); >> + write_all(fd, contents, strlen(contents) + 1); >> + close(fd); >> + >> + SEND_WRQ("small.txt", "octet"); >> + recv_ack(0); >> + send_data(1, NULL, 0); >> + recv_ack(1); >> + >> + ATF_REQUIRE_EQ(stat("small.txt", &sb), 0); >> + ATF_REQUIRE_EQ(sb.st_size, 0); >> +} >> + >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> >> From owner-svn-src-head@freebsd.org Sat Mar 10 20:13: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 3BD16F2F910; Sat, 10 Mar 2018 20:13:08 +0000 (UTC) (envelope-from jamie@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 D1A52822A1; Sat, 10 Mar 2018 20:13:07 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6F9F1290D; Sat, 10 Mar 2018 20:13:07 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2AKD7MF039282; Sat, 10 Mar 2018 20:13:07 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2AKD78X039280; Sat, 10 Mar 2018 20:13:07 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201803102013.w2AKD78X039280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sat, 10 Mar 2018 20:13:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330743 - in head: etc/rc.d share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: jamie X-SVN-Commit-Paths: in head: etc/rc.d share/man/man5 X-SVN-Commit-Revision: 330743 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 20:13:08 -0000 Author: jamie Date: Sat Mar 10 20:13:07 2018 New Revision: 330743 URL: https://svnweb.freebsd.org/changeset/base/330743 Log: Don't warn when the "hostname" rc variable is unset, but the hostname is already non-empty (common in jails). Modified: head/etc/rc.d/hostname head/share/man/man5/rc.conf.5 Modified: head/etc/rc.d/hostname ============================================================================== --- head/etc/rc.d/hostname Sat Mar 10 18:07:31 2018 (r330742) +++ head/etc/rc.d/hostname Sat Mar 10 20:13:07 2018 (r330743) @@ -60,9 +60,11 @@ hostname_start() # Have we got a hostname yet? # if [ -z "${hostname}" ]; then - # Null hostname is probably OK if DHCP is in use. + # Null hostname is probably OK if DHCP is in use, + # or when hostname is already set (common for jails). # - if [ -z "`list_net_interfaces dhcp`" ]; then + if [ -z "`list_net_interfaces dhcp`" -a \ + -z "`/bin/hostname`" ]; then warn "\$hostname is not set -- see rc.conf(5)." fi return Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Mar 10 18:07:31 2018 (r330742) +++ head/share/man/man5/rc.conf.5 Sat Mar 10 20:13:07 2018 (r330743) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2018 +.Dd March 10, 2018 .Dt RC.CONF 5 .Os .Sh NAME @@ -421,6 +421,9 @@ If .Xr dhclient 8 is used to set the hostname via DHCP, this variable should be set to an empty string. +Within a +.Xr jail 8 +the hostname is generally already set and this variable may absent. If this value remains unset when the system is done booting your console login will display the default hostname of .Dq Amnesiac . From owner-svn-src-head@freebsd.org Sat Mar 10 22:01: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 06B71F378E0 for ; Sat, 10 Mar 2018 22:01:49 +0000 (UTC) (envelope-from dab@freebsd.org) Received: from qproxy6-pub.mail.unifiedlayer.com (qproxy6-pub.mail.unifiedlayer.com [69.89.23.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E89385A6B for ; Sat, 10 Mar 2018 22:01:48 +0000 (UTC) (envelope-from dab@freebsd.org) Received: from cmgw4 (unknown [10.0.90.85]) by qproxy6.mail.unifiedlayer.com (Postfix) with ESMTP id 2F8871407B0 for ; Sat, 10 Mar 2018 15:01:47 -0700 (MST) Received: from host305.hostmonster.com ([74.220.215.105]) by cmgw4 with id LN1i1x00h2H155E01N1l0A; Sat, 10 Mar 2018 15:01:47 -0700 X-Authority-Analysis: v=2.2 cv=G85sK5s5 c=1 sm=1 tr=0 a=oRSXaeV14bi+UgmAP6q2Hg==:117 a=oRSXaeV14bi+UgmAP6q2Hg==:17 a=IkcTkHD0fZMA:10 a=v2DPQv5-lfwA:10 a=6I5d2MoRAAAA:8 a=TlQAbdF0yEK7xw9wynIA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 Received: from d192-24-6-24.try.wideopenwest.com ([24.192.24.6]:51616 helo=[192.168.1.122]) by host305.hostmonster.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1eumYf-002ICK-UL; Sat, 10 Mar 2018 15:01:41 -0700 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs From: David Bright In-Reply-To: <20180310161701.GA73335@raichu> Date: Sat, 10 Mar 2018 17:01:40 -0500 Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201801151925.w0FJPCKA019434@repo.freebsd.org> <20180309220940.GG6174@raichu> <1520634689.84937.74.camel@freebsd.org> <20180310161701.GA73335@raichu> To: Mark Johnston 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 - host305.hostmonster.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - FreeBSD.org X-BWhitelist: no X-Source-IP: 24.192.24.6 X-Exim-ID: 1eumYf-002ICK-UL X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: d192-24-6-24.try.wideopenwest.com ([192.168.1.122]) [24.192.24.6]:51616 X-Source-Auth: david@bright-family.net X-Email-Count: 1 X-Source-Cap: YnJpZ2h0ZmE7YnJpZ2h0ZmE7aG9zdDMwNS5ob3N0bW9uc3Rlci5jb20= X-Local-Domain: no 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 Mar 2018 22:01:49 -0000 With regard to: fsck_y_flags=3D"-T ffs:-R -T ufs:-R" # Additional = flags for fsck -y I don=E2=80=99t know how, but I completely missed the -T option for fsck = when I was investigating this issue. That would be very useful, although = I wanted my solution to be applicable to file systems other than = ffs/ufs. With regard to the fsck_ffs behavior being a regression because formerly = the FS would be mounted successfully: That was not my experience. What I observed was that the =E2=80=9Cfsck = -y=E2=80=9D would give the =E2=80=9Cplease re-run=E2=80=9D message, exit = with 0 status so the boot would continue, the subsequent mount would = fail because the filesystem was not clean, and *then* the boot would = stop and drop to single user. --=20 David Bright dab@FreeBSD.org From owner-svn-src-head@freebsd.org Sat Mar 10 22:07: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 78337F3805E; Sat, 10 Mar 2018 22:07:58 +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 1F20885DDF; Sat, 10 Mar 2018 22:07:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14CF913A82; Sat, 10 Mar 2018 22:07:58 +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 w2AM7vYa093820; Sat, 10 Mar 2018 22:07:57 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2AM7vKk093818; Sat, 10 Mar 2018 22:07:57 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201803102207.w2AM7vKk093818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 10 Mar 2018 22:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330745 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 330745 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:07:58 -0000 Author: ian Date: Sat Mar 10 22:07:57 2018 New Revision: 330745 URL: https://svnweb.freebsd.org/changeset/base/330745 Log: Make root mount timeout logic work for filesystems other than ufs. The vfs.mountroot.timeout tunable and .timeout directive in a mount.conf(5) file allow specifying a wait timeout for the device(s) hosting the root filesystem to become usable. The current mechanism for waiting for devices and detecting their availability can't be used for zfs-hosted filesystems. See the comment #20 in the PR for some expanded detail on these points. This change adds retry logic to the actual root filesystem mount. That is, insted of relying on device availability using device name lookups, it uses the kernel_mount() call itself to detect whether the filesystem can be mounted, and loops until it succeeds or the configured timeout is exceeded. These changes are based on the patch attached to the PR, but it's rewritten enough that all mistakes belong to me. PR: 208882 X-MFC after: sufficient testing, and hopefully in time for 11.1 Modified: head/sys/kern/vfs_mountroot.c Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Sat Mar 10 20:46:36 2018 (r330744) +++ head/sys/kern/vfs_mountroot.c Sat Mar 10 22:07:57 2018 (r330745) @@ -714,7 +714,7 @@ parse_mount(char **conf) char *errmsg; struct mntarg *ma; char *dev, *fs, *opts, *tok; - int error; + int delay, error, timeout; error = parse_token(conf, &tok); if (error) @@ -755,15 +755,31 @@ parse_mount(char **conf) if (error != 0) goto out; - ma = NULL; - ma = mount_arg(ma, "fstype", fs, -1); - ma = mount_arg(ma, "fspath", "/", -1); - ma = mount_arg(ma, "from", dev, -1); - ma = mount_arg(ma, "errmsg", errmsg, ERRMSGL); - ma = mount_arg(ma, "ro", NULL, 0); - ma = parse_mountroot_options(ma, opts); - error = kernel_mount(ma, MNT_ROOTFS); + delay = hz / 10; + timeout = root_mount_timeout * hz; + for (;;) { + ma = NULL; + ma = mount_arg(ma, "fstype", fs, -1); + ma = mount_arg(ma, "fspath", "/", -1); + ma = mount_arg(ma, "from", dev, -1); + ma = mount_arg(ma, "errmsg", errmsg, ERRMSGL); + ma = mount_arg(ma, "ro", NULL, 0); + ma = parse_mountroot_options(ma, opts); + + error = kernel_mount(ma, MNT_ROOTFS); + if (error == 0 || timeout <= 0) + break; + + if (root_mount_timeout * hz == timeout || + (bootverbose && timeout % hz == 0)) { + printf("Mounting from %s:%s failed with error %d; " + "retrying for %d more second%s\n", fs, dev, error, + timeout / hz, (timeout / hz > 1) ? "s" : ""); + } + pause("rmretry", delay); + timeout -= delay; + } out: if (error) { printf("Mounting from %s:%s failed with error %d", From owner-svn-src-head@freebsd.org Sat Mar 10 22:52: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 B2316F3BD40; Sat, 10 Mar 2018 22:52:39 +0000 (UTC) (envelope-from avos@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 63FC787BFB; Sat, 10 Mar 2018 22:52:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5ED821425E; Sat, 10 Mar 2018 22:52:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2AMqd2a018534; Sat, 10 Mar 2018 22:52:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2AMqdiW018533; Sat, 10 Mar 2018 22:52:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803102252.w2AMqdiW018533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 10 Mar 2018 22:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330747 - head/sys/dev/usb/wlan X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/usb/wlan X-SVN-Commit-Revision: 330747 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 22:52:39 -0000 Author: avos Date: Sat Mar 10 22:52:39 2018 New Revision: 330747 URL: https://svnweb.freebsd.org/changeset/base/330747 Log: run(4): drop few unused variables. Found by: Clang static analyzer Modified: head/sys/dev/usb/wlan/if_run.c Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sat Mar 10 22:47:26 2018 (r330746) +++ head/sys/dev/usb/wlan/if_run.c Sat Mar 10 22:52:39 2018 (r330747) @@ -3483,7 +3483,6 @@ run_tx_mgt(struct run_softc *sc, struct mbuf *m, struc struct rt2860_txwi *txwi; uint16_t dur; uint8_t ridx = rn->mgt_ridx; - uint8_t type; uint8_t xflags = 0; uint8_t wflags = 0; @@ -3491,8 +3490,6 @@ run_tx_mgt(struct run_softc *sc, struct mbuf *m, struc wh = mtod(m, struct ieee80211_frame *); - type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - /* tell hardware to add timestamp for probe responses */ if ((wh->i_fc[0] & (IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_MASK)) == @@ -3609,11 +3606,9 @@ run_tx_param(struct run_softc *sc, struct mbuf *m, str const struct ieee80211_bpf_params *params) { struct ieee80211com *ic = ni->ni_ic; - struct ieee80211_frame *wh; struct run_tx_data *data; struct rt2870_txd *txd; struct rt2860_txwi *txwi; - uint8_t type; uint8_t ridx; uint8_t rate; uint8_t opflags = 0; @@ -3623,9 +3618,6 @@ run_tx_param(struct run_softc *sc, struct mbuf *m, str RUN_LOCK_ASSERT(sc, MA_OWNED); KASSERT(params != NULL, ("no raw xmit params")); - - wh = mtod(m, struct ieee80211_frame *); - type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; rate = params->ibp_rate0; if (!ieee80211_isratevalid(ic->ic_rt, rate)) { From owner-svn-src-head@freebsd.org Sat Mar 10 22:56: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 B7DD3F3C149; Sat, 10 Mar 2018 22:56:14 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B87687E29; Sat, 10 Mar 2018 22:56:14 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x241.google.com with SMTP id v194-v6so7088413itb.0; Sat, 10 Mar 2018 14:56:14 -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=DyV32CBfUdom7Wkx0k660Nd98+QzjQ2x27k5XdQAyhw=; b=IKyYcRNVz9WQAUZ3gzRYXF4dPYN9T868tKZ/oBXhW/IYLxCK+KmgbIlIX0+RNOjD/y SqsmivtLxDGzX+wDlCEz/CHHTkfJ7Q2pMxuKXG01f/+OWW8o96FkScSpof7jBLNGWaoA oXmHAfYuXsjHsjknoocquwmq1pjsJiS+GO8qUmLPCO0cXNV2GPQZ2+u12kfil9HjFyE+ p9F99tYQanFYhP0UEFmssEoZ1kszXi/ChcNDEY1J2A+mKiSJMCRdXlDKWpru+T7z0t6X Y9dYXX3b7XPARPdCDsPIc1lTEd+d4/6Bcr9vVeDg2Yd4SQliYL/f+fZKpCTXvdYm8oJN Jwcw== 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=DyV32CBfUdom7Wkx0k660Nd98+QzjQ2x27k5XdQAyhw=; b=aBotvB7JMBeqbaDTkOdLuUcJEhIigTDUsu4fFkon+csxDdQkkK7Afge2wClHKiu0TW TzLfN6ZtUp35xlr+HNJj7kPsLmRq64IsqQn2HWyYP/hy4iA9+v6SHmDDLE265HomqSMo Mu9qAxLSYKBPy354cCrcjxLPOqU18Xy06iICXEts/JYx2o7jegFezci2hQDN5dPiLaNp oIqG0Qz58Z4daZnqv9fC9ZC3oI9+KZ72T2AcUNHp5DpakuxrXDHoWUsIIK+U9rOo9C/R 4+wwO2sDqmQK8sLhhMSbKLt1SmtPFmdxO7kkIkNCX41CWZUS+QnCa6Z4DYDfrMsoT3W4 CccA== X-Gm-Message-State: AElRT7Fm/wXMgATrI/qHcS3vU1SCXx/K/nY2j4gaGQry4WoS6f1Q5rBf 6uaK+3KHTFl22jZnJgWJgHuMUg== X-Google-Smtp-Source: AG47ELtVEKkCq5YocmSn9wm+GyUbxLcDmHH9j6o4M1mw60WWKjmX4m9XtV+K2HidMKLWKlqVl+cKJQ== X-Received: by 10.36.189.129 with SMTP id x123mr3422359ite.13.1520722573329; Sat, 10 Mar 2018 14:56:13 -0800 (PST) Received: from raichu (toroon0560w-lp130-01-174-88-76-226.dsl.bell.ca. [174.88.76.226]) by smtp.gmail.com with ESMTPSA id j19sm2759836ioe.15.2018.03.10.14.56.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Mar 2018 14:56:12 -0800 (PST) Sender: Mark Johnston Date: Sat, 10 Mar 2018 17:56:10 -0500 From: Mark Johnston To: David Bright Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r328013 - head/sbin/fsck_ffs Message-ID: <20180310225610.GD73335@raichu> References: <201801151925.w0FJPCKA019434@repo.freebsd.org> <20180309220940.GG6174@raichu> <1520634689.84937.74.camel@freebsd.org> <20180310161701.GA73335@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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 Mar 2018 22:56:15 -0000 On Sat, Mar 10, 2018 at 05:01:40PM -0500, David Bright wrote: > With regard to the fsck_ffs behavior being a regression because formerly the FS would be mounted successfully: > > That was not my experience. What I observed was that the “fsck -y” would give the “please re-run” message, exit with 0 status so the boot would continue, the subsequent mount would fail because the filesystem was not clean, and *then* the boot would stop and drop to single user. I think my problem is specific to SU without journaling. The UFS code allows one to mount an unclean filesystem in that configuration since SU guarantees that on-disk metadata is consistent. A background fsck takes care of leaked inodes and data blocks. (FWIW, I'm not using journaling only because makefs(8) doesn't support the creation of SU+J filesystems.) /dev/gpt/rootfs: FREE BLK COUNT(S) WRONG IN SUPERBLK (SALVAGED) /dev/gpt/rootfs: SUMMARY INFORMATION BAD (SALVAGED) /dev/gpt/rootfs: BLK(S) MISSING IN BIT MAPS (SALVAGED) /dev/gpt/rootfs: 32664 files, 495447 used, 813272 free (176 frags, 203274 blocks, 0.0% fragmentation) ***** PLEASE RERUN FSCK ***** WARNING: /: reload pending error: blocks 192 files 3 Unknown error 16; help! ERROR: ABORTING BOOT (sending SIGTERM to parent)! Mar 10 12:47:50 init: /bin/sh on /etc/rc terminated abnormally, going to single user mode Enter full pathname of shell or RETURN for /bin/sh: # mount /dev/gpt/rootfs on / (ufs, local, read-only) devfs on /dev (devfs, local, multilabel) # mount -u -o rw / WARNING: / was not properly dismounted # echo $? 0 # mount /dev/gpt/rootfs on / (ufs, local, soft-updates) devfs on /dev (devfs, local, multilabel) From owner-svn-src-head@freebsd.org Sat Mar 10 23:16: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 37E6EF3E8A2; Sat, 10 Mar 2018 23:16:26 +0000 (UTC) (envelope-from avos@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 D8A7D6AD1E; Sat, 10 Mar 2018 23:16:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D39AA14616; Sat, 10 Mar 2018 23:16:25 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2ANGPoU033336; Sat, 10 Mar 2018 23:16:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2ANGOLV033320; Sat, 10 Mar 2018 23:16:24 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803102316.w2ANGOLV033320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 10 Mar 2018 23:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330749 - in head/sys: dev/usb/wlan modules/usb/rum modules/usb/run modules/usb/uath modules/usb/upgt modules/usb/ural modules/usb/urtw modules/usb/zyd X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: dev/usb/wlan modules/usb/rum modules/usb/run modules/usb/uath modules/usb/upgt modules/usb/ural modules/usb/urtw modules/usb/zyd X-SVN-Commit-Revision: 330749 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 23:16:26 -0000 Author: avos Date: Sat Mar 10 23:16:24 2018 New Revision: 330749 URL: https://svnweb.freebsd.org/changeset/base/330749 Log: usb/wlan/*: properly include "opt_wlan.h" into all drivers Without it driver cannot be loaded when wlan(4) module is built with 'options IEEE80211_DEBUG_REFCNT'. Modified: head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c head/sys/modules/usb/rum/Makefile head/sys/modules/usb/run/Makefile head/sys/modules/usb/uath/Makefile head/sys/modules/usb/upgt/Makefile head/sys/modules/usb/ural/Makefile head/sys/modules/usb/urtw/Makefile head/sys/modules/usb/zyd/Makefile Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/dev/usb/wlan/if_rum.c Sat Mar 10 23:16:24 2018 (r330749) @@ -27,6 +27,8 @@ __FBSDID("$FreeBSD$"); * http://www.ralinktech.com.tw/ */ +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/dev/usb/wlan/if_run.c Sat Mar 10 23:16:24 2018 (r330749) @@ -25,6 +25,8 @@ __FBSDID("$FreeBSD$"); * http://www.ralinktech.com/ */ +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/dev/usb/wlan/if_uath.c Sat Mar 10 23:16:24 2018 (r330749) @@ -67,6 +67,9 @@ __FBSDID("$FreeBSD$"); * for these devices does not work in this way and so does not work * with this driver. */ + +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/dev/usb/wlan/if_upgt.c Sat Mar 10 23:16:24 2018 (r330749) @@ -17,6 +17,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/dev/usb/wlan/if_ural.c Sat Mar 10 23:16:24 2018 (r330749) @@ -28,6 +28,8 @@ __FBSDID("$FreeBSD$"); * http://www.ralinktech.com/ */ +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/dev/usb/wlan/if_urtw.c Sat Mar 10 23:16:24 2018 (r330749) @@ -16,6 +16,9 @@ #include __FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + #include #include #include Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/dev/usb/wlan/if_zyd.c Sat Mar 10 23:16:24 2018 (r330749) @@ -26,6 +26,8 @@ __FBSDID("$FreeBSD$"); * ZyDAS ZD1211/ZD1211B USB WLAN driver. */ +#include "opt_wlan.h" + #include #include #include Modified: head/sys/modules/usb/rum/Makefile ============================================================================== --- head/sys/modules/usb/rum/Makefile Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/modules/usb/rum/Makefile Sat Mar 10 23:16:24 2018 (r330749) @@ -30,7 +30,7 @@ S= ${SRCTOP}/sys .PATH: $S/dev/usb/wlan KMOD= if_rum -SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ - if_rum.c +SRCS= opt_bus.h opt_usb.h opt_wlan.h device_if.h bus_if.h usb_if.h \ + usbdevs.h if_rum.c .include Modified: head/sys/modules/usb/run/Makefile ============================================================================== --- head/sys/modules/usb/run/Makefile Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/modules/usb/run/Makefile Sat Mar 10 23:16:24 2018 (r330749) @@ -30,7 +30,7 @@ S= ${SRCTOP}/sys .PATH: $S/dev/usb/wlan KMOD= if_run -SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ - if_run.c +SRCS= opt_bus.h opt_usb.h opt_wlan.h device_if.h bus_if.h usb_if.h \ + usbdevs.h if_run.c .include Modified: head/sys/modules/usb/uath/Makefile ============================================================================== --- head/sys/modules/usb/uath/Makefile Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/modules/usb/uath/Makefile Sat Mar 10 23:16:24 2018 (r330749) @@ -5,6 +5,6 @@ KMOD = if_uath SRCS = if_uath.c if_uathvar.h if_uathreg.h \ bus_if.h device_if.h \ - opt_bus.h opt_usb.h usb_if.h usbdevs.h + opt_bus.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h .include Modified: head/sys/modules/usb/upgt/Makefile ============================================================================== --- head/sys/modules/usb/upgt/Makefile Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/modules/usb/upgt/Makefile Sat Mar 10 23:16:24 2018 (r330749) @@ -5,6 +5,6 @@ KMOD = if_upgt SRCS = if_upgt.c if_upgtvar.h \ bus_if.h device_if.h \ - opt_bus.h opt_usb.h usb_if.h usbdevs.h + opt_bus.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h .include Modified: head/sys/modules/usb/ural/Makefile ============================================================================== --- head/sys/modules/usb/ural/Makefile Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/modules/usb/ural/Makefile Sat Mar 10 23:16:24 2018 (r330749) @@ -30,7 +30,7 @@ S= ${SRCTOP}/sys .PATH: $S/dev/usb/wlan KMOD= if_ural -SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ - if_ural.c +SRCS= opt_bus.h opt_usb.h opt_wlan.h device_if.h bus_if.h usb_if.h \ + usbdevs.h if_ural.c .include Modified: head/sys/modules/usb/urtw/Makefile ============================================================================== --- head/sys/modules/usb/urtw/Makefile Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/modules/usb/urtw/Makefile Sat Mar 10 23:16:24 2018 (r330749) @@ -5,6 +5,6 @@ KMOD = if_urtw SRCS = if_urtw.c if_urtwreg.h if_urtwvar.h \ bus_if.h device_if.h \ - opt_bus.h opt_usb.h usb_if.h usbdevs.h + opt_bus.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h .include Modified: head/sys/modules/usb/zyd/Makefile ============================================================================== --- head/sys/modules/usb/zyd/Makefile Sat Mar 10 23:04:03 2018 (r330748) +++ head/sys/modules/usb/zyd/Makefile Sat Mar 10 23:16:24 2018 (r330749) @@ -30,7 +30,7 @@ S= ${SRCTOP}/sys .PATH: $S/dev/usb/wlan KMOD= if_zyd -SRCS= opt_bus.h opt_usb.h device_if.h bus_if.h usb_if.h usbdevs.h \ - if_zyd.c if_zydreg.h if_zydfw.h +SRCS= opt_bus.h opt_usb.h opt_wlan.h device_if.h bus_if.h usb_if.h \ + usbdevs.h if_zyd.c if_zydreg.h if_zydfw.h .include From owner-svn-src-head@freebsd.org Sat Mar 10 23:47: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 A4584F41458; Sat, 10 Mar 2018 23:47:04 +0000 (UTC) (envelope-from avos@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 5726C6C34C; Sat, 10 Mar 2018 23:47:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 521C514B0B; Sat, 10 Mar 2018 23:47:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2ANl4PR048292; Sat, 10 Mar 2018 23:47:04 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2ANl45n048290; Sat, 10 Mar 2018 23:47:04 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201803102347.w2ANl45n048290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 10 Mar 2018 23:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330750 - in head/sys/dev/rtwn: rtl8188e rtl8192c X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8188e rtl8192c X-SVN-Commit-Revision: 330750 X-SVN-Commit-Repository: base MIME-Version: 1.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 Mar 2018 23:47:04 -0000 Author: avos Date: Sat Mar 10 23:47:03 2018 New Revision: 330750 URL: https://svnweb.freebsd.org/changeset/base/330750 Log: rtwn(4): reset Tx power values before calling get_txpower() for RTL8192C / RTL8188E (like it is done for other chipsets). Modified: head/sys/dev/rtwn/rtl8188e/r88e_chan.c head/sys/dev/rtwn/rtl8192c/r92c_chan.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_chan.c Sat Mar 10 23:16:24 2018 (r330749) +++ head/sys/dev/rtwn/rtl8188e/r88e_chan.c Sat Mar 10 23:47:03 2018 (r330750) @@ -104,8 +104,6 @@ r88e_get_txpower(struct rtwn_softc *sc, int chain, max_mcs = RTWN_RIDX_HT_MCS(sc->ntxchains * 8 - 1); KASSERT(max_mcs <= RTWN_RIDX_COUNT, ("increase ridx limit\n")); - memset(power, 0, max_mcs * sizeof(power[0])); - /* Compute per-CCK rate Tx power. */ cckpow = rt->cck_tx_pwr[group]; for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) { Modified: head/sys/dev/rtwn/rtl8192c/r92c_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_chan.c Sat Mar 10 23:16:24 2018 (r330749) +++ head/sys/dev/rtwn/rtl8192c/r92c_chan.c Sat Mar 10 23:47:03 2018 (r330750) @@ -102,7 +102,6 @@ r92c_get_txpower(struct rtwn_softc *sc, int chain, max_mcs = RTWN_RIDX_HT_MCS(sc->ntxchains * 8 - 1); KASSERT(max_mcs <= RTWN_RIDX_COUNT, ("increase ridx limit\n")); - memset(power, 0, max_mcs * sizeof(power[0])); if (rs->regulatory == 0) { for (ridx = RTWN_RIDX_CCK1; ridx <= RTWN_RIDX_CCK11; ridx++) power[ridx] = base[chain].pwr[0][ridx]; @@ -225,6 +224,7 @@ r92c_set_txpower(struct rtwn_softc *sc, struct ieee802 int i; for (i = 0; i < sc->ntxchains; i++) { + memset(power, 0, sizeof(power)); /* Compute per-rate Tx power values. */ rtwn_r92c_get_txpower(sc, i, c, power); #ifdef RTWN_DEBUG