From owner-svn-src-head@freebsd.org Sun Oct 8 05:18:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BBD4E27398; Sun, 8 Oct 2017 05:18:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x230.google.com (mail-pf0-x230.google.com [IPv6:2607:f8b0:400e:c00::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 7C94782FFD; Sun, 8 Oct 2017 05:18:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x230.google.com with SMTP id m63so11285142pfk.7; Sat, 07 Oct 2017 22:18:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Y5Q7Do7NLrSLRXOeBPoMMghC8nxIRsxnHBCkrbp+Zak=; b=fdRNOdtX+G5sDuxZbPnf1qB+nnEw/rNq266aTH3UUEuqcat5Fb1L6xIsYM4FuaQhpX JGGzpyejvgxBuP4Lu8ufrG6DABUFdEZXnP4iqJkRklgeCV4gcoNcrTU/eN0NTnNcHS8c bE1yZsp6vK/Lxoahiw4V+y6Za/OZMGClYGyrv08busOGJtYt9FMlYqj8aybk2R5kJ6+R j9L3biAuCLT61d2xnGDlJavDrjNOox8BKSZSRYeEU8r4H4iAkokqq7czLiQjp8aXG0if QmnOhZ1fcqOeTzvHcTamT1Hy+PfAEGmlkvLpOyb4qVSWznJyiIB+fEou1OHwy79y6J8E TkIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Y5Q7Do7NLrSLRXOeBPoMMghC8nxIRsxnHBCkrbp+Zak=; b=VREhClHZaQ/WZf83rcUlhmxFx4TR97smpu14J6OAlkfivd1m0RR+xpEdHtWeioE2Bg +ILcY7A+eNKuCAk8OcTuJMvPqmlyEXMai9FEUusqZWks4vow/ksmhnPuh3qoxwXd1Idl S2/+h24bKLtuQrMnHc0sNd/tmrRjx6ym45+gLpLC4r+kBdX6Tdr4NfVpcc+T47tyz7fB jEDFduZ0reZ53KJbGaZ+ng2aIzCvco2eYJJdeSOhCxgGFLRZx1agjI/8Px5lYv3JpDVP TBAXA8nYl1woXX/hrLRLgNFWv99ad2u5zyQGfETJgSxFjVdljbDF8EUpDTL9yH6jn134 HTeQ== X-Gm-Message-State: AMCzsaW+JX/JbfpWgP0LVIaCGLuOOx74erB7k1fhkg9JjIESlRFZ/FrH cigmQmIISgWkZh3Ir+ToGkudlaJo X-Google-Smtp-Source: AOwi7QDLUhpvZr7gPLfPa4IIa4YkJ5XfzO/Ci0VV+6kxeRuWAFRGPkiv7KP/WfI63/CUkt19+XpR8A== X-Received: by 10.99.95.145 with SMTP id t139mr6325349pgb.344.1507439922406; Sat, 07 Oct 2017 22:18:42 -0700 (PDT) Received: from ?IPv6:2607:fb90:8120:cf90:2069:3ba:b5d:6cb7? ([2607:fb90:8120:cf90:2069:3ba:b5d:6cb7]) by smtp.gmail.com with ESMTPSA id q13sm927723pfi.166.2017.10.07.22.18.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Oct 2017 22:18:41 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r324406 - head/sys/modules/em From: Ngie Cooper X-Mailer: iPhone Mail (15A421) In-Reply-To: <201710072333.v97NXE6E044433@repo.freebsd.org> Date: Sat, 7 Oct 2017 22:18:40 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> References: <201710072333.v97NXE6E044433@repo.freebsd.org> To: Sean Bruno X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 08 Oct 2017 05:18:44 -0000 > On Oct 7, 2017, at 16:33, Sean Bruno wrote: >=20 > Author: sbruno > Date: Sat Oct 7 23:33:14 2017 > New Revision: 324406 > URL: https://svnweb.freebsd.org/changeset/base/324406 >=20 > Log: > Fix symlink if_igb.ko in -current such that its relative and doesn't > end up with non-standard DESTDIR information in its symlink. This > can happen very trivially if the release scripts are used. >=20 > Sponsored by: Limelight Networks >=20 > Modified: > head/sys/modules/em/Makefile >=20 > Modified: head/sys/modules/em/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sys/modules/em/Makefile Sat Oct 7 23:30:57 2017 (r324405) > +++ head/sys/modules/em/Makefile Sat Oct 7 23:33:14 2017 (r324406) > @@ -23,6 +23,6 @@ CFLAGS +=3D -I${SRCTOP}/sys/dev/e1000 > #CFLAGS +=3D -DDEVICE_POLLING >=20 > afterinstall: > - ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko ${DESTDIR}${KMODDIR}/if_igb.ko= > + cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko While this is definitely better, the same thing could be achieved via: ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko= From owner-svn-src-head@freebsd.org Sun Oct 8 08:33:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52993E2DDED; Sun, 8 Oct 2017 08:33:14 +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 4E6A167B2F; Sun, 8 Oct 2017 08:33:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v988X7uS019017 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 8 Oct 2017 11:33:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v988X7uS019017 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v988X7Ux019015; Sun, 8 Oct 2017 11:33:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 8 Oct 2017 11:33:07 +0300 From: Konstantin Belousov To: Don Lewis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324313 - head/sys/amd64/amd64 Message-ID: <20171008083307.GG95911@kib.kiev.ua> References: <20171007201142.GE95911@kib.kiev.ua> <201710072054.v97Ks5nX062548@gw.catspoiler.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710072054.v97Ks5nX062548@gw.catspoiler.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 08:33:14 -0000 On Sat, Oct 07, 2017 at 01:54:05PM -0700, Don Lewis wrote: > On 7 Oct, Konstantin Belousov wrote: > > On Sat, Oct 07, 2017 at 01:04:09PM -0700, Don Lewis wrote: > >> On 5 Oct, Konstantin Belousov wrote: > >> > Author: kib > >> > Date: Thu Oct 5 12:50:03 2017 > >> > New Revision: 324313 > >> > URL: https://svnweb.freebsd.org/changeset/base/324313 > >> > > >> > Log: > >> > Avoid a race betweem freeing LDT and context switches. > >> > > >> > cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating > >> > presence of the process LDT. The flag is checked and then ldt segment > >> > descriptor is copied into the CPU' GDT slot. > >> > > >> > Disallow context switches around clearing of the curproc LDT state by > >> > performing the cleanup in critical section. Ensure that the md_ldt > >> > flag is cleared before md_ldt_sd descriptor content is destroyed by > >> > inserting fence between the operations. > >> > > >> > We depend on the x86 memory model strong ordering guarantees, in > >> > particular, that cpu_switch.S observes the writes to md_ldt and > >> > md_ldt_sd in the expected order. > >> > >> I don't know which of this series of commits is responsible, but I think > >> that it fixed the build of lang/ghc on Ryzen. > >> > >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221029#c102 > > > > Does ghc use LDT on amd64 ? This sounds unbelievable. > > I have no idea, but ghc would reliably fail to build on my Ryzen machine > up through r323398, and at r324367 it seems to reliably build. Could you try to bisect ? I reviewed all kernel changes and do not see anything which could be marked as possible fix for whatever kernel issue causing usermode fault. From owner-svn-src-head@freebsd.org Sun Oct 8 15:42:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0896AE38BDB; Sun, 8 Oct 2017 15:42:46 +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 A10F264A46; Sun, 8 Oct 2017 15:42:45 +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 v98FgZ1c074040; Sun, 8 Oct 2017 08:42:35 -0700 (PDT) (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 v98FgZ5f074039; Sun, 8 Oct 2017 08:42:35 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r324406 - head/sys/modules/em In-Reply-To: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> To: Ngie Cooper Date: Sun, 8 Oct 2017 08:42:35 -0700 (PDT) CC: Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 15:42:46 -0000 > > > On Oct 7, 2017, at 16:33, Sean Bruno wrote: > > > > Author: sbruno > > Date: Sat Oct 7 23:33:14 2017 > > New Revision: 324406 > > URL: https://svnweb.freebsd.org/changeset/base/324406 > > > > Log: > > Fix symlink if_igb.ko in -current such that its relative and doesn't > > end up with non-standard DESTDIR information in its symlink. This > > can happen very trivially if the release scripts are used. > > > > Sponsored by: Limelight Networks > > > > Modified: > > head/sys/modules/em/Makefile > > > > Modified: head/sys/modules/em/Makefile > > ============================================================================== > > --- head/sys/modules/em/Makefile Sat Oct 7 23:30:57 2017 (r324405) > > +++ head/sys/modules/em/Makefile Sat Oct 7 23:33:14 2017 (r324406) > > @@ -23,6 +23,6 @@ CFLAGS += -I${SRCTOP}/sys/dev/e1000 > > #CFLAGS += -DDEVICE_POLLING > > > > afterinstall: > > - ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko ${DESTDIR}${KMODDIR}/if_igb.ko > > + cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko > > While this is definitely better, the same thing could be achieved via: > > ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko Should this be using SYMLINK+= as I thought using ln -sf was a breakage for meta mode stuff? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Oct 8 16:54:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63898E3A2ED; Sun, 8 Oct 2017 16:54:44 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA07574A96; Sun, 8 Oct 2017 16:54:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98Gsgn9077964; Sun, 8 Oct 2017 16:54:42 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98GsghJ077963; Sun, 8 Oct 2017 16:54:42 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710081654.v98GsghJ077963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 8 Oct 2017 16:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324411 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324411 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 16:54:44 -0000 Author: alc Date: Sun Oct 8 16:54:42 2017 New Revision: 324411 URL: https://svnweb.freebsd.org/changeset/base/324411 Log: Replace an unnecessary call to vm_page_activate() by an assertion that the page is already wired or queued. Prior to the elimination of PG_CACHED pages, vm_page_grab() might have returned a valid, previously PG_CACHED page, in which case enqueueing the page was necessary. Now, that can't happen. Moreover, activating the page is a dubious choice, since the page is not being accessed. Reviewed by: kib MFC after: 1 week Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Sun Oct 8 08:02:26 2017 (r324410) +++ head/sys/vm/swap_pager.c Sun Oct 8 16:54:42 2017 (r324411) @@ -1635,9 +1635,12 @@ swp_pager_force_pagein(vm_object_t object, vm_pindex_t if (m->valid == VM_PAGE_BITS_ALL) { vm_object_pip_wakeup(object); vm_page_dirty(m); +#ifdef INVARIANTS vm_page_lock(m); - vm_page_activate(m); + if (m->wire_count == 0 && m->queue == PQ_NONE) + panic("page %p is neither wired nor queued", m); vm_page_unlock(m); +#endif vm_page_xunbusy(m); vm_pager_page_unswapped(m); return; From owner-svn-src-head@freebsd.org Sun Oct 8 17:21:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03E0EE3B05D; Sun, 8 Oct 2017 17:21:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B44C37E950; Sun, 8 Oct 2017 17:21:17 +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 v98HLGCI086892; Sun, 8 Oct 2017 17:21:16 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98HLGlT086889; Sun, 8 Oct 2017 17:21:16 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710081721.v98HLGlT086889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Oct 2017 17:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324413 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 324413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 17:21:18 -0000 Author: ian Date: Sun Oct 8 17:21:16 2017 New Revision: 324413 URL: https://svnweb.freebsd.org/changeset/base/324413 Log: Restore the ability to deregister an eventhandler from within the callback. When the EVENTHANDLER(9) subsystem was created, it was a documented feature that an eventhandler callback function could safely deregister itself. In r200652 that feature was inadvertantly broken by adding drain-wait logic to eventhandler_deregister(), so that it would be safe to unload a module upon return from deregistering its event handlers. There are now 145 callers of EVENTHANDLER_DEREGISTER(), and it's likely many of them are depending on the drain-wait logic that has been in place for 8 years. So instead of creating a separate eventhandler_drain() and adding it to some or all of those 145 call sites, this creates a separate eventhandler_drain_nowait() function for the specific purpose of deregistering a callback from within the running callback. Differential Revision: https://reviews.freebsd.org/D12561 Modified: head/share/man/man9/EVENTHANDLER.9 head/sys/kern/subr_eventhandler.c head/sys/sys/eventhandler.h Modified: head/share/man/man9/EVENTHANDLER.9 ============================================================================== --- head/share/man/man9/EVENTHANDLER.9 Sun Oct 8 17:14:45 2017 (r324412) +++ head/share/man/man9/EVENTHANDLER.9 Sun Oct 8 17:21:16 2017 (r324413) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd March 27, 2017 +.Dd October 1, 2017 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -37,6 +37,7 @@ .Ft eventhandler_tag .Fn EVENTHANDLER_REGISTER name func arg priority .Fn EVENTHANDLER_DEREGISTER name tag +.Fn EVENTHANDLER_DEREGISTER_NOWAIT name tag .Ft eventhandler_tag .Fo eventhandler_register .Fa "struct eventhandler_list *list" @@ -50,6 +51,11 @@ .Fa "struct eventhandler_list *list" .Fa "eventhandler_tag tag" .Fc +.Ft void +.Fo eventhandler_deregister_nowait +.Fa "struct eventhandler_list *list" +.Fa "eventhandler_tag tag" +.Fc .Ft "struct eventhandler_list *" .Fn eventhandler_find_list "const char *name" .Ft void @@ -121,6 +127,18 @@ This macro removes a previously registered callback as .Fa tag from the event handler named by argument .Fa name . +It waits until no threads are running handlers for this event before +returning, making it safe to unload a module immediately upon return +from this function. +.It Fn EVENTHANDLER_DEREGISTER_NOWAIT +This macro removes a previously registered callback associated with tag +.Fa tag +from the event handler named by argument +.Fa name . +Upon return, one or more threads could still be running the removed +function(s), but no new calls will be made. +To remove a handler function from within that function, use this +version of deregister, to avoid a deadlock. .It Fn EVENTHANDLER_INVOKE This macro is used to invoke all the callbacks associated with event handler @@ -176,6 +194,21 @@ that can later be used with .Fn eventhandler_deregister to remove the particular callback function. .It Fn eventhandler_deregister +The +.Fn eventhandler_deregister +function removes the callback associated with tag +.Fa tag +from the event handler list pointed to by +.Fa list . +If +.Fa tag +is +.Va NULL , +all callback functions for the event are removed. +This function will not return until all threads have exited from the +removed handler callback function(s). +This function is not safe to call from inside an event handler callback. +.It Fn eventhandler_deregister_nowait The .Fn eventhandler_deregister function removes the callback associated with tag Modified: head/sys/kern/subr_eventhandler.c ============================================================================== --- head/sys/kern/subr_eventhandler.c Sun Oct 8 17:14:45 2017 (r324412) +++ head/sys/kern/subr_eventhandler.c Sun Oct 8 17:21:16 2017 (r324413) @@ -180,8 +180,9 @@ vimage_eventhandler_register(struct eventhandler_list } #endif -void -eventhandler_deregister(struct eventhandler_list *list, eventhandler_tag tag) +static void +_eventhandler_deregister(struct eventhandler_list *list, eventhandler_tag tag, + bool wait) { struct eventhandler_entry *ep = tag; @@ -215,9 +216,24 @@ eventhandler_deregister(struct eventhandler_list *list ep->ee_priority = EHE_DEAD_PRIORITY; } } - while (list->el_runcount > 0) + while (wait && list->el_runcount > 0) mtx_sleep(list, &list->el_lock, 0, "evhrm", 0); EHL_UNLOCK(list); +} + +void +eventhandler_deregister(struct eventhandler_list *list, eventhandler_tag tag) +{ + + _eventhandler_deregister(list, tag, true); +} + +void +eventhandler_deregister_nowait(struct eventhandler_list *list, + eventhandler_tag tag) +{ + + _eventhandler_deregister(list, tag, false); } /* Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Sun Oct 8 17:14:45 2017 (r324412) +++ head/sys/sys/eventhandler.h Sun Oct 8 17:21:16 2017 (r324413) @@ -141,11 +141,20 @@ do { \ if ((_el = eventhandler_find_list(#name)) != NULL) \ eventhandler_deregister(_el, tag); \ } while(0) - +#define EVENTHANDLER_DEREGISTER_NOWAIT(name, tag) \ +do { \ + struct eventhandler_list *_el; \ + \ + if ((_el = eventhandler_find_list(#name)) != NULL) \ + eventhandler_deregister_nowait(_el, tag); \ +} while(0) + eventhandler_tag eventhandler_register(struct eventhandler_list *list, const char *name, void *func, void *arg, int priority); void eventhandler_deregister(struct eventhandler_list *list, + eventhandler_tag tag); +void eventhandler_deregister_nowait(struct eventhandler_list *list, eventhandler_tag tag); struct eventhandler_list *eventhandler_find_list(const char *name); void eventhandler_prune_list(struct eventhandler_list *list); From owner-svn-src-head@freebsd.org Sun Oct 8 17:29:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2767E3B2E3; Sun, 8 Oct 2017 17:29:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5FA9E8061E; Sun, 8 Oct 2017 17:29:44 +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 v98HTh5w090883; Sun, 8 Oct 2017 17:29:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98HThrx090882; Sun, 8 Oct 2017 17:29:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710081729.v98HThrx090882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 8 Oct 2017 17:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324414 - head/lib/libcapsicum X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/lib/libcapsicum X-SVN-Commit-Revision: 324414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 17:29:45 -0000 Author: trasz Date: Sun Oct 8 17:29:43 2017 New Revision: 324414 URL: https://svnweb.freebsd.org/changeset/base/324414 Log: capsicum_helpers: Add EVENT to default stdio rights set Without it, calling caph_limit_stdio(3) breaks Irssi. Reviewed by: oshogbo MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12622 Modified: head/lib/libcapsicum/capsicum_helpers.h Modified: head/lib/libcapsicum/capsicum_helpers.h ============================================================================== --- head/lib/libcapsicum/capsicum_helpers.h Sun Oct 8 17:21:16 2017 (r324413) +++ head/lib/libcapsicum/capsicum_helpers.h Sun Oct 8 17:29:43 2017 (r324414) @@ -50,7 +50,8 @@ caph_limit_stream(int fd, int flags) cap_rights_t rights; unsigned long cmds[] = { TIOCGETA, TIOCGWINSZ, FIODTYPE }; - cap_rights_init(&rights, CAP_FCNTL, CAP_FSTAT, CAP_IOCTL, CAP_SEEK); + cap_rights_init(&rights, CAP_EVENT, CAP_FCNTL, CAP_FSTAT, + CAP_IOCTL, CAP_SEEK); if ((flags & CAPH_READ) != 0) cap_rights_set(&rights, CAP_READ); From owner-svn-src-head@freebsd.org Sun Oct 8 17:33:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECF71E3B53B; Sun, 8 Oct 2017 17:33:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FBD2815F1; Sun, 8 Oct 2017 17:33:50 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98HXnCQ094647; Sun, 8 Oct 2017 17:33:49 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98HXnu1094645; Sun, 8 Oct 2017 17:33:49 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710081733.v98HXnu1094645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Oct 2017 17:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324415 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324415 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 17:33:51 -0000 Author: ian Date: Sun Oct 8 17:33:49 2017 New Revision: 324415 URL: https://svnweb.freebsd.org/changeset/base/324415 Log: Add eventhandler notifications for newbus device attach/detach. The detach case is slightly complicated by the fact that some in-kernel consumers may want to know before a device detaches (so they can release related resources, stop using the device, etc), but the detach can fail. So there are pre- and post-detach notifications for those consumers who need to handle all cases. A couple salient comments from the review, they amount to some helpful documentation about these events, but there's currently no good place for such documentation... Note that in the current newbus locking model, DETACH_BEGIN and DETACH_COMPLETE/FAILED sequence of event handler invocation might interweave with other attach/detach events arbitrarily. The handlers should be prepared for such situations. Also should note that detach may be called after the parent bus knows the hardware has left the building. In-kernel consumers have to be prepared to cope with this race. Differential Revision: https://reviews.freebsd.org/D12557 Modified: head/sys/kern/subr_bus.c head/sys/sys/eventhandler.h Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Sun Oct 8 17:29:43 2017 (r324414) +++ head/sys/kern/subr_bus.c Sun Oct 8 17:33:49 2017 (r324415) @@ -2936,6 +2936,7 @@ device_attach(device_t dev) else dev->state = DS_ATTACHED; dev->flags &= ~DF_DONENOMATCH; + EVENTHANDLER_INVOKE(device_attach, dev); devadded(dev); return (0); } @@ -2969,8 +2970,13 @@ device_detach(device_t dev) if (dev->state != DS_ATTACHED) return (0); - if ((error = DEVICE_DETACH(dev)) != 0) + EVENTHANDLER_INVOKE(device_detach, dev, EVHDEV_DETACH_BEGIN); + if ((error = DEVICE_DETACH(dev)) != 0) { + EVENTHANDLER_INVOKE(device_detach, dev, EVHDEV_DETACH_FAILED); return (error); + } else { + EVENTHANDLER_INVOKE(device_detach, dev, EVHDEV_DETACH_COMPLETE); + } devremoved(dev); if (!device_is_quiet(dev)) device_printf(dev, "detached\n"); Modified: head/sys/sys/eventhandler.h ============================================================================== --- head/sys/sys/eventhandler.h Sun Oct 8 17:29:43 2017 (r324414) +++ head/sys/sys/eventhandler.h Sun Oct 8 17:33:49 2017 (r324415) @@ -293,4 +293,15 @@ typedef void (*swapoff_fn)(void *, struct swdevt *); EVENTHANDLER_DECLARE(swapon, swapon_fn); EVENTHANDLER_DECLARE(swapoff, swapoff_fn); +/* newbus device events */ +enum evhdev_detach { + EVHDEV_DETACH_BEGIN, /* Before detach() is called */ + EVHDEV_DETACH_COMPLETE, /* After detach() returns 0 */ + EVHDEV_DETACH_FAILED /* After detach() returns err */ +}; +typedef void (*device_attach_fn)(void *, device_t); +typedef void (*device_detach_fn)(void *, device_t, enum evhdev_detach); +EVENTHANDLER_DECLARE(device_attach, device_attach_fn); +EVENTHANDLER_DECLARE(device_detach, device_detach_fn); + #endif /* _SYS_EVENTHANDLER_H_ */ From owner-svn-src-head@freebsd.org Sun Oct 8 17:56:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D587E3BDD2 for ; Sun, 8 Oct 2017 17:56:44 +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 E45A52DA6 for ; Sun, 8 Oct 2017 17:56:43 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0518bb5d-ac52-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 0518bb5d-ac52-11e7-a893-25625093991c; Sun, 08 Oct 2017 17:56:34 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v98HuUXN001560; Sun, 8 Oct 2017 11:56:30 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507485390.86205.323.camel@freebsd.org> Subject: Re: svn commit: r324415 - in head/sys: kern sys From: Ian Lepore To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 08 Oct 2017 11:56:30 -0600 In-Reply-To: <201710081733.v98HXnu1094645@repo.freebsd.org> References: <201710081733.v98HXnu1094645@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.23 Precedence: list List-Id: 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, 08 Oct 2017 17:56:44 -0000 On Sun, 2017-10-08 at 17:33 +0000, Ian Lepore wrote: > Author: ian > Date: Sun Oct  8 17:33:49 2017 > New Revision: 324415 > URL: https://svnweb.freebsd.org/changeset/base/324415 > > Log: >   Add eventhandler notifications for newbus device attach/detach. >    > [...] >    >   A couple salient comments from the review, they amount to some helpful >   documentation about these events, but there's currently no good place for >   such documentation... About this last point... sys/eventhandler.h is now an ever-growing list of EVENTHANDLER_DECLARE() statements for events that are unrelated to each other.  I think we are at the point where it's no longer a few well-known "standard system event queues", it's turning into a mess. My first thought was to add these to bus.h because they're bus events.  But you have to include eventhandler.h to use EVENTHANDLER_DECLARE, and I didn't want to pull it (and its dependencies) into bus.h. Now I'm thinking maybe we need a handful of separate header files, like bus_events.h, proc_events.h, thread_events.h, etc.  Maybe we could have a kern_events.h as a catch-all for a few misc ones like low-memory, root-mounted, etc.  Having a few subsystem-focused header files would provide a good place to put some comment blocks describing quirks and other nice-to-know information about using/handling the events. Or we could go with full-on manpages for describing each event, or each group of related events.  In that case we'd need some sort of naming convention that makes it easy to find the page for the events you care about.  My gut tells me comment blocks at the point of the DECLARE statements are more likely to get written than manpages. Thoughts? -- Ian From owner-svn-src-head@freebsd.org Sun Oct 8 18:38:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAC51E3CBAD; Sun, 8 Oct 2017 18:38:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76C2F6B8A6; Sun, 8 Oct 2017 18:38: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 v98IcMfU019623; Sun, 8 Oct 2017 18:38:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98IcMlY019622; Sun, 8 Oct 2017 18:38:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201710081838.v98IcMlY019622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 8 Oct 2017 18:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324416 - 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: 324416 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 18:38:24 -0000 Author: ian Date: Sun Oct 8 18:38:22 2017 New Revision: 324416 URL: https://svnweb.freebsd.org/changeset/base/324416 Log: Fix imx6 hdmi init after r323553, which used a config_intrhook to defer the attachment of i2c devices needed by hdmi. The hdmi init also uses an intrhook callback to defer initialization, and if the hdmi callback runs first, the i2c devices will not yet have registered their device_t in association with their FDT phandle, which allows cross- device references on FDT systems. Now the hdmi deferred init checks for the i2c device registration, and if it's not complete yet, it registers as an eventhandler watching for newbus attach events. When the i2c device eventually attaches, the hdmi driver unregisters from watching further events, and continues with the hdmi init. Because the function signatures for an intrhook callback and an event handler callback are the same, a single function is used for both callbacks. Reported by: Russell Haley Modified: head/sys/arm/freescale/imx/imx6_hdmi.c Modified: head/sys/arm/freescale/imx/imx6_hdmi.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_hdmi.c Sun Oct 8 17:33:49 2017 (r324415) +++ head/sys/arm/freescale/imx/imx6_hdmi.c Sun Oct 8 18:38:22 2017 (r324416) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -57,6 +58,7 @@ __FBSDID("$FreeBSD$"); struct imx_hdmi_softc { struct dwc_hdmi_softc base; phandle_t i2c_xref; + eventhandler_tag eh_tag; }; static struct ofw_compat_data compat_data[] = { @@ -78,6 +80,48 @@ imx_hdmi_get_i2c_dev(device_t dev) return (OF_device_from_xref(sc->i2c_xref)); } +/* + * Deferred HDMI init. dwc_hdmi_init() does i2c transfers for DDC/EDID. The imx + * i2c devices also use a config_intrhook function to finish their init, because + * they require interrupts to perform transfers. There is no way to control + * whether the i2c or our hdmi intrhook function runs first. If we go first we + * have to continue waiting until after the i2c driver is ready to do transfers + * and has registered its phandle. + * + * This function is used as both a config_intrhook function and after that as an + * eventhandler callback function (if necessary), to see if our i2c device is + * ready yet. When it is, continue with hdmi init. When first called as an + * intrhook function the i2c devices might be ready, in which case we never + * register as an eventhandler at all. Otherwise we register to see newbus + * attach events, and as each device attaches we check to see whether it was the + * i2c device we care about. Once we have our i2c device we unregister from + * seeing further attach events. + */ +static void +imx_hdmi_init(void *dev) +{ + struct imx_hdmi_softc *sc; + + sc = device_get_softc((device_t)dev); + + if (OF_device_from_xref(sc->i2c_xref) != NULL) { + if (sc->eh_tag != NULL) { + EVENTHANDLER_DEREGISTER_NOWAIT(device_attach, + sc->eh_tag); + } + dwc_hdmi_init(dev); + return; + } + + if (bootverbose) + device_printf((device_t)dev, "Waiting for DDC i2c device\n"); + + if (sc->eh_tag == NULL) { + sc->eh_tag = EVENTHANDLER_REGISTER(device_attach, + imx_hdmi_init, dev, EVENTHANDLER_PRI_ANY); + } +} + static int imx_hdmi_detach(device_t dev) { @@ -128,7 +172,9 @@ imx_hdmi_attach(device_t dev) gpr3 |= IOMUXC_GPR3_HDMI_IPU1_DI0; imx_iomux_gpr_set(IOMUXC_GPR3, gpr3); - return (dwc_hdmi_init(dev)); + /* Further HDMI init requires interrupts for i2c transfers. */ + config_intrhook_oneshot(imx_hdmi_init, dev); + return (0); out: imx_hdmi_detach(dev); From owner-svn-src-head@freebsd.org Sun Oct 8 22:17:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28EB1E41430; Sun, 8 Oct 2017 22:17:41 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C7F217F0D7; Sun, 8 Oct 2017 22:17:40 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v98MHd61012274; Sun, 8 Oct 2017 22:17:39 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v98MHdNI012272; Sun, 8 Oct 2017 22:17:39 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710082217.v98MHdNI012272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 8 Oct 2017 22:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324420 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324420 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Oct 2017 22:17:41 -0000 Author: alc Date: Sun Oct 8 22:17:39 2017 New Revision: 324420 URL: https://svnweb.freebsd.org/changeset/base/324420 Log: The blst_radix_init function has two purposes - to compute the number of nodes to allocate for the blist, and to initialize them. The computation can be done much more quickly by identifying the terminating node, if any, at every level of the tree and then summing the number of nodes at each level that precedes the topmost terminator. The initialization can also be done quickly, since settings at the root mark the tree as all-allocated, and only a few terminator nodes need to be marked in the rest of the tree. Eliminate blst_radix_init, and perform its two functions more simply in blist_create. The allocation of the blist takes places in two pieces, but there's no good reason to do so, when a single allocation is sufficient, and simpler. Allocate the blist struct, and the array of nodes associated with it, with a single allocation. Submitted by: Doug Moore Reviewed by: markj (an earlier version) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11968 Modified: head/sys/kern/subr_blist.c head/sys/sys/blist.h Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Sun Oct 8 21:20:25 2017 (r324419) +++ head/sys/kern/subr_blist.c Sun Oct 8 22:17:39 2017 (r324420) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -137,7 +138,6 @@ static void blst_copy(blmeta_t *scan, daddr_t blk, dad static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, u_daddr_t radix); -static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count); #ifndef _KERNEL static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab); @@ -218,30 +218,69 @@ blist_t blist_create(daddr_t blocks, int flags) { blist_t bl; - daddr_t nodes, radix; + daddr_t i, last_block; + u_daddr_t nodes, radix, skip; + int digit; /* - * Calculate the radix field used for scanning. + * Calculate the radix and node count used for scanning. Find the last + * block that is followed by a terminator. */ + last_block = blocks - 1; radix = BLIST_BMAP_RADIX; while (radix < blocks) { + if (((last_block / radix + 1) & BLIST_META_MASK) != 0) + /* + * A terminator will be added. Update last_block to the + * position just before that terminator. + */ + last_block |= radix - 1; radix *= BLIST_META_RADIX; } - nodes = 1 + blst_radix_init(NULL, radix, blocks); - bl = malloc(sizeof(struct blist), M_SWAP, flags); + /* + * Count the meta-nodes in the expanded tree, including the final + * terminator, from the bottom level up to the root. + */ + nodes = (last_block >= blocks) ? 2 : 1; + last_block /= BLIST_BMAP_RADIX; + while (last_block > 0) { + nodes += last_block + 1; + last_block /= BLIST_META_RADIX; + } + bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags); if (bl == NULL) return (NULL); bl->bl_blocks = blocks; bl->bl_radix = radix; bl->bl_cursor = 0; - bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags); - if (bl->bl_root == NULL) { - free(bl, M_SWAP); - return (NULL); + + /* + * Initialize the empty tree by filling in root values, then initialize + * just the terminators in the rest of the tree. + */ + bl->bl_root[0].bm_bighint = 0; + if (radix == BLIST_BMAP_RADIX) + bl->bl_root[0].u.bmu_bitmap = 0; + else + bl->bl_root[0].u.bmu_avail = 0; + last_block = blocks - 1; + i = 0; + while (radix > BLIST_BMAP_RADIX) { + radix /= BLIST_META_RADIX; + skip = radix_to_skip(radix); + digit = last_block / radix; + i += 1 + digit * skip; + if (digit != BLIST_META_MASK) { + /* + * Add a terminator. + */ + bl->bl_root[i + skip].bm_bighint = (daddr_t)-1; + bl->bl_root[i + skip].u.bmu_bitmap = 0; + } + last_block %= radix; } - blst_radix_init(bl->bl_root, radix, blocks); #if defined(BLIST_DEBUG) printf( @@ -261,7 +300,7 @@ blist_create(daddr_t blocks, int flags) void blist_destroy(blist_t bl) { - free(bl->bl_root, M_SWAP); + free(bl, M_SWAP); } @@ -1070,83 +1109,6 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr } scan->u.bmu_avail -= nblks; return (nblks); -} - -/* - * BLST_RADIX_INIT() - initialize radix tree - * - * Initialize our meta structures and bitmaps and calculate the exact - * amount of space required to manage 'count' blocks - this space may - * be considerably less than the calculated radix due to the large - * RADIX values we use. - */ -static daddr_t -blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count) -{ - daddr_t i, memindex, next_skip, skip; - - memindex = 0; - - /* - * Leaf node - */ - - if (radix == BLIST_BMAP_RADIX) { - if (scan) { - scan->bm_bighint = 0; - scan->u.bmu_bitmap = 0; - } - return (memindex); - } - - /* - * Meta node. If allocating the entire object we can special - * case it. However, we need to figure out how much memory - * is required to manage 'count' blocks, so we continue on anyway. - */ - - if (scan) { - scan->bm_bighint = 0; - scan->u.bmu_avail = 0; - } - - skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; - radix /= BLIST_META_RADIX; - - for (i = 1; i < skip; i += next_skip) { - if (count >= radix) { - /* - * Allocate the entire object - */ - memindex = i + - blst_radix_init(((scan) ? &scan[i] : NULL), radix, - radix); - count -= radix; - } else if (count > 0) { - /* - * Allocate a partial object - */ - memindex = i + - blst_radix_init(((scan) ? &scan[i] : NULL), radix, - count); - count = 0; - } else { - /* - * Add terminator and break out. Make terminator bitmap - * zero to avoid a spanning leaf allocation that - * includes the terminator. - */ - if (scan) { - scan[i].bm_bighint = (daddr_t)-1; - scan[i].u.bmu_bitmap = 0; - } - break; - } - } - if (memindex < i) - memindex = i; - return (memindex); } #ifdef BLIST_DEBUG Modified: head/sys/sys/blist.h ============================================================================== --- head/sys/sys/blist.h Sun Oct 8 21:20:25 2017 (r324419) +++ head/sys/sys/blist.h Sun Oct 8 22:17:39 2017 (r324420) @@ -82,7 +82,7 @@ typedef struct blist { daddr_t bl_blocks; /* area of coverage */ u_daddr_t bl_radix; /* coverage radix */ daddr_t bl_cursor; /* next-fit search starts at */ - blmeta_t *bl_root; /* root of radix tree */ + blmeta_t bl_root[1]; /* root of radix tree */ } *blist_t; #define BLIST_META_RADIX 16 From owner-svn-src-head@freebsd.org Mon Oct 9 04:43:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 356D5E24E32; Mon, 9 Oct 2017 04:43:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B85FF6C6B5; Mon, 9 Oct 2017 04:43:06 +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 v994h5Tp072031; Mon, 9 Oct 2017 04:43:05 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v994h5Jf072030; Mon, 9 Oct 2017 04:43:05 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710090443.v994h5Jf072030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 9 Oct 2017 04:43:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324422 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324422 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 04:43:07 -0000 Author: eadler Date: Mon Oct 9 04:43:05 2017 New Revision: 324422 URL: https://svnweb.freebsd.org/changeset/base/324422 Log: Add macOS 10.13 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Oct 9 01:17:12 2017 (r324421) +++ head/share/misc/bsd-family-tree Mon Oct 9 04:43:05 2017 (r324422) @@ -339,7 +339,7 @@ FreeBSD 5.2 | | | | | | | | DragonFly 4.2.0 | FreeBSD | | | | | 10.2 | | | | - | | OS X NetBSD 7.0 | | + | | macOS NetBSD 7.0 | | | | 10.11 | OpenBSD 5.8 | | | | | | DragonFly 4.4.1 | FreeBSD | | OpenBSD 5.9 | @@ -355,8 +355,8 @@ FreeBSD 5.2 | | | | | | | | OpenBSD 6.1 | | FreeBSD | | | | | | 11.1 FreeBSD | | | | - | | 10.4 | | | | - | v | | | | + | | 10.4 macOS | | | + | v 10.13 | | | | | | | | FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -717,6 +717,7 @@ NetBSD 7.1 2017-03-11 [NBD] DragonFly 4.8.0 2017-03-27 [DFB] OpenBSD 6.1 2017-04-11 [OBD] FreeBSD 11.1 2017-07-26 [FBD] +macOS 10.13 2017-09-25 [APL] FreeBSD 10.4 2017-10-03 [FBD] Bibliography From owner-svn-src-head@freebsd.org Mon Oct 9 05:01:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52640E25250; Mon, 9 Oct 2017 05:01:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDE68708A2; Mon, 9 Oct 2017 05:01:52 +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 v9951q7C079522; Mon, 9 Oct 2017 05:01:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9951qcF079521; Mon, 9 Oct 2017 05:01:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710090501.v9951qcF079521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 9 Oct 2017 05:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324423 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324423 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 05:01:53 -0000 Author: eadler Date: Mon Oct 9 05:01:51 2017 New Revision: 324423 URL: https://svnweb.freebsd.org/changeset/base/324423 Log: Update iso3166 codes Based on https://raw.githubusercontent.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.csv and hand massaged. Modified: head/share/misc/iso3166 Modified: head/share/misc/iso3166 ============================================================================== --- head/share/misc/iso3166 Mon Oct 9 04:43:05 2017 (r324422) +++ head/share/misc/iso3166 Mon Oct 9 05:01:51 2017 (r324423) @@ -21,7 +21,7 @@ # two three number name AF AFG 004 Afghanistan AL ALB 008 Albania -AX ALA 248 Aland Islands +AX ALA 248 Ă…land Islands DZ DZA 012 Algeria AS ASM 016 American Samoa AD AND 020 Andorra @@ -59,7 +59,7 @@ BI BDI 108 Burundi KH KHM 116 Cambodia CM CMR 120 Cameroon CA CAN 124 Canada -CV CPV 132 Cape Verde +CV CPV 132 Cabo Verde KY CYM 136 Cayman Islands CF CAF 140 Central African Republic TD TCD 148 Chad @@ -70,20 +70,19 @@ CC CCK 166 Cocos (Keeling) Islands CO COL 170 Colombia KM COM 174 Comoros CG COG 178 Congo -CD COD 180 Congo, the Democratic Republic of the +CD COD 180 Congo, Democratic Republic of the CK COK 184 Cook Islands CR CRI 188 Costa Rica -CI CIV 384 Cote d'Ivoire +CI CIV 384 CĂ´te d'Ivoire HR HRV 191 Croatia CU CUB 192 Cuba -CW CUW 531 Curacao +CW CUW 531 Curaçao CY CYP 196 Cyprus CZ CZE 203 Czech Republic DK DNK 208 Denmark DJ DJI 262 Djibouti DM DMA 212 Dominica DO DOM 214 Dominican Republic -TL TLS 626 Timor-Leste EC ECU 218 Ecuador EG EGY 818 Egypt SV SLV 222 El Salvador @@ -117,13 +116,14 @@ GW GNB 624 Guinea-Bissau GY GUY 328 Guyana HT HTI 332 Haiti HM HMD 334 Heard Island and McDonald Islands +VA VAT 336 Holy See HN HND 340 Honduras HK HKG 344 Hong Kong HU HUN 348 Hungary IS ISL 352 Iceland IN IND 356 India ID IDN 360 Indonesia -IR IRN 364 Iran, Islamic Republic of +IR IRN 364 Iran (Islamic Republic of) IQ IRQ 368 Iraq IE IRL 372 Ireland IM IMN 833 Isle of Man @@ -136,8 +136,8 @@ JO JOR 400 Jordan KZ KAZ 398 Kazakhstan KE KEN 404 Kenya KI KIR 296 Kiribati -KP PRK 408 Korea, Democratic People's Republic of -KR KOR 410 Korea, Republic of +KP PRK 408 Korea (Democratic People's Republic of) +KR KOR 410 Korea (Republic of) KW KWT 414 Kuwait KG KGZ 417 Kyrgyzstan LA LAO 418 Lao People's Democratic Republic @@ -145,12 +145,12 @@ LV LVA 428 Latvia LB LBN 422 Lebanon LS LSO 426 Lesotho LR LBR 430 Liberia -LY LBY 434 Libyan Arab Jamahiriya +LY LBY 434 Libya LI LIE 438 Liechtenstein LT LTU 440 Lithuania LU LUX 442 Luxembourg MO MAC 446 Macao -MK MKD 807 Macedonia, the Former Yugoslav Republic of +MK MKD 807 Macedonia (the former Yugoslav Republic of) MG MDG 450 Madagascar MW MWI 454 Malawi MY MYS 458 Malaysia @@ -163,8 +163,8 @@ MR MRT 478 Mauritania MU MUS 480 Mauritius YT MYT 175 Mayotte MX MEX 484 Mexico -FM FSM 583 Micronesia, Federated States of -MD MDA 498 Moldova, Republic of +FM FSM 583 Micronesia (Federated States of) +MD MDA 498 Moldova (Republic of) MC MCO 492 Monaco MN MNG 496 Mongolia ME MNE 499 Montenegro @@ -188,7 +188,7 @@ NO NOR 578 Norway OM OMN 512 Oman PK PAK 586 Pakistan PW PLW 585 Palau -PS PSE 275 Palestinian Territory, Occupied +PS PSE 275 Palestine, State of PA PAN 591 Panama PG PNG 598 Papua New Guinea PY PRY 600 Paraguay @@ -199,14 +199,16 @@ PL POL 616 Poland PT PRT 620 Portugal PR PRI 630 Puerto Rico QA QAT 634 Qatar -RE REU 638 Reunion +RE REU 638 RĂ©union RO ROU 642 Romania RU RUS 643 Russian Federation RW RWA 646 Rwanda -BL BLM 652 Saint Barthelemy +BL BLM 652 Saint BarthĂ©lemy +SH SHN 654 Saint Helena Ascension and Tristan da Cunha KN KNA 659 Saint Kitts and Nevis LC LCA 662 Saint Lucia -MF MAF 663 Saint Martin (French Part) +MF MAF 663 Saint Martin (French part) +PM SPM 666 Saint Pierre and Miquelon VC VCT 670 Saint Vincent and the Grenadines WS WSM 882 Samoa SM SMR 674 San Marino @@ -227,8 +229,6 @@ GS SGS 239 South Georgia and the South Sandwich Island SS SSD 728 South Sudan ES ESP 724 Spain LK LKA 144 Sri Lanka -SH SHN 654 Saint Helena, Ascension and Tristan da Cunha -PM SPM 666 Saint Pierre and Miquelon SD SDN 729 Sudan SR SUR 740 Suriname SJ SJM 744 Svalbard and Jan Mayen @@ -236,10 +236,11 @@ SZ SWZ 748 Swaziland SE SWE 752 Sweden CH CHE 756 Switzerland SY SYR 760 Syrian Arab Republic -TW TWN 158 Taiwan +TW TWN 158 Taiwan, Province of China TJ TJK 762 Tajikistan -TZ TZA 834 Tanzania, United Republic of +TZ TZA 834 Tanzania United Republic of TH THA 764 Thailand +TL TLS 626 Timor-Leste TG TGO 768 Togo TK TKL 772 Tokelau TO TON 776 Tonga @@ -252,17 +253,16 @@ TV TUV 798 Tuvalu UG UGA 800 Uganda UA UKR 804 Ukraine AE ARE 784 United Arab Emirates -GB GBR 826 United Kingdom -US USA 840 United States +GB GBR 826 United Kingdom of Great Britain and Northern Ireland +US USA 840 United States of America UM UMI 581 United States Minor Outlying Islands UY URY 858 Uruguay UZ UZB 860 Uzbekistan VU VUT 548 Vanuatu -VA VAT 336 Holy See (Vatican City State) VE VEN 862 Venezuela, Bolivarian Republic of VN VNM 704 Viet Nam -VG VGB 092 Virgin Islands, British -VI VIR 850 Virgin Islands, U.S. +VG VGB 092 Virgin Islands (British) +VI VIR 850 Virgin Islands (U.S.) WF WLF 876 Wallis and Futuna EH ESH 732 Western Sahara YE YEM 887 Yemen From owner-svn-src-head@freebsd.org Mon Oct 9 05:16:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32DABE255F4; Mon, 9 Oct 2017 05:16:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDADE73B96; Mon, 9 Oct 2017 05:16:35 +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 v995GYPH084480; Mon, 9 Oct 2017 05:16:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v995GYdC084479; Mon, 9 Oct 2017 05:16:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710090516.v995GYdC084479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 9 Oct 2017 05:16:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324424 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324424 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 05:16:36 -0000 Author: eadler Date: Mon Oct 9 05:16:34 2017 New Revision: 324424 URL: https://svnweb.freebsd.org/changeset/base/324424 Log: Remove CVS - we don't run that infrastructure anymore Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Mon Oct 9 05:01:51 2017 (r324423) +++ head/share/misc/organization.dot Mon Oct 9 05:16:34 2017 (r324424) @@ -45,10 +45,8 @@ accounts [label="Accounts Team\naccounts@FreeBSD.org\n backups [label="Backup Administrators\nbackups@FreeBSD.org\nsimon, kensmith,\ndhw"] bugmeister [label="Bugmeister Team\nbugmeister@FreeBSD.org\neadler, gavin, gonzo"] clusteradm [label="Cluster Administrators\nclusteradm@FreeBSD.org\nallanjude, brd,\ndhw, gavin,\ngjb, peter,\nsbruno, simon,\nzi"] -cvsupmaster [label="CVSup Mirror Site Coordinators\ncvsup-master@FreeBSD.org\nkuriyama, jdp,\nkensmith"] dnsadm [label="DNS Administrators\ndnsadm@FreeBSD.org\nbillf, dg, ps,\nkensmith, peter"] mirroradmin [label="FTP/WWW Mirror Site Coordinators\nmirror-admin@FreeBSD.org\nkuriyama, kensmith"] -ncvs [label="CVS src Repository Managers\nncvs@FreeBSD.org\njoe, kuriyama, markm,\nsimon, peter"] perforceadmin [label="Perforce Repository Administrators\nperforce-admin@FreeBSD.org\nscottl, kensmith, gordon,\nrwatson, peter, dhw"] postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\ndhw, ler, pi, rea, remko, zi"] refadm [label="Reference Systems Administrators\nrefadm@FreeBSD.org\njake, billf, markm, simon,\nobrien, ps, kensmith,\npeter, dhw"] @@ -68,8 +66,6 @@ _admin -> accounts _admin -> backups _admin -> bugmeister _admin -> clusteradm -_admin -> ncvs -_admin -> cvsupmaster _admin -> dnsadm _admin -> mirroradmin _admin -> perforceadmin From owner-svn-src-head@freebsd.org Mon Oct 9 05:47:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF58EE2616B; Mon, 9 Oct 2017 05:47:39 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E0B1F7EB1A; Mon, 9 Oct 2017 05:47:38 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id v995lRso069094; Sun, 8 Oct 2017 22:47:31 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201710090547.v995lRso069094@gw.catspoiler.org> Date: Sun, 8 Oct 2017 22:47:27 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r324313 - head/sys/amd64/amd64 To: kostikbel@gmail.com cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20171008083307.GG95911@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 05:47:40 -0000 On 8 Oct, Konstantin Belousov wrote: > On Sat, Oct 07, 2017 at 01:54:05PM -0700, Don Lewis wrote: >> On 7 Oct, Konstantin Belousov wrote: >> > On Sat, Oct 07, 2017 at 01:04:09PM -0700, Don Lewis wrote: >> >> On 5 Oct, Konstantin Belousov wrote: >> >> > Author: kib >> >> > Date: Thu Oct 5 12:50:03 2017 >> >> > New Revision: 324313 >> >> > URL: https://svnweb.freebsd.org/changeset/base/324313 >> >> > >> >> > Log: >> >> > Avoid a race betweem freeing LDT and context switches. >> >> > >> >> > cpu_switch.S uses curproc->p_md.md_ldt value as the flag indicating >> >> > presence of the process LDT. The flag is checked and then ldt segment >> >> > descriptor is copied into the CPU' GDT slot. >> >> > >> >> > Disallow context switches around clearing of the curproc LDT state by >> >> > performing the cleanup in critical section. Ensure that the md_ldt >> >> > flag is cleared before md_ldt_sd descriptor content is destroyed by >> >> > inserting fence between the operations. >> >> > >> >> > We depend on the x86 memory model strong ordering guarantees, in >> >> > particular, that cpu_switch.S observes the writes to md_ldt and >> >> > md_ldt_sd in the expected order. >> >> >> >> I don't know which of this series of commits is responsible, but I think >> >> that it fixed the build of lang/ghc on Ryzen. >> >> >> >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221029#c102 >> > >> > Does ghc use LDT on amd64 ? This sounds unbelievable. >> >> I have no idea, but ghc would reliably fail to build on my Ryzen machine >> up through r323398, and at r324367 it seems to reliably build. > Could you try to bisect ? > > I reviewed all kernel changes and do not see anything which could be > marked as possible fix for whatever kernel issue causing usermode > fault. I need to bisect at least userland for another reason. I've recently been seeing sporadic build runaways when using poudriere to build ports. This has happened both on my replacement Ryzen CPU and also on my AMD FX-8320E, more frequently on the Ryzen. My reason for suspecting a userland problem is that I've only seen this when building ports in a 12.0-CURRENT jail, and not 10.4 or 11.1. I first started seeing this a couple weeks ago. This will be slow going because even on the Ryzen, my full package set builds take about nine hours and I don't see the failure every time. I'll also see if ghc is affected by the userland version. From owner-svn-src-head@freebsd.org Mon Oct 9 07:44:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AE50E284F1; Mon, 9 Oct 2017 07:44:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76AFB72E67; Mon, 9 Oct 2017 07:44:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v997i9B7045361; Mon, 9 Oct 2017 07:44:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v997i977045360; Mon, 9 Oct 2017 07:44:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710090744.v997i977045360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 9 Oct 2017 07:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324425 - head/sys/cddl/compat/opensolaris/sys X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/compat/opensolaris/sys X-SVN-Commit-Revision: 324425 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 07:44:11 -0000 Author: avg Date: Mon Oct 9 07:44:09 2017 New Revision: 324425 URL: https://svnweb.freebsd.org/changeset/base/324425 Log: illumos mutex_init: use SX_NEW instead of bzero There should be no functional change, but SX_NEW seems to be more idiomatic to the use-case. MFC after: 2 weeks X-MFC note: stable/11 only Modified: head/sys/cddl/compat/opensolaris/sys/mutex.h Modified: head/sys/cddl/compat/opensolaris/sys/mutex.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/mutex.h Mon Oct 9 05:16:34 2017 (r324424) +++ head/sys/cddl/compat/opensolaris/sys/mutex.h Mon Oct 9 07:44:09 2017 (r324425) @@ -47,9 +47,9 @@ typedef enum { typedef struct sx kmutex_t; #ifndef OPENSOLARIS_WITNESS -#define MUTEX_FLAGS (SX_DUPOK | SX_NOWITNESS) +#define MUTEX_FLAGS (SX_DUPOK | SX_NEW | SX_NOWITNESS) #else -#define MUTEX_FLAGS (SX_DUPOK) +#define MUTEX_FLAGS (SX_DUPOK | SX_NEW) #endif #define mutex_init(lock, desc, type, arg) do { \ @@ -57,7 +57,6 @@ typedef struct sx kmutex_t; ASSERT((type) == 0 || (type) == MUTEX_DEFAULT); \ KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \ LO_EXPECTED, ("lock %s already initialized", #lock)); \ - bzero((lock), sizeof(struct sx)); \ for (_name = #lock; *_name != '\0'; _name++) { \ if (*_name >= 'a' && *_name <= 'z') \ break; \ From owner-svn-src-head@freebsd.org Mon Oct 9 10:24:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9CA7E2C287; Mon, 9 Oct 2017 10:24:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5FA1D764BA; Mon, 9 Oct 2017 10:24:07 +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 v99AO6uN011674; Mon, 9 Oct 2017 10:24:06 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99AO6pt011672; Mon, 9 Oct 2017 10:24:06 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710091024.v99AO6pt011672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Oct 2017 10:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324427 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 324427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 10:24:08 -0000 Author: trasz Date: Mon Oct 9 10:24:06 2017 New Revision: 324427 URL: https://svnweb.freebsd.org/changeset/base/324427 Log: Document "tdnam" keyword to ps(1), and add "tdname" alias. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Mon Oct 9 08:50:03 2017 (r324426) +++ head/bin/ps/keyword.c Mon Oct 9 10:24:06 2017 (r324427) @@ -201,6 +201,7 @@ static VAR var[] = { {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, 0}, {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, CHAR, NULL, 0}, + {"tdname", "", "tdnam", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, {"tpgid", "TPGID", NULL, "terminal-process-gid", 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Mon Oct 9 08:50:03 2017 (r324426) +++ head/bin/ps/ps.1 Mon Oct 9 10:24:06 2017 (r324427) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd September 7, 2017 +.Dd October 9, 2017 .Dt PS 1 .Os .Sh NAME @@ -675,6 +675,9 @@ saved UID from a setuid executable accumulated system CPU time .It Cm tdaddr thread address +.It Cm tdnam +thread name (alias +.Cm tdname ) .It Cm tdev control terminal device number .It Cm time From owner-svn-src-head@freebsd.org Mon Oct 9 11:46:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 474AFE2DC01; Mon, 9 Oct 2017 11:46:27 +0000 (UTC) (envelope-from pluknet@gmail.com) 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 6379E673CA; Mon, 9 Oct 2017 11:46:26 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: by mail-lf0-x230.google.com with SMTP id l196so27015169lfl.1; Mon, 09 Oct 2017 04:46:26 -0700 (PDT) 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=EtYjeEJQb9bsd7/Es2hQQVauZrdNJX7uhF8eCQ169iQ=; b=m8BtkcSwfEZUPvMwul75W/MOMzXGF6oWMNHm8GHUBvhD9dWn/puwvoa3AHU9mqpCHk iKqvsh9xiSaxc1uCNSZ+fSlrffwVpAsvI0AmLH7KLqmyvyolI2voDivTJpXMPxeo086t 2gxE4QhCUS8rtPmEMx4aUPl6GbzMBWufnOT1Rh+hrcJh47cDzQeASVEm/AguPZ332AFq wQZTWgPdrtiV9M503uMgpbYNiHe5KZjI1ZJqM288dx5xNVHN6+KeaBRfSBMo3PM4DUcN abGEtoaCWN06LaC54g8EhNUhEqOpBnZ3NVusWeCPRW20DSr1XaSTOywT7lumCYl5GrfR aFJg== 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=EtYjeEJQb9bsd7/Es2hQQVauZrdNJX7uhF8eCQ169iQ=; b=TlCDdaVayGq+278MnDSQa679K2+JkRSr3uaSOd4Zn9aG981JR1a7DBzr1c+Dqh1x8R pJ99Pd3nBdW02wu+nFdDVVMayHch1dFOtuDeOuJuwDW528arpNkPuBmXnph3RCu3OMc1 BmK85rlqy0z6ioV8BTo4aAzkF/a9JJOhvyRH/Mq3qmeYL+QbTTgb8pQk92SvOxSLh+9r zIqqqC3ZBdBm51F0ZTHBDrhb6QupbNTHmbFbcBEWryZTbITibaTsXlyC4PrYaIq6y4Fg uN6V3c7fam+WhZKVvMtJRo2ZurvlRAg0pmo6q+ylhRAjhm7o0TexxYBAgfIY/q9s+X7e /XYA== X-Gm-Message-State: AMCzsaX/ZihELWLDpnYNr/Gi7AuXmKV7y/SzZP2mpTYMs7ZapXa87ces zRcSfNfB7GfaEBSkwe/LgQdubmyfO+glvZyLIzpn1CMr X-Google-Smtp-Source: AOwi7QAcEmH07jCclpI9IOpNtvgnvh5WUPvsxsTEk3bc+IY5IB1rLWpHJHOn98tMPGPk3iSJruc4QS2J7DR9SG0mCCg= X-Received: by 10.46.85.145 with SMTP id g17mr4272421lje.84.1507549584442; Mon, 09 Oct 2017 04:46:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.46.81.73 with HTTP; Mon, 9 Oct 2017 04:46:24 -0700 (PDT) In-Reply-To: <201710091024.v99AO6pt011672@repo.freebsd.org> References: <201710091024.v99AO6pt011672@repo.freebsd.org> From: Sergey Kandaurov Date: Mon, 9 Oct 2017 14:46:24 +0300 Message-ID: Subject: Re: svn commit: r324427 - head/bin/ps To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 11:46:27 -0000 On 9 October 2017 at 13:24, Edward Tomasz Napierala wrote: > Author: trasz > Date: Mon Oct 9 10:24:06 2017 > New Revision: 324427 > URL: https://svnweb.freebsd.org/changeset/base/324427 > > Log: > Document "tdnam" keyword to ps(1), and add "tdname" alias. > > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > > Modified: > head/bin/ps/keyword.c > head/bin/ps/ps.1 > > Modified: head/bin/ps/keyword.c > ============================================================ > ================== > --- head/bin/ps/keyword.c Mon Oct 9 08:50:03 2017 (r324426) > +++ head/bin/ps/keyword.c Mon Oct 9 10:24:06 2017 (r324427) > @@ -201,6 +201,7 @@ static VAR var[] = { > {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, > 0}, > {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, > CHAR, > NULL, 0}, > Hello, could you please fix this ^^ "tdnam" description as well? fwiw, looks like it's only used in libxo as a field name. [..] -- wbr, pluknet From owner-svn-src-head@freebsd.org Mon Oct 9 11:47:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1DB4E2DCB1; Mon, 9 Oct 2017 11:47:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13732678F9; Mon, 9 Oct 2017 11:47:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x229.google.com with SMTP id p1so5119778qtg.2; Mon, 09 Oct 2017 04:47:47 -0700 (PDT) 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=sizWMiZ/5L81S5G2VMX94ofubsQDK9tZVGi5DFVlNOE=; b=S6sNnrVGljANA56DFP53QPrtfncNAnx06XX6RMa66YuC8r5jF6DJymClJyViBVlVYU Ha3lY6uJ3u/e69/zxOisMV3btImqLnU4F9C1N1wtxI55eTK2s0QO7EGWCd81HSZCMruF nhoLRK+vimiKj0VvAvhDWrFevbii9bkarPnT8zMgO89lQp8n1ymK5ny0jJJ07PUMrmVI PCa2DOM3AvKcng4QkDaYI46h2X9Un0pmqgAz4dKHrfc296hP844jp4L7OFaMVERZTPRw Jk3tOxyzazxA108fTNdQgPHtdPzCqTVgA3zKmt6wuv1DXrH19qOm9D4MwmyePvYizg2/ FE0g== 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=sizWMiZ/5L81S5G2VMX94ofubsQDK9tZVGi5DFVlNOE=; b=uhEL/YZYRajEM3WWNRTvOwTdTEKf3Ldg07dUmsmE2v9QuY97KY2nw/kwk1qms8daBa Yker+YWNSzxmIHh+pkTs4P/Ha7WvYuPwKizCelgw2u2KrHKv+WmrWISKcWTNiK8ko5nw awwNzwFoyWZoSsr5NXrxZaA6mo6KpOxVDVeokqGlmY7fXAN0EI3h7WrvleSy4aKI7127 /1G3Dk0wlWrd+AI1Oy/9ptw6pa8tDxu1ahd+yA4uhfqTm+Cuc9ZRJyeGR2V39wmtgSoc ZVnNMxOgHyF2rPoJ7dymKIJ8LF1ZRwz+/azH0On9M7axj2fMzYVsSwnTIbxXmnOboWqs oIpw== X-Gm-Message-State: AMCzsaUp6T7tSrX5YPLdAXB8fxeKVYFV8v8Jw4FT0ME5BYM6jyOwOvji wOlSSpw/B+LieNXCUm2xUaCtqko+er82KTXOZF/Jrw== X-Google-Smtp-Source: AOwi7QCzPt3+Is44XGV4sob9/S5oCHM8NKFNJnm7Zkwmv4MXJIvblzVFHzhuJLY535eUnW5HSWM9Z5DuJte9uy0pnIM= X-Received: by 10.200.27.221 with SMTP id m29mr2457294qtk.152.1507549665824; Mon, 09 Oct 2017 04:47:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.46.33 with HTTP; Mon, 9 Oct 2017 04:47:45 -0700 (PDT) In-Reply-To: <1507485390.86205.323.camel@freebsd.org> References: <201710081733.v98HXnu1094645@repo.freebsd.org> <1507485390.86205.323.camel@freebsd.org> From: Mateusz Guzik Date: Mon, 9 Oct 2017 13:47:45 +0200 Message-ID: Subject: Re: svn commit: r324415 - in head/sys: kern sys 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.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 11:47:47 -0000 On Sun, Oct 08, 2017 at 11:56:30AM -0600, Ian Lepore wrote: > On Sun, 2017-10-08 at 17:33 +0000, Ian Lepore wrote: > > Author: ian > > Date: Sun Oct 8 17:33:49 2017 > > New Revision: 324415 > > URL: https://svnweb.freebsd.org/changeset/base/324415 > > > > Log: > > Add eventhandler notifications for newbus device attach/detach. > > > > [...] > > > > A couple salient comments from the review, they amount to some helpful > > documentation about these events, but there's currently no good place for > > such documentation... > > About this last point... sys/eventhandler.h is now an ever-growing list > of EVENTHANDLER_DECLARE() statements for events that are unrelated to > each other. I think we are at the point where it's no longer a few > well-known "standard system event queues", it's turning into a mess. > > My first thought was to add these to bus.h because they're bus events. > But you have to include eventhandler.h to use EVENTHANDLER_DECLARE, > and I didn't want to pull it (and its dependencies) into bus.h. > The current implementation has to be retired and significant tinkering with it is imho a waste of time. It is weirdly inefficient both single and multithreaded. Vast majority (if not all) lists are statically defined. And yet invocing the handlers starts with following a linked list and strcmping to find the instance. All this under a global eventhanadler lock which starts showing up. Most registered handlers for any paritcular event are never going to get unregistered. The current code locks the list do the traversal, which again is slow and starts showing up in lock profiles. So the proposal is to partially unscrew the current code so that it largely gets out of the way and then implement something new and migrate evertyhing on head to use it. A new set of eventhnadler declarations can be added (_STATIC?) which provides a known at compilation time symbol. Then a paired invocation macro to just lock the handler list without the need to look it up. As for the new mechanism, I don't have anything fleshed out, but in general it would do away with excessive macro use. handlers which once registered never get removed get a lockless treatment for traveral. say they also get implemented as a linked list. Invocations would do a lockless traversal of the list. If there is an entry, it is fully installed and never goes away. Registrations would lock the list and add an entry in traversal-friendly manner updating the '->next' pointer at the lsat step. Later this can be made even nicer with a table, but that will require a little bit of trickery to make it freeable. With this in place there will be no central "here are the handlers" header. That said, I have no immediate plans working on this, but I'll eventually get around to it unless someone beats me or has a better idea. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Mon Oct 9 12:10:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94678E2EB46; Mon, 9 Oct 2017 12:10:58 +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 2FAE66D293; Mon, 9 Oct 2017 12:10:56 +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 DE2D93C57F7; Mon, 9 Oct 2017 23:10:54 +1100 (AEDT) Date: Mon, 9 Oct 2017 23:10:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sergey Kandaurov cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324427 - head/bin/ps In-Reply-To: Message-ID: <20171009231026.M2645@besplex.bde.org> References: <201710091024.v99AO6pt011672@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=LI0WeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=GYZi_WjK67zS3PyEqQcA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 12:10:58 -0000 On Mon, 9 Oct 2017, Sergey Kandaurov wrote: > On 9 October 2017 at 13:24, Edward Tomasz Napierala > wrote: > >> Author: trasz >> Date: Mon Oct 9 10:24:06 2017 >> New Revision: 324427 >> URL: https://svnweb.freebsd.org/changeset/base/324427 >> >> Log: >> Document "tdnam" keyword to ps(1), and add "tdname" alias. >> >> MFC after: 2 weeks >> Sponsored by: DARPA, AFRL >> >> Modified: >> head/bin/ps/keyword.c >> head/bin/ps/ps.1 >> >> Modified: head/bin/ps/keyword.c >> ============================================================ >> ================== >> --- head/bin/ps/keyword.c Mon Oct 9 08:50:03 2017 (r324426) >> +++ head/bin/ps/keyword.c Mon Oct 9 10:24:06 2017 (r324427) >> @@ -201,6 +201,7 @@ static VAR var[] = { >> {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, >> 0}, >> {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, >> CHAR, >> NULL, 0}, >> > > > Hello, > could you please fix this ^^ "tdnam" description as well? > fwiw, looks like it's only used in libxo as a field name. > > [..] > > -- > wbr, > pluknet > From owner-svn-src-head@freebsd.org Mon Oct 9 12:54:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E732E2FD21; Mon, 9 Oct 2017 12:54:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id E5E3576B7A; Mon, 9 Oct 2017 12:54: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 mail106.syd.optusnet.com.au (Postfix) with ESMTPS id A8ABB3C579D; Mon, 9 Oct 2017 23:54:32 +1100 (AEDT) Date: Mon, 9 Oct 2017 23:53:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sergey Kandaurov cc: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324427 - head/bin/ps In-Reply-To: Message-ID: <20171009231134.P2645@besplex.bde.org> References: <201710091024.v99AO6pt011672@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=UyfP_cosPN9UB4uMd_gA:9 a=tpJOXtjAOTdNX3We:21 a=mCOBi_0y4SuvmJo5:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 12:54:36 -0000 {Please ignore my previous null reply] On Mon, 9 Oct 2017, Sergey Kandaurov wrote: > On 9 October 2017 at 13:24, Edward Tomasz Napierala > wrote: > >> Author: trasz >> Date: Mon Oct 9 10:24:06 2017 >> New Revision: 324427 >> URL: https://svnweb.freebsd.org/changeset/base/324427 >> >> Log: >> Document "tdnam" keyword to ps(1), and add "tdname" alias. >> Modified: head/bin/ps/keyword.c >> ============================================================ >> ================== >> --- head/bin/ps/keyword.c Mon Oct 9 08:50:03 2017 (r324426) >> +++ head/bin/ps/keyword.c Mon Oct 9 10:24:06 2017 (r324427) >> @@ -201,6 +201,7 @@ static VAR var[] = { >> {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, >> 0}, >> {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, >> CHAR, >> NULL, 0}, > > Hello, > could you please fix this ^^ "tdnam" description as well? > fwiw, looks like it's only used in libxo as a field name. Since it is badly designed and implemented, 2 names for it are worse than for any other keyword. Perhaps since it was undocumented in the man page and misdocumented in the screen, nothing uses it and you can rename it without anything noticing it. (Design errors start with splitting thread and proc names in a way that is difficult for applications to untangle. Implementation errors start with abusing the space reserved for the old command name (ki_ocomm) for ki_tdname. This helps break old applications that only understand ki_ocomm. TDNAMLEN = OCOMMLEN = 16 is also too small, and its name is spelled without an E, unlike all other *NAMELEN names in . This is too short. It is only 3 shorter than COMMLEN, but should probably be longer, depending on how thread and proc names are split. The last bug has been partly fixed. There is now ki_moretdname[]. This has length just 3 (plus 1 for a NUL) to make allow expansion of thread names to the same length as proc names (19). ps and top actually understand this (except the update to use it is missing in ps/ps.c; it is only in ps/print.c). Thread names are also printed for the comm and command keywords in ps. They are essentially appended to ki_comm. This is too simple of ki_comm already contains some thread info. A negative amount of space is available for expansion. if the user uses tdnam then it is even more difficult to get a good combination of proc and thread info. Bruce From owner-svn-src-head@freebsd.org Mon Oct 9 13:48:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1F3CE30CB2; Mon, 9 Oct 2017 13:48:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id B1AC21FD7; Mon, 9 Oct 2017 13:48:11 +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 v99DmATN096179; Mon, 9 Oct 2017 13:48:10 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99DmAn2096178; Mon, 9 Oct 2017 13:48:10 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710091348.v99DmAn2096178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Oct 2017 13:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324429 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 324429 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 13:48:12 -0000 Author: trasz Date: Mon Oct 9 13:48:10 2017 New Revision: 324429 URL: https://svnweb.freebsd.org/changeset/base/324429 Log: Fix long name (used by libxo) for the "tdnam" ps(1) keyword. Reported by: pluknet MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/ps/keyword.c Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Mon Oct 9 13:28:08 2017 (r324428) +++ head/bin/ps/keyword.c Mon Oct 9 13:48:10 2017 (r324429) @@ -199,7 +199,7 @@ static VAR var[] = { {"tdaddr", "TDADDR", NULL, "thread-address", 0, kvar, KOFF(ki_tdaddr), KPTR, "lx", 0}, {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, 0}, - {"tdnam", "TDNAM", NULL, "terminal-device-name", LJUST, tdnam, 0, CHAR, + {"tdnam", "TDNAM", NULL, "thread-name", LJUST, tdnam, 0, CHAR, NULL, 0}, {"tdname", "", "tdnam", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, From owner-svn-src-head@freebsd.org Mon Oct 9 13:53:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0485EE30EDE; Mon, 9 Oct 2017 13:53:42 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7C8533759; Mon, 9 Oct 2017 13:53:42 +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 v99DrfRM000174; Mon, 9 Oct 2017 13:53:41 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99DrfsI000172; Mon, 9 Oct 2017 13:53:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201710091353.v99DrfsI000172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 9 Oct 2017 13:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324430 - head/bin/ps X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/ps X-SVN-Commit-Revision: 324430 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 13:53:43 -0000 Author: trasz Date: Mon Oct 9 13:53:41 2017 New Revision: 324430 URL: https://svnweb.freebsd.org/changeset/base/324430 Log: Undocument "tdnam" (leaving it as an alias), and rename the column to TDNAME. Suggested by: bde MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/bin/ps/keyword.c head/bin/ps/ps.1 Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Mon Oct 9 13:48:10 2017 (r324429) +++ head/bin/ps/keyword.c Mon Oct 9 13:53:41 2017 (r324430) @@ -199,9 +199,9 @@ static VAR var[] = { {"tdaddr", "TDADDR", NULL, "thread-address", 0, kvar, KOFF(ki_tdaddr), KPTR, "lx", 0}, {"tdev", "TDEV", NULL, "terminal-device", 0, tdev, 0, CHAR, NULL, 0}, - {"tdnam", "TDNAM", NULL, "thread-name", LJUST, tdnam, 0, CHAR, + {"tdnam", "", "tdname", NULL, 0, NULL, 0, CHAR, NULL, 0}, + {"tdname", "TDNAME", NULL, "thread-name", LJUST, tdnam, 0, CHAR, NULL, 0}, - {"tdname", "", "tdnam", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, {"tpgid", "TPGID", NULL, "terminal-process-gid", 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Mon Oct 9 13:48:10 2017 (r324429) +++ head/bin/ps/ps.1 Mon Oct 9 13:53:41 2017 (r324430) @@ -675,9 +675,8 @@ saved UID from a setuid executable accumulated system CPU time .It Cm tdaddr thread address -.It Cm tdnam -thread name (alias -.Cm tdname ) +.It Cm tdname +thread name .It Cm tdev control terminal device number .It Cm time From owner-svn-src-head@freebsd.org Mon Oct 9 14:48:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 081D0E32243; Mon, 9 Oct 2017 14:48:05 +0000 (UTC) (envelope-from lwhsu@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 5CF026F1A8; Mon, 9 Oct 2017 14:48:04 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1129) id F0D7210A1C; Mon, 9 Oct 2017 14:47:28 +0000 (UTC) Date: Mon, 9 Oct 2017 14:47:28 +0000 From: Li-Wen Hsu To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324423 - head/share/misc Message-ID: <20171009144728.GA93977@freefall.freebsd.org> References: <201710090501.v9951qcF079521@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710090501.v9951qcF079521@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 14:48:05 -0000 On Mon, Oct 09, 2017 at 05:01:52 +0000, Eitan Adler wrote: > Author: eadler > Date: Mon Oct 9 05:01:51 2017 > New Revision: 324423 > URL: https://svnweb.freebsd.org/changeset/base/324423 > > Log: > Update iso3166 codes > > Based on https://raw.githubusercontent.com/lukes/ISO-3166-Countries-with-Regional-Codes/master/all/all.csv > and hand massaged. > > Modified: > head/share/misc/iso3166 > > Modified: head/share/misc/iso3166 > ============================================================================== > --- head/share/misc/iso3166 Mon Oct 9 04:43:05 2017 (r324422) > +++ head/share/misc/iso3166 Mon Oct 9 05:01:51 2017 (r324423) > @@ -236,10 +236,11 @@ SZ SWZ 748 Swaziland > SE SWE 752 Sweden > CH CHE 756 Switzerland > SY SYR 760 Syrian Arab Republic > -TW TWN 158 Taiwan > +TW TWN 158 Taiwan, Province of China Hi Eitan, Plase revert this line, "Taiwan" is how we call ourself. Also please refer to previous commit: https://svnweb.freebsd.org/changeset/base/198948 Thanks, Li-Wen -- Li-Wen Hsu https://lwhsu.org From owner-svn-src-head@freebsd.org Mon Oct 9 14:50:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2C2BE32406; Mon, 9 Oct 2017 14:50: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 mx1.freebsd.org (Postfix) with ESMTPS id D6C8C6FB08; Mon, 9 Oct 2017 14:50:03 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99Eo2TY021216; Mon, 9 Oct 2017 14:50:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99Eo20W021215; Mon, 9 Oct 2017 14:50:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201710091450.v99Eo20W021215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 9 Oct 2017 14:50:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324431 - head/usr.bin/patch X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/patch X-SVN-Commit-Revision: 324431 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 14:50:05 -0000 Author: kevans Date: Mon Oct 9 14:50:02 2017 New Revision: 324431 URL: https://svnweb.freebsd.org/changeset/base/324431 Log: patch(1): Don't overrun line buffer in some cases Patches like file.txt attached to PR 190195 with a final line formed like ">(EOL)" could cause a copy past the end of the current line buffer. In the case of PR 191641, this caused a duplicate line to be copied into the resulting file. Instead of running past the end, treat it as if it were a blank line. PR: 191641 Reviewed by: cem, emaste, pfg Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12609 Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Mon Oct 9 13:53:41 2017 (r324430) +++ head/usr.bin/patch/pch.c Mon Oct 9 14:50:02 2017 (r324431) @@ -1135,7 +1135,12 @@ hunk_done: if (*buf != '>') fatal("> expected at line %ld of patch\n", p_input_line); - p_line[i] = savestr(buf + 2); + /* Don't overrun if we don't have enough line */ + if (len > 2) + p_line[i] = savestr(buf + 2); + else + p_line[i] = savestr(""); + if (out_of_mem) { p_end = i - 1; return false; From owner-svn-src-head@freebsd.org Mon Oct 9 15:24:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F181E3319C; Mon, 9 Oct 2017 15:24:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D306E77923; Mon, 9 Oct 2017 15:24:19 +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 v99FOIK6037689; Mon, 9 Oct 2017 15:24:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99FOIVR037688; Mon, 9 Oct 2017 15:24:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091524.v99FOIVR037688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 15:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324432 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324432 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:24:20 -0000 Author: kib Date: Mon Oct 9 15:24:18 2017 New Revision: 324432 URL: https://svnweb.freebsd.org/changeset/base/324432 Log: More style. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Oct 9 14:50:02 2017 (r324431) +++ head/sys/i386/i386/sys_machdep.c Mon Oct 9 15:24:18 2017 (r324432) @@ -717,10 +717,10 @@ i386_set_ldt_data(struct thread *td, int start, int nu static int i386_ldt_grow(struct thread *td, int len) { - struct mdproc *mdp = &td->td_proc->p_md; + struct mdproc *mdp; struct proc_ldt *new_ldt, *pldt; - caddr_t old_ldt_base = NULL_LDT_BASE; - int old_ldt_len = 0; + caddr_t old_ldt_base; + int old_ldt_len; mtx_assert(&dt_lock, MA_OWNED); @@ -728,6 +728,10 @@ i386_ldt_grow(struct thread *td, int len) return (ENOMEM); if (len < NLDT + 1) len = NLDT + 1; + + mdp = &td->td_proc->p_md; + old_ldt_base = NULL_LDT_BASE; + old_ldt_len = 0; /* Allocate a user ldt. */ if ((pldt = mdp->md_ldt) == NULL || len > pldt->ldt_len) { From owner-svn-src-head@freebsd.org Mon Oct 9 15:39:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8EBEE33819; Mon, 9 Oct 2017 15:39:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 956F97F085; Mon, 9 Oct 2017 15:39:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99FdhO5042227; Mon, 9 Oct 2017 15:39:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99Fdh4m042224; Mon, 9 Oct 2017 15:39:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091539.v99Fdh4m042224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 15:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324433 - in head/sys/i386: i386 include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/i386: i386 include X-SVN-Commit-Revision: 324433 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:39:45 -0000 Author: kib Date: Mon Oct 9 15:39:43 2017 New Revision: 324433 URL: https://svnweb.freebsd.org/changeset/base/324433 Log: Reset the fs and gs bases on exec(2). The values from the old address space do not make sense for the new program. In particular, gsbase might be the TLS base for the old program but the new program has no TLS now. amd64 already handles this correctly. Reported and reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/machdep.c head/sys/i386/i386/sys_machdep.c head/sys/i386/include/md_var.h Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Mon Oct 9 15:24:18 2017 (r324432) +++ head/sys/i386/i386/machdep.c Mon Oct 9 15:39:43 2017 (r324433) @@ -1132,6 +1132,15 @@ exec_setregs(struct thread *td, struct image_params *i else mtx_unlock_spin(&dt_lock); + /* + * Reset the fs and gs bases. The values from the old address + * space do not make sense for the new program. In particular, + * gsbase might be the TLS base for the old program but the new + * program has no TLS now. + */ + set_fsbase(td, 0); + set_gsbase(td, 0); + bzero((char *)regs, sizeof(struct trapframe)); regs->tf_eip = imgp->entry_addr; regs->tf_esp = stack; Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Oct 9 15:24:18 2017 (r324432) +++ head/sys/i386/i386/sys_machdep.c Mon Oct 9 15:39:43 2017 (r324433) @@ -91,6 +91,37 @@ fill_based_sd(struct segment_descriptor *sdp, uint32_t sdp->sd_gran = 1; } +/* + * Construct special descriptors for "base" selectors. Store them in + * the PCB for later use by cpu_switch(). Store them in the GDT for + * more immediate use. The GDT entries are part of the current + * context. Callers must load related segment registers to complete + * setting up the current context. + */ +void +set_fsbase(struct thread *td, uint32_t base) +{ + struct segment_descriptor sd; + + fill_based_sd(&sd, base); + critical_enter(); + td->td_pcb->pcb_fsd = sd; + PCPU_GET(fsgs_gdt)[0] = sd; + critical_exit(); +} + +void +set_gsbase(struct thread *td, uint32_t base) +{ + struct segment_descriptor sd; + + fill_based_sd(&sd, base); + critical_enter(); + td->td_pcb->pcb_gsd = sd; + PCPU_GET(fsgs_gdt)[1] = sd; + critical_exit(); +} + #ifndef _SYS_SYSPROTO_H_ struct sysarch_args { int op; @@ -109,7 +140,7 @@ sysarch(struct thread *td, struct sysarch_args *uap) struct i386_get_xfpustate xfpu; } kargs; uint32_t base; - struct segment_descriptor sd, *sdp; + struct segment_descriptor *sdp; AUDIT_ARG_CMD(uap->op); @@ -204,16 +235,11 @@ sysarch(struct thread *td, struct sysarch_args *uap) error = copyin(uap->parms, &base, sizeof(base)); if (error == 0) { /* - * Construct a descriptor and store it in the pcb for - * the next context switch. Also store it in the gdt - * so that the load of tf_fs into %fs will activate it - * at return to userland. + * Construct the special descriptor for fsbase + * and arrange for doreti to load its selector + * soon enough. */ - fill_based_sd(&sd, base); - critical_enter(); - td->td_pcb->pcb_fsd = sd; - PCPU_GET(fsgs_gdt)[0] = sd; - critical_exit(); + set_fsbase(td, base); td->td_frame->tf_fs = GSEL(GUFS_SEL, SEL_UPL); } break; @@ -226,15 +252,11 @@ sysarch(struct thread *td, struct sysarch_args *uap) error = copyin(uap->parms, &base, sizeof(base)); if (error == 0) { /* - * Construct a descriptor and store it in the pcb for - * the next context switch. Also store it in the gdt - * because we have to do a load_gs() right now. + * Construct the special descriptor for gsbase. + * The selector is loaded immediately, since we + * normally only reload %gs on context switches. */ - fill_based_sd(&sd, base); - critical_enter(); - td->td_pcb->pcb_gsd = sd; - PCPU_GET(fsgs_gdt)[1] = sd; - critical_exit(); + set_gsbase(td, base); load_gs(GSEL(GUGS_SEL, SEL_UPL)); } break; Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Oct 9 15:24:18 2017 (r324432) +++ head/sys/i386/include/md_var.h Mon Oct 9 15:39:43 2017 (r324433) @@ -66,6 +66,8 @@ void init_AMD_Elan_sc520(void); vm_paddr_t kvtop(void *addr); void panicifcpuunsupported(void); void ppro_reenable_apic(void); +void set_fsbase(struct thread *td, uint32_t base); +void set_gsbase(struct thread *td, uint32_t base); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); union savefpu *get_pcb_user_save_td(struct thread *td); union savefpu *get_pcb_user_save_pcb(struct pcb *pcb); From owner-svn-src-head@freebsd.org Mon Oct 9 15:48:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 944C3E33B5F; Mon, 9 Oct 2017 15:48:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41FF8813EE; Mon, 9 Oct 2017 15:48:58 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99Fmvrr046505; Mon, 9 Oct 2017 15:48:57 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99FmuuT046501; Mon, 9 Oct 2017 15:48:56 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201710091548.v99FmuuT046501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 9 Oct 2017 15:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324434 - in head/sys: dev/iwm modules/iwmfw/iwm8265fw X-SVN-Group: head X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: in head/sys: dev/iwm modules/iwmfw/iwm8265fw X-SVN-Commit-Revision: 324434 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:48:58 -0000 Author: gnn Date: Mon Oct 9 15:48:56 2017 New Revision: 324434 URL: https://svnweb.freebsd.org/changeset/base/324434 Log: Add support for Intel 8265 WiFi Obtained from: OpenBSD MFC after: 1 month Added: head/sys/modules/iwmfw/iwm8265fw/ head/sys/modules/iwmfw/iwm8265fw/Makefile (contents, props changed) Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_8000.c head/sys/dev/iwm/if_iwm_config.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Oct 9 15:39:43 2017 (r324433) +++ head/sys/dev/iwm/if_iwm.c Mon Oct 9 15:48:56 2017 (r324434) @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.42 2015/05/30 02:49:23 deraadt Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.167 2017/04/04 00:40:52 claudio Exp $ */ /* * Copyright (c) 2014 genua mbh @@ -5690,6 +5690,7 @@ iwm_intr(void *arg) #define PCI_PRODUCT_INTEL_WL_7265_2 0x095b #define PCI_PRODUCT_INTEL_WL_8260_1 0x24f3 #define PCI_PRODUCT_INTEL_WL_8260_2 0x24f4 +#define PCI_PRODUCT_INTEL_WL_8265_1 0x24fd static const struct iwm_devices { uint16_t device; @@ -5705,6 +5706,7 @@ static const struct iwm_devices { { PCI_PRODUCT_INTEL_WL_7265_2, &iwm7265_cfg }, { PCI_PRODUCT_INTEL_WL_8260_1, &iwm8260_cfg }, { PCI_PRODUCT_INTEL_WL_8260_2, &iwm8260_cfg }, + { PCI_PRODUCT_INTEL_WL_8265_1, &iwm8265_cfg }, }; static int Modified: head/sys/dev/iwm/if_iwm_8000.c ============================================================================== --- head/sys/dev/iwm/if_iwm_8000.c Mon Oct 9 15:39:43 2017 (r324433) +++ head/sys/dev/iwm/if_iwm_8000.c Mon Oct 9 15:48:56 2017 (r324434) @@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include "if_iwm_config.h" #define IWM8000_FW "iwm8000Cfw" +#define IWM8265_FW "iwm8265fw" #define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 @@ -90,6 +91,13 @@ __FBSDID("$FreeBSD$"); const struct iwm_cfg iwm8260_cfg = { .name = "Intel(R) Dual Band Wireless AC 8260", .fw_name = IWM8000_FW, + IWM_DEVICE_8000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm8265_cfg = { + .name = "Intel(R) Dual Band Wireless AC 8265", + .fw_name = IWM8265_FW, IWM_DEVICE_8000_COMMON, .host_interrupt_operation_mode = 0, }; Modified: head/sys/dev/iwm/if_iwm_config.h ============================================================================== --- head/sys/dev/iwm/if_iwm_config.h Mon Oct 9 15:39:43 2017 (r324433) +++ head/sys/dev/iwm/if_iwm_config.h Mon Oct 9 15:48:56 2017 (r324434) @@ -131,5 +131,6 @@ extern const struct iwm_cfg iwm3165_cfg; extern const struct iwm_cfg iwm7265_cfg; extern const struct iwm_cfg iwm7265d_cfg; extern const struct iwm_cfg iwm8260_cfg; +extern const struct iwm_cfg iwm8265_cfg; #endif /* __IWM_CONFIG_H__ */ Added: head/sys/modules/iwmfw/iwm8265fw/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/iwmfw/iwm8265fw/Makefile Mon Oct 9 15:48:56 2017 (r324434) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +KMOD= iwm8265fw +IMG= iwm-8265-22 + +.include From owner-svn-src-head@freebsd.org Mon Oct 9 15:54:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BFEDE33F0D; Mon, 9 Oct 2017 15:54:16 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 CF1C182844; Mon, 9 Oct 2017 15:54:15 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 1aNfer01hM9gt1aNgeQZtz; Mon, 09 Oct 2017 09:54:13 -0600 X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=a4Aw6F95ZvH9RvhgbvMA:9 a=K0OK_Eu0TMvzUq_5:21 a=0CyyuH9aOhxaPQ_5:21 a=CjuIK1q_8ugA: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 B02F0D0; Mon, 9 Oct 2017 08:54:10 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v99FsAjK002950; Mon, 9 Oct 2017 08:54:10 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710091554.v99FsAjK002950@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Alan Cox cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324420 - in head/sys: kern sys In-Reply-To: Message from Alan Cox of "Sun, 08 Oct 2017 22:17:39 -0000." <201710082217.v98MHdNI012272@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 09 Oct 2017 08:54:10 -0700 X-CMAE-Envelope: MS4wfDMxvRywROYAUhDwqywor3BDK/16EEP3jKuzwG86D9pgTB5QjUmIinMeTcptv/YsNlQbE4CdtV2R4/cZgefmzxiywC8rZWd62oA/n9yOnJ/38IP/lNyh FxTAaZ3vKLtjXafQsVncvnBJjLZMrspa1vdVonj45Fvel0fwcOst9YOKRtrvyVaQ5HowV6TOycISVzgn5t877qZ39PKHe/g6EkNuEPUmuwOvyn/a7smAjGGZ qeX6XrmgbBvyIZf/kiHnXt1y1G8N8VoJ3XWbh+sLpfg/cwHSb0UFDUStICztvnB9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 09 Oct 2017 15:54:16 -0000 In message <201710082217.v98MHdNI012272@repo.freebsd.org>, Alan Cox writes: > Author: alc > Date: Sun Oct 8 22:17:39 2017 > New Revision: 324420 > URL: https://svnweb.freebsd.org/changeset/base/324420 > > Log: > The blst_radix_init function has two purposes - to compute the number of > nodes to allocate for the blist, and to initialize them. The computation > can be done much more quickly by identifying the terminating node, if any, > at every level of the tree and then summing the number of nodes at each > level that precedes the topmost terminator. The initialization can also be > done quickly, since settings at the root mark the tree as all-allocated, an > d > only a few terminator nodes need to be marked in the rest of the tree. > Eliminate blst_radix_init, and perform its two functions more simply in > blist_create. > > The allocation of the blist takes places in two pieces, but there's no good > reason to do so, when a single allocation is sufficient, and simpler. > Allocate the blist struct, and the array of nodes associated with it, with > a > single allocation. > > Submitted by: Doug Moore > Reviewed by: markj (an earlier version) > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D11968 > > Modified: > head/sys/kern/subr_blist.c > head/sys/sys/blist.h > > Modified: head/sys/kern/subr_blist.c > ============================================================================= > = > --- head/sys/kern/subr_blist.c Sun Oct 8 21:20:25 2017 (r32441 > 9) > +++ head/sys/kern/subr_blist.c Sun Oct 8 22:17:39 2017 (r32442 > 0) > @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -137,7 +138,6 @@ static void blst_copy(blmeta_t *scan, daddr_t blk, dad > static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); > static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t coun > t, > u_daddr_t radix); > -static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t > count); > #ifndef _KERNEL > static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, > int tab); > @@ -218,30 +218,69 @@ blist_t > blist_create(daddr_t blocks, int flags) > { > blist_t bl; > - daddr_t nodes, radix; > + daddr_t i, last_block; > + u_daddr_t nodes, radix, skip; > + int digit; > > /* > - * Calculate the radix field used for scanning. > + * Calculate the radix and node count used for scanning. Find the last > + * block that is followed by a terminator. > */ > + last_block = blocks - 1; > radix = BLIST_BMAP_RADIX; > while (radix < blocks) { > + if (((last_block / radix + 1) & BLIST_META_MASK) != 0) > + /* > + * A terminator will be added. Update last_block to th > e > + * position just before that terminator. > + */ > + last_block |= radix - 1; > radix *= BLIST_META_RADIX; > } > - nodes = 1 + blst_radix_init(NULL, radix, blocks); > > - bl = malloc(sizeof(struct blist), M_SWAP, flags); > + /* > + * Count the meta-nodes in the expanded tree, including the final > + * terminator, from the bottom level up to the root. > + */ > + nodes = (last_block >= blocks) ? 2 : 1; > + last_block /= BLIST_BMAP_RADIX; > + while (last_block > 0) { > + nodes += last_block + 1; > + last_block /= BLIST_META_RADIX; > + } > + bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags); > if (bl == NULL) > return (NULL); > > bl->bl_blocks = blocks; > bl->bl_radix = radix; > bl->bl_cursor = 0; > - bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags); > - if (bl->bl_root == NULL) { > - free(bl, M_SWAP); > - return (NULL); > + > + /* > + * Initialize the empty tree by filling in root values, then initialize > + * just the terminators in the rest of the tree. > + */ > + bl->bl_root[0].bm_bighint = 0; > + if (radix == BLIST_BMAP_RADIX) > + bl->bl_root[0].u.bmu_bitmap = 0; > + else > + bl->bl_root[0].u.bmu_avail = 0; > + last_block = blocks - 1; > + i = 0; > + while (radix > BLIST_BMAP_RADIX) { > + radix /= BLIST_META_RADIX; > + skip = radix_to_skip(radix); > + digit = last_block / radix; > + i += 1 + digit * skip; > + if (digit != BLIST_META_MASK) { > + /* > + * Add a terminator. > + */ > + bl->bl_root[i + skip].bm_bighint = (daddr_t)-1; > + bl->bl_root[i + skip].u.bmu_bitmap = 0; > + } > + last_block %= radix; > } > - blst_radix_init(bl->bl_root, radix, blocks); > > #if defined(BLIST_DEBUG) > printf( > @@ -261,7 +300,7 @@ blist_create(daddr_t blocks, int flags) > void > blist_destroy(blist_t bl) > { > - free(bl->bl_root, M_SWAP); > + > free(bl, M_SWAP); > } > > @@ -1070,83 +1109,6 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr > } > scan->u.bmu_avail -= nblks; > return (nblks); > -} > - > -/* > - * BLST_RADIX_INIT() - initialize radix tree > - * > - * Initialize our meta structures and bitmaps and calculate the exact > - * amount of space required to manage 'count' blocks - this space may > - * be considerably less than the calculated radix due to the large > - * RADIX values we use. > - */ > -static daddr_t > -blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count) > -{ > - daddr_t i, memindex, next_skip, skip; > - > - memindex = 0; > - > - /* > - * Leaf node > - */ > - > - if (radix == BLIST_BMAP_RADIX) { > - if (scan) { > - scan->bm_bighint = 0; > - scan->u.bmu_bitmap = 0; > - } > - return (memindex); > - } > - > - /* > - * Meta node. If allocating the entire object we can special > - * case it. However, we need to figure out how much memory > - * is required to manage 'count' blocks, so we continue on anyway. > - */ > - > - if (scan) { > - scan->bm_bighint = 0; > - scan->u.bmu_avail = 0; > - } > - > - skip = radix_to_skip(radix); > - next_skip = skip / BLIST_META_RADIX; > - radix /= BLIST_META_RADIX; > - > - for (i = 1; i < skip; i += next_skip) { > - if (count >= radix) { > - /* > - * Allocate the entire object > - */ > - memindex = i + > - blst_radix_init(((scan) ? &scan[i] : NULL), radix, > - radix); > - count -= radix; > - } else if (count > 0) { > - /* > - * Allocate a partial object > - */ > - memindex = i + > - blst_radix_init(((scan) ? &scan[i] : NULL), radix, > - count); > - count = 0; > - } else { > - /* > - * Add terminator and break out. Make terminator bitma > p > - * zero to avoid a spanning leaf allocation that > - * includes the terminator. > - */ > - if (scan) { > - scan[i].bm_bighint = (daddr_t)-1; > - scan[i].u.bmu_bitmap = 0; > - } > - break; > - } > - } > - if (memindex < i) > - memindex = i; > - return (memindex); > } > > #ifdef BLIST_DEBUG > > Modified: head/sys/sys/blist.h > ============================================================================= > = > --- head/sys/sys/blist.h Sun Oct 8 21:20:25 2017 (r324419) > +++ head/sys/sys/blist.h Sun Oct 8 22:17:39 2017 (r324420) > @@ -82,7 +82,7 @@ typedef struct blist { > daddr_t bl_blocks; /* area of coverage */ > u_daddr_t bl_radix; /* coverage radix */ > daddr_t bl_cursor; /* next-fit search starts at */ > - blmeta_t *bl_root; /* root of radix tree */ > + blmeta_t bl_root[1]; /* root of radix tree */ > } *blist_t; > > #define BLIST_META_RADIX 16 > This commit is causing this: panic: freeing invalid range On my laptop (Core i3 chip): (kgdb) bt #0 doadump (textdump=1) at pcpu.h:232 #1 0xffffffff80583e16 in kern_reboot (howto=260) at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 #2 0xffffffff80584306 in vpanic (fmt=, ap=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 #3 0xffffffff80584123 in panic (fmt=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 #4 0xffffffff805b9133 in blst_meta_free (scan=0xfffffe00045c3128, freeBlk=, count=0, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:869 #5 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3048, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #6 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3038, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #7 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3028, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #8 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3018, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #9 0xffffffff808359af in swaponsomething (vp=, id=0xfffff8000cb97200, nblks=3145727, strategy=0xffffffff80835c60 , close=0xffffffff80835ee0 , dev=132, flags=1) at /opt/src/svn-current/sys/vm/swap_pager.c:2199 #10 0xffffffff8083392c in sys_swapon (td=, uap=) at /opt/src/svn-current/sys/vm/swap_pager.c:2 728 #11 0xffffffff80887a11 in amd64_syscall (td=0xfffff8000c659560, traced=0) at subr_syscall.c:132 #12 0xffffffff8086afcb in Xfast_syscall () at /opt/src/svn-current/sys/amd64/amd64/exception.S:419 #13 0x000000002c689aea in ?? () Previous frame inner to this frame (corrupt stack?) Current language: auto; currently minimal (kgdb) On my gateway machine (AMD 4600+): (kgdb) bt #0 doadump (textdump=) at pcpu.h:232 #1 0xffffffff80573e11 in kern_reboot (howto=260) at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 #2 0xffffffff805742e6 in vpanic (fmt=, ap=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 #3 0xffffffff80574103 in panic (fmt=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 #4 0xffffffff805a8b63 in blst_meta_free (scan=0xfffffe00021c9038, freeBlk=, count=0, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:869 #5 0xffffffff805a8b0f in blst_meta_free (scan=0xfffffe00021c9028, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #6 0xffffffff805a8b0f in blst_meta_free (scan=0xfffffe00021c9018, freeBlk=, count=, radix=) at /opt/src/svn-current/sys/kern/subr_blist.c:926 #7 0xffffffff8081becf in swaponsomething (vp=, id=0xfffff800124d1080, nblks=262144, strategy=0xffffffff8081c180 , close=0xffffffff8081c400 , dev=101, flags=1) at /opt/src/svn-current/sys/vm/swap_pager.c:2199 #8 0xffffffff80819e4c in sys_swapon (td=, uap=) at /opt/src/svn-current/sys/vm/swap_pager.c:2 728 #9 0xffffffff80869fb1 in amd64_syscall (td=0xfffff80012558000, traced=0) at subr_syscall.c:132 #10 0xffffffff8084dd4b in Xfast_syscall () at /opt/src/svn-current/sys/amd64/amd64/exception.S:419 #11 0x0000000800a89aea in ?? () Previous frame inner to this frame (corrupt stack?) Current language: auto; currently minimal (kgdb) In the case of my laptop, it panicked only once. My gateway machine downstairs was in a panic reboot loop, panicking during swapon. Reverting this diff resolves my issue. -- 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 Mon Oct 9 15:54:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5598E33FB5; Mon, 9 Oct 2017 15:54:59 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40D4B82A5C; Mon, 9 Oct 2017 15:54:59 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99Fswv0050430; Mon, 9 Oct 2017 15:54:58 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99Fsv8k050429; Mon, 9 Oct 2017 15:54:57 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201710091554.v99Fsv8k050429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 9 Oct 2017 15:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324435 - head/sys/contrib/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: gnn X-SVN-Commit-Paths: head/sys/contrib/dev/iwm X-SVN-Commit-Revision: 324435 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 15:55:00 -0000 Author: gnn Date: Mon Oct 9 15:54:57 2017 New Revision: 324435 URL: https://svnweb.freebsd.org/changeset/base/324435 Log: Add the firmware for the Intel 8265 WiFi device. MFC after: 1 month Added: head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu Added: head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu Mon Oct 9 15:54:57 2017 (r324435) @@ -0,0 +1,40270 @@ +begin 644 iwm-8265-22.fw +M`````$E73`IS=')E86TZ0V]R94-Y8VQE,3E?````"`````$`````````'@````@````"```` +MCWX#`!P````0`````````````````````````!L````$`````@```#,````, +M````````````@```@`$`,P````P````!``````"(``"````S````#`````(` +M`````$```(`&`!,```"\`@```$!```8```"A```````!``````"&@````P<6 +M(`#/`0!`````0`````$````$A`4````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````U7?1O$KMC1P!%L)AM`1@'DT[FA#1 +MOWMZR()DJ-L;GQEBIN9H[A^ZS%KH6MG.(:=CV\&$V<0:'I[5@L7;]O#+S6])Q;OTUZ` +M@Q9O#\ZQZUROU1XL3>@GIX0A'ZLQS3.]EM]`#)-:.@LH#44.K^C\7[\`!P3D +MY4F9W;8[]70ZRI8T>H?6RDCG3OM +M8]KY^9H/)$3]O$5[L'!Q8_7B]),MEL2SE/;3@!]'*Q0B!J +MSTEZ*8)Z!0@S6DLP1!FVOW/)J9&S#<5HT&$4S<7=^@(C/O$<4EJ.EO9XL_%E +MT>4]#<7,[9G60.1^$&L="\AYAH+6D>M<"8*SB6+Z(O@K2S"E-V&#A#J=*)YQ +M?A=_2W+\0QR``+XRI7=42EPB2)(!`2I!$9U:;0F'*M._3+OF[>!&+"-+#-'H +M\PZ#!\0+`..6,0`#S%^8W8&G25#,,I>V=BW:]"V:&%%;OYJG`P````<````( +M@`$```"```"``0`'````"``%``````````4`!P```%"Y````@$0`2+D``!,` +M```$@`$```"````````6````!(0%```!````````S-:``"0H@`!`_(``Q/.` +M`)04@`"`<($`````````````````````````````````;"#`$`\;"2+<'<`0 +M"@`;0"``&VX,``!A@``;;D```&$``1MN4P``80`"&VYC``!A``0;;GX``&$0 +M`!MN`0``88```&%[``!A```;)"``&R7D'<`12`GA&!\`"&(``!LE`0`;)``` +M!24!``4D``@%.0$`!6*((,`1`@`%)``(!3D!``5BC"#`$00`!20`"`4Y`0`% +M8I`@P!$(``4D``@%.0$`!6*4(,`1$``%)``(!3D!``5BF"#`$2``!20`"`4Y +M`0`%8IP@P!%```4D``@%.0$`!6*@(,`1```()0``""1(">$91`GA&10)P!(! +M`!MP"@``80\<'2($`!TF)`G`$@$;(R+H'<`0`0`C<`$``&$1`!LP`0`;,.@= +MP!&Z#P!A```;)(``&R7D'<`1"`!?<`D``&'0",`2``D;*,P(@($``,`7U`C` +M$@`)&RC("("!``#`%ZP/`&',",`2X`B`@0``P!?(",`2W`B`@0``P!>E#P!A +M```;)``!&R7D'<`1"`!?<*`/`&$```4EX@0%)-0(P!(`"1LH``4;*=P(@($` +M`,`7T`C`$@`)&R@`!1LIX`B`@0``P!>3#P!A```;)``"&R7D'<`1"`!?<`P` +M`&'L'\`0__\;,^P?P!'.[@TE@ID-)`\--R)L(,`0#QLW(O__#24._PTD#PTW +M(H(/`&'L'\`0```;,>P?P!'.[@TE@ID-)`\--R)L(,`0#QLW(O__#26._PTD +M#PTW(G8/`&$```!A```;)2``&R1<',`1````8=P=P!```!TD````(0$`6#'. +M[@TE`8$-)`\--R(/1#$7`$`$`$W`,``!A"`!8,-@>P!`*`!-``@`3;@0` +M`&$!``@D```()40)X1D!``!A`(!8,`@`9#$```!A"`!8;N,/`&$``!,E```3 +M)"00P!$`@!,D```3)3@!,B +M``#&$0,``20```$E#T4`(@!<`#GO_P`R%P``9`"`$R0!`!,E.!S`$0]W$R+@ +M',`1`@`!8@\!$R($",`1?`S`$LA)QQ&0"\`2`0`!;@,`$S`,`,T1"`!8,0\4 +M%2($`!4F`P`3)```$R4$",`1```3)#A%P!$%``!A``!8.`0`6#$``!,D`0`3 +M)3@P!`*`!-``@`3;@0``&$!``@D```()40)X1D$``!A`(!8 +M,`(``&$`(%@P````8>@=P!#F_Q,R__\3,^@=P!$```$D"``!)0\!8R(!`%(D +M"``';@(``&$``!4D#P``80X``&'H'<`0^^K=[OOJW>[[ZMWN^^K=[OOJW>[[ZMWN^^ +MK=[OOJW>[[ZMWN^^K=[OOJW>[[ZMWN^^K=X````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````-`'```` +M``````````$!`0$!`0$!O1\``&,N``#_____```````````````````````` +M```(```````````````````````````````````````````````!```````` +M`````````````0`````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````S,```$1`````````````` +M``HH```````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````$0`@````````````"0````H````+````#`````T````.``` +M`#P```!`````1````$@```!,````4````%0```!8````7````&````!D```` +M:````&P```!P````=````'@```!\````@````(0```"(````C````)````"5 +M````F0```)T```"A````I0```*D```"M````L0```"H````Z````2@```%H` +M``!J````>@```(H```";````JP````(````$````!@````,````+````$P`` +M`!L````C````*P```#,````Z````0@````$`````````!`````4````````` +M`````````````/\```#^`0```O\```/_``$`_P$``0(!`@+_`@#_`P(`_@0" +M``/_````````````````".@```H````$````&-J``````````````````!SH +M```*````!````!C:@``````````````````````````````````````````` +M````````````'@```!Z('HA:````5@```%:(5H@"`0``J@```*J(JHC^`0`` +MC`H``%2,5(RD'P````#_```!`/\```/_```&_P``"?\```K_`0#_`0$!`0$! +M``+_`0(#_P$!!O\!`0G_`0`*_P$`_@("`/\#`@($`P(`!?\"``C_`@,&_P(` +M"?\"`@/_`@`*_P(`_@0#`/\%`P('_P,`"?\#`P/_`P,&_P,`"O\#`/X&```` +M````````````:)@```H````$````&-J```````````````````"9```%```` +M!````!C:@````````````````````````````````````````````)S'`0"H +MR0$`",D!`'C)`0`DQ`$`',0!`!QB```D8```>&```"`[`0`````````````` +M``````````````````````````#_!P```/\```?_``$)"```"O\!`@```0,! +M_P$#`O\!`P/_`0$$_P$"!0`!`0O_`0(,_P$$!@8!`0?_`0`(_P$`"O\"`@#_ +M`@,!_P(#`O\"`P/_`@$$`0("!0`"`0L!`@(,`0($!@8"`@<``@`(`0(`"@$# +M`/\"`P,`_P,#`?\#`P+_`P,#!`,!!`4#`@4``P$+!0,"#`4#!`8&`P,'_P,` +M"`4#``H%`P#^`P0$`/\$!`'_!`0"_P0$`_\$!`3_!`0%_P0$"_\$!`S_!`0& +M!@0$!P8$``C_!``*_P````````````#_`````0,``@("``,``@``!?\```;_ +M```$_P``!P0```C_`0#_`0$!``,!`@$"`0("`@$`!/\!`0<$`0`(_P(#``8" +M`@(&`@`%_P(`!O\"``0'`@`'!P(`"`<#`P`&`P`!!0,"`@8#`07_`P`&_P,` +M!`<#``<'`P`(!P`````````````````0``#V#P``V`\``*8/``!A#P``"0\` +M`)T.```@#@``D0T``/$,``!!#```@@L``+0*``#9"0``\@@````(```#!P`` +M_@4``/$$``#>`P``QP(``*P!``".``````````````````````$````!```` +M```````````!`````0````$```````````````$``)S0@``>``$D/@(``0`$ +M``!(MH``!``!L/2```P``0``1,V```$``T#-@``!``.4%(```0`!*-"```$` +M`RS0@``!``/H/0(``@`$```@````(`````````!54@``1T4``$Q)``!.0P`` +M1$D``%-5``!:6@``6EH``%I:``!:6@``6EH``%I:``!:6@``6EH``%I:``!: +M6@`````````(!`P""@8.`0D%#0,+!P\!`````@````P```#P/P$````!```` +M`````````````!@_`P`%```"!````!C:@````````````/\````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````#`````````$YB$`#A +M@0$`3F(0````````````````````````````V0#8``$`)`"`!Q`*`0$"`1T` +M@0J""J$(,0N\!TP*````````)P`[`%L)ZPL`````I*H"`#,S`P````0`,E4% +M````"`"KJ@H````,`,W,#``````````````````````````````````!```` +M````````````````_P```````````````````-CW```%```"!````!C:@`#_ +M````````````````````````````````````!@`````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````"@%(``"/R``!@````````` +M````````````````_LJMJP`````````````````````@`@`````A`@`````B +M`@`````C`@`````D`@`````E`@`````&``````````````!8!`,`3`0#`'@$ +M`P"8!P,`3`4#`!`%`P"\!`,```@#`"@/@`"`]8``'@```"R21``!```````` +M`$J21``````````````````````````````````!```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````/!L!``4```($````&-J````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````@``````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````````#_ +M```!`_\```D!```*_P`#!`(```#_``#^`P$`_P0!`0D%`0$*!0$``?\!`P0" +M`0$"_P$!"/\!``#_`0#^!@(`_P<"`@D(`@(*"`("!PD"``'_`@$#_P(#!`H" +M`@+_`@``"P,#"0P#`PH,`P0%#0,#`@X#```/!`#_$`0$"1$$!`H1!`(&_P0" +M`A($!`C_!```_P0`_A,```````````````!<\P``"@````0````8VH`````` +M````````````9",```H````$````&-J``(Q[```(?```D"````!\``"0\@`` +M]/(``-SR``#D(```_"$``'0A``#$(```^"$``+P@``"P(```M"```+@@``"T +MWP``$.```.3?``#)VE````````'P#0_P``````````T/^@_P``!F0`!@8& +M``````#Z_?P`]/GY```````````"`````P````4``````-#_H/\``-#_H/\` +M`-#_H/\``-#_H/\A(2$A(2$A(2$A2$A(2$A(2$A(2%965E965E965E9Q<7%Q +M96!W='%Q2$A(2$A(2$A(2(!@@&"`8(!@@&`````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````H!`0$!`0``"`IQR;Z\```````` +M```````````````````````````````````````````````````````````` +M````````````````````_W\```````#_?P```````/]_````````_W\````` +M``#_?P```````/]_````````_W\```````#_?P```````/]_```````````` +M`/]__W]@'H``8!Z``&`>@````````````````````/]_``````$````````` +M````````````````6``H`%@`*``P``````#0_U@`*`!(`"@`2``H`#@`#``` +M`-#_2``H`%``(`!0`"``:`!(`"@`"`!0`"``4``P`%``,`!@`#@`*``(`%`` +M,`!(`"@`2``H`&@`.``H``0`2``H`%@`*`!8`"@`8``H`"@`(`!8`"@`2``H +M`$@`*`!@`"@`*``8`$@`*``````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````_LJMJP`````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````!``````D`$```"@`!`G``#H`P``Z`,``+":``!$F@`` +M0)H``)R:``#HRP(`.,P"`!S,`@!@RP(`F,L"`"S+`@`DS`(``0`````````` +M``````````````````````````-````4``````$```````"<)H`````````` +M``````````````````!$,`(`"@````0````8VH```````````````"`````` +M```````````````````````````````````````````````````````````` +M````````````````````````!````````````````````````````/@P`@`% +M````!````!C:@```````````````````````'#("``4```($````&-J````` +M`````````````#0S`@`%```"!````!C:@`#`48`````````````````````` +M``$``````````@``````````````````````````````9T4C`04````"`@(" +M`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(" +M`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(!`@("`@("`@$! +M`@("`@("`@("`@("`@("`@("`@("`O\````0`@`````````````````````` +M````````````.".!```````````````````````````````````````````` +M```````````!```````````````````````````````````````````````` +M```````````````)```````````````````````````````````````````` +M``````````````````````````````````````````````````#_________ +M_________________________________P`````````````````````````` +M``````T-#0T.#@X.#@\/#P\/$!`0$!$1$1$2$A(2$Q,3$Q04%!45%146%A87 +M%Q<8&!@9&1H:&AL;&QP<'1T='AX?'R`@(2$B(B,C)"0E)28F)R`` +M``K@``!&X```%^```!C@``!'X```*.```"G@```XX```.>````"(`0!B8F)B +M8F(```"<`0!G9V=G9V<```"0`0!D9&1D9&0``&9F9F9F9@`````````````` +M```````````````````````````````````````````````````````````` +M``#D;@``!0````0````8VH``U&X``-QN``",;P``V&X``.!N```````````` +M```````````````````````````````````````````````````````````` +M````````````````I``$``4````$````&-J````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````S!L`````R!L`````0!P` +M````3!P`````4!P`````5!P`````6!P`````7!P`````8!P`````9!P````` +M`````$0?`````(`?`````(0?`````(@?`````(P? +M`````)`?`````)0?`````)@?`````)P?`````*`?`````*0?`````*@?```` +M`*P?`````+`?`````.0?`````/`?`````/0?`````/P?`````$8````````` +M````````````````X!P`````Y!P`````Z!P`````]!P`````^!P`````#!T` +M````&!T`````+!T`````,!T`````G!T`````H!T`````,!X`````-!X````` +M.!X`````/!X`````3!X`````4!X`````5!X`````6!X`````7!X`````9!X` +M````>!X`````?!X`````A!X`````C!X`````D!X`````E!X`````F!X````` +MG!X`````H!X`````P!X`````Q!X`````T!X`````U!X``````!\`````X!X` +M````!!\`````W!X`````=!\`````>!\`````?!\`````^!\`````*@`````` +M``````````````,````?````````````````````$````$M+2TM+```````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````$````````````````````` +M`````````````````````````````````````````````````````````/\` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````/SP```````````````````,````````` +M_P``````````````````````````````````````````````__\````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````(```````````````````````````````````````````````````` +M`````/__________````````````````_(X```H````$````&-J````````` +M````.)0``.25``"(E```D),``!26``"HE0``Y),``$23`````0````$$`0$! +M``(!`0$#`0`"!P$!!`0!`04%`0(#_P(!`08"``('B!,````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````#_____```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````"````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````#_____```````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````"````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````#_____```` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````"````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````````#_ +M____```````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````"````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````#_____```````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````"````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````_P`````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````````"< +MZH``+.B``)SJ@`#H[X``C.N``%3J@`!X[X``5.J``"#K@`"`*$`I0"I`*T`L`"T`+@`NP"_`,,`Q@#*`,X` +MT0#5`-@`W`#?`.,`YP#J`.X`\0#U`/@`_`#_``(!!@$)`0T!$`$4`1 +M`2$!)`$H`2L!+@$R`34!.`$[`3\!0@%%`4@!3`%/`5(!50%9`5P!7P%B`64! +M:`%K`6\!<@%U`7@!>P%^`8$!A`&'`8H!C0&0`9,!E@&:`9T!GP&B`:4!J`&K +M`:X!L0&T`;(!Y0'H`>L! +M[0'P`?,!]@'X`?L!_@$!`@,"!@()`@P"#@(1`A0"%@(9`AP"'@(A`B0")@(I +M`BP"+@(Q`C0"-@(Y`CL"/@)!`D,"1@)(`DL"30)0`E,"50)8`EH"70)?`F(" +M9`)G`FD";`)N`G$"P)]`G\"@@*$`H<"B0*,`HX"D`*3`I4"F`*: +M`IP"GP*A`J,"I@*H`JL"K0*O`K("M`*V`KD"NP*]`L`"P@+$`L8"R0++`LT" +MT`+2`M0"U@+9`ML"W0+?`N("Y`+F`N@"Z@+M`N\"\0+S`O8"^`+Z`OP"_@(` +M`ZL````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````!DG0``!0````0````8VH`````` +M```%``!R`0``J`(```0)!`D!!@D,$0$````````````````````````````` +M````````````````````````````````_LJMJP`<``````0<``````@<```` +M``P<`````"@<`````$@<`````$P<`````%`<`````%`<`````'P<`````"@X +M``````!,``````1,``````A,``````Q,`````"!,`````"1,`````"A,```` +M`$!,`````$1,`````&!,`````(!,`````*!,`````,!,`````,1,`````,A, +M`````,Q,`````.!,``````!-`````&!-```````D`````,PF`````-PF```` +M`,0F`````"`D`````#0D`````)@E`````)PE`````*`E`````*0E`````*@E +M`````*PE`````,0E`````,@E`````-0E`````-@E`````-PE`````.`E```` +M`.0E`````.@E`````.PE`````/`E``````0G`````!@0`````"P0`````$`0 +M`````$P0`````(P-`````)0-`````)P-`````,!$`````,1$`````,A$```` +M`,Q$`````-!$`````-1$`````-A$`````.!$`````.1$`````.A$`````.Q$ +M`````/A$`````/Q$``````!%`````"1%`````"A%`````"Q%`````$1%```` +M`&`(``````@-`````!`-`````!0-```````-``````0-`````(@P`````%4` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````!.*(``3`B@`$@(H```````-`J````````````````` +M`'43+A/H$J,27Q(<$MD1F!%8$1@1VA"<$%\0(Q#H#ZX/=0\\#P4/S@Z8#F(. +M+@[Z#<<-E`UB#3(-`0W2#*,,=0Q'#!H,[@O""Y<+;0M#"QH+\0K)"J(*>PI5 +M"B\*"@KE"<$)G0EZ"5<)-0D3"?((T0BQ")$(<@A3"#4(%PCY!]P'OP>C!X<' +M:P=0!S4'&P0!W0'6`=`!R0'"`0`````#0``````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````+@`J`"`````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````#;$(Y(FY`""P`````` +M`#,``````````````````````$L#2P-+`TL#2P-+`TL#2P-+`TL#2P-+`TL# +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````*"@H*"@H*"@H*"@H*``H*"@H*"@H*"@H*"@H`"@H*"@H*"@H +M*``H*"@H*"@H*"@`````````````````````````*"@H*"@H*"@H*"@H*"@H +M*"@H*"@H*"@H*"@H*"@H*"@H*"@H*``H*"@H*"@H*"@H*"@H*"@H*"@````` +M```````````````````````````````````````````H*"@H&"@H*"@````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````H +M*"@H*"@H*"@H*"@H*```````````````````````````*"@H*"@H*"@H```` +M````````````````````````````````````````````````*"@H*"@H*"@H +M*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*``````````````````````` +M```H*"@H*"@H*"@H*"@H*"@H*"@`````````````*"@H*"@H*"@H`"@H*"@H +M*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@`*"@H*"@H*"@H`"@H +M*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@`*"@H*"@H*"@H +M*"@H*"@H*"@H*"@H*"@H*"@H```````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````!65```.`````````!:9```/@````````!JI```/@````````!: +MI```/@````````!:I```/@````````!:9```/@````````!:5```/@`````` +M``!:I```/@````````!:9```/@`````````*(```/@````````!:9```/@`` +M``````!:9```/@````````!:5```/@````````!:9````P````````!:I``` +M`P`````````*````,0`````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````#`P``````````````$````` +M`````0```#\0``````````````````````````````4`!0`````````````` +M``0(``$```4$`0`!!``$!0`````!``$``````!K0```3@```"$`$``$`!``:,````&`$``!@!```8`0``&`$` +M*A0``"A(```F>```!K0```3@```"$`$``$`!``:(````&`$`"E0(``B$```& +MM```!.````(0`0``0`$``!@!```8`0``&`$``!@!```8`0!C`````(`$`,8` +M``#&&`<`0$`5`&,!``#&`0``"C0```AH```&N```!.0```(4`0``0`$`!H@` +M```8`0``&`$``!@!```8`0``&`$`"C0```AH```&N```!.0```(4`0``0`$` +M!H@````8`0``&`$``!@!```8`0``&`$``!@!```8`0``&`$``!@!```8`0`` +M&`$``!@!```8`0!"`````````*4```"EE`(`0$`5`$(```"E````"CP```AL +M```&P```!/0```(D`0``4`$``8`!``%,`0`$P````!@!```8`0``&`$`"CP` +M``AL```&P```!/0```(D`0``4`$``8`!``%,`0`$P````!@!```8`0``&`$` +M`!@!```8`0``&`$``!@!```8`0``&`$``!@!```8`0`"``````````8````& +M&```0$`5``(````&````&@```!@8```62```%'@``!*P```&X```!!@!``), +M`0``@`$``!@!```8`0``&`$`&@```!@8```62```%'@``!*P```&X```!!@! +M``),`0``@`$`"'````:L```$V````@@!```X`0``&`$``!@!```8`0``&`$` +M`!@!```8`0"$``````````@!```((00`0$`5`(0````(`0``&@@``!@T```6 +M9```%)0``!+$```&"`$`!#@!``)D`0``E`$``!@!```8`0``&`$`&@@``!@T +M```69```%)0``!+$```&"`$`!#@!``)D`0``E`$``!@!```8`0``&`$``!@! +M```8`0``&`$``!@!```8`0``&`$``!@!```8`0"$``````````@!```((00` +M0$`5`(0````(`0`````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````!````(`````,```#I`.D` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````#/[__P$```#2V```TM@``"YG__\N9___$``` +M`-+8``#2V```+F?__RYG__\0````TM@``-+8```N9___+F?__Q````#2V``` +MTM@``"YG__\N9___$````-+8``#2V```+F?__RYG__\0````TM@``-+8```N +M9___+F?__Q````#2V```TM@``"YG__\N9___$````-+8``#2V```+F?__RYG +M__\0````TM@``-+8```N9___+F?__Q````#2V```TM@``"YG__\N9___$``` +M`-+8``#2V```+F?__RYG__\0````TM@``-+8```N9___+F?__Q`````````` +M````````````````````````````````````````````````F@````$````` +M`.0,```````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`/]__W__?_]__W\````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````4%!04("PL,#2$$A45%14E +M+2TQ-842%!04%!PD)"PTA!(5%145'24M-3F%$A45%14E)2TU/842$A(2$AHB +M(BHJ@A(:&AH:(BHN-CZ*`!H:&AHJ,C(Z0HH`&AH:(BHR.D)RB@`='1T=)2TQ +M.46-`!T='1TM-3D]28T`'1T='2TU/4%9C0`;&QL;)R\W/T>+`!D9&2$I,3D] +M38D`&AH:(BHZ0D9FB@`7%Q<7)S,W/T^'`!45%1TE-3U!384`#P\/%Q\G,SMC +M?P`0$!`0("0H,#R```\/#Q+`!D9 +M&2$I,3D]38D`&AH:(BHZ0D9FB@`7%Q<7)S,W/T^'`!45%1TE-3U!384`#P\/ +M%Q\G,SMC?P`0$!`0("0H,#R```\/#Q+`!D9&2$I,3D]38D`&AH:(BHZ0D9FB@`7%Q<7)S,W +M/T^'`!45%1TE-3U!384`#P\/%Q\G,SMC?P`0$!`0("0H,#R```\/#Q#"!,3$Q,C*R\S/X,(%!04%!PD)"PT +MA`@3$Q,3&R,K*S.#"!(2$A(B(BHN,H(($!`0$!@@*"@P@`@8&!@8*"@P-$"( +M`!<7%Q\G,S#"!,3$Q,C*R\S/X,(%!04 +M%!PD)"PTA`@3$Q,3&R,K*S.#"!(2$A(B(BHN,H(($!`0$!@@*"@P@`@8&!@8 +M*"@P-$"(`!<7%Q\G,SV``3$Q,3'RLO +M,S>#"!,3$Q,C*R\S/X,(%!04%!PD)"PTA`@3$Q,3&R,K*S.#"!(2$A(B(BHN +M,H(($!`0$!@@*"@P@`@8&!@8*"@P-$"(`!<7%Q\G,S`"@H +M*"@R/$1,5&``*"@H*#`X0$948``H*"@H,#A`1E1@`!`0$!`4("@H,#`-$!`0 +M$!0@*"@P.`TH*"@H+CA"2$Y8`"@H*"@R/$1,4EX`*"@H*#(\1$Q48``H*"@H +M,#A`1E1@`"@H*"@P.$!&5&``_W__?_]__W__?_]__W__?_]__W\````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````#H`>@! +MN`6X!8@)B`E8#5@-*!$H$?@4^!3(&,@8F!R8'&@@:"`X)#@D""@(*-@KV"NH +M+Z@O>#-X,T@W2#<8.Q@[Z#[H/KA"N$*(1HA&6$I82BA.*$[X4?A1R%7(59A9 +MF%EH76A=.&$X80AE"&78:-AHJ&RH;'AP>'!(=$AT&'@8>.A[Z'NX?[A_B(.( +M@UB'6(.)X(H@BBV*78I:BIJ*EXK7BM +M2+%(L1BU&+7HN.BXN+RXO(C`B,!8Q%C$*,@HR/C+^,O(S\C/F-.8TVC7:-.IXZDCN2.X8\ACRZ/7H];CYN/F(_8C]_O_^__[_ +M_O_^__[__O_^__[__O_^__[__O_^__[__O_^__[__O_^__[__O_^__[__O_^ +M__[__O_^__[__O_^__[__O^@NPT`X"("```````````!``$````!``$````! +M``$````!``$````!``$````!``$````!`````0````$````!`````0````$` +M```!``$````!``$````!``$````!``$````!``$````!``$````!`````0`` +M``$````!`````0````$````!``$````!``$````!``$````!``$````!``$` +M```!``$````!`````0````$````!`````0````$````!``$````!``$````! +M``$````!``$````!``$````!``$````!`````0````$````!`````0````$` +M```!``$````!``$````!``$````!``$````!``$````!``$````!`````0`` +M``$````!`````0````$````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````'=W`P,-#08& +M`P,-#08&`P,-#08&`P,-#08&`P,-#08&`P,-#0`````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````F%D0!)@9BJ(````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Oct 9 16:02:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B127BE34695; Mon, 9 Oct 2017 16:02:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55ADCCA9; Mon, 9 Oct 2017 16:02:16 +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 v99G2FCk054732; Mon, 9 Oct 2017 16:02:15 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99G2FEG054731; Mon, 9 Oct 2017 16:02:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710091602.v99G2FEG054731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 9 Oct 2017 16:02:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324436 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324436 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:02:17 -0000 Author: eadler Date: Mon Oct 9 16:02:15 2017 New Revision: 324436 URL: https://svnweb.freebsd.org/changeset/base/324436 Log: See r198948 Modified: head/share/misc/iso3166 Modified: head/share/misc/iso3166 ============================================================================== --- head/share/misc/iso3166 Mon Oct 9 15:54:57 2017 (r324435) +++ head/share/misc/iso3166 Mon Oct 9 16:02:15 2017 (r324436) @@ -236,7 +236,7 @@ SZ SWZ 748 Swaziland SE SWE 752 Sweden CH CHE 756 Switzerland SY SYR 760 Syrian Arab Republic -TW TWN 158 Taiwan, Province of China +TW TWN 158 Taiwan TJ TJK 762 Tajikistan TZ TZA 834 Tanzania United Republic of TH THA 764 Thailand From owner-svn-src-head@freebsd.org Mon Oct 9 16:03:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E61DE3476A for ; Mon, 9 Oct 2017 16:03:17 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-qt0-x232.google.com (mail-qt0-x232.google.com [IPv6:2607:f8b0:400d:c0d::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 E8285FDE for ; Mon, 9 Oct 2017 16:03:16 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-qt0-x232.google.com with SMTP id a43so38092971qta.0 for ; Mon, 09 Oct 2017 09:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zw8TCjYNbUSay8zytfFfCKaNt8a8F0uFGGIJfwbkUIo=; b=hbw7VRcM+6P6vsIR8mXxmlIAmY4C26jNOgjgz2sSE1JR16ObT9T0wd3cSmFzzMatLZ v1eMio+CylzhbxJCvSBW479livqxIisHkRaTIF8fwLJZVP9exkDRQL9N6mBtrWwSMYQT 5ELCV8VHgT5mouLSeelt9JBTCJmr1wFKKfkQo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zw8TCjYNbUSay8zytfFfCKaNt8a8F0uFGGIJfwbkUIo=; b=PCRWnLBh8rrKjOz5gB20Lv7rK0gYabVSP1mSMQcl7ZTVb7UTnz9mggjs0dnjIxpV07 AGFsRI4CgQ2xjWgkHiSUQWHsZxHQw5Y0w42DJxPu7jvPLrrar0iwOP7SlhbXIHIzFsQJ lIsu1MZhCyVidjg0goiw0igMXYwnj5IB/n8YNafbNU2llY5MvTixUlv5qsltDXmrM5xK 09cN9DID9Z3Cuemthv5NpQZNWCZQdVSIYAMRii1bRSJK4ozT1ZXd703w7Y4Td5SOnXj/ 1k8pTdRRd0WqibRygnQX5AfYJBrpj55P2JKZIhpjOT/IvGWoxcBL0szKD83kNEBBzUlm Z3jA== 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=zw8TCjYNbUSay8zytfFfCKaNt8a8F0uFGGIJfwbkUIo=; b=ptObjycqSp6nfpoyiQtvNPgPqQfia/H1pAUhwYxM6DJye9yTJ9QtGH6Mgv0yRXT7Vq RlSsGi8E/RlCNE1Skiv06JjmFHatMO4ZGd+nIg1ivIUi6thH3SlrtcXyk25wUolWwYRp VycICF1V5EoPfMhtxhwpe44OwB3ZK0iO+JcDM2wLTE6cNnd8/b5dgsUpfXlTiljwvGtR cKlmPk/cfi5SoZbHG2xyW3BxvxZaS5eopngRBLpxHNIgvwOEqDpbzzKTf4McS9rAWMha /Di7jdxSvV+W88xTHLjpVojQJs+YuswbCdxOER53thA4G0Fs5zpDbkcYEkBKQj3Y7/5L quYg== X-Gm-Message-State: AMCzsaXjq+udplMiD3INbYey5iNjZy4ZMHx+zxftSDFxr5sEp9eJZQQY 9KGdtK6isA7ItlrggKeXvSyMD8jyg7PYldPivWkjHw== X-Google-Smtp-Source: AOwi7QCI5JDJ79qgD2j+uHfF+AztDbEXQdybEo4oXm+fTffkcqY+D8NVSE23XFYlJf2+MsF64OrrZFR1D7yxT5cx15Y= X-Received: by 10.37.202.6 with SMTP id a6mr23702ybg.174.1507564995986; Mon, 09 Oct 2017 09:03:15 -0700 (PDT) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.37.44.68 with HTTP; Mon, 9 Oct 2017 09:02:45 -0700 (PDT) In-Reply-To: <20171009144728.GA93977@freefall.freebsd.org> References: <201710090501.v9951qcF079521@repo.freebsd.org> <20171009144728.GA93977@freefall.freebsd.org> From: Eitan Adler Date: Mon, 9 Oct 2017 09:02:45 -0700 X-Google-Sender-Auth: 88KquANzWAEBm3jQy3LsZ8h47Xo Message-ID: Subject: Re: svn commit: r324423 - head/share/misc To: Li-Wen Hsu Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:03:17 -0000 On 9 October 2017 at 07:47, Li-Wen Hsu wrote: > Hi Eitan, > > Plase revert this line, "Taiwan" is how we call ourself. Done in r324436. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Mon Oct 9 16:07:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17206E34A73; Mon, 9 Oct 2017 16:07:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FA86206F; Mon, 9 Oct 2017 16:07:28 +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 v99G7R51054973; Mon, 9 Oct 2017 16:07:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99G7Rhl054971; Mon, 9 Oct 2017 16:07:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091607.v99G7Rhl054971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 16:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324437 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324437 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:07:29 -0000 Author: kib Date: Mon Oct 9 16:07:27 2017 New Revision: 324437 URL: https://svnweb.freebsd.org/changeset/base/324437 Log: Improvements to set_user_ldt(). Remove mtx_owned() checks from set_user_ldt(). Split the function into _locked() version which requires the dt_lock spinlock owned, and make set_user_ldt() a wrapper. Add a comment in swtch.s noting that the call to the new set_user_ldt() cannot recurse on dt_lock. Remove #ifdef SMP block, the addend is always zero on UP. Fix type of set_user_ldt_rv(), making it match the type used for smb_rendezvous() callback, and remove the cast. Use curproc. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/swtch.s head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/swtch.s ============================================================================== --- head/sys/i386/i386/swtch.s Mon Oct 9 16:02:15 2017 (r324436) +++ head/sys/i386/i386/swtch.s Mon Oct 9 16:07:27 2017 (r324437) @@ -279,6 +279,10 @@ sw1: pushl %edx /* Preserve pointer to pcb. */ addl $P_MD,%eax /* Pointer to mdproc is arg. */ pushl %eax + /* + * Holding dt_lock prevents context switches, so dt_lock cannot + * be held now and set_user_ldt() will not deadlock acquiring it. + */ call set_user_ldt addl $4,%esp popl %edx Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Oct 9 16:02:15 2017 (r324436) +++ head/sys/i386/i386/sys_machdep.c Mon Oct 9 16:07:27 2017 (r324437) @@ -69,10 +69,10 @@ __FBSDID("$FreeBSD$"); #define NULL_LDT_BASE ((caddr_t)NULL) #ifdef SMP -static void set_user_ldt_rv(struct vmspace *vmsp); +static void set_user_ldt_rv(void *arg); #endif static int i386_set_ldt_data(struct thread *, int start, int num, - union descriptor *descs); + union descriptor *descs); static int i386_ldt_grow(struct thread *td, int len); void @@ -405,41 +405,40 @@ done: * Update the GDT entry pointing to the LDT to point to the LDT of the * current process. Manage dt_lock holding/unholding autonomously. */ -void -set_user_ldt(struct mdproc *mdp) +static void +set_user_ldt_locked(struct mdproc *mdp) { struct proc_ldt *pldt; - int dtlocked; + int gdt_idx; - dtlocked = 0; - if (!mtx_owned(&dt_lock)) { - mtx_lock_spin(&dt_lock); - dtlocked = 1; - } + mtx_assert(&dt_lock, MA_OWNED); pldt = mdp->md_ldt; -#ifdef SMP - gdt[PCPU_GET(cpuid) * NGDT + GUSERLDT_SEL].sd = pldt->ldt_sd; -#else - gdt[GUSERLDT_SEL].sd = pldt->ldt_sd; -#endif + gdt_idx = GUSERLDT_SEL; + gdt_idx += PCPU_GET(cpuid) * NGDT; /* always 0 on UP */ + gdt[gdt_idx].sd = pldt->ldt_sd; lldt(GSEL(GUSERLDT_SEL, SEL_KPL)); PCPU_SET(currentldt, GSEL(GUSERLDT_SEL, SEL_KPL)); - if (dtlocked) - mtx_unlock_spin(&dt_lock); } +void +set_user_ldt(struct mdproc *mdp) +{ + + mtx_lock_spin(&dt_lock); + set_user_ldt_locked(mdp); + mtx_unlock_spin(&dt_lock); +} + #ifdef SMP static void -set_user_ldt_rv(struct vmspace *vmsp) +set_user_ldt_rv(void *arg) { - struct thread *td; + struct proc *p; - td = curthread; - if (vmsp != td->td_proc->p_vmspace) - return; - - set_user_ldt(&td->td_proc->p_md); + p = curproc; + if (arg == p->p_vmspace) + set_user_ldt(&p->p_md); } #endif @@ -796,10 +795,10 @@ i386_ldt_grow(struct thread *td, int len) * to acquire it. */ mtx_unlock_spin(&dt_lock); - smp_rendezvous(NULL, (void (*)(void *))set_user_ldt_rv, - NULL, td->td_proc->p_vmspace); + smp_rendezvous(NULL, set_user_ldt_rv, NULL, + td->td_proc->p_vmspace); #else - set_user_ldt(&td->td_proc->p_md); + set_user_ldt_locked(&td->td_proc->p_md); mtx_unlock_spin(&dt_lock); #endif if (old_ldt_base != NULL_LDT_BASE) { From owner-svn-src-head@freebsd.org Mon Oct 9 16:19:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FD8EE35320; Mon, 9 Oct 2017 16:19:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6CE0645EE; Mon, 9 Oct 2017 16:19:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99GJQEB059504; Mon, 9 Oct 2017 16:19:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99GJQPs059503; Mon, 9 Oct 2017 16:19:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091619.v99GJQPs059503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 16:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324438 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 324438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:19:28 -0000 Author: kib Date: Mon Oct 9 16:19:26 2017 New Revision: 324438 URL: https://svnweb.freebsd.org/changeset/base/324438 Log: Change i386_get_ldt() to return 'EOF' when the requested range of descriptors does not fit into currently allocated LDT, or trim the return if the range fits partially. Before, the function returned EINVAL. Fix two bugs in r324366: use capped num counter for malloc size, and do not leak allocated buffer on EINVAL (by handling EINVAL case as normal, see above). Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Oct 9 16:07:27 2017 (r324437) +++ head/sys/i386/i386/sys_machdep.c Mon Oct 9 16:19:26 2017 (r324438) @@ -534,23 +534,20 @@ i386_get_ldt(struct thread *td, struct i386_ldt_args * uap->start, uap->num, (void *)uap->descs); #endif - if (uap->start >= MAX_LD) - return (EINVAL); - num = min(uap->num, MAX_LD - uap->start); - data = malloc(uap->num * sizeof(union descriptor), M_TEMP, M_WAITOK); + num = min(uap->num, MAX_LD); + data = malloc(num * sizeof(union descriptor), M_TEMP, M_WAITOK); mtx_lock_spin(&dt_lock); pldt = td->td_proc->p_md.md_ldt; nldt = pldt != NULL ? pldt->ldt_len : nitems(ldt); - num = min(num, nldt); - if (uap->start > nldt || uap->start + num > nldt) { - mtx_unlock_spin(&dt_lock); - return (EINVAL); + if (uap->start >= nldt) { + num = 0; + } else { + num = min(num, nldt - uap->start); + bcopy(pldt != NULL ? + &((union descriptor *)(pldt->ldt_base))[uap->start] : + &ldt[uap->start], data, num * sizeof(union descriptor)); } - bcopy(pldt != NULL ? - &((union descriptor *)(pldt->ldt_base))[uap->start] : - &ldt[uap->start], data, num * sizeof(union descriptor)); mtx_unlock_spin(&dt_lock); - error = copyout(data, uap->descs, num * sizeof(union descriptor)); if (error == 0) td->td_retval[0] = num; From owner-svn-src-head@freebsd.org Mon Oct 9 16:20:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4321E353C2; Mon, 9 Oct 2017 16:20:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B1CD64A32; Mon, 9 Oct 2017 16:20:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99GKdoC059610; Mon, 9 Oct 2017 16:20:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99GKdVI059609; Mon, 9 Oct 2017 16:20:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710091620.v99GKdVI059609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 9 Oct 2017 16:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324439 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 324439 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:20:40 -0000 Author: kib Date: Mon Oct 9 16:20:39 2017 New Revision: 324439 URL: https://svnweb.freebsd.org/changeset/base/324439 Log: Change amd64_get_ldt() to return 'EOF' when the LDT is not yet allocated, when requested range of descriptors does not fit into currently allocated LDT, or trim the return if the range fits partially. Before, the function returned EINVAL. Reviewed by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Mon Oct 9 16:19:26 2017 (r324438) +++ head/sys/amd64/amd64/sys_machdep.c Mon Oct 9 16:20:39 2017 (r324439) @@ -556,12 +556,12 @@ amd64_get_ldt(struct thread *td, struct i386_ldt_args uap->start, uap->num, (void *)uap->descs); #endif - if (uap->start >= max_ldt_segment) - return (EINVAL); - num = min(uap->num, max_ldt_segment - uap->start); pldt = td->td_proc->p_md.md_ldt; - if (pldt == NULL) - return (EINVAL); + if (pldt == NULL || uap->start >= max_ldt_segment || uap->num == 0) { + td->td_retval[0] = 0; + return (0); + } + num = min(uap->num, max_ldt_segment - uap->start); lp = &((struct user_segment_descriptor *)(pldt->ldt_base))[uap->start]; data = malloc(num * sizeof(struct user_segment_descriptor), M_TEMP, M_WAITOK); From owner-svn-src-head@freebsd.org Mon Oct 9 16:33:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 985F3E359F0; Mon, 9 Oct 2017 16:33:38 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C5B6679BD; Mon, 9 Oct 2017 16:33:38 +0000 (UTC) (envelope-from ygy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99GXbaX067582; Mon, 9 Oct 2017 16:33:37 GMT (envelope-from ygy@FreeBSD.org) Received: (from ygy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99GXbmK067581; Mon, 9 Oct 2017 16:33:37 GMT (envelope-from ygy@FreeBSD.org) Message-Id: <201710091633.v99GXbmK067581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ygy set sender to ygy@FreeBSD.org using -f From: Guangyuan Yang Date: Mon, 9 Oct 2017 16:33:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324441 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: ygy X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 324441 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 16:33:38 -0000 Author: ygy (doc committer) Date: Mon Oct 9 16:33:37 2017 New Revision: 324441 URL: https://svnweb.freebsd.org/changeset/base/324441 Log: Fix freebsd-update(8) erroneous message and exit status when "fetch install" used. PR: 190660 Reviewed by: allanjude Approved by: emaste Differential Revision: https://reviews.freebsd.org/D12037 Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Oct 9 16:27:31 2017 (r324440) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Oct 9 16:33:37 2017 (r324441) @@ -418,6 +418,9 @@ init_params () { # Run without a TTY NOTTYOK=0 + + # Fetched first in a chain of commands + ISFETCHED=0 } # Parse the command line @@ -783,8 +786,10 @@ install_check_params () { # Check that we have updates ready to install if ! [ -L ${BDHASH}-install ]; then echo "No updates are available to install." - echo "Run '$0 fetch' first." - exit 1 + if [ $ISFETCHED -eq 0 ]; then + echo "Run '$0 fetch' first." + fi + exit 0 fi if ! [ -f ${BDHASH}-install/INDEX-OLD ] || ! [ -f ${BDHASH}-install/INDEX-NEW ]; then @@ -3241,6 +3246,7 @@ cmd_fetch () { fi fetch_check_params fetch_run || exit 1 + ISFETCHED=1 } # Cron command. Make sure the parameters are sensible; wait From owner-svn-src-head@freebsd.org Mon Oct 9 17:12:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAFE4E36CF8; Mon, 9 Oct 2017 17:12:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3738E71013; Mon, 9 Oct 2017 17:12:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99HC3Uk084358; Mon, 9 Oct 2017 17:12:03 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99HC2hj084355; Mon, 9 Oct 2017 17:12:02 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710091712.v99HC2hj084355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 9 Oct 2017 17:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324442 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 324442 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 17:12:05 -0000 Author: gjb Date: Mon Oct 9 17:12:02 2017 New Revision: 324442 URL: https://svnweb.freebsd.org/changeset/base/324442 Log: Switch BEAGLEBONE, CUBIEBOARD, and PANDABOARD to use the GENERIC kernel configuration. Submitted by: andrew Differential Revision: https://reviews.freebsd.org/D12484 Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BEAGLEBONE.conf head/release/arm/CUBIEBOARD.conf head/release/arm/PANDABOARD.conf Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Mon Oct 9 16:33:37 2017 (r324441) +++ head/release/arm/BEAGLEBONE.conf Mon Oct 9 17:12:02 2017 (r324442) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-beaglebone" -KERNEL="BEAGLEBONE" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" IMAGE_SIZE="2560M" PART_SCHEME="MBR" @@ -15,6 +15,7 @@ FAT_SIZE="2m" FAT_TYPE="12" MD_ARGS="-x 63 -y 255" NODOC=1 +export BOARDNAME="BEAGLEBONE" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-beaglebone" Modified: head/release/arm/CUBIEBOARD.conf ============================================================================== --- head/release/arm/CUBIEBOARD.conf Mon Oct 9 16:33:37 2017 (r324441) +++ head/release/arm/CUBIEBOARD.conf Mon Oct 9 17:12:02 2017 (r324442) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubieboard" -KERNEL="ALLWINNER_UP" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" IMAGE_SIZE="2560M" PART_SCHEME="MBR" @@ -15,6 +15,7 @@ FAT_SIZE="32m -b 1m" FAT_TYPE="16" MD_ARGS="-x 63 -y 255" NODOC=1 +export BOARDNAME="CUBIEBOARD" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-cubieboard" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Mon Oct 9 16:33:37 2017 (r324441) +++ head/release/arm/PANDABOARD.conf Mon Oct 9 17:12:02 2017 (r324442) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-pandaboard" -KERNEL="PANDABOARD" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" IMAGE_SIZE="2560M" PART_SCHEME="MBR" @@ -15,6 +15,7 @@ FAT_SIZE="2m" FAT_TYPE="12" MD_ARGS="-x 63 -y 255" NODOC=1 +export BOARDNAME="PANDABOARD" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-pandaboard" From owner-svn-src-head@freebsd.org Mon Oct 9 17:16:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22671E36F1F; Mon, 9 Oct 2017 17:16:26 +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 A93C571ECB; Mon, 9 Oct 2017 17:16:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8BED410A8BA; Mon, 9 Oct 2017 13:16:24 -0400 (EDT) From: John Baldwin To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324415 - in head/sys: kern sys Date: Mon, 09 Oct 2017 09:47:20 -0700 Message-ID: <1856969.ba1KYHj0O9@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <1507485390.86205.323.camel@freebsd.org> References: <201710081733.v98HXnu1094645@repo.freebsd.org> <1507485390.86205.323.camel@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, 09 Oct 2017 13:16:24 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 17:16:26 -0000 On Sunday, October 08, 2017 11:56:30 AM Ian Lepore wrote: > On Sun, 2017-10-08 at 17:33 +0000, Ian Lepore wrote: > > Author: ian > > Date: Sun Oct 8 17:33:49 2017 > > New Revision: 324415 > > URL: https://svnweb.freebsd.org/changeset/base/324415 > > > > Log: > > Add eventhandler notifications for newbus device attach/detach. > > > > [...] > > > > A couple salient comments from the review, they amount to some helpful > > documentation about these events, but there's currently no good place for > > such documentation... > > About this last point... sys/eventhandler.h is now an ever-growing list > of EVENTHANDLER_DECLARE() statements for events that are unrelated to > each other. I think we are at the point where it's no longer a few > well-known "standard system event queues", it's turning into a mess. > > My first thought was to add these to bus.h because they're bus events. > But you have to include eventhandler.h to use EVENTHANDLER_DECLARE, > and I didn't want to pull it (and its dependencies) into bus.h. I think we should fix the headers so that we can declare these in bus.h. It might consist of moving some bits of eventhandler.h into _eventhandler.h. All you would need for _eventhandler.h is struct eventhandler_entry and EVENTHANDLER_DECLARE() I think. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Oct 9 18:00:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC212E37D3C; Mon, 9 Oct 2017 18:00:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A590D74AA9; Mon, 9 Oct 2017 18:00:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99I0e2N001665; Mon, 9 Oct 2017 18:00:40 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99I0evm001664; Mon, 9 Oct 2017 18:00:40 GMT (envelope-from np@FreeBSD.org) Message-Id: <201710091800.v99I0evm001664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 9 Oct 2017 18:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324443 - head/usr.sbin/cxgbetool X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/usr.sbin/cxgbetool X-SVN-Commit-Revision: 324443 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 18:00:42 -0000 Author: np Date: Mon Oct 9 18:00:40 2017 New Revision: 324443 URL: https://svnweb.freebsd.org/changeset/base/324443 Log: cxgbetool(8): Do not close uninitialized fd on malloc failure. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/usr.sbin/cxgbetool/cxgbetool.c Modified: head/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- head/usr.sbin/cxgbetool/cxgbetool.c Mon Oct 9 17:12:02 2017 (r324442) +++ head/usr.sbin/cxgbetool/cxgbetool.c Mon Oct 9 18:00:40 2017 (r324443) @@ -1901,7 +1901,6 @@ dumpstate(int argc, const char *argv[]) dump.len = 8 * 1024 * 1024; dump.data = malloc(dump.len); if (dump.data == NULL) { - close(fd); return (ENOMEM); } From owner-svn-src-head@freebsd.org Mon Oct 9 18:19:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E9B0E382A5; Mon, 9 Oct 2017 18:19:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E32C752BA; Mon, 9 Oct 2017 18:19:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99IJ6F8009918; Mon, 9 Oct 2017 18:19:06 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99IJ6oB009917; Mon, 9 Oct 2017 18:19:06 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710091819.v99IJ6oB009917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 9 Oct 2017 18:19:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324444 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324444 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 18:19:07 -0000 Author: alc Date: Mon Oct 9 18:19:06 2017 New Revision: 324444 URL: https://svnweb.freebsd.org/changeset/base/324444 Log: The recent change to initialization of blists (r324420) relied on '-1' appearing only where the code explicitly set it, but since much of the data was not initialized, '-1' appeared other places too, and led to panics. Clear the allocated data before initializing nonzero values by allocating with M_ZERO. Submitted by: Doug Moore Reported by: Oleg V. Nauman , cy Tested by: Oleg V. Nauman MFC after: 1 week X-MFC with: r324420 Differential Revision: https://reviews.freebsd.org/D12627 Modified: head/sys/kern/subr_blist.c Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Mon Oct 9 18:00:40 2017 (r324443) +++ head/sys/kern/subr_blist.c Mon Oct 9 18:19:06 2017 (r324444) @@ -248,7 +248,8 @@ blist_create(daddr_t blocks, int flags) nodes += last_block + 1; last_block /= BLIST_META_RADIX; } - bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags); + bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags | + M_ZERO); if (bl == NULL) return (NULL); From owner-svn-src-head@freebsd.org Mon Oct 9 18:22:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6437E384C2; Mon, 9 Oct 2017 18:22:20 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BC0A756D6; Mon, 9 Oct 2017 18:22:19 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.16.0.17/8.16.0.17) with SMTP id v99CcA8l006667; Mon, 9 Oct 2017 13:22:12 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 2desyj8kjc-1; Mon, 09 Oct 2017 13:22:12 -0500 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 2BF13460E19; Mon, 9 Oct 2017 13:22:12 -0500 (CDT) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 2A5F1460DE8; Mon, 9 Oct 2017 13:22:12 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id qezoSXrTPQVH; Mon, 9 Oct 2017 13:22:12 -0500 (CDT) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id B84AA460DE3; Mon, 9 Oct 2017 13:22:11 -0500 (CDT) Subject: Re: svn commit: r324420 - in head/sys: kern sys To: Cy Schubert , Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710091554.v99FsAjK002950@slippy.cwsent.com> From: Alan Cox Message-ID: Date: Mon, 9 Oct 2017 13:22:09 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <201710091554.v99FsAjK002950@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=10 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611190142 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 09 Oct 2017 18:22:20 -0000 On 10/09/2017 10:54, Cy Schubert wrote: > In message <201710082217.v98MHdNI012272@repo.freebsd.org>, Alan Cox writes: >> Author: alc >> Date: Sun Oct 8 22:17:39 2017 >> New Revision: 324420 >> URL: https://svnweb.freebsd.org/changeset/base/324420 >> >> Log: >> The blst_radix_init function has two purposes - to compute the number of >> nodes to allocate for the blist, and to initialize them. The computation >> can be done much more quickly by identifying the terminating node, if any, >> at every level of the tree and then summing the number of nodes at each >> level that precedes the topmost terminator. The initialization can also be >> done quickly, since settings at the root mark the tree as all-allocated, an >> d >> only a few terminator nodes need to be marked in the rest of the tree. >> Eliminate blst_radix_init, and perform its two functions more simply in >> blist_create. >> >> The allocation of the blist takes places in two pieces, but there's no good >> reason to do so, when a single allocation is sufficient, and simpler. >> Allocate the blist struct, and the array of nodes associated with it, with >> a >> single allocation. >> >> Submitted by: Doug Moore >> Reviewed by: markj (an earlier version) >> MFC after: 1 week >> Differential Revision: https://reviews.freebsd.org/D11968 >> >> Modified: >> head/sys/kern/subr_blist.c >> head/sys/sys/blist.h >> >> Modified: head/sys/kern/subr_blist.c >> ============================================================================= >> = >> --- head/sys/kern/subr_blist.c Sun Oct 8 21:20:25 2017 (r32441 >> 9) >> +++ head/sys/kern/subr_blist.c Sun Oct 8 22:17:39 2017 (r32442 >> 0) >> @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -137,7 +138,6 @@ static void blst_copy(blmeta_t *scan, daddr_t blk, dad >> static daddr_t blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count); >> static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t coun >> t, >> u_daddr_t radix); >> -static daddr_t blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t >> count); >> #ifndef _KERNEL >> static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, >> int tab); >> @@ -218,30 +218,69 @@ blist_t >> blist_create(daddr_t blocks, int flags) >> { >> blist_t bl; >> - daddr_t nodes, radix; >> + daddr_t i, last_block; >> + u_daddr_t nodes, radix, skip; >> + int digit; >> >> /* >> - * Calculate the radix field used for scanning. >> + * Calculate the radix and node count used for scanning. Find the last >> + * block that is followed by a terminator. >> */ >> + last_block = blocks - 1; >> radix = BLIST_BMAP_RADIX; >> while (radix < blocks) { >> + if (((last_block / radix + 1) & BLIST_META_MASK) != 0) >> + /* >> + * A terminator will be added. Update last_block to th >> e >> + * position just before that terminator. >> + */ >> + last_block |= radix - 1; >> radix *= BLIST_META_RADIX; >> } >> - nodes = 1 + blst_radix_init(NULL, radix, blocks); >> >> - bl = malloc(sizeof(struct blist), M_SWAP, flags); >> + /* >> + * Count the meta-nodes in the expanded tree, including the final >> + * terminator, from the bottom level up to the root. >> + */ >> + nodes = (last_block >= blocks) ? 2 : 1; >> + last_block /= BLIST_BMAP_RADIX; >> + while (last_block > 0) { >> + nodes += last_block + 1; >> + last_block /= BLIST_META_RADIX; >> + } >> + bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags); >> if (bl == NULL) >> return (NULL); >> >> bl->bl_blocks = blocks; >> bl->bl_radix = radix; >> bl->bl_cursor = 0; >> - bl->bl_root = malloc(nodes * sizeof(blmeta_t), M_SWAP, flags); >> - if (bl->bl_root == NULL) { >> - free(bl, M_SWAP); >> - return (NULL); >> + >> + /* >> + * Initialize the empty tree by filling in root values, then initialize >> + * just the terminators in the rest of the tree. >> + */ >> + bl->bl_root[0].bm_bighint = 0; >> + if (radix == BLIST_BMAP_RADIX) >> + bl->bl_root[0].u.bmu_bitmap = 0; >> + else >> + bl->bl_root[0].u.bmu_avail = 0; >> + last_block = blocks - 1; >> + i = 0; >> + while (radix > BLIST_BMAP_RADIX) { >> + radix /= BLIST_META_RADIX; >> + skip = radix_to_skip(radix); >> + digit = last_block / radix; >> + i += 1 + digit * skip; >> + if (digit != BLIST_META_MASK) { >> + /* >> + * Add a terminator. >> + */ >> + bl->bl_root[i + skip].bm_bighint = (daddr_t)-1; >> + bl->bl_root[i + skip].u.bmu_bitmap = 0; >> + } >> + last_block %= radix; >> } >> - blst_radix_init(bl->bl_root, radix, blocks); >> >> #if defined(BLIST_DEBUG) >> printf( >> @@ -261,7 +300,7 @@ blist_create(daddr_t blocks, int flags) >> void >> blist_destroy(blist_t bl) >> { >> - free(bl->bl_root, M_SWAP); >> + >> free(bl, M_SWAP); >> } >> >> @@ -1070,83 +1109,6 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr >> } >> scan->u.bmu_avail -= nblks; >> return (nblks); >> -} >> - >> -/* >> - * BLST_RADIX_INIT() - initialize radix tree >> - * >> - * Initialize our meta structures and bitmaps and calculate the exact >> - * amount of space required to manage 'count' blocks - this space may >> - * be considerably less than the calculated radix due to the large >> - * RADIX values we use. >> - */ >> -static daddr_t >> -blst_radix_init(blmeta_t *scan, daddr_t radix, daddr_t count) >> -{ >> - daddr_t i, memindex, next_skip, skip; >> - >> - memindex = 0; >> - >> - /* >> - * Leaf node >> - */ >> - >> - if (radix == BLIST_BMAP_RADIX) { >> - if (scan) { >> - scan->bm_bighint = 0; >> - scan->u.bmu_bitmap = 0; >> - } >> - return (memindex); >> - } >> - >> - /* >> - * Meta node. If allocating the entire object we can special >> - * case it. However, we need to figure out how much memory >> - * is required to manage 'count' blocks, so we continue on anyway. >> - */ >> - >> - if (scan) { >> - scan->bm_bighint = 0; >> - scan->u.bmu_avail = 0; >> - } >> - >> - skip = radix_to_skip(radix); >> - next_skip = skip / BLIST_META_RADIX; >> - radix /= BLIST_META_RADIX; >> - >> - for (i = 1; i < skip; i += next_skip) { >> - if (count >= radix) { >> - /* >> - * Allocate the entire object >> - */ >> - memindex = i + >> - blst_radix_init(((scan) ? &scan[i] : NULL), radix, >> - radix); >> - count -= radix; >> - } else if (count > 0) { >> - /* >> - * Allocate a partial object >> - */ >> - memindex = i + >> - blst_radix_init(((scan) ? &scan[i] : NULL), radix, >> - count); >> - count = 0; >> - } else { >> - /* >> - * Add terminator and break out. Make terminator bitma >> p >> - * zero to avoid a spanning leaf allocation that >> - * includes the terminator. >> - */ >> - if (scan) { >> - scan[i].bm_bighint = (daddr_t)-1; >> - scan[i].u.bmu_bitmap = 0; >> - } >> - break; >> - } >> - } >> - if (memindex < i) >> - memindex = i; >> - return (memindex); >> } >> >> #ifdef BLIST_DEBUG >> >> Modified: head/sys/sys/blist.h >> ============================================================================= >> = >> --- head/sys/sys/blist.h Sun Oct 8 21:20:25 2017 (r324419) >> +++ head/sys/sys/blist.h Sun Oct 8 22:17:39 2017 (r324420) >> @@ -82,7 +82,7 @@ typedef struct blist { >> daddr_t bl_blocks; /* area of coverage */ >> u_daddr_t bl_radix; /* coverage radix */ >> daddr_t bl_cursor; /* next-fit search starts at */ >> - blmeta_t *bl_root; /* root of radix tree */ >> + blmeta_t bl_root[1]; /* root of radix tree */ >> } *blist_t; >> >> #define BLIST_META_RADIX 16 >> > This commit is causing this: > > panic: freeing invalid range > > On my laptop (Core i3 chip): > > (kgdb) bt > #0 doadump (textdump=1) at pcpu.h:232 > #1 0xffffffff80583e16 in kern_reboot (howto=260) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 > #2 0xffffffff80584306 in vpanic (fmt=, > ap=) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 > #3 0xffffffff80584123 in panic (fmt=) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 > #4 0xffffffff805b9133 in blst_meta_free (scan=0xfffffe00045c3128, > freeBlk=, count=0, radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:869 > #5 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3048, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #6 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3038, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #7 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3028, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #8 0xffffffff805b90df in blst_meta_free (scan=0xfffffe00045c3018, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #9 0xffffffff808359af in swaponsomething (vp=, > id=0xfffff8000cb97200, nblks=3145727, > strategy=0xffffffff80835c60 , > close=0xffffffff80835ee0 , dev=132, flags=1) > at /opt/src/svn-current/sys/vm/swap_pager.c:2199 > #10 0xffffffff8083392c in sys_swapon (td=, > uap=) at /opt/src/svn-current/sys/vm/swap_pager.c:2 > 728 > #11 0xffffffff80887a11 in amd64_syscall (td=0xfffff8000c659560, traced=0) > at subr_syscall.c:132 > #12 0xffffffff8086afcb in Xfast_syscall () > at /opt/src/svn-current/sys/amd64/amd64/exception.S:419 > #13 0x000000002c689aea in ?? () > Previous frame inner to this frame (corrupt stack?) > Current language: auto; currently minimal > (kgdb) > > > On my gateway machine (AMD 4600+): > > (kgdb) bt > #0 doadump (textdump=) at pcpu.h:232 > #1 0xffffffff80573e11 in kern_reboot (howto=260) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 > #2 0xffffffff805742e6 in vpanic (fmt=, > ap=) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 > #3 0xffffffff80574103 in panic (fmt=) > at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 > #4 0xffffffff805a8b63 in blst_meta_free (scan=0xfffffe00021c9038, > freeBlk=, count=0, radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:869 > #5 0xffffffff805a8b0f in blst_meta_free (scan=0xfffffe00021c9028, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #6 0xffffffff805a8b0f in blst_meta_free (scan=0xfffffe00021c9018, > freeBlk=, count=, > radix=) > at /opt/src/svn-current/sys/kern/subr_blist.c:926 > #7 0xffffffff8081becf in swaponsomething (vp=, > id=0xfffff800124d1080, nblks=262144, > strategy=0xffffffff8081c180 , > close=0xffffffff8081c400 , dev=101, flags=1) > at /opt/src/svn-current/sys/vm/swap_pager.c:2199 > #8 0xffffffff80819e4c in sys_swapon (td=, > uap=) at /opt/src/svn-current/sys/vm/swap_pager.c:2 > 728 > #9 0xffffffff80869fb1 in amd64_syscall (td=0xfffff80012558000, traced=0) > at subr_syscall.c:132 > #10 0xffffffff8084dd4b in Xfast_syscall () > at /opt/src/svn-current/sys/amd64/amd64/exception.S:419 > #11 0x0000000800a89aea in ?? () > Previous frame inner to this frame (corrupt stack?) > Current language: auto; currently minimal > (kgdb) > > In the case of my laptop, it panicked only once. My gateway machine > downstairs was in a panic reboot loop, panicking during swapon. > > Reverting this diff resolves my issue. > > Doug Moore has provided a fix, which I just committed. From owner-svn-src-head@freebsd.org Mon Oct 9 18:28:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDF71E385F5; Mon, 9 Oct 2017 18:28:10 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (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 6ECB375A47; Mon, 9 Oct 2017 18:28:09 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 1cmdeAnWOI8mC1cmfer8oV; Mon, 09 Oct 2017 12:28:09 -0600 X-Authority-Analysis: v=2.2 cv=HahkdmM8 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=QCccru2TAAAA:8 a=YxBL1-UpAAAA:8 a=KOormpjoEEOd_GiNS3AA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=rCjsK_HQOcgUb9vb-KUg:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 94045AD; Mon, 9 Oct 2017 11:28:07 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v99IS7Mj060589; Mon, 9 Oct 2017 11:28:07 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710091828.v99IS7Mj060589@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Alan Cox cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324444 - head/sys/kern In-Reply-To: Message from Alan Cox of "Mon, 09 Oct 2017 18:19:06 -0000." <201710091819.v99IJ6oB009917@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 09 Oct 2017 11:28:07 -0700 X-CMAE-Envelope: MS4wfPb6pK35/HS6w5r+Kk8Mybc2Op6gyLtI9387D+jvtFZAXmyC7qNEtoZtZ9lKbNYky7gTFP7G3Sga0Nt+FtuyBe4QDGBtb6YGkZxuYzcibkw1T8TuiUZ8 3kBCGUO4nI5FXKs7TC06Pcsr6DIMApdogn1xovv8W6SZ8k9EYd/Xzxcomuypbikk7Q3u4oOMyM25kAeKuDGihRB7I5JDY+Rq2ZTjQc59tsX+5I3m0h3hDdv0 LjCQzFAk3kiIGJegrhAbpmksdzsq8jVHWyho+Q645DiV48T4CWOIOkX8PEfnSadX X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 09 Oct 2017 18:28:10 -0000 In message <201710091819.v99IJ6oB009917@repo.freebsd.org>, Alan Cox writes: > Author: alc > Date: Mon Oct 9 18:19:06 2017 > New Revision: 324444 > URL: https://svnweb.freebsd.org/changeset/base/324444 > > Log: > The recent change to initialization of blists (r324420) relied on '-1' > appearing only where the code explicitly set it, but since much of the > data was not initialized, '-1' appeared other places too, and led to > panics. Clear the allocated data before initializing nonzero values by > allocating with M_ZERO. > > Submitted by: Doug Moore > Reported by: Oleg V. Nauman , cy > Tested by: Oleg V. Nauman > MFC after: 1 week > X-MFC with: r324420 > Differential Revision: https://reviews.freebsd.org/D12627 Thanks. This fixes the recurring panic on one of my machines. -- 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 Mon Oct 9 18:33:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B56E9E3891E; Mon, 9 Oct 2017 18:33:30 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82716760AE; Mon, 9 Oct 2017 18:33: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 v99IXTZ6018081; Mon, 9 Oct 2017 18:33:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99IXTjd018080; Mon, 9 Oct 2017 18:33:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710091833.v99IXTjd018080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 9 Oct 2017 18:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324445 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324445 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 18:33:30 -0000 Author: hselasky Date: Mon Oct 9 18:33:29 2017 New Revision: 324445 URL: https://svnweb.freebsd.org/changeset/base/324445 Log: When showing the sleepqueues from the in-kernel debugger, properly dump all the sendqueues and not just the first one History: It appears that in the commit which introduced the code, r165272, the array indexes of "sq_blocked[0]" and "td_name[i]" were interchanged. In r180927 "td_name[i]" was corrected to "td_name[0]", but "sq_blocked[0]" was left unchanged. PR: 222624 Discussed with: kmacy @ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Mon Oct 9 18:19:06 2017 (r324444) +++ head/sys/kern/subr_sleepqueue.c Mon Oct 9 18:33:29 2017 (r324445) @@ -1435,7 +1435,7 @@ found: if (TAILQ_EMPTY(&sq->sq_blocked[i])) db_printf("\tempty\n"); else - TAILQ_FOREACH(td, &sq->sq_blocked[0], + TAILQ_FOREACH(td, &sq->sq_blocked[i], td_slpq) { db_printf("\t%p (tid %d, pid %d, \"%s\")\n", td, td->td_tid, td->td_proc->p_pid, From owner-svn-src-head@freebsd.org Mon Oct 9 20:35:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C183E3B377; Mon, 9 Oct 2017 20:35:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 557D87E910; Mon, 9 Oct 2017 20:35:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99KZXEC068991; Mon, 9 Oct 2017 20:35:33 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99KZVR7068970; Mon, 9 Oct 2017 20:35:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710092035.v99KZVR7068970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 9 Oct 2017 20:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324446 - in head: share/man/man9 sys/compat/ndis sys/dev/cas sys/dev/cxgbe sys/dev/cxgbe/tom sys/dev/dpaa sys/dev/if_ndis sys/dev/iscsi_initiator sys/dev/lge sys/dev/mwl sys/dev/netmap... X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head: share/man/man9 sys/compat/ndis sys/dev/cas sys/dev/cxgbe sys/dev/cxgbe/tom sys/dev/dpaa sys/dev/if_ndis sys/dev/iscsi_initiator sys/dev/lge sys/dev/mwl sys/dev/netmap sys/dev/wb sys/kern sys/... X-SVN-Commit-Revision: 324446 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 20:35:34 -0000 Author: glebius Date: Mon Oct 9 20:35:31 2017 New Revision: 324446 URL: https://svnweb.freebsd.org/changeset/base/324446 Log: Shorten list of arguments to mbuf external storage freeing function. All of these arguments are stored in m_ext, so there is no reason to pass them in the argument list. Not all functions need the second argument, some don't even need the first one. The second argument lives in next cache line, so not dereferencing it is a performance gain. This was discovered in sendfile(2), which will be covered by next commits. The second goal of this commit is to bring even more flexibility to m_ext mbufs, allowing to create more fields in m_ext, opaque to the generic mbuf code, and potentially set and dereferenced by subsystems. Reviewed by: gallatin, kbowling Differential Revision: https://reviews.freebsd.org/D12615 Modified: head/share/man/man9/mbpool.9 head/share/man/man9/mbuf.9 head/sys/compat/ndis/kern_ndis.c head/sys/compat/ndis/ndis_var.h head/sys/dev/cas/if_cas.c head/sys/dev/cas/if_casvar.h head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/dpaa/if_dtsec_rm.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/iscsi_initiator/isc_soc.c head/sys/dev/lge/if_lge.c head/sys/dev/mwl/if_mwl.c head/sys/dev/netmap/netmap_generic.c head/sys/dev/wb/if_wb.c head/sys/kern/kern_mbuf.c head/sys/kern/subr_mbpool.c head/sys/sys/mbpool.h head/sys/sys/mbuf.h Modified: head/share/man/man9/mbpool.9 ============================================================================== --- head/share/man/man9/mbpool.9 Mon Oct 9 18:33:29 2017 (r324445) +++ head/share/man/man9/mbpool.9 Mon Oct 9 20:35:31 2017 (r324446) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 15, 2003 +.Dd September 27, 2017 .Dt MBPOOL 9 .Os .Sh NAME @@ -50,7 +50,7 @@ .Ft void .Fn mbp_free "struct mbpool *mbp" "void *p" .Ft void -.Fn mbp_ext_free "void *" "void *" +.Fn mbp_ext_free "struct mbuf *" .Ft void .Fn mbp_card_free "struct mbpool *mbp" .Ft void @@ -223,8 +223,6 @@ The function can be given to .Fn m_extadd as the free function. -The user argument must be the pointer to -the pool. .Pp Before using the contents of a buffer returned by the card, the driver must call Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Mon Oct 9 18:33:29 2017 (r324445) +++ head/share/man/man9/mbuf.9 Mon Oct 9 20:35:31 2017 (r324446) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2016 +.Dd September 27, 2017 .Dt MBUF 9 .Os .\" @@ -44,12 +44,12 @@ .Fn MCLGET "struct mbuf *mbuf" "int how" .Fo MEXTADD .Fa "struct mbuf *mbuf" -.Fa "caddr_t buf" +.Fa "char *buf" .Fa "u_int size" -.Fa "void (*free)(void *opt_arg1, void *opt_arg2)" +.Fa "void (*free)(struct mbuf *)" .Fa "void *opt_arg1" .Fa "void *opt_arg2" -.Fa "short flags" +.Fa "int flags" .Fa "int type" .Fc .\" @@ -416,8 +416,13 @@ The .Fa opt_arg1 and .Fa opt_arg2 -arguments will be passed unmodified to -.Fa free . +arguments will be saved in +.Va ext_arg1 +and +.Va ext_arg2 +fields of the +.Va struct m_ext +of the mbuf. The .Fa flags argument specifies additional Modified: head/sys/compat/ndis/kern_ndis.c ============================================================================== --- head/sys/compat/ndis/kern_ndis.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/compat/ndis/kern_ndis.c Mon Oct 9 20:35:31 2017 (r324446) @@ -495,17 +495,21 @@ ndis_return(dobj, arg) KeReleaseSpinLock(&block->nmb_returnlock, irql); } +static void +ndis_ext_free(struct mbuf *m) +{ + + return (ndis_return_packet(m->m_ext.ext_arg1)); +} + void -ndis_return_packet(struct mbuf *m, void *buf, void *arg) +ndis_return_packet(ndis_packet *p) { - ndis_packet *p; ndis_miniport_block *block; - if (arg == NULL) + if (p == NULL) return; - p = arg; - /* Decrement refcount. */ p->np_refcnt--; @@ -676,9 +680,8 @@ ndis_ptom(m0, p) return (ENOBUFS); } m->m_len = MmGetMdlByteCount(buf); - m->m_data = MmGetMdlVirtualAddress(buf); - MEXTADD(m, m->m_data, m->m_len, ndis_return_packet, - m->m_data, p, 0, EXT_NDIS); + m_extadd(m, MmGetMdlVirtualAddress(buf), m->m_len, + ndis_ext_free, p, NULL, 0, EXT_NDIS); p->np_refcnt++; totlen += m->m_len; Modified: head/sys/compat/ndis/ndis_var.h ============================================================================== --- head/sys/compat/ndis/ndis_var.h Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/compat/ndis/ndis_var.h Mon Oct 9 20:35:31 2017 (r324446) @@ -1743,7 +1743,7 @@ extern int ndis_halt_nic(void *); extern int ndis_shutdown_nic(void *); extern int ndis_pnpevent_nic(void *, int); extern int ndis_init_nic(void *); -extern void ndis_return_packet(struct mbuf *, void *, void *); +extern void ndis_return_packet(ndis_packet *); extern int ndis_init_dma(void *); extern int ndis_destroy_dma(void *); extern int ndis_create_sysctls(void *); Modified: head/sys/dev/cas/if_cas.c ============================================================================== --- head/sys/dev/cas/if_cas.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/cas/if_cas.c Mon Oct 9 20:35:31 2017 (r324446) @@ -133,7 +133,7 @@ static void cas_detach(struct cas_softc *sc); static int cas_disable_rx(struct cas_softc *sc); static int cas_disable_tx(struct cas_softc *sc); static void cas_eint(struct cas_softc *sc, u_int status); -static void cas_free(struct mbuf *m, void *arg1, void* arg2); +static void cas_free(struct mbuf *m); static void cas_init(void *xsc); static void cas_init_locked(struct cas_softc *sc); static void cas_init_regs(struct cas_softc *sc); @@ -1732,16 +1732,10 @@ cas_rint(struct cas_softc *sc) refcount_acquire(&rxds->rxds_refcount); bus_dmamap_sync(sc->sc_rdmatag, rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); -#if __FreeBSD_version < 800016 - MEXTADD(m, (caddr_t)rxds->rxds_buf + + m_extadd(m, (char *)rxds->rxds_buf + off * 256 + ETHER_ALIGN, len, cas_free, - rxds, M_RDONLY, EXT_NET_DRV); -#else - MEXTADD(m, (caddr_t)rxds->rxds_buf + - off * 256 + ETHER_ALIGN, len, cas_free, sc, (void *)(uintptr_t)idx, M_RDONLY, EXT_NET_DRV); -#endif if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -1779,16 +1773,10 @@ cas_rint(struct cas_softc *sc) m->m_len = min(CAS_PAGE_SIZE - off, len); bus_dmamap_sync(sc->sc_rdmatag, rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); -#if __FreeBSD_version < 800016 - MEXTADD(m, (caddr_t)rxds->rxds_buf + off, - m->m_len, cas_free, rxds, M_RDONLY, - EXT_NET_DRV); -#else - MEXTADD(m, (caddr_t)rxds->rxds_buf + off, + m_extadd(m, (char *)rxds->rxds_buf + off, m->m_len, cas_free, sc, (void *)(uintptr_t)idx, M_RDONLY, EXT_NET_DRV); -#endif if ((m->m_flags & M_EXT) == 0) { m_freem(m); m = NULL; @@ -1818,19 +1806,11 @@ cas_rint(struct cas_softc *sc) sc->sc_rdmatag, rxds2->rxds_dmamap, BUS_DMASYNC_POSTREAD); -#if __FreeBSD_version < 800016 - MEXTADD(m2, - (caddr_t)rxds2->rxds_buf, - m2->m_len, cas_free, - rxds2, M_RDONLY, - EXT_NET_DRV); -#else - MEXTADD(m2, - (caddr_t)rxds2->rxds_buf, + m_extadd(m2, + (char *)rxds2->rxds_buf, m2->m_len, cas_free, sc, (void *)(uintptr_t)idx2, M_RDONLY, EXT_NET_DRV); -#endif if ((m2->m_flags & M_EXT) == 0) { m_freem(m2); @@ -1889,21 +1869,15 @@ cas_rint(struct cas_softc *sc) } static void -cas_free(struct mbuf *m, void *arg1, void *arg2) +cas_free(struct mbuf *m) { struct cas_rxdsoft *rxds; struct cas_softc *sc; u_int idx, locked; -#if __FreeBSD_version < 800016 - rxds = arg2; - sc = rxds->rxds_sc; - idx = rxds->rxds_idx; -#else - sc = arg1; - idx = (uintptr_t)arg2; + sc = m->m_ext.ext_arg1; + idx = (uintptr_t)m->m_ext.ext_arg2; rxds = &sc->sc_rxdsoft[idx]; -#endif if (refcount_release(&rxds->rxds_refcount) == 0) return; Modified: head/sys/dev/cas/if_casvar.h ============================================================================== --- head/sys/dev/cas/if_casvar.h Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/cas/if_casvar.h Mon Oct 9 20:35:31 2017 (r324446) @@ -119,10 +119,6 @@ struct cas_rxdsoft { void *rxds_buf; /* receive buffer */ bus_dmamap_t rxds_dmamap; /* our DMA map */ bus_addr_t rxds_paddr; /* physical address of the segment */ -#if __FreeBSD_version < 800016 - struct cas_softc *rxds_sc; /* softc pointer */ - u_int rxds_idx; /* our index */ -#endif u_int rxds_refcount; /* hardware + mbuf references */ }; @@ -239,18 +235,7 @@ do { \ __CAS_UPDATE_RXDESC(&(sc)->sc_rxdescs[(d)], \ &(sc)->sc_rxdsoft[(s)], (s)) -#if __FreeBSD_version < 800016 -#define CAS_INIT_RXDESC(sc, d, s) \ -do { \ - struct cas_rxdsoft *__rxds = &(sc)->sc_rxdsoft[(s)]; \ - \ - __rxds->rxds_sc = (sc); \ - __rxds->rxds_idx = (s); \ - __CAS_UPDATE_RXDESC(&(sc)->sc_rxdescs[(d)], __rxds, (s)); \ -} while (0) -#else #define CAS_INIT_RXDESC(sc, d, s) CAS_UPDATE_RXDESC(sc, d, s) -#endif #define CAS_LOCK_INIT(_sc, _name) \ mtx_init(&(_sc)->sc_mtx, _name, MTX_NETWORK_LOCK, MTX_DEF) Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 9 20:35:31 2017 (r324446) @@ -1670,10 +1670,10 @@ cl_metadata(struct adapter *sc, struct sge_fl *fl, str } static void -rxb_free(struct mbuf *m, void *arg1, void *arg2) +rxb_free(struct mbuf *m) { - uma_zone_t zone = arg1; - caddr_t cl = arg2; + uma_zone_t zone = m->m_ext.ext_arg1; + void *cl = m->m_ext.ext_arg2; uma_zfree(zone, cl); counter_u64_add(extfree_rels, 1); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 9 20:35:31 2017 (r324446) @@ -1979,9 +1979,9 @@ free_aiotx_buffer(struct aiotx_buffer *ab) } static void -t4_aiotx_mbuf_free(struct mbuf *m, void *buffer, void *arg) +t4_aiotx_mbuf_free(struct mbuf *m) { - struct aiotx_buffer *ab = buffer; + struct aiotx_buffer *ab = m->m_ext.ext_arg1; #ifdef VERBOSE_TRACES CTR3(KTR_CXGBE, "%s: completed %d bytes for tid %d", __func__, Modified: head/sys/dev/dpaa/if_dtsec_rm.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_rm.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/dpaa/if_dtsec_rm.c Mon Oct 9 20:35:31 2017 (r324446) @@ -337,11 +337,13 @@ dtsec_rm_pool_rx_init(struct dtsec_softc *sc) * @{ */ static void -dtsec_rm_fqr_mext_free(struct mbuf *m, void *buffer, void *arg) +dtsec_rm_fqr_mext_free(struct mbuf *m) { struct dtsec_softc *sc; + void *buffer; - sc = arg; + buffer = m->m_ext.ext_arg1; + sc = m->m_ext.ext_arg2; if (bman_count(sc->sc_rx_pool) <= DTSEC_RM_POOL_RX_MAX_SIZE) bman_put_buffer(sc->sc_rx_pool, buffer); else Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/if_ndis/if_ndis.c Mon Oct 9 20:35:31 2017 (r324446) @@ -1418,7 +1418,7 @@ ndis_rxeof(adapter, packets, pktcnt) p = packets[i]; if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) { p->np_refcnt++; - (void)ndis_return_packet(NULL ,p, block); + ndis_return_packet(p); } } return; @@ -1431,7 +1431,7 @@ ndis_rxeof(adapter, packets, pktcnt) if (ndis_ptom(&m0, p)) { device_printf(sc->ndis_dev, "ptom failed\n"); if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) - (void)ndis_return_packet(NULL, p, block); + ndis_return_packet(p); } else { #ifdef notdef if (p->np_oob.npo_status == NDIS_STATUS_RESOURCES) { Modified: head/sys/dev/iscsi_initiator/isc_soc.c ============================================================================== --- head/sys/dev/iscsi_initiator/isc_soc.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/iscsi_initiator/isc_soc.c Mon Oct 9 20:35:31 2017 (r324446) @@ -70,12 +70,13 @@ static int ou_refcnt = 0; | function for freeing external storage for mbuf */ static void -ext_free(struct mbuf *m, void *a, void *b) +ext_free(struct mbuf *m) { - pduq_t *pq = b; + pduq_t *pq = m->m_ext.ext_arg1; if(pq->buf != NULL) { - debug(3, "ou_refcnt=%d a=%p b=%p", ou_refcnt, a, pq->buf); + debug(3, "ou_refcnt=%d a=%p b=%p", + ou_refcnt, m->m_ext.ext_buf, pq->buf); free(pq->buf, M_ISCSIBUF); pq->buf = NULL; } @@ -137,11 +138,8 @@ isc_sendPDU(isc_session_t *sp, pduq_t *pq) md->m_ext.ext_cnt = &ou_refcnt; l = min(MCLBYTES, len); debug(4, "setting ext_free(arg=%p len/l=%d/%d)", pq->buf, len, l); - MEXTADD(md, pp->ds_addr + off, l, ext_free, -#if __FreeBSD_version >= 800000 - pp->ds_addr + off, -#endif - pq, 0, EXT_EXTREF); + m_extadd(md, pp->ds_addr + off, l, ext_free, pq, NULL, 0, + EXT_EXTREF); md->m_len = l; md->m_next = NULL; mh->m_pkthdr.len += l; Modified: head/sys/dev/lge/if_lge.c ============================================================================== --- head/sys/dev/lge/if_lge.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/lge/if_lge.c Mon Oct 9 20:35:31 2017 (r324446) @@ -123,7 +123,7 @@ static int lge_detach(device_t); static int lge_alloc_jumbo_mem(struct lge_softc *); static void lge_free_jumbo_mem(struct lge_softc *); static void *lge_jalloc(struct lge_softc *); -static void lge_jfree(struct mbuf *, void *, void *); +static void lge_jfree(struct mbuf *); static int lge_newbuf(struct lge_softc *, struct lge_rx_desc *, struct mbuf *); static int lge_encap(struct lge_softc *, struct mbuf *, u_int32_t *); @@ -689,7 +689,7 @@ lge_newbuf(sc, c, m) struct mbuf *m; { struct mbuf *m_new = NULL; - caddr_t *buf = NULL; + char *buf = NULL; if (m == NULL) { MGETHDR(m_new, M_NOWAIT, MT_DATA); @@ -710,10 +710,9 @@ lge_newbuf(sc, c, m) return(ENOBUFS); } /* Attach the buffer to the mbuf */ - m_new->m_data = (void *)buf; m_new->m_len = m_new->m_pkthdr.len = LGE_JUMBO_FRAMELEN; - MEXTADD(m_new, buf, LGE_JUMBO_FRAMELEN, lge_jfree, - buf, (struct lge_softc *)sc, 0, EXT_NET_DRV); + m_extadd(m_new, buf, LGE_JUMBO_FRAMELEN, lge_jfree, sc, NULL, + 0, EXT_NET_DRV); } else { m_new = m; m_new->m_len = m_new->m_pkthdr.len = LGE_JUMBO_FRAMELEN; @@ -848,20 +847,20 @@ lge_jalloc(sc) * Release a jumbo buffer. */ static void -lge_jfree(struct mbuf *m, void *buf, void *args) +lge_jfree(struct mbuf *m) { struct lge_softc *sc; int i; struct lge_jpool_entry *entry; /* Extract the softc struct pointer. */ - sc = args; + sc = m->m_ext.ext_arg1; if (sc == NULL) panic("lge_jfree: can't find softc pointer!"); /* calculate the slot this buffer belongs to */ - i = ((vm_offset_t)buf + i = ((vm_offset_t)m->m_ext.ext_buf - (vm_offset_t)sc->lge_cdata.lge_jumbo_buf) / LGE_JLEN; if ((i < 0) || (i >= LGE_JSLOTS)) Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/mwl/if_mwl.c Mon Oct 9 20:35:31 2017 (r324446) @@ -2522,12 +2522,12 @@ mwl_rxbuf_init(struct mwl_softc *sc, struct mwl_rxbuf } static void -mwl_ext_free(struct mbuf *m, void *data, void *arg) +mwl_ext_free(struct mbuf *m) { - struct mwl_softc *sc = arg; + struct mwl_softc *sc = m->m_ext.ext_arg1; /* XXX bounds check data */ - mwl_putrxdma(sc, data); + mwl_putrxdma(sc, m->m_ext.ext_buf); /* * If we were previously blocked by a lack of rx dma buffers * check if we now have enough to restart rx interrupt handling. @@ -2746,8 +2746,8 @@ mwl_rx_proc(void *arg, int npending) * descriptor using the replacement dma * buffer we just installed above. */ - MEXTADD(m, data, MWL_AGGR_SIZE, mwl_ext_free, - data, sc, 0, EXT_NET_DRV); + m_extadd(m, data, MWL_AGGR_SIZE, mwl_ext_free, sc, NULL, 0, + EXT_NET_DRV); m->m_data += off - hdrlen; m->m_pkthdr.len = m->m_len = pktlen; /* NB: dma buffer assumed read-only */ Modified: head/sys/dev/netmap/netmap_generic.c ============================================================================== --- head/sys/dev/netmap/netmap_generic.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/netmap/netmap_generic.c Mon Oct 9 20:35:31 2017 (r324446) @@ -166,7 +166,7 @@ nm_os_get_mbuf(struct ifnet *ifp, int len) * has a KASSERT(), checking that the mbuf dtor function is not NULL. */ -static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } +static void void_mbuf_dtor(struct mbuf *m) { } #define SET_MBUF_DESTRUCTOR(m, fn) do { \ (m)->m_ext.ext_free = (fn != NULL) ? \ @@ -624,7 +624,7 @@ generic_mbuf_destructor(struct mbuf *m) * txsync. */ netmap_generic_irq(na, r, NULL); #ifdef __FreeBSD__ - void_mbuf_dtor(m, NULL, NULL); + void_mbuf_dtor(m); #endif } Modified: head/sys/dev/wb/if_wb.c ============================================================================== --- head/sys/dev/wb/if_wb.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/dev/wb/if_wb.c Mon Oct 9 20:35:31 2017 (r324446) @@ -143,7 +143,7 @@ static int wb_probe(device_t); static int wb_attach(device_t); static int wb_detach(device_t); -static void wb_bfree(struct mbuf *, void *addr, void *args); +static void wb_bfree(struct mbuf *); static int wb_newbuf(struct wb_softc *, struct wb_chain_onefrag *, struct mbuf *); static int wb_encap(struct wb_softc *, struct wb_chain *, struct mbuf *); @@ -824,7 +824,7 @@ wb_list_rx_init(sc) } static void -wb_bfree(struct mbuf *m, void *buf, void *args) +wb_bfree(struct mbuf *m) { } @@ -843,10 +843,9 @@ wb_newbuf(sc, c, m) MGETHDR(m_new, M_NOWAIT, MT_DATA); if (m_new == NULL) return(ENOBUFS); - m_new->m_data = c->wb_buf; m_new->m_pkthdr.len = m_new->m_len = WB_BUFBYTES; - MEXTADD(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, c->wb_buf, - NULL, 0, EXT_NET_DRV); + m_extadd(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, NULL, NULL, + 0, EXT_NET_DRV); } else { m_new = m; m_new->m_len = m_new->m_pkthdr.len = WB_BUFBYTES; Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/kern/kern_mbuf.c Mon Oct 9 20:35:31 2017 (r324446) @@ -504,7 +504,7 @@ mb_ctor_clust(void *mem, int size, void *arg, int how) #endif m = (struct mbuf *)arg; if (m != NULL) { - m->m_ext.ext_buf = (caddr_t)mem; + m->m_ext.ext_buf = (char *)mem; m->m_data = m->m_ext.ext_buf; m->m_flags |= M_EXT; m->m_ext.ext_free = NULL; @@ -688,15 +688,13 @@ mb_free_ext(struct mbuf *m) case EXT_DISPOSABLE: KASSERT(m->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); - (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, - m->m_ext.ext_arg2); + m->m_ext.ext_free(m); uma_zfree(zone_mbuf, mref); break; case EXT_EXTREF: KASSERT(m->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); - (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, - m->m_ext.ext_arg2); + m->m_ext.ext_free(m); break; default: KASSERT(m->m_ext.ext_type == 0, @@ -918,9 +916,8 @@ m_getm2(struct mbuf *m, int len, int how, short type, * Nothing. */ void -m_extadd(struct mbuf *mb, caddr_t buf, u_int size, - void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2, - int flags, int type) +m_extadd(struct mbuf *mb, char *buf, u_int size, m_ext_free_t freef, + void *arg1, void *arg2, int flags, int type) { KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__)); Modified: head/sys/kern/subr_mbpool.c ============================================================================== --- head/sys/kern/subr_mbpool.c Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/kern/subr_mbpool.c Mon Oct 9 20:35:31 2017 (r324446) @@ -281,10 +281,10 @@ mbp_free(struct mbpool *p, void *ptr) * Mbuf system external mbuf free routine */ void -mbp_ext_free(struct mbuf *m, void *buf, void *arg) +mbp_ext_free(struct mbuf *m) { - mbp_free(arg, buf); + mbp_free(m->m_ext.ext_arg2, m->m_ext.ext_arg1); } /* Modified: head/sys/sys/mbpool.h ============================================================================== --- head/sys/sys/mbpool.h Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/sys/mbpool.h Mon Oct 9 20:35:31 2017 (r324446) @@ -69,7 +69,7 @@ void *mbp_alloc(struct mbpool *, bus_addr_t *, uint32_ void mbp_free(struct mbpool *, void *); /* free a chunk that is an external mbuf */ -void mbp_ext_free(struct mbuf *, void *, void *); +void mbp_ext_free(struct mbuf *); /* free all buffers that are marked to be on the card */ void mbp_card_free(struct mbpool *); Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Oct 9 18:33:29 2017 (r324445) +++ head/sys/sys/mbuf.h Mon Oct 9 20:35:31 2017 (r324446) @@ -197,17 +197,17 @@ struct pkthdr { * Compile-time assertions in uipc_mbuf.c test these values to ensure that * they are correct. */ +typedef void m_ext_free_t(struct mbuf *); struct m_ext { union { volatile u_int ext_count; /* value of ref count info */ volatile u_int *ext_cnt; /* pointer to ref count info */ }; - caddr_t ext_buf; /* start of buffer */ + char *ext_buf; /* start of buffer */ uint32_t ext_size; /* size of buffer, for ext_free */ uint32_t ext_type:8, /* type of external storage */ ext_flags:24; /* external storage mbuf flags */ - void (*ext_free) /* free routine if not the usual */ - (struct mbuf *, void *, void *); + m_ext_free_t *ext_free; /* free routine if not the usual */ void *ext_arg1; /* optional argument pointer */ void *ext_arg2; /* optional argument pointer */ }; @@ -436,10 +436,10 @@ struct mbuf { #define EXT_FLAG_NOFREE 0x000010 /* don't free mbuf to pool, notyet */ -#define EXT_FLAG_VENDOR1 0x010000 /* for vendor-internal use */ -#define EXT_FLAG_VENDOR2 0x020000 /* for vendor-internal use */ -#define EXT_FLAG_VENDOR3 0x040000 /* for vendor-internal use */ -#define EXT_FLAG_VENDOR4 0x080000 /* for vendor-internal use */ +#define EXT_FLAG_VENDOR1 0x010000 /* These flags are vendor */ +#define EXT_FLAG_VENDOR2 0x020000 /* or submodule specific, */ +#define EXT_FLAG_VENDOR3 0x040000 /* not used by mbuf code. */ +#define EXT_FLAG_VENDOR4 0x080000 /* Set/read by submodule. */ #define EXT_FLAG_EXP1 0x100000 /* for experimental use */ #define EXT_FLAG_EXP2 0x200000 /* for experimental use */ @@ -610,9 +610,8 @@ struct mbuf *m_devget(char *, int, int, struct ifnet * void (*)(char *, caddr_t, u_int)); struct mbuf *m_dup(const struct mbuf *, int); int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); -void m_extadd(struct mbuf *, caddr_t, u_int, - void (*)(struct mbuf *, void *, void *), void *, void *, - int, int); +void m_extadd(struct mbuf *, char *, u_int, m_ext_free_t, + void *, void *, int, int); u_int m_fixhdr(struct mbuf *); struct mbuf *m_fragment(struct mbuf *, int, int); void m_freem(struct mbuf *); @@ -667,8 +666,8 @@ m_gettype(int size) * Associated an external reference counted buffer with an mbuf. */ static __inline void -m_extaddref(struct mbuf *m, caddr_t buf, u_int size, u_int *ref_cnt, - void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2) +m_extaddref(struct mbuf *m, char *buf, u_int size, u_int *ref_cnt, + m_ext_free_t freef, void *arg1, void *arg2) { KASSERT(ref_cnt != NULL, ("%s: ref_cnt not provided", __func__)); @@ -864,7 +863,7 @@ m_extrefcnt(struct mbuf *m) #define MGETHDR(m, how, type) ((m) = m_gethdr((how), (type))) #define MCLGET(m, how) m_clget((m), (how)) #define MEXTADD(m, buf, size, free, arg1, arg2, flags, type) \ - m_extadd((m), (caddr_t)(buf), (size), (free), (arg1), (arg2), \ + m_extadd((m), (char *)(buf), (size), (free), (arg1), (arg2), \ (flags), (type)) #define m_getm(m, len, how, type) \ m_getm2((m), (len), (how), (type), M_PKTHDR) From owner-svn-src-head@freebsd.org Mon Oct 9 20:43:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E6CBE3B8BA; Mon, 9 Oct 2017 20:43:58 +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 28B3B7F17C; Mon, 9 Oct 2017 20:43:58 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 106D75A9F27; Mon, 9 Oct 2017 20:33:51 +0000 (UTC) Date: Mon, 9 Oct 2017 20:33:50 +0000 From: Brooks Davis To: rgrimes@freebsd.org Cc: Ngie Cooper , Sean Bruno , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324406 - head/sys/modules/em Message-ID: <20171009203350.GB68389@spindle.one-eyed-alien.net> References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline In-Reply-To: <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 20:43:58 -0000 --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 08, 2017 at 08:42:35AM -0700, Rodney W. Grimes wrote: > >=20 > > > On Oct 7, 2017, at 16:33, Sean Bruno wrote: > > >=20 > > > Author: sbruno > > > Date: Sat Oct 7 23:33:14 2017 > > > New Revision: 324406 > > > URL: https://svnweb.freebsd.org/changeset/base/324406 > > >=20 > > > Log: > > > Fix symlink if_igb.ko in -current such that its relative and doesn't > > > end up with non-standard DESTDIR information in its symlink. This > > > can happen very trivially if the release scripts are used. > > >=20 > > > Sponsored by: Limelight Networks > > >=20 > > > Modified: > > > head/sys/modules/em/Makefile > > >=20 > > > Modified: head/sys/modules/em/Makefile > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sys/modules/em/Makefile Sat Oct 7 23:30:57 2017 (r324= 405) > > > +++ head/sys/modules/em/Makefile Sat Oct 7 23:33:14 2017 (r324= 406) > > > @@ -23,6 +23,6 @@ CFLAGS +=3D -I${SRCTOP}/sys/dev/e1000 > > > #CFLAGS +=3D -DDEVICE_POLLING > > >=20 > > > afterinstall: > > > - ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko ${DESTDIR}${KMODDIR}/if_i= gb.ko > > > + cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko > >=20 > > While this is definitely better, the same thing could be achieved via: > >=20 > > ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko >=20 > Should this be using SYMLINK+=3D as I thought using ln -sf was a breakage > for meta mode stuff? At the very least it should use INSTALL_LIBSYMLINK or INSTALL_RLIBSYMLINK. Direct use of ln(1) is always a bug in install targets and ideally we would make it fail. (It breaks NO_ROOT installs by failing to add an entry to the METALOG file). -- Brooks --b5gNqxB1S1yM7hjW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJZ290uAAoJEKzQXbSebgfAJUcH/iJUHmSlEGqliH+uqHZ51w3p M/+iBM3rGUHAbEE9dL0+qvY/FaZ+DQZh7sxoyOlfppWpdhIEFalDX/pXVy/1pgwW pdOYvVA5ZJgFdJLkKO9LT7yhwessZu9CbxKV+5ZZpZqW9rWzov7gg8q4RANtzR0q PJgTZetq81elAxY3o7tn1KTd2d0Ef29EvWnU4IsRwim3Zj/lCAFHHH3171BzmZKw eX3Orp8p1fgrcQZT+E2KFmSDp/svOQPnU0vz5DwpfWbkLXLeZBTJxYO3ao72GbqP w9CaJULZlhfzXuQcN4p0NAFMYJCzmPHjR6GvIy+1ubpFoLny1jgGmd0gILqBqLM= =smL7 -----END PGP SIGNATURE----- --b5gNqxB1S1yM7hjW-- From owner-svn-src-head@freebsd.org Mon Oct 9 20:52:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A84CE3BB02; Mon, 9 Oct 2017 20:52:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 542117F5D9; Mon, 9 Oct 2017 20:52:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99KpxEV077383; Mon, 9 Oct 2017 20:51:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99KpxPC077380; Mon, 9 Oct 2017 20:51:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710092051.v99KpxPC077380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 9 Oct 2017 20:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324447 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324447 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 20:52:00 -0000 Author: glebius Date: Mon Oct 9 20:51:58 2017 New Revision: 324447 URL: https://svnweb.freebsd.org/changeset/base/324447 Log: In mb_dupcl() don't copy full m_ext, to avoid cache miss. Respectively, in mb_free_ext() always use fields from the original refcount holding mbuf (see. r296242) mbuf. Cuts another cache miss from mb_free_ext(). However, treat EXT_EXTREF mbufs differently, since they are different - they don't have a refcount holding mbuf. Provide longer comments in m_ext declaration to explain this change and change from r296242. In collaboration with: gallatin Differential Revision: https://reviews.freebsd.org/D12615 Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Oct 9 20:35:31 2017 (r324446) +++ head/sys/kern/kern_mbuf.c Mon Oct 9 20:51:58 2017 (r324447) @@ -675,20 +675,20 @@ mb_free_ext(struct mbuf *m) uma_zfree(zone_mbuf, mref); break; case EXT_SFBUF: - sf_ext_free(m->m_ext.ext_arg1, m->m_ext.ext_arg2); + sf_ext_free(mref->m_ext.ext_arg1, mref->m_ext.ext_arg2); uma_zfree(zone_mbuf, mref); break; case EXT_SFBUF_NOCACHE: - sf_ext_free_nocache(m->m_ext.ext_arg1, - m->m_ext.ext_arg2); + sf_ext_free_nocache(mref->m_ext.ext_arg1, + mref->m_ext.ext_arg2); uma_zfree(zone_mbuf, mref); break; case EXT_NET_DRV: case EXT_MOD_TYPE: case EXT_DISPOSABLE: - KASSERT(m->m_ext.ext_free != NULL, + KASSERT(mref->m_ext.ext_free != NULL, ("%s: ext_free not set", __func__)); - m->m_ext.ext_free(m); + mref->m_ext.ext_free(mref); uma_zfree(zone_mbuf, mref); break; case EXT_EXTREF: Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Mon Oct 9 20:35:31 2017 (r324446) +++ head/sys/kern/uipc_mbuf.c Mon Oct 9 20:51:58 2017 (r324447) @@ -188,7 +188,17 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) KASSERT(m->m_flags & M_EXT, ("%s: M_EXT not set on %p", __func__, m)); KASSERT(!(n->m_flags & M_EXT), ("%s: M_EXT set on %p", __func__, n)); - n->m_ext = m->m_ext; + /* + * Cache access optimization. For most kinds of external + * storage we don't need full copy of m_ext, since the + * holder of the 'ext_count' is responsible to carry the + * free routine and its arguments. Exclusion is EXT_EXTREF, + * where 'ext_cnt' doesn't point into mbuf at all. + */ + if (m->m_ext.ext_type == EXT_EXTREF) + bcopy(&m->m_ext, &n->m_ext, sizeof(struct m_ext)); + else + bcopy(&m->m_ext, &n->m_ext, m_ext_copylen); n->m_flags |= M_EXT; n->m_flags |= m->m_flags & M_RDONLY; Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Oct 9 20:35:31 2017 (r324446) +++ head/sys/sys/mbuf.h Mon Oct 9 20:51:58 2017 (r324447) @@ -200,13 +200,29 @@ struct pkthdr { typedef void m_ext_free_t(struct mbuf *); struct m_ext { union { - volatile u_int ext_count; /* value of ref count info */ - volatile u_int *ext_cnt; /* pointer to ref count info */ + /* + * If EXT_FLAG_EMBREF is set, then we use refcount in the + * mbuf, the 'ext_count' member. Otherwise, we have a + * shadow copy and we use pointer 'ext_cnt'. The original + * mbuf is responsible to carry the pointer to free routine + * and its arguments. They aren't copied into shadows in + * mb_dupcl() to avoid dereferencing next cachelines. + */ + volatile u_int ext_count; + volatile u_int *ext_cnt; }; char *ext_buf; /* start of buffer */ uint32_t ext_size; /* size of buffer, for ext_free */ uint32_t ext_type:8, /* type of external storage */ ext_flags:24; /* external storage mbuf flags */ + /* + * Fields below store the free context for the external storage. + * They are valid only in the refcount carrying mbuf, the one with + * EXT_FLAG_EMBREF flag, with exclusion for EXT_EXTREF type, where + * the free context is copied into all mbufs that use same external + * storage. + */ +#define m_ext_copylen offsetof(struct m_ext, ext_free) m_ext_free_t *ext_free; /* free routine if not the usual */ void *ext_arg1; /* optional argument pointer */ void *ext_arg2; /* optional argument pointer */ From owner-svn-src-head@freebsd.org Mon Oct 9 21:06:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEBB2E3BD86; Mon, 9 Oct 2017 21:06:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB4DE7FAD7; Mon, 9 Oct 2017 21:06:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99L6GXl081899; Mon, 9 Oct 2017 21:06:16 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99L6Gft081896; Mon, 9 Oct 2017 21:06:16 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710092106.v99L6Gft081896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 9 Oct 2017 21:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324448 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 324448 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 21:06:17 -0000 Author: glebius Date: Mon Oct 9 21:06:16 2017 New Revision: 324448 URL: https://svnweb.freebsd.org/changeset/base/324448 Log: Improvements to sendfile(2) mbuf free routine. o Fall back to default m_ext free mech, using function pointer in m_ext_free, and remove sf_ext_free() called directly from mbuf code. Testing on modern CPUs showed no regression. o Provide internally used flag EXT_FLAG_SYNC, to mark that I/O uses SF_SYNC flag. Lack of the flag allows us not to dereference ext_arg2, saving from a cache line miss. o Create function sendfile_free_page() that later will be used, for multi-page mbufs. For now compiler will inline it into sendfile_free_mext(). In collaboration with: gallatin Differential Revision: https://reviews.freebsd.org/D12615 Modified: head/sys/kern/kern_mbuf.c head/sys/kern/kern_sendfile.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Oct 9 20:51:58 2017 (r324447) +++ head/sys/kern/kern_mbuf.c Mon Oct 9 21:06:16 2017 (r324448) @@ -675,14 +675,6 @@ mb_free_ext(struct mbuf *m) uma_zfree(zone_mbuf, mref); break; case EXT_SFBUF: - sf_ext_free(mref->m_ext.ext_arg1, mref->m_ext.ext_arg2); - uma_zfree(zone_mbuf, mref); - break; - case EXT_SFBUF_NOCACHE: - sf_ext_free_nocache(mref->m_ext.ext_arg1, - mref->m_ext.ext_arg2); - uma_zfree(zone_mbuf, mref); - break; case EXT_NET_DRV: case EXT_MOD_TYPE: case EXT_DISPOSABLE: Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Mon Oct 9 20:51:58 2017 (r324447) +++ head/sys/kern/kern_sendfile.c Mon Oct 9 21:06:16 2017 (r324448) @@ -62,6 +62,9 @@ __FBSDID("$FreeBSD$"); #include #include +#define EXT_FLAG_SYNC EXT_FLAG_VENDOR1 +#define EXT_FLAG_NOCACHE EXT_FLAG_VENDOR2 + /* * Structure describing a single sendfile(2) I/O, which may consist of * several underlying pager I/Os. @@ -122,63 +125,53 @@ SYSCTL_PROC(_kern_ipc, OID_AUTO, sfstat, CTLTYPE_OPAQU * Detach mapped page and release resources back to the system. Called * by mbuf(9) code when last reference to a page is freed. */ -void -sf_ext_free(void *arg1, void *arg2) +static void +sendfile_free_page(vm_page_t pg, bool nocache) { - struct sf_buf *sf = arg1; - struct sendfile_sync *sfs = arg2; - vm_page_t pg = sf_buf_page(sf); - sf_buf_free(sf); - vm_page_lock(pg); /* - * Check for the object going away on us. This can - * happen since we don't hold a reference to it. - * If so, we're responsible for freeing the page. + * In either case check for the object going away on us. This can + * happen since we don't hold a reference to it. If so, we're + * responsible for freeing the page. In 'noncache' case try to free + * the page, but only if it is cheap to. */ - if (vm_page_unwire(pg, PQ_INACTIVE) && pg->object == NULL) - vm_page_free(pg); - vm_page_unlock(pg); + if (vm_page_unwire(pg, nocache ? PQ_NONE : PQ_INACTIVE)) { + vm_object_t obj; - if (sfs != NULL) { - mtx_lock(&sfs->mtx); - KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); - if (--sfs->count == 0) - cv_signal(&sfs->cv); - mtx_unlock(&sfs->mtx); + if ((obj = pg->object) == NULL) + vm_page_free(pg); + else if (nocache) { + if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) { + vm_page_free(pg); + VM_OBJECT_WUNLOCK(obj); + } else + vm_page_deactivate(pg); + } } + vm_page_unlock(pg); } -/* - * Same as above, but forces the page to be detached from the object - * and go into free pool. - */ -void -sf_ext_free_nocache(void *arg1, void *arg2) +static void +sendfile_free_mext(struct mbuf *m) { - struct sf_buf *sf = arg1; - struct sendfile_sync *sfs = arg2; - vm_page_t pg = sf_buf_page(sf); + struct sf_buf *sf; + vm_page_t pg; + bool nocache; - sf_buf_free(sf); + KASSERT(m->m_flags & M_EXT && m->m_ext.ext_type == EXT_SFBUF, + ("%s: m %p !M_EXT or !EXT_SFBUF", __func__, m)); - vm_page_lock(pg); - if (vm_page_unwire(pg, PQ_NONE)) { - vm_object_t obj; + sf = m->m_ext.ext_arg1; + pg = sf_buf_page(sf); + nocache = m->m_ext.ext_flags & EXT_FLAG_NOCACHE; - /* Try to free the page, but only if it is cheap to. */ - if ((obj = pg->object) == NULL) - vm_page_free(pg); - else if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) { - vm_page_free(pg); - VM_OBJECT_WUNLOCK(obj); - } else - vm_page_deactivate(pg); - } - vm_page_unlock(pg); + sf_buf_free(sf); + sendfile_free_page(pg, nocache); - if (sfs != NULL) { + if (m->m_ext.ext_flags & EXT_FLAG_SYNC) { + struct sendfile_sync *sfs = m->m_ext.ext_arg2; + mtx_lock(&sfs->mtx); KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); if (--sfs->count == 0) @@ -782,7 +775,9 @@ retry_space: m0->m_ext.ext_buf = (char *)sf_buf_kva(sf); m0->m_ext.ext_size = PAGE_SIZE; m0->m_ext.ext_arg1 = sf; - m0->m_ext.ext_arg2 = sfs; + m0->m_ext.ext_type = EXT_SFBUF; + m0->m_ext.ext_flags = EXT_FLAG_EMBREF; + m0->m_ext.ext_free = sendfile_free_mext; /* * SF_NOCACHE sets the page as being freed upon send. * However, we ignore it for the last page in 'space', @@ -790,14 +785,18 @@ retry_space: * send (rem > space), or if we have readahead * configured (rhpages > 0). */ - if ((flags & SF_NOCACHE) == 0 || - (i == npages - 1 && - ((off + space) & PAGE_MASK) && - (rem > space || rhpages > 0))) - m0->m_ext.ext_type = EXT_SFBUF; - else - m0->m_ext.ext_type = EXT_SFBUF_NOCACHE; - m0->m_ext.ext_flags = EXT_FLAG_EMBREF; + if ((flags & SF_NOCACHE) && + (i != npages - 1 || + !((off + space) & PAGE_MASK) || + !(rem > space || rhpages > 0))) + m0->m_ext.ext_flags |= EXT_FLAG_NOCACHE; + if (sfs != NULL) { + m0->m_ext.ext_flags |= EXT_FLAG_SYNC; + m0->m_ext.ext_arg2 = sfs; + mtx_lock(&sfs->mtx); + sfs->count++; + mtx_unlock(&sfs->mtx); + } m0->m_ext.ext_count = 1; m0->m_flags |= (M_EXT | M_RDONLY); if (nios) @@ -815,12 +814,6 @@ retry_space: else m = m0; mtail = m0; - - if (sfs != NULL) { - mtx_lock(&sfs->mtx); - sfs->count++; - mtx_unlock(&sfs->mtx); - } } if (vp != NULL) Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Mon Oct 9 20:51:58 2017 (r324447) +++ head/sys/sys/mbuf.h Mon Oct 9 21:06:16 2017 (r324448) @@ -426,7 +426,6 @@ struct mbuf { #define EXT_JUMBO16 5 /* jumbo cluster 16184 bytes */ #define EXT_PACKET 6 /* mbuf+cluster from packet zone */ #define EXT_MBUF 7 /* external mbuf reference */ -#define EXT_SFBUF_NOCACHE 8 /* sendfile(2)'s sf_buf not to be cached */ #define EXT_VENDOR1 224 /* for vendor-internal use */ #define EXT_VENDOR2 225 /* for vendor-internal use */ @@ -470,12 +469,6 @@ struct mbuf { "\21EXT_FLAG_VENDOR1\22EXT_FLAG_VENDOR2\23EXT_FLAG_VENDOR3" \ "\24EXT_FLAG_VENDOR4\25EXT_FLAG_EXP1\26EXT_FLAG_EXP2\27EXT_FLAG_EXP3" \ "\30EXT_FLAG_EXP4" - -/* - * External reference/free functions. - */ -void sf_ext_free(void *, void *); -void sf_ext_free_nocache(void *, void *); /* * Flags indicating checksum, segmentation and other offload work to be From owner-svn-src-head@freebsd.org Mon Oct 9 22:11:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74C3EE3D95B; Mon, 9 Oct 2017 22:11:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31571821CA; Mon, 9 Oct 2017 22:11:59 +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 v99MBwEw010910; Mon, 9 Oct 2017 22:11:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MBwCq010906; Mon, 9 Oct 2017 22:11:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092211.v99MBwCq010906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:11:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: arm/uboot efi/boot1 sparc64/loader X-SVN-Commit-Revision: 324449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:11:59 -0000 Author: imp Date: Mon Oct 9 22:11:57 2017 New Revision: 324449 URL: https://svnweb.freebsd.org/changeset/base/324449 Log: Prefer ${LIBSTAND} to -lstand Sponsored by: Netflix Modified: head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/boot1/Makefile head/sys/boot/sparc64/loader/Makefile Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) @@ -121,7 +121,7 @@ CFLAGS+= -fPIC NO_WERROR.clang= DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a # as well as required string and memory functions for all platforms. # DPADD+= ${LIBEFI} ${LIBSTAND} -LDADD+= ${LIBEFI} -lstand +LDADD+= ${LIBEFI} ${LIBSTAND} DPADD+= ${LDSCRIPT} Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ CFLAGS+= -I${SRCTOP}/sys DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ From owner-svn-src-head@freebsd.org Mon Oct 9 22:12:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6557E3D9CA; Mon, 9 Oct 2017 22:12:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A7C88247E; Mon, 9 Oct 2017 22:12:36 +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 v99MCZ81011005; Mon, 9 Oct 2017 22:12:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MCXtD010979; Mon, 9 Oct 2017 22:12:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MCXtD010979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324450 - in head/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader i386/libfirewire i386/libi386 i386/loader libstand32 mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw ... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader i386/libfirewire i386/libi386 i386/loader libstand32 mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/kboot powerpc/ofw... X-SVN-Commit-Revision: 324450 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:36 -0000 Author: imp Date: Mon Oct 9 22:12:32 2017 New Revision: 324450 URL: https://svnweb.freebsd.org/changeset/base/324450 Log: Define SASRC and use it Define SASRC to point to the current libstand sources. Include ../Makefile.inc early enough in a few places so we can .include "${SASRC}/Makefile" and have it work. Create a new pass-up Makefile.inc in sys/boot/userboot to allow this pattern to work. Sponsored by: Netflix Added: head/sys/boot/userboot/Makefile.inc (contents, props changed) Modified: head/sys/boot/Makefile.inc head/sys/boot/arm/uboot/Makefile head/sys/boot/common/Makefile.inc head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/libfirewire/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/libstand32/Makefile head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/ofw/libofw/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/uboot/fdt/Makefile head/sys/boot/uboot/lib/Makefile head/sys/boot/userboot/libstand/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/boot/userboot/zfs/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/Makefile.inc Mon Oct 9 22:12:32 2017 (r324450) @@ -2,6 +2,11 @@ .include +.if !defined(__BOOT_MAKEFILE_INC__) +__BOOT_MAKEFILE_INC__=${MFILE} + +SASRC=${SRCTOP}/lib/libstand + SSP_CFLAGS= .if ${MACHINE_CPUARCH} == "arm" @@ -24,9 +29,9 @@ DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && e DD=dd ${DD_NOSTATUS} .if ${MK_LOADER_FORCE_LE} != "no" - .if ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -mlittle-endian +.endif .endif .endif Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -113,7 +113,7 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} CFLAGS+= -fPIC Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/common/Makefile.inc Mon Oct 9 22:12:32 2017 (r324450) @@ -70,7 +70,7 @@ CFLAGS+= -DBOOT_PROMPT_123 .if defined(LOADER_INSTALL_SUPPORT) SRCS+= install.c -CFLAGS+=-I${.CURDIR}/../../../../lib/libstand +CFLAGS+=-I${SASRC} .endif CLEANFILES+= vers.c Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/efi/fdt/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -17,7 +17,7 @@ CFLAGS+= -mgeneral-regs-only CFLAGS+= -msoft-float .endif -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # EFI library headers CFLAGS+= -I${.CURDIR}/../include Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/efi/libefi/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -37,7 +37,7 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/efi/loader/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -37,7 +37,7 @@ CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif .if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} .endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 Modified: head/sys/boot/i386/libfirewire/Makefile ============================================================================== --- head/sys/boot/i386/libfirewire/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/i386/libfirewire/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -10,7 +10,7 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../btx/lib CFLAGS+= -I${.CURDIR}/../libi386 Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/i386/libi386/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -60,7 +60,7 @@ CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../fi -I${.CURDIR}/../../../contrib/dev/acpica/include \ -I${.CURDIR}/../../.. -I. # the location of libstand -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/i386/loader/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -29,7 +29,7 @@ LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif .if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} .endif .if defined(LOADER_TFTP_SUPPORT) Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/libstand32/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -2,23 +2,25 @@ .include -LIBSTAND_SRC= ${.CURDIR}/../../../lib/libstand +.include "../Makefile.inc" + .if ${MACHINE_CPUARCH} == "amd64" LIBSTAND_CPUARCH=i386 .else LIBSTAND_CPUARCH=${MACHINE_CPUARCH} .endif -LIBC_SRC= ${LIBSTAND_SRC}/../libc +LIBSTAND_SRC= ${SASRC} +LIBC_SRC= ${SRCTOP}/lib/libc INTERNALLIB= INCS= MAN= -.PATH: ${LIBSTAND_SRC} +.PATH: ${SASRC} .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -I. .endif -.include "${LIBSTAND_SRC}/Makefile" +.include "${SASRC}/Makefile" .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/mips/beri/boot2/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -58,7 +58,7 @@ CFLAGS= -ffreestanding \ -g # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../../lib/libstand/ +CFLAGS+= -I${SASRC} LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a LDFLAGS= -nostdlib \ Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -108,7 +108,7 @@ LDFLAGS= -nostdlib \ -e __start # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../../lib/libstand/ +CFLAGS+= -I${SASRC} LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a DPADD= ${LIBFICL} ${LIBSTAND} Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/mips/uboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -116,7 +116,7 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a # clang doesn't understand %D as a specifier to printf Modified: head/sys/boot/ofw/libofw/Makefile ============================================================================== --- head/sys/boot/ofw/libofw/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/ofw/libofw/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -9,7 +9,7 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_cop .PATH: ${.CURDIR}/../../zfs SRCS+= devicename_stubs.c -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -95,7 +95,7 @@ CFLAGS+= -Wa,-mppc64bridge # where to get libstand from LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -93,7 +93,7 @@ CFLAGS+= -I${.CURDIR}/../../ofw/libofw # where to get libstand from LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -92,7 +92,7 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe # where to get libstand from LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -98,7 +98,7 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -80,7 +80,7 @@ LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ # where to get libstand from -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys Modified: head/sys/boot/uboot/fdt/Makefile ============================================================================== --- head/sys/boot/uboot/fdt/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/uboot/fdt/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -12,7 +12,7 @@ SRCS= uboot_fdt.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} # U-Boot library headers CFLAGS+= -I${.CURDIR}/../lib Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/uboot/lib/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -13,7 +13,7 @@ SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${SASRC} .if !defined(LOADER_NO_DISK_SUPPORT) SRCS+= disk.c Added: head/sys/boot/userboot/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/userboot/Makefile.inc Mon Oct 9 22:12:32 2017 (r324450) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/userboot/libstand/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -1,8 +1,9 @@ # $FreeBSD$ .include +.include "../Makefile.inc" -LIBSTAND_SRC= ${.CURDIR}/../../../../lib/libstand +LIBSTAND_SRC= ${SASRC} INTERNALLIB= INCS= Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/userboot/userboot/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -32,7 +32,7 @@ CFLAGS+= -Wall CFLAGS+= -I${.CURDIR}/.. CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -ffreestanding -I. CWARNFLAGS.main.c += -Wno-implicit-function-declaration Modified: head/sys/boot/userboot/zfs/Makefile ============================================================================== --- head/sys/boot/userboot/zfs/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/userboot/zfs/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -12,7 +12,7 @@ SRCS+= zfs.c skein.c skein_block.c CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs CFLAGS+= -I${.CURDIR}/../../../crypto/skein Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Mon Oct 9 22:11:57 2017 (r324449) +++ head/sys/boot/zfs/Makefile Mon Oct 9 22:12:32 2017 (r324450) @@ -12,7 +12,7 @@ CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. -CFLAGS+= -I${.CURDIR}/../../../lib/libstand +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs CFLAGS+= -I${.CURDIR}/../../crypto/skein From owner-svn-src-head@freebsd.org Mon Oct 9 22:12:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 036CEE3D9E7; Mon, 9 Oct 2017 22:12:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C781782485; Mon, 9 Oct 2017 22:12:40 +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 v99MCegs011058; Mon, 9 Oct 2017 22:12:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MCdIn011056; Mon, 9 Oct 2017 22:12:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MCdIn011056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324451 - in head/sys/boot: . fdt X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . fdt X-SVN-Commit-Revision: 324451 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:41 -0000 Author: imp Date: Mon Oct 9 22:12:39 2017 New Revision: 324451 URL: https://svnweb.freebsd.org/changeset/base/324451 Log: Add missing -I${SASRC} in a couple of places so that stand.h doesn't accidentally come in via host pollution. Sponsored by: Netflix Modified: head/sys/boot/Makefile.ficl head/sys/boot/fdt/Makefile Modified: head/sys/boot/Makefile.ficl ============================================================================== --- head/sys/boot/Makefile.ficl Mon Oct 9 22:12:32 2017 (r324450) +++ head/sys/boot/Makefile.ficl Mon Oct 9 22:12:39 2017 (r324451) @@ -27,7 +27,7 @@ CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ - -I${FICLDIR}/../common + -I${FICLDIR}/../common -I${SASRC} .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Mon Oct 9 22:12:32 2017 (r324450) +++ head/sys/boot/fdt/Makefile Mon Oct 9 22:12:39 2017 (r324451) @@ -12,6 +12,7 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c fdt_overlay.c +CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ CFLAGS+= -ffreestanding From owner-svn-src-head@freebsd.org Mon Oct 9 22:12:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCF12E3DA56; Mon, 9 Oct 2017 22:12:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1C4E8255B; Mon, 9 Oct 2017 22:12:49 +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 v99MCmMI011131; Mon, 9 Oct 2017 22:12:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MClEC011111; Mon, 9 Oct 2017 22:12:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MClEC011111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324452 - in head/sys/boot: . arm/uboot efi/boot1 efi/loader i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot mips/beri/boot2 mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw ... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot efi/boot1 efi/loader i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot mips/beri/boot2 mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot... X-SVN-Commit-Revision: 324452 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:50 -0000 Author: imp Date: Mon Oct 9 22:12:46 2017 New Revision: 324452 URL: https://svnweb.freebsd.org/changeset/base/324452 Log: Define LIBSA* and use them instead of overloaded LIBSTAND LIBSA is the current stand alone library. LIBSA32 is the 32-bit version of the library. LIBSAU is the userboot version of libsa. Use the proper define instead of the more generic define. Sponsored by: Netflix Modified: head/sys/boot/Makefile.inc head/sys/boot/arm/uboot/Makefile head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/Makefile.inc Mon Oct 9 22:12:46 2017 (r324452) @@ -6,6 +6,12 @@ __BOOT_MAKEFILE_INC__=${MFILE} SASRC=${SRCTOP}/lib/libstand +# Normal stand alone library +LIBSA=${OBJTOP}/lib/libstand/libstand.a +# stand alone library compiled for 32-bit version of the processor +LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a +# stand along library compiled for userboot +LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a SSP_CFLAGS= Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -112,7 +112,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from CFLAGS+= -I${SASRC} CFLAGS+= -fPIC @@ -120,8 +119,8 @@ CFLAGS+= -fPIC # clang doesn't understand %D as a specifier to printf NO_WERROR.clang= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -90,8 +90,8 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a # __aeabi_* (arm) or __divdi3 (i386). # as well as required string and memory functions for all platforms. # -DPADD+= ${LIBEFI} ${LIBSTAND} -LDADD+= ${LIBEFI} ${LIBSTAND} +DPADD+= ${LIBEFI} ${LIBSA} +LDADD+= ${LIBEFI} ${LIBSA} DPADD+= ${LDSCRIPT} Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/efi/loader/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -150,9 +150,9 @@ loader.efi: ${PROG} LIBEFI= ${.OBJDIR}/../libefi/libefi.a -DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} \ +DPADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} \ ${LDSCRIPT} -LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSTAND} +LDADD= ${LIBFICL} ${LIBEFI} ${LIBFDT} ${LIBEFI_FDT} ${LIBSA} .include Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/i386/gptboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -50,8 +50,6 @@ OPENCRYPTO_XTS= xform_aes_xts.o LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -76,7 +74,7 @@ gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} gptboot.o: ${.CURDIR}/../../common/ufsread.c Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/i386/gptzfsboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -60,8 +60,6 @@ CFLAGS.gcc+= --param max-inline-insns-single=100 LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -87,7 +85,7 @@ gptzfsboot.bin: gptzfsboot.out gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ skein.o skein_block.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/i386/loader/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -90,8 +90,6 @@ LDFLAGS= -static -Ttext 0x0 LIBI386= ${.OBJDIR}/../libi386/libi386.a CFLAGS+= -I${.CURDIR}/.. -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib @@ -127,8 +125,8 @@ FILES+= loader.rc menu.rc # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} .include Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/i386/zfsboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -40,8 +40,6 @@ CFLAGS+= -DSKEIN_LOOP=111 LD_FLAGS=${LD_FLAGS_BIN} -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # Pick up ../Makefile.inc early. .include @@ -83,7 +81,7 @@ zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o skein.o skein_block.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} SRCS= zfsboot.c Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/mips/beri/boot2/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -59,7 +59,6 @@ CFLAGS= -ffreestanding \ # where to get libstand from CFLAGS+= -I${SASRC} -LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a LDFLAGS= -nostdlib \ -static \ @@ -72,7 +71,7 @@ CFLAGS+= -I${.CURDIR}/../common flashboot.elf: relocate.o start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/flashboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSTAND} + ${.ALLSRC} ${LIBSA} flashboot: flashboot.elf ${OBJCOPY} -S -O binary ${.TARGET}.elf ${.TARGET} flashboot.md5: flashboot @@ -80,7 +79,7 @@ flashboot.md5: flashboot jtagboot: start.o boot2.o altera_jtag_uart.o cfi.o sdcard.o ${CC} ${LDFLAGS} -T ${.CURDIR}/jtagboot.ldscript -o ${.TARGET} \ - ${.ALLSRC} ${LIBSTAND} + ${.ALLSRC} ${LIBSA} jtagboot.md5: jtagboot md5 jtagboot > jtagboot.md5 Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/mips/beri/loader/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -109,10 +109,9 @@ LDFLAGS= -nostdlib \ # where to get libstand from CFLAGS+= -I${SASRC} -LIBSTAND= ${.OBJDIR}/../../../../../lib/libstand/libstand.a -DPADD= ${LIBFICL} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBSA} +LDADD= ${LIBFICL} ${LIBSA} loader.help: help.common help.mips cat ${.ALLSRC} | \ Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/mips/uboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -117,14 +117,13 @@ CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from CFLAGS+= -I${SASRC} -LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a # clang doesn't understand %D as a specifier to printf #NO_WERROR.clang= #NO_WERROR= -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA} OBJS+= ${SRCS:N*.h:R:S/$/.o/g} Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/powerpc/kboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -94,11 +94,10 @@ CFLAGS+= -Wa,-mppc64bridge #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.kboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/powerpc/ofw/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -92,11 +92,10 @@ LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} loader.help: help.common help.ofw ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/powerpc/ps3/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -91,11 +91,10 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe #.include "${.CURDIR}/../../ofw/common/Makefile.inc" # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBOFW} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} SC_DFLT_FONT=cp437 Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/powerpc/uboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -97,11 +97,10 @@ CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib # where to get libstand from -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a CFLAGS+= -I${SASRC} -DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} loader.help: help.common help.uboot ${.CURDIR}/../../fdt/help.fdt cat ${.ALLSRC} | \ Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -85,8 +85,8 @@ CFLAGS+= -I${SASRC} # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys -DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} +DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSA} loader.help: help.common help.sparc64 cat ${.ALLSRC} | \ Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Mon Oct 9 22:12:39 2017 (r324451) +++ head/sys/boot/userboot/userboot/Makefile Mon Oct 9 22:12:46 2017 (r324452) @@ -49,8 +49,6 @@ CFLAGS+= -DBF_DICTSIZE=15000 LIBFICL= ${.OBJDIR}/../ficl/libficl.a .endif -LIBSTAND= ${.OBJDIR}/../libstand/libstand.a - .if ${MK_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a @@ -61,7 +59,7 @@ LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} -LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSTAND} +DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} +LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} .include From owner-svn-src-head@freebsd.org Mon Oct 9 22:12:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A6EDE3DA90; Mon, 9 Oct 2017 22:12:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61CBA825CB; Mon, 9 Oct 2017 22:12:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99MCrx5011185; Mon, 9 Oct 2017 22:12:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MCrb0011182; Mon, 9 Oct 2017 22:12:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MCrb0011182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324453 - in head/sys/boot: . libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . libsa X-SVN-Commit-Revision: 324453 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:54 -0000 Author: imp Date: Mon Oct 9 22:12:53 2017 New Revision: 324453 URL: https://svnweb.freebsd.org/changeset/base/324453 Log: Create sys/boot/libsa and build libstand.a there Build libstand from inside the sys/boot build. Redirect all users in sys/boot to grab it from there. We still build it as libstand.a for the moment. When lib/libstand is moved here, we'll change the name. Sponsored by: Netflix Added: head/sys/boot/libsa/ head/sys/boot/libsa/Makefile (contents, props changed) Modified: head/sys/boot/Makefile head/sys/boot/Makefile.inc Modified: head/sys/boot/Makefile ============================================================================== --- head/sys/boot/Makefile Mon Oct 9 22:12:46 2017 (r324452) +++ head/sys/boot/Makefile Mon Oct 9 22:12:53 2017 (r324453) @@ -2,6 +2,7 @@ .include +SUBDIR+= libsa .if ${MK_FORTH} != "no" # Build the add-in FORTH interpreter. SUBDIR+= ficl Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Mon Oct 9 22:12:46 2017 (r324452) +++ head/sys/boot/Makefile.inc Mon Oct 9 22:12:53 2017 (r324453) @@ -7,7 +7,7 @@ __BOOT_MAKEFILE_INC__=${MFILE} SASRC=${SRCTOP}/lib/libstand # Normal stand alone library -LIBSA=${OBJTOP}/lib/libstand/libstand.a +LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a # stand alone library compiled for 32-bit version of the processor LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a # stand along library compiled for userboot Added: head/sys/boot/libsa/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/libsa/Makefile Mon Oct 9 22:12:53 2017 (r324453) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.include + +.include "../Makefile.inc" + +LIBSTAND_SRC= ${SASRC} +LIBC_SRC= ${SRCTOP}/lib/libc +INTERNALLIB= +INCS= +MAN= +.PATH: ${SASRC} + +.include "${SASRC}/Makefile" From owner-svn-src-head@freebsd.org Mon Oct 9 22:12:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E1C2E3DAE1; Mon, 9 Oct 2017 22:12:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03A8882662; Mon, 9 Oct 2017 22:12:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99MCwTs011241; Mon, 9 Oct 2017 22:12:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MCvAf011238; Mon, 9 Oct 2017 22:12:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092212.v99MCvAf011238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:12:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324454 - in head: . lib share/mk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . lib share/mk X-SVN-Commit-Revision: 324454 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:12:59 -0000 Author: imp Date: Mon Oct 9 22:12:57 2017 New Revision: 324454 URL: https://svnweb.freebsd.org/changeset/base/324454 Log: Disconnect libstand from the build. Remove libstand from the src/lib build. Remove LIBSTAND from bsd.libnames.mk. Add affected files to the obsolete files list. Sponsored by: Netflix Modified: head/ObsoleteFiles.inc head/lib/Makefile head/share/mk/bsd.libnames.mk Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Oct 9 22:12:53 2017 (r324453) +++ head/ObsoleteFiles.inc Mon Oct 9 22:12:57 2017 (r324454) @@ -38,6 +38,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20161010: Remove libstand +OLD_FILES+=usr/lib/libstand.a +OLD_FILES+=usr/lib/libstand_p.a +OLD_FILES+=usr/include/stand.h +OLD_FILES+=usr/share/man/man3/libstand.3 # 20171003: remove RCMDS OLD_FILES+=bin/rcp OLD_FILES+=rescue/rcp Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Oct 9 22:12:53 2017 (r324453) +++ head/lib/Makefile Mon Oct 9 22:12:57 2017 (r324454) @@ -75,7 +75,6 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ libsbuf \ libsmb \ libsqlite3 \ - libstand \ libstdbuf \ libstdthreads \ libsysdecode \ Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Mon Oct 9 22:12:53 2017 (r324453) +++ head/share/mk/bsd.libnames.mk Mon Oct 9 22:12:57 2017 (r324454) @@ -142,7 +142,6 @@ LIBSDP?= ${LIBDESTDIR}${LIBDIR_BASE}/libsdp.a LIBSMB?= ${LIBDESTDIR}${LIBDIR_BASE}/libsmb.a LIBSSL?= ${LIBDESTDIR}${LIBDIR_BASE}/libssl.a LIBSSP_NONSHARED?= ${LIBDESTDIR}${LIBDIR_BASE}/libssp_nonshared.a -LIBSTAND?= ${LIBDESTDIR}${LIBDIR_BASE}/libstand.a LIBSTDCPLUSPLUS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdc++.a LIBSTDTHREADS?= ${LIBDESTDIR}${LIBDIR_BASE}/libstdthreads.a LIBSYSDECODE?= ${LIBDESTDIR}${LIBDIR_BASE}/libsysdecode.a From owner-svn-src-head@freebsd.org Mon Oct 9 22:17:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C554E3DC58; Mon, 9 Oct 2017 22:17:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03A2182B49; Mon, 9 Oct 2017 22:17:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99MHJRv011455; Mon, 9 Oct 2017 22:17:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MHJqn011453; Mon, 9 Oct 2017 22:17:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710092217.v99MHJqn011453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 9 Oct 2017 22:17:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324455 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 324455 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:17:20 -0000 Author: imp Date: Mon Oct 9 22:17:18 2017 New Revision: 324455 URL: https://svnweb.freebsd.org/changeset/base/324455 Log: Note libstand is no longer a public interface in UPDATING. Bump FreeBSD_version to 1200051 on the off chance that something cares. Sponsored by: Netflix Modified: head/UPDATING head/sys/sys/param.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Oct 9 22:12:57 2017 (r324454) +++ head/UPDATING Mon Oct 9 22:17:18 2017 (r324455) @@ -51,6 +51,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20171010: + libstand has turned into a private library for sys/boot use only. + It is no longer supported as a public interface outside of sys/boot. + 20171005: The arm port has split armv6 into armv6 and armv7. armv7 is now a valid TARGET_ARCH/MACHINE_ARCH setting. If you have an armv7 system Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Oct 9 22:12:57 2017 (r324454) +++ head/sys/sys/param.h Mon Oct 9 22:17:18 2017 (r324455) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200050 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200051 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Mon Oct 9 22:19:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF8B5E3DD4F; Mon, 9 Oct 2017 22:19:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 991EA82DB5; Mon, 9 Oct 2017 22:19:59 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v99MJwmZ011724; Mon, 9 Oct 2017 22:19:58 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MJwf0011723; Mon, 9 Oct 2017 22:19:58 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201710092219.v99MJwf0011723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Mon, 9 Oct 2017 22:19:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324456 - head/sbin/fsck_ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/fsck_ffs X-SVN-Commit-Revision: 324456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:19:59 -0000 Author: mckusick Date: Mon Oct 9 22:19:58 2017 New Revision: 324456 URL: https://svnweb.freebsd.org/changeset/base/324456 Log: Do not report the filesystem as modified when the only change is to update the timestamp in the superblock. Reported by: Peter Holm MFC after: 1 week Modified: head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Mon Oct 9 22:17:18 2017 (r324455) +++ head/sbin/fsck_ffs/main.c Mon Oct 9 22:19:58 2017 (r324456) @@ -231,6 +231,7 @@ checkfilesys(char *filesys) struct group *grp; struct iovec *iov; char errmsg[255]; + int ofsmodified; int iovlen; int cylno; intmax_t blks, files; @@ -425,10 +426,15 @@ checkfilesys(char *filesys) } /* * Write the superblock so we don't try to recover the - * journal on another pass. + * journal on another pass. If this is the only change + * to the filesystem, we do not want it to be called + * out as modified. */ sblock.fs_mtime = time(NULL); sbdirty(); + ofsmodified = fsmodified; + flush(fswritefd, &sblk); + fsmodified = ofsmodified; } /* From owner-svn-src-head@freebsd.org Mon Oct 9 22:27:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBA47E3DF8C; Mon, 9 Oct 2017 22:27:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9487E832A5; Mon, 9 Oct 2017 22:27:39 +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 v99MRcIx016143; Mon, 9 Oct 2017 22:27:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v99MRcFV016141; Mon, 9 Oct 2017 22:27:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710092227.v99MRcFV016141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 9 Oct 2017 22:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324457 - in head/sys/dev: pccbb pci X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sys/dev: pccbb pci X-SVN-Commit-Revision: 324457 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 22:27:39 -0000 Author: asomers Date: Mon Oct 9 22:27:38 2017 New Revision: 324457 URL: https://svnweb.freebsd.org/changeset/base/324457 Log: Remove embedded newlines from sysctl variable descriptions PR: 112556 Submitted by: Willem Jan Withagen (earlier version) Reported by: Willem Jan Withagen, ighighi@gmail.com MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/dev/pccbb/pccbb_isa.c head/sys/dev/pci/pci.c Modified: head/sys/dev/pccbb/pccbb_isa.c ============================================================================== --- head/sys/dev/pccbb/pccbb_isa.c Mon Oct 9 22:19:58 2017 (r324456) +++ head/sys/dev/pccbb/pccbb_isa.c Mon Oct 9 22:27:38 2017 (r324457) @@ -75,11 +75,11 @@ static SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, static int isa_intr_mask = EXCA_INT_MASK_ALLOWED; SYSCTL_INT(_hw_pcic, OID_AUTO, intr_mask, CTLFLAG_RDTUN, &isa_intr_mask, 0, - "Mask of allowable interrupts for this laptop. The default is generally\n\ -correct, but some laptops do not route all the IRQ pins to the bridge to\n\ -save wires. Sometimes you need a more restrictive mask because some of the\n\ -hardware in your laptop may not have a driver so its IRQ might not be\n\ -allocated."); + "Mask of allowable interrupts for this laptop. The default is generally" + " correct, but some laptops do not route all the IRQ pins to the bridge to" + " save wires. Sometimes you need a more restrictive mask because some of" + " the hardware in your laptop may not have a driver so its IRQ might not be" + " allocated."); /* * CL-PD6722's VSENSE method @@ -90,13 +90,13 @@ allocated."); int pcic_pd6722_vsense = 1; SYSCTL_INT(_hw_pcic, OID_AUTO, pd6722_vsense, CTLFLAG_RDTUN, &pcic_pd6722_vsense, 1, - "Select CL-PD6722's VSENSE method. VSENSE is used to determine the\n\ -volatage of inserted cards. The CL-PD6722 has two methods to determine the\n\ -voltage of the card. 0 means assume a 5.0V card and do not check. 1 means\n\ -use the same method that the CL-PD6710 uses (default). 2 means use the\n\ -same method as the CL-PD6729. 2 is documented in the datasheet as being\n\ -the correct way, but 1 seems to give better results on more laptops."); - + "Select CL-PD6722's VSENSE method. VSENSE is used to determine the" + " voltage of inserted cards. The CL-PD6722 has two methods to determine" + " the voltage of the card. 0 means assume a 5.0V card and do not check. 1" + " means use the same method that the CL-PD6710 uses (default). 2 means use" + " the same method as the CL-PD6729. 2 is documented in the datasheet as" + " being the correct way, but 1 seems to give better results on more" + " laptops."); /***************************************************************************** * End of configurable parameters. *****************************************************************************/ Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Mon Oct 9 22:19:58 2017 (r324456) +++ head/sys/dev/pci/pci.c Mon Oct 9 22:27:38 2017 (r324457) @@ -321,9 +321,9 @@ SYSCTL_NODE(_hw, OID_AUTO, pci, CTLFLAG_RD, 0, "PCI bu static int pci_enable_io_modes = 1; SYSCTL_INT(_hw_pci, OID_AUTO, enable_io_modes, CTLFLAG_RWTUN, &pci_enable_io_modes, 1, - "Enable I/O and memory bits in the config register. Some BIOSes do not\n\ -enable these bits correctly. We'd like to do this all the time, but there\n\ -are some peripherals that this causes problems with."); + "Enable I/O and memory bits in the config register. Some BIOSes do not" + " enable these bits correctly. We'd like to do this all the time, but" + " there are some peripherals that this causes problems with."); static int pci_do_realloc_bars = 0; SYSCTL_INT(_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RWTUN, @@ -334,10 +334,10 @@ SYSCTL_INT(_hw_pci, OID_AUTO, realloc_bars, CTLFLAG_RW static int pci_do_power_nodriver = 0; SYSCTL_INT(_hw_pci, OID_AUTO, do_power_nodriver, CTLFLAG_RWTUN, &pci_do_power_nodriver, 0, - "Place a function into D3 state when no driver attaches to it. 0 means\n\ -disable. 1 means conservatively place devices into D3 state. 2 means\n\ -aggressively place devices into D3 state. 3 means put absolutely everything\n\ -in D3 state."); + "Place a function into D3 state when no driver attaches to it. 0 means" + " disable. 1 means conservatively place devices into D3 state. 2 means" + " aggressively place devices into D3 state. 3 means put absolutely" + " everything in D3 state."); int pci_do_power_resume = 1; SYSCTL_INT(_hw_pci, OID_AUTO, do_power_resume, CTLFLAG_RWTUN, @@ -372,9 +372,10 @@ static int pci_usb_takeover = 1; static int pci_usb_takeover = 0; #endif SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_takeover, CTLFLAG_RDTUN, - &pci_usb_takeover, 1, "Enable early takeover of USB controllers.\n\ -Disable this if you depend on BIOS emulation of USB devices, that is\n\ -you use USB devices (like keyboard or mouse) but do not load USB drivers"); + &pci_usb_takeover, 1, + "Enable early takeover of USB controllers. Disable this if you depend on" + " BIOS emulation of USB devices, that is you use USB devices (like" + " keyboard or mouse) but do not load USB drivers"); static int pci_clear_bars; SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, From owner-svn-src-head@freebsd.org Mon Oct 9 23:20:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956E8E3EEE7; Mon, 9 Oct 2017 23:20:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D46684BB3; Mon, 9 Oct 2017 23:20:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v99NKqtl029450 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 9 Oct 2017 16:20:52 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v99NKqXQ029449; Mon, 9 Oct 2017 16:20:52 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 9 Oct 2017 16:20:52 -0700 From: Gleb Smirnoff To: Sean Bruno , Jason Eggleston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324405 - head/sys/kern Message-ID: <20171009232052.GU1055@FreeBSD.org> References: <201710072330.v97NUv7E040636@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ZYOWEO2dMm2Af3e3" Content-Disposition: inline In-Reply-To: <201710072330.v97NUv7E040636@repo.freebsd.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 23:20:54 -0000 --ZYOWEO2dMm2Af3e3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sean & Jason, On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: S> Author: sbruno S> Date: Sat Oct 7 23:30:57 2017 S> New Revision: 324405 S> URL: https://svnweb.freebsd.org/changeset/base/324405 S> S> Log: S> Check so_error early in sendfile() call. Prior to this patch, if a S> connection was reset by the remote end, sendfile() would just report S> ENOTCONN instead of ECONNRESET. S> S> Submitted by: Jason Eggleston S> Reviewed by: glebius S> Sponsored by: Limelight Networks S> Differential Revision: https://reviews.freebsd.org/D12575 S> S> Modified: S> head/sys/kern/kern_sendfile.c S> S> Modified: head/sys/kern/kern_sendfile.c S> ============================================================================== S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 (r324404) S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 (r324405) S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, struct file S> *so = (*sock_fp)->f_data; S> if ((*so)->so_type != SOCK_STREAM) S> return (EINVAL); S> + if ((*so)->so_error) { S> + error = (*so)->so_error; S> + (*so)->so_error = 0; S> + return (error); S> + } S> if (((*so)->so_state & SS_ISCONNECTED) == 0) S> return (ENOTCONN); S> return (0); Despite my initial positive review, now I am quite unsure on that. Problem is that sendfile(2) isn't defined by SUS, so there is no distinctive final answer on that. Should we match other OSes? Should we match our historic behaviour? Or should we match write(2)/send(2) to socket, which are closest analogy. I probably believe in the latter: sendfile(2) belongs to write(2)/send(2) family. SUS specifies that write may return ECONNRESET. It also documents EPIPE. However, our manual page documents only EPIPE for both send(2) and write(2). For write we have: SOCKBUF_LOCK(&so->so_snd); if (so->so_snd.sb_state & SBS_CANTSENDMORE) { SOCKBUF_UNLOCK(&so->so_snd); error = EPIPE; goto out; } if (so->so_error) { error = so->so_error; so->so_error = 0; SOCKBUF_UNLOCK(&so->so_snd); goto out; } Indeed, EPIPE will be returned prior to return/clear of so_error, which supposedly is ECONNRESET. In the sendfile(2) implementation we see exactly same code: if (so->so_snd.sb_state & SBS_CANTSENDMORE) { error = EPIPE; SOCKBUF_UNLOCK(&so->so_snd); goto done; } else if (so->so_error) { error = so->so_error; so->so_error = 0; SOCKBUF_UNLOCK(&so->so_snd); goto done; } But it isn't reached. Before due to SS_ISCONNECTED check, now due to your change. Now we got two spots where so_error is returned/cleared. For the receive family (read(2) and recv(2)), SUS specifies ECONNRESET and our code does that. It also clears so_error. So, after your change at least one standard case is broken: an application that polls/selects for both readability and writeability of a socket. It discovers that socket is available for writing, does sendfile(2), receives ECONNRESET. Then it does read on the socket, and blocks(?) or returns a bogus error(?), not sure. But definitely not ECONNRESET, since it is now cleared. Now, where does this ENOTCONN come from? These two lines: if (((*so)->so_state & SS_ISCONNECTED) == 0) return (ENOTCONN); can be traced back all the way to original 1998 commit of sendfile. Here comes difference between sendfile(2) and send(2). In send(2), this check is done _after_ so_error check, so your change is correct in placing of so_error check wrt so_state check, but is incorrect in placing wrt socket buffer state check. After all this considerations, I would suggest to revert your change, and apply this patch. It would make behavior of sendfile(2) to match send(2). I would appreciate more reviews around it. -- Gleb Smirnoff --ZYOWEO2dMm2Af3e3 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="sendfile-error.diff" Index: kern_sendfile.c =================================================================== --- kern_sendfile.c (revision 324457) +++ kern_sendfile.c (working copy) @@ -507,13 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct *so = (*sock_fp)->f_data; if ((*so)->so_type != SOCK_STREAM) return (EINVAL); - if ((*so)->so_error) { - error = (*so)->so_error; - (*so)->so_error = 0; - return (error); - } - if (((*so)->so_state & SS_ISCONNECTED) == 0) - return (ENOTCONN); return (0); } @@ -622,6 +615,12 @@ retry_space: SOCKBUF_UNLOCK(&so->so_snd); goto done; } + if ((so->so_state & SS_ISCONNECTED) == 0) { + SOCKBUF_UNLOCK(&so->so_snd); + error = ENOTCONN; + goto done; + } + space = sbspace(&so->so_snd); if (space < rem && (space <= 0 || --ZYOWEO2dMm2Af3e3-- From owner-svn-src-head@freebsd.org Mon Oct 9 23:24:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63D31E3EFB0; Mon, 9 Oct 2017 23:24:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37B5D84F37; Mon, 9 Oct 2017 23:24:31 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id E347910A87D; Mon, 9 Oct 2017 19:24:29 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324452 - in head/sys/boot: . arm/uboot efi/boot1 efi/loader i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot mips/beri/boot2 mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw ... Date: Mon, 09 Oct 2017 16:23:35 -0700 Message-ID: <2405988.NgFGazePSZ@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201710092212.v99MClEC011111@repo.freebsd.org> References: <201710092212.v99MClEC011111@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, 09 Oct 2017 19:24:30 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 23:24:31 -0000 On Monday, October 09, 2017 10:12:47 PM Warner Losh wrote: > Author: imp > Date: Mon Oct 9 22:12:46 2017 > New Revision: 324452 > URL: https://svnweb.freebsd.org/changeset/base/324452 > > Log: > Define LIBSA* and use them instead of overloaded LIBSTAND > > LIBSA is the current stand alone library. LIBSA32 is the 32-bit > version of the library. LIBSAU is the userboot version of libsa. Use > the proper define instead of the more generic define. > > Sponsored by: Netflix > > Modified: > head/sys/boot/Makefile.inc > head/sys/boot/arm/uboot/Makefile > head/sys/boot/efi/boot1/Makefile > head/sys/boot/efi/loader/Makefile > head/sys/boot/i386/gptboot/Makefile > head/sys/boot/i386/gptzfsboot/Makefile > head/sys/boot/i386/loader/Makefile > head/sys/boot/i386/zfsboot/Makefile > head/sys/boot/mips/beri/boot2/Makefile > head/sys/boot/mips/beri/loader/Makefile > head/sys/boot/mips/uboot/Makefile > head/sys/boot/powerpc/kboot/Makefile > head/sys/boot/powerpc/ofw/Makefile > head/sys/boot/powerpc/ps3/Makefile > head/sys/boot/powerpc/uboot/Makefile > head/sys/boot/sparc64/loader/Makefile > head/sys/boot/userboot/userboot/Makefile > > Modified: head/sys/boot/Makefile.inc > ============================================================================== > --- head/sys/boot/Makefile.inc Mon Oct 9 22:12:39 2017 (r324451) > +++ head/sys/boot/Makefile.inc Mon Oct 9 22:12:46 2017 (r324452) > @@ -6,6 +6,12 @@ > __BOOT_MAKEFILE_INC__=${MFILE} > > SASRC=${SRCTOP}/lib/libstand > +# Normal stand alone library > +LIBSA=${OBJTOP}/lib/libstand/libstand.a > +# stand alone library compiled for 32-bit version of the processor > +LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a > +# stand along library compiled for userboot > +LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a s/along/alone/. bde@ probably prefers that the comments start with a capital letter as well. -- John Baldwin From owner-svn-src-head@freebsd.org Mon Oct 9 23:56:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC154E3F554 for ; Mon, 9 Oct 2017 23:56:10 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::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 8D59FD5C for ; Mon, 9 Oct 2017 23:56:10 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x233.google.com with SMTP id i124so566840wmf.3 for ; Mon, 09 Oct 2017 16:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=PQ/8BJ9i3CexgPdglZN1iGMsuEcPLPGg9uK6updi6ps=; b=v0uFV2T2IlAUB3a7Th1dB+3qym0fMY+VPIcie2pvTQ0ApF9kREm5APP4L8kOH/a3mJ BScJq4xNop4hNiATcQZPhMnrqLG13dFEHSlmR70t2Bt9etIkSZErNKfT/kApK6Vvz0+U +a2NsYjYbEeHpyKosrPm2JexW/sAVaXYAtHC0UdNX48saies8XKRHIP+AIZYrFtS4q54 tkIpgiwvPJMV5AHS+SZMp5XDk6/LXM9HGmNBuOORa7wExwWsy6b1jRSUzfY1T9wz+KpY 8invKjU/wOxdfX2P5u730UkJ9M+yNPrHCbL+/c3+HMGAh2oVGsoPq+8rXk2PePFQtl39 ZnSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=PQ/8BJ9i3CexgPdglZN1iGMsuEcPLPGg9uK6updi6ps=; b=G/ANgcBPsgVd4maTAubCQOq2pE2eUuvLBvhqAH1BVmDTGSu5gc4SZuTepGK5Px/lyP acH0RERgfVsFHgI5WGNpurcQXvFfvGaTSmKfYu38qhboWaqqzsbvvvRC6CosEbX20G+F d63Fu1d2jVNRJIJzMd2ZTo1zCIcwonDFUvJGgerzF58FH0RaYSo9y4mvRGwUPbfMyQfB QEmhIkT2udlYd7/cndUxNjwanTtriWfPyDFc50xrcU4VySLlKF0wrP8XsRH3LowY+i/1 hHlYWbO2jmmd2ocYBzg1Yt1ZGpd3yhcnaaC2/o64mYOD4K1niN/Qdwg7NTRTcG1AFtk6 HcpQ== X-Gm-Message-State: AMCzsaUV19zhCdR1xS+BXyZBeD6WbVdjbtYGs0WtYoGVv22lubGGJuBO uXrPfiHWCnZ5/fEUzQ25luXJAe1cEKQ= X-Google-Smtp-Source: AOwi7QCy6egPPfs7veSEilYvcPom/uwnZ10yLjCyCgMOHrSeRuVYQnEZGLGE/HXIzpnCEFImAOX5MA== X-Received: by 10.223.163.26 with SMTP id c26mr4517219wrb.185.1507593368262; Mon, 09 Oct 2017 16:56:08 -0700 (PDT) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id v80sm1808085wrc.49.2017.10.09.16.56.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 16:56:06 -0700 (PDT) Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Tue, 10 Oct 2017 00:56:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710092211.v99MBwCq010906@repo.freebsd.org> Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 23:56:11 -0000 Not sure which of these sets of changes caused the issue but a clean build from scratch is currently failing here with: In file included from /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/ufs_module.c:41: In file included from /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/boot_module.h:35: /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: fatal error: 'stand.h' file not found #include          ^~~~~~~~~ Build was with -j24 in case it matters, going to try without -j but that will take many hours On 09/10/2017 23:11, Warner Losh wrote: > Author: imp > Date: Mon Oct 9 22:11:57 2017 > New Revision: 324449 > URL: https://svnweb.freebsd.org/changeset/base/324449 > > Log: > Prefer ${LIBSTAND} to -lstand > > Sponsored by: Netflix > > Modified: > head/sys/boot/arm/uboot/Makefile > head/sys/boot/efi/boot1/Makefile > head/sys/boot/sparc64/loader/Makefile > > Modified: head/sys/boot/arm/uboot/Makefile > ============================================================================== > --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -121,7 +121,7 @@ CFLAGS+= -fPIC > NO_WERROR.clang= > > DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} > -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand > +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} > > OBJS+= ${SRCS:N*.h:R:S/$/.o/g} > > > Modified: head/sys/boot/efi/boot1/Makefile > ============================================================================== > --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a > # as well as required string and memory functions for all platforms. > # > DPADD+= ${LIBEFI} ${LIBSTAND} > -LDADD+= ${LIBEFI} -lstand > +LDADD+= ${LIBEFI} ${LIBSTAND} > > DPADD+= ${LDSCRIPT} > > > Modified: head/sys/boot/sparc64/loader/Makefile > ============================================================================== > --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > CFLAGS+= -I${SRCTOP}/sys > > DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} > -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand > +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} > > loader.help: help.common help.sparc64 > cat ${.ALLSRC} | \ > From owner-svn-src-head@freebsd.org Tue Oct 10 00:00:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8AE2E3F798 for ; Tue, 10 Oct 2017 00:00:05 +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 A6746EFA for ; Tue, 10 Oct 2017 00:00:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x235.google.com with SMTP id z187so22523518ioz.12 for ; Mon, 09 Oct 2017 17:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PPIKE1TxdyYeVNgxrqBnX+xK7h4I+d19dRUznmMCcvg=; b=YU+m3BiCNAE7+6U/qGwq5fb76PS5Bwro77cCwYkX8YDpiCFRyGNVk67wQsBnwIgnwA +ibvHNOD4Piq8MKvmM0fWK+WveS9J5lqxayDmIVh6oviSTJUDv4+A0ba7iM3exTe8Stm cxwkDuiXx4iXo9FjgXeChLCADFOUDy2tVHbId7/HXXWBXY7alSPHodxoLg6pjNTivM7o xJnQNqPsznUHnqAQFlC7tn1XDXLvs/oaRerRPJzPEE38JMXBo/UKoPjKWbHj0ZIhfQft Orj4WEpB8PIEcEGpAGB1862S1k17JcjelXyf/4w0B5EAHfGVdioTgj3aBYMs9wh4AhsQ 3n2Q== 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=PPIKE1TxdyYeVNgxrqBnX+xK7h4I+d19dRUznmMCcvg=; b=np361lcrwAYId3rSq/XFiTYcSy7Uo8KXfUyMR5T3OL7+ZceKrOcP5Wwq4yrO5FQINu wyn1OMbsRhMbPA5DZx8P8deAE8GS4MHf33EzCYLPyTOd4fDqQBxGLC3Ojid/Eb1yYDf2 Kn6tF44cYODjE/HoSuBgxWbxjl9lGJdf6fktryJOyPRrWiFXZB8FnDjCYzubR6jj/Ith vWCDwEJ0re6wV8uU/2yDU72GAG+RMUvMThYU3hNj0cHSiRl21YWeGSAQ+KQPuyETjhmi 6WTfO0Qz3B6JiN0LQ1Iky6DneWqT4wdII+asi6WGwMYxRxBk9b9sdToR/wG3Yc0XgQTT M7fQ== X-Gm-Message-State: AMCzsaX3coEh9KxWFGfGGBiT3/yVSBqoSFbAKmpdDjpPrdnYBoeZreqN 2MarsN92V5DoympIKuzZCElcJQjyhlorKs7VD+Ls+g== X-Google-Smtp-Source: AOwi7QBiv4gVKIcgUmLPX4r70AFJh2UhGCgZhxsyzD43UPHeQ7iEpVarXl7F4ttTJdmbzU86ad7ttlPPwvmB1yhKEKo= X-Received: by 10.107.133.85 with SMTP id h82mr14342327iod.208.1507593604981; Mon, 09 Oct 2017 17:00:04 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 9 Oct 2017 17:00:04 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:8936:338a:89de:d5ea] In-Reply-To: References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Warner Losh Date: Mon, 9 Oct 2017 18:00:04 -0600 X-Google-Sender-Auth: pQkSVC_67vTljgjQ5ovRalmPG8M Message-ID: Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Steven Hartland Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:00:06 -0000 Can you find out? A clean build works for me. Chances are good that sys/boot/efi/boot1/Makefile needs a line like CFLAGS+=-I${SASRC} or similar. I have to go out for 2 hours, but will look into when I get back if you can't make progress. I don't see one there and I had to add it a couple of other places. Warner On Mon, Oct 9, 2017 at 5:56 PM, Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > Not sure which of these sets of changes caused the issue but a clean build > from scratch is currently failing here with: > > In file included from /usr/home/smh/freebsd/base/ > head/sys/boot/efi/boot1/ufs_module.c:41: > In file included from /usr/home/smh/freebsd/base/ > head/sys/boot/efi/boot1/boot_module.h:35: > /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: > fatal error: 'stand.h' file not found > #include > ^~~~~~~~~ > > Build was with -j24 in case it matters, going to try without -j but that > will take many hours > > > On 09/10/2017 23:11, Warner Losh wrote: > > Author: imp > Date: Mon Oct 9 22:11:57 2017 > New Revision: 324449 > URL: https://svnweb.freebsd.org/changeset/base/324449 > > Log: > Prefer ${LIBSTAND} to -lstand > > Sponsored by: Netflix > > Modified: > head/sys/boot/arm/uboot/Makefile > head/sys/boot/efi/boot1/Makefile > head/sys/boot/sparc64/loader/Makefile > > Modified: head/sys/boot/arm/uboot/Makefile > ============================================================================== > --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -121,7 +121,7 @@ CFLAGS+= -fPIC > NO_WERROR.clang= > > DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} > -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand > +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} > > OBJS+= ${SRCS:N*.h:R:S/$/.o/g} > > > Modified: head/sys/boot/efi/boot1/Makefile > ============================================================================== > --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a > # as well as required string and memory functions for all platforms. > # > DPADD+= ${LIBEFI} ${LIBSTAND} > -LDADD+= ${LIBEFI} -lstand > +LDADD+= ${LIBEFI} ${LIBSTAND} > > DPADD+= ${LDSCRIPT} > > > Modified: head/sys/boot/sparc64/loader/Makefile > ============================================================================== > --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) > +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) > @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ > CFLAGS+= -I${SRCTOP}/sys > > DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} > -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand > +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} > > loader.help: help.common help.sparc64 > cat ${.ALLSRC} | \ > > > > From owner-svn-src-head@freebsd.org Tue Oct 10 00:01:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 071ACE3F8A6; Tue, 10 Oct 2017 00:01:06 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: from mail-oi0-x244.google.com (mail-oi0-x244.google.com [IPv6:2607:f8b0:4003:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBFBD1220; Tue, 10 Oct 2017 00:01:05 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: by mail-oi0-x244.google.com with SMTP id f3so14370160oia.2; Mon, 09 Oct 2017 17:01:05 -0700 (PDT) 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=kd+M/rO07n5xVOIwWxq+yjoljlc2j8tL8dCwcZMzWYo=; b=tvPHoJud6jsnfEpSL4N2lMm+7cOpkZkI+HXKTBPNu4zxIwvtpb6pm/vmaClG7Wb2Ku KdgjLLlEl6Fqx29YIElbL98pNjRQAyZwxC8lU5LFd19MO1sH8UGIuMupNZP4PFW+HSve vCLJkVGMHCKSWbk3mj5O6ArM5+4QPmvAOKQlbEmyk8RKhW2e6h+d9WpDM9VgyJ6XPCaL q4KRazI9N4UKoJEkjoZZrZeH8H8jPDYvqvnqfHsupZMvt6ZFodWkZLzm/YbuLUItcQtK e0Tw4ERtCqL8viWESZiOIgvr+bhUtCvvE0RkhI4adcpj3w21Nm3qgbCP2g8/OrUZfkZF KJ7A== 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=kd+M/rO07n5xVOIwWxq+yjoljlc2j8tL8dCwcZMzWYo=; b=nHMxiMB4OA9uTSFP3KrKUb7PrACfPeLBc3Cab4nq5VZxrZz6dGm7ncYG7DacS8jDvL OpUhJxjPSIQQkgAicGKMw1GNpYESNCC4UjKcAZnr0SN6Ge4su4pssWs0SJK49ksuiwMk E2AAF+gPu2cIKuqX0S5UwojCucsM+/ZXjgNLvozqvKY13CYDyupBebkUa03S4ChgDRPD f0UyeyH5tG3cnw003ubnKKVamunZFTQJWoP5KCafx1enn5/yg4+U7WUkFyi3eVR5kDQN JN0EvjWo1HXI171fWUEnDAJGqOMjqKc3RWoVWPA/C3xODqITw+iqZY1uZ9LMEa9s459D SH3A== X-Gm-Message-State: AMCzsaVKqw8TNRzdAPIIrCIpRGL93LL3Mo1/5PFfMNv5eto5pPUqQIuF XRsOFI19MTtOrfRwNdhkEo7+1zCm/EGLnY9y3b8bYdl+ X-Google-Smtp-Source: AOwi7QA3f1tWeMpoWStlq0VJx9XCR1cVVheIeaYD3Xfh+atxUjJJ9dyzoyZlTYLsHjmuH95eI8LtttIp1dFK4bsPGX0= X-Received: by 10.157.63.173 with SMTP id r42mr628849otc.107.1507593664612; Mon, 09 Oct 2017 17:01:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.10.211 with HTTP; Mon, 9 Oct 2017 17:01:03 -0700 (PDT) In-Reply-To: <20171009232052.GU1055@FreeBSD.org> References: <201710072330.v97NUv7E040636@repo.freebsd.org> <20171009232052.GU1055@FreeBSD.org> From: Jason Eggleston Date: Mon, 9 Oct 2017 17:01:03 -0700 Message-ID: Subject: Re: svn commit: r324405 - head/sys/kern To: Gleb Smirnoff Cc: Sean Bruno , 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.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:01:06 -0000 In tcp_input.c, this is where a RST is handled. so_error gets ECONNRESET, then tcp_close() is called. case TCPS_ESTABLISHED: case TCPS_FIN_WAIT_1: case TCPS_FIN_WAIT_2: case TCPS_CLOSE_WAIT: case TCPS_CLOSING: case TCPS_LAST_ACK: so->so_error = ECONNRESET; close: /* FALLTHROUGH */ default: tp = tcp_close(tp); tcp_close() calls soisdisconnected() which sets this flag: so->so_state |= SS_ISDISCONNECTED; Followed by: ... socantrcvmore_locked(so); ... socantsendmore_locked(so); ... Those two functions set these flags: so->so_rcv.sb_state |= SBS_CANTRCVMORE; so->so_snd.sb_state |= SBS_CANTSENDMORE; A TCP session cannot survive a RST, and i/o calls will not work afterword, no matter how many times you try. Having said that, there's a race condition between when so_error is set and when the socket and socket buffer flags are set, and I agree with your strategy of: - have sendfile() match send() - The current send() behavior is probably fine as is I agree sendfile() should match write() and send(), by checking in this order: SBS_CANTSENDMORE so_error SS_ISCONNECTED and will prep a new review with your patch. On Mon, Oct 9, 2017 at 4:20 PM, Gleb Smirnoff wrote: > Sean & Jason, > > On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: > S> Author: sbruno > S> Date: Sat Oct 7 23:30:57 2017 > S> New Revision: 324405 > S> URL: https://svnweb.freebsd.org/changeset/base/324405 > S> > S> Log: > S> Check so_error early in sendfile() call. Prior to this patch, if a > S> connection was reset by the remote end, sendfile() would just report > S> ENOTCONN instead of ECONNRESET. > S> > S> Submitted by: Jason Eggleston > S> Reviewed by: glebius > S> Sponsored by: Limelight Networks > S> Differential Revision: https://reviews.freebsd.org/D12575 > S> > S> Modified: > S> head/sys/kern/kern_sendfile.c > S> > S> Modified: head/sys/kern/kern_sendfile.c > S> ============================================================ > ================== > S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 > (r324404) > S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 > (r324405) > S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, struct > file > S> *so = (*sock_fp)->f_data; > S> if ((*so)->so_type != SOCK_STREAM) > S> return (EINVAL); > S> + if ((*so)->so_error) { > S> + error = (*so)->so_error; > S> + (*so)->so_error = 0; > S> + return (error); > S> + } > S> if (((*so)->so_state & SS_ISCONNECTED) == 0) > S> return (ENOTCONN); > S> return (0); > > Despite my initial positive review, now I am quite unsure on that. > > Problem is that sendfile(2) isn't defined by SUS, so there is no > distinctive final answer on that. Should we match other OSes? > Should we match our historic behaviour? Or should we match > write(2)/send(2) to socket, which are closest analogy. I probably > believe in the latter: sendfile(2) belongs to write(2)/send(2) > family. > > SUS specifies that write may return ECONNRESET. It also documents > EPIPE. However, our manual page documents only EPIPE for both > send(2) and write(2). For write we have: > > SOCKBUF_LOCK(&so->so_snd); > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > SOCKBUF_UNLOCK(&so->so_snd); > error = EPIPE; > goto out; > } > if (so->so_error) { > error = so->so_error; > so->so_error = 0; > SOCKBUF_UNLOCK(&so->so_snd); > goto out; > } > > Indeed, EPIPE will be returned prior to return/clear of so_error, > which supposedly is ECONNRESET. > > In the sendfile(2) implementation we see exactly same code: > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > error = EPIPE; > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } else if (so->so_error) { > error = so->so_error; > so->so_error = 0; > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } > > But it isn't reached. Before due to SS_ISCONNECTED check, now > due to your change. Now we got two spots where so_error is > returned/cleared. > > For the receive family (read(2) and recv(2)), SUS specifies > ECONNRESET and our code does that. It also clears so_error. > > So, after your change at least one standard case is broken: an > application that polls/selects for both readability and > writeability of a socket. It discovers that socket is available > for writing, does sendfile(2), receives ECONNRESET. Then it does > read on the socket, and blocks(?) or returns a bogus error(?), > not sure. But definitely not ECONNRESET, since it is now cleared. > > Now, where does this ENOTCONN come from? These two lines: > > if (((*so)->so_state & SS_ISCONNECTED) == 0) > return (ENOTCONN); > > can be traced back all the way to original 1998 commit of sendfile. > > Here comes difference between sendfile(2) and send(2). In send(2), > this check is done _after_ so_error check, so your change is correct > in placing of so_error check wrt so_state check, but is incorrect > in placing wrt socket buffer state check. > > After all this considerations, I would suggest to revert your change, > and apply this patch. It would make behavior of sendfile(2) to match > send(2). I would appreciate more reviews around it. > > -- > Gleb Smirnoff > From owner-svn-src-head@freebsd.org Tue Oct 10 00:01:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43225E3F9B1 for ; Tue, 10 Oct 2017 00:01:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04BB21450 for ; Tue, 10 Oct 2017 00:01:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x241.google.com with SMTP id m16so8297370iod.5 for ; Mon, 09 Oct 2017 17:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3LR223Te/Io7e7r47PuEY1SpN2gY+9GszCzIChSgonI=; b=m99EuQYVStiWw8dqBHHCGS8L8j+fJJsT2R6P9Gl6F5to/h1J2IHnThpYQfp+rmEaZG v4bIFoUiFqdIcljXrng5pdAR7tFUuec9rEyMFW+VVenS+iI3IJ2mfV/WwN1XuwyHi7OW fD4EIKFOSsj9lioXMCfUesvrFocvWO5N5tP1y8L5+HwrNP83Hl9xb0liSmtGIaHu1M41 5FXizJ7g/hA5Jfi4/tGVTREBB8ykkIBtotgg+HGQYavf5AYt2fEn8s9uPQ8pWV117JSN y4cc3PxVLVk+6w2m1Kd8eAceW8tBS19viuafEet2SeRHpjl3RRhleUPNt83r1m6LHpfa kFFA== 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=3LR223Te/Io7e7r47PuEY1SpN2gY+9GszCzIChSgonI=; b=dwgnd+JOgP0Y+leefTt6ETCGsPBifJ9Cnh6dhq4z/VMfMIbCsy6l5au6tOdKEwioVr HqL1BTDh6SpU2a9TX4dSA10gbOWlBNs65u9vJPO7AnUMCQyGxQ8Uid2l4l431dMfullr 9zjd1OlOyzyaCGNlYQram+903i00/4jozl46gQtRoDkGgXqPDlUQn0FaESDMPelqndVp vwnlZB89vNP0dqzNw2EkAK2a63yBImXBAstl6Ia+O8UPod2oP4d2ETc2m8C3PP9Vta8H 4OMMgMnq05uPEMSH5DVwrdtIrmzDSszxKOXB3fWUIYW/SRTQPmlUhDqir9VtpETAs5b6 Dkdw== X-Gm-Message-State: AMCzsaVtrRKI8RhqIlQZKqmRyvTkcQ3Z9XhgLN57dctZA3iWmAjSSnW7 PXONTTy0cKZz5bdGEe1XD0sTZpgVexlQxOkkAN490A== X-Google-Smtp-Source: AOwi7QAQQ5wLQ87pVnQGKe+BSdplbJ9T1kNEuy16FPaCjdW1ULXJ24gqBEYUz3gK9y5Ptz3dn2O0ryD7CaMQAvj5GY4= X-Received: by 10.107.68.6 with SMTP id r6mr16407396ioa.282.1507593705280; Mon, 09 Oct 2017 17:01:45 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 9 Oct 2017 17:01:44 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:8936:338a:89de:d5ea] In-Reply-To: References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Warner Losh Date: Mon, 9 Oct 2017 18:01:44 -0600 X-Google-Sender-Auth: K-A_U0F4G0vfvogxaol_0pssNaE Message-ID: Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Steven Hartland Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:01:46 -0000 Oh, killed /usr/include/stand.h and found it. I'll post a fix when I get back. On Mon, Oct 9, 2017 at 6:00 PM, Warner Losh wrote: > Can you find out? A clean build works for me. Chances are good that > sys/boot/efi/boot1/Makefile needs a line like > CFLAGS+=-I${SASRC} or similar. I have to go out for 2 hours, but will look > into when I get back if you can't make progress. I don't see one there and > I had to add it a couple of other places. > > Warner > > On Mon, Oct 9, 2017 at 5:56 PM, Steven Hartland < > steven.hartland@multiplay.co.uk> wrote: > >> Not sure which of these sets of changes caused the issue but a clean >> build from scratch is currently failing here with: >> >> In file included from /usr/home/smh/freebsd/base/hea >> d/sys/boot/efi/boot1/ufs_module.c:41: >> In file included from /usr/home/smh/freebsd/base/hea >> d/sys/boot/efi/boot1/boot_module.h:35: >> /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: >> fatal error: 'stand.h' file not found >> #include >> ^~~~~~~~~ >> >> Build was with -j24 in case it matters, going to try without -j but that >> will take many hours >> >> >> On 09/10/2017 23:11, Warner Losh wrote: >> >> Author: imp >> Date: Mon Oct 9 22:11:57 2017 >> New Revision: 324449 >> URL: https://svnweb.freebsd.org/changeset/base/324449 >> >> Log: >> Prefer ${LIBSTAND} to -lstand >> >> Sponsored by: Netflix >> >> Modified: >> head/sys/boot/arm/uboot/Makefile >> head/sys/boot/efi/boot1/Makefile >> head/sys/boot/sparc64/loader/Makefile >> >> Modified: head/sys/boot/arm/uboot/Makefile >> ============================================================================== >> --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -121,7 +121,7 @@ CFLAGS+= -fPIC >> NO_WERROR.clang= >> >> DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >> -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand >> +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >> >> OBJS+= ${SRCS:N*.h:R:S/$/.o/g} >> >> >> Modified: head/sys/boot/efi/boot1/Makefile >> ============================================================================== >> --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a >> # as well as required string and memory functions for all platforms. >> # >> DPADD+= ${LIBEFI} ${LIBSTAND} >> -LDADD+= ${LIBEFI} -lstand >> +LDADD+= ${LIBEFI} ${LIBSTAND} >> >> DPADD+= ${LDSCRIPT} >> >> >> Modified: head/sys/boot/sparc64/loader/Makefile >> ============================================================================== >> --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ >> CFLAGS+= -I${SRCTOP}/sys >> >> DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >> -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand >> +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >> >> loader.help: help.common help.sparc64 >> cat ${.ALLSRC} | \ >> >> >> >> > From owner-svn-src-head@freebsd.org Tue Oct 10 00:09:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49A9CE3FD59; Tue, 10 Oct 2017 00:09:51 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: from mail-oi0-x232.google.com (mail-oi0-x232.google.com [IPv6:2607:f8b0:4003:c06::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 0AD9817BD; Tue, 10 Oct 2017 00:09:51 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: by mail-oi0-x232.google.com with SMTP id j126so42524578oia.10; Mon, 09 Oct 2017 17:09:51 -0700 (PDT) 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=8q7VMyLqrSo1ghQTe/Sr6Z65NBz5KrRuWT/vP+5bCqY=; b=mS7RVB2sG/ypS5CtHAgZjt5ZA+75KsuzzRl7mt5CQ8aAbkBF+HQJfd+yAFQWgQ6VYT yKpl/Adwng/uT4zWsD69U+SeeMNu/368yiSScEpbS6lot7gvvMuLJUDEjd4zSEmpsDBD aPCjng083UkX6hLxKj1PZ1jJwHRJcNpaXYh+GVdXAn4tP5g+mO5uAlzTImQtOkxV5QC+ q7fCgnWKTg7bjYV7tz4Sr2glZwm5wgK0Orb8W3o6gzBZTYmBGXiabSPIdn+Ae2cp4GEo reNqittL/5c0J4vKuN4K8/5XM3iRwtXZ5RjDWKRGFrZJcX+Ka3lIveWQ0Kn0a5jZFqUb q7BA== 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=8q7VMyLqrSo1ghQTe/Sr6Z65NBz5KrRuWT/vP+5bCqY=; b=IqgXqZDUNlr1bxPxrnlh9i+TawLBTUyMuoo1CuXKzQ8A6yNBTvffYQHcalsiXPGqph JT/ObDgrQrQqsHk60CsNiy+UP1rsyf3YMH0O3xMMQnvAGSuZgH9CYT8qmCHxUIcx9aBx PjQ5UPwnoysbqTq5374zSBl8erNJkUDjrKQpbyM2H6bDnJ3iDFhltEnNnH9/1PZ8aK5t CHlLaEfbNx6oXTN1HUsDW1aqxumgwNnaKUkxydg7MvhDOjt1S/jI6Sc8Pbmgs+KheQjc 7nvM0GG708FVRU2kq2migz08Kwmxd5zODLxs/qEBQyXIEwqyJ9g3/WR0FPmLBf8PQEAy r5WA== X-Gm-Message-State: AMCzsaXk12c86PsIu2Y/x+6KZA1NKrTMGgesIZ8zGdTTtt7kwwwLiYhK nuDlaOvW+AiPALdpsyocjYu75iUevnunLrZsqzKhHm+w X-Google-Smtp-Source: AOwi7QAK9g2fVoOF41lAyBGYgAUaFlbo08mPcAXY1N0v9FuHCBRXieK/s7AAwxdyFU8zkaBtsf7u9IYnUTGX3lP8zIw= X-Received: by 10.157.73.131 with SMTP id g3mr513500otf.451.1507594190136; Mon, 09 Oct 2017 17:09:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.10.211 with HTTP; Mon, 9 Oct 2017 17:09:49 -0700 (PDT) In-Reply-To: References: <201710072330.v97NUv7E040636@repo.freebsd.org> <20171009232052.GU1055@FreeBSD.org> From: Jason Eggleston Date: Mon, 9 Oct 2017 17:09:49 -0700 Message-ID: Subject: Re: svn commit: r324405 - head/sys/kern To: Gleb Smirnoff Cc: Sean Bruno , 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.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:09:51 -0000 https://reviews.freebsd.org/D12633 On Mon, Oct 9, 2017 at 5:01 PM, Jason Eggleston wrote: > In tcp_input.c, this is where a RST is handled. so_error gets ECONNRESET, > then tcp_close() is called. > > case TCPS_ESTABLISHED: > case TCPS_FIN_WAIT_1: > case TCPS_FIN_WAIT_2: > case TCPS_CLOSE_WAIT: > case TCPS_CLOSING: > case TCPS_LAST_ACK: > so->so_error = ECONNRESET; > close: > /* FALLTHROUGH */ > default: > tp = tcp_close(tp); > > tcp_close() calls soisdisconnected() which sets this flag: > > so->so_state |= SS_ISDISCONNECTED; > > Followed by: > > ... > socantrcvmore_locked(so); > ... > socantsendmore_locked(so); > ... > > Those two functions set these flags: > > so->so_rcv.sb_state |= SBS_CANTRCVMORE; > so->so_snd.sb_state |= SBS_CANTSENDMORE; > > A TCP session cannot survive a RST, and i/o calls will not work afterword, > no matter how many times you try. > > Having said that, there's a race condition between when so_error is set > and when the socket and socket buffer flags are set, and I agree with your > strategy of: > > - have sendfile() match send() > - The current send() behavior is probably fine as is > > I agree sendfile() should match write() and send(), by checking in this > order: > > SBS_CANTSENDMORE > so_error > SS_ISCONNECTED > > and will prep a new review with your patch. > > On Mon, Oct 9, 2017 at 4:20 PM, Gleb Smirnoff wrote: > >> Sean & Jason, >> >> On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: >> S> Author: sbruno >> S> Date: Sat Oct 7 23:30:57 2017 >> S> New Revision: 324405 >> S> URL: https://svnweb.freebsd.org/changeset/base/324405 >> S> >> S> Log: >> S> Check so_error early in sendfile() call. Prior to this patch, if a >> S> connection was reset by the remote end, sendfile() would just report >> S> ENOTCONN instead of ECONNRESET. >> S> >> S> Submitted by: Jason Eggleston >> S> Reviewed by: glebius >> S> Sponsored by: Limelight Networks >> S> Differential Revision: https://reviews.freebsd.org/D12575 >> S> >> S> Modified: >> S> head/sys/kern/kern_sendfile.c >> S> >> S> Modified: head/sys/kern/kern_sendfile.c >> S> ============================================================ >> ================== >> S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 >> (r324404) >> S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 >> (r324405) >> S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, struct >> file >> S> *so = (*sock_fp)->f_data; >> S> if ((*so)->so_type != SOCK_STREAM) >> S> return (EINVAL); >> S> + if ((*so)->so_error) { >> S> + error = (*so)->so_error; >> S> + (*so)->so_error = 0; >> S> + return (error); >> S> + } >> S> if (((*so)->so_state & SS_ISCONNECTED) == 0) >> S> return (ENOTCONN); >> S> return (0); >> >> Despite my initial positive review, now I am quite unsure on that. >> >> Problem is that sendfile(2) isn't defined by SUS, so there is no >> distinctive final answer on that. Should we match other OSes? >> Should we match our historic behaviour? Or should we match >> write(2)/send(2) to socket, which are closest analogy. I probably >> believe in the latter: sendfile(2) belongs to write(2)/send(2) >> family. >> >> SUS specifies that write may return ECONNRESET. It also documents >> EPIPE. However, our manual page documents only EPIPE for both >> send(2) and write(2). For write we have: >> >> SOCKBUF_LOCK(&so->so_snd); >> if (so->so_snd.sb_state & SBS_CANTSENDMORE) { >> SOCKBUF_UNLOCK(&so->so_snd); >> error = EPIPE; >> goto out; >> } >> if (so->so_error) { >> error = so->so_error; >> so->so_error = 0; >> SOCKBUF_UNLOCK(&so->so_snd); >> goto out; >> } >> >> Indeed, EPIPE will be returned prior to return/clear of so_error, >> which supposedly is ECONNRESET. >> >> In the sendfile(2) implementation we see exactly same code: >> >> if (so->so_snd.sb_state & SBS_CANTSENDMORE) { >> error = EPIPE; >> SOCKBUF_UNLOCK(&so->so_snd); >> goto done; >> } else if (so->so_error) { >> error = so->so_error; >> so->so_error = 0; >> SOCKBUF_UNLOCK(&so->so_snd); >> goto done; >> } >> >> But it isn't reached. Before due to SS_ISCONNECTED check, now >> due to your change. Now we got two spots where so_error is >> returned/cleared. >> >> For the receive family (read(2) and recv(2)), SUS specifies >> ECONNRESET and our code does that. It also clears so_error. >> >> So, after your change at least one standard case is broken: an >> application that polls/selects for both readability and >> writeability of a socket. It discovers that socket is available >> for writing, does sendfile(2), receives ECONNRESET. Then it does >> read on the socket, and blocks(?) or returns a bogus error(?), >> not sure. But definitely not ECONNRESET, since it is now cleared. >> >> Now, where does this ENOTCONN come from? These two lines: >> >> if (((*so)->so_state & SS_ISCONNECTED) == 0) >> return (ENOTCONN); >> >> can be traced back all the way to original 1998 commit of sendfile. >> >> Here comes difference between sendfile(2) and send(2). In send(2), >> this check is done _after_ so_error check, so your change is correct >> in placing of so_error check wrt so_state check, but is incorrect >> in placing wrt socket buffer state check. >> >> After all this considerations, I would suggest to revert your change, >> and apply this patch. It would make behavior of sendfile(2) to match >> send(2). I would appreciate more reviews around it. >> >> -- >> Gleb Smirnoff >> > > From owner-svn-src-head@freebsd.org Tue Oct 10 00:17:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A12E9E3FFAE; Tue, 10 Oct 2017 00:17:27 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from mail.ignoranthack.me (ignoranthack.me [199.102.79.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 69C9F1C57; Tue, 10 Oct 2017 00:17:26 +0000 (UTC) (envelope-from sbruno@freebsd.org) Received: from [192.168.0.6] (75-173-106-27.albq.qwest.net [75.173.106.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sbruno@ignoranthack.me) by mail.ignoranthack.me (Postfix) with ESMTPSA id 5C2BF192892; Tue, 10 Oct 2017 00:17:24 +0000 (UTC) Subject: Re: svn commit: r324406 - head/sys/modules/em To: Brooks Davis , rgrimes@freebsd.org Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> <20171009203350.GB68389@spindle.one-eyed-alien.net> From: Sean Bruno Message-ID: <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> Date: Mon, 9 Oct 2017 18:17:21 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171009203350.GB68389@spindle.one-eyed-alien.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KclhsJsK7b42NaqonaT9qB7pN6cPNXCNt" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 10 Oct 2017 00:17:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KclhsJsK7b42NaqonaT9qB7pN6cPNXCNt Content-Type: multipart/mixed; boundary="WiBn6gddnPFMMBEewTpU7gGrheb2rWoRj"; protected-headers="v1" From: Sean Bruno To: Brooks Davis , rgrimes@freebsd.org Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> Subject: Re: svn commit: r324406 - head/sys/modules/em References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> <20171009203350.GB68389@spindle.one-eyed-alien.net> In-Reply-To: <20171009203350.GB68389@spindle.one-eyed-alien.net> --WiBn6gddnPFMMBEewTpU7gGrheb2rWoRj Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 10/09/17 14:33, Brooks Davis wrote: > On Sun, Oct 08, 2017 at 08:42:35AM -0700, Rodney W. Grimes wrote: >>> >>>> On Oct 7, 2017, at 16:33, Sean Bruno wrote: >>>> >>>> Author: sbruno >>>> Date: Sat Oct 7 23:33:14 2017 >>>> New Revision: 324406 >>>> URL: https://svnweb.freebsd.org/changeset/base/324406 >>>> >>>> Log: >>>> Fix symlink if_igb.ko in -current such that its relative and doesn'= t >>>> end up with non-standard DESTDIR information in its symlink. This >>>> can happen very trivially if the release scripts are used. >>>> >>>> Sponsored by: Limelight Networks >>>> >>>> Modified: >>>> head/sys/modules/em/Makefile >>>> >>>> Modified: head/sys/modules/em/Makefile >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>> --- head/sys/modules/em/Makefile Sat Oct 7 23:30:57 2017 (r32= 4405) >>>> +++ head/sys/modules/em/Makefile Sat Oct 7 23:33:14 2017 (r32= 4406) >>>> @@ -23,6 +23,6 @@ CFLAGS +=3D -I${SRCTOP}/sys/dev/e1000 >>>> #CFLAGS +=3D -DDEVICE_POLLING >>>> >>>> afterinstall: >>>> - ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko ${DESTDIR}${KMODDIR}/if_= igb.ko >>>> + cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko >>> >>> While this is definitely better, the same thing could be achieved via= : >>> >>> ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko >> >> Should this be using SYMLINK+=3D as I thought using ln -sf was a break= age >> for meta mode stuff? >=20 > At the very least it should use INSTALL_LIBSYMLINK or INSTALL_RLIBSYMLI= NK. > Direct use of ln(1) is always a bug in install targets and ideally we > would make it fail. (It breaks NO_ROOT installs by failing to add an > entry to the METALOG file). >=20 > -- Brooks >=20 I'm more than happy to make changes here. The closest example I can see in the tree from a Makefile is some of the things in etc: ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound Is that, more or less, something y'all would like to see? sean --WiBn6gddnPFMMBEewTpU7gGrheb2rWoRj-- --KclhsJsK7b42NaqonaT9qB7pN6cPNXCNt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQGTBAEBCgB9FiEE6MTp+IA1BOHj9Lo0veT1/om1/LYFAlncEZFfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEU4 QzRFOUY4ODAzNTA0RTFFM0Y0QkEzNEJERTRGNUZFODlCNUZDQjYACgkQveT1/om1 /LbOmQf/Yy7PetHAJcvKn2wVkxf6/FE6wqIAQONdIp+wsitE9MTY1aImbXk4r7/G aXSpoSejHdpoiSzAwjwt/DkHTwkQT95t+5hgBVGOeLvMmoUIGHLN+U26gBxm2dz/ OmmfNHF2lGI3d8YT1w+aYdsFCRqxpJPH0gSLAF1a5ykXNPUvn20u9BW1F8rlIP4J NTaP0aV9PSKFROZGw23j0aAY29+5jU8Bmmfrr6YXi/PCabvWzxhusNQp35tc7O7p OCX13xSaABENih6SrZjuXKM2HMPoDlzdfDMPQwo4NSwKn0fcdsT2GAqIw43FJa7B Lml2fmYAceFtcF4vpRCcbbvf7h2T4A== =mywg -----END PGP SIGNATURE----- --KclhsJsK7b42NaqonaT9qB7pN6cPNXCNt-- From owner-svn-src-head@freebsd.org Tue Oct 10 00:26:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFE95E4025D; Tue, 10 Oct 2017 00:26:45 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F60F20BB; Tue, 10 Oct 2017 00:26:45 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A0QiS3065309; Tue, 10 Oct 2017 00:26:44 GMT (envelope-from bjk@FreeBSD.org) Received: (from bjk@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A0Qiqh065308; Tue, 10 Oct 2017 00:26:44 GMT (envelope-from bjk@FreeBSD.org) Message-Id: <201710100026.v9A0Qiqh065308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bjk set sender to bjk@FreeBSD.org using -f From: Benjamin Kaduk Date: Tue, 10 Oct 2017 00:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324458 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: bjk X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 324458 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:26:45 -0000 Author: bjk (doc committer) Date: Tue Oct 10 00:26:44 2017 New Revision: 324458 URL: https://svnweb.freebsd.org/changeset/base/324458 Log: Add Asus USB-N13, rev. B1 to the rtwn_usb hardware list Reported by: Patrik Horst Modified: head/share/man/man4/rtwn_usb.4 Modified: head/share/man/man4/rtwn_usb.4 ============================================================================== --- head/share/man/man4/rtwn_usb.4 Mon Oct 9 22:27:38 2017 (r324457) +++ head/share/man/man4/rtwn_usb.4 Tue Oct 10 00:26:44 2017 (r324458) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd January 24, 2017 +.Dd October 9, 2017 .Dt RTWN_USB 4 .Os .Sh NAME @@ -64,6 +64,7 @@ based USB wireless network adapters, including: .It "Alfa AWUS036NHR v2" Ta USB 2.0 .It "ASUS USB-AC56" Ta USB 3.0 .It "ASUS USB-N10 NANO" Ta USB 2.0 +.It "Asus USB-N13, rev. B1" Ta USB 2.0 .It "Belkin F7D1102 Surf Wireless Micro" Ta USB 2.0 .It "Buffalo WI-U2-433DM" Ta USB 2.0 .It "Buffalo WI-U3-866D" Ta USB 3.0 From owner-svn-src-head@freebsd.org Tue Oct 10 00:32:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96609E40427; Tue, 10 Oct 2017 00:32:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65CE7255D; Tue, 10 Oct 2017 00:32:22 +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 v9A0WLiV069346; Tue, 10 Oct 2017 00:32:21 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A0WLCa069345; Tue, 10 Oct 2017 00:32:21 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201710100032.v9A0WLCa069345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 10 Oct 2017 00:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324459 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324459 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:32:22 -0000 Author: sbruno Date: Tue Oct 10 00:32:21 2017 New Revision: 324459 URL: https://svnweb.freebsd.org/changeset/base/324459 Log: Revert r324405 at the request of the submitter pending better solution. Submitted by: Jason Eggleston Sponsored by: Limelight Networks Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Tue Oct 10 00:26:44 2017 (r324458) +++ head/sys/kern/kern_sendfile.c Tue Oct 10 00:32:21 2017 (r324459) @@ -507,11 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct file *so = (*sock_fp)->f_data; if ((*so)->so_type != SOCK_STREAM) return (EINVAL); - if ((*so)->so_error) { - error = (*so)->so_error; - (*so)->so_error = 0; - return (error); - } if (((*so)->so_state & SS_ISCONNECTED) == 0) return (ENOTCONN); return (0); From owner-svn-src-head@freebsd.org Tue Oct 10 00:38:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4F4AE405AF for ; Tue, 10 Oct 2017 00:38:09 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30C3A27AC for ; Tue, 10 Oct 2017 00:38:09 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id i124so738815wmf.3 for ; Mon, 09 Oct 2017 17:38:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=/z7of2WcE8sqg+vOorLBB3B/ZJkudsfQfdEWQJc7OUE=; b=NL9Z8hWWNcPf2m06OBblwdaXFZ8fNw5mLjfznsQcqKNrhECGET90rYigUZviGJXDo+ L1E5QaCoHDpqe+uOUd5gmHzNBfDrWKYTRBR+Rvvs9pzvisIcJf6me3f48lGB6sPywn2G styBqYOo5ZpeBE92n3XPAjKrMpD3J0RB/XBCjgyiCE9qjEsqZ599ZEzGXfQ8rCgNN99N D04D+oCmgWga/wZwR1ReVgcLTrRTbeJkQSsm/c8FQPKWJGY9gHAJ9KUZZ8nBe+HXKOrE BBHPxdEf9OS7LOoiEUKXVoghYHH5zk+/ugNBzcE1CzI2IPO1wpg5+tuLFf3CXfLHYZnn /PWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=/z7of2WcE8sqg+vOorLBB3B/ZJkudsfQfdEWQJc7OUE=; b=gqFC+1sPRRGZjpj6Jz5M/OLC4obur25+TB4GpMnxgnb2O/rtRsybI6/ScOjgyMC+eW qcqzwxQVC96JCLlbejZ3ozPnK2UJDWJ4s3V1bGJJYXJFpwQnv49GBcsgWUM4dsWkPqGm es/nDn6ZBhX2QRteALSE0LhXO4WApK2PVfkLCkb5s6294QQn52fu8sy47JbuidPrSCYc T78S675/iU5e9q6VTBP6H4zlGbi0+VkUa6vfvhJiS5oLc7Ijy2axnkfz4jeUmnDC5qCI 2X4tXKbCCdTUcx0f7XXVgMDd/vcNPFluItyi2FDc7arxV+LB5a0SrvRU6yp/Isw9F0Fx HslQ== X-Gm-Message-State: AMCzsaWzIRcLyxD2HV28nSPY/wkxag/4ePTdaxzYuv/dKbcOr/3DHM0g 2JTfnsCI7lzrLWTeeMkXEcbBri0fjXs= X-Google-Smtp-Source: AOwi7QCPqwSiJYtTzWR5sQeaeCyRoyJI9ZGuzsMMqf/vDhP31op2lWcP7kkmAVdH4PzpNjhN/RpNpg== X-Received: by 10.28.173.1 with SMTP id w1mr9045157wme.3.1507595887238; Mon, 09 Oct 2017 17:38:07 -0700 (PDT) Received: from [10.10.1.111] ([185.97.61.1]) by smtp.gmail.com with ESMTPSA id y84sm3476363wmg.43.2017.10.09.17.38.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 17:38:05 -0700 (PDT) Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Warner Losh Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Tue, 10 Oct 2017 01:38:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 00:38:09 -0000 Yer even no -j fails :( On 10/10/2017 01:01, Warner Losh wrote: > Oh, killed /usr/include/stand.h and found it. I'll post a fix when I > get back. > > On Mon, Oct 9, 2017 at 6:00 PM, Warner Losh > wrote: > > Can you find out? A clean build works for me. Chances are good > that sys/boot/efi/boot1/Makefile needs a line like > CFLAGS+=-I${SASRC} or similar. I have to go out for 2 hours, but > will look into when I get back if you can't make progress. I don't > see one there and I had to add it a couple of other places. > > Warner > > On Mon, Oct 9, 2017 at 5:56 PM, Steven Hartland > > wrote: > > Not sure which of these sets of changes caused the issue but a > clean build from scratch is currently failing here with: > > In file included from > /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/ufs_module.c:41: > In file included from > /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/boot_module.h:35: > /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: > fatal error: 'stand.h' file not found > #include >          ^~~~~~~~~ > > Build was with -j24 in case it matters, going to try without > -j but that will take many hours > > > On 09/10/2017 23:11, Warner Losh wrote: >> Author: imp >> Date: Mon Oct 9 22:11:57 2017 >> New Revision: 324449 >> URL:https://svnweb.freebsd.org/changeset/base/324449 >> >> >> Log: >> Prefer ${LIBSTAND} to -lstand >> >> Sponsored by: Netflix >> >> Modified: >> head/sys/boot/arm/uboot/Makefile >> head/sys/boot/efi/boot1/Makefile >> head/sys/boot/sparc64/loader/Makefile >> >> Modified: head/sys/boot/arm/uboot/Makefile >> ============================================================================== >> --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -121,7 +121,7 @@ CFLAGS+= -fPIC >> NO_WERROR.clang= >> >> DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >> -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand >> +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >> >> OBJS+= ${SRCS:N*.h:R:S/$/.o/g} >> >> >> Modified: head/sys/boot/efi/boot1/Makefile >> ============================================================================== >> --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a >> # as well as required string and memory functions for all platforms. >> # >> DPADD+= ${LIBEFI} ${LIBSTAND} >> -LDADD+= ${LIBEFI} -lstand >> +LDADD+= ${LIBEFI} ${LIBSTAND} >> >> DPADD+= ${LDSCRIPT} >> >> >> Modified: head/sys/boot/sparc64/loader/Makefile >> ============================================================================== >> --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) >> +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) >> @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ >> CFLAGS+= -I${SRCTOP}/sys >> >> DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >> -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand >> +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >> >> loader.help: help.common help.sparc64 >> cat ${.ALLSRC} | \ >> > > > From owner-svn-src-head@freebsd.org Tue Oct 10 01:31:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FCDAE421CB; Tue, 10 Oct 2017 01:31:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C41D663BDC; Tue, 10 Oct 2017 01:31:47 +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 v9A1VkJM093134; Tue, 10 Oct 2017 01:31:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A1VijN091588; Tue, 10 Oct 2017 01:31:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710100131.v9A1VijN091588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 10 Oct 2017 01:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324460 - in head/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader fdt i386/libfirewire i386/libi386 i386/loader mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . arm/uboot common efi/fdt efi/libefi efi/loader fdt i386/libfirewire i386/libi386 i386/loader mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/kboot powerpc/ofw powerp... X-SVN-Commit-Revision: 324460 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 01:31:48 -0000 Author: imp Date: Tue Oct 10 01:31:44 2017 New Revision: 324460 URL: https://svnweb.freebsd.org/changeset/base/324460 Log: Rather than laying whack-a-mole with including the path to stand.h, always include it. Remove places where we explicitly include it. This also helps reduce the 'cut-and-paste' factor of these Makefiles. Sponsored by: Netflix Modified: head/sys/boot/Makefile.ficl head/sys/boot/Makefile.inc head/sys/boot/arm/uboot/Makefile head/sys/boot/common/Makefile.inc head/sys/boot/efi/fdt/Makefile head/sys/boot/efi/libefi/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/fdt/Makefile head/sys/boot/i386/libfirewire/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/loader/Makefile head/sys/boot/mips/beri/boot2/Makefile head/sys/boot/mips/beri/loader/Makefile head/sys/boot/mips/uboot/Makefile head/sys/boot/ofw/libofw/Makefile head/sys/boot/powerpc/kboot/Makefile head/sys/boot/powerpc/ofw/Makefile head/sys/boot/powerpc/ps3/Makefile head/sys/boot/powerpc/uboot/Makefile head/sys/boot/sparc64/loader/Makefile head/sys/boot/uboot/fdt/Makefile head/sys/boot/uboot/lib/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/boot/zfs/Makefile Modified: head/sys/boot/Makefile.ficl ============================================================================== --- head/sys/boot/Makefile.ficl Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/Makefile.ficl Tue Oct 10 01:31:44 2017 (r324460) @@ -27,7 +27,7 @@ CFLAGS+= -m32 -mcpu=powerpc -I. .endif CFLAGS+= -I${FICLDIR} -I${FICLDIR}/${FICL_CPUARCH} \ - -I${FICLDIR}/../common -I${SASRC} + -I${FICLDIR}/../common .if ${MACHINE_CPUARCH} == "amd64" && defined(FICL32) .if !exists(machine) Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/Makefile.inc Tue Oct 10 01:31:44 2017 (r324460) @@ -13,6 +13,8 @@ LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a # stand along library compiled for userboot LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a +CFLAGS+=-I${SASRC} + SSP_CFLAGS= .if ${MACHINE_CPUARCH} == "arm" Modified: head/sys/boot/arm/uboot/Makefile ============================================================================== --- head/sys/boot/arm/uboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/arm/uboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -112,8 +112,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -CFLAGS+= -I${SASRC} - CFLAGS+= -fPIC # clang doesn't understand %D as a specifier to printf Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/common/Makefile.inc Tue Oct 10 01:31:44 2017 (r324460) @@ -70,7 +70,6 @@ CFLAGS+= -DBOOT_PROMPT_123 .if defined(LOADER_INSTALL_SUPPORT) SRCS+= install.c -CFLAGS+=-I${SASRC} .endif CLEANFILES+= vers.c Modified: head/sys/boot/efi/fdt/Makefile ============================================================================== --- head/sys/boot/efi/fdt/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/efi/fdt/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -17,8 +17,6 @@ CFLAGS+= -mgeneral-regs-only CFLAGS+= -msoft-float .endif -CFLAGS+= -I${SASRC} - # EFI library headers CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} Modified: head/sys/boot/efi/libefi/Makefile ============================================================================== --- head/sys/boot/efi/libefi/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/efi/libefi/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -37,7 +37,6 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${.CURDIR}/../include CFLAGS+= -I${.CURDIR}/../include/${MACHINE} -CFLAGS+= -I${SASRC} .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/efi/loader/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -36,10 +36,6 @@ CWARNFLAGS.zfs.c+= -Wno-array-bounds CWARNFLAGS.zfs.c+= -Wno-missing-prototypes .endif -.if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${SASRC} -.endif - .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/fdt/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -12,7 +12,6 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt # Loader's fdt commands extension sources. SRCS+= fdt_loader_cmd.c fdt_overlay.c -CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ CFLAGS+= -ffreestanding Modified: head/sys/boot/i386/libfirewire/Makefile ============================================================================== --- head/sys/boot/i386/libfirewire/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/i386/libfirewire/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -10,7 +10,6 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. -CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../btx/lib CFLAGS+= -I${.CURDIR}/../libi386 Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/i386/libi386/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -59,8 +59,6 @@ CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../fi -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../../contrib/dev/acpica/include \ -I${.CURDIR}/../../.. -I. -# the location of libstand -CFLAGS+= -I${SASRC} # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} Modified: head/sys/boot/i386/loader/Makefile ============================================================================== --- head/sys/boot/i386/loader/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/i386/loader/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -28,10 +28,6 @@ CFLAGS+= -DLOADER_ZFS_SUPPORT LIBZFSBOOT= ${.OBJDIR}/../../zfs/libzfsboot.a .endif -.if defined(LOADER_NET_SUPPORT) -CFLAGS+= -I${SASRC} -.endif - .if defined(LOADER_TFTP_SUPPORT) CFLAGS+= -DLOADER_TFTP_SUPPORT .endif Modified: head/sys/boot/mips/beri/boot2/Makefile ============================================================================== --- head/sys/boot/mips/beri/boot2/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/mips/beri/boot2/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -57,9 +57,6 @@ CFLAGS= -ffreestanding \ -msoft-float \ -g -# where to get libstand from -CFLAGS+= -I${SASRC} - LDFLAGS= -nostdlib \ -static \ -Wl,-N \ Modified: head/sys/boot/mips/beri/loader/Makefile ============================================================================== --- head/sys/boot/mips/beri/loader/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/mips/beri/loader/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -107,9 +107,6 @@ LDFLAGS= -nostdlib \ -L${.CURDIR} \ -e __start -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBSA} LDADD= ${LIBFICL} ${LIBSA} Modified: head/sys/boot/mips/uboot/Makefile ============================================================================== --- head/sys/boot/mips/uboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/mips/uboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -115,9 +115,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from -CFLAGS+= -I${SASRC} - # clang doesn't understand %D as a specifier to printf #NO_WERROR.clang= #NO_WERROR= Modified: head/sys/boot/ofw/libofw/Makefile ============================================================================== --- head/sys/boot/ofw/libofw/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/ofw/libofw/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -9,8 +9,6 @@ SRCS= devicename.c elf_freebsd.c ofw_console.c ofw_cop .PATH: ${.CURDIR}/../../zfs SRCS+= devicename_stubs.c -CFLAGS+= -I${SASRC} - # Pick up the bootstrap header for some interface items CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. Modified: head/sys/boot/powerpc/kboot/Makefile ============================================================================== --- head/sys/boot/powerpc/kboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/powerpc/kboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -93,9 +93,6 @@ CFLAGS+= -Wa,-mppc64bridge #.PATH: ${.CURDIR}/../../ofw/common #.include "${.CURDIR}/../../ofw/common/Makefile.inc" -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} Modified: head/sys/boot/powerpc/ofw/Makefile ============================================================================== --- head/sys/boot/powerpc/ofw/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/powerpc/ofw/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -91,9 +91,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA32} Modified: head/sys/boot/powerpc/ps3/Makefile ============================================================================== --- head/sys/boot/powerpc/ps3/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/powerpc/ps3/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -90,9 +90,6 @@ LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powe #.PATH: ${.CURDIR}/../../ofw/common #.include "${.CURDIR}/../../ofw/common/Makefile.inc" -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} LDADD= ${LIBFICL} ${LIBOFW} ${LIBSA32} Modified: head/sys/boot/powerpc/uboot/Makefile ============================================================================== --- head/sys/boot/powerpc/uboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/powerpc/uboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -96,9 +96,6 @@ LIBUBOOT= ${.OBJDIR}/../../uboot/lib/libuboot.a CFLAGS+= -I${.CURDIR}/../../uboot/lib CFLAGS+= -I${.OBJDIR}/../../uboot/lib -# where to get libstand from -CFLAGS+= -I${SASRC} - DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSA32} Modified: head/sys/boot/sparc64/loader/Makefile ============================================================================== --- head/sys/boot/sparc64/loader/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/sparc64/loader/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -79,9 +79,6 @@ LDFLAGS= -static LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ -# where to get libstand from -CFLAGS+= -I${SASRC} - # Need sys/ for crypto/intake.h CFLAGS+= -I${SRCTOP}/sys Modified: head/sys/boot/uboot/fdt/Makefile ============================================================================== --- head/sys/boot/uboot/fdt/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/uboot/fdt/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -12,8 +12,6 @@ SRCS= uboot_fdt.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${SASRC} - # U-Boot library headers CFLAGS+= -I${.CURDIR}/../lib Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/uboot/lib/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -13,8 +13,6 @@ SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float -CFLAGS+= -I${SASRC} - .if !defined(LOADER_NO_DISK_SUPPORT) SRCS+= disk.c CFLAGS+= -DLOADER_DISK_SUPPORT Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/userboot/userboot/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -32,7 +32,6 @@ CFLAGS+= -Wall CFLAGS+= -I${.CURDIR}/.. CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. -CFLAGS+= -I${SASRC} CFLAGS+= -ffreestanding -I. CWARNFLAGS.main.c += -Wno-implicit-function-declaration Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Tue Oct 10 00:32:21 2017 (r324459) +++ head/sys/boot/zfs/Makefile Tue Oct 10 01:31:44 2017 (r324460) @@ -12,7 +12,6 @@ CFLAGS+= -DSKEIN_LOOP=111 CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. -CFLAGS+= -I${SASRC} CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs CFLAGS+= -I${.CURDIR}/../../crypto/skein From owner-svn-src-head@freebsd.org Tue Oct 10 01:33:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D0DDE42504 for ; Tue, 10 Oct 2017 01:33:41 +0000 (UTC) (envelope-from wlosh@bsdimp.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 C0D3863EAC for ; Tue, 10 Oct 2017 01:33:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id z187so22651255ioz.12 for ; Mon, 09 Oct 2017 18:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=qll4/7QvzgGkwOp5yL2bkM+KvBOUhmoS39dKPfzvTSU=; b=X359/znqcdjlXcXriPsnrawZJqWuxNhXobYF27B4+YbTfU0qeUJL1nOmUPcZUmhMXB TjaGkTb2Sso4m1OyGeW7aUaN8MlV6SdEu2zgM+2RL8/R7sKgi4SwnsnwMEriBGGE7iud aTJ4o87oAj1DW4fhjRsdAh8LkTGqoXw92Bn1E/6va8+l7JrvPmqcu3wcqa9UyJB9j/tv mE35AOBatYWNWZgGDfoUqcupQjQv4Ulgg5ZKr7Y8lD2QkS5eza9zijCBGgD0amoajore xshYRfcsw7PDcdsDci4XNRaEALFcytDr7qXjmot2p5YVxhUIBx0QKyJIHTHunrlm2tPP H8kw== 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=qll4/7QvzgGkwOp5yL2bkM+KvBOUhmoS39dKPfzvTSU=; b=kz6aNtcZUQNgHXc+yUBhNSLz7iugfqSllVMcCLxg3DxNZ2v4BMO3FcnPFAfOaTpoZ7 WxSjK0GxTUrDqKV4/9FTKf81bsjffLj7aZaBIpsyVuNIAjGgsIlzPrGuHlDUL8FBFijs HGcip0LIBWNPgk7epjlaHH873cA+2jYJ/+hxoL3fSROzpwNxXZ10XPb1PiHCdr8oydBx ECM8mmN/Y/ulsb0MkKBFgf8ZoEKzIWbg0nb2TCiIBHTB8bZ8q5EOnyzKjNXU8opGGiU/ g6ysg6GGSDjIXsZ+CAs+5WPIk8kISM7oU7orrEsVVWlw1XP0XObfVw0lN3cfuNXJIMkv Clng== X-Gm-Message-State: AMCzsaUIpW7NbyibMeumpb4KKaMd7nDsCIj4qhaWQKcfLmlqkOPaJt0N 1EpKOSyQp45xdPFDgVk82lDH7NGGd5Vv9C4Un+CQDw== X-Google-Smtp-Source: AOwi7QC6/OAQKad4cMsSpA3zHlavgsIySoDnGwRdpvlxnr0UbTKrYGm6GL/Yqan+pdPP4xY56xN8IGT2TA3foQcgZfQ= X-Received: by 10.107.185.6 with SMTP id j6mr11078796iof.221.1507599220143; Mon, 09 Oct 2017 18:33:40 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 9 Oct 2017 18:33:39 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:8936:338a:89de:d5ea] In-Reply-To: References: <201710092211.v99MBwCq010906@repo.freebsd.org> From: Warner Losh Date: Mon, 9 Oct 2017 19:33:39 -0600 X-Google-Sender-Auth: 1PadNpsu93vd9O5fRbQB1crDq9w Message-ID: Subject: Re: svn commit: r324449 - in head/sys/boot: arm/uboot efi/boot1 sparc64/loader To: Steven Hartland Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 01:33:41 -0000 Yea, that's my bad. I didn't do a completely clean build with stand.h gone, so I didn't catch it before the commit. I've just pushed in a fixup so that we always include the path to stand.h in the include path, since almost everybody needs it, and it is harmless to the others to include. Sorry for the bumps... Warner On Mon, Oct 9, 2017 at 6:38 PM, Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > Yer even no -j fails :( > > > On 10/10/2017 01:01, Warner Losh wrote: > > Oh, killed /usr/include/stand.h and found it. I'll post a fix when I get > back. > > On Mon, Oct 9, 2017 at 6:00 PM, Warner Losh wrote: > >> Can you find out? A clean build works for me. Chances are good that >> sys/boot/efi/boot1/Makefile needs a line like >> CFLAGS+=-I${SASRC} or similar. I have to go out for 2 hours, but will >> look into when I get back if you can't make progress. I don't see one there >> and I had to add it a couple of other places. >> >> Warner >> >> On Mon, Oct 9, 2017 at 5:56 PM, Steven Hartland < >> steven.hartland@multiplay.co.uk> wrote: >> >>> Not sure which of these sets of changes caused the issue but a clean >>> build from scratch is currently failing here with: >>> >>> In file included from /usr/home/smh/freebsd/base/hea >>> d/sys/boot/efi/boot1/ufs_module.c:41: >>> In file included from /usr/home/smh/freebsd/base/hea >>> d/sys/boot/efi/boot1/boot_module.h:35: >>> /usr/home/smh/freebsd/base/head/sys/boot/efi/boot1/../include/efilib.h:33:10: >>> fatal error: 'stand.h' file not found >>> #include >>> ^~~~~~~~~ >>> >>> Build was with -j24 in case it matters, going to try without -j but that >>> will take many hours >>> >>> >>> On 09/10/2017 23:11, Warner Losh wrote: >>> >>> Author: imp >>> Date: Mon Oct 9 22:11:57 2017 >>> New Revision: 324449 >>> URL: https://svnweb.freebsd.org/changeset/base/324449 >>> >>> Log: >>> Prefer ${LIBSTAND} to -lstand >>> >>> Sponsored by: Netflix >>> >>> Modified: >>> head/sys/boot/arm/uboot/Makefile >>> head/sys/boot/efi/boot1/Makefile >>> head/sys/boot/sparc64/loader/Makefile >>> >>> Modified: head/sys/boot/arm/uboot/Makefile >>> ============================================================================== >>> --- head/sys/boot/arm/uboot/Makefile Mon Oct 9 21:06:16 2017 (r324448) >>> +++ head/sys/boot/arm/uboot/Makefile Mon Oct 9 22:11:57 2017 (r324449) >>> @@ -121,7 +121,7 @@ CFLAGS+= -fPIC >>> NO_WERROR.clang= >>> >>> DPADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >>> -LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} -lstand >>> +LDADD= ${LIBFICL} ${LIBUBOOT} ${LIBFDT} ${LIBUBOOT_FDT} ${LIBSTAND} >>> >>> OBJS+= ${SRCS:N*.h:R:S/$/.o/g} >>> >>> >>> Modified: head/sys/boot/efi/boot1/Makefile >>> ============================================================================== >>> --- head/sys/boot/efi/boot1/Makefile Mon Oct 9 21:06:16 2017 (r324448) >>> +++ head/sys/boot/efi/boot1/Makefile Mon Oct 9 22:11:57 2017 (r324449) >>> @@ -91,7 +91,7 @@ LIBEFI= ${.OBJDIR}/../libefi/libefi.a >>> # as well as required string and memory functions for all platforms. >>> # >>> DPADD+= ${LIBEFI} ${LIBSTAND} >>> -LDADD+= ${LIBEFI} -lstand >>> +LDADD+= ${LIBEFI} ${LIBSTAND} >>> >>> DPADD+= ${LDSCRIPT} >>> >>> >>> Modified: head/sys/boot/sparc64/loader/Makefile >>> ============================================================================== >>> --- head/sys/boot/sparc64/loader/Makefile Mon Oct 9 21:06:16 2017 (r324448) >>> +++ head/sys/boot/sparc64/loader/Makefile Mon Oct 9 22:11:57 2017 (r324449) >>> @@ -86,7 +86,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ >>> CFLAGS+= -I${SRCTOP}/sys >>> >>> DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >>> -LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} -lstand >>> +LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBOFW} ${LIBSTAND} >>> >>> loader.help: help.common help.sparc64 >>> cat ${.ALLSRC} | \ >>> >>> >>> >>> >> > > From owner-svn-src-head@freebsd.org Tue Oct 10 01:54:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2D58E4310F for ; Tue, 10 Oct 2017 01:54:17 +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 4CAC464AD9 for ; Tue, 10 Oct 2017 01:54:16 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: e7375abd-ad5d-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id e7375abd-ad5d-11e7-a893-25625093991c; Tue, 10 Oct 2017 01:54:09 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9A1s53Y002547; Mon, 9 Oct 2017 19:54:05 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507600445.84167.23.camel@freebsd.org> Subject: Re: svn commit: r324406 - head/sys/modules/em From: Ian Lepore To: Sean Bruno , Brooks Davis , rgrimes@freebsd.org Cc: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 09 Oct 2017 19:54:05 -0600 In-Reply-To: <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> <20171009203350.GB68389@spindle.one-eyed-alien.net> <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 01:54:17 -0000 On Mon, 2017-10-09 at 18:17 -0600, Sean Bruno wrote: > > On 10/09/17 14:33, Brooks Davis wrote: > > > > On Sun, Oct 08, 2017 at 08:42:35AM -0700, Rodney W. Grimes wrote: > > > > > > > > > > > > > > > > > > > > > On Oct 7, 2017, at 16:33, Sean Bruno > > > > > wrote: > > > > > > > > > > Author: sbruno > > > > > Date: Sat Oct  7 23:33:14 2017 > > > > > New Revision: 324406 > > > > > URL: https://svnweb.freebsd.org/changeset/base/324406 > > > > > > > > > > Log: > > > > >  Fix symlink if_igb.ko in -current such that its relative and > > > > > doesn't > > > > >  end up with non-standard DESTDIR information in its > > > > > symlink.  This > > > > >  can happen very trivially if the release scripts are used. > > > > > > > > > >  Sponsored by:    Limelight Networks > > > > > > > > > > Modified: > > > > >  head/sys/modules/em/Makefile > > > > > > > > > > Modified: head/sys/modules/em/Makefile > > > > > ============================================================= > > > > > ================= > > > > > --- head/sys/modules/em/Makefile    Sat Oct  7 23:30:57 > > > > > 2017    (r324405) > > > > > +++ head/sys/modules/em/Makefile    Sat Oct  7 23:33:14 > > > > > 2017    (r324406) > > > > > @@ -23,6 +23,6 @@ CFLAGS += -I${SRCTOP}/sys/dev/e1000 > > > > > #CFLAGS  += -DDEVICE_POLLING > > > > > > > > > > afterinstall: > > > > > -    ln -sf ${DESTDIR}${KMODDIR}/${KMOD}.ko > > > > > ${DESTDIR}${KMODDIR}/if_igb.ko > > > > > +    cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko > > > > While this is definitely better, the same thing could be > > > > achieved via: > > > > > > > > ln -sf if_em.ko ${DESTDIR}/.../if_igb.ko > > > Should this be using SYMLINK+= as I thought using ln -sf was a > > > breakage > > > for meta mode stuff? > > At the very least it should use INSTALL_LIBSYMLINK or > > INSTALL_RLIBSYMLINK. > > Direct use of ln(1) is always a bug in install targets and ideally > > we > > would make it fail.  (It breaks NO_ROOT installs by failing to add > > an > > entry to the METALOG file). > > > > -- Brooks > > > > I'm more than happy to make changes here. > > The closest example I can see in the tree from a Makefile is some of > the > things in etc: > > ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound > > Is that, more or less, something y'all would like to see? > > sean > I think the right answer here is just   LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_igb.ko -- Ian From owner-svn-src-head@freebsd.org Tue Oct 10 02:51:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5244E450C1; Tue, 10 Oct 2017 02:51:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 850B36695C; Tue, 10 Oct 2017 02:51:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (106-69-250-194.dyn.iinet.net.au [106.69.250.194]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v9A2pFg9070357 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Oct 2017 19:51:18 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r324446 - in head: share/man/man9 sys/compat/ndis sys/dev/cas sys/dev/cxgbe sys/dev/cxgbe/tom sys/dev/dpaa sys/dev/if_ndis sys/dev/iscsi_initiator sys/dev/lge sys/dev/mwl sys/dev/netmap... To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710092035.v99KZVR7068970@repo.freebsd.org> From: Julian Elischer Message-ID: Date: Tue, 10 Oct 2017 10:51:10 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710092035.v99KZVR7068970@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.23 Precedence: list List-Id: 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, 10 Oct 2017 02:51:21 -0000 On 10/10/17 4:35 am, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Oct 9 20:35:31 2017 > New Revision: 324446 > URL: https://svnweb.freebsd.org/changeset/base/324446 > > Log: > Shorten list of arguments to mbuf external storage freeing function. > > All of these arguments are stored in m_ext, so there is no reason > to pass them in the argument list. Not all functions need the second > argument, some don't even need the first one. The second argument > lives in next cache line, so not dereferencing it is a performance > gain. This was discovered in sendfile(2), which will be covered by > next commits. > Originally the external free function was not necessarily freeing things that were mbuf related. In fact in one early use the items being freed were used by both the network layer and the disk io layer. The disk layer had no idea what an m_ext was or an mbuf for that matter. > The second goal of this commit is to bring even more flexibility > to m_ext mbufs, allowing to create more fields in m_ext, opaque to > the generic mbuf code, and potentially set and dereferenced by > subsystems. > > Reviewed by: gallatin, kbowling > Differential Revision: https://reviews.freebsd.org/D12615 > > Modified: > head/share/man/man9/mbpool.9 > head/share/man/man9/mbuf.9 > head/sys/compat/ndis/kern_ndis.c > head/sys/compat/ndis/ndis_var.h > head/sys/dev/cas/if_cas.c > head/sys/dev/cas/if_casvar.h > head/sys/dev/cxgbe/t4_sge.c > head/sys/dev/cxgbe/tom/t4_cpl_io.c > head/sys/dev/dpaa/if_dtsec_rm.c > head/sys/dev/if_ndis/if_ndis.c > head/sys/dev/iscsi_initiator/isc_soc.c > head/sys/dev/lge/if_lge.c > head/sys/dev/mwl/if_mwl.c > head/sys/dev/netmap/netmap_generic.c > head/sys/dev/wb/if_wb.c > head/sys/kern/kern_mbuf.c > head/sys/kern/subr_mbpool.c > head/sys/sys/mbpool.h > head/sys/sys/mbuf.h > > Modified: head/share/man/man9/mbpool.9 > ============================================================================== > --- head/share/man/man9/mbpool.9 Mon Oct 9 18:33:29 2017 (r324445) > +++ head/share/man/man9/mbpool.9 Mon Oct 9 20:35:31 2017 (r324446) > @@ -27,7 +27,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 15, 2003 > +.Dd September 27, 2017 > .Dt MBPOOL 9 > .Os > .Sh NAME > @@ -50,7 +50,7 @@ > .Ft void > .Fn mbp_free "struct mbpool *mbp" "void *p" > .Ft void > -.Fn mbp_ext_free "void *" "void *" > +.Fn mbp_ext_free "struct mbuf *" > .Ft void > .Fn mbp_card_free "struct mbpool *mbp" > .Ft void > @@ -223,8 +223,6 @@ The function > can be given to > .Fn m_extadd > as the free function. > -The user argument must be the pointer to > -the pool. > .Pp > Before using the contents of a buffer returned by the card, the driver > must call > > Modified: head/share/man/man9/mbuf.9 > ============================================================================== > --- head/share/man/man9/mbuf.9 Mon Oct 9 18:33:29 2017 (r324445) > +++ head/share/man/man9/mbuf.9 Mon Oct 9 20:35:31 2017 (r324446) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd October 10, 2016 > +.Dd September 27, 2017 > .Dt MBUF 9 > .Os > .\" > @@ -44,12 +44,12 @@ > .Fn MCLGET "struct mbuf *mbuf" "int how" > .Fo MEXTADD > .Fa "struct mbuf *mbuf" > -.Fa "caddr_t buf" > +.Fa "char *buf" > .Fa "u_int size" > -.Fa "void (*free)(void *opt_arg1, void *opt_arg2)" > +.Fa "void (*free)(struct mbuf *)" > .Fa "void *opt_arg1" > .Fa "void *opt_arg2" > -.Fa "short flags" > +.Fa "int flags" > .Fa "int type" > .Fc > .\" > @@ -416,8 +416,13 @@ The > .Fa opt_arg1 > and > .Fa opt_arg2 > -arguments will be passed unmodified to > -.Fa free . > +arguments will be saved in > +.Va ext_arg1 > +and > +.Va ext_arg2 > +fields of the > +.Va struct m_ext > +of the mbuf. > The > .Fa flags > argument specifies additional > > Modified: head/sys/compat/ndis/kern_ndis.c > ============================================================================== > --- head/sys/compat/ndis/kern_ndis.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/compat/ndis/kern_ndis.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -495,17 +495,21 @@ ndis_return(dobj, arg) > KeReleaseSpinLock(&block->nmb_returnlock, irql); > } > > +static void > +ndis_ext_free(struct mbuf *m) > +{ > + > + return (ndis_return_packet(m->m_ext.ext_arg1)); > +} > + > void > -ndis_return_packet(struct mbuf *m, void *buf, void *arg) > +ndis_return_packet(ndis_packet *p) > { > - ndis_packet *p; > ndis_miniport_block *block; > > - if (arg == NULL) > + if (p == NULL) > return; > > - p = arg; > - > /* Decrement refcount. */ > p->np_refcnt--; > > @@ -676,9 +680,8 @@ ndis_ptom(m0, p) > return (ENOBUFS); > } > m->m_len = MmGetMdlByteCount(buf); > - m->m_data = MmGetMdlVirtualAddress(buf); > - MEXTADD(m, m->m_data, m->m_len, ndis_return_packet, > - m->m_data, p, 0, EXT_NDIS); > + m_extadd(m, MmGetMdlVirtualAddress(buf), m->m_len, > + ndis_ext_free, p, NULL, 0, EXT_NDIS); > p->np_refcnt++; > > totlen += m->m_len; > > Modified: head/sys/compat/ndis/ndis_var.h > ============================================================================== > --- head/sys/compat/ndis/ndis_var.h Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/compat/ndis/ndis_var.h Mon Oct 9 20:35:31 2017 (r324446) > @@ -1743,7 +1743,7 @@ extern int ndis_halt_nic(void *); > extern int ndis_shutdown_nic(void *); > extern int ndis_pnpevent_nic(void *, int); > extern int ndis_init_nic(void *); > -extern void ndis_return_packet(struct mbuf *, void *, void *); > +extern void ndis_return_packet(ndis_packet *); > extern int ndis_init_dma(void *); > extern int ndis_destroy_dma(void *); > extern int ndis_create_sysctls(void *); > > Modified: head/sys/dev/cas/if_cas.c > ============================================================================== > --- head/sys/dev/cas/if_cas.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/cas/if_cas.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -133,7 +133,7 @@ static void cas_detach(struct cas_softc *sc); > static int cas_disable_rx(struct cas_softc *sc); > static int cas_disable_tx(struct cas_softc *sc); > static void cas_eint(struct cas_softc *sc, u_int status); > -static void cas_free(struct mbuf *m, void *arg1, void* arg2); > +static void cas_free(struct mbuf *m); > static void cas_init(void *xsc); > static void cas_init_locked(struct cas_softc *sc); > static void cas_init_regs(struct cas_softc *sc); > @@ -1732,16 +1732,10 @@ cas_rint(struct cas_softc *sc) > refcount_acquire(&rxds->rxds_refcount); > bus_dmamap_sync(sc->sc_rdmatag, > rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); > -#if __FreeBSD_version < 800016 > - MEXTADD(m, (caddr_t)rxds->rxds_buf + > + m_extadd(m, (char *)rxds->rxds_buf + > off * 256 + ETHER_ALIGN, len, cas_free, > - rxds, M_RDONLY, EXT_NET_DRV); > -#else > - MEXTADD(m, (caddr_t)rxds->rxds_buf + > - off * 256 + ETHER_ALIGN, len, cas_free, > sc, (void *)(uintptr_t)idx, > M_RDONLY, EXT_NET_DRV); > -#endif > if ((m->m_flags & M_EXT) == 0) { > m_freem(m); > m = NULL; > @@ -1779,16 +1773,10 @@ cas_rint(struct cas_softc *sc) > m->m_len = min(CAS_PAGE_SIZE - off, len); > bus_dmamap_sync(sc->sc_rdmatag, > rxds->rxds_dmamap, BUS_DMASYNC_POSTREAD); > -#if __FreeBSD_version < 800016 > - MEXTADD(m, (caddr_t)rxds->rxds_buf + off, > - m->m_len, cas_free, rxds, M_RDONLY, > - EXT_NET_DRV); > -#else > - MEXTADD(m, (caddr_t)rxds->rxds_buf + off, > + m_extadd(m, (char *)rxds->rxds_buf + off, > m->m_len, cas_free, sc, > (void *)(uintptr_t)idx, M_RDONLY, > EXT_NET_DRV); > -#endif > if ((m->m_flags & M_EXT) == 0) { > m_freem(m); > m = NULL; > @@ -1818,19 +1806,11 @@ cas_rint(struct cas_softc *sc) > sc->sc_rdmatag, > rxds2->rxds_dmamap, > BUS_DMASYNC_POSTREAD); > -#if __FreeBSD_version < 800016 > - MEXTADD(m2, > - (caddr_t)rxds2->rxds_buf, > - m2->m_len, cas_free, > - rxds2, M_RDONLY, > - EXT_NET_DRV); > -#else > - MEXTADD(m2, > - (caddr_t)rxds2->rxds_buf, > + m_extadd(m2, > + (char *)rxds2->rxds_buf, > m2->m_len, cas_free, sc, > (void *)(uintptr_t)idx2, > M_RDONLY, EXT_NET_DRV); > -#endif > if ((m2->m_flags & M_EXT) == > 0) { > m_freem(m2); > @@ -1889,21 +1869,15 @@ cas_rint(struct cas_softc *sc) > } > > static void > -cas_free(struct mbuf *m, void *arg1, void *arg2) > +cas_free(struct mbuf *m) > { > struct cas_rxdsoft *rxds; > struct cas_softc *sc; > u_int idx, locked; > > -#if __FreeBSD_version < 800016 > - rxds = arg2; > - sc = rxds->rxds_sc; > - idx = rxds->rxds_idx; > -#else > - sc = arg1; > - idx = (uintptr_t)arg2; > + sc = m->m_ext.ext_arg1; > + idx = (uintptr_t)m->m_ext.ext_arg2; > rxds = &sc->sc_rxdsoft[idx]; > -#endif > if (refcount_release(&rxds->rxds_refcount) == 0) > return; > > > Modified: head/sys/dev/cas/if_casvar.h > ============================================================================== > --- head/sys/dev/cas/if_casvar.h Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/cas/if_casvar.h Mon Oct 9 20:35:31 2017 (r324446) > @@ -119,10 +119,6 @@ struct cas_rxdsoft { > void *rxds_buf; /* receive buffer */ > bus_dmamap_t rxds_dmamap; /* our DMA map */ > bus_addr_t rxds_paddr; /* physical address of the segment */ > -#if __FreeBSD_version < 800016 > - struct cas_softc *rxds_sc; /* softc pointer */ > - u_int rxds_idx; /* our index */ > -#endif > u_int rxds_refcount; /* hardware + mbuf references */ > }; > > @@ -239,18 +235,7 @@ do { \ > __CAS_UPDATE_RXDESC(&(sc)->sc_rxdescs[(d)], \ > &(sc)->sc_rxdsoft[(s)], (s)) > > -#if __FreeBSD_version < 800016 > -#define CAS_INIT_RXDESC(sc, d, s) \ > -do { \ > - struct cas_rxdsoft *__rxds = &(sc)->sc_rxdsoft[(s)]; \ > - \ > - __rxds->rxds_sc = (sc); \ > - __rxds->rxds_idx = (s); \ > - __CAS_UPDATE_RXDESC(&(sc)->sc_rxdescs[(d)], __rxds, (s)); \ > -} while (0) > -#else > #define CAS_INIT_RXDESC(sc, d, s) CAS_UPDATE_RXDESC(sc, d, s) > -#endif > > #define CAS_LOCK_INIT(_sc, _name) \ > mtx_init(&(_sc)->sc_mtx, _name, MTX_NETWORK_LOCK, MTX_DEF) > > Modified: head/sys/dev/cxgbe/t4_sge.c > ============================================================================== > --- head/sys/dev/cxgbe/t4_sge.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/cxgbe/t4_sge.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -1670,10 +1670,10 @@ cl_metadata(struct adapter *sc, struct sge_fl *fl, str > } > > static void > -rxb_free(struct mbuf *m, void *arg1, void *arg2) > +rxb_free(struct mbuf *m) > { > - uma_zone_t zone = arg1; > - caddr_t cl = arg2; > + uma_zone_t zone = m->m_ext.ext_arg1; > + void *cl = m->m_ext.ext_arg2; > > uma_zfree(zone, cl); > counter_u64_add(extfree_rels, 1); > > Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -1979,9 +1979,9 @@ free_aiotx_buffer(struct aiotx_buffer *ab) > } > > static void > -t4_aiotx_mbuf_free(struct mbuf *m, void *buffer, void *arg) > +t4_aiotx_mbuf_free(struct mbuf *m) > { > - struct aiotx_buffer *ab = buffer; > + struct aiotx_buffer *ab = m->m_ext.ext_arg1; > > #ifdef VERBOSE_TRACES > CTR3(KTR_CXGBE, "%s: completed %d bytes for tid %d", __func__, > > Modified: head/sys/dev/dpaa/if_dtsec_rm.c > ============================================================================== > --- head/sys/dev/dpaa/if_dtsec_rm.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/dpaa/if_dtsec_rm.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -337,11 +337,13 @@ dtsec_rm_pool_rx_init(struct dtsec_softc *sc) > * @{ > */ > static void > -dtsec_rm_fqr_mext_free(struct mbuf *m, void *buffer, void *arg) > +dtsec_rm_fqr_mext_free(struct mbuf *m) > { > struct dtsec_softc *sc; > + void *buffer; > > - sc = arg; > + buffer = m->m_ext.ext_arg1; > + sc = m->m_ext.ext_arg2; > if (bman_count(sc->sc_rx_pool) <= DTSEC_RM_POOL_RX_MAX_SIZE) > bman_put_buffer(sc->sc_rx_pool, buffer); > else > > Modified: head/sys/dev/if_ndis/if_ndis.c > ============================================================================== > --- head/sys/dev/if_ndis/if_ndis.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/if_ndis/if_ndis.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -1418,7 +1418,7 @@ ndis_rxeof(adapter, packets, pktcnt) > p = packets[i]; > if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) { > p->np_refcnt++; > - (void)ndis_return_packet(NULL ,p, block); > + ndis_return_packet(p); > } > } > return; > @@ -1431,7 +1431,7 @@ ndis_rxeof(adapter, packets, pktcnt) > if (ndis_ptom(&m0, p)) { > device_printf(sc->ndis_dev, "ptom failed\n"); > if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS) > - (void)ndis_return_packet(NULL, p, block); > + ndis_return_packet(p); > } else { > #ifdef notdef > if (p->np_oob.npo_status == NDIS_STATUS_RESOURCES) { > > Modified: head/sys/dev/iscsi_initiator/isc_soc.c > ============================================================================== > --- head/sys/dev/iscsi_initiator/isc_soc.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/iscsi_initiator/isc_soc.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -70,12 +70,13 @@ static int ou_refcnt = 0; > | function for freeing external storage for mbuf > */ > static void > -ext_free(struct mbuf *m, void *a, void *b) > +ext_free(struct mbuf *m) > { > - pduq_t *pq = b; > + pduq_t *pq = m->m_ext.ext_arg1; > > if(pq->buf != NULL) { > - debug(3, "ou_refcnt=%d a=%p b=%p", ou_refcnt, a, pq->buf); > + debug(3, "ou_refcnt=%d a=%p b=%p", > + ou_refcnt, m->m_ext.ext_buf, pq->buf); > free(pq->buf, M_ISCSIBUF); > pq->buf = NULL; > } > @@ -137,11 +138,8 @@ isc_sendPDU(isc_session_t *sp, pduq_t *pq) > md->m_ext.ext_cnt = &ou_refcnt; > l = min(MCLBYTES, len); > debug(4, "setting ext_free(arg=%p len/l=%d/%d)", pq->buf, len, l); > - MEXTADD(md, pp->ds_addr + off, l, ext_free, > -#if __FreeBSD_version >= 800000 > - pp->ds_addr + off, > -#endif > - pq, 0, EXT_EXTREF); > + m_extadd(md, pp->ds_addr + off, l, ext_free, pq, NULL, 0, > + EXT_EXTREF); > md->m_len = l; > md->m_next = NULL; > mh->m_pkthdr.len += l; > > Modified: head/sys/dev/lge/if_lge.c > ============================================================================== > --- head/sys/dev/lge/if_lge.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/lge/if_lge.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -123,7 +123,7 @@ static int lge_detach(device_t); > static int lge_alloc_jumbo_mem(struct lge_softc *); > static void lge_free_jumbo_mem(struct lge_softc *); > static void *lge_jalloc(struct lge_softc *); > -static void lge_jfree(struct mbuf *, void *, void *); > +static void lge_jfree(struct mbuf *); > > static int lge_newbuf(struct lge_softc *, struct lge_rx_desc *, struct mbuf *); > static int lge_encap(struct lge_softc *, struct mbuf *, u_int32_t *); > @@ -689,7 +689,7 @@ lge_newbuf(sc, c, m) > struct mbuf *m; > { > struct mbuf *m_new = NULL; > - caddr_t *buf = NULL; > + char *buf = NULL; > > if (m == NULL) { > MGETHDR(m_new, M_NOWAIT, MT_DATA); > @@ -710,10 +710,9 @@ lge_newbuf(sc, c, m) > return(ENOBUFS); > } > /* Attach the buffer to the mbuf */ > - m_new->m_data = (void *)buf; > m_new->m_len = m_new->m_pkthdr.len = LGE_JUMBO_FRAMELEN; > - MEXTADD(m_new, buf, LGE_JUMBO_FRAMELEN, lge_jfree, > - buf, (struct lge_softc *)sc, 0, EXT_NET_DRV); > + m_extadd(m_new, buf, LGE_JUMBO_FRAMELEN, lge_jfree, sc, NULL, > + 0, EXT_NET_DRV); > } else { > m_new = m; > m_new->m_len = m_new->m_pkthdr.len = LGE_JUMBO_FRAMELEN; > @@ -848,20 +847,20 @@ lge_jalloc(sc) > * Release a jumbo buffer. > */ > static void > -lge_jfree(struct mbuf *m, void *buf, void *args) > +lge_jfree(struct mbuf *m) > { > struct lge_softc *sc; > int i; > struct lge_jpool_entry *entry; > > /* Extract the softc struct pointer. */ > - sc = args; > + sc = m->m_ext.ext_arg1; > > if (sc == NULL) > panic("lge_jfree: can't find softc pointer!"); > > /* calculate the slot this buffer belongs to */ > - i = ((vm_offset_t)buf > + i = ((vm_offset_t)m->m_ext.ext_buf > - (vm_offset_t)sc->lge_cdata.lge_jumbo_buf) / LGE_JLEN; > > if ((i < 0) || (i >= LGE_JSLOTS)) > > Modified: head/sys/dev/mwl/if_mwl.c > ============================================================================== > --- head/sys/dev/mwl/if_mwl.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/mwl/if_mwl.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -2522,12 +2522,12 @@ mwl_rxbuf_init(struct mwl_softc *sc, struct mwl_rxbuf > } > > static void > -mwl_ext_free(struct mbuf *m, void *data, void *arg) > +mwl_ext_free(struct mbuf *m) > { > - struct mwl_softc *sc = arg; > + struct mwl_softc *sc = m->m_ext.ext_arg1; > > /* XXX bounds check data */ > - mwl_putrxdma(sc, data); > + mwl_putrxdma(sc, m->m_ext.ext_buf); > /* > * If we were previously blocked by a lack of rx dma buffers > * check if we now have enough to restart rx interrupt handling. > @@ -2746,8 +2746,8 @@ mwl_rx_proc(void *arg, int npending) > * descriptor using the replacement dma > * buffer we just installed above. > */ > - MEXTADD(m, data, MWL_AGGR_SIZE, mwl_ext_free, > - data, sc, 0, EXT_NET_DRV); > + m_extadd(m, data, MWL_AGGR_SIZE, mwl_ext_free, sc, NULL, 0, > + EXT_NET_DRV); > m->m_data += off - hdrlen; > m->m_pkthdr.len = m->m_len = pktlen; > /* NB: dma buffer assumed read-only */ > > Modified: head/sys/dev/netmap/netmap_generic.c > ============================================================================== > --- head/sys/dev/netmap/netmap_generic.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/netmap/netmap_generic.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -166,7 +166,7 @@ nm_os_get_mbuf(struct ifnet *ifp, int len) > * has a KASSERT(), checking that the mbuf dtor function is not NULL. > */ > > -static void void_mbuf_dtor(struct mbuf *m, void *arg1, void *arg2) { } > +static void void_mbuf_dtor(struct mbuf *m) { } > > #define SET_MBUF_DESTRUCTOR(m, fn) do { \ > (m)->m_ext.ext_free = (fn != NULL) ? \ > @@ -624,7 +624,7 @@ generic_mbuf_destructor(struct mbuf *m) > * txsync. */ > netmap_generic_irq(na, r, NULL); > #ifdef __FreeBSD__ > - void_mbuf_dtor(m, NULL, NULL); > + void_mbuf_dtor(m); > #endif > } > > > Modified: head/sys/dev/wb/if_wb.c > ============================================================================== > --- head/sys/dev/wb/if_wb.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/dev/wb/if_wb.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -143,7 +143,7 @@ static int wb_probe(device_t); > static int wb_attach(device_t); > static int wb_detach(device_t); > > -static void wb_bfree(struct mbuf *, void *addr, void *args); > +static void wb_bfree(struct mbuf *); > static int wb_newbuf(struct wb_softc *, struct wb_chain_onefrag *, > struct mbuf *); > static int wb_encap(struct wb_softc *, struct wb_chain *, struct mbuf *); > @@ -824,7 +824,7 @@ wb_list_rx_init(sc) > } > > static void > -wb_bfree(struct mbuf *m, void *buf, void *args) > +wb_bfree(struct mbuf *m) > { > } > > @@ -843,10 +843,9 @@ wb_newbuf(sc, c, m) > MGETHDR(m_new, M_NOWAIT, MT_DATA); > if (m_new == NULL) > return(ENOBUFS); > - m_new->m_data = c->wb_buf; > m_new->m_pkthdr.len = m_new->m_len = WB_BUFBYTES; > - MEXTADD(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, c->wb_buf, > - NULL, 0, EXT_NET_DRV); > + m_extadd(m_new, c->wb_buf, WB_BUFBYTES, wb_bfree, NULL, NULL, > + 0, EXT_NET_DRV); > } else { > m_new = m; > m_new->m_len = m_new->m_pkthdr.len = WB_BUFBYTES; > > Modified: head/sys/kern/kern_mbuf.c > ============================================================================== > --- head/sys/kern/kern_mbuf.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/kern/kern_mbuf.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -504,7 +504,7 @@ mb_ctor_clust(void *mem, int size, void *arg, int how) > #endif > m = (struct mbuf *)arg; > if (m != NULL) { > - m->m_ext.ext_buf = (caddr_t)mem; > + m->m_ext.ext_buf = (char *)mem; > m->m_data = m->m_ext.ext_buf; > m->m_flags |= M_EXT; > m->m_ext.ext_free = NULL; > @@ -688,15 +688,13 @@ mb_free_ext(struct mbuf *m) > case EXT_DISPOSABLE: > KASSERT(m->m_ext.ext_free != NULL, > ("%s: ext_free not set", __func__)); > - (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, > - m->m_ext.ext_arg2); > + m->m_ext.ext_free(m); > uma_zfree(zone_mbuf, mref); > break; > case EXT_EXTREF: > KASSERT(m->m_ext.ext_free != NULL, > ("%s: ext_free not set", __func__)); > - (*(m->m_ext.ext_free))(m, m->m_ext.ext_arg1, > - m->m_ext.ext_arg2); > + m->m_ext.ext_free(m); > break; > default: > KASSERT(m->m_ext.ext_type == 0, > @@ -918,9 +916,8 @@ m_getm2(struct mbuf *m, int len, int how, short type, > * Nothing. > */ > void > -m_extadd(struct mbuf *mb, caddr_t buf, u_int size, > - void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2, > - int flags, int type) > +m_extadd(struct mbuf *mb, char *buf, u_int size, m_ext_free_t freef, > + void *arg1, void *arg2, int flags, int type) > { > > KASSERT(type != EXT_CLUSTER, ("%s: EXT_CLUSTER not allowed", __func__)); > > Modified: head/sys/kern/subr_mbpool.c > ============================================================================== > --- head/sys/kern/subr_mbpool.c Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/kern/subr_mbpool.c Mon Oct 9 20:35:31 2017 (r324446) > @@ -281,10 +281,10 @@ mbp_free(struct mbpool *p, void *ptr) > * Mbuf system external mbuf free routine > */ > void > -mbp_ext_free(struct mbuf *m, void *buf, void *arg) > +mbp_ext_free(struct mbuf *m) > { > > - mbp_free(arg, buf); > + mbp_free(m->m_ext.ext_arg2, m->m_ext.ext_arg1); > } > > /* > > Modified: head/sys/sys/mbpool.h > ============================================================================== > --- head/sys/sys/mbpool.h Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/sys/mbpool.h Mon Oct 9 20:35:31 2017 (r324446) > @@ -69,7 +69,7 @@ void *mbp_alloc(struct mbpool *, bus_addr_t *, uint32_ > void mbp_free(struct mbpool *, void *); > > /* free a chunk that is an external mbuf */ > -void mbp_ext_free(struct mbuf *, void *, void *); > +void mbp_ext_free(struct mbuf *); > > /* free all buffers that are marked to be on the card */ > void mbp_card_free(struct mbpool *); > > Modified: head/sys/sys/mbuf.h > ============================================================================== > --- head/sys/sys/mbuf.h Mon Oct 9 18:33:29 2017 (r324445) > +++ head/sys/sys/mbuf.h Mon Oct 9 20:35:31 2017 (r324446) > @@ -197,17 +197,17 @@ struct pkthdr { > * Compile-time assertions in uipc_mbuf.c test these values to ensure that > * they are correct. > */ > +typedef void m_ext_free_t(struct mbuf *); > struct m_ext { > union { > volatile u_int ext_count; /* value of ref count info */ > volatile u_int *ext_cnt; /* pointer to ref count info */ > }; > - caddr_t ext_buf; /* start of buffer */ > + char *ext_buf; /* start of buffer */ > uint32_t ext_size; /* size of buffer, for ext_free */ > uint32_t ext_type:8, /* type of external storage */ > ext_flags:24; /* external storage mbuf flags */ > - void (*ext_free) /* free routine if not the usual */ > - (struct mbuf *, void *, void *); > + m_ext_free_t *ext_free; /* free routine if not the usual */ > void *ext_arg1; /* optional argument pointer */ > void *ext_arg2; /* optional argument pointer */ > }; > @@ -436,10 +436,10 @@ struct mbuf { > > #define EXT_FLAG_NOFREE 0x000010 /* don't free mbuf to pool, notyet */ > > -#define EXT_FLAG_VENDOR1 0x010000 /* for vendor-internal use */ > -#define EXT_FLAG_VENDOR2 0x020000 /* for vendor-internal use */ > -#define EXT_FLAG_VENDOR3 0x040000 /* for vendor-internal use */ > -#define EXT_FLAG_VENDOR4 0x080000 /* for vendor-internal use */ > +#define EXT_FLAG_VENDOR1 0x010000 /* These flags are vendor */ > +#define EXT_FLAG_VENDOR2 0x020000 /* or submodule specific, */ > +#define EXT_FLAG_VENDOR3 0x040000 /* not used by mbuf code. */ > +#define EXT_FLAG_VENDOR4 0x080000 /* Set/read by submodule. */ > > #define EXT_FLAG_EXP1 0x100000 /* for experimental use */ > #define EXT_FLAG_EXP2 0x200000 /* for experimental use */ > @@ -610,9 +610,8 @@ struct mbuf *m_devget(char *, int, int, struct ifnet * > void (*)(char *, caddr_t, u_int)); > struct mbuf *m_dup(const struct mbuf *, int); > int m_dup_pkthdr(struct mbuf *, const struct mbuf *, int); > -void m_extadd(struct mbuf *, caddr_t, u_int, > - void (*)(struct mbuf *, void *, void *), void *, void *, > - int, int); > +void m_extadd(struct mbuf *, char *, u_int, m_ext_free_t, > + void *, void *, int, int); > u_int m_fixhdr(struct mbuf *); > struct mbuf *m_fragment(struct mbuf *, int, int); > void m_freem(struct mbuf *); > @@ -667,8 +666,8 @@ m_gettype(int size) > * Associated an external reference counted buffer with an mbuf. > */ > static __inline void > -m_extaddref(struct mbuf *m, caddr_t buf, u_int size, u_int *ref_cnt, > - void (*freef)(struct mbuf *, void *, void *), void *arg1, void *arg2) > +m_extaddref(struct mbuf *m, char *buf, u_int size, u_int *ref_cnt, > + m_ext_free_t freef, void *arg1, void *arg2) > { > > KASSERT(ref_cnt != NULL, ("%s: ref_cnt not provided", __func__)); > @@ -864,7 +863,7 @@ m_extrefcnt(struct mbuf *m) > #define MGETHDR(m, how, type) ((m) = m_gethdr((how), (type))) > #define MCLGET(m, how) m_clget((m), (how)) > #define MEXTADD(m, buf, size, free, arg1, arg2, flags, type) \ > - m_extadd((m), (caddr_t)(buf), (size), (free), (arg1), (arg2), \ > + m_extadd((m), (char *)(buf), (size), (free), (arg1), (arg2), \ > (flags), (type)) > #define m_getm(m, len, how, type) \ > m_getm2((m), (len), (how), (type), M_PKTHDR) > > From owner-svn-src-head@freebsd.org Tue Oct 10 04:32:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59147E484FB; Tue, 10 Oct 2017 04:32:42 +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 E1FC86AC8B; Tue, 10 Oct 2017 04:32:41 +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 8B2C93C36B3; Tue, 10 Oct 2017 15:32:38 +1100 (AEDT) Date: Tue, 10 Oct 2017 15:32:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324457 - in head/sys/dev: pccbb pci In-Reply-To: <201710092227.v99MRcFV016141@repo.freebsd.org> Message-ID: <20171010142321.Q1134@besplex.bde.org> References: <201710092227.v99MRcFV016141@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=LI0WeNe9 c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=Iau21ub-UXeGsUTFskIA:9 a=pNLrUVhz5m34pnmG:21 a=gw8T9opGQSYv2c5R:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:32:42 -0000 On Mon, 9 Oct 2017, Alan Somers wrote: > Log: > Remove embedded newlines from sysctl variable descriptions This doesn't fix the main bug of writing man pages in sysctl descriptions. > Modified: head/sys/dev/pccbb/pccbb_isa.c > ============================================================================== > --- head/sys/dev/pccbb/pccbb_isa.c Mon Oct 9 22:19:58 2017 (r324456) > +++ head/sys/dev/pccbb/pccbb_isa.c Mon Oct 9 22:27:38 2017 (r324457) > @@ -75,11 +75,11 @@ static SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, > > static int isa_intr_mask = EXCA_INT_MASK_ALLOWED; > SYSCTL_INT(_hw_pcic, OID_AUTO, intr_mask, CTLFLAG_RDTUN, &isa_intr_mask, 0, > - "Mask of allowable interrupts for this laptop. The default is generally\n\ > -correct, but some laptops do not route all the IRQ pins to the bridge to\n\ > -save wires. Sometimes you need a more restrictive mask because some of the\n\ > -hardware in your laptop may not have a driver so its IRQ might not be\n\ > -allocated."); > + "Mask of allowable interrupts for this laptop. The default is generally" > + " correct, but some laptops do not route all the IRQ pins to the bridge to" > + " save wires. Sometimes you need a more restrictive mask because some of" > + " the hardware in your laptop may not have a driver so its IRQ might not be" > + " allocated."); More low quality sysctl messages can be found using sysctl -da | grep -v ': ' # Sloppy check for embedded newlines sysctl -da | grep '^[^ ]*: [^A-Z]' # Uncapitalized messages previous | grep '^dev.*%'' # Auto-generated spam for dev tree sysctl -da | grep '[^.]*\.$' # Terminating period sysctl -da | grep '^[^ ]*: .*\..*\.$' # Multiple sentence, term. period sysctl -da | grep '^[^ ]*: .*\..*[^.]$' # Period, but not terminating sysctl -da | grep '\. ' # Normal sentence break sysctl -da | grep '\. [^.]' # Misformatted sentence break sysctl -da | grep '......' # (Really 80 dots). Long lines Results on freefall: - 3294 lines of output - 7 lines with embedded newlines - 1041 lines with uncapitalized messages - 637 lines with previous bug auto-generated for dev tree. Approx 5 lines duplicated for each device - 109 lines with a terminating period but no other periods - 5 lines with multiple sentences and a terminating period - 43 lines with a period but not a terminating period. This is a sloppy check for multiple sentences. It finds a few correct descriptions with periods in sysctl names - 7 lines with normal sentence breaks. Half for man pages in sysctls in this commit - 17 lines with single-space sentence breaks - 359 long lines. Not counting the sysctl name or ': ', only 30 lines are too long. These lines and ones up to about 10 shorter are also too long for source lines. Another type of search finds inconsistent spellings of booleans. grep -i for literal "disable" shows 63 lines with the following inconsistencies and verboseness: - often "disable" in the description echoes "disable" in the sysctl name. But sometimes the sysctl uses "control", or the sysctl name uses "disable" but the description uses "disallow" - when the description uses "Enable/disable" (10 instances), the name uses "allow" (2 instances), "use" (1 instance), "enable "(1 instance) or is not clearly boolean (6 instances), - often (in usb cloned descriptions), "Disable is spelled verbosely as "Set to disable". This is still not verbose enough to say that unset means "enable" or even "don't disable". Disable/enable is never used. For integer variables, there are lots of inconsistences and verboseness involving "number/number of/num/n". Bruce From owner-svn-src-head@freebsd.org Tue Oct 10 04:37:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7956CE48604; Tue, 10 Oct 2017 04:37:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::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 3BE186AE5E; Tue, 10 Oct 2017 04:37:08 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id z11so6039666pfk.4; Mon, 09 Oct 2017 21:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=0V385TKyWXJarKmk6m0gZR2KLfX6mWxzYDMnUzIANQk=; b=iVf7lqKSOIDNvTvtjdeymL+44hWy7c5zZSl8CMcogJKpCGQmKp5Gyaw0K/NGEUAUhv ovMTRnnC/GMpp1IJrZyA77SyxBOuRcA/ZLTA6CRhxuJozM35mgMNCmyeFIuN4rz/iWPQ 4+Hwh1cWStHCq/y3SkdMtazH3LawqyKbQhbxATLVHhX6GlF+iDq0gG0Cd7M8vxkiKixQ 8KyHqyVlnwQyrRAiWvg90zPDKCxGhVaC2GXOlnE7p5v3GBtfTzLNZMIBxVJ0ffGHOsoB lCVu6rb0CHSs5YVN8HevF5L4L9blPZ6yKUCby5fhQ8I0EF4uPlWKyrcutdWTgW+ty5We C+sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=0V385TKyWXJarKmk6m0gZR2KLfX6mWxzYDMnUzIANQk=; b=j3dAa6gZIu/0gVfHIOruAMF+9xQa23TsMW1QN1/DEcAF6VAQ8WQejqvwmAbythOtp/ O87kxMHK3IRikBGaGbNeeRG3glzW9TWiFb2JCajo9TeH2OF0p8vZ2rL5POb9bBYi8Alz ILSx6kAkCc+D8iqOXYUjOIxkzS1fP0dBM6PNalvgKqmQcfZCsnc2boQ74HJ2cNqSSxTU lT4mJqE5afNX5RdduMDHKqpRJUUIAlu9oIJE6/GkGOZ6Eo6K9FI0hCouzD4GJXB6Yzxg B70iSKueZVd+QL6Hj3jIvp/GIwR2aUfSmZIhZskr6PJSLhoVaV3bHF/Tu3rAVaj96wh8 Q2Uw== X-Gm-Message-State: AMCzsaWsYwM4x5QPX9qB/Yscgw5tMS/kBvyjAc0YryAyAYQ9UYYguCvn kJ3+9ayiI+qYyhOaRoxQcsRjB5i3 X-Google-Smtp-Source: AOwi7QCuPB29X5CxDjoVtMRZQpZkNSCG9/GET5ckfsXIYTrLt/TLAqHJrmGmEJjxD41pGuZSqvDP2A== X-Received: by 10.99.131.66 with SMTP id h63mr10966059pge.156.1507610227430; Mon, 09 Oct 2017 21:37:07 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 81sm1042976pfh.145.2017.10.09.21.37.06 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 21:37:06 -0700 (PDT) Subject: Re: svn commit: r324406 - head/sys/modules/em Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_355CBE91-445E-45E5-BEF3-ADBBA9C183F1"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <1507600445.84167.23.camel@freebsd.org> Date: Mon, 9 Oct 2017 21:37:05 -0700 Cc: Sean Bruno , Brooks Davis , rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <95D45458-24C3-473C-80AF-A2C622747886@gmail.com> <201710081542.v98FgZ5f074039@pdx.rh.CN85.dnsmgr.net> <20171009203350.GB68389@spindle.one-eyed-alien.net> <20789d66-03b0-db20-5f3f-2e4b9a4cd487@freebsd.org> <1507600445.84167.23.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:37:08 -0000 --Apple-Mail=_355CBE91-445E-45E5-BEF3-ADBBA9C183F1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=iso-8859-1 > On Oct 9, 2017, at 18:54, Ian Lepore wrote: ... > I think the right answer here is just > > LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_igb.ko That will definitely work and is probably the best pattern. Thanks, -Ngie --Apple-Mail=_355CBE91-445E-45E5-BEF3-ADBBA9C183F1 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ3E5xAAoJEPWDqSZpMIYV0EkP/itl1jeHLq9i4zZiZcvIQw3R yNMc7MJyBiszqFOINl6t3jP24tZwx1EU058tRqvmgt2zdMHljBdwqM1T5vJDw3Gs BicoIyB9zd4wC46O6ZiMITK14Otx2oJfsKo5Ov+0vj3yDao+xLrzrbHNESZ4YcMj kpkqmp8qHGsDR++MmWpNY0YaTNIryu66qfZqh6jPT6V3FAPILAIN7yX+11iWTXz5 YvuaH1czn0ioaCcjsbIm23rXzWHcLJSmUh1s9uZFeOXYgB3J0aKphtQHiAld7+NE 8yR7b3bPZVZGIAe2ZQnDHk2pU5yXK7qAk3EcNX9GFrDja2Qr0xUTPZFRl+NuCzQW vWHXQVIpuyKLOo/oAQmLP5kPMAVRf1v6/f5/0rdJr4Ra9FD+tc9NRqLV9lUv3ERD Qh7JbHNJLraFpM7w46+crOdq17Naerj5RU3F5GVIH9HziSp/jBmBU8UTI/0C+JK8 nsDVUbWhRY/m6OEe1T6NjXK1P968dESfd2HqFVcYvSzsfAzY0Oh2eLcDqkokkpLy uju5On0cU2swZ2RNgahF8du6LjtH1gRmiKCodnSdv7HwRySIQo8RCh8b/0REGkTv odsiep7WPSLt02a7pvWGoWBoccmUoXJWNXuUZj2JhygbNxZQ9X6I2eFC63vcjQZn tvVVOC8Iva7g0wnThXjD =51vv -----END PGP SIGNATURE----- --Apple-Mail=_355CBE91-445E-45E5-BEF3-ADBBA9C183F1-- From owner-svn-src-head@freebsd.org Tue Oct 10 04:39:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A2CBE486B1; Tue, 10 Oct 2017 04:39:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::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 232AE6AFF1; Tue, 10 Oct 2017 04:39:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id z11so6045279pfk.4; Mon, 09 Oct 2017 21:39:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=rAPzoaxSu7xAc7BqyjdH5ieASKFNsnfGZfaGO0DVbH0=; b=JF1VJLiS3hguQp6DVBQXXn4UU1wR9BHKY+B8LK+m9qAOKTiqzs9qPiImfsa/OKh+fM KimqU64fhbu9Z74E4CT7R6w4iALvpvEpz84PHV8ozbLREHt5LBJ95lUCu26T//9LGv71 pw+PYLtXSG10Ee6gFKZPVn1yXJLDe1wA8AIthZb/wJ+CbzXPXjJSC4MpWW1B30NZpCEQ OvsrQcLiZTFc+RUFOS3vF3FZl/Ck0eZ9UoMFkaNs/V2a3rspEOmJxdinK+VF3w2exDh+ QJ0FObdpFIWFqBooMppvNhHNPkvMCc2fJfZfXehw1WEfy/eqWI6VgEts4qtwUFlWzHQo j9qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=rAPzoaxSu7xAc7BqyjdH5ieASKFNsnfGZfaGO0DVbH0=; b=Z2aVPzzaf6NSt9IRsvj+Ps4LoRYa37wjypU1LVJFkfrjBBQgPAcBkf084FobruKS2V gNSISEHwHwZfOKSjQv9llqUduUd9BXWIurRnfXai2zllVCNYlvQnOjcCNWf9hX2erpmN dZv3PD1PM9e46Z7DKItgSemtmCtYrH3PQh6iGtGXvh7L616o8GhCEJTr0ZXCWQNfC2T+ 9nbnkc/QAvIXqiFMV6vMr6pBssR+GKeAjmW9ipi/CIWtnDw0Q6/qtZ8iPjsvBmEkn5PK uDI3ctlU2R5j3oynFz0BUThRgmFbr28XzS5Za2iwRQBg/0LmmSMuF5KPommkgbtomsc/ cR5Q== X-Gm-Message-State: AMCzsaUbs7+9HBJr4acmrQmoxvHeir3TsKtQbvdsVvUmYhKxW1xQQ806 WlLFSrn1N7P5d2EeRXvYXq9eD0Iy X-Google-Smtp-Source: AOwi7QD/SYc6MUO1KsffbwywrGdzGhX4SUAYf2wAHRbW8VzHqaeFkhcjQv5Z4u93SMWxawL6Raqjmg== X-Received: by 10.99.106.67 with SMTP id f64mr11512245pgc.101.1507610369438; Mon, 09 Oct 2017 21:39:29 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id d12sm14835285pgu.91.2017.10.09.21.39.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 21:39:28 -0700 (PDT) Subject: Re: svn commit: r324452 - in head/sys/boot: . arm/uboot efi/boot1 efi/loader i386/gptboot i386/gptzfsboot i386/loader i386/zfsboot mips/beri/boot2 mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw ... Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_AFEEFB1B-4C8A-4F5C-8E0A-0C33CBC00FA7"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <2405988.NgFGazePSZ@ralph.baldwin.cx> Date: Mon, 9 Oct 2017 21:39:27 -0700 Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <4675B6E0-7E3E-4C86-AAB3-4DBD3D44AD94@gmail.com> References: <201710092212.v99MClEC011111@repo.freebsd.org> <2405988.NgFGazePSZ@ralph.baldwin.cx> To: John Baldwin X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:39:30 -0000 --Apple-Mail=_AFEEFB1B-4C8A-4F5C-8E0A-0C33CBC00FA7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Oct 9, 2017, at 16:23, John Baldwin wrote: =E2=80=A6 > s/along/alone/. bde@ probably prefers that the comments start with a = capital > letter as well. Also: standalone is one word, not 2. -Ngie --Apple-Mail=_AFEEFB1B-4C8A-4F5C-8E0A-0C33CBC00FA7 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ3E8AAAoJEPWDqSZpMIYVxnEQALfmuc9sR6cLlyzbNG7pgMGU MgFcPdUeJ0FY9Xg1CR47UIFgsRm9wygiknNMRSbaln4IyFxJXTXg2IKScELRQBVd VWKgOfepGtVk4h80EvjNWpOffsjzNHULkmDSr+80fgguJUGLkJDWqr69oJF9F36p 49fB8YCKM9OpOuvmDbCVUiTyTcUliBBrFAhtCz2MusN+XMIsv5wT0HiXAwt3S0Cl AiGb84omWAwqFowYg4G9MA67T3OG+EfJUAvHUq16l7j8YJ+XXi3vdR03excbdIF1 P3MBUNgb1pDwy1NC2Ttui/HzoLyYq2ty1hdyN6sWsZ4Y+VAquky/N783jXun+MvL BDlakKFYe3ehbMiKDvsmVd9c/M1e1Bjdv/7qX3JFoXrhyNQL47WgWz4ntz7GLkjA thf1r/o6S3UZISDPqx/6X3ccpF7WtWHOaDulbGGqPaqPnomOu0sNf2XfJp4xe4aS 9oduiusMFN6DzTYqm54BnwXJja2Qqx5XTxsI7ZicKP/jFwIYnc2H16vFw6pF/QBT CFpECnPRgE4bqL9RBU2eRRN4vRUL32fZRWFHovlKwd/xGkQs4Ar+Gbtxz7Wzmp6Y yvuzrERV1QNRmgPY4tGDGTj62LVP3416VC17D37uwEyPIkpch/hl5euYlXBUrmuV RXUpDdENaNMXEeRHwjjy =q4aq -----END PGP SIGNATURE----- --Apple-Mail=_AFEEFB1B-4C8A-4F5C-8E0A-0C33CBC00FA7-- From owner-svn-src-head@freebsd.org Tue Oct 10 04:47:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26149E48909; Tue, 10 Oct 2017 04:47:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E755C6B3F7; Tue, 10 Oct 2017 04:47:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A4l2uS074453; Tue, 10 Oct 2017 04:47:02 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A4l2Rv074452; Tue, 10 Oct 2017 04:47:02 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710100447.v9A4l2Rv074452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 04:47:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324469 - head/sys/modules/iwmfw X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/modules/iwmfw X-SVN-Commit-Revision: 324469 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:47:03 -0000 Author: ngie Date: Tue Oct 10 04:47:01 2017 New Revision: 324469 URL: https://svnweb.freebsd.org/changeset/base/324469 Log: Sort SUBDIR and put entries on a single list This is to aid with identifying diffs between commits. MFC after: 3 days Modified: head/sys/modules/iwmfw/Makefile Modified: head/sys/modules/iwmfw/Makefile ============================================================================== --- head/sys/modules/iwmfw/Makefile Tue Oct 10 03:40:38 2017 (r324468) +++ head/sys/modules/iwmfw/Makefile Tue Oct 10 04:47:01 2017 (r324469) @@ -1,5 +1,9 @@ # $FreeBSD$ -SUBDIR= iwm3160fw iwm7260fw iwm7265fw iwm8000Cfw iwm7265Dfw +SUBDIR= iwm3160fw \ + iwm7260fw \ + iwm7265fw \ + iwm7265Dfw \ + iwm8000Cfw .include From owner-svn-src-head@freebsd.org Tue Oct 10 04:50:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B85CE48A0C; Tue, 10 Oct 2017 04:50:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B0E46B57D; Tue, 10 Oct 2017 04:50:06 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A4o514074618; Tue, 10 Oct 2017 04:50:05 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A4o56r074617; Tue, 10 Oct 2017 04:50:05 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710100450.v9A4o56r074617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 04:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324470 - head/sys/modules/iwmfw X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/modules/iwmfw X-SVN-Commit-Revision: 324470 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:50:06 -0000 Author: ngie Date: Tue Oct 10 04:50:05 2017 New Revision: 324470 URL: https://svnweb.freebsd.org/changeset/base/324470 Log: Add missing SUBDIR needed for iwmfw to load after ^/head@r324434 Submitted by: Pete Wright MFC after: 1 month MFC with: r324434 Modified: head/sys/modules/iwmfw/Makefile Modified: head/sys/modules/iwmfw/Makefile ============================================================================== --- head/sys/modules/iwmfw/Makefile Tue Oct 10 04:47:01 2017 (r324469) +++ head/sys/modules/iwmfw/Makefile Tue Oct 10 04:50:05 2017 (r324470) @@ -4,6 +4,7 @@ SUBDIR= iwm3160fw \ iwm7260fw \ iwm7265fw \ iwm7265Dfw \ - iwm8000Cfw + iwm8000Cfw \ + iwm8265fw .include From owner-svn-src-head@freebsd.org Tue Oct 10 04:53:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59940E48BAC; Tue, 10 Oct 2017 04:53:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 240DD6B92F; Tue, 10 Oct 2017 04:53:27 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A4rQ21078537; Tue, 10 Oct 2017 04:53:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A4rQ6W078536; Tue, 10 Oct 2017 04:53:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710100453.v9A4rQ6W078536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 04:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324471 - head/sys/boot X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/sys/boot X-SVN-Commit-Revision: 324471 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:53:27 -0000 Author: ngie Date: Tue Oct 10 04:53:26 2017 New Revision: 324471 URL: https://svnweb.freebsd.org/changeset/base/324471 Log: Fix typos: `stand alon{e,g}` should be spelled like `standalone` Modified: head/sys/boot/Makefile.inc Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Tue Oct 10 04:50:05 2017 (r324470) +++ head/sys/boot/Makefile.inc Tue Oct 10 04:53:26 2017 (r324471) @@ -6,11 +6,11 @@ __BOOT_MAKEFILE_INC__=${MFILE} SASRC=${SRCTOP}/lib/libstand -# Normal stand alone library +# Normal standalone library LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a -# stand alone library compiled for 32-bit version of the processor +# Standalone library compiled for 32-bit version of the processor LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a -# stand along library compiled for userboot +# Standalone library compiled for userboot LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a CFLAGS+=-I${SASRC} From owner-svn-src-head@freebsd.org Tue Oct 10 04:56:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 421C9E48C38 for ; Tue, 10 Oct 2017 04:56:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1840C6BAA5 for ; Tue, 10 Oct 2017 04:56:47 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id n195so457462itg.0 for ; Mon, 09 Oct 2017 21:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=XqVCfnnDdWOvRvMLO0QaJx0MqLy639Ze8+fthj171d8=; b=Nvtu3Hpwb6HN3bwPI+oP48SM6hKYDpOP2c30tBx7OkaMzoMSFFDn1wGvHGINb29n6G 8hmwo9UEfCXQpp54UW1YV39gLnTsi3dD6tRY2PUjj9drXO+H5rtHwwU/qTMJKoi8jjxM M4kM+VWA+rG4gieuG91talqSojZS7W+RV1vDKIUtuhepSoOiTl1Lcvd//MRZUNCsnbx9 pMPUijZxhXxoO8vpjnq3/CJG82liLFj81QZlizxOysY/4Wcv4K9/n3n6pl4LU70IoQfq ZIQ9EkQ2oxNfoGKI/ZZm29/OIDCCOXrHuP04SzPRkjNnKVmJZtAniEt56kun81BgWv/x BIcQ== 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=XqVCfnnDdWOvRvMLO0QaJx0MqLy639Ze8+fthj171d8=; b=hRi3wDyO+oBzAQO5W9RYEbU3PICzxBPdvb8Q3v1tSQc7iFsI3sZmuNDloiOGgr/yH4 oFgWEzleB1NMdmF7y9Ruk+YAK4S5bJeH3pPKpSdJsQ1WdGHQPCWfC8CZqYnn1jKTpCBQ MBIWGjrUtIvCxXjbstspg80vt11nJxl3ehYms6ckG2QB37aOyij7BHdlR+MDKXfDHbiX PFH4Nv6rTL3geM22lK0W4ggpn1Papv5N7ldpGwOIrv/0dBlu2PK2vCIi8dc5mE2PTFgJ snExOGCxfo/aGYFOem8g5TlihYXbLI7L6CiyGGbA2dyaUveZcpDCyxQ1MlfWXcZenWil bJtg== X-Gm-Message-State: AMCzsaW9BeFMLqgCv8EbBWKRYAQxyDy+qwcutOQwiNFRijnWo3yGTe25 sxMhSaR2RpsnXOdcsrqOsLHpbuW3rZyhjLFnoCe60g== X-Google-Smtp-Source: AOwi7QBhUzAwjbZO7F7m6EkfJL1iceXBMUv/jz3XX9djK8pWB7QDMj7XZBr0j/L34YT2Y0B45Upg6xakZ0INGa1bAiM= X-Received: by 10.36.203.3 with SMTP id u3mr15347955itg.136.1507611406359; Mon, 09 Oct 2017 21:56:46 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Mon, 9 Oct 2017 21:56:45 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:8936:338a:89de:d5ea] In-Reply-To: <201710100453.v9A4rQ6W078536@repo.freebsd.org> References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> From: Warner Losh Date: Mon, 9 Oct 2017 22:56:45 -0600 X-Google-Sender-Auth: KEkzSxtsquCCgiinnZHrQEWCNFU Message-ID: Subject: Re: svn commit: r324471 - head/sys/boot To: Ngie Cooper Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:56:47 -0000 DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. DO NOT MAKE ANY COMMITS TO sys/boot. BACK OFF. Seriously, though, extra changes create extra friction, and these changes aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a conflict when I update. So please, do not make any edits to sys/boot whatsoever, no matter how trivial. At least until I'm done. Thanks. Warner On Mon, Oct 9, 2017 at 10:53 PM, Ngie Cooper wrote: > Author: ngie > Date: Tue Oct 10 04:53:26 2017 > New Revision: 324471 > URL: https://svnweb.freebsd.org/changeset/base/324471 > > Log: > Fix typos: `stand alon{e,g}` should be spelled like `standalone` > > Modified: > head/sys/boot/Makefile.inc > > Modified: head/sys/boot/Makefile.inc > ============================================================ > ================== > --- head/sys/boot/Makefile.inc Tue Oct 10 04:50:05 2017 (r324470) > +++ head/sys/boot/Makefile.inc Tue Oct 10 04:53:26 2017 (r324471) > @@ -6,11 +6,11 @@ > __BOOT_MAKEFILE_INC__=${MFILE} > > SASRC=${SRCTOP}/lib/libstand > -# Normal stand alone library > +# Normal standalone library > LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a > -# stand alone library compiled for 32-bit version of the processor > +# Standalone library compiled for 32-bit version of the processor > LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a > -# stand along library compiled for userboot > +# Standalone library compiled for userboot > LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a > > CFLAGS+=-I${SASRC} > > From owner-svn-src-head@freebsd.org Tue Oct 10 04:57:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11675E48CA8; Tue, 10 Oct 2017 04:57:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::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 CECC76BBEC; Tue, 10 Oct 2017 04:57:29 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id n14so14123970pfh.8; Mon, 09 Oct 2017 21:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Ty0y1lylmMsfvc55h2m4uoAHWlzevEwZbvzQAryHZOU=; b=ZJSs0orAMxu3Br5+RjDmcYK7xQDt/5SLnGUTumcC8mOQuW4Vl7R0h3XVxnQvPJYcYT WIzSgJRy32kLJDd7O9D+E2tbfk/JINrlzp6yK3NyWg0MGOWTEd6ie2zwrQ4UUioMwmF8 FeyNqtfwwZZlC4bAxnQpJkhmwn/h6gohM1E4aXGBzXLnEwCEJG8Jy1n3MecxjajMZ3iq aAR7Cq3+mlClI8wdkzCdX3VuDnrTDxwoEulhoeeQhFq0wTbhc0otgx+HBAOJ27Z2lC3n K48DauKT3ymVKtzWMhnTgubcwgUyDviyxbhaCDAEgQ/1Dw2rwEP3h7nb0nvukjhtIH7z mqdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Ty0y1lylmMsfvc55h2m4uoAHWlzevEwZbvzQAryHZOU=; b=X/5LQMFN7P5H6HpzkiE2FFovUCr1nGfx5Z2YugWuc/ukoU/yZkkgpIdn4wL5YNL265 mNSXK9UcUKZommRlwZ9+XEXq/F6pTJ7gPSYxp7LIS8Ny+e+PE4lZKFKAW42soTT3IO6t Y/7Iz5goTs1MUAu4dAMQ2IUI15Kdhz7a6cpL+7ggCDa2NEvcy76u0tQfpHz1fcCoJl5/ R5ULLI5qJS3wW+H/JI1mG1U40zw4SLCZvi+ItacFePSQXWI156+8W1hMMkpz56MOLSv9 LAPVojlVzqNH1v9+X3ZuAllKmlpLdP/xGxUeacLF7CwsoEUqyFyJJl22QdGy+fBJFQmH SWEQ== X-Gm-Message-State: AMCzsaVznY+TBsFZEoG1wh+6Yoo2ld4rvjDEJ4SnTnMaTA0uSGwkQRwD dCMM15chPtDLgHnzhKuRVOcu/cBH X-Google-Smtp-Source: AOwi7QCxeZLODHvz7foKA3/lQa6PxizLA0NCW7cfRc2gWUGXrtcgGK5g5srNOa+ogvvWwgZ1ljIxZA== X-Received: by 10.99.136.198 with SMTP id l189mr10912497pgd.165.1507611449409; Mon, 09 Oct 2017 21:57:29 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id z126sm18190632pfz.70.2017.10.09.21.57.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 21:57:28 -0700 (PDT) Subject: Re: svn commit: r324471 - head/sys/boot Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_34C74F4C-F411-4EF7-9BC3-DE8D5F7AEFED"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Mon, 9 Oct 2017 21:57:27 -0700 Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 04:57:30 -0000 --Apple-Mail=_34C74F4C-F411-4EF7-9BC3-DE8D5F7AEFED Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 9, 2017, at 21:56, Warner Losh wrote: >=20 > DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. >=20 > DO NOT MAKE ANY COMMITS TO sys/boot. >=20 > BACK OFF. >=20 > Seriously, though, extra changes create extra friction, and these = changes aren't worth any friction at all. I'm deleting LIBSAU and this = guarantees a conflict when I update. >=20 > So please, do not make any edits to sys/boot whatsoever, no matter how = trivial. >=20 > At least until I'm done. Ok --Apple-Mail=_34C74F4C-F411-4EF7-9BC3-DE8D5F7AEFED Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ3FM3AAoJEPWDqSZpMIYVf3kP/Rv80h4YoUvKQw1qnL6wYYI9 88QHhRreSMDfImEBoZCbzfKWWpqKdRN7Pu54XVCJy9NghmR/oMl452qhzxQxssbP eQXcFaZlReCY9tckyWvL3mt550C0OiHBQHZQeMEqlG4nfEmbcQCsih9aoY0WlejO DrbPeZs6jeERDwql0T2KtjOeSiemcU6oFdwX2ayv5CdFpYzD8sc0JCNEo+fmZb5t UV/7SeJ8MJIhNV0KKQ62IIsaexbXMRtPNJkRy3FnyX6NaBqaeYLP3wOnJpM/27wE 5R9tDS0m6EzyZmr0Ignp9JKqLftlcCpb7iRM/LEtGq7SuxCBnccxNVj3P4QUOa6x 8aRd2LWzPd7HBGzFgMP6/aCULZs25CPf7uW8FUeguVfCudE9LwFd8/6cS1r/EkLm VE+Rcg8WzN2gXwBKvMe/uUFRwlM3+1n1KJtvKYNi6gH2yUfNX4tv7e836TnCbq6r OMhVr9LZoYe8tQypQgPonhnEz44jaZB++Ue6NftdfU+EOZH+mygB6Q3xsa/v5QCO RiAjhkSmSO1DJOhKNjiZ8FGcvhx+0GSDFfvKCQuvisbzz+HHY2qtDxeXwSLPw0iS mdrQa/h+4iDZgjUQ9FP+WVgjAhVSMfxtGMAFLPStuS2yz5mnwro1GMSDnDgmsE8u e3yoUe8/3iqKwPaBoyBZ =Hdq/ -----END PGP SIGNATURE----- --Apple-Mail=_34C74F4C-F411-4EF7-9BC3-DE8D5F7AEFED-- From owner-svn-src-head@freebsd.org Tue Oct 10 05:47:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C418BE24F59; Tue, 10 Oct 2017 05:47:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D20E6D3B7; Tue, 10 Oct 2017 05:47:11 +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 v9A5lAxe099745; Tue, 10 Oct 2017 05:47:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A5lA0L099744; Tue, 10 Oct 2017 05:47:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201710100547.v9A5lA0L099744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 10 Oct 2017 05:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324476 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 324476 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 05:47:11 -0000 Author: eadler Date: Tue Oct 10 05:47:10 2017 New Revision: 324476 URL: https://svnweb.freebsd.org/changeset/base/324476 Log: Add OpenBSD 6.2, reorder macOS 10.13 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Oct 10 05:46:57 2017 (r324475) +++ head/share/misc/bsd-family-tree Tue Oct 10 05:47:10 2017 (r324476) @@ -351,12 +351,12 @@ FreeBSD 5.2 | | | *--FreeBSD | macOS | OpenBSD 6.0 | | 11.0 | 10.12 | | | | | | | NetBSD 7.1 | | - | | | | | | DragonFly 4.8.0 - | | | | | OpenBSD 6.1 | + | | | macOS | | DragonFly 4.8.0 + | | | 10.13 | OpenBSD 6.1 | | FreeBSD | | | | | | 11.1 FreeBSD | | | | - | | 10.4 macOS | | | - | v 10.13 | | | + | | 10.4 | | OpenBSD 6.2 | + | v | | | | | | | | | FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -719,6 +719,7 @@ OpenBSD 6.1 2017-04-11 [OBD] FreeBSD 11.1 2017-07-26 [FBD] macOS 10.13 2017-09-25 [APL] FreeBSD 10.4 2017-10-03 [FBD] +OpenBSD 6.2 2017-10-09 [OBD] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Tue Oct 10 05:58:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF8E2E25340; Tue, 10 Oct 2017 05:58:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 985486DA88; Tue, 10 Oct 2017 05:58:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A5wXHV003971; Tue, 10 Oct 2017 05:58:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A5wXkR003969; Tue, 10 Oct 2017 05:58:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710100558.v9A5wXkR003969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 05:58:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324478 - in head: sbin/growfs/tests tests/sys/geom/class/eli X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: in head: sbin/growfs/tests tests/sys/geom/class/eli X-SVN-Commit-Revision: 324478 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 05:58:34 -0000 Author: ngie Date: Tue Oct 10 05:58:33 2017 New Revision: 324478 URL: https://svnweb.freebsd.org/changeset/base/324478 Log: Check the exit code from fsck_ffs instead of relying on MODIFIED being in the output ^/head@r323923 changed when MODIFIED is printed at exit. It's better to follow the documented way of determining whether or not a filesystem is clean per fsck_ffs, i.e., ensure that the exit code is either 0 or 7. The pass/fail determination is brittle prior to this commit, and ^/head@r323923 made the issue apparent -- thus this needs to be fixed independent of ^/head@r323923. PR: 222780 MFC after: 1 week MFC with: r323923 Reported by: Jenkins Modified: head/sbin/growfs/tests/legacy_test.pl head/tests/sys/geom/class/eli/resize_test.sh Modified: head/sbin/growfs/tests/legacy_test.pl ============================================================================== --- head/sbin/growfs/tests/legacy_test.pl Tue Oct 10 05:52:28 2017 (r324477) +++ head/sbin/growfs/tests/legacy_test.pl Tue Oct 10 05:58:33 2017 (r324478) @@ -2,6 +2,7 @@ use strict; use warnings; +use POSIX; use Test::More tests => 19; use Fcntl qw(:DEFAULT :seek); @@ -11,6 +12,22 @@ use constant BLKS_PER_MB => 2048; my $unit; END { system "mdconfig -du$unit" if defined $unit }; +sub fsck_md { + my ($is_clean, $md); + + $md = shift; + + chomp(my @fsck_output = `fsck_ffs -Ffy ${md}a`); + $is_clean = WIFEXITED($?) && + (WEXITSTATUS($?) == 0 || WEXITSTATUS($?) == 7); + ok($is_clean, "checking ${md}a's filesystem"); + if ($is_clean) { + diag "filesystem reported clean"; + } else { + diag "filesystem not reported clean: " . join("\n", @fsck_output); + } +} + sub setsize { my ($partszMB, $unitszMB) = @_; @@ -46,9 +63,8 @@ SKIP: { ok(setsize(10, 40), "Sized ${md}a to 10m"); system "newfs -O $type -U ${md}a >/dev/null"; is($?, 0, "Initialised the filesystem on ${md}a as UFS$type"); - chomp(my @out = `fsck -tufs -y ${md}a`); - ok(!grep(/MODIFIED/, @out), "fsck says ${md}a is clean, " . - scalar(@out) . " lines of output"); + + fsck_md($md); } extend20_zeroed: { @@ -62,9 +78,7 @@ SKIP: { fill(30 * BLKS_PER_MB - $unallocated, $unallocated, chr(0)) if $unallocated; - chomp(my @out = `fsck -tufs -y ${md}a`); - ok(!grep(/MODIFIED/, @out), "fsck says ${md}a is clean, " . - scalar(@out) . " lines of output"); + fsck_md($md); } extend30_garbaged: { @@ -78,9 +92,7 @@ SKIP: { fill(30 * BLKS_PER_MB - $unallocated, $unallocated, chr(0)) if $unallocated; - chomp(my @out = `fsck -tufs -y ${md}a`); - ok(!grep(/MODIFIED/, @out), "fsck says ${md}a is clean, " . - scalar(@out) . " lines of output"); + fsck_md($md); } } Modified: head/tests/sys/geom/class/eli/resize_test.sh ============================================================================== --- head/tests/sys/geom/class/eli/resize_test.sh Tue Oct 10 05:52:28 2017 (r324477) +++ head/tests/sys/geom/class/eli/resize_test.sh Tue Oct 10 05:58:33 2017 (r324478) @@ -12,6 +12,19 @@ md=$(mdconfig -s40m) || exit 1 unit=${md#md} i=1 +fsck_md() +{ + local is_clean + + out=$(fsck_ffs -Ffy ${md}a.eli) + if [ $? -eq 0 -o $? -eq 7 ]; then + echo "ok $i - fsck says ${md}a.eli is clean" + else + echo "not ok $i - fsck says ${md}a.eli is dirty" + fi + i=$((i + 1)) +} + setsize() { partszMB=$1 unitszMB=$2 @@ -38,13 +51,8 @@ i=$((i + 1)) newfs -U ${md}a.eli >/dev/null || echo -n "not " echo ok $i - "Initialised the filesystem on ${md}a.eli" i=$((i + 1)) -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) +fsck_md - # Doing a backup, resize & restore must be forced (with -f) as geli # verifies that the provider size in the metadata matches the consumer. @@ -78,13 +86,8 @@ growfs -y ${md}a.eli >/dev/null || echo -n "not " echo ok $i - "Extended the filesystem on ${md}a.eli" i=$((i + 1)) -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) +fsck_md - # Now do the resize properly geli detach ${md}a.eli || echo -n "not " @@ -110,11 +113,7 @@ growfs -y ${md}a.eli >/dev/null || echo -n "not " echo ok $i - "Extended the filesystem on ${md}a.eli" i=$((i + 1)) -out=$(fsck -tufs -y ${md}a.eli) -echo "$out" | fgrep -q MODIFIED && echo -n "not " -echo ok $i - "fsck says ${md}a.eli is clean," $(echo $(echo "$out" | wc -l)) \ - "lines of output" -i=$((i + 1)) +fsck_md geli detach ${md}a.eli gpart destroy -F $md >/dev/null From owner-svn-src-head@freebsd.org Tue Oct 10 07:17:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 948B2E26E9B; Tue, 10 Oct 2017 07:17:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18A506FE63; Tue, 10 Oct 2017 07:17:14 +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 v9A7H4Gj045834 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Oct 2017 10:17:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v9A7H4Gj045834 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v9A7H3tq045833; Tue, 10 Oct 2017 10:17:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Oct 2017 10:17:03 +0300 From: Konstantin Belousov To: Gleb Smirnoff Cc: Sean Bruno , Jason Eggleston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324405 - head/sys/kern Message-ID: <20171010071703.GR95911@kib.kiev.ua> References: <201710072330.v97NUv7E040636@repo.freebsd.org> <20171009232052.GU1055@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171009232052.GU1055@FreeBSD.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 07:17:15 -0000 On Mon, Oct 09, 2017 at 04:20:52PM -0700, Gleb Smirnoff wrote: > Sean & Jason, > > On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: > S> Author: sbruno > S> Date: Sat Oct 7 23:30:57 2017 > S> New Revision: 324405 > S> URL: https://svnweb.freebsd.org/changeset/base/324405 > S> > S> Log: > S> Check so_error early in sendfile() call. Prior to this patch, if a > S> connection was reset by the remote end, sendfile() would just report > S> ENOTCONN instead of ECONNRESET. > S> > S> Submitted by: Jason Eggleston > S> Reviewed by: glebius > S> Sponsored by: Limelight Networks > S> Differential Revision: https://reviews.freebsd.org/D12575 > S> > S> Modified: > S> head/sys/kern/kern_sendfile.c > S> > S> Modified: head/sys/kern/kern_sendfile.c > S> ============================================================================== > S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 (r324404) > S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 (r324405) > S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, struct file > S> *so = (*sock_fp)->f_data; > S> if ((*so)->so_type != SOCK_STREAM) > S> return (EINVAL); > S> + if ((*so)->so_error) { > S> + error = (*so)->so_error; > S> + (*so)->so_error = 0; > S> + return (error); > S> + } > S> if (((*so)->so_state & SS_ISCONNECTED) == 0) > S> return (ENOTCONN); > S> return (0); > > Despite my initial positive review, now I am quite unsure on that. > > Problem is that sendfile(2) isn't defined by SUS, so there is no > distinctive final answer on that. Should we match other OSes? > Should we match our historic behaviour? Or should we match > write(2)/send(2) to socket, which are closest analogy. I probably > believe in the latter: sendfile(2) belongs to write(2)/send(2) > family. > > SUS specifies that write may return ECONNRESET. It also documents > EPIPE. However, our manual page documents only EPIPE for both > send(2) and write(2). For write we have: > > SOCKBUF_LOCK(&so->so_snd); > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > SOCKBUF_UNLOCK(&so->so_snd); > error = EPIPE; > goto out; > } > if (so->so_error) { > error = so->so_error; > so->so_error = 0; > SOCKBUF_UNLOCK(&so->so_snd); > goto out; > } > > Indeed, EPIPE will be returned prior to return/clear of so_error, > which supposedly is ECONNRESET. > > In the sendfile(2) implementation we see exactly same code: > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > error = EPIPE; > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } else if (so->so_error) { > error = so->so_error; > so->so_error = 0; > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } > > But it isn't reached. Before due to SS_ISCONNECTED check, now > due to your change. Now we got two spots where so_error is > returned/cleared. Do you mean that EPIPE could be returned from sendfile(2) after some round of changes ? It should be not. EPIPE is a workaround for naive programs that use stdio and cannot detect the broken pipe when used as an element in the shell plumbing. EPIPE results in SIGPIPE terminating such programs (instead of looping endlessly when write(2) returns error). Any application using sendfile(2) must understand the API to properly handle disconnects, so SIGPIPE workaround would be avoided. Often such applications are already sofisticated enough to block SIGPIPE, but if blocking becomes a new requirement because EPIPE was not returned in earlier version of the system, they might not block it still. > > For the receive family (read(2) and recv(2)), SUS specifies > ECONNRESET and our code does that. It also clears so_error. > > So, after your change at least one standard case is broken: an > application that polls/selects for both readability and > writeability of a socket. It discovers that socket is available > for writing, does sendfile(2), receives ECONNRESET. Then it does > read on the socket, and blocks(?) or returns a bogus error(?), > not sure. But definitely not ECONNRESET, since it is now cleared. > > Now, where does this ENOTCONN come from? These two lines: > > if (((*so)->so_state & SS_ISCONNECTED) == 0) > return (ENOTCONN); > > can be traced back all the way to original 1998 commit of sendfile. > > Here comes difference between sendfile(2) and send(2). In send(2), > this check is done _after_ so_error check, so your change is correct > in placing of so_error check wrt so_state check, but is incorrect > in placing wrt socket buffer state check. > > After all this considerations, I would suggest to revert your change, > and apply this patch. It would make behavior of sendfile(2) to match > send(2). I would appreciate more reviews around it. > > -- > Gleb Smirnoff > Index: kern_sendfile.c > =================================================================== > --- kern_sendfile.c (revision 324457) > +++ kern_sendfile.c (working copy) > @@ -507,13 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct > *so = (*sock_fp)->f_data; > if ((*so)->so_type != SOCK_STREAM) > return (EINVAL); > - if ((*so)->so_error) { > - error = (*so)->so_error; > - (*so)->so_error = 0; > - return (error); > - } > - if (((*so)->so_state & SS_ISCONNECTED) == 0) > - return (ENOTCONN); > return (0); > } > > @@ -622,6 +615,12 @@ retry_space: > SOCKBUF_UNLOCK(&so->so_snd); > goto done; > } > + if ((so->so_state & SS_ISCONNECTED) == 0) { > + SOCKBUF_UNLOCK(&so->so_snd); > + error = ENOTCONN; > + goto done; > + } > + > space = sbspace(&so->so_snd); > if (space < rem && > (space <= 0 || From owner-svn-src-head@freebsd.org Tue Oct 10 08:16:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCE5EE2879D; Tue, 10 Oct 2017 08:16:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A3B671F68; Tue, 10 Oct 2017 08:16:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A8Gtdp061919; Tue, 10 Oct 2017 08:16:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A8Gt6l061918; Tue, 10 Oct 2017 08:16:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100816.v9A8Gt6l061918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 08:16:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324487 - head/sys/dev/hyperv/vmbus X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/vmbus X-SVN-Commit-Revision: 324487 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 08:16:56 -0000 Author: sephe Date: Tue Oct 10 08:16:55 2017 New Revision: 324487 URL: https://svnweb.freebsd.org/changeset/base/324487 Log: hyperv/vmbus: Add tunable to pin/unpin event tasks. Event tasks are pinned to their respective CPU by default, in the same fashion as they were. Unpin the event tasks by setting hw.vmbus.pin_evttask to 0, if certain CPUs serve special purpose. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Tue Oct 10 08:07:05 2017 (r324486) +++ head/sys/dev/hyperv/vmbus/vmbus.c Tue Oct 10 08:16:55 2017 (r324487) @@ -128,6 +128,13 @@ static void vmbus_event_proc_dummy(struct vmbus_soft static struct vmbus_softc *vmbus_sc; +SYSCTL_NODE(_hw, OID_AUTO, vmbus, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Hyper-V vmbus"); + +static int vmbus_pin_evttask = 1; +SYSCTL_INT(_hw_vmbus, OID_AUTO, pin_evttask, CTLFLAG_RDTUN, + &vmbus_pin_evttask, 0, "Pin event tasks to their respective CPU"); + extern inthand_t IDTVEC(vmbus_isr); static const uint32_t vmbus_version[] = { @@ -905,10 +912,16 @@ vmbus_intr_setup(struct vmbus_softc *sc) VMBUS_PCPU_GET(sc, event_tq, cpu) = taskqueue_create_fast( "hyperv event", M_WAITOK, taskqueue_thread_enqueue, VMBUS_PCPU_PTR(sc, event_tq, cpu)); - CPU_SETOF(cpu, &cpu_mask); - taskqueue_start_threads_cpuset( - VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, &cpu_mask, - "hvevent%d", cpu); + if (vmbus_pin_evttask) { + CPU_SETOF(cpu, &cpu_mask); + taskqueue_start_threads_cpuset( + VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, + &cpu_mask, "hvevent%d", cpu); + } else { + taskqueue_start_threads( + VMBUS_PCPU_PTR(sc, event_tq, cpu), 1, PI_NET, + "hvevent%d", cpu); + } /* * Setup tasks and taskqueues to handle messages. From owner-svn-src-head@freebsd.org Tue Oct 10 08:23:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93BA5E28ABF; Tue, 10 Oct 2017 08:23:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D4B1723F1; Tue, 10 Oct 2017 08:23:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A8NJIc065769; Tue, 10 Oct 2017 08:23:19 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A8NJ28065767; Tue, 10 Oct 2017 08:23:19 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100823.v9A8NJ28065767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 08:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324488 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: in head/sys/dev/hyperv: include vmbus X-SVN-Commit-Revision: 324488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 08:23:20 -0000 Author: sephe Date: Tue Oct 10 08:23:19 2017 New Revision: 324488 URL: https://svnweb.freebsd.org/changeset/base/324488 Log: hyperv/vmbus: Expose Hyper-V major version. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/vmbus/hyperv.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Tue Oct 10 08:16:55 2017 (r324487) +++ head/sys/dev/hyperv/include/hyperv.h Tue Oct 10 08:23:19 2017 (r324488) @@ -90,6 +90,7 @@ int hyperv_guid2str(const struct hyperv_guid *, char */ extern hyperv_tc64_t hyperv_tc64; extern u_int hyperv_features; /* CPUID_HV_MSR_ */ +extern u_int hyperv_ver_major; #endif /* _KERNEL */ Modified: head/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv.c Tue Oct 10 08:16:55 2017 (r324487) +++ head/sys/dev/hyperv/vmbus/hyperv.c Tue Oct 10 08:23:19 2017 (r324488) @@ -77,6 +77,8 @@ static u_int hyperv_get_timecount(struct timecounter static bool hyperv_identify(void); static void hypercall_memfree(void); +u_int hyperv_ver_major; + u_int hyperv_features; u_int hyperv_recommends; @@ -169,8 +171,9 @@ hyperv_identify(void) hyperv_features3 = regs[3]; do_cpuid(CPUID_LEAF_HV_IDENTITY, regs); + hyperv_ver_major = regs[1] >> 16; printf("Hyper-V Version: %d.%d.%d [SP%d]\n", - regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); + hyperv_ver_major, regs[1] & 0xffff, regs[0], regs[2]); printf(" Features=0x%b\n", hyperv_features, "\020" From owner-svn-src-head@freebsd.org Tue Oct 10 08:32:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D43ADE28DE4; Tue, 10 Oct 2017 08:32:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97FD57283C; Tue, 10 Oct 2017 08:32:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9A8W3Jm066117; Tue, 10 Oct 2017 08:32:03 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9A8W3FV066114; Tue, 10 Oct 2017 08:32:03 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710100832.v9A8W3FV066114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 08:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324489 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324489 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 08:32:05 -0000 Author: sephe Date: Tue Oct 10 08:32:03 2017 New Revision: 324489 URL: https://svnweb.freebsd.org/changeset/base/324489 Log: hyperv/hn: Workaround erroneous hash type observed on WS2016. Background: - UDP 4-tuple hash type is unconditionally enabled in Hyper-V on WS2016, which is _not_ affected by NDIS_OBJTYPE_RSS_PARAMS. - Non-fragment UDP/IPv4 datagrams' hash type is delivered to VM as TCP_IPV4. Currently this erroneous behavior only applies to WS2016/Windows10. Force l3/l4 protocol check, if the RXed packet's hash type is TCP_IPV4, and the Hyper-V is running on WS2016/Windows10. If the RXed packet is UDP datagram, adjust mbuf hash type to UDP_IPV4. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 08:23:19 2017 (r324488) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Tue Oct 10 08:32:03 2017 (r324489) @@ -601,6 +601,11 @@ hn_nvs_attach(struct hn_softc *sc, int mtu) { int error; + if (hyperv_ver_major >= 10) { + /* UDP 4-tuple hash is enforced. */ + sc->hn_caps |= HN_CAP_UDPHASH; + } + /* * Initialize NVS. */ Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 08:23:19 2017 (r324488) +++ head/sys/dev/hyperv/netvsc/if_hn.c Tue Oct 10 08:32:03 2017 (r324489) @@ -385,6 +385,7 @@ static void hn_link_status(struct hn_softc *); static int hn_create_rx_data(struct hn_softc *, int); static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); +static void hn_rxpkt_proto(const struct mbuf *, int *, int *); static int hn_set_rxfilter(struct hn_softc *, uint32_t); static int hn_rxfilter_config(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); @@ -399,6 +400,7 @@ static int hn_tx_ring_create(struct hn_softc *, int) static void hn_tx_ring_destroy(struct hn_tx_ring *); static int hn_create_tx_data(struct hn_softc *, int); static void hn_fixup_tx_data(struct hn_softc *); +static void hn_fixup_rx_data(struct hn_softc *); static void hn_destroy_tx_data(struct hn_softc *); static void hn_txdesc_dmamap_destroy(struct hn_txdesc *); static void hn_txdesc_gc(struct hn_tx_ring *, @@ -2238,9 +2240,10 @@ hn_attach(device_t dev) #endif /* - * Fixup TX stuffs after synthetic parts are attached. + * Fixup TX/RX stuffs after synthetic parts are attached. */ hn_fixup_tx_data(sc); + hn_fixup_rx_data(sc); ctx = device_get_sysctl_ctx(dev); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); @@ -3378,6 +3381,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int struct mbuf *m_new; int size, do_lro = 0, do_csum = 1, is_vf = 0; int hash_type = M_HASHTYPE_NONE; + int l3proto = ETHERTYPE_MAX, l4proto = IPPROTO_DONE; ifp = hn_ifp; if (rxr->hn_rxvf_ifp != NULL) { @@ -3477,31 +3481,9 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int (NDIS_RXCSUM_INFO_TCPCS_OK | NDIS_RXCSUM_INFO_IPCS_OK)) do_lro = 1; } else { - const struct ether_header *eh; - uint16_t etype; - int hoff; - - hoff = sizeof(*eh); - /* Checked at the beginning of this function. */ - KASSERT(m_new->m_len >= hoff, ("not ethernet frame")); - - eh = mtod(m_new, struct ether_header *); - etype = ntohs(eh->ether_type); - if (etype == ETHERTYPE_VLAN) { - const struct ether_vlan_header *evl; - - hoff = sizeof(*evl); - if (m_new->m_len < hoff) - goto skip; - evl = mtod(m_new, struct ether_vlan_header *); - etype = ntohs(evl->evl_proto); - } - - if (etype == ETHERTYPE_IP) { - int pr; - - pr = hn_check_iplen(m_new, hoff); - if (pr == IPPROTO_TCP) { + hn_rxpkt_proto(m_new, &l3proto, &l4proto); + if (l3proto == ETHERTYPE_IP) { + if (l4proto == IPPROTO_TCP) { if (do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_TCP)) { @@ -3512,7 +3494,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int m_new->m_pkthdr.csum_data = 0xffff; } do_lro = 1; - } else if (pr == IPPROTO_UDP) { + } else if (l4proto == IPPROTO_UDP) { if (do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_UDP)) { @@ -3522,7 +3504,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; } - } else if (pr != IPPROTO_DONE && do_csum && + } else if (l4proto != IPPROTO_DONE && do_csum && (rxr->hn_trust_hcsum & HN_TRUST_HCSUM_IP)) { rxr->hn_csum_trusted++; m_new->m_pkthdr.csum_flags |= @@ -3530,7 +3512,7 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int } } } -skip: + if (info->vlan_info != HN_NDIS_VLAN_INFO_INVALID) { m_new->m_pkthdr.ether_vtag = EVL_MAKETAG( NDIS_VLAN_INFO_ID(info->vlan_info), @@ -3585,6 +3567,35 @@ skip: case NDIS_HASH_TCP_IPV4: hash_type = M_HASHTYPE_RSS_TCP_IPV4; + if (rxr->hn_rx_flags & HN_RX_FLAG_UDP_HASH) { + int def_htype = M_HASHTYPE_OPAQUE_HASH; + + if (is_vf) + def_htype = M_HASHTYPE_NONE; + + /* + * UDP 4-tuple hash is delivered as + * TCP 4-tuple hash. + */ + if (l3proto == ETHERTYPE_MAX) { + hn_rxpkt_proto(m_new, + &l3proto, &l4proto); + } + if (l3proto == ETHERTYPE_IP) { + if (l4proto == IPPROTO_UDP) { + hash_type = + M_HASHTYPE_RSS_UDP_IPV4; + do_lro = 0; + } else if (l4proto != + IPPROTO_TCP) { + hash_type = def_htype; + do_lro = 0; + } + } else { + hash_type = def_htype; + do_lro = 0; + } + } break; case NDIS_HASH_IPV6: @@ -4835,6 +4846,36 @@ hn_check_iplen(const struct mbuf *m, int hoff) return ip->ip_p; } +static void +hn_rxpkt_proto(const struct mbuf *m_new, int *l3proto, int *l4proto) +{ + const struct ether_header *eh; + uint16_t etype; + int hoff; + + hoff = sizeof(*eh); + /* Checked at the beginning of this function. */ + KASSERT(m_new->m_len >= hoff, ("not ethernet frame")); + + eh = mtod(m_new, const struct ether_header *); + etype = ntohs(eh->ether_type); + if (etype == ETHERTYPE_VLAN) { + const struct ether_vlan_header *evl; + + hoff = sizeof(*evl); + if (m_new->m_len < hoff) + return; + evl = mtod(m_new, const struct ether_vlan_header *); + etype = ntohs(evl->evl_proto); + } + *l3proto = etype; + + if (etype == ETHERTYPE_IP) + *l4proto = hn_check_iplen(m_new, hoff); + else + *l4proto = IPPROTO_DONE; +} + static int hn_create_rx_data(struct hn_softc *sc, int ring_cnt) { @@ -5543,6 +5584,18 @@ hn_fixup_tx_data(struct hn_softc *sc) if_printf(sc->hn_ifp, "support HASHVAL pktinfo\n"); for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_tx_flags |= HN_TX_FLAG_HASHVAL; + } +} + +static void +hn_fixup_rx_data(struct hn_softc *sc) +{ + + if (sc->hn_caps & HN_CAP_UDPHASH) { + int i; + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) + sc->hn_rx_ring[i].hn_rx_flags |= HN_RX_FLAG_UDP_HASH; } } Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 08:23:19 2017 (r324488) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Oct 10 08:32:03 2017 (r324489) @@ -97,6 +97,7 @@ struct hn_rx_ring { #define HN_RX_FLAG_ATTACHED 0x0001 #define HN_RX_FLAG_BR_REF 0x0002 #define HN_RX_FLAG_XPNT_VF 0x0004 +#define HN_RX_FLAG_UDP_HASH 0x0008 struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING @@ -304,11 +305,12 @@ do { \ #define HN_CAP_TSO4 0x0080 #define HN_CAP_TSO6 0x0100 #define HN_CAP_HASHVAL 0x0200 +#define HN_CAP_UDPHASH 0x0400 /* Capability description for use with printf(9) %b identifier. */ #define HN_CAP_BITS \ "\020\1VLAN\2MTU\3IPCS\4TCP4CS\5TCP6CS" \ - "\6UDP4CS\7UDP6CS\10TSO4\11TSO6\12HASHVAL" + "\6UDP4CS\7UDP6CS\10TSO4\11TSO6\12HASHVAL\13UDPHASH" #define HN_LINK_FLAG_LINKUP 0x0001 #define HN_LINK_FLAG_NETCHG 0x0002 From owner-svn-src-head@freebsd.org Tue Oct 10 12:10:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE9DCE2F625; Tue, 10 Oct 2017 12:10:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B38A27ECFB; Tue, 10 Oct 2017 12:10:20 +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 v9ACAJj9060588; Tue, 10 Oct 2017 12:10:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ACAJ8W060587; Tue, 10 Oct 2017 12:10:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710101210.v9ACAJ8W060587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Oct 2017 12:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324490 - head/sys/contrib/rdma/krping X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/contrib/rdma/krping X-SVN-Commit-Revision: 324490 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:10:21 -0000 Author: hselasky Date: Tue Oct 10 12:10:19 2017 New Revision: 324490 URL: https://svnweb.freebsd.org/changeset/base/324490 Log: Add support for parsing and using IPv6 addresses in krping. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Tue Oct 10 08:32:03 2017 (r324489) +++ head/sys/contrib/rdma/krping/krping.c Tue Oct 10 12:10:19 2017 (r324490) @@ -86,6 +86,7 @@ static const struct krping_option krping_opts[] = { {"count", OPT_INT, 'C'}, {"size", OPT_INT, 'S'}, {"addr", OPT_STRING, 'a'}, + {"addr6", OPT_STRING, 'A'}, {"port", OPT_INT, 'p'}, {"verbose", OPT_NOPARAM, 'v'}, {"validate", OPT_NOPARAM, 'V'}, @@ -220,7 +221,11 @@ struct krping_cb { struct krping_stats stats; uint16_t port; /* dst port in NBO */ - struct in_addr addr; /* dst addr in NBO */ + union { + struct in_addr v4; + struct in6_addr v6; + } addr; /* dst addr in NBO */ + int addr_type; /* AF_INET or AF_INET6 */ char *addr_str; /* dst addr string */ int verbose; /* verbose logging */ int count; /* ping count */ @@ -1600,15 +1605,31 @@ static int fastreg_supported(struct krping_cb *cb, int static int krping_bind_server(struct krping_cb *cb) { - struct sockaddr_in sin; + union { + struct sockaddr_in v4; + struct sockaddr_in6 v6; + } sin; int ret; memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof sin; - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = cb->addr.s_addr; - sin.sin_port = cb->port; + switch (cb->addr_type) { + case AF_INET: + sin.v4.sin_len = sizeof sin.v4; + sin.v4.sin_family = AF_INET; + sin.v4.sin_addr = cb->addr.v4; + sin.v4.sin_port = cb->port; + break; + case AF_INET6: + sin.v6.sin6_len = sizeof sin.v6; + sin.v6.sin6_family = AF_INET6; + sin.v6.sin6_addr = cb->addr.v6; + sin.v6.sin6_port = cb->port; + break; + default: + return (-EINVAL); + } + ret = rdma_bind_addr(cb->cm_id, (struct sockaddr *) &sin); if (ret) { PRINTF(cb, "rdma_bind_addr error %d\n", ret); @@ -3059,15 +3080,31 @@ static int krping_connect_client(struct krping_cb *cb) static int krping_bind_client(struct krping_cb *cb) { - struct sockaddr_in sin; + union { + struct sockaddr_in v4; + struct sockaddr_in6 v6; + } sin; int ret; memset(&sin, 0, sizeof(sin)); - sin.sin_len = sizeof sin; - sin.sin_family = AF_INET; - sin.sin_addr.s_addr = cb->addr.s_addr; - sin.sin_port = cb->port; + switch (cb->addr_type) { + case AF_INET: + sin.v4.sin_len = sizeof sin.v4; + sin.v4.sin_family = AF_INET; + sin.v4.sin_addr = cb->addr.v4; + sin.v4.sin_port = cb->port; + break; + case AF_INET6: + sin.v6.sin6_len = sizeof sin.v6; + sin.v6.sin6_family = AF_INET6; + sin.v6.sin6_addr = cb->addr.v6; + sin.v6.sin6_port = cb->port; + break; + default: + return (-EINVAL); + } + ret = rdma_resolve_addr(cb->cm_id, NULL, (struct sockaddr *) &sin, 2000); if (ret) { @@ -3140,12 +3177,29 @@ err1: krping_free_qp(cb); } +static uint16_t +krping_get_ipv6_scope_id(char *name) +{ + struct ifnet *ifp; + uint16_t retval; + + if (name == NULL) + return (0); + ifp = ifunit_ref(name); + if (ifp == NULL) + return (0); + retval = ifp->if_index; + if_rele(ifp); + return (retval); +} + int krping_doit(char *cmd, void *cookie) { struct krping_cb *cb; int op; int ret = 0; char *optarg; + char *scope; unsigned long optint; cb = kzalloc(sizeof(*cb), GFP_KERNEL); @@ -3162,6 +3216,7 @@ int krping_doit(char *cmd, void *cookie) cb->size = 64; cb->txdepth = RPING_SQ_DEPTH; cb->mem = DMA; + cb->addr_type = AF_INET; init_waitqueue_head(&cb->sem); while ((op = krping_getopt("krping", &cmd, krping_opts, NULL, &optarg, @@ -3169,11 +3224,33 @@ int krping_doit(char *cmd, void *cookie) switch (op) { case 'a': cb->addr_str = optarg; - DEBUG_LOG(cb, "ipaddr (%s)\n", optarg); - if (!inet_aton(optarg, &cb->addr)) { + cb->addr_type = AF_INET; + DEBUG_LOG(cb, "ipv4addr (%s)\n", optarg); + if (inet_pton(AF_INET, optarg, &cb->addr) != 1) { PRINTF(cb, "bad addr string %s\n", optarg); ret = EINVAL; + } + break; + case 'A': + cb->addr_str = optarg; + cb->addr_type = AF_INET6; + DEBUG_LOG(cb, "ipv6addr (%s)\n", optarg); + scope = strstr(optarg, "%"); + /* extract scope ID, if any */ + if (scope != NULL) + *scope++ = 0; + /* extract IPv6 network address */ + if (inet_pton(AF_INET6, optarg, &cb->addr) != 1) { + PRINTF(cb, "bad addr string %s\n", + optarg); + ret = EINVAL; + } else if (IN6_IS_SCOPE_LINKLOCAL(&cb->addr.v6) || + IN6_IS_ADDR_MC_INTFACELOCAL(&cb->addr.v6)) { + uint16_t scope_id = krping_get_ipv6_scope_id(scope); + DEBUG_LOG(cb, "ipv6 scope ID = %d\n", scope_id); + cb->addr.v6.s6_addr[2] = scope_id >> 8; + cb->addr.v6.s6_addr[3] = scope_id & 0xFF; } break; case 'p': From owner-svn-src-head@freebsd.org Tue Oct 10 12:24:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 276B8E2FFC1; Tue, 10 Oct 2017 12:24:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E85D67F6C3; Tue, 10 Oct 2017 12:24:53 +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 v9ACOrJB068853; Tue, 10 Oct 2017 12:24:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ACOr0Z068852; Tue, 10 Oct 2017 12:24:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710101224.v9ACOr0Z068852@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Oct 2017 12:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324491 - 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: 324491 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:24:54 -0000 Author: hselasky Date: Tue Oct 10 12:24:52 2017 New Revision: 324491 URL: https://svnweb.freebsd.org/changeset/base/324491 Log: Use common rdma_ip2gid() function instead of custom mlx5_ip2gid() one. Sponsored by: Mellanox Technologies MFC after: 1 week 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 Tue Oct 10 12:10:19 2017 (r324490) +++ head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c Tue Oct 10 12:24:52 2017 (r324491) @@ -562,26 +562,6 @@ mlx5_make_default_gid(struct net_device *dev, union ib mlx5_addrconf_ifid_eui48(&gid->raw[8], dev); } -static inline int -mlx5_ip2gid(const struct sockaddr *addr, union ib_gid *gid) -{ - switch (addr->sa_family) { - case AF_INET: - ipv6_addr_set_v4mapped(((const struct sockaddr_in *)addr)->sin_addr.s_addr, - (struct in6_addr *)gid->raw); - break; - case AF_INET6: - memcpy(gid->raw, &((const struct sockaddr_in6 *)addr)->sin6_addr, 16); - /* clear SCOPE ID */ - gid->raw[2] = 0; - gid->raw[3] = 0; - break; - default: - return -EINVAL; - } - return 0; -} - static void mlx5_ib_roce_port_update(void *arg) { @@ -639,7 +619,7 @@ mlx5_ib_roce_port_update(void *arg) gid_index >= MLX5_IB_GID_MAX) continue; memset(&gid_temp, 0, sizeof(gid_temp)); - mlx5_ip2gid(ifa->ifa_addr, &gid_temp); + rdma_ip2gid(ifa->ifa_addr, &gid_temp); /* check for existing entry */ for (j = 0; j != gid_index; j++) { if (bcmp(&gid_temp, &port->gid_table[j], sizeof(gid_temp)) == 0) From owner-svn-src-head@freebsd.org Tue Oct 10 12:36:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D46AE30446; Tue, 10 Oct 2017 12:36:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC697FCB3; Tue, 10 Oct 2017 12:36: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 v9ACafvq073203; Tue, 10 Oct 2017 12:36:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ACafPP073202; Tue, 10 Oct 2017 12:36:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710101236.v9ACafPP073202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 10 Oct 2017 12:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324492 - 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: 324492 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:36:42 -0000 Author: hselasky Date: Tue Oct 10 12:36:41 2017 New Revision: 324492 URL: https://svnweb.freebsd.org/changeset/base/324492 Log: Make sure the IPv6 scope ID gets zeroed inside the GID. Else searching for a valid GID entry based on IPv6 addresses can fail. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/include/rdma/ib_addr.h Modified: head/sys/ofed/include/rdma/ib_addr.h ============================================================================== --- head/sys/ofed/include/rdma/ib_addr.h Tue Oct 10 12:24:52 2017 (r324491) +++ head/sys/ofed/include/rdma/ib_addr.h Tue Oct 10 12:36:41 2017 (r324492) @@ -157,6 +157,12 @@ static inline int rdma_ip2gid(struct sockaddr *addr, u case AF_INET6: memcpy(gid->raw, &((struct sockaddr_in6 *)addr)->sin6_addr, 16); + /* make sure scope ID gets zeroed inside GID */ + if (IN6_IS_SCOPE_LINKLOCAL((struct in6_addr *)gid->raw) || + IN6_IS_ADDR_MC_INTFACELOCAL((struct in6_addr *)gid->raw)) { + gid->raw[2] = 0; + gid->raw[3] = 0; + } break; default: return -EINVAL; From owner-svn-src-head@freebsd.org Tue Oct 10 12:54:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB6C8E309A8; Tue, 10 Oct 2017 12:54:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id B5A9080841; Tue, 10 Oct 2017 12:54:37 +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 v9ACsaD6081552; Tue, 10 Oct 2017 12:54:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ACsaSD081550; Tue, 10 Oct 2017 12:54:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710101254.v9ACsaSD081550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 10 Oct 2017 12:54:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324493 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 324493 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 12:54:38 -0000 Author: andrew Date: Tue Oct 10 12:54:36 2017 New Revision: 324493 URL: https://svnweb.freebsd.org/changeset/base/324493 Log: Move the pmap_l0_index, etc. macros to pte.h. These will be used by the EFI Runtime Services code. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pte.h Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Tue Oct 10 12:36:41 2017 (r324492) +++ head/sys/arm64/arm64/pmap.c Tue Oct 10 12:54:36 2017 (r324493) @@ -306,11 +306,6 @@ pagecopy(void *s, void *d) memcpy(d, s, PAGE_SIZE); } -#define pmap_l0_index(va) (((va) >> L0_SHIFT) & L0_ADDR_MASK) -#define pmap_l1_index(va) (((va) >> L1_SHIFT) & Ln_ADDR_MASK) -#define pmap_l2_index(va) (((va) >> L2_SHIFT) & Ln_ADDR_MASK) -#define pmap_l3_index(va) (((va) >> L3_SHIFT) & Ln_ADDR_MASK) - static __inline pd_entry_t * pmap_l0(pmap_t pmap, vm_offset_t va) { Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Tue Oct 10 12:36:41 2017 (r324492) +++ head/sys/arm64/include/pte.h Tue Oct 10 12:54:36 2017 (r324493) @@ -118,6 +118,11 @@ typedef uint64_t pt_entry_t; /* page table entry */ #define Ln_ADDR_MASK (Ln_ENTRIES - 1) #define Ln_TABLE_MASK ((1 << 12) - 1) +#define pmap_l0_index(va) (((va) >> L0_SHIFT) & L0_ADDR_MASK) +#define pmap_l1_index(va) (((va) >> L1_SHIFT) & Ln_ADDR_MASK) +#define pmap_l2_index(va) (((va) >> L2_SHIFT) & Ln_ADDR_MASK) +#define pmap_l3_index(va) (((va) >> L3_SHIFT) & Ln_ADDR_MASK) + #endif /* !_MACHINE_PTE_H_ */ /* End of pte.h */ From owner-svn-src-head@freebsd.org Tue Oct 10 13:02:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8CA0E30D76; Tue, 10 Oct 2017 13:02:59 +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 mx1.freebsd.org (Postfix) with ESMTPS id 881C080DD1; Tue, 10 Oct 2017 13:02:59 +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 v9AD2wcN085769; Tue, 10 Oct 2017 13:02:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AD2w8K085768; Tue, 10 Oct 2017 13:02:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710101302.v9AD2w8K085768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 10 Oct 2017 13:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324494 - 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: 324494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:02:59 -0000 Author: andrew Date: Tue Oct 10 13:02:58 2017 New Revision: 324494 URL: https://svnweb.freebsd.org/changeset/base/324494 Log: Add machine/fpu.h on arm64 for compatibility with amd64. Sponsored by: DARPA, AFRL Added: head/sys/arm64/include/fpu.h (contents, props changed) Added: head/sys/arm64/include/fpu.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/include/fpu.h Tue Oct 10 13:02:58 2017 (r324494) @@ -0,0 +1,6 @@ +/*- + * This file is in the public domain. + * + * $FreeBSD$ + */ +#include From owner-svn-src-head@freebsd.org Tue Oct 10 13:05:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C008E30E3E; Tue, 10 Oct 2017 13:05: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 mx1.freebsd.org (Postfix) with ESMTPS id 77FDB80F55; Tue, 10 Oct 2017 13:05: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 v9AD5RmE085951; Tue, 10 Oct 2017 13:05:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AD5RKI085945; Tue, 10 Oct 2017 13:05:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201710101305.v9AD5RKI085945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 10 Oct 2017 13:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324495 - in head/sys: arm64/arm64 arm64/include conf modules X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include conf modules X-SVN-Commit-Revision: 324495 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:05:28 -0000 Author: andrew Date: Tue Oct 10 13:05:26 2017 New Revision: 324495 URL: https://svnweb.freebsd.org/changeset/base/324495 Log: Support the EFI Runtime Services on arm64. As with amd64 we use the 1:1 mapping. This uses the new common code shared with amd64. The RTC should only be accessed via EFI. There is no locking around it as the spec only has this as a requirement for the PC-AT CMOS device. Reviewed by: kib, imp Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12595 Added: head/sys/arm64/arm64/efirt_machdep.c (contents, props changed) Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/include/efi.h head/sys/conf/files.arm64 head/sys/conf/options.arm64 head/sys/modules/Makefile Added: head/sys/arm64/arm64/efirt_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/efirt_machdep.c Tue Oct 10 13:05:26 2017 (r324495) @@ -0,0 +1,252 @@ +/*- + * Copyright (c) 2004 Marcel Moolenaar + * Copyright (c) 2001 Doug Rabson + * Copyright (c) 2016 The FreeBSD Foundation + * Copyright (c) 2017 Andrew Turner + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +static vm_object_t obj_1t1_pt; +static vm_page_t efi_l0_page; +static pd_entry_t *efi_l0; + +void +efi_destroy_1t1_map(void) +{ + vm_page_t m; + + if (obj_1t1_pt != NULL) { + VM_OBJECT_RLOCK(obj_1t1_pt); + TAILQ_FOREACH(m, &obj_1t1_pt->memq, listq) + m->wire_count = 0; + atomic_subtract_int(&vm_cnt.v_wire_count, + obj_1t1_pt->resident_page_count); + VM_OBJECT_RUNLOCK(obj_1t1_pt); + vm_object_deallocate(obj_1t1_pt); + } + + obj_1t1_pt = NULL; + efi_l0 = NULL; + efi_l0_page = NULL; +} + +static vm_page_t +efi_1t1_page(vm_pindex_t idx) +{ + + return (vm_page_grab(obj_1t1_pt, idx, VM_ALLOC_NOBUSY | + VM_ALLOC_WIRED | VM_ALLOC_ZERO)); +} + +static pt_entry_t * +efi_1t1_l3(vm_offset_t va) +{ + pd_entry_t *l0, *l1, *l2; + pt_entry_t *l3; + vm_pindex_t l0_idx, l1_idx, l2_idx; + vm_page_t m; + vm_paddr_t mphys; + + l0_idx = pmap_l0_index(va); + l0 = &efi_l0[l0_idx]; + if (*l0 == 0) { + m = efi_1t1_page(1 + l0_idx); + mphys = VM_PAGE_TO_PHYS(m); + *l0 = mphys | L0_TABLE; + } else { + mphys = *l0 & ~ATTR_MASK; + } + + l1 = (pd_entry_t *)PHYS_TO_DMAP(mphys); + l1_idx = pmap_l1_index(va); + l1 += l1_idx; + if (*l1 == 0) { + m = efi_1t1_page(1 + L0_ENTRIES + (l0_idx + 1) * (l1_idx + 1)); + mphys = VM_PAGE_TO_PHYS(m); + *l1 = mphys | L1_TABLE; + } else { + mphys = *l1 & ~ATTR_MASK; + } + + l2 = (pd_entry_t *)PHYS_TO_DMAP(mphys); + l2_idx = pmap_l2_index(va); + l2 += l2_idx; + if (*l2 == 0) { + m = efi_1t1_page(1 + L0_ENTRIES + L0_ENTRIES * Ln_ENTRIES + + (l0_idx + 1) * (l1_idx + 1) * (l2_idx + 1)); + mphys = VM_PAGE_TO_PHYS(m); + *l2 = mphys | L2_TABLE; + } else { + mphys = *l2 & ~ATTR_MASK; + } + + l3 = (pt_entry_t *)PHYS_TO_DMAP(mphys); + l3 += pmap_l3_index(va); + KASSERT(*l3 == 0, ("%s: Already mapped: va %#jx *pt %#jx", __func__, + va, *l3)); + + return (l3); +} + +/* + * Create the 1:1 virtual to physical map for EFI + */ +bool +efi_create_1t1_map(struct efi_md *map, int ndesc, int descsz) +{ + struct efi_md *p; + pt_entry_t *l3; + vm_offset_t va; + uint64_t idx; + int i, mode; + + obj_1t1_pt = vm_pager_allocate(OBJT_PHYS, NULL, L0_ENTRIES + + L0_ENTRIES * Ln_ENTRIES + L0_ENTRIES * Ln_ENTRIES * Ln_ENTRIES + + L0_ENTRIES * Ln_ENTRIES * Ln_ENTRIES * Ln_ENTRIES, + VM_PROT_ALL, 0, NULL); + VM_OBJECT_WLOCK(obj_1t1_pt); + efi_l0_page = efi_1t1_page(0); + VM_OBJECT_WUNLOCK(obj_1t1_pt); + efi_l0 = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(efi_l0_page)); + bzero(efi_l0, L0_ENTRIES * sizeof(*efi_l0)); + + for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p, + descsz)) { + if ((p->md_attr & EFI_MD_ATTR_RT) == 0) + continue; + if (p->md_virt != NULL) { + if (bootverbose) + printf("EFI Runtime entry %d is mapped\n", i); + goto fail; + } + if ((p->md_phys & EFI_PAGE_MASK) != 0) { + if (bootverbose) + printf("EFI Runtime entry %d is not aligned\n", + i); + goto fail; + } + if (p->md_phys + p->md_pages * EFI_PAGE_SIZE < p->md_phys || + p->md_phys + p->md_pages * EFI_PAGE_SIZE >= + VM_MAXUSER_ADDRESS) { + printf("EFI Runtime entry %d is not in mappable for RT:" + "base %#016jx %#jx pages\n", + i, (uintmax_t)p->md_phys, + (uintmax_t)p->md_pages); + goto fail; + } + if ((p->md_attr & EFI_MD_ATTR_WB) != 0) + mode = VM_MEMATTR_WRITE_BACK; + else if ((p->md_attr & EFI_MD_ATTR_WT) != 0) + mode = VM_MEMATTR_WRITE_THROUGH; + else if ((p->md_attr & EFI_MD_ATTR_WC) != 0) + mode = VM_MEMATTR_WRITE_COMBINING; + else if ((p->md_attr & EFI_MD_ATTR_UC) != 0) + mode = VM_MEMATTR_UNCACHEABLE; + else { + if (bootverbose) + printf("EFI Runtime entry %d mapping " + "attributes unsupported\n", i); + mode = VM_MEMATTR_UNCACHEABLE; + } + + printf("MAP %lx mode %x pages %lu\n", p->md_phys, mode, p->md_pages); + VM_OBJECT_WLOCK(obj_1t1_pt); + for (va = p->md_phys, idx = 0; idx < p->md_pages; idx++, + va += PAGE_SIZE) { + l3 = efi_1t1_l3(va); + *l3 = va | ATTR_DEFAULT | ATTR_IDX(mode) | + ATTR_AP(ATTR_AP_RW) | L3_PAGE; + } + VM_OBJECT_WUNLOCK(obj_1t1_pt); + } + + return (true); +fail: + efi_destroy_1t1_map(); + return (false); +} + +int +efi_arch_enter(void) +{ + + __asm __volatile( + "msr ttbr0_el1, %0 \n" + "dsb ishst \n" + "tlbi vmalle1is \n" + "dsb ish \n" + "isb \n" + : : "r"(VM_PAGE_TO_PHYS(efi_l0_page))); + + return (0); +} + +void +efi_arch_leave(void) +{ + struct thread *td; + + td = curthread; + __asm __volatile( + "msr ttbr0_el1, %0 \n" + "dsb ishst \n" + "tlbi vmalle1is \n" + "dsb ish \n" + "isb \n" + : : "r"(td->td_proc->p_md.md_l0addr)); +} Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/arm64/arm64/machdep.c Tue Oct 10 13:05:26 2017 (r324495) @@ -121,6 +121,12 @@ int64_t idcache_line_size; /* The minimum cache line s int64_t dczva_line_size; /* The size of cache line the dc zva zeroes */ int has_pan; +/* + * Physical address of the EFI System Table. Stashed from the metadata hints + * passed into the kernel and used by the EFI code to call runtime services. + */ +vm_paddr_t efi_systbl_phys; + /* pagezero_* implementations are provided in support.S */ void pagezero_simple(void *); void pagezero_cache(void *); @@ -985,6 +991,8 @@ initarm(struct arm64_bootparams *abp) #ifdef FDT try_load_dtb(kmdp); #endif + + efi_systbl_phys = MD_FETCH(kmdp, MODINFOMD_FW_HANDLE, vm_paddr_t); /* Find the address to start allocating from */ lastaddr = MD_FETCH(kmdp, MODINFOMD_KERNEND, vm_offset_t); Modified: head/sys/arm64/include/efi.h ============================================================================== --- head/sys/arm64/include/efi.h Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/arm64/include/efi.h Tue Oct 10 13:05:26 2017 (r324495) @@ -1,6 +1,32 @@ /*- - * This file is in the public domain since it's just boilerplate. + * Copyright (c) 2017 Andrew Turner + * All rights reserved. * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * * $FreeBSD$ */ @@ -8,5 +34,11 @@ #define __ARM64_INCLUDE_EFI_H_ #define EFIABI_ATTR + +#ifdef _KERNEL +#define EFI_TIME_LOCK() +#define EFI_TIME_UNLOCK() +#define EFI_TIME_OWNED() +#endif #endif /* __ARM64_INCLUDE_EFI_H_ */ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/conf/files.arm64 Tue Oct 10 13:05:26 2017 (r324495) @@ -95,6 +95,7 @@ arm64/arm64/db_trace.c optional ddb arm64/arm64/debug_monitor.c optional ddb arm64/arm64/disassem.c optional ddb arm64/arm64/dump_machdep.c standard +arm64/arm64/efirt_machdep.c optional efirt arm64/arm64/elf_machdep.c standard arm64/arm64/exception.S standard arm64/arm64/gicv3_its.c optional intrng fdt Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/conf/options.arm64 Tue Oct 10 13:05:26 2017 (r324495) @@ -7,6 +7,10 @@ SOCDEV_VA opt_global.h THUNDERX_PASS_1_1_ERRATA opt_global.h VFP opt_global.h +# EFI Runtime services support +EFIRT opt_efirt.h + +# Devices DEV_PSCI opt_platform.h # SoC Support Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue Oct 10 13:02:58 2017 (r324494) +++ head/sys/modules/Makefile Tue Oct 10 13:05:26 2017 (r324495) @@ -562,6 +562,7 @@ _cxgb= cxgb .if ${MACHINE_CPUARCH} == "aarch64" _armv8crypto= armv8crypto +_efirt= efirt _em= em .endif From owner-svn-src-head@freebsd.org Tue Oct 10 13:06:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8CBEE30F22; Tue, 10 Oct 2017 13:06:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88A8681191; Tue, 10 Oct 2017 13:06:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AD6BuU086032; Tue, 10 Oct 2017 13:06:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AD6Bck086031; Tue, 10 Oct 2017 13:06:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710101306.v9AD6Bck086031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 10 Oct 2017 13:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324496 - head X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 324496 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:06:12 -0000 Author: bapt Date: Tue Oct 10 13:06:11 2017 New Revision: 324496 URL: https://svnweb.freebsd.org/changeset/base/324496 Log: Do not print error when running make check-old on system without catpages directories Reported by: dim Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Oct 10 13:05:26 2017 (r324495) +++ head/Makefile.inc1 Tue Oct 10 13:06:11 2017 (r324496) @@ -2590,7 +2590,7 @@ check-old-files: .PHONY done; \ done # Check for catpages without corresponding manpages. - @find ${DESTDIR}/usr/share/man/cat* ! -type d | \ + @find ${DESTDIR}/usr/share/man/cat* ! -type d 2>/dev/null | \ sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ while read catpage; do \ read manpage; \ From owner-svn-src-head@freebsd.org Tue Oct 10 13:23:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24CF7E319C8; Tue, 10 Oct 2017 13:23:26 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com [IPv6:2607:f8b0:4003:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4D12822D6; Tue, 10 Oct 2017 13:23:25 +0000 (UTC) (envelope-from eggnet@gmail.com) Received: by mail-oi0-x235.google.com with SMTP id j126so45097980oia.10; Tue, 10 Oct 2017 06:23:25 -0700 (PDT) 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=w277796g0AvXYWxKgYN1kUUDcKx/aTFLFqN8QIVdVxo=; b=HQ6A6ZHIBRivIMC0307WSXCZvgfqf1S0wiMbHLgTDhToqiUyCwp7J0d0vVSzbdU++o XpECBd2okXWxj+2cD/EtC3ehv7JttdkceaDRK83TwNwtmA3+2LP8ZRv1Vb4NYrtq33bm RzvMQ/Hx0fbrnxrG1KlJ4I5w19i7efVuzGCG7IxaqYsaXJgndqdt0OkEaI+9ph+4Qo7J 2Zh+ORdy28Bfc+jHF5P8KDCFnz3/Y7m/3lEh4BtO85oKsRGxv4YI8KbiTweN1laYTyNG AE1TTvP7AdXqa2p6/5XjYr+QJQ8CsEywvbvV37RvxnrbwLymcqJJXxFavv149LiJf+HK vPnA== 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=w277796g0AvXYWxKgYN1kUUDcKx/aTFLFqN8QIVdVxo=; b=UasJU5gvGHT8dZOWNSlWzBOjjBAJXDWL2tRfwoVqUnS1CXeblViG9gmD92h5lh2qxv 7JIU/V7fL0YNhaLYq9h7rY4dSWWNb4xUnoXJ4Bt0ckaYkxms9MaMNm1drGy5zRHAjYnY KiLzquCmHRQYrNBpdqsrz8XtPOaPvKn1jYEWkFdw/QyLk7+1uHhsvcR3r21RcCB6PWwa f5USZqHonCrX7yOKHTOr8ljczFEI9Z3PP5xIpo4/MD40Y11fLWrWxo5yGPsx+CXirKSl SD77d5V+ljDzMe3/hhL0M/1g2dW4qyAQuNrjPL5Pd5BV4NvYoe1DKUZp6In+ecovaDnX PyOw== X-Gm-Message-State: AMCzsaXRr5B5RaJ8w0uip7X6QyHNLK604B6E9KHHm3K9oNRnI30ZwJHm 6C0BLE5Rhpfc0BQWpRcMYX1H+RsKPYjKT6i9MYk= X-Google-Smtp-Source: AOwi7QAU6JEDfHFdnM7CxELOxzU49hFha6CDKbQV+70UwMb3ef7v06/D+6x74pBRsTKQBzY0fveP6rVExS+mJHabvuA= X-Received: by 10.157.46.207 with SMTP id w73mr265663ota.227.1507641804946; Tue, 10 Oct 2017 06:23:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.10.211 with HTTP; Tue, 10 Oct 2017 06:23:24 -0700 (PDT) Received: by 10.74.10.211 with HTTP; Tue, 10 Oct 2017 06:23:24 -0700 (PDT) In-Reply-To: <20171010071703.GR95911@kib.kiev.ua> References: <201710072330.v97NUv7E040636@repo.freebsd.org> <20171009232052.GU1055@FreeBSD.org> <20171010071703.GR95911@kib.kiev.ua> From: Jason Eggleston Date: Tue, 10 Oct 2017 06:23:24 -0700 Message-ID: Subject: Re: svn commit: r324405 - head/sys/kern To: Konstantin Belousov Cc: Gleb Smirnoff , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Sean Bruno , src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:23:26 -0000 Sendfile does return EPIPE today. All that has to happen is receiving a RST after sendfile starts looping. There is a race condition, which still exists after this suggested patch, where ECONNRESET could be returned. But mostly it is EPIPE. On Oct 10, 2017 12:17 AM, "Konstantin Belousov" wrote: > On Mon, Oct 09, 2017 at 04:20:52PM -0700, Gleb Smirnoff wrote: > > Sean & Jason, > > > > On Sat, Oct 07, 2017 at 11:30:57PM +0000, Sean Bruno wrote: > > S> Author: sbruno > > S> Date: Sat Oct 7 23:30:57 2017 > > S> New Revision: 324405 > > S> URL: https://svnweb.freebsd.org/changeset/base/324405 > > S> > > S> Log: > > S> Check so_error early in sendfile() call. Prior to this patch, if a > > S> connection was reset by the remote end, sendfile() would just report > > S> ENOTCONN instead of ECONNRESET. > > S> > > S> Submitted by: Jason Eggleston > > S> Reviewed by: glebius > > S> Sponsored by: Limelight Networks > > S> Differential Revision: https://reviews.freebsd.org/D12575 > > S> > > S> Modified: > > S> head/sys/kern/kern_sendfile.c > > S> > > S> Modified: head/sys/kern/kern_sendfile.c > > S> ============================================================ > ================== > > S> --- head/sys/kern/kern_sendfile.c Sat Oct 7 23:10:16 2017 > (r324404) > > S> +++ head/sys/kern/kern_sendfile.c Sat Oct 7 23:30:57 2017 > (r324405) > > S> @@ -514,6 +514,11 @@ sendfile_getsock(struct thread *td, int s, > struct file > > S> *so = (*sock_fp)->f_data; > > S> if ((*so)->so_type != SOCK_STREAM) > > S> return (EINVAL); > > S> + if ((*so)->so_error) { > > S> + error = (*so)->so_error; > > S> + (*so)->so_error = 0; > > S> + return (error); > > S> + } > > S> if (((*so)->so_state & SS_ISCONNECTED) == 0) > > S> return (ENOTCONN); > > S> return (0); > > > > Despite my initial positive review, now I am quite unsure on that. > > > > Problem is that sendfile(2) isn't defined by SUS, so there is no > > distinctive final answer on that. Should we match other OSes? > > Should we match our historic behaviour? Or should we match > > write(2)/send(2) to socket, which are closest analogy. I probably > > believe in the latter: sendfile(2) belongs to write(2)/send(2) > > family. > > > > SUS specifies that write may return ECONNRESET. It also documents > > EPIPE. However, our manual page documents only EPIPE for both > > send(2) and write(2). For write we have: > > > > SOCKBUF_LOCK(&so->so_snd); > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > > SOCKBUF_UNLOCK(&so->so_snd); > > error = EPIPE; > > goto out; > > } > > if (so->so_error) { > > error = so->so_error; > > so->so_error = 0; > > SOCKBUF_UNLOCK(&so->so_snd); > > goto out; > > } > > > > Indeed, EPIPE will be returned prior to return/clear of so_error, > > which supposedly is ECONNRESET. > > > > In the sendfile(2) implementation we see exactly same code: > > > > if (so->so_snd.sb_state & SBS_CANTSENDMORE) { > > error = EPIPE; > > SOCKBUF_UNLOCK(&so->so_snd); > > goto done; > > } else if (so->so_error) { > > error = so->so_error; > > so->so_error = 0; > > SOCKBUF_UNLOCK(&so->so_snd); > > goto done; > > } > > > > But it isn't reached. Before due to SS_ISCONNECTED check, now > > due to your change. Now we got two spots where so_error is > > returned/cleared. > Do you mean that EPIPE could be returned from sendfile(2) after some > round of changes ? It should be not. > > EPIPE is a workaround for naive programs that use stdio and cannot detect > the broken pipe when used as an element in the shell plumbing. EPIPE > results in SIGPIPE terminating such programs (instead of looping endlessly > when write(2) returns error). > > Any application using sendfile(2) must understand the API to properly > handle > disconnects, so SIGPIPE workaround would be avoided. Often such > applications > are already sofisticated enough to block SIGPIPE, but if blocking becomes > a new requirement because EPIPE was not returned in earlier version of > the system, they might not block it still. > > > > > For the receive family (read(2) and recv(2)), SUS specifies > > ECONNRESET and our code does that. It also clears so_error. > > > > So, after your change at least one standard case is broken: an > > application that polls/selects for both readability and > > writeability of a socket. It discovers that socket is available > > for writing, does sendfile(2), receives ECONNRESET. Then it does > > read on the socket, and blocks(?) or returns a bogus error(?), > > not sure. But definitely not ECONNRESET, since it is now cleared. > > > > Now, where does this ENOTCONN come from? These two lines: > > > > if (((*so)->so_state & SS_ISCONNECTED) == 0) > > return (ENOTCONN); > > > > can be traced back all the way to original 1998 commit of sendfile. > > > > Here comes difference between sendfile(2) and send(2). In send(2), > > this check is done _after_ so_error check, so your change is correct > > in placing of so_error check wrt so_state check, but is incorrect > > in placing wrt socket buffer state check. > > > > After all this considerations, I would suggest to revert your change, > > and apply this patch. It would make behavior of sendfile(2) to match > > send(2). I would appreciate more reviews around it. > > > > -- > > Gleb Smirnoff > > > Index: kern_sendfile.c > > =================================================================== > > --- kern_sendfile.c (revision 324457) > > +++ kern_sendfile.c (working copy) > > @@ -507,13 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct > > *so = (*sock_fp)->f_data; > > if ((*so)->so_type != SOCK_STREAM) > > return (EINVAL); > > - if ((*so)->so_error) { > > - error = (*so)->so_error; > > - (*so)->so_error = 0; > > - return (error); > > - } > > - if (((*so)->so_state & SS_ISCONNECTED) == 0) > > - return (ENOTCONN); > > return (0); > > } > > > > @@ -622,6 +615,12 @@ retry_space: > > SOCKBUF_UNLOCK(&so->so_snd); > > goto done; > > } > > + if ((so->so_state & SS_ISCONNECTED) == 0) { > > + SOCKBUF_UNLOCK(&so->so_snd); > > + error = ENOTCONN; > > + goto done; > > + } > > + > > space = sbspace(&so->so_snd); > > if (space < rem && > > (space <= 0 || > > From owner-svn-src-head@freebsd.org Tue Oct 10 14:46:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65020E33E08; Tue, 10 Oct 2017 14:46:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 280F284E84; Tue, 10 Oct 2017 14:46:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id RAA02552; Tue, 10 Oct 2017 17:46:27 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1vnf-0001ey-1y; Tue, 10 Oct 2017 17:46:27 +0300 From: Andriy Gapon Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> Message-ID: <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> Date: Tue, 10 Oct 2017 17:45:31 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201709112149.v8BLncAs049328@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 14:46:31 -0000 On 12/09/2017 00:49, Ian Lepore wrote: > Author: ian > Date: Mon Sep 11 21:49:38 2017 > New Revision: 323465 > URL: https://svnweb.freebsd.org/changeset/base/323465 > > Log: > Make i2c -s (device scan) work on hardware that supports only full xfers. > > The existing scan code is based on sending an i2c START condition and if > there is no error it assumes there is a device at that i2c address. Some > i2c controllers don't support sending individual start/stop signals on the > bus, they can only perform complete data transfers with start/stop handled > in the silicon. > > This adds a fallback mechanism that attempts to read a single byte from each > i2c address. It's less reliable than looking for an an ACK repsonse to a > start, because some devices will NAK an attempt to read that isn't preceeded > by a write of a register address. Writing to devices to probe them is too > dangerous to even consider. The user is told that a less-reliable scan is > being done, so even if the read-scan comes up empty too, it's still a vast > improvement over the old situation where it would just claim there were no > devices on the bus even though the devices were there and working fine. > > If the i2c controller responds with a proper ENODEV (device doesn't support > operation) or an almost-proper EOPNOTSUPP, the START/STOP scan is switched > to a read-scan right away. Most controllers respond with ENXIO or EIO if > they don't support START/STOP, so no quick-out is available. For those, > if a scan of all 127 addresses and come up empty, the scan is re-done using > the read method. Perhaps the new scan method should have been added as a separate option that has to be explicitly activated... My concern is that there are some extremely simple I2C devices out there that do no sanity checking and may get confused > Reported by: Maxim Filimonov > > Modified: > head/usr.sbin/i2c/i2c.c > > Modified: head/usr.sbin/i2c/i2c.c > ============================================================================== > --- head/usr.sbin/i2c/i2c.c Mon Sep 11 21:32:35 2017 (r323464) > +++ head/usr.sbin/i2c/i2c.c Mon Sep 11 21:49:38 2017 (r323465) > @@ -121,9 +121,12 @@ skip_get_tokens(char *skip_addr, int *sk_addr, int max > static int > scan_bus(struct iiccmd cmd, char *dev, int skip, char *skip_addr) > { > + struct iic_msg rdmsg; > + struct iic_rdwr_data rdwrdata; > struct skip_range addr_range = { 0, 0 }; > int *tokens, fd, error, i, index, j; > - int len = 0, do_skip = 0, no_range = 1; > + int len = 0, do_skip = 0, no_range = 1, num_found = 0, use_read_xfer = 0; > + uint8_t rdbyte; > > fd = open(dev, O_RDWR); > if (fd == -1) { > @@ -157,6 +160,14 @@ scan_bus(struct iiccmd cmd, char *dev, int skip, char > } > > printf("Scanning I2C devices on %s: ", dev); > + > +start_over: > + if (use_read_xfer) { > + fprintf(stderr, > + "Hardware may not support START/STOP scanning; " > + "trying less-reliable read method.\n"); > + } > + > for (i = 1; i < 127; i++) { > > if (skip && ( addr_range.start < addr_range.end)) { > @@ -180,17 +191,46 @@ scan_bus(struct iiccmd cmd, char *dev, int skip, char > cmd.last = 1; > cmd.count = 0; > error = ioctl(fd, I2CRSTCARD, &cmd); > - if (error) > + if (error) { > + fprintf(stderr, "Controller reset failed\n"); > goto out; > - > - cmd.slave = i << 1; > - cmd.last = 1; > - error = ioctl(fd, I2CSTART, &cmd); > - if (!error) > - printf("%x ", i); > - cmd.slave = i << 1; > - cmd.last = 1; > - error = ioctl(fd, I2CSTOP, &cmd); > + } > + if (use_read_xfer) { > + rdmsg.buf = &rdbyte; > + rdmsg.len = 1; > + rdmsg.flags = IIC_M_RD; > + rdmsg.slave = i << 1; > + rdwrdata.msgs = &rdmsg; > + rdwrdata.nmsgs = 1; > + error = ioctl(fd, I2CRDWR, &rdwrdata); > + } else { > + cmd.slave = i << 1; > + cmd.last = 1; > + error = ioctl(fd, I2CSTART, &cmd); > + if (errno == ENODEV || errno == EOPNOTSUPP) { > + /* If START not supported try reading. */ > + use_read_xfer = 1; > + goto start_over; > + } > + cmd.slave = i << 1; > + cmd.last = 1; > + ioctl(fd, I2CSTOP, &cmd); > + } > + if (error == 0) { > + ++num_found; > + printf("%02x ", i); > + } > + } > + /* > + * If we found nothing, maybe START is not supported and returns a > + * generic error code such as EIO or ENXIO, so try again using reads. > + */ > + if (num_found == 0) { > + if (!use_read_xfer) { > + use_read_xfer = 1; > + goto start_over; > + } > + printf(""); > } > printf("\n"); > > -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Oct 10 15:39:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7F3E3505E; Tue, 10 Oct 2017 15:39:29 +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 89D521AE9; Tue, 10 Oct 2017 15:39:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v9AFdNUn083073; Tue, 10 Oct 2017 08:39:24 -0700 (PDT) (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 v9AFdMMM083072; Tue, 10 Oct 2017 08:39:22 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201710101539.v9AFdMMM083072@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r324406 - head/sys/modules/em In-Reply-To: To: "Ngie Cooper (yaneurabeya)" Date: Tue, 10 Oct 2017 08:39:22 -0700 (PDT) CC: Ian Lepore , Sean Bruno , Brooks Davis , rgrimes@freebsd.org, 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.23 Precedence: list List-Id: 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, 10 Oct 2017 15:39:29 -0000 > > > On Oct 9, 2017, at 18:54, Ian Lepore wrote: > > ... > > > I think the right answer here is just > > > > LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_igb.ko > > That will definitely work and is probably the best pattern. > Thanks, > -Ngie I concur, a hard link would probably be a better solution all around than a symlink, unless there is some major reason for this to be a symlink? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Oct 10 15:41:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49433E35541; Tue, 10 Oct 2017 15:41:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18FCE2003; Tue, 10 Oct 2017 15:41:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AFfaQx051652; Tue, 10 Oct 2017 15:41:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AFfaiw051651; Tue, 10 Oct 2017 15:41:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201710101541.v9AFfaiw051651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 10 Oct 2017 15:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324497 - head/usr.bin/su X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/usr.bin/su X-SVN-Commit-Revision: 324497 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 15:41:37 -0000 Author: ngie Date: Tue Oct 10 15:41:35 2017 New Revision: 324497 URL: https://svnweb.freebsd.org/changeset/base/324497 Log: Mute gcc warning about p not being possibly initialized I'm running into this warning on a tinderbox run with gcc 4.2.1 with mips and powerpc. MFC after: 1 week Modified: head/usr.bin/su/su.c Modified: head/usr.bin/su/su.c ============================================================================== --- head/usr.bin/su/su.c Tue Oct 10 13:06:11 2017 (r324496) +++ head/usr.bin/su/su.c Tue Oct 10 15:41:35 2017 (r324497) @@ -172,7 +172,7 @@ main(int argc, char *argv[]) au_id_t auid; #endif - shell = class = cleanenv = NULL; + p = shell = class = cleanenv = NULL; asme = asthem = fastlogin = statusp = 0; user = "root"; iscsh = UNSET; From owner-svn-src-head@freebsd.org Tue Oct 10 16:12:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86360E3634E for ; Tue, 10 Oct 2017 16:12:52 +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 69F443307 for ; Tue, 10 Oct 2017 16:12:52 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: c55db599-add5-11e7-b50b-53dc5ecda239 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id c55db599-add5-11e7-b50b-53dc5ecda239; Tue, 10 Oct 2017 16:12:11 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9AGCimK004201; Tue, 10 Oct 2017 10:12:44 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507651963.84167.37.camel@freebsd.org> Subject: Re: svn commit: r323465 - head/usr.sbin/i2c From: Ian Lepore To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Date: Tue, 10 Oct 2017 10:12:43 -0600 In-Reply-To: <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:12:52 -0000 On Tue, 2017-10-10 at 17:45 +0300, Andriy Gapon wrote: > On 12/09/2017 00:49, Ian Lepore wrote: > > > > Author: ian > > Date: Mon Sep 11 21:49:38 2017 > > New Revision: 323465 > > URL: https://svnweb.freebsd.org/changeset/base/323465 > > > > Log: > >   Make i2c -s (device scan) work on hardware that supports only full xfers. > >    > >   The existing scan code is based on sending an i2c START condition and if > >   there is no error it assumes there is a device at that i2c address.  Some > >   i2c controllers don't support sending individual start/stop signals on the > >   bus, they can only perform complete data transfers with start/stop handled > >   in the silicon. > >    > >   This adds a fallback mechanism that attempts to read a single byte from each > >   i2c address.  It's less reliable than looking for an an ACK repsonse to a > >   start, because some devices will NAK an attempt to read that isn't preceeded > >   by a write of a register address.  Writing to devices to probe them is too > >   dangerous to even consider.  The user is told that a less-reliable scan is > >   being done, so even if the read-scan comes up empty too, it's still a vast > >   improvement over the old situation where it would just claim there were no > >   devices on the bus even though the devices were there and working fine. > >    > >   If the i2c controller responds with a proper ENODEV (device doesn't support > >   operation) or an almost-proper EOPNOTSUPP, the START/STOP scan is switched > >   to a read-scan right away.  Most controllers respond with ENXIO or EIO if > >   they don't support START/STOP, so no quick-out is available.  For those, > >   if a scan of all 127 addresses and come up empty, the scan is re-done using > >   the read method. > > Perhaps the new scan method should have been added as a separate option that has > to be explicitly activated...  My concern is that there are some extremely > simple I2C devices out there that do no sanity checking and may get confused > i2c -s is not a thing that's done routinely in a production system or normal system operations... it's something a person does manually when trying to configure or debug a system.  In that situation, there is more harm in being told there are no working devices on the bus when in fact everything is fine, than there is some some hypothetical device doing some hypothetical "bad thing" in response to a read command.  In all my years of working with i2c stuff I've never seen a device doing anything more harmful than hanging the bus, requiring a reset (and even causing that requires worse behavior than an unexpected read).  On the other hand, I've seen a lot of people frustrated that i2c -s on freebsd says there are no devices, while the equivelent command on linux shows that everything is fine. -- Ian From owner-svn-src-head@freebsd.org Tue Oct 10 16:17:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC567E3641A; Tue, 10 Oct 2017 16:17:04 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9959134B8; Tue, 10 Oct 2017 16:17:04 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AGH3Ag065098; Tue, 10 Oct 2017 16:17:03 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AGH3fc065096; Tue, 10 Oct 2017 16:17:03 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201710101617.v9AGH3fc065096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 10 Oct 2017 16:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324499 - head/sbin/growfs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sbin/growfs X-SVN-Commit-Revision: 324499 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:17:04 -0000 Author: mckusick Date: Tue Oct 10 16:17:03 2017 New Revision: 324499 URL: https://svnweb.freebsd.org/changeset/base/324499 Log: Growfs got missed in r323923 that added a check hash to cylinder groups. This makes the needed changes to add/update cylinder group check hashes when a filesystem is expanded. Reported by: kib and Warner Losh (imp) Reviewed by: kib Tested by: Peter Holm (pho) Modified: head/sbin/growfs/Makefile head/sbin/growfs/growfs.c Modified: head/sbin/growfs/Makefile ============================================================================== --- head/sbin/growfs/Makefile Tue Oct 10 15:46:58 2017 (r324498) +++ head/sbin/growfs/Makefile Tue Oct 10 16:17:03 2017 (r324499) @@ -20,7 +20,7 @@ CFLAGS+= -DFS_DEBUG NO_WCAST_ALIGN= yes .endif -LIBADD= util +LIBADD= ufs util HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Tue Oct 10 15:46:58 2017 (r324498) +++ head/sbin/growfs/growfs.c Tue Oct 10 16:17:03 2017 (r324499) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "debug.h" @@ -121,6 +122,7 @@ static void updcsloc(time_t, int, int, unsigned int); static void frag_adjust(ufs2_daddr_t, int); static void updclst(int); static void mount_reload(const struct statfs *stfs); +static void cgckhash(struct cg *); /* * Here we actually start growing the file system. We basically read the @@ -480,6 +482,7 @@ initcg(int cylno, time_t modtime, int fso, unsigned in sblock.fs_cstotal.cs_nifree += acg.cg_cs.cs_nifree; *cs = acg.cg_cs; + cgckhash(&acg); memcpy(iobuf, &acg, sblock.fs_cgsize); memset(iobuf + sblock.fs_cgsize, '\0', sblock.fs_bsize * 3 - sblock.fs_cgsize); @@ -771,6 +774,7 @@ updjcg(int cylno, time_t modtime, int fsi, int fso, un /* * Write the updated "joining" cylinder group back to disk. */ + cgckhash(&acg); wtfs(fsbtodb(&sblock, cgtod(&sblock, cylno)), (size_t)sblock.fs_cgsize, (void *)&acg, fso, Nflag); DBG_PRINT0("jcg written\n"); @@ -1738,4 +1742,18 @@ mount_reload(const struct statfs *stfs) err(9, "%s: cannot reload filesystem%s%s", stfs->f_mntonname, *errmsg != '\0' ? ": " : "", errmsg); } +} + +/* + * Calculate the check-hash of the cylinder group. + */ +static void +cgckhash(cgp) + struct cg *cgp; +{ + + if ((sblock.fs_metackhash & CK_CYLGRP) == 0) + return; + cgp->cg_ckhash = 0; + cgp->cg_ckhash = calculate_crc32c(~0L, (void *)cgp, sblock.fs_cgsize); } From owner-svn-src-head@freebsd.org Tue Oct 10 16:21:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF332E36684; Tue, 10 Oct 2017 16:21:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 74F0038E1; Tue, 10 Oct 2017 16:21:22 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA02726; Tue, 10 Oct 2017 19:21:21 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1xHU-0001ia-V5; Tue, 10 Oct 2017 19:21:20 +0300 Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> From: Andriy Gapon Message-ID: Date: Tue, 10 Oct 2017 19:20:25 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1507651963.84167.37.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:21:24 -0000 On 10/10/2017 19:12, Ian Lepore wrote: > i2c -s is not a thing that's done routinely in a production system or > normal system operations... it's something a person does manually when > trying to configure or debug a system.  In that situation, there is > more harm in being told there are no working devices on the bus when in > fact everything is fine, than there is some some hypothetical device > doing some hypothetical "bad thing" in response to a read command.  In > all my years of working with i2c stuff I've never seen a device doing > anything more harmful than hanging the bus, requiring a reset (and even > causing that requires worse behavior than an unexpected read).  On the > other hand, I've seen a lot of people frustrated that i2c -s on freebsd > says there are no devices, while the equivelent command on linux shows > that everything is fine. Okay. However, I will just mention that in the past I used to own a system where scanning the bus would make a slave that controlled CPU frequency to change it to some garbage. The system "just" crashed, but theoretically the damage could have been worse. Also, I own a system right now where scanning the bus results in something like what you mentioned, but a little bit worse, the hanging bus that can be brought back only by a power cycle (not even a warm reset). -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Oct 10 16:23:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A264E368DF; Tue, 10 Oct 2017 16:23:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 378AC3BE7; Tue, 10 Oct 2017 16:23:38 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id TAA02734; Tue, 10 Oct 2017 19:23:37 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1xJh-0001im-JJ; Tue, 10 Oct 2017 19:23:37 +0300 Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> From: Andriy Gapon Message-ID: <230cbbbf-9d98-2249-e0db-488b4a3abfb3@FreeBSD.org> Date: Tue, 10 Oct 2017 19:23:02 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1507651963.84167.37.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:23:41 -0000 On 10/10/2017 19:12, Ian Lepore wrote: > On Tue, 2017-10-10 at 17:45 +0300, Andriy Gapon wrote: >> On 12/09/2017 00:49, Ian Lepore wrote: >>> >>> Author: ian >>> Date: Mon Sep 11 21:49:38 2017 >>> New Revision: 323465 >>> URL: https://svnweb.freebsd.org/changeset/base/323465 >>> >>> Log: >>>   Make i2c -s (device scan) work on hardware that supports only full xfers. >>>    >>>   The existing scan code is based on sending an i2c START condition and if >>>   there is no error it assumes there is a device at that i2c address.  Some >>>   i2c controllers don't support sending individual start/stop signals on the >>>   bus, they can only perform complete data transfers with start/stop handled >>>   in the silicon. >>>    >>>   This adds a fallback mechanism that attempts to read a single byte from each >>>   i2c address.  It's less reliable than looking for an an ACK repsonse to a >>>   start, because some devices will NAK an attempt to read that isn't preceeded >>>   by a write of a register address.  Writing to devices to probe them is too >>>   dangerous to even consider.  The user is told that a less-reliable scan is >>>   being done, so even if the read-scan comes up empty too, it's still a vast >>>   improvement over the old situation where it would just claim there were no >>>   devices on the bus even though the devices were there and working fine. >>>    >>>   If the i2c controller responds with a proper ENODEV (device doesn't support >>>   operation) or an almost-proper EOPNOTSUPP, the START/STOP scan is switched >>>   to a read-scan right away.  Most controllers respond with ENXIO or EIO if >>>   they don't support START/STOP, so no quick-out is available.  For those, >>>   if a scan of all 127 addresses and come up empty, the scan is re-done using >>>   the read method. >> >> Perhaps the new scan method should have been added as a separate option that has >> to be explicitly activated...  My concern is that there are some extremely >> simple I2C devices out there that do no sanity checking and may get confused >> > > i2c -s is not a thing that's done routinely in a production system or > normal system operations... it's something a person does manually when > trying to configure or debug a system. Right. And another point, it's not extremely hard to type another option on the command line. I haven't suggested that the functionality should not have been added at all, I have just suggested adding a new option to unlock it. > In that situation, there is > more harm in being told there are no working devices on the bus when in > fact everything is fine, than there is some some hypothetical device > doing some hypothetical "bad thing" in response to a read command.  In > all my years of working with i2c stuff I've never seen a device doing > anything more harmful than hanging the bus, requiring a reset (and even > causing that requires worse behavior than an unexpected read).  On the > other hand, I've seen a lot of people frustrated that i2c -s on freebsd > says there are no devices, while the equivelent command on linux shows > that everything is fine. -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Oct 10 16:42:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C7B2E36FD2 for ; Tue, 10 Oct 2017 16:42:35 +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 09B73638AC for ; Tue, 10 Oct 2017 16:42:34 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 01450651-adda-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 01450651-adda-11e7-a893-25625093991c; Tue, 10 Oct 2017 16:42:30 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9AGgQnd004242; Tue, 10 Oct 2017 10:42:26 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507653746.84167.40.camel@freebsd.org> Subject: Re: svn commit: r323465 - head/usr.sbin/i2c From: Ian Lepore To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Date: Tue, 10 Oct 2017 10:42:26 -0600 In-Reply-To: References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 16:42:35 -0000 On Tue, 2017-10-10 at 19:20 +0300, Andriy Gapon wrote: > On 10/10/2017 19:12, Ian Lepore wrote: > > > > i2c -s is not a thing that's done routinely in a production system or > > normal system operations... it's something a person does manually when > > trying to configure or debug a system.  In that situation, there is > > more harm in being told there are no working devices on the bus when in > > fact everything is fine, than there is some some hypothetical device > > doing some hypothetical "bad thing" in response to a read command.  In > > all my years of working with i2c stuff I've never seen a device doing > > anything more harmful than hanging the bus, requiring a reset (and even > > causing that requires worse behavior than an unexpected read).  On the > > other hand, I've seen a lot of people frustrated that i2c -s on freebsd > > says there are no devices, while the equivelent command on linux shows > > that everything is fine. > Okay. > > However, I will just mention that in the past I used to own a system where > scanning the bus would make a slave that controlled CPU frequency to change it > to some garbage.  The system "just" crashed, but theoretically the damage could > have been worse. > Also, I own a system right now where scanning the bus results in something like > what you mentioned, but a little bit worse, the hanging bus that can be brought > back only by a power cycle (not even a warm reset). > These systems didn't used to hang on i2c -s, and now they do? -- Ian From owner-svn-src-head@freebsd.org Tue Oct 10 17:01:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 876BFE378B0; Tue, 10 Oct 2017 17:01:56 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 385F06431C; Tue, 10 Oct 2017 17:01:54 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA02806; Tue, 10 Oct 2017 20:01:53 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1xuj-0001kH-7d; Tue, 10 Oct 2017 20:01:53 +0300 Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> <1507653746.84167.40.camel@freebsd.org> From: Andriy Gapon Message-ID: <736553e2-050b-a444-d52e-5526e03c0ae8@FreeBSD.org> Date: Tue, 10 Oct 2017 20:00:32 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1507653746.84167.40.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 17:01:56 -0000 On 10/10/2017 19:42, Ian Lepore wrote: > On Tue, 2017-10-10 at 19:20 +0300, Andriy Gapon wrote: >> On 10/10/2017 19:12, Ian Lepore wrote: >>> >>> i2c -s is not a thing that's done routinely in a production system or >>> normal system operations... it's something a person does manually when >>> trying to configure or debug a system.  In that situation, there is >>> more harm in being told there are no working devices on the bus when in >>> fact everything is fine, than there is some some hypothetical device >>> doing some hypothetical "bad thing" in response to a read command.  In >>> all my years of working with i2c stuff I've never seen a device doing >>> anything more harmful than hanging the bus, requiring a reset (and even >>> causing that requires worse behavior than an unexpected read).  On the >>> other hand, I've seen a lot of people frustrated that i2c -s on freebsd >>> says there are no devices, while the equivelent command on linux shows >>> that everything is fine. >> Okay. >> >> However, I will just mention that in the past I used to own a system where >> scanning the bus would make a slave that controlled CPU frequency to change it >> to some garbage.  The system "just" crashed, but theoretically the damage could >> have been worse. >> Also, I own a system right now where scanning the bus results in something like >> what you mentioned, but a little bit worse, the hanging bus that can be brought >> back only by a power cycle (not even a warm reset). >> > > These systems didn't used to hang on i2c -s, and now they do? Sorry, I failed to clarify that I talked about smbus and smbmsg -p. I imagine that pure i2c slaves can be as fragile. -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Oct 10 17:04:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFBF0E37A69 for ; Tue, 10 Oct 2017 17:04:03 +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 7793464510 for ; Tue, 10 Oct 2017 17:04:02 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0098d88a-addd-11e7-a893-25625093991c X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 0098d88a-addd-11e7-a893-25625093991c; Tue, 10 Oct 2017 17:03:58 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9AH3rK3004302; Tue, 10 Oct 2017 11:03:54 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507655033.84167.54.camel@freebsd.org> Subject: Re: svn commit: r323465 - head/usr.sbin/i2c From: Ian Lepore To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Date: Tue, 10 Oct 2017 11:03:53 -0600 In-Reply-To: <230cbbbf-9d98-2249-e0db-488b4a3abfb3@FreeBSD.org> References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> <230cbbbf-9d98-2249-e0db-488b4a3abfb3@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 17:04:04 -0000 On Tue, 2017-10-10 at 19:23 +0300, Andriy Gapon wrote: > On 10/10/2017 19:12, Ian Lepore wrote: > > > > On Tue, 2017-10-10 at 17:45 +0300, Andriy Gapon wrote: > > > > > > On 12/09/2017 00:49, Ian Lepore wrote: > > > > > > > > > > > > Author: ian > > > > Date: Mon Sep 11 21:49:38 2017 > > > > New Revision: 323465 > > > > URL: https://svnweb.freebsd.org/changeset/base/323465 > > > > > > > > Log: > > > >   Make i2c -s (device scan) work on hardware that supports only full xfers. > > > >    > > > >   The existing scan code is based on sending an i2c START condition and if > > > >   there is no error it assumes there is a device at that i2c address.  Some > > > >   i2c controllers don't support sending individual start/stop signals on the > > > >   bus, they can only perform complete data transfers with start/stop handled > > > >   in the silicon. > > > >    > > > >   This adds a fallback mechanism that attempts to read a single byte from each > > > >   i2c address.  It's less reliable than looking for an an ACK repsonse to a > > > >   start, because some devices will NAK an attempt to read that isn't preceeded > > > >   by a write of a register address.  Writing to devices to probe them is too > > > >   dangerous to even consider.  The user is told that a less-reliable scan is > > > >   being done, so even if the read-scan comes up empty too, it's still a vast > > > >   improvement over the old situation where it would just claim there were no > > > >   devices on the bus even though the devices were there and working fine. > > > >    > > > >   If the i2c controller responds with a proper ENODEV (device doesn't support > > > >   operation) or an almost-proper EOPNOTSUPP, the START/STOP scan is switched > > > >   to a read-scan right away.  Most controllers respond with ENXIO or EIO if > > > >   they don't support START/STOP, so no quick-out is available.  For those, > > > >   if a scan of all 127 addresses and come up empty, the scan is re-done using > > > >   the read method. > > > Perhaps the new scan method should have been added as a separate option that has > > > to be explicitly activated...  My concern is that there are some extremely > > > simple I2C devices out there that do no sanity checking and may get confused > > > > > i2c -s is not a thing that's done routinely in a production system or > > normal system operations... it's something a person does manually when > > trying to configure or debug a system. > Right.  And another point, it's not extremely hard to type another option on the > command line.  I haven't suggested that the functionality should not have been > added at all, I have just suggested adding a new option to unlock it. > This conversation is making me think harder about what's happening on the bus during the two different kinds of scans, and I'm realizing the answer is "almost exactly the same thing in both cases". A "normal" scan is a START, followed by 9 clocks during which the slave address is put on the bus and either an ACK or NAK happens, followed by a STOP. A new-style "read" scan is a START, followed by 9 clocks during which the slave address is put on the bus and either an ACK or NAK happens, followed by 9 more clocks for transferring a byte+NAK, followed by a STOP. So the entire difference is 9 extra clocks, in terms of bus behavior.  Operationally, the slave device already indicated a willingness to service a read operation when it ACK'd its address following the start. Actually doing the read shouldn't put the device into a bad state, but I guess we could theorize it might... maybe it likes to work in 16-bit chunks and a STOP after 8 bits confuses it.  But before the stop comes a NAK from the master which says "I don't want to read anymore" and if that confuses the device, it's violating the protocol. All in all, I'm now wondering if what should change is removing the wording about the read-based scan being somehow "less reliable", I don't think it really is. -- Ian From owner-svn-src-head@freebsd.org Tue Oct 10 17:28:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 749F8E381E0; Tue, 10 Oct 2017 17:28:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2050A650F8; Tue, 10 Oct 2017 17:28:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA02848; Tue, 10 Oct 2017 20:28:12 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1e1yKC-0001lP-1v; Tue, 10 Oct 2017 20:28:12 +0300 Subject: Re: svn commit: r323465 - head/usr.sbin/i2c To: Ian Lepore , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201709112149.v8BLncAs049328@repo.freebsd.org> <4c4a916f-9960-6d7f-3389-37b998ba980b@FreeBSD.org> <1507651963.84167.37.camel@freebsd.org> <230cbbbf-9d98-2249-e0db-488b4a3abfb3@FreeBSD.org> <1507655033.84167.54.camel@freebsd.org> From: Andriy Gapon Message-ID: <4f91a38d-4de8-b6a7-1076-4f6c200708fe@FreeBSD.org> Date: Tue, 10 Oct 2017 20:27:10 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1507655033.84167.54.camel@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 17:28:15 -0000 On 10/10/2017 20:03, Ian Lepore wrote: > This conversation is making me think harder about what's happening on > the bus during the two different kinds of scans, and I'm realizing the > answer is "almost exactly the same thing in both cases". > > A "normal" scan is a START, followed by 9 clocks during which the slave > address is put on the bus and either an ACK or NAK happens, followed by > a STOP. > > A new-style "read" scan is a START, followed by 9 clocks during which > the slave address is put on the bus and either an ACK or NAK happens, > followed by 9 more clocks for transferring a byte+NAK, followed by a > STOP. > > So the entire difference is 9 extra clocks, in terms of bus behavior. >  Operationally, the slave device already indicated a willingness to > service a read operation when it ACK'd its address following the start. > > Actually doing the read shouldn't put the device into a bad state, but > I guess we could theorize it might... maybe it likes to work in 16-bit > chunks and a STOP after 8 bits confuses it.  But before the stop comes > a NAK from the master which says "I don't want to read anymore" and if > that confuses the device, it's violating the protocol. > > All in all, I'm now wondering if what should change is removing the > wording about the read-based scan being somehow "less reliable", I > don't think it really is. Well, the misbehaving devices most certainly violate the protocol, but that does not change the fact that they exist. For example, the PLL chip I mentioned earlier simply listened for its slave address and then expected a fixed length sequence of bytes to program a new frequency. The slave even ignored the R/W bit and intermediate start-stop bits. It simply treated the next 8 x N bits as the data. I think that it was this chip or something like it: http://pdf1.alldatasheet.com/datasheet-pdf/view/58355/CYPRESS/W48S111-14.html -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Oct 10 19:14:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 641E7E3A806; Tue, 10 Oct 2017 19:14:41 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 331E16891F; Tue, 10 Oct 2017 19:14:41 +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 v9AJEejQ040537; Tue, 10 Oct 2017 19:14:40 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AJEenl040536; Tue, 10 Oct 2017 19:14:40 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201710101914.v9AJEenl040536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 10 Oct 2017 19:14:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324500 - head/sys/modules/em X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/modules/em X-SVN-Commit-Revision: 324500 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 19:14:41 -0000 Author: sbruno Date: Tue Oct 10 19:14:40 2017 New Revision: 324500 URL: https://svnweb.freebsd.org/changeset/base/324500 Log: Hard link if_igb.ko to if_em.ko. Use a LINK directive to ensure that this is more friendly to the tree. Tested this with loader.conf:if_igb_load="YES" and it does the right thing. Submitted by: Ian Lepore Modified: head/sys/modules/em/Makefile Modified: head/sys/modules/em/Makefile ============================================================================== --- head/sys/modules/em/Makefile Tue Oct 10 16:17:03 2017 (r324499) +++ head/sys/modules/em/Makefile Tue Oct 10 19:14:40 2017 (r324500) @@ -22,7 +22,6 @@ CFLAGS += -I${SRCTOP}/sys/dev/e1000 # DEVICE_POLLING for a non-interrupt-driven method #CFLAGS += -DDEVICE_POLLING -afterinstall: - cd ${DESTDIR}${KMODDIR} && ln -sf if_em.ko if_igb.ko +LINKS= ${KMODDIR}/${KMOD}.ko ${KMODDIR}/if_igb.ko .include From owner-svn-src-head@freebsd.org Tue Oct 10 19:20:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C77E3AA3D; Tue, 10 Oct 2017 19:20:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2E3C69251; Tue, 10 Oct 2017 19:20:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AJKcMP041750; Tue, 10 Oct 2017 19:20:38 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AJKcto041749; Tue, 10 Oct 2017 19:20:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201710101920.v9AJKcto041749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Oct 2017 19:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324501 - head/sys/dev/acpica/Osd X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: head/sys/dev/acpica/Osd X-SVN-Commit-Revision: 324501 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 19:20:40 -0000 Author: jkim Date: Tue Oct 10 19:20:38 2017 New Revision: 324501 URL: https://svnweb.freebsd.org/changeset/base/324501 Log: Do not check whether AcpiOsGetTimer() is called during boot. From ACPICA 20170929, AcpiOsGetTimer() should be available early because While() loop timeout mechanism was reimplemented with it. Unfortunately, it means AcpiLoadTables() may cause panic when a While() loop is executed. After having lengthy discussions with ACPICA developers, I have concluded that dummy timecounter is good enough for the purpose and it is the least intrusive solution for now. Also, they reminded me the ACPI specification implies OS timer function should be available before loading tables. Modified: head/sys/dev/acpica/Osd/OsdSchedule.c Modified: head/sys/dev/acpica/Osd/OsdSchedule.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSchedule.c Tue Oct 10 19:14:40 2017 (r324500) +++ head/sys/dev/acpica/Osd/OsdSchedule.c Tue Oct 10 19:20:38 2017 (r324501) @@ -274,9 +274,6 @@ AcpiOsGetTimer(void) struct bintime bt; UINT64 t; - /* XXX During early boot there is no (decent) timer available yet. */ - KASSERT(cold == 0, ("acpi: timer op not yet supported during boot")); - binuptime(&bt); t = (uint64_t)bt.sec * 10000000; t += ((uint64_t)10000000 * (uint32_t)(bt.frac >> 32)) >> 32; From owner-svn-src-head@freebsd.org Tue Oct 10 19:33:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F8E2E3B09A; Tue, 10 Oct 2017 19:33:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA42669C6F; Tue, 10 Oct 2017 19:33:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AJXPbk048837; Tue, 10 Oct 2017 19:33:25 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AJXORV048830; Tue, 10 Oct 2017 19:33:24 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201710101933.v9AJXORV048830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 10 Oct 2017 19:33:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324502 - in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/ha... X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/dispatcher sys/contrib/dev/acpica/components/hardware sys/contrib/dev/ac... X-SVN-Commit-Revision: 324502 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 19:33:26 -0000 Author: jkim Date: Tue Oct 10 19:33:24 2017 New Revision: 324502 URL: https://svnweb.freebsd.org/changeset/base/324502 Log: Merge ACPICA 20170929 (take 2). Added: head/sys/contrib/dev/acpica/compiler/aslallocate.c (contents, props changed) - copied, changed from r324104, vendor-sys/acpica/dist/source/compiler/aslallocate.c head/sys/contrib/dev/acpica/compiler/aslcache.c (contents, props changed) - copied, changed from r324104, vendor-sys/acpica/dist/source/compiler/aslcache.c Modified: head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/asldebug.c head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslhelp.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/aslmapenter.c head/sys/contrib/dev/acpica/compiler/aslmaputils.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslparseop.c head/sys/contrib/dev/acpica/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/cvcompiler.c head/sys/contrib/dev/acpica/compiler/cvparser.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nssearch.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/dev/acpica/acpi_cpu.c head/usr.sbin/acpi/iasl/Makefile Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/changes.txt Tue Oct 10 19:33:24 2017 (r324502) @@ -1,4 +1,104 @@ ---------------------------------------- +29 September 2017. Summary of changes for version 20170929: + + +1) ACPICA kernel-resident subsystem: + +Redesigned and implemented an improved ASL While() loop timeout +mechanism. This mechanism is used to prevent infinite loops in the kernel +AML interpreter caused by either non-responsive hardware or incorrect AML +code. The new implementation uses AcpiOsGetTimer instead of a simple +maximum loop count, and is thus more accurate and constant across +different machines. The default timeout is currently 30 seconds, but this +may be adjusted later. + +Renamed the ACPI_AML_INFINITE_LOOP exception to AE_AML_LOOP_TIMEOUT to +better reflect the new implementation of the loop timeout mechanism. + +Updated the AcpiGetTimerDuration interface to cleanup the 64-bit support +and to fix an off-by-one error. Jung-uk Kim. + +Fixed an EFI build problem by updating the makefiles to for a new file +that was added, utstrsuppt.c + + +2) iASL Compiler/Disassembler and Tools: + +Implemented full support for the PDTT, SDEV, and TPM2 ACPI tables. This +includes support in the table disassembler, compiler, and template +generator. + +iASL: Added an exception for an illegal type of recursive method +invocation. If a method creates named objects, the first recursive call +will fail at runtime. This change adds an error detection at compile time +to catch the problem up front. Note: Marking such a method as +"serialized" will not help with this problem, because the same thread can +acquire the method mutex more than once. Example compiler and runtime +output: + + Method (MTH1) + { + Name (INT1, 1) + MTH1 () + } + + dsdt.asl 22: MTH1 () + Error 6152 - ^ Illegal recursive call to method + that creates named objects (MTH1) + +Previous runtime exception: + ACPI Error: [INT1] Namespace lookup failure, + AE_ALREADY_EXISTS (20170831/dswload2-465) + +iASL: Updated support for External() opcodes to improve namespace +management and error detection. These changes are related to issues seen +with multiple-segment namespace pathnames within External declarations, +such as below: + + External(\_SB.PCI0.GFX0, DeviceObj) + External(\_SB.PCI0.GFX0.ALSI) + +iASL: Implemented support for multi-line error/warning messages. This +enables more detailed and helpful error messages as below, from the +initial deployment for the duplicate names error: + + DSDT.iiii 1692: Device(PEG2) { + Error 6074 - ^ Name already exists in scope +(PEG2) + + Original name creation/declaration below: + DSDT.iiii 93: External(\_SB.PCI0.PEG2, DeviceObj) + +AcpiXtract: Added additional flexibility to support differing input hex +dump formats. Specifically, hex dumps that contain partial disassembly +and/or comments within the ACPI table data definition. There exist some +dump utilities seen in the field that create this type of hex dump (such +as Simics). For example: + + DSDT @ 0xdfffd0c0 (10999 bytes) + Signature DSDT + Length 10999 + Revision 1 + Checksum 0xf3 (Ok) + OEM_ID BXPC + OEM_table_id BXDSDT + OEM_revision 1 + Creator_id 1280593481 + Creator_revision 537399345 + 0000: 44 53 44 54 f7 2a 00 00 01 f3 42 58 50 43 00 00 + ... + 2af0: 5f 4c 30 46 00 a4 01 + +Test suite: Miscellaneous changes/fixes: + More cleanup and simplification of makefiles + Continue compilation of test cases after a compile failure + Do not perform binary compare unless both files actually exist + +iASL: Performed some code/module restructuring. Moved all memory +allocation functions to new modules. Two new files, aslallocate.c and +aslcache.c + +---------------------------------------- 31 August 2017. Summary of changes for version 20170831: Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/common/adfile.c Tue Oct 10 19:33:24 2017 (r324502) @@ -314,7 +314,7 @@ FlGenerateFilename ( * Copy the original filename to a new buffer. Leave room for the worst * case where we append the suffix, an added dot and the null terminator. */ - NewFilename = UtStringCacheCalloc ((ACPI_SIZE) + NewFilename = UtLocalCacheCalloc ((ACPI_SIZE) strlen (InputFilename) + strlen (Suffix) + 2); strcpy (NewFilename, InputFilename); @@ -358,7 +358,7 @@ FlStrdup ( char *NewString; - NewString = UtStringCacheCalloc ((ACPI_SIZE) strlen (String) + 1); + NewString = UtLocalCacheCalloc ((ACPI_SIZE) strlen (String) + 1); strcpy (NewString, String); return (NewString); } Modified: head/sys/contrib/dev/acpica/common/ahtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/ahtable.c Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/common/ahtable.c Tue Oct 10 19:33:24 2017 (r324502) @@ -232,6 +232,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_MTMR, "MID Timer Table"}, {ACPI_SIG_NFIT, "NVDIMM Firmware Interface Table"}, {ACPI_SIG_PCCT, "Platform Communications Channel Table"}, + {ACPI_SIG_PDTT, "Platform Debug Trigger Table"}, {ACPI_SIG_PMTT, "Platform Memory Topology Table"}, {ACPI_SIG_PPTT, "Processor Properties Topology Table"}, {ACPI_SIG_RASF, "RAS Features Table"}, @@ -240,6 +241,7 @@ const AH_TABLE Gbl_AcpiSupportedTables[] = {ACPI_SIG_S3PT, "S3 Performance Table"}, {ACPI_SIG_SBST, "Smart Battery Specification Table"}, {ACPI_SIG_SDEI, "Software Delegated Exception Interface Table"}, + {ACPI_SIG_SDEV, "Secure Devices table"}, {ACPI_SIG_SLIC, "Software Licensing Description Table"}, {ACPI_SIG_SLIT, "System Locality Information Table"}, {ACPI_SIG_SPCR, "Serial Port Console Redirection table"}, Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/common/dmtable.c Tue Oct 10 19:33:24 2017 (r324502) @@ -154,7 +154,6 @@ #include #include #include -#include /* This module used for application-level code only */ @@ -290,9 +289,9 @@ static const char *AcpiDmHestSubnames[] = "IA-32 Machine Check Exception", "IA-32 Corrected Machine Check", "IA-32 Non-Maskable Interrupt", - "Unknown SubTable Type", /* 3 - Reserved */ - "Unknown SubTable Type", /* 4 - Reserved */ - "Unknown SubTable Type", /* 5 - Reserved */ + "Unknown Subtable Type", /* 3 - Reserved */ + "Unknown Subtable Type", /* 4 - Reserved */ + "Unknown Subtable Type", /* 5 - Reserved */ "PCI Express Root Port AER", "PCI Express AER (AER Endpoint)", "PCI Express/PCI-X Bridge AER", @@ -374,7 +373,7 @@ static const char *AcpiDmPmttSubnames[] = { "Socket", /* ACPI_PMTT_TYPE_SOCKET */ "Memory Controller", /* ACPI_PMTT_TYPE_CONTROLLER */ - "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */ + "Physical Component (DIMM)", /* ACPI_PMTT_TYPE_DIMM */ "Unknown Subtable Type" /* Reserved */ }; @@ -382,10 +381,17 @@ static const char *AcpiDmPpttSubnames[] = { "Processor Hierarchy Node", /* ACPI_PPTT_TYPE_PROCESSOR */ "Cache Type", /* ACPI_PPTT_TYPE_CACHE */ - "ID", /* ACPI_PMTT_TYPE_ID */ + "ID", /* ACPI_PPTT_TYPE_ID */ "Unknown Subtable Type" /* Reserved */ }; +static const char *AcpiDmSdevSubnames[] = +{ + "Namespace Device", /* ACPI_SDEV_TYPE_NAMESPACE_DEVICE */ + "PCIe Endpoint Device", /* ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE */ + "Unknown Subtable Type" /* Reserved */ +}; + static const char *AcpiDmSratSubnames[] = { "Processor Local APIC/SAPIC Affinity", @@ -396,6 +402,23 @@ static const char *AcpiDmSratSubnames[] = "Unknown Subtable Type" /* Reserved */ }; +static const char *AcpiDmTpm2Subnames[] = +{ + "Illegal Start Method value", + "Reserved", + "ACPI Start Method", + "Reserved", + "Reserved", + "Reserved", + "Memory Mapped I/O", + "Command Response Buffer", + "Command Response Buffer with ACPI Start Method", + "Reserved", + "Reserved", + "Command Response Buffer with ARM SMC", + "Unknown Subtable Type" /* Reserved */ +}; + static const char *AcpiDmIvrsSubnames[] = { "Hardware Definition Block", @@ -487,6 +510,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_MTMR, NULL, AcpiDmDumpMtmr, DtCompileMtmr, TemplateMtmr}, {ACPI_SIG_NFIT, AcpiDmTableInfoNfit, AcpiDmDumpNfit, DtCompileNfit, TemplateNfit}, {ACPI_SIG_PCCT, AcpiDmTableInfoPcct, AcpiDmDumpPcct, DtCompilePcct, TemplatePcct}, + {ACPI_SIG_PDTT, AcpiDmTableInfoPdtt, AcpiDmDumpPdtt, DtCompilePdtt, TemplatePdtt}, {ACPI_SIG_PMTT, NULL, AcpiDmDumpPmtt, DtCompilePmtt, TemplatePmtt}, {ACPI_SIG_PPTT, NULL, AcpiDmDumpPptt, DtCompilePptt, TemplatePptt}, {ACPI_SIG_RASF, AcpiDmTableInfoRasf, NULL, NULL, TemplateRasf}, @@ -494,6 +518,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_S3PT, NULL, NULL, NULL, TemplateS3pt}, {ACPI_SIG_SBST, AcpiDmTableInfoSbst, NULL, NULL, TemplateSbst}, {ACPI_SIG_SDEI, AcpiDmTableInfoSdei, NULL, NULL, TemplateSdei}, + {ACPI_SIG_SDEV, AcpiDmTableInfoSdev, AcpiDmDumpSdev, DtCompileSdev, TemplateSdev}, {ACPI_SIG_SLIC, NULL, AcpiDmDumpSlic, DtCompileSlic, TemplateSlic}, {ACPI_SIG_SLIT, NULL, AcpiDmDumpSlit, DtCompileSlit, TemplateSlit}, {ACPI_SIG_SPCR, AcpiDmTableInfoSpcr, NULL, NULL, TemplateSpcr}, @@ -501,7 +526,7 @@ const ACPI_DMTABLE_DATA AcpiDmTableData[] = {ACPI_SIG_SRAT, NULL, AcpiDmDumpSrat, DtCompileSrat, TemplateSrat}, {ACPI_SIG_STAO, NULL, AcpiDmDumpStao, DtCompileStao, TemplateStao}, {ACPI_SIG_TCPA, NULL, AcpiDmDumpTcpa, DtCompileTcpa, TemplateTcpa}, - {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, NULL, NULL, TemplateTpm2}, + {ACPI_SIG_TPM2, AcpiDmTableInfoTpm2, AcpiDmDumpTpm2, DtCompileTpm2, TemplateTpm2}, {ACPI_SIG_UEFI, AcpiDmTableInfoUefi, NULL, DtCompileUefi, TemplateUefi}, {ACPI_SIG_VRTC, AcpiDmTableInfoVrtc, AcpiDmDumpVrtc, DtCompileVrtc, TemplateVrtc}, {ACPI_SIG_WAET, AcpiDmTableInfoWaet, NULL, NULL, TemplateWaet}, @@ -917,6 +942,7 @@ AcpiDmDumpTable ( case ACPI_DMT_PCCT: case ACPI_DMT_PMTT: case ACPI_DMT_PPTT: + case ACPI_DMT_SDEV: case ACPI_DMT_SRAT: case ACPI_DMT_ASF: case ACPI_DMT_HESTNTYP: @@ -948,6 +974,7 @@ AcpiDmDumpTable ( case ACPI_DMT_NAME4: case ACPI_DMT_SIG: case ACPI_DMT_LPIT: + case ACPI_DMT_TPM2: ByteLength = 4; break; @@ -1583,6 +1610,20 @@ AcpiDmDumpTable ( CurrentOffset, NULL); break; + case ACPI_DMT_SDEV: + + /* SDEV subtable types */ + + Temp8 = *Target; + if (Temp8 > ACPI_SDEV_TYPE_RESERVED) + { + Temp8 = ACPI_SDEV_TYPE_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmSdevSubnames[Temp8]); + break; + case ACPI_DMT_SRAT: /* SRAT subtable types */ @@ -1596,6 +1637,22 @@ AcpiDmDumpTable ( AcpiOsPrintf (UINT8_FORMAT, *Target, AcpiDmSratSubnames[Temp8]); break; + + case ACPI_DMT_TPM2: + + /* TPM2 Start Method types */ + + Temp8 = *Target; + if (Temp8 > ACPI_TPM2_RESERVED) + { + Temp8 = ACPI_TPM2_RESERVED; + } + + AcpiOsPrintf (UINT8_FORMAT, *Target, + AcpiDmTpm2Subnames[Temp8]); + break; + + case ACPI_DMT_FADTPM: Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Tue Oct 10 19:20:38 2017 (r324501) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Tue Oct 10 19:33:24 2017 (r324502) @@ -623,7 +623,7 @@ AcpiDmDumpAsf ( { ACPI_STATUS Status; UINT32 Offset = sizeof (ACPI_TABLE_HEADER); - ACPI_ASF_INFO *SubTable; + ACPI_ASF_INFO *Subtable; ACPI_DMTABLE_INFO *InfoTable; ACPI_DMTABLE_INFO *DataInfoTable = NULL; UINT8 *DataTable = NULL; @@ -636,13 +636,13 @@ AcpiDmDumpAsf ( /* No main table, only subtables */ - SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ - Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, - SubTable->Header.Length, AcpiDmTableInfoAsfHdr); + Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, + Subtable->Header.Length, AcpiDmTableInfoAsfHdr); if (ACPI_FAILURE (Status)) { return; @@ -650,7 +650,7 @@ AcpiDmDumpAsf ( /* The actual type is the lower 7 bits of Type */ - Type = (UINT8) (SubTable->Header.Type & 0x7F); + Type = (UINT8) (Subtable->Header.Type & 0x7F); switch (Type) { @@ -663,9 +663,9 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf1; DataInfoTable = AcpiDmTableInfoAsf1a; - DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts; - DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength; + DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT)); + DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts; + DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_ALERT); break; @@ -673,9 +673,9 @@ AcpiDmDumpAsf ( InfoTable = AcpiDmTableInfoAsf2; DataInfoTable = AcpiDmTableInfoAsf2a; - DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE)); - DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls; - DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength; + DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE)); + DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls; + DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength; DataOffset = Offset + sizeof (ACPI_ASF_REMOTE); break; @@ -687,20 +687,20 @@ AcpiDmDumpAsf ( case ACPI_ASF_TYPE_ADDRESS: InfoTable = AcpiDmTableInfoAsf4; - DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS)); - DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices; + DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS)); + DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices; DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS); break; default: AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", - SubTable->Header.Type); + Subtable->Header.Type); return; } - Status = AcpiDmDumpTable (Table->Length, Offset, SubTable, - SubTable->Header.Length, InfoTable); + Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, + Subtable->Header.Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -762,15 +762,15 @@ AcpiDmDumpAsf ( /* Point to next subtable */ - if (!SubTable->Header.Length) + if (!Subtable->Header.Length) { AcpiOsPrintf ("Invalid zero subtable header length\n"); return; } - Offset += SubTable->Header.Length; - SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, - SubTable->Header.Length); + Offset += Subtable->Header.Length; + Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable, + Subtable->Header.Length); } } @@ -793,7 +793,7 @@ AcpiDmDumpCpep ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_CPEP_POLLING *SubTable; + ACPI_CPEP_POLLING *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CPEP); @@ -808,12 +808,12 @@ AcpiDmDumpCpep ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Header.Length, AcpiDmTableInfoCpep0); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Header.Length, AcpiDmTableInfoCpep0); if (ACPI_FAILURE (Status)) { return; @@ -821,9 +821,9 @@ AcpiDmDumpCpep ( /* Point to next subtable */ - Offset += SubTable->Header.Length; - SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable, - SubTable->Header.Length); + Offset += Subtable->Header.Length; + Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable, + Subtable->Header.Length); } } @@ -846,9 +846,9 @@ AcpiDmDumpCsrt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_CSRT_GROUP *SubTable; + ACPI_CSRT_GROUP *Subtable; ACPI_CSRT_SHARED_INFO *SharedInfoTable; - ACPI_CSRT_DESCRIPTOR *SubSubTable; + ACPI_CSRT_DESCRIPTOR *SubSubtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_CSRT); UINT32 SubOffset; @@ -860,14 +860,14 @@ AcpiDmDumpCsrt ( /* Subtables (Resource Groups) */ - SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset); while (Offset < Table->Length) { /* Resource group subtable */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoCsrt0); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoCsrt0); if (ACPI_FAILURE (Status)) { return; @@ -887,19 +887,19 @@ AcpiDmDumpCsrt ( return; } - SubOffset += SubTable->SharedInfoLength; + SubOffset += Subtable->SharedInfoLength; /* Sub-Subtables (Resource Descriptors) */ - SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, + SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table, Offset + SubOffset); - while ((SubOffset < SubTable->Length) && + while ((SubOffset < Subtable->Length) && ((Offset + SubOffset) < Table->Length)) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable, - SubSubTable->Length, AcpiDmTableInfoCsrt2); + Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable, + SubSubtable->Length, AcpiDmTableInfoCsrt2); if (ACPI_FAILURE (Status)) { return; @@ -909,7 +909,7 @@ AcpiDmDumpCsrt ( /* Resource-specific info buffer */ - InfoLength = SubSubTable->Length - SubSubOffset; + InfoLength = SubSubtable->Length - SubSubOffset; if (InfoLength) { Status = AcpiDmDumpTable (Length, @@ -924,16 +924,16 @@ AcpiDmDumpCsrt ( /* Point to next sub-subtable */ - SubOffset += SubSubTable->Length; - SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable, - SubSubTable->Length); + SubOffset += SubSubtable->Length; + SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable, + SubSubtable->Length); } /* Point to next subtable */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable, - SubTable->Length); + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable, + Subtable->Length); } } @@ -956,7 +956,7 @@ AcpiDmDumpDbg2 ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_DBG2_DEVICE *SubTable; + ACPI_DBG2_DEVICE *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_DBG2); UINT32 i; @@ -975,12 +975,12 @@ AcpiDmDumpDbg2 ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoDbg2Device); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoDbg2Device); if (ACPI_FAILURE (Status)) { return; @@ -988,15 +988,15 @@ AcpiDmDumpDbg2 ( /* Dump the BaseAddress array */ - for (i = 0; i < SubTable->RegisterCount; i++) + for (i = 0; i < Subtable->RegisterCount; i++) { - ArrayOffset = SubTable->BaseAddressOffset + + ArrayOffset = Subtable->BaseAddressOffset + (sizeof (ACPI_GENERIC_ADDRESS) * i); AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) SubTable + ArrayOffset; + Array = (UINT8 *) Subtable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - SubTable->Length, AcpiDmTableInfoDbg2Addr); + Subtable->Length, AcpiDmTableInfoDbg2Addr); if (ACPI_FAILURE (Status)) { return; @@ -1005,15 +1005,15 @@ AcpiDmDumpDbg2 ( /* Dump the AddressSize array */ - for (i = 0; i < SubTable->RegisterCount; i++) + for (i = 0; i < Subtable->RegisterCount; i++) { - ArrayOffset = SubTable->AddressSizeOffset + + ArrayOffset = Subtable->AddressSizeOffset + (sizeof (UINT32) * i); AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) SubTable + ArrayOffset; + Array = (UINT8 *) Subtable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - SubTable->Length, AcpiDmTableInfoDbg2Size); + Subtable->Length, AcpiDmTableInfoDbg2Size); if (ACPI_FAILURE (Status)) { return; @@ -1023,12 +1023,12 @@ AcpiDmDumpDbg2 ( /* Dump the Namestring (required) */ AcpiOsPrintf ("\n"); - ArrayOffset = SubTable->NamepathOffset; + ArrayOffset = Subtable->NamepathOffset; AbsoluteOffset = Offset + ArrayOffset; - Array = (UINT8 *) SubTable + ArrayOffset; + Array = (UINT8 *) Subtable + ArrayOffset; Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array, - SubTable->Length, AcpiDmTableInfoDbg2Name); + Subtable->Length, AcpiDmTableInfoDbg2Name); if (ACPI_FAILURE (Status)) { return; @@ -1036,10 +1036,10 @@ AcpiDmDumpDbg2 ( /* Dump the OemData (optional) */ - if (SubTable->OemDataOffset) + if (Subtable->OemDataOffset) { - Status = AcpiDmDumpTable (Length, Offset + SubTable->OemDataOffset, - Table, SubTable->OemDataLength, + Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset, + Table, Subtable->OemDataLength, AcpiDmTableInfoDbg2OemData); if (ACPI_FAILURE (Status)) { @@ -1049,9 +1049,9 @@ AcpiDmDumpDbg2 ( /* Point to next subtable */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable, - SubTable->Length); + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable, + Subtable->Length); } } @@ -1074,7 +1074,7 @@ AcpiDmDumpDmar ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_DMAR_HEADER *SubTable; + ACPI_DMAR_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_DMAR); ACPI_DMTABLE_INFO *InfoTable; @@ -1094,14 +1094,14 @@ AcpiDmDumpDmar ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoDmarHdr); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoDmarHdr); if (ACPI_FAILURE (Status)) { return; @@ -1109,7 +1109,7 @@ AcpiDmDumpDmar ( AcpiOsPrintf ("\n"); - switch (SubTable->Type) + switch (Subtable->Type) { case ACPI_DMAR_TYPE_HARDWARE_UNIT: @@ -1144,12 +1144,12 @@ AcpiDmDumpDmar ( default: AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", - SubTable->Type); + Subtable->Type); return; } - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, InfoTable); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -1158,16 +1158,16 @@ AcpiDmDumpDmar ( /* * Dump the optional device scope entries */ - if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || - (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE)) + if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) || + (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE)) { /* These types do not support device scopes */ goto NextSubtable; } - ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset); - while (ScopeOffset < SubTable->Length) + ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset); + while (ScopeOffset < Subtable->Length) { AcpiOsPrintf ("\n"); Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable, @@ -1208,9 +1208,9 @@ AcpiDmDumpDmar ( NextSubtable: /* Point to next subtable */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, - SubTable->Length); + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable, + Subtable->Length); } } @@ -1343,7 +1343,7 @@ AcpiDmDumpEinj ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_WHEA_HEADER *SubTable; + ACPI_WHEA_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_EINJ); @@ -1358,11 +1358,11 @@ AcpiDmDumpEinj ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, + Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0); if (ACPI_FAILURE (Status)) { @@ -1372,7 +1372,7 @@ AcpiDmDumpEinj ( /* Point to next subtable (each subtable is of fixed length) */ Offset += sizeof (ACPI_WHEA_HEADER); - SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable, + Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, sizeof (ACPI_WHEA_HEADER)); } } @@ -1396,7 +1396,7 @@ AcpiDmDumpErst ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_WHEA_HEADER *SubTable; + ACPI_WHEA_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_ERST); @@ -1411,11 +1411,11 @@ AcpiDmDumpErst ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset); while (Offset < Table->Length) { AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, + Status = AcpiDmDumpTable (Length, Offset, Subtable, sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0); if (ACPI_FAILURE (Status)) { @@ -1425,7 +1425,7 @@ AcpiDmDumpErst ( /* Point to next subtable (each subtable is of fixed length) */ Offset += sizeof (ACPI_WHEA_HEADER); - SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable, + Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable, sizeof (ACPI_WHEA_HEADER)); } } @@ -1449,7 +1449,7 @@ AcpiDmDumpFpdt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_FPDT_HEADER *SubTable; + ACPI_FPDT_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_FPDT); ACPI_DMTABLE_INFO *InfoTable; @@ -1459,20 +1459,20 @@ AcpiDmDumpFpdt ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoFpdtHdr); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoFpdtHdr); if (ACPI_FAILURE (Status)) { return; } - switch (SubTable->Type) + switch (Subtable->Type) { case ACPI_FPDT_TYPE_BOOT: @@ -1487,31 +1487,31 @@ AcpiDmDumpFpdt ( default: AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", - SubTable->Type); + Subtable->Type); /* Attempt to continue */ - if (!SubTable->Length) + if (!Subtable->Length) { AcpiOsPrintf ("Invalid zero length subtable\n"); return; } - goto NextSubTable; + goto NextSubtable; } - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, InfoTable); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; } -NextSubTable: +NextSubtable: /* Point to next subtable */ - Offset += SubTable->Length; - SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, - SubTable->Length); + Offset += Subtable->Length; + Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, + Subtable->Length); } } @@ -1534,11 +1534,11 @@ AcpiDmDumpGtdt ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_GTDT_HEADER *SubTable; + ACPI_GTDT_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_GTDT); ACPI_DMTABLE_INFO *InfoTable; - UINT32 SubTableLength; + UINT32 SubtableLength; UINT32 GtCount; ACPI_GTDT_TIMER_ENTRY *GtxTable; @@ -1553,34 +1553,34 @@ AcpiDmDumpGtdt ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset); while (Offset < Table->Length) { /* Common subtable header */ AcpiOsPrintf ("\n"); - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, AcpiDmTableInfoGtdtHdr); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, AcpiDmTableInfoGtdtHdr); if (ACPI_FAILURE (Status)) { return; } GtCount = 0; - switch (SubTable->Type) + switch (Subtable->Type) { case ACPI_GTDT_TYPE_TIMER_BLOCK: - SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK); + SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK); GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK, - SubTable))->TimerCount; + Subtable))->TimerCount; InfoTable = AcpiDmTableInfoGtdt0; break; case ACPI_GTDT_TYPE_WATCHDOG: - SubTableLength = sizeof (ACPI_GTDT_WATCHDOG); + SubtableLength = sizeof (ACPI_GTDT_WATCHDOG); InfoTable = AcpiDmTableInfoGtdt1; break; @@ -1590,12 +1590,12 @@ AcpiDmDumpGtdt ( /* Cannot continue on unknown type - no length */ AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", - SubTable->Type); + Subtable->Type); return; } - Status = AcpiDmDumpTable (Length, Offset, SubTable, - SubTable->Length, InfoTable); + Status = AcpiDmDumpTable (Length, Offset, Subtable, + Subtable->Length, InfoTable); if (ACPI_FAILURE (Status)) { return; @@ -1603,15 +1603,15 @@ AcpiDmDumpGtdt ( /* Point to end of current subtable (each subtable above is of fixed length) */ - Offset += SubTableLength; + Offset += SubtableLength; /* If there are any Gt Timer Blocks from above, dump them now */ if (GtCount) { GtxTable = ACPI_ADD_PTR ( - ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength); - SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY); + ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength); + SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY); while (GtCount) { @@ -1630,7 +1630,7 @@ AcpiDmDumpGtdt ( /* Point to next subtable */ - SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength); + Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength); } } @@ -1653,11 +1653,11 @@ AcpiDmDumpHest ( ACPI_TABLE_HEADER *Table) { ACPI_STATUS Status; - ACPI_HEST_HEADER *SubTable; + ACPI_HEST_HEADER *Subtable; UINT32 Length = Table->Length; UINT32 Offset = sizeof (ACPI_TABLE_HEST); ACPI_DMTABLE_INFO *InfoTable; - UINT32 SubTableLength; + UINT32 SubtableLength; UINT32 BankCount; ACPI_HEST_IA_ERROR_BANK *BankTable; @@ -1672,70 +1672,70 @@ AcpiDmDumpHest ( /* Subtables */ - SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset); + Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset); while (Offset < Table->Length) { BankCount = 0; - switch (SubTable->Type) + switch (Subtable->Type) { case ACPI_HEST_TYPE_IA32_CHECK: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Oct 10 20:08:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1E4FE3B8EC; Tue, 10 Oct 2017 20:08:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7C506AB53; Tue, 10 Oct 2017 20:08:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AK8Uws061416; Tue, 10 Oct 2017 20:08:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AK8U6V061415; Tue, 10 Oct 2017 20:08:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710102008.v9AK8U6V061415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Oct 2017 20:08:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324503 - head/sys/dev/uart X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/dev/uart X-SVN-Commit-Revision: 324503 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 20:08:32 -0000 Author: emaste Date: Tue Oct 10 20:08:30 2017 New Revision: 324503 URL: https://svnweb.freebsd.org/changeset/base/324503 Log: uart: detect 256-byte FIFOs Submitted by: Zakary Nafziger Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Tue Oct 10 19:33:24 2017 (r324502) +++ head/sys/dev/uart/uart_dev_ns8250.c Tue Oct 10 20:08:30 2017 (r324503) @@ -873,7 +873,7 @@ ns8250_bus_probe(struct uart_softc *sc) count = 0; goto describe; } - } while ((lsr & LSR_OE) == 0 && count < 130); + } while ((lsr & LSR_OE) == 0 && count < 260); count--; uart_setreg(bas, REG_MCR, mcr); @@ -894,6 +894,9 @@ ns8250_bus_probe(struct uart_softc *sc) } else if (count >= 112 && count <= 128) { sc->sc_rxfifosz = 128; device_set_desc(sc->sc_dev, "16950 or compatible"); + } else if (count >= 224 && count <= 256) { + sc->sc_rxfifosz = 256; + device_set_desc(sc->sc_dev, "16x50 with 256 byte FIFO"); } else { sc->sc_rxfifosz = 16; device_set_desc(sc->sc_dev, From owner-svn-src-head@freebsd.org Tue Oct 10 20:45:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09A8BE3C71E; Tue, 10 Oct 2017 20:45:47 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB0BA6BF9F; Tue, 10 Oct 2017 20:45:46 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AKjjRH077766; Tue, 10 Oct 2017 20:45:45 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AKjjRI077764; Tue, 10 Oct 2017 20:45:45 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201710102045.v9AKjjRI077764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Tue, 10 Oct 2017 20:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324504 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 324504 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 20:45:47 -0000 Author: davidcs Date: Tue Oct 10 20:45:45 2017 New Revision: 324504 URL: https://svnweb.freebsd.org/changeset/base/324504 Log: Revert Commit r324290 Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots in Tx Ring map to empty slot in Tx_buf array before Transmits. If the checks fail further Transmission on that Tx Ring is prevented. Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Tue Oct 10 20:08:30 2017 (r324503) +++ head/sys/dev/qlxgbe/ql_hw.c Tue Oct 10 20:45:45 2017 (r324504) @@ -2374,16 +2374,6 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in } } - for (i = 0; i < num_tx_cmds; i++) { - if (NULL != ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head) { - QL_ASSERT(ha, 0, \ - ("%s: txr_idx = %d tx_idx = %d mbuf = %p\n",\ - __func__, txr_idx, (tx_idx+i),\ - ha->tx_ring[txr_idx].tx_buf[(tx_idx+i)].m_head)); - return (EINVAL); - } - } - tx_cmd = &hw->tx_cntxt[txr_idx].tx_ring_base[tx_idx]; if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) { Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Tue Oct 10 20:08:30 2017 (r324503) +++ head/sys/dev/qlxgbe/ql_os.c Tue Oct 10 20:45:45 2017 (r324504) @@ -1232,17 +1232,6 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; - - if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) { - QL_ASSERT(ha, 0, ("%s: txr_idx = %d tx_idx = %d mbuf = %p\n",\ - __func__, txr_idx, tx_idx,\ - ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head)); - if (m_head) - m_freem(m_head); - *m_headp = NULL; - return (ret); - } - map = ha->tx_ring[txr_idx].tx_buf[tx_idx].map; ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs, From owner-svn-src-head@freebsd.org Tue Oct 10 21:05:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71EAEE3CFC8; Tue, 10 Oct 2017 21:05:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40E006CCA2; Tue, 10 Oct 2017 21:05:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9AL5e4c085991; Tue, 10 Oct 2017 21:05:40 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AL5eCu085989; Tue, 10 Oct 2017 21:05:40 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201710102105.v9AL5eCu085989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 10 Oct 2017 21:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324506 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 324506 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 21:05:41 -0000 Author: rmacklem Date: Tue Oct 10 21:05:40 2017 New Revision: 324506 URL: https://svnweb.freebsd.org/changeset/base/324506 Log: Fix forced dismount when a pNFS mount is hung on a DS. When a "pnfs" NFSv4.1 mount is hung because of an unresponsive DS, a forced dismount wouldn't work, because the RPC socket for the DS was not being closed. This patch fixes this. This will only affect "pnfs" mounts where the pNFS server's DS is unresponsive (crashed or network partitioned or...). Found during testing of the pNFS server. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfsclstate.h Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Tue Oct 10 21:04:40 2017 (r324505) +++ head/sys/fs/nfs/nfs_commonkrpc.c Tue Oct 10 21:05:40 2017 (r324506) @@ -1121,9 +1121,29 @@ nfsmout: int newnfs_nmcancelreqs(struct nfsmount *nmp) { + struct nfsclds *dsp; + struct __rpc_client *cl; if (nmp->nm_sockreq.nr_client != NULL) CLNT_CLOSE(nmp->nm_sockreq.nr_client); +lookformore: + NFSLOCKMNT(nmp); + TAILQ_FOREACH(dsp, &nmp->nm_sess, nfsclds_list) { + NFSLOCKDS(dsp); + if (dsp != TAILQ_FIRST(&nmp->nm_sess) && + (dsp->nfsclds_flags & NFSCLDS_CLOSED) == 0 && + dsp->nfsclds_sockp != NULL && + dsp->nfsclds_sockp->nr_client != NULL) { + dsp->nfsclds_flags |= NFSCLDS_CLOSED; + cl = dsp->nfsclds_sockp->nr_client; + NFSUNLOCKDS(dsp); + NFSUNLOCKMNT(nmp); + CLNT_CLOSE(cl); + goto lookformore; + } + NFSUNLOCKDS(dsp); + } + NFSUNLOCKMNT(nmp); return (0); } Modified: head/sys/fs/nfs/nfsclstate.h ============================================================================== --- head/sys/fs/nfs/nfsclstate.h Tue Oct 10 21:04:40 2017 (r324505) +++ head/sys/fs/nfs/nfsclstate.h Tue Oct 10 21:05:40 2017 (r324506) @@ -91,6 +91,7 @@ struct nfsclds { #define NFSCLDS_HASWRITEVERF 0x0001 #define NFSCLDS_MDS 0x0002 #define NFSCLDS_DS 0x0004 +#define NFSCLDS_CLOSED 0x0008 struct nfsclclient { LIST_ENTRY(nfsclclient) nfsc_list; From owner-svn-src-head@freebsd.org Tue Oct 10 21:16:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E95FBE3D3DF; Tue, 10 Oct 2017 21:16:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6CCF6D2D5; Tue, 10 Oct 2017 21:16:08 +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 v9ALG7hW090014; Tue, 10 Oct 2017 21:16:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ALG77m090013; Tue, 10 Oct 2017 21:16:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710102116.v9ALG77m090013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Oct 2017 21:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324507 - head/sbin/growfs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sbin/growfs X-SVN-Commit-Revision: 324507 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 21:16:09 -0000 Author: emaste Date: Tue Oct 10 21:16:07 2017 New Revision: 324507 URL: https://svnweb.freebsd.org/changeset/base/324507 Log: growfs: ANSIfy cgckhash() The build was broken on GCC-using architectures with: growfs.c: In function 'cgckhash': growfs.c:1753: warning: old-style function definition Sponsored by: The FreeBSD Foundation Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Tue Oct 10 21:05:40 2017 (r324506) +++ head/sbin/growfs/growfs.c Tue Oct 10 21:16:07 2017 (r324507) @@ -1748,8 +1748,7 @@ mount_reload(const struct statfs *stfs) * Calculate the check-hash of the cylinder group. */ static void -cgckhash(cgp) - struct cg *cgp; +cgckhash(struct cg *cgp) { if ((sblock.fs_metackhash & CK_CYLGRP) == 0) From owner-svn-src-head@freebsd.org Tue Oct 10 22:21:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFA83E3ED1E; Tue, 10 Oct 2017 22:21:06 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF2D16F508; Tue, 10 Oct 2017 22:21:06 +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 v9AML5xK015783; Tue, 10 Oct 2017 22:21:05 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9AML554015782; Tue, 10 Oct 2017 22:21:05 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201710102221.v9AML554015782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 10 Oct 2017 22:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324508 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324508 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 22:21:07 -0000 Author: sbruno Date: Tue Oct 10 22:21:05 2017 New Revision: 324508 URL: https://svnweb.freebsd.org/changeset/base/324508 Log: match sendfile() error handling to send(). Sendfile() should match the error checking order of send() which is currently: SBS_CANTSENDMORE so_error SS_ISCONNECTED Submitted by: Jason Eggleston Reviewed by: glebius MFC after: 2 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12633 Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Tue Oct 10 21:16:07 2017 (r324507) +++ head/sys/kern/kern_sendfile.c Tue Oct 10 22:21:05 2017 (r324508) @@ -507,8 +507,6 @@ sendfile_getsock(struct thread *td, int s, struct file *so = (*sock_fp)->f_data; if ((*so)->so_type != SOCK_STREAM) return (EINVAL); - if (((*so)->so_state & SS_ISCONNECTED) == 0) - return (ENOTCONN); return (0); } @@ -617,6 +615,12 @@ retry_space: SOCKBUF_UNLOCK(&so->so_snd); goto done; } + if ((so->so_state & SS_ISCONNECTED) == 0) { + SOCKBUF_UNLOCK(&so->so_snd); + error = ENOTCONN; + goto done; + } + space = sbspace(&so->so_snd); if (space < rem && (space <= 0 || From owner-svn-src-head@freebsd.org Tue Oct 10 23:54:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 889E9E40B38; Tue, 10 Oct 2017 23:54:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5645671B46; Tue, 10 Oct 2017 23:54:26 +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 v9ANsPZA056335; Tue, 10 Oct 2017 23:54:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ANsPk4056334; Tue, 10 Oct 2017 23:54:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710102354.v9ANsPk4056334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 10 Oct 2017 23:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324509 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 324509 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 23:54:26 -0000 Author: emaste Date: Tue Oct 10 23:54:25 2017 New Revision: 324509 URL: https://svnweb.freebsd.org/changeset/base/324509 Log: sysctl.9: document CTLFLAG_CAPRD and CTLFLAG_CAPWR Reported by: Shawn Webb MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/sysctl.9 Modified: head/share/man/man9/sysctl.9 ============================================================================== --- head/share/man/man9/sysctl.9 Tue Oct 10 22:21:05 2017 (r324508) +++ head/share/man/man9/sysctl.9 Tue Oct 10 23:54:25 2017 (r324509) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2016 +.Dd October 10, 2017 .Dt SYSCTL 9 .Os .Sh NAME @@ -668,6 +668,10 @@ Additionally, any of the following optional flags may .Bl -tag -width ".Dv CTLFLAG_ANYBODY" .It Dv CTLFLAG_ANYBODY Any user or process can write to this sysctl. +.It Dv CTLFLAG_CAPRD +A process in capability mode can read from this sysctl. +.It Dv CTLFLAG_CAPWR +A process in capability mode can write to this sysctl. .It Dv CTLFLAG_SECURE This sysctl can be written to only if the effective securelevel of the process is \[<=] 0. From owner-svn-src-head@freebsd.org Wed Oct 11 02:39:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE870E43ED6; Wed, 11 Oct 2017 02:39:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C12475AA3; Wed, 11 Oct 2017 02:39:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B2dKB8022589; Wed, 11 Oct 2017 02:39:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B2dKlx022588; Wed, 11 Oct 2017 02:39:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201710110239.v9B2dKlx022588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 11 Oct 2017 02:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324511 - head/contrib/binutils/bfd X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/contrib/binutils/bfd X-SVN-Commit-Revision: 324511 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 02:39:21 -0000 Author: jhibbits Date: Wed Oct 11 02:39:20 2017 New Revision: 324511 URL: https://svnweb.freebsd.org/changeset/base/324511 Log: Do exception offset computations in 64 bits, not 32. This fixes clang-built binaries on a gcc powerpc64 world. Gets us one step closer to a clang-built world. The same change was made in later upstream binutils. Submitted by: rdivacky MFC after: 2 weeks Modified: head/contrib/binutils/bfd/elf-eh-frame.c Modified: head/contrib/binutils/bfd/elf-eh-frame.c ============================================================================== --- head/contrib/binutils/bfd/elf-eh-frame.c Wed Oct 11 00:31:54 2017 (r324510) +++ head/contrib/binutils/bfd/elf-eh-frame.c Wed Oct 11 02:39:20 2017 (r324511) @@ -1344,7 +1344,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, val = read_value (abfd, buf, per_width, get_DW_EH_PE_signed (per_encoding)); - val += ent->offset - ent->new_offset; + val += (bfd_vma)ent->offset - ent->new_offset; val -= extra_string + extra_data; write_value (abfd, buf, val, per_width); action &= ~4; @@ -1400,7 +1400,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, } break; case DW_EH_PE_pcrel: - value += ent->offset - ent->new_offset; + value += (bfd_vma)ent->offset - ent->new_offset; address += sec->output_section->vma + ent->offset + 8; break; } @@ -1428,7 +1428,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, if (value) { if ((ent->lsda_encoding & 0xf0) == DW_EH_PE_pcrel) - value += ent->offset - ent->new_offset; + value += (bfd_vma)ent->offset - ent->new_offset; else if (ent->cie_inf->need_lsda_relative) value -= (sec->output_section->vma + ent->new_offset + 8 + ent->lsda_offset); From owner-svn-src-head@freebsd.org Wed Oct 11 03:50:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA6A1E451DB; Wed, 11 Oct 2017 03:50:45 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B48D777D81; Wed, 11 Oct 2017 03:50:45 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B3oivu052679; Wed, 11 Oct 2017 03:50:44 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B3oiEn052678; Wed, 11 Oct 2017 03:50:44 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201710110350.v9B3oiEn052678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Wed, 11 Oct 2017 03:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324512 - head/sys/sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: lidl X-SVN-Commit-Paths: head/sys/sparc64/sparc64 X-SVN-Commit-Revision: 324512 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 03:50:46 -0000 Author: lidl Date: Wed Oct 11 03:50:44 2017 New Revision: 324512 URL: https://svnweb.freebsd.org/changeset/base/324512 Log: Don't use a non-zero argument for __builtin_frame_address Mirror the change made for powerpc64 in r323687. With this change, gcc 6.4.0 can successfully compile and link a kernel that runs on sparc64. MFC after: 2 weeks Modified: head/sys/sparc64/sparc64/stack_machdep.c Modified: head/sys/sparc64/sparc64/stack_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/stack_machdep.c Wed Oct 11 02:39:20 2017 (r324511) +++ head/sys/sparc64/sparc64/stack_machdep.c Wed Oct 11 03:50:44 2017 (r324512) @@ -93,5 +93,5 @@ void stack_save(struct stack *st) { - stack_capture(st, (struct frame *)__builtin_frame_address(1)); + stack_capture(st, (struct frame *)__builtin_frame_address(0)); } From owner-svn-src-head@freebsd.org Wed Oct 11 05:15:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 606D1E46BFC; Wed, 11 Oct 2017 05:15:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B7937E45B; Wed, 11 Oct 2017 05:15:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B5FnRQ088735; Wed, 11 Oct 2017 05:15:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B5Fn0o088732; Wed, 11 Oct 2017 05:15:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110515.v9B5Fn0o088732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 05:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324516 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324516 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:15:50 -0000 Author: sephe Date: Wed Oct 11 05:15:49 2017 New Revision: 324516 URL: https://svnweb.freebsd.org/changeset/base/324516 Log: hyperv/hn: Workaround erroneous hash type observed on WS2016 for VF. The background was described in r324489. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Wed Oct 11 05:07:37 2017 (r324515) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Wed Oct 11 05:15:49 2017 (r324516) @@ -521,6 +521,10 @@ hn_rndis_query_rsscaps(struct hn_softc *sc, int *rxr_c /* Commit! */ sc->hn_rss_ind_size = indsz; sc->hn_rss_hcap = hash_func | hash_types; + if (sc->hn_caps & HN_CAP_UDPHASH) { + /* UDP 4-tuple hash is unconditionally enabled. */ + sc->hn_rss_hcap |= NDIS_HASH_UDP_IPV4_X; + } *rxr_cnt0 = rxr_cnt; return (0); } @@ -760,8 +764,10 @@ hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags) ("NDIS 6.20+ is required, NDIS version 0x%08x", sc->hn_ndis_ver)); /* XXX only one can be specified through, popcnt? */ - KASSERT((sc->hn_rss_hash & NDIS_HASH_FUNCTION_MASK), ("no hash func")); - KASSERT((sc->hn_rss_hash & NDIS_HASH_TYPE_MASK), ("no hash types")); + KASSERT((sc->hn_rss_hash & NDIS_HASH_FUNCTION_MASK), + ("no hash func %08x", sc->hn_rss_hash)); + KASSERT((sc->hn_rss_hash & NDIS_HASH_STD), + ("no standard hash types %08x", sc->hn_rss_hash)); KASSERT(sc->hn_rss_ind_size > 0, ("no indirect table size")); if (bootverbose) { @@ -780,7 +786,8 @@ hn_rndis_conf_rss(struct hn_softc *sc, uint16_t flags) prm->ndis_hdr.ndis_rev = NDIS_RSS_PARAMS_REV_2; prm->ndis_hdr.ndis_size = rss_size; prm->ndis_flags = flags; - prm->ndis_hash = sc->hn_rss_hash; + prm->ndis_hash = sc->hn_rss_hash & + (NDIS_HASH_FUNCTION_MASK | NDIS_HASH_STD); prm->ndis_indsize = sizeof(rss->rss_ind[0]) * sc->hn_rss_ind_size; prm->ndis_indoffset = __offsetof(struct ndis_rssprm_toeplitz, rss_ind[0]); Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 11 05:07:37 2017 (r324515) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 11 05:15:49 2017 (r324516) @@ -1424,6 +1424,8 @@ hn_rss_type_fromndis(uint32_t rss_hash) types |= RSS_TYPE_TCP_IPV6; if (rss_hash & NDIS_HASH_TCP_IPV6_EX) types |= RSS_TYPE_TCP_IPV6_EX; + if (rss_hash & NDIS_HASH_UDP_IPV4_X) + types |= RSS_TYPE_UDP_IPV4; return (types); } @@ -1432,9 +1434,8 @@ hn_rss_type_tondis(uint32_t types) { uint32_t rss_hash = 0; - KASSERT((types & - (RSS_TYPE_UDP_IPV4 | RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, - ("UDP4, UDP6 and UDP6EX are not supported")); + KASSERT((types & (RSS_TYPE_UDP_IPV6 | RSS_TYPE_UDP_IPV6_EX)) == 0, + ("UDP6 and UDP6EX are not supported")); if (types & RSS_TYPE_IPV4) rss_hash |= NDIS_HASH_IPV4; @@ -1448,6 +1449,8 @@ hn_rss_type_tondis(uint32_t types) rss_hash |= NDIS_HASH_TCP_IPV6; if (types & RSS_TYPE_TCP_IPV6_EX) rss_hash |= NDIS_HASH_TCP_IPV6_EX; + if (types & RSS_TYPE_UDP_IPV4) + rss_hash |= NDIS_HASH_UDP_IPV4_X; return (rss_hash); } @@ -1546,6 +1549,13 @@ hn_vf_rss_fixup(struct hn_softc *sc, bool reconf) * NOTE: * We don't disable the hash type, but stop delivery the hash * value/type through mbufs on RX path. + * + * XXX If HN_CAP_UDPHASH is set in hn_caps, then UDP 4-tuple + * hash is delivered with type of TCP_IPV4. This means if + * UDP_IPV4 is enabled, then TCP_IPV4 should be forced, at + * least to hn_mbuf_hash. However, given that _all_ of the + * NICs implement TCP_IPV4, this will _not_ impose any issues + * here. */ if ((my_types & RSS_TYPE_IPV4) && (diff_types & ifrh.ifrh_types & @@ -3582,7 +3592,9 @@ hn_rxpkt(struct hn_rx_ring *rxr, const void *data, int &l3proto, &l4proto); } if (l3proto == ETHERTYPE_IP) { - if (l4proto == IPPROTO_UDP) { + if (l4proto == IPPROTO_UDP && + (rxr->hn_mbuf_hash & + NDIS_HASH_UDP_IPV4_X)) { hash_type = M_HASHTYPE_RSS_UDP_IPV4; do_lro = 0; Modified: head/sys/dev/hyperv/netvsc/ndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/ndis.h Wed Oct 11 05:07:37 2017 (r324515) +++ head/sys/dev/hyperv/netvsc/ndis.h Wed Oct 11 05:15:49 2017 (r324516) @@ -56,17 +56,26 @@ #define NDIS_HASH_IPV6_EX 0x00000800 #define NDIS_HASH_TCP_IPV6 0x00001000 #define NDIS_HASH_TCP_IPV6_EX 0x00002000 +#define NDIS_HASH_UDP_IPV4_X 0x00004000 /* XXX non-standard */ #define NDIS_HASH_ALL (NDIS_HASH_IPV4 | \ NDIS_HASH_TCP_IPV4 | \ NDIS_HASH_IPV6 | \ NDIS_HASH_IPV6_EX | \ NDIS_HASH_TCP_IPV6 | \ + NDIS_HASH_TCP_IPV6_EX |\ + NDIS_HASH_UDP_IPV4_X) + +#define NDIS_HASH_STD (NDIS_HASH_IPV4 | \ + NDIS_HASH_TCP_IPV4 | \ + NDIS_HASH_IPV6 | \ + NDIS_HASH_IPV6_EX | \ + NDIS_HASH_TCP_IPV6 | \ NDIS_HASH_TCP_IPV6_EX) /* Hash description for use with printf(9) %b identifier. */ #define NDIS_HASH_BITS \ - "\20\1TOEPLITZ\11IP4\12TCP4\13IP6\14IP6EX\15TCP6\16TCP6EX" + "\20\1TOEPLITZ\11IP4\12TCP4\13IP6\14IP6EX\15TCP6\16TCP6EX\17UDP4_X" #define NDIS_HASH_KEYSIZE_TOEPLITZ 40 #define NDIS_HASH_INDCNT 128 From owner-svn-src-head@freebsd.org Wed Oct 11 05:28:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEDB3E4702B; Wed, 11 Oct 2017 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E6877EAC6; Wed, 11 Oct 2017 05:28:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B5SpI2092908; Wed, 11 Oct 2017 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B5SpMB092907; Wed, 11 Oct 2017 05:28:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110528.v9B5SpMB092907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 05:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324517 - head/sys/dev/hyperv/netvsc X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/hyperv/netvsc X-SVN-Commit-Revision: 324517 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:28:52 -0000 Author: sephe Date: Wed Oct 11 05:28:51 2017 New Revision: 324517 URL: https://svnweb.freebsd.org/changeset/base/324517 Log: hyperv/hn: Enable transparent VF by default. MFC after: 3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 11 05:15:49 2017 (r324516) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 11 05:28:51 2017 (r324517) @@ -584,7 +584,7 @@ SYSCTL_PROC(_hw_hn, OID_AUTO, vfmap, CTLFLAG_RD | CTLT 0, 0, hn_vfmap_sysctl, "A", "VF mapping"); /* Transparent VF */ -static int hn_xpnt_vf = 0; +static int hn_xpnt_vf = 1; SYSCTL_INT(_hw_hn, OID_AUTO, vf_transparent, CTLFLAG_RDTUN, &hn_xpnt_vf, 0, "Transparent VF mod"); From owner-svn-src-head@freebsd.org Wed Oct 11 05:55:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91C3DE4773E; Wed, 11 Oct 2017 05:55:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BA627F7FF; Wed, 11 Oct 2017 05:55:53 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B5tq5Q005575; Wed, 11 Oct 2017 05:55:52 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B5tqGL005572; Wed, 11 Oct 2017 05:55:52 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110555.v9B5tqGL005572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 05:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324518 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 324518 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 05:55:53 -0000 Author: sephe Date: Wed Oct 11 05:55:52 2017 New Revision: 324518 URL: https://svnweb.freebsd.org/changeset/base/324518 Log: ixgbe: Remove never defined UDP_IPV4_EX Reviewed by: sbruno Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12454 Modified: head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/ixgbe_rss.h Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Oct 11 05:28:51 2017 (r324517) +++ head/sys/dev/ixgbe/if_ix.c Wed Oct 11 05:55:52 2017 (r324518) @@ -469,9 +469,6 @@ ixgbe_initialize_rss_mapping(struct adapter *adapter) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP; if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; - if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4_EX) - device_printf(adapter->dev, "%s: RSS_HASHTYPE_RSS_UDP_IPV4_EX defined, but not supported\n", - __func__); if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6_EX) Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Wed Oct 11 05:28:51 2017 (r324517) +++ head/sys/dev/ixgbe/if_ixv.c Wed Oct 11 05:55:52 2017 (r324518) @@ -1403,9 +1403,6 @@ ixv_initialize_rss_mapping(struct adapter *adapter) __func__); if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; - if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4_EX) - device_printf(adapter->dev, "%s: RSS_HASHTYPE_RSS_UDP_IPV4_EX defined, but not supported\n", - __func__); if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6_EX) Modified: head/sys/dev/ixgbe/ixgbe_rss.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_rss.h Wed Oct 11 05:28:51 2017 (r324517) +++ head/sys/dev/ixgbe/ixgbe_rss.h Wed Oct 11 05:55:52 2017 (r324518) @@ -49,7 +49,6 @@ #define RSS_HASHTYPE_RSS_IPV6_EX (1 << 5) #define RSS_HASHTYPE_RSS_TCP_IPV6_EX (1 << 6) #define RSS_HASHTYPE_RSS_UDP_IPV4 (1 << 7) -#define RSS_HASHTYPE_RSS_UDP_IPV4_EX (1 << 8) #define RSS_HASHTYPE_RSS_UDP_IPV6 (1 << 9) #define RSS_HASHTYPE_RSS_UDP_IPV6_EX (1 << 10) From owner-svn-src-head@freebsd.org Wed Oct 11 06:08:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2E7EE479CA; Wed, 11 Oct 2017 06:08:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90EF97FCAD; Wed, 11 Oct 2017 06:08:02 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9B681a9009595; Wed, 11 Oct 2017 06:08:01 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9B681LO009593; Wed, 11 Oct 2017 06:08:01 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201710110608.v9B681LO009593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 11 Oct 2017 06:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324519 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: sephe X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 324519 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 06:08:02 -0000 Author: sephe Date: Wed Oct 11 06:08:01 2017 New Revision: 324519 URL: https://svnweb.freebsd.org/changeset/base/324519 Log: rss: Remove never defined UDP_IPV4_EX Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D12455 Modified: head/sys/net/rss_config.c head/sys/net/rss_config.h Modified: head/sys/net/rss_config.c ============================================================================== --- head/sys/net/rss_config.c Wed Oct 11 05:55:52 2017 (r324518) +++ head/sys/net/rss_config.c Wed Oct 11 06:08:01 2017 (r324519) @@ -489,7 +489,6 @@ rss_gethashconfig(void) | RSS_HASHTYPE_RSS_TCP_IPV6_EX #if 0 | RSS_HASHTYPE_RSS_UDP_IPV4 - | RSS_HASHTYPE_RSS_UDP_IPV4_EX | RSS_HASHTYPE_RSS_UDP_IPV6 | RSS_HASHTYPE_RSS_UDP_IPV6_EX #endif Modified: head/sys/net/rss_config.h ============================================================================== --- head/sys/net/rss_config.h Wed Oct 11 05:55:52 2017 (r324518) +++ head/sys/net/rss_config.h Wed Oct 11 06:08:01 2017 (r324519) @@ -66,7 +66,6 @@ #define RSS_HASHTYPE_RSS_IPV6_EX (1 << 5) /* IPv6 2-tuple + ext hdrs */ #define RSS_HASHTYPE_RSS_TCP_IPV6_EX (1 << 6) /* TCPv6 4-tiple + ext hdrs */ #define RSS_HASHTYPE_RSS_UDP_IPV4 (1 << 7) /* IPv4 UDP 4-tuple */ -#define RSS_HASHTYPE_RSS_UDP_IPV4_EX (1 << 8) /* IPv4 UDP 4-tuple + ext hdrs */ #define RSS_HASHTYPE_RSS_UDP_IPV6 (1 << 9) /* IPv6 UDP 4-tuple */ #define RSS_HASHTYPE_RSS_UDP_IPV6_EX (1 << 10) /* IPv6 UDP 4-tuple + ext hdrs */ From owner-svn-src-head@freebsd.org Wed Oct 11 11:03:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10F51E28787; Wed, 11 Oct 2017 11:03:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D488963A17; Wed, 11 Oct 2017 11:03:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BB3BC0032702; Wed, 11 Oct 2017 11:03:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BB3Bew032701; Wed, 11 Oct 2017 11:03:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710111103.v9BB3Bew032701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 11 Oct 2017 11:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324528 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 11:03:13 -0000 Author: kib Date: Wed Oct 11 11:03:11 2017 New Revision: 324528 URL: https://svnweb.freebsd.org/changeset/base/324528 Log: The th_bintime, th_microtime and th_nanotime members of the timehand all cache the last system time (uptime + boottime). Only the format differs. Do not re-calculate the bintime and simply use the value used to calculate the microtime and nanotime. Group all the updates under the relevant comment. Remove obsoleted XXX part. Submitted by: Sebastian Huber MFC after: 1 week Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Oct 11 10:56:59 2017 (r324527) +++ head/sys/kern/kern_tc.c Wed Oct 11 11:03:11 2017 (r324528) @@ -1413,10 +1413,8 @@ tc_windup(struct bintime *new_boottimebin) if (bt.sec != t) th->th_boottime.sec += bt.sec - t; } - th->th_bintime = th->th_offset; - bintime_add(&th->th_bintime, &th->th_boottime); /* Update the UTC timestamps used by the get*() functions. */ - /* XXX shouldn't do this here. Should force non-`get' versions. */ + th->th_bintime = bt; bintime2timeval(&bt, &th->th_microtime); bintime2timespec(&bt, &th->th_nanotime); From owner-svn-src-head@freebsd.org Wed Oct 11 14:34:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA5F0E2D945; Wed, 11 Oct 2017 14:34:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 998F16A1C8; Wed, 11 Oct 2017 14:34:07 +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 v9BEY6HL020263; Wed, 11 Oct 2017 14:34:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BEY64u020262; Wed, 11 Oct 2017 14:34:06 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710111434.v9BEY64u020262@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Oct 2017 14:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324531 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 324531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 14:34:07 -0000 Author: emaste Date: Wed Oct 11 14:34:06 2017 New Revision: 324531 URL: https://svnweb.freebsd.org/changeset/base/324531 Log: OptionalObsoleteFiles: remove diff from MK_GNU_DIFF=no block diff (and man page) are not from GNU, as of r317209, and should not be deleted if WITHOUT_GNU_DIFF is set. (WITHOUT_GNU_DIFF still controls whether diff3 is built.) Sponsored by: The FreeBSD Foundation Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 11 13:33:11 2017 (r324530) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 11 14:34:06 2017 (r324531) @@ -2480,9 +2480,7 @@ OLD_FILES+=usr/share/man/man8/gpioctl.8.gz .endif .if ${MK_GNU_DIFF} == no -OLD_FILES+=usr/bin/diff OLD_FILES+=usr/bin/diff3 -OLD_FILES+=usr/share/man/man1/diff.1.gz OLD_FILES+=usr/share/man/man1/diff3.1.gz OLD_FILES+=usr/share/man/man7/diff.7.gz .endif From owner-svn-src-head@freebsd.org Wed Oct 11 14:41:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A3EEE2DE1C; Wed, 11 Oct 2017 14:41:13 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDF116A808; Wed, 11 Oct 2017 14:41:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BEfC0K023024; Wed, 11 Oct 2017 14:41:12 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BEfCOC023023; Wed, 11 Oct 2017 14:41:12 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201710111441.v9BEfCOC023023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 11 Oct 2017 14:41:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324532 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 324532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 14:41:13 -0000 Author: bapt Date: Wed Oct 11 14:41:11 2017 New Revision: 324532 URL: https://svnweb.freebsd.org/changeset/base/324532 Log: Do not try to remove diff.7 optionaly has it is always removed since GNU diff(1) has been replaced with BSD diff(1) Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 11 14:34:06 2017 (r324531) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Oct 11 14:41:11 2017 (r324532) @@ -2482,7 +2482,6 @@ OLD_FILES+=usr/share/man/man8/gpioctl.8.gz .if ${MK_GNU_DIFF} == no OLD_FILES+=usr/bin/diff3 OLD_FILES+=usr/share/man/man1/diff3.1.gz -OLD_FILES+=usr/share/man/man7/diff.7.gz .endif .if ${MK_GNU_GREP} == no From owner-svn-src-head@freebsd.org Wed Oct 11 14:59:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 115EFE2E79A; Wed, 11 Oct 2017 14:59:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D325E6B3A5; Wed, 11 Oct 2017 14:59:05 +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 v9BEx4v2028776; Wed, 11 Oct 2017 14:59:04 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BEx492028775; Wed, 11 Oct 2017 14:59:04 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710111459.v9BEx492028775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 11 Oct 2017 14:59:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324533 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 324533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 14:59:06 -0000 Author: cem Date: Wed Oct 11 14:59:04 2017 New Revision: 324533 URL: https://svnweb.freebsd.org/changeset/base/324533 Log: hwpmc(4): Force sufficiently wide type for left shift Ordinary input to this macro comes from pe_code, which is uint16_t. Coverity points out that shifting such a value discards the result of a 24 bit shift, which is not what we want. A follow-up to r324291. CID: 1381676 Sponsored by: Dell EMC Isilon Modified: head/sys/dev/hwpmc/hwpmc_amd.h Modified: head/sys/dev/hwpmc/hwpmc_amd.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 11 14:41:11 2017 (r324532) +++ head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 11 14:59:04 2017 (r324533) @@ -67,7 +67,7 @@ #define AMD_PMC_EVENTMASK 0xF000000FF #define AMD_PMC_TO_UNITMASK(x) (((x) << 8) & AMD_PMC_UNITMASK) -#define AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((x) & 0xF00) << 24)) +#define AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((uint32_t)(x) & 0xF00) << 24)) #define AMD_VALID_BITS (AMD_PMC_COUNTERMASK | AMD_PMC_INVERT | \ AMD_PMC_ENABLE | AMD_PMC_INT | AMD_PMC_PC | AMD_PMC_EDGE | \ AMD_PMC_OS | AMD_PMC_USR | AMD_PMC_UNITMASK | AMD_PMC_EVENTMASK) From owner-svn-src-head@freebsd.org Wed Oct 11 15:13:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47067E2EFA2; Wed, 11 Oct 2017 15:13:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14D7D6BC30; Wed, 11 Oct 2017 15:13:41 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BFDe9A036997; Wed, 11 Oct 2017 15:13:40 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BFDepN036996; Wed, 11 Oct 2017 15:13:40 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710111513.v9BFDepN036996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 11 Oct 2017 15:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324534 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 324534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 15:13:41 -0000 Author: cem Date: Wed Oct 11 15:13:40 2017 New Revision: 324534 URL: https://svnweb.freebsd.org/changeset/base/324534 Log: hwpmc(4): Actually use a sufficiently wide type jhibbits@ points out that left shifting bits 8-11 24 bits won't fit in a 32-bit integer either. Corrects r324533. Submitted by: jhibbits Sponsored by: Dell EMC Isilon Modified: head/sys/dev/hwpmc/hwpmc_amd.h Modified: head/sys/dev/hwpmc/hwpmc_amd.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 11 14:59:04 2017 (r324533) +++ head/sys/dev/hwpmc/hwpmc_amd.h Wed Oct 11 15:13:40 2017 (r324534) @@ -67,7 +67,7 @@ #define AMD_PMC_EVENTMASK 0xF000000FF #define AMD_PMC_TO_UNITMASK(x) (((x) << 8) & AMD_PMC_UNITMASK) -#define AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((uint32_t)(x) & 0xF00) << 24)) +#define AMD_PMC_TO_EVENTMASK(x) (((x) & 0xFF) | (((uint64_t)(x) & 0xF00) << 24)) #define AMD_VALID_BITS (AMD_PMC_COUNTERMASK | AMD_PMC_INVERT | \ AMD_PMC_ENABLE | AMD_PMC_INT | AMD_PMC_PC | AMD_PMC_EDGE | \ AMD_PMC_OS | AMD_PMC_USR | AMD_PMC_UNITMASK | AMD_PMC_EVENTMASK) From owner-svn-src-head@freebsd.org Wed Oct 11 18:25:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04808E33296; Wed, 11 Oct 2017 18:25:07 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C547E71970; Wed, 11 Oct 2017 18:25:06 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BIP5m7016814; Wed, 11 Oct 2017 18:25:05 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BIP5Sf016812; Wed, 11 Oct 2017 18:25:05 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201710111825.v9BIP5Sf016812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 11 Oct 2017 18:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324535 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 324535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 18:25:07 -0000 Author: davidcs Date: Wed Oct 11 18:25:05 2017 New Revision: 324535 URL: https://svnweb.freebsd.org/changeset/base/324535 Log: Add sanity checks in ql_hw_send() qla_send() to ensure that empty slots in Tx Ring map to empty slot in Tx_buf array before Transmits. If the checks fail further Transmission on that Tx Ring is prevented. MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_os.c Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Wed Oct 11 15:13:40 2017 (r324534) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Oct 11 18:25:05 2017 (r324535) @@ -2374,6 +2374,20 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, in } } + for (i = 0; i < num_tx_cmds; i++) { + int j; + + j = (tx_idx+i) & (NUM_TX_DESCRIPTORS - 1); + + if (NULL != ha->tx_ring[txr_idx].tx_buf[j].m_head) { + QL_ASSERT(ha, 0, \ + ("%s [%d]: txr_idx = %d tx_idx = %d mbuf = %p\n",\ + __func__, __LINE__, txr_idx, j,\ + ha->tx_ring[txr_idx].tx_buf[j].m_head)); + return (EINVAL); + } + } + tx_cmd = &hw->tx_cntxt[txr_idx].tx_ring_base[tx_idx]; if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) { Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 15:13:40 2017 (r324534) +++ head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 18:25:05 2017 (r324535) @@ -1232,6 +1232,17 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; + + if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) { + QL_ASSERT(ha, 0, ("%s [%d]: txr_idx = %d tx_idx = %d "\ + "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\ + ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head)); + if (m_head) + m_freem(m_head); + *m_headp = NULL; + return (ret); + } + map = ha->tx_ring[txr_idx].tx_buf[tx_idx].map; ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs, From owner-svn-src-head@freebsd.org Wed Oct 11 18:30:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEE04E3339F; Wed, 11 Oct 2017 18:30:09 +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 98FFE71B3D; Wed, 11 Oct 2017 18:30:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 9B39510AF3A; Wed, 11 Oct 2017 14:30:06 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r324471 - head/sys/boot Date: Wed, 11 Oct 2017 10:47:07 -0700 Message-ID: <2024262.CuRUiD5dcO@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: References: <201710100453.v9A4rQ6W078536@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, 11 Oct 2017 14:30:06 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 18:30:09 -0000 On Monday, October 09, 2017 10:56:45 PM Warner Losh wrote: > DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. > > DO NOT MAKE ANY COMMITS TO sys/boot. > > BACK OFF. > > Seriously, though, extra changes create extra friction, and these changes > aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a > conflict when I update. > > So please, do not make any edits to sys/boot whatsoever, no matter how > trivial. > > At least until I'm done. > > Thanks. Umm, I know you are working on sys/boot but I never saw any mail or headsup claiming a lock on that part of the tree. It would be a reasonable assumption for someone based on the public commits that you had finished a milestone for now. I only knew about you wanting to remove LIBSAU via a private reply you sent to my earlier mail, but there was no public mention that you have more work. To that end I think this mail was a bit harsh. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Oct 11 18:44:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7704E337EE for ; Wed, 11 Oct 2017 18:44:31 +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 AA5F472471 for ; Wed, 11 Oct 2017 18:44:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id 72so4227649itl.5 for ; Wed, 11 Oct 2017 11:44:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=1haOTKd9dgcE+RK4Bn1feCLIXjIjy1n5+fjiRVIwMtE=; b=YrXJnZeBwPMP1npDUzoGO8/7IBQGhteS+GmNkNselPOHP7ePYZkxBkAN8xZ12sLKE2 FMbc5yedYlnpHY+0Ez5mqP9444KCMssmvoxZajMHTWXtDhUwD9q3HqKsiU05BIH9ccRh 6z6ndsRBfqSzQI8IwjFAP0BN58rnMZ0kZI3CFSwbnfJkEMCsiHRynaEtPSdanCPKyStH zCZlb3HmRujQobpnwRbBYApvS9336gRW3LN2Rh67BYskTKTPfa9u86O/iFJYk8t2mCc6 XCUTxelp2/A/iU/X5KDypYoytYU31RLL0tkxz0GffimecP+7MaemDj7l6CYUWwXeLEkD O2vg== 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=1haOTKd9dgcE+RK4Bn1feCLIXjIjy1n5+fjiRVIwMtE=; b=FhjxgXG/hGSmBXM77JAjumE+9YxKDk1XtEBVN1mWlLcPvPZ4k79ZM8guMYXuaj03Ke 0ehEmHIBg9PXb4FI1mLxbHlJ4tcpUX/zRZ0oWHFrcexXq9hiBCxLJCiMWXp0D1sLhYU5 QsjoO329hnZ8wJeEAZ/kJFpVi/LJ+5AUT/mDtnGiyPuw+0ruRrfRGM5/KDEUsH6uxBpG 5C7SdyNAvD7sE4MWc4kcVUaDTvKNo39oFMCZ6TwgFZk6xjkUsEKgUbhTjowuFnHXFkHM tIbG44sJYGnKWxjrNrz4ycngiUOLmi/5dS22Qti9NFGGCEiquqlYp/CdtCz9an3Fs+YG U+1A== X-Gm-Message-State: AMCzsaVWnWi0o3r9TW0BBdu5gtCp4PQnnz5ThK3OTnYw9/rbZOfoScYB YcLJ6Q/jVSY6bAS5zUn3wKzZpfVgEstN8vCfsJDzsw== X-Google-Smtp-Source: AOwi7QCsC8xu/XX7FX8hawHu4Dqg8PA6FUlCeKay1FfVUp/ojBKaWw5WN7xk8bUFhpEsrtDexsyjpSb/yVhC9hlpjLY= X-Received: by 10.36.203.3 with SMTP id u3mr652153itg.136.1507747471069; Wed, 11 Oct 2017 11:44:31 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.94.130 with HTTP; Wed, 11 Oct 2017 11:44:30 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:9015:f13b:4510:443e] In-Reply-To: <2024262.CuRUiD5dcO@ralph.baldwin.cx> References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> <2024262.CuRUiD5dcO@ralph.baldwin.cx> From: Warner Losh Date: Wed, 11 Oct 2017 12:44:30 -0600 X-Google-Sender-Auth: IiW6466wRy52OafzF0uzIZSIG2g Message-ID: Subject: Re: svn commit: r324471 - head/sys/boot To: John Baldwin Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 18:44:32 -0000 On Wed, Oct 11, 2017 at 11:47 AM, John Baldwin wrote: > On Monday, October 09, 2017 10:56:45 PM Warner Losh wrote: > > DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. > > > > DO NOT MAKE ANY COMMITS TO sys/boot. > > > > BACK OFF. > > > > Seriously, though, extra changes create extra friction, and these changes > > aren't worth any friction at all. I'm deleting LIBSAU and this > guarantees a > > conflict when I update. > > > > So please, do not make any edits to sys/boot whatsoever, no matter how > > trivial. > > > > At least until I'm done. > > > > Thanks. > > Umm, I know you are working on sys/boot but I never saw any mail or headsup > claiming a lock on that part of the tree. It would be a reasonable > assumption > for someone based on the public commits that you had finished a milestone > for > now. I only knew about you wanting to remove LIBSAU via a private reply > you > sent to my earlier mail, but there was no public mention that you have more > work. To that end I think this mail was a bit harsh. > The specific issue was that several people had made suggestions in this area, some of which were conflicting, and I was mulling over what the right thing to commit was. They were made to me, but in a public forum, in response to my original commit. Since I had other changes in flight, I wasn't sure the right way to roll them in. Then with no warning or heads up, the issue was forced by ngie committing changes to something that I'd just touched without even so much as a heads up. And it didn't help that the friction this created wasted 10 minutes of my time dealing with git svn rebase tripping over 3 or 4 commits in my queue. So I was harsh. Perhaps a bit too harsh and too public, but this wasn't a first offense. I'll try to moderate that in the future. Warner From owner-svn-src-head@freebsd.org Wed Oct 11 19:26:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF5F5E34D0E; Wed, 11 Oct 2017 19:26:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 904D074150; Wed, 11 Oct 2017 19:26:40 +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 v9BJQdq2041827; Wed, 11 Oct 2017 19:26:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BJQdNa041824; Wed, 11 Oct 2017 19:26:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710111926.v9BJQdNa041824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 11 Oct 2017 19:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324536 - head/contrib/llvm/projects/libunwind/src X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/projects/libunwind/src X-SVN-Commit-Revision: 324536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 19:26:40 -0000 Author: emaste Date: Wed Oct 11 19:26:39 2017 New Revision: 324536 URL: https://svnweb.freebsd.org/changeset/base/324536 Log: libunwind: use upstream patch to disable executable stacks arm uses '@' as a comment character, and cannot use @progbits in the .section directive. Apply the upstream noexec stach change which avoids this issue. Obtained from: LLVM r277868 Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S head/contrib/llvm/projects/libunwind/src/assembly.h Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Wed Oct 11 18:25:05 2017 (r324535) +++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Wed Oct 11 19:26:39 2017 (r324536) @@ -528,4 +528,5 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind15Regis #endif - .section .note.GNU-stack,"",@progbits +NO_EXEC_STACK_DIRECTIVE + Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Wed Oct 11 18:25:05 2017 (r324535) +++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Wed Oct 11 19:26:39 2017 (r324536) @@ -470,4 +470,5 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) #endif - .section .note.GNU-stack,"",@progbits +NO_EXEC_STACK_DIRECTIVE + Modified: head/contrib/llvm/projects/libunwind/src/assembly.h ============================================================================== --- head/contrib/llvm/projects/libunwind/src/assembly.h Wed Oct 11 18:25:05 2017 (r324535) +++ head/contrib/llvm/projects/libunwind/src/assembly.h Wed Oct 11 19:26:39 2017 (r324536) @@ -35,19 +35,34 @@ #define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name) #if defined(__APPLE__) + #define SYMBOL_IS_FUNC(name) +#define NO_EXEC_STACK_DIRECTIVE + #elif defined(__ELF__) + #if defined(__arm__) #define SYMBOL_IS_FUNC(name) .type name,%function #else #define SYMBOL_IS_FUNC(name) .type name,@function #endif + +#if defined(__GNU__) || defined(__ANDROID__) || defined(__FreeBSD__) +#define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits #else +#define NO_EXEC_STACK_DIRECTIVE +#endif + +#else + #define SYMBOL_IS_FUNC(name) \ .def name SEPARATOR \ .scl 2 SEPARATOR \ .type 32 SEPARATOR \ .endef + +#define NO_EXEC_STACK_DIRECTIVE + #endif #define DEFINE_LIBUNWIND_FUNCTION(name) \ From owner-svn-src-head@freebsd.org Wed Oct 11 20:04:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F460E35E30; Wed, 11 Oct 2017 20:04:32 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2B697650D; Wed, 11 Oct 2017 20:04: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 v9BK4VJZ060403; Wed, 11 Oct 2017 20:04:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BK4VVR060402; Wed, 11 Oct 2017 20:04:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201710112004.v9BK4VVR060402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 11 Oct 2017 20:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324537 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 324537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 20:04:32 -0000 Author: cem Date: Wed Oct 11 20:04:30 2017 New Revision: 324537 URL: https://svnweb.freebsd.org/changeset/base/324537 Log: crypto(9): Print flags in more useful hex Sponsored by: Dell EMC Isilon Modified: head/sys/opencrypto/crypto.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Wed Oct 11 19:26:39 2017 (r324536) +++ head/sys/opencrypto/crypto.c Wed Oct 11 20:04:30 2017 (r324537) @@ -572,7 +572,7 @@ crypto_get_driverid(device_t dev, int flags) crypto_drivers[i].cc_dev = dev; crypto_drivers[i].cc_flags = flags; if (bootverbose) - printf("crypto: assign %s driver id %u, flags %u\n", + printf("crypto: assign %s driver id %u, flags 0x%x\n", device_get_nameunit(dev), i, flags); CRYPTO_DRIVER_UNLOCK(); From owner-svn-src-head@freebsd.org Wed Oct 11 20:22:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05A52E362D0; Wed, 11 Oct 2017 20:22:03 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B540F76C8B; Wed, 11 Oct 2017 20:22:02 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BKM1DR068887; Wed, 11 Oct 2017 20:22:01 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BKM1g2068880; Wed, 11 Oct 2017 20:22:01 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201710112022.v9BKM1g2068880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 11 Oct 2017 20:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324538 - head/sys/dev/qlxgbe X-SVN-Group: head X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: head/sys/dev/qlxgbe X-SVN-Commit-Revision: 324538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 20:22:03 -0000 Author: davidcs Date: Wed Oct 11 20:22:01 2017 New Revision: 324538 URL: https://svnweb.freebsd.org/changeset/base/324538 Log: Added support driver state capture/retrieval MFC after:5 days Modified: head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_ioctl.h head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_def.h ============================================================================== --- head/sys/dev/qlxgbe/ql_def.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_def.h Wed Oct 11 20:22:01 2017 (r324538) @@ -201,7 +201,6 @@ struct qla_host { qla_rx_buf_t *rxb_free; uint32_t rxb_free_count; - volatile uint32_t posting; /* stats */ uint32_t err_m_getcl; Modified: head/sys/dev/qlxgbe/ql_glbl.h ============================================================================== --- head/sys/dev/qlxgbe/ql_glbl.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_glbl.h Wed Oct 11 20:22:01 2017 (r324538) @@ -112,4 +112,8 @@ extern unsigned int ql83xx_resetseq_len; extern unsigned char ql83xx_minidump[]; extern unsigned int ql83xx_minidump_len; +extern void ql_alloc_drvr_state_buffer(qla_host_t *ha); +extern void ql_free_drvr_state_buffer(qla_host_t *ha); +extern void ql_capture_drvr_state(qla_host_t *ha); + #endif /* #ifndef_QL_GLBL_H_ */ Modified: head/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_hw.h Wed Oct 11 20:22:01 2017 (r324538) @@ -1703,6 +1703,9 @@ typedef struct _qla_hw { uint32_t mdump_buffer_size; void *mdump_template; uint32_t mdump_template_size; + + /* driver state related */ + void *drvr_state; } qla_hw_t; #define QL_UPDATE_RDS_PRODUCER_INDEX(ha, prod_reg, val) \ Modified: head/sys/dev/qlxgbe/ql_ioctl.c ============================================================================== --- head/sys/dev/qlxgbe/ql_ioctl.c Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_ioctl.c Wed Oct 11 20:22:01 2017 (r324538) @@ -39,7 +39,11 @@ __FBSDID("$FreeBSD$"); #include "ql_inline.h" #include "ql_glbl.h" #include "ql_ioctl.h" +#include "ql_ver.h" +#include "ql_dbg.h" +static int ql_drvr_state(qla_host_t *ha, qla_driver_state_t *drvr_state); +static uint32_t ql_drvr_state_size(qla_host_t *ha); static int ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td); @@ -279,6 +283,10 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, rval = ENXIO; break; + case QLA_RD_DRVR_STATE: + rval = ql_drvr_state(ha, (qla_driver_state_t *)data); + break; + case QLA_RD_PCI_IDS: pci_ids = (qla_rd_pci_ids_t *)data; pci_ids->ven_id = pci_get_vendor(pci_dev); @@ -293,5 +301,225 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } return rval; +} + + +static int +ql_drvr_state(qla_host_t *ha, qla_driver_state_t *state) +{ + int rval = 0; + uint32_t drvr_state_size; + qla_drvr_state_hdr_t *hdr; + + drvr_state_size = ql_drvr_state_size(ha); + + if (state->buffer == NULL) { + state->size = drvr_state_size; + return (0); + } + + if (state->size < drvr_state_size) + return (ENXIO); + + if (ha->hw.drvr_state == NULL) + return (ENOMEM); + + hdr = ha->hw.drvr_state; + + if (!hdr->drvr_version_major) + ql_capture_drvr_state(ha); + + rval = copyout(ha->hw.drvr_state, state->buffer, drvr_state_size); + + bzero(ha->hw.drvr_state, drvr_state_size); + + return (rval); +} + +static uint32_t +ql_drvr_state_size(qla_host_t *ha) +{ + uint32_t drvr_state_size; + uint32_t size; + + size = sizeof (qla_drvr_state_hdr_t); + drvr_state_size = QL_ALIGN(size, 64); + + size = ha->hw.num_tx_rings * (sizeof (qla_drvr_state_tx_t)); + drvr_state_size += QL_ALIGN(size, 64); + + size = ha->hw.num_rds_rings * (sizeof (qla_drvr_state_rx_t)); + drvr_state_size += QL_ALIGN(size, 64); + + size = ha->hw.num_sds_rings * (sizeof (qla_drvr_state_sds_t)); + drvr_state_size += QL_ALIGN(size, 64); + + size = sizeof(q80_tx_cmd_t) * NUM_TX_DESCRIPTORS * ha->hw.num_tx_rings; + drvr_state_size += QL_ALIGN(size, 64); + + size = sizeof(q80_recv_desc_t) * NUM_RX_DESCRIPTORS * ha->hw.num_rds_rings; + drvr_state_size += QL_ALIGN(size, 64); + + size = sizeof(q80_stat_desc_t) * NUM_STATUS_DESCRIPTORS * + ha->hw.num_sds_rings; + drvr_state_size += QL_ALIGN(size, 64); + + return (drvr_state_size); +} + +static void +ql_get_tx_state(qla_host_t *ha, qla_drvr_state_tx_t *tx_state) +{ + int i; + + for (i = 0; i < ha->hw.num_tx_rings; i++) { + tx_state->base_p_addr = ha->hw.tx_cntxt[i].tx_ring_paddr; + tx_state->cons_p_addr = ha->hw.tx_cntxt[i].tx_cons_paddr; + tx_state->tx_prod_reg = ha->hw.tx_cntxt[i].tx_prod_reg; + tx_state->tx_cntxt_id = ha->hw.tx_cntxt[i].tx_cntxt_id; + tx_state->txr_free = ha->hw.tx_cntxt[i].txr_free; + tx_state->txr_next = ha->hw.tx_cntxt[i].txr_next; + tx_state->txr_comp = ha->hw.tx_cntxt[i].txr_comp; + tx_state++; + } + return; +} + +static void +ql_get_rx_state(qla_host_t *ha, qla_drvr_state_rx_t *rx_state) +{ + int i; + + for (i = 0; i < ha->hw.num_rds_rings; i++) { + rx_state->prod_std = ha->hw.rds[i].prod_std; + rx_state->rx_next = ha->hw.rds[i].rx_next; + rx_state++; + } + return; +} + +static void +ql_get_sds_state(qla_host_t *ha, qla_drvr_state_sds_t *sds_state) +{ + int i; + + for (i = 0; i < ha->hw.num_sds_rings; i++) { + sds_state->sdsr_next = ha->hw.sds[i].sdsr_next; + sds_state->sds_consumer = ha->hw.sds[i].sds_consumer; + sds_state++; + } + return; +} + +void +ql_capture_drvr_state(qla_host_t *ha) +{ + uint8_t *state_buffer; + uint8_t *ptr; + uint32_t drvr_state_size; + qla_drvr_state_hdr_t *hdr; + uint32_t size; + int i; + + drvr_state_size = ql_drvr_state_size(ha); + + state_buffer = ha->hw.drvr_state; + + if (state_buffer == NULL) + return; + + bzero(state_buffer, drvr_state_size); + + hdr = (qla_drvr_state_hdr_t *)state_buffer; + + hdr->drvr_version_major = QLA_VERSION_MAJOR; + hdr->drvr_version_minor = QLA_VERSION_MINOR; + hdr->drvr_version_build = QLA_VERSION_BUILD; + + bcopy(ha->hw.mac_addr, hdr->mac_addr, ETHER_ADDR_LEN); + + hdr->link_speed = ha->hw.link_speed; + hdr->cable_length = ha->hw.cable_length; + hdr->cable_oui = ha->hw.cable_oui; + hdr->link_up = ha->hw.link_up; + hdr->module_type = ha->hw.module_type; + hdr->link_faults = ha->hw.link_faults; + hdr->rcv_intr_coalesce = ha->hw.rcv_intr_coalesce; + hdr->xmt_intr_coalesce = ha->hw.xmt_intr_coalesce; + + size = sizeof (qla_drvr_state_hdr_t); + hdr->tx_state_offset = QL_ALIGN(size, 64); + + ptr = state_buffer + hdr->tx_state_offset; + + ql_get_tx_state(ha, (qla_drvr_state_tx_t *)ptr); + + size = ha->hw.num_tx_rings * (sizeof (qla_drvr_state_tx_t)); + hdr->rx_state_offset = hdr->tx_state_offset + QL_ALIGN(size, 64); + ptr = state_buffer + hdr->rx_state_offset; + + ql_get_rx_state(ha, (qla_drvr_state_rx_t *)ptr); + + size = ha->hw.num_rds_rings * (sizeof (qla_drvr_state_rx_t)); + hdr->sds_state_offset = hdr->rx_state_offset + QL_ALIGN(size, 64); + ptr = state_buffer + hdr->sds_state_offset; + + ql_get_sds_state(ha, (qla_drvr_state_sds_t *)ptr); + + size = ha->hw.num_sds_rings * (sizeof (qla_drvr_state_sds_t)); + hdr->txr_offset = hdr->sds_state_offset + QL_ALIGN(size, 64); + ptr = state_buffer + hdr->txr_offset; + + hdr->num_tx_rings = ha->hw.num_tx_rings; + hdr->txr_size = sizeof(q80_tx_cmd_t) * NUM_TX_DESCRIPTORS; + hdr->txr_entries = NUM_TX_DESCRIPTORS; + + size = hdr->num_tx_rings * hdr->txr_size; + bcopy(ha->hw.dma_buf.tx_ring.dma_b, ptr, size); + + hdr->rxr_offset = hdr->txr_offset + QL_ALIGN(size, 64); + ptr = state_buffer + hdr->rxr_offset; + + hdr->rxr_size = sizeof(q80_recv_desc_t) * NUM_RX_DESCRIPTORS; + hdr->rxr_entries = NUM_RX_DESCRIPTORS; + hdr->num_rx_rings = ha->hw.num_rds_rings; + + for (i = 0; i < ha->hw.num_rds_rings; i++) { + bcopy(ha->hw.dma_buf.rds_ring[i].dma_b, ptr, hdr->rxr_size); + ptr += hdr->rxr_size; + } + + size = hdr->rxr_size * hdr->num_rx_rings; + hdr->sds_offset = hdr->rxr_offset + QL_ALIGN(size, 64); + hdr->sds_ring_size = sizeof(q80_stat_desc_t) * NUM_STATUS_DESCRIPTORS; + hdr->sds_entries = NUM_STATUS_DESCRIPTORS; + hdr->num_sds_rings = ha->hw.num_sds_rings; + + ptr = state_buffer + hdr->sds_offset; + for (i = 0; i < ha->hw.num_sds_rings; i++) { + bcopy(ha->hw.dma_buf.sds_ring[i].dma_b, ptr, hdr->sds_ring_size); + ptr += hdr->sds_ring_size; + } + return; +} + +void +ql_alloc_drvr_state_buffer(qla_host_t *ha) +{ + uint32_t drvr_state_size; + + drvr_state_size = ql_drvr_state_size(ha); + + ha->hw.drvr_state = malloc(drvr_state_size, M_QLA83XXBUF, M_NOWAIT); + + return; +} + +void +ql_free_drvr_state_buffer(qla_host_t *ha) +{ + if (ha->hw.drvr_state != NULL) + free(ha->hw.drvr_state, M_QLA83XXBUF); + return; } Modified: head/sys/dev/qlxgbe/ql_ioctl.h ============================================================================== --- head/sys/dev/qlxgbe/ql_ioctl.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_ioctl.h Wed Oct 11 20:22:01 2017 (r324538) @@ -93,6 +93,72 @@ struct qla_rd_fw_dump { }; typedef struct qla_rd_fw_dump qla_rd_fw_dump_t; +struct qla_drvr_state_tx { + uint64_t base_p_addr; + uint64_t cons_p_addr; + uint32_t tx_prod_reg; + uint32_t tx_cntxt_id; + uint32_t txr_free; + uint32_t txr_next; + uint32_t txr_comp; +}; +typedef struct qla_drvr_state_tx qla_drvr_state_tx_t; + +struct qla_drvr_state_sds { + uint32_t sdsr_next; /* next entry in SDS ring to process */ + uint32_t sds_consumer; +}; +typedef struct qla_drvr_state_sds qla_drvr_state_sds_t; + +struct qla_drvr_state_rx { + uint32_t prod_std; + uint32_t rx_next; /* next standard rcv ring to arm fw */; +}; +typedef struct qla_drvr_state_rx qla_drvr_state_rx_t; + +struct qla_drvr_state_hdr { + uint32_t drvr_version_major; + uint32_t drvr_version_minor; + uint32_t drvr_version_build; + + uint8_t mac_addr[ETHER_ADDR_LEN]; + uint16_t link_speed; + uint16_t cable_length; + uint32_t cable_oui; + uint8_t link_up; + uint8_t module_type; + uint8_t link_faults; + uint32_t rcv_intr_coalesce; + uint32_t xmt_intr_coalesce; + + uint32_t tx_state_offset;/* size = sizeof (qla_drvr_state_tx_t) * num_tx_rings */ + uint32_t rx_state_offset;/* size = sizeof (qla_drvr_state_rx_t) * num_rx_rings */ + uint32_t sds_state_offset;/* size = sizeof (qla_drvr_state_sds_t) * num_sds_rings */ + + uint32_t num_tx_rings; /* number of tx rings */ + uint32_t txr_size; /* size of each tx ring in bytes */ + uint32_t txr_entries; /* number of descriptors in each tx ring */ + uint32_t txr_offset; /* start of tx ring [0 - #rings] content */ + + uint32_t num_rx_rings; /* number of rx rings */ + uint32_t rxr_size; /* size of each rx ring in bytes */ + uint32_t rxr_entries; /* number of descriptors in each rx ring */ + uint32_t rxr_offset; /* start of rx ring [0 - #rings] content */ + + uint32_t num_sds_rings; /* number of sds rings */ + uint32_t sds_ring_size; /* size of each sds ring in bytes */ + uint32_t sds_entries; /* number of descriptors in each sds ring */ + uint32_t sds_offset; /* start of sds ring [0 - #rings] content */ +}; + +typedef struct qla_drvr_state_hdr qla_drvr_state_hdr_t; + +struct qla_driver_state { + uint32_t size; + void *buffer; +}; +typedef struct qla_driver_state qla_driver_state_t; + /* * Read/Write Register */ @@ -132,5 +198,11 @@ typedef struct qla_rd_fw_dump qla_rd_fw_dump_t; * Read Minidump Template */ #define QLA_RD_FW_DUMP _IOWR('q', 8, qla_rd_fw_dump_t) + +/* + * Read Driver State + */ +#define QLA_RD_DRVR_STATE _IOWR('q', 9, qla_driver_state_t) + #endif /* #ifndef _QL_IOCTL_H_ */ Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_os.c Wed Oct 11 20:22:01 2017 (r324538) @@ -492,6 +492,7 @@ qla_pci_attach(device_t dev) device_printf(dev, "%s: ql_minidump_init failed\n", __func__); goto qla_pci_attach_err; } + ql_alloc_drvr_state_buffer(ha); /* create the o.s ethernet interface */ qla_init_ifnet(dev, ha); @@ -645,6 +646,7 @@ qla_release(qla_host_t *ha) if (ha->ifp != NULL) ether_ifdetach(ha->ifp); + ql_free_drvr_state_buffer(ha); ql_free_dma(ha); qla_free_parent_dma_tag(ha); Modified: head/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- head/sys/dev/qlxgbe/ql_ver.h Wed Oct 11 20:04:30 2017 (r324537) +++ head/sys/dev/qlxgbe/ql_ver.h Wed Oct 11 20:22:01 2017 (r324538) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 34 +#define QLA_VERSION_BUILD 35 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-head@freebsd.org Wed Oct 11 20:36:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D66CDE36907; Wed, 11 Oct 2017 20:36:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B27B47732F; Wed, 11 Oct 2017 20:36:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BKa9NC073118; Wed, 11 Oct 2017 20:36:09 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BKa9hE073113; Wed, 11 Oct 2017 20:36:09 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710112036.v9BKa9hE073113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 11 Oct 2017 20:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324539 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 324539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 20:36:11 -0000 Author: glebius Date: Wed Oct 11 20:36:09 2017 New Revision: 324539 URL: https://svnweb.freebsd.org/changeset/base/324539 Log: Declare more TCP globals in tcp_var.h, so that alternative TCP stacks can use them. Gather all TCP tunables in tcp_var.h in one place and alphabetically sort them, to ease maintainance of the list. Don't copy and paste declarations in tcp_stacks/fastpath.c. Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_input.c Wed Oct 11 20:36:09 2017 (r324539) @@ -145,7 +145,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, delayed_ack, CTLFL "Delay ACK to try and piggyback it onto a data packet"); VNET_DEFINE(int, drop_synfin) = 0; -#define V_drop_synfin VNET(drop_synfin) SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(drop_synfin), 0, "Drop TCP packets with SYN+FIN set"); @@ -156,7 +155,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc6675_pipe, CTLF "Use calculated pipe/in-flight bytes per RFC 6675"); VNET_DEFINE(int, tcp_do_rfc3042) = 1; -#define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3042), 0, "Enable RFC 3042 (Limited Transmit)"); @@ -194,13 +192,11 @@ SYSCTL_INT(_net_inet_tcp_ecn, OID_AUTO, maxretries, CT "Max retries before giving up on ECN"); VNET_DEFINE(int, tcp_insecure_syn) = 0; -#define V_tcp_insecure_syn VNET(tcp_insecure_syn) SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_syn, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_insecure_syn), 0, "Follow RFC793 instead of RFC5961 criteria for accepting SYN packets"); VNET_DEFINE(int, tcp_insecure_rst) = 0; -#define V_tcp_insecure_rst VNET(tcp_insecure_rst) SYSCTL_INT(_net_inet_tcp, OID_AUTO, insecure_rst, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_insecure_rst), 0, "Follow RFC793 instead of RFC5961 criteria for accepting RST packets"); @@ -211,19 +207,16 @@ SYSCTL_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"); VNET_DEFINE(int, tcp_do_autorcvbuf) = 1; -#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_autorcvbuf), 0, "Enable automatic receive buffer sizing"); VNET_DEFINE(int, tcp_autorcvbuf_inc) = 16*1024; -#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_inc, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_inc), 0, "Incrementor step size of automatic receive buffer"); VNET_DEFINE(int, tcp_autorcvbuf_max) = 2*1024*1024; -#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) SYSCTL_INT(_net_inet_tcp, OID_AUTO, recvbuf_max, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autorcvbuf_max), 0, "Max size of automatic receive buffer"); Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_output.c Wed Oct 11 20:36:09 2017 (r324539) @@ -102,7 +102,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, path_mtu_discovery "Enable Path MTU Discovery"); VNET_DEFINE(int, tcp_do_tso) = 1; -#define V_tcp_do_tso VNET(tcp_do_tso) SYSCTL_INT(_net_inet_tcp, OID_AUTO, tso, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_tso), 0, "Enable TCP Segmentation Offload"); @@ -113,19 +112,16 @@ SYSCTL_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace, &VNET_NAME(tcp_sendspace), 0, "Initial send socket buffer size"); VNET_DEFINE(int, tcp_do_autosndbuf) = 1; -#define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_do_autosndbuf), 0, "Enable automatic send buffer sizing"); VNET_DEFINE(int, tcp_autosndbuf_inc) = 8*1024; -#define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_inc, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_inc), 0, "Incrementor step size of automatic send buffer"); VNET_DEFINE(int, tcp_autosndbuf_max) = 2*1024*1024; -#define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_autosndbuf_max), 0, "Max size of automatic send buffer"); Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_sack.c Wed Oct 11 20:36:09 2017 (r324539) @@ -133,19 +133,16 @@ SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, enable, CTLFL &VNET_NAME(tcp_do_sack), 0, "Enable/Disable TCP SACK support"); VNET_DEFINE(int, tcp_sack_maxholes) = 128; -#define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, maxholes, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_sack_maxholes), 0, "Maximum number of TCP SACK holes allowed per connection"); VNET_DEFINE(int, tcp_sack_globalmaxholes) = 65536; -#define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, globalmaxholes, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_sack_globalmaxholes), 0, "Global maximum number of TCP SACK holes"); VNET_DEFINE(int, tcp_sack_globalholes) = 0; -#define V_tcp_sack_globalholes VNET(tcp_sack_globalholes) SYSCTL_INT(_net_inet_tcp_sack, OID_AUTO, globalholes, CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(tcp_sack_globalholes), 0, "Global number of TCP SACK holes currently allocated"); Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_stacks/fastpath.c Wed Oct 11 20:36:09 2017 (r324539) @@ -120,21 +120,6 @@ __FBSDID("$FreeBSD$"); #include -VNET_DECLARE(int, tcp_autorcvbuf_inc); -#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) -VNET_DECLARE(int, tcp_autorcvbuf_max); -#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -VNET_DECLARE(int, tcp_do_rfc3042); -#define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) -VNET_DECLARE(int, tcp_do_autorcvbuf); -#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) -VNET_DECLARE(int, tcp_insecure_rst); -#define V_tcp_insecure_rst VNET(tcp_insecure_rst) -VNET_DECLARE(int, tcp_insecure_syn); -#define V_tcp_insecure_syn VNET(tcp_insecure_syn) -VNET_DECLARE(int, drop_synfin); -#define V_drop_synfin VNET(drop_synfin) - static void tcp_do_segment_fastslow(struct mbuf *, struct tcphdr *, struct socket *, struct tcpcb *, int, int, uint8_t, int); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Oct 11 20:22:01 2017 (r324538) +++ head/sys/netinet/tcp_var.h Wed Oct 11 20:36:09 2017 (r324539) @@ -201,12 +201,6 @@ struct tcpcb { #endif /* _KERNEL || _WANT_TCPCB */ #ifdef _KERNEL -/* - * Kernel variables for tcp. - */ -VNET_DECLARE(int, tcp_do_rfc1323); -#define V_tcp_do_rfc1323 VNET(tcp_do_rfc1323) - struct tcptemp { u_char tt_ipgen[40]; /* the size must be of max ip header, now IPv6 */ struct tcphdr tt_t; @@ -701,49 +695,82 @@ SYSCTL_DECL(_net_inet_tcp_sack); MALLOC_DECLARE(M_TCPLOG); #endif -VNET_DECLARE(struct inpcbhead, tcb); /* queue of active tcpcb's */ -VNET_DECLARE(struct inpcbinfo, tcbinfo); extern int tcp_log_in_vain; -VNET_DECLARE(int, tcp_mssdflt); /* XXX */ -VNET_DECLARE(int, tcp_minmss); + +/* + * Global TCP tunables shared between different stacks. + * Please keep the list sorted. + */ +VNET_DECLARE(int, drop_synfin); +VNET_DECLARE(int, path_mtu_discovery); +VNET_DECLARE(int, tcp_abc_l_var); +VNET_DECLARE(int, tcp_autorcvbuf_inc); +VNET_DECLARE(int, tcp_autorcvbuf_max); +VNET_DECLARE(int, tcp_autosndbuf_inc); +VNET_DECLARE(int, tcp_autosndbuf_max); VNET_DECLARE(int, tcp_delack_enabled); +VNET_DECLARE(int, tcp_do_autorcvbuf); +VNET_DECLARE(int, tcp_do_autosndbuf); +VNET_DECLARE(int, tcp_do_ecn); +VNET_DECLARE(int, tcp_do_rfc1323); +VNET_DECLARE(int, tcp_do_rfc3042); VNET_DECLARE(int, tcp_do_rfc3390); +VNET_DECLARE(int, tcp_do_rfc3465); +VNET_DECLARE(int, tcp_do_rfc6675_pipe); +VNET_DECLARE(int, tcp_do_sack); +VNET_DECLARE(int, tcp_do_tso); +VNET_DECLARE(int, tcp_ecn_maxretries); VNET_DECLARE(int, tcp_initcwnd_segments); -VNET_DECLARE(int, tcp_sendspace); +VNET_DECLARE(int, tcp_insecure_rst); +VNET_DECLARE(int, tcp_insecure_syn); +VNET_DECLARE(int, tcp_minmss); +VNET_DECLARE(int, tcp_mssdflt); VNET_DECLARE(int, tcp_recvspace); -VNET_DECLARE(int, path_mtu_discovery); -VNET_DECLARE(int, tcp_do_rfc3465); -VNET_DECLARE(int, tcp_abc_l_var); -#define V_tcb VNET(tcb) -#define V_tcbinfo VNET(tcbinfo) -#define V_tcp_mssdflt VNET(tcp_mssdflt) -#define V_tcp_minmss VNET(tcp_minmss) -#define V_tcp_delack_enabled VNET(tcp_delack_enabled) -#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) -#define V_tcp_initcwnd_segments VNET(tcp_initcwnd_segments) -#define V_tcp_sendspace VNET(tcp_sendspace) -#define V_tcp_recvspace VNET(tcp_recvspace) -#define V_path_mtu_discovery VNET(path_mtu_discovery) -#define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) -#define V_tcp_abc_l_var VNET(tcp_abc_l_var) +VNET_DECLARE(int, tcp_sack_globalholes); +VNET_DECLARE(int, tcp_sack_globalmaxholes); +VNET_DECLARE(int, tcp_sack_maxholes); +VNET_DECLARE(int, tcp_sc_rst_sock_fail); +VNET_DECLARE(int, tcp_sendspace); +VNET_DECLARE(struct inpcbhead, tcb); +VNET_DECLARE(struct inpcbinfo, tcbinfo); -VNET_DECLARE(int, tcp_do_sack); /* SACK enabled/disabled */ -VNET_DECLARE(int, tcp_sc_rst_sock_fail); /* RST on sock alloc failure */ -#define V_tcp_do_sack VNET(tcp_do_sack) -#define V_tcp_sc_rst_sock_fail VNET(tcp_sc_rst_sock_fail) +#define V_drop_synfin VNET(drop_synfin) +#define V_path_mtu_discovery VNET(path_mtu_discovery) +#define V_tcb VNET(tcb) +#define V_tcbinfo VNET(tcbinfo) +#define V_tcp_abc_l_var VNET(tcp_abc_l_var) +#define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) +#define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) +#define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) +#define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) +#define V_tcp_delack_enabled VNET(tcp_delack_enabled) +#define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) +#define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) +#define V_tcp_do_ecn VNET(tcp_do_ecn) +#define V_tcp_do_rfc1323 VNET(tcp_do_rfc1323) +#define V_tcp_do_rfc3042 VNET(tcp_do_rfc3042) +#define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) +#define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) +#define V_tcp_do_rfc6675_pipe VNET(tcp_do_rfc6675_pipe) +#define V_tcp_do_sack VNET(tcp_do_sack) +#define V_tcp_do_tso VNET(tcp_do_tso) +#define V_tcp_ecn_maxretries VNET(tcp_ecn_maxretries) +#define V_tcp_initcwnd_segments VNET(tcp_initcwnd_segments) +#define V_tcp_insecure_rst VNET(tcp_insecure_rst) +#define V_tcp_insecure_syn VNET(tcp_insecure_syn) +#define V_tcp_minmss VNET(tcp_minmss) +#define V_tcp_mssdflt VNET(tcp_mssdflt) +#define V_tcp_recvspace VNET(tcp_recvspace) +#define V_tcp_sack_globalholes VNET(tcp_sack_globalholes) +#define V_tcp_sack_globalmaxholes VNET(tcp_sack_globalmaxholes) +#define V_tcp_sack_maxholes VNET(tcp_sack_maxholes) +#define V_tcp_sc_rst_sock_fail VNET(tcp_sc_rst_sock_fail) +#define V_tcp_sendspace VNET(tcp_sendspace) -VNET_DECLARE(int, tcp_do_ecn); /* TCP ECN enabled/disabled */ -VNET_DECLARE(int, tcp_ecn_maxretries); -#define V_tcp_do_ecn VNET(tcp_do_ecn) -#define V_tcp_ecn_maxretries VNET(tcp_ecn_maxretries) - #ifdef TCP_HHOOK VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]); #define V_tcp_hhh VNET(tcp_hhh) #endif - -VNET_DECLARE(int, tcp_do_rfc6675_pipe); -#define V_tcp_do_rfc6675_pipe VNET(tcp_do_rfc6675_pipe) int tcp_addoptions(struct tcpopt *, u_char *); int tcp_ccalgounload(struct cc_algo *unload_algo); From owner-svn-src-head@freebsd.org Wed Oct 11 21:53:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 418AEE38390; Wed, 11 Oct 2017 21:53:52 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C31F7E3CC; Wed, 11 Oct 2017 21:53:52 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BLrpsv007327; Wed, 11 Oct 2017 21:53:51 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BLroeR007323; Wed, 11 Oct 2017 21:53:50 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201710112153.v9BLroeR007323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Wed, 11 Oct 2017 21:53:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 324541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 21:53:52 -0000 Author: mjoras Date: Wed Oct 11 21:53:50 2017 New Revision: 324541 URL: https://svnweb.freebsd.org/changeset/base/324541 Log: Add clearing function for unr(9). Previously before you could call unrhdr_delete you needed to individually free every allocated unit. It is useful to be able to tear down the unr without having to go through this process, as it is significantly faster than freeing the individual units. Reviewed by: cem, lidl Approved by: rstone (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12591 Modified: head/share/man/man9/Makefile head/share/man/man9/unr.9 head/sys/kern/subr_unit.c head/sys/sys/systm.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Oct 11 20:36:22 2017 (r324540) +++ head/share/man/man9/Makefile Wed Oct 11 21:53:50 2017 (r324541) @@ -414,6 +414,7 @@ MAN= accept_filter.9 \ MLINKS= unr.9 alloc_unr.9 \ unr.9 alloc_unrl.9 \ unr.9 alloc_unr_specific.9 \ + unr.9 clear_unrhdr.9 \ unr.9 delete_unrhdr.9 \ unr.9 free_unr.9 \ unr.9 new_unrhdr.9 Modified: head/share/man/man9/unr.9 ============================================================================== --- head/share/man/man9/unr.9 Wed Oct 11 20:36:22 2017 (r324540) +++ head/share/man/man9/unr.9 Wed Oct 11 21:53:50 2017 (r324541) @@ -24,11 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd July 5, 2010 +.Dd October 4, 2017 .Dt UNR 9 .Os .Sh NAME .Nm new_unrhdr , +.Nm clear_unrhdr , .Nm delete_unrhdr , .Nm alloc_unr , .Nm alloc_unr_specific , @@ -39,6 +40,8 @@ .Ft "struct unrhdr *" .Fn new_unrhdr "int low" "int high" "struct mtx *mutex" .Ft void +.Fn clear_unrhdr "struct unrhdr *uh" +.Ft void .Fn delete_unrhdr "struct unrhdr *uh" .Ft int .Fn alloc_unr "struct unrhdr *uh" @@ -70,8 +73,16 @@ is not .Dv NULL , it is used for locking when allocating and freeing units. Otherwise, internal mutex is used. +.It Fn clear_unrhdr uh +Clear all units from the specified unit number allocator entity. +This function resets the entity as if it were just initialized with +.Fn new_unrhdr . .It Fn delete_unrhdr uh -Destroy specified unit number allocator entity. +Delete specified unit number allocator entity. +This function frees the memory associated with the entity, it does not free +any units. +To free all units use +.Fn clear_unrhdr . .It Fn alloc_unr uh Return a new unit number. The lowest free number is always allocated. Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017 (r324540) +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017 (r324541) @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh) Free(uh); } +void +clear_unrhdr(struct unrhdr *uh) +{ + struct unr *up, *uq; + + KASSERT(TAILQ_EMPTY(&uh->ppfree), + ("unrhdr has postponed item for free")); + up = TAILQ_FIRST(&uh->head); + while (up != NULL) { + uq = TAILQ_NEXT(up, list); + if (up->ptr != uh) { + Free(up->ptr); + } + Free(up); + up = uq; + } + TAILQ_INIT(&uh->head); + uh->busy = 0; + uh->alloc = 0; +} + static __inline int is_bitmap(struct unrhdr *uh, struct unr *up) { Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Oct 11 20:36:22 2017 (r324540) +++ head/sys/sys/systm.h Wed Oct 11 21:53:50 2017 (r324541) @@ -450,6 +450,7 @@ struct unrhdr; struct unrhdr *new_unrhdr(int low, int high, struct mtx *mutex); void init_unrhdr(struct unrhdr *uh, int low, int high, struct mtx *mutex); void delete_unrhdr(struct unrhdr *uh); +void clear_unrhdr(struct unrhdr *uh); void clean_unrhdr(struct unrhdr *uh); void clean_unrhdrl(struct unrhdr *uh); int alloc_unr(struct unrhdr *uh); From owner-svn-src-head@freebsd.org Wed Oct 11 21:53:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CD19E3839D; Wed, 11 Oct 2017 21:53:55 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D01BC7E3CD; Wed, 11 Oct 2017 21:53:54 +0000 (UTC) (envelope-from mjoras@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9BLrsS5007374; Wed, 11 Oct 2017 21:53:54 GMT (envelope-from mjoras@FreeBSD.org) Received: (from mjoras@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9BLrrID007371; Wed, 11 Oct 2017 21:53:53 GMT (envelope-from mjoras@FreeBSD.org) Message-Id: <201710112153.v9BLrrID007371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjoras set sender to mjoras@FreeBSD.org using -f From: Matt Joras Date: Wed, 11 Oct 2017 21:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324542 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: mjoras X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 324542 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Oct 2017 21:53:55 -0000 Author: mjoras Date: Wed Oct 11 21:53:53 2017 New Revision: 324542 URL: https://svnweb.freebsd.org/changeset/base/324542 Log: When unmounting a tmpfs, do not call free_unr. tmpfs uses unr(9) to allocate inodes. Previously when unmounting it would individually free the units when it freed each vnode. This is unnecessary as we can use the newly-added unrhdr_clear function to clear out the unr in onde go. This measurably reduces the time to unmount a tmpfs with many files. Reviewed by: cem, lidl Approved by: rstone (mentor) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D12591 Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Wed Oct 11 21:53:50 2017 (r324541) +++ head/sys/fs/tmpfs/tmpfs_subr.c Wed Oct 11 21:53:53 2017 (r324542) @@ -362,7 +362,13 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type); } - free_unr(tmp->tm_ino_unr, node->tn_id); + /* + * If we are unmounting there is no need for going through the overhead + * of freeing the inodes from the unr individually, so free them all in + * one go later. + */ + if (!detach) + free_unr(tmp->tm_ino_unr, node->tn_id); uma_zfree(tmp->tm_node_pool, node); TMPFS_LOCK(tmp); tmpfs_free_tmp(tmp); Modified: head/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vfsops.c Wed Oct 11 21:53:50 2017 (r324541) +++ head/sys/fs/tmpfs/tmpfs_vfsops.c Wed Oct 11 21:53:53 2017 (r324542) @@ -317,6 +317,8 @@ tmpfs_unmount(struct mount *mp, int mntflags) TMPFS_NODE_UNLOCK(node); } + clear_unrhdr(tmp->tm_ino_unr); + mp->mnt_data = NULL; tmpfs_free_tmp(tmp); vfs_write_resume(mp, VR_START_WRITE); From owner-svn-src-head@freebsd.org Thu Oct 12 13:59:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95EDE2A49D; Thu, 12 Oct 2017 13:59:24 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 771F87C132; Thu, 12 Oct 2017 13:59:24 +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 v9CDxNaB009479; Thu, 12 Oct 2017 13:59:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CDxN6X009478; Thu, 12 Oct 2017 13:59:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710121359.v9CDxN6X009478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 12 Oct 2017 13:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324547 - head/usr.bin/xinstall X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/usr.bin/xinstall X-SVN-Commit-Revision: 324547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 13:59:24 -0000 Author: mjg Date: Thu Oct 12 13:59:23 2017 New Revision: 324547 URL: https://svnweb.freebsd.org/changeset/base/324547 Log: xinstall: plug an infinite loop in directory creation If stat continues to fail with ENOENT and mkdir with EEXIST the code wont finish. In particular this can show up when the target path follows through a symlink to a non-existent directory. Reported by: ae MFC after: 1 week Modified: head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Thu Oct 12 08:27:57 2017 (r324546) +++ head/usr.bin/xinstall/xinstall.c Thu Oct 12 13:59:23 2017 (r324547) @@ -1292,17 +1292,19 @@ install_dir(char *path) { char *p; struct stat sb; - int ch; + int ch, tried_mkdir; for (p = path;; ++p) if (!*p || (p != path && *p == '/')) { + tried_mkdir = 0; ch = *p; *p = '\0'; again: if (stat(path, &sb) < 0) { - if (errno != ENOENT) + if (errno != ENOENT || tried_mkdir) err(EX_OSERR, "stat %s", path); if (mkdir(path, 0755) < 0) { + tried_mkdir = 1; if (errno == EEXIST) goto again; err(EX_OSERR, "mkdir %s", path); From owner-svn-src-head@freebsd.org Thu Oct 12 14:32:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5551E2B028; Thu, 12 Oct 2017 14:32:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A131D7D4F3; Thu, 12 Oct 2017 14:32:46 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEWjlI026148; Thu, 12 Oct 2017 14:32:45 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEWjCe026147; Thu, 12 Oct 2017 14:32:45 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201710121432.v9CEWjCe026147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 12 Oct 2017 14:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324549 - head/sys/arm/conf X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/arm/conf X-SVN-Commit-Revision: 324549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:32:47 -0000 Author: bz Date: Thu Oct 12 14:32:45 2017 New Revision: 324549 URL: https://svnweb.freebsd.org/changeset/base/324549 Log: Previously there was a VIRT kernel to which I had added these options. With that gone they need to go into GENERIC now. Makes FreeBSD/arm usable on gem5 by default. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D12566 Modified: head/sys/arm/conf/GENERIC Modified: head/sys/arm/conf/GENERIC ============================================================================== --- head/sys/arm/conf/GENERIC Thu Oct 12 14:08:55 2017 (r324548) +++ head/sys/arm/conf/GENERIC Thu Oct 12 14:32:45 2017 (r324549) @@ -99,6 +99,7 @@ device ahci # AHCI-compatible SATA controllers # PCI options NEW_PCIB device pci +device pci_host_generic # PCI NICs device re # RealTek 8139C+/8169/8169S/8110S @@ -106,6 +107,7 @@ device re # RealTek 8139C+/8169/8169S/8110S # VirtIO device virtio device virtio_mmio +device virtio_pci device virtio_blk device vtnet From owner-svn-src-head@freebsd.org Thu Oct 12 14:53:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70C15E2B94C; Thu, 12 Oct 2017 14:53:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8C27E0F2; Thu, 12 Oct 2017 14:53:26 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CErP6V034838; Thu, 12 Oct 2017 14:53:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CErPiV034836; Thu, 12 Oct 2017 14:53:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121453.v9CErPiV034836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:53:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324550 - head/lib/libstand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libstand X-SVN-Commit-Revision: 324550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:53:26 -0000 Author: imp Date: Thu Oct 12 14:53:25 2017 New Revision: 324550 URL: https://svnweb.freebsd.org/changeset/base/324550 Log: Add $FreeBSD$ to ancient sources that it's missing from. Sponsored by: Netflix Modified: head/lib/libstand/bootparam.h head/lib/libstand/tftp.h Modified: head/lib/libstand/bootparam.h ============================================================================== --- head/lib/libstand/bootparam.h Thu Oct 12 14:32:45 2017 (r324549) +++ head/lib/libstand/bootparam.h Thu Oct 12 14:53:25 2017 (r324550) @@ -1,4 +1,5 @@ /* $NetBSD: bootparam.h,v 1.3 1998/01/05 19:19:41 perry Exp $ */ +/* $FreeBSD$ */ int bp_whoami(int sock); int bp_getfile(int sock, char *key, struct in_addr *addrp, char *path); Modified: head/lib/libstand/tftp.h ============================================================================== --- head/lib/libstand/tftp.h Thu Oct 12 14:32:45 2017 (r324549) +++ head/lib/libstand/tftp.h Thu Oct 12 14:53:25 2017 (r324550) @@ -30,6 +30,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$ */ From owner-svn-src-head@freebsd.org Thu Oct 12 14:56:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6C9BE2BA13; Thu, 12 Oct 2017 14:56:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8058B7E295; Thu, 12 Oct 2017 14:56:37 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEuaaZ035102; Thu, 12 Oct 2017 14:56:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEuSRE035015; Thu, 12 Oct 2017 14:56:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121456.v9CEuSRE035015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324551 - in head: lib/libstand lib/libstand/amd64 lib/libstand/i386 lib/libstand/mips lib/libstand/powerpc lib/libstand/sparc64 sys/boot/libsa sys/boot/libsa/amd64 sys/boot/libsa/i386 ... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head: lib/libstand lib/libstand/amd64 lib/libstand/i386 lib/libstand/mips lib/libstand/powerpc lib/libstand/sparc64 sys/boot/libsa sys/boot/libsa/amd64 sys/boot/libsa/i386 sys/boot/libsa/mips sys/b... X-SVN-Commit-Revision: 324551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:56:37 -0000 Author: imp Date: Thu Oct 12 14:56:28 2017 New Revision: 324551 URL: https://svnweb.freebsd.org/changeset/base/324551 Log: Move lib/libstand to sys/boot/libsa Move the sources to sys/boot. Make adjustments related to the move. Kill LIBSTAND_SRC since it's no longer needed. Sponsored by: Netflix Added: head/sys/boot/libsa/Makefile.depend (contents, props changed) - copied, changed from r324550, head/lib/libstand/Makefile.depend head/sys/boot/libsa/__main.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/__main.c head/sys/boot/libsa/amd64/ head/sys/boot/libsa/amd64/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/amd64/_setjmp.S head/sys/boot/libsa/arp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/arp.c head/sys/boot/libsa/assert.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/assert.c head/sys/boot/libsa/bcd.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/bcd.c head/sys/boot/libsa/bootp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/bootp.c head/sys/boot/libsa/bootp.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/bootp.h head/sys/boot/libsa/bootparam.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/bootparam.c head/sys/boot/libsa/bootparam.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/bootparam.h head/sys/boot/libsa/bzipfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/bzipfs.c head/sys/boot/libsa/cd9660.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/cd9660.c head/sys/boot/libsa/close.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/close.c head/sys/boot/libsa/closeall.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/closeall.c head/sys/boot/libsa/dev.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/dev.c head/sys/boot/libsa/dosfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/dosfs.c head/sys/boot/libsa/dosfs.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/dosfs.h head/sys/boot/libsa/environment.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/environment.c head/sys/boot/libsa/ether.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ether.c head/sys/boot/libsa/ext2fs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ext2fs.c head/sys/boot/libsa/fstat.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/fstat.c head/sys/boot/libsa/getopt.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/getopt.c head/sys/boot/libsa/gets.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/gets.c head/sys/boot/libsa/globals.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/globals.c head/sys/boot/libsa/gzipfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/gzipfs.c head/sys/boot/libsa/i386/ head/sys/boot/libsa/i386/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/i386/_setjmp.S head/sys/boot/libsa/in_cksum.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/in_cksum.c head/sys/boot/libsa/inet_ntoa.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/inet_ntoa.c head/sys/boot/libsa/ioctl.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ioctl.c head/sys/boot/libsa/iodesc.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/iodesc.h head/sys/boot/libsa/ip.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ip.c head/sys/boot/libsa/libstand.3 (contents, props changed) - copied, changed from r324550, head/lib/libstand/libstand.3 head/sys/boot/libsa/lseek.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/lseek.c head/sys/boot/libsa/mips/ head/sys/boot/libsa/mips/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/mips/_setjmp.S head/sys/boot/libsa/nandfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/nandfs.c head/sys/boot/libsa/net.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/net.c head/sys/boot/libsa/net.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/net.h head/sys/boot/libsa/netif.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/netif.c head/sys/boot/libsa/netif.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/netif.h head/sys/boot/libsa/nfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/nfs.c head/sys/boot/libsa/nfsv2.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/nfsv2.h head/sys/boot/libsa/nullfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/nullfs.c head/sys/boot/libsa/open.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/open.c head/sys/boot/libsa/pager.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/pager.c head/sys/boot/libsa/pkgfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/pkgfs.c head/sys/boot/libsa/powerpc/ head/sys/boot/libsa/powerpc/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/powerpc/_setjmp.S head/sys/boot/libsa/powerpc/syncicache.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/powerpc/syncicache.c head/sys/boot/libsa/printf.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/printf.c head/sys/boot/libsa/qdivrem.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/qdivrem.c head/sys/boot/libsa/quad.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/quad.h head/sys/boot/libsa/random.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/random.c head/sys/boot/libsa/rarp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/rarp.c head/sys/boot/libsa/read.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/read.c head/sys/boot/libsa/readdir.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/readdir.c head/sys/boot/libsa/rpc.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/rpc.c head/sys/boot/libsa/rpc.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/rpc.h head/sys/boot/libsa/rpcv2.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/rpcv2.h head/sys/boot/libsa/saioctl.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/saioctl.h head/sys/boot/libsa/sbrk.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/sbrk.c head/sys/boot/libsa/sparc64/ head/sys/boot/libsa/sparc64/_setjmp.S (contents, props changed) - copied, changed from r324550, head/lib/libstand/sparc64/_setjmp.S head/sys/boot/libsa/splitfs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/splitfs.c head/sys/boot/libsa/stand.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/stand.h head/sys/boot/libsa/stat.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/stat.c head/sys/boot/libsa/strcasecmp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strcasecmp.c head/sys/boot/libsa/strdup.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strdup.c head/sys/boot/libsa/strerror.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strerror.c head/sys/boot/libsa/strtol.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strtol.c head/sys/boot/libsa/strtoul.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/strtoul.c head/sys/boot/libsa/tftp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/tftp.c head/sys/boot/libsa/tftp.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/tftp.h head/sys/boot/libsa/twiddle.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/twiddle.c head/sys/boot/libsa/udp.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/udp.c head/sys/boot/libsa/ufs.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/ufs.c head/sys/boot/libsa/uuid_from_string.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/uuid_from_string.c head/sys/boot/libsa/uuid_to_string.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/uuid_to_string.c head/sys/boot/libsa/write.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/write.c head/sys/boot/libsa/zalloc.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc.c head/sys/boot/libsa/zalloc_defs.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc_defs.h head/sys/boot/libsa/zalloc_malloc.c (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc_malloc.c head/sys/boot/libsa/zalloc_mem.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc_mem.h head/sys/boot/libsa/zalloc_protos.h (contents, props changed) - copied, changed from r324550, head/lib/libstand/zalloc_protos.h Deleted: head/lib/libstand/Makefile head/lib/libstand/Makefile.depend head/lib/libstand/__main.c head/lib/libstand/amd64/_setjmp.S head/lib/libstand/arp.c head/lib/libstand/assert.c head/lib/libstand/bcd.c head/lib/libstand/bootp.c head/lib/libstand/bootp.h head/lib/libstand/bootparam.c head/lib/libstand/bootparam.h head/lib/libstand/bzipfs.c head/lib/libstand/cd9660.c head/lib/libstand/close.c head/lib/libstand/closeall.c head/lib/libstand/dev.c head/lib/libstand/dosfs.c head/lib/libstand/dosfs.h head/lib/libstand/environment.c head/lib/libstand/ether.c head/lib/libstand/ext2fs.c head/lib/libstand/fstat.c head/lib/libstand/getopt.c head/lib/libstand/gets.c head/lib/libstand/globals.c head/lib/libstand/gzipfs.c head/lib/libstand/i386/_setjmp.S head/lib/libstand/in_cksum.c head/lib/libstand/inet_ntoa.c head/lib/libstand/ioctl.c head/lib/libstand/iodesc.h head/lib/libstand/ip.c head/lib/libstand/libstand.3 head/lib/libstand/lseek.c head/lib/libstand/mips/_setjmp.S head/lib/libstand/nandfs.c head/lib/libstand/net.c head/lib/libstand/net.h head/lib/libstand/netif.c head/lib/libstand/netif.h head/lib/libstand/nfs.c head/lib/libstand/nfsv2.h head/lib/libstand/nullfs.c head/lib/libstand/open.c head/lib/libstand/pager.c head/lib/libstand/pkgfs.c head/lib/libstand/powerpc/_setjmp.S head/lib/libstand/powerpc/syncicache.c head/lib/libstand/printf.c head/lib/libstand/qdivrem.c head/lib/libstand/quad.h head/lib/libstand/random.c head/lib/libstand/rarp.c head/lib/libstand/read.c head/lib/libstand/readdir.c head/lib/libstand/rpc.c head/lib/libstand/rpc.h head/lib/libstand/rpcv2.h head/lib/libstand/saioctl.h head/lib/libstand/sbrk.c head/lib/libstand/sparc64/_setjmp.S head/lib/libstand/splitfs.c head/lib/libstand/stand.h head/lib/libstand/stat.c head/lib/libstand/strcasecmp.c head/lib/libstand/strdup.c head/lib/libstand/strerror.c head/lib/libstand/strtol.c head/lib/libstand/strtoul.c head/lib/libstand/tftp.c head/lib/libstand/tftp.h head/lib/libstand/twiddle.c head/lib/libstand/udp.c head/lib/libstand/ufs.c head/lib/libstand/uuid_from_string.c head/lib/libstand/uuid_to_string.c head/lib/libstand/write.c head/lib/libstand/zalloc.c head/lib/libstand/zalloc_defs.h head/lib/libstand/zalloc_malloc.c head/lib/libstand/zalloc_mem.h head/lib/libstand/zalloc_protos.h Modified: head/sys/boot/libsa/Makefile head/sys/boot/libstand32/Makefile head/sys/boot/userboot/libstand/Makefile Modified: head/sys/boot/libsa/Makefile ============================================================================== --- head/sys/boot/libsa/Makefile Thu Oct 12 14:53:25 2017 (r324550) +++ head/sys/boot/libsa/Makefile Thu Oct 12 14:56:28 2017 (r324551) @@ -1,14 +1,161 @@ # $FreeBSD$ +# Originally from $NetBSD: Makefile,v 1.21 1997/10/26 22:08:38 lukem Exp $ +# +# Notes: +# - We don't use the libc strerror/sys_errlist because the string table is +# quite large. +# +MK_PROFILE= no +MK_SSP= no + .include .include "../Makefile.inc" -LIBSTAND_SRC= ${SASRC} -LIBC_SRC= ${SRCTOP}/lib/libc INTERNALLIB= -INCS= -MAN= -.PATH: ${SASRC} +LIBSTAND_CPUARCH?=${MACHINE_CPUARCH} +LIBC_SRC= ${SRCTOP}/lib/libc -.include "${SASRC}/Makefile" +LIB?= stand +NO_PIC= +WARNS?= 0 + +CFLAGS+= -I${SASRC} + +# standalone components and stuff we have modified locally +SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ + globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ + sbrk.c twiddle.c zalloc.c zalloc_malloc.c + +# private (pruned) versions of libc string functions +SRCS+= strcasecmp.c + +.PATH: ${LIBC_SRC}/net + +SRCS+= ntoh.c + +# string functions from libc +.PATH: ${LIBC_SRC}/string +SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ + memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ + qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ + strcspn.c strlcat.c strlcpy.c strlen.c strncat.c strncmp.c strncpy.c \ + strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c +.if ${MACHINE_CPUARCH} == "arm" +.PATH: ${LIBC_SRC}/arm/gen + +# Do not generate movt/movw, because the relocation fixup for them does not +# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). +# Also, the fpu is not available in a standalone environment. +.if ${COMPILER_VERSION} < 30800 +CFLAGS.clang+= -mllvm -arm-use-movt=0 +.else +CFLAGS.clang+= -mno-movt +.endif +CFLAGS.clang+= -mfpu=none + +# Compiler support functions +.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/ +# __clzsi2 and ctzsi2 for various builtin functions +SRCS+= clzsi2.c ctzsi2.c +# Divide and modulus functions called by the compiler +SRCS+= divmoddi4.c divmodsi4.c divdi3.c divsi3.c moddi3.c modsi3.c +SRCS+= udivmoddi4.c udivmodsi4.c udivdi3.c udivsi3.c umoddi3.c umodsi3.c + +.PATH: ${SRCTOP}/contrib/compiler-rt/lib/builtins/arm/ +SRCS+= aeabi_idivmod.S aeabi_ldivmod.S aeabi_uidivmod.S aeabi_uldivmod.S +SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S +.endif + +.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" +.PATH: ${LIBC_SRC}/${MACHINE_CPUARCH}/gen +.endif + +.if ${MACHINE_CPUARCH} == "powerpc" +.PATH: ${LIBC_SRC}/quad +SRCS+= ashldi3.c ashrdi3.c +SRCS+= syncicache.c +.endif + +# uuid functions from libc +.PATH: ${LIBC_SRC}/uuid +SRCS+= uuid_create_nil.c uuid_equal.c uuid_from_string.c uuid_is_nil.c uuid_to_string.c + +# _setjmp/_longjmp +.PATH: ${SASRC}/${LIBSTAND_CPUARCH} +SRCS+= _setjmp.S + +# decompression functionality from libbz2 +# NOTE: to actually test this functionality after libbz2 upgrade compile +# loader(8) with LOADER_BZIP2_SUPPORT defined +.PATH: ${SRCTOP}/contrib/bzip2 +CFLAGS+= -DBZ_NO_STDIO -DBZ_NO_COMPRESS +SRCS+= libstand_bzlib_private.h + +.for file in bzlib.c crctable.c decompress.c huffman.c randtable.c +SRCS+= _${file} +CLEANFILES+= _${file} + +_${file}: ${file} + sed "s|bzlib_private\.h|libstand_bzlib_private.h|" \ + ${.ALLSRC} > ${.TARGET} +.endfor + +CLEANFILES+= libstand_bzlib_private.h +libstand_bzlib_private.h: bzlib_private.h + sed -e 's||"stand.h"|' \ + ${.ALLSRC} > ${.TARGET} + +# decompression functionality from zlib +.PATH: ${SRCTOP}/contrib/zlib +CFLAGS+=-DHAVE_MEMCPY -I${SRCTOP}/contrib/zlib +SRCS+= adler32.c crc32.c libstand_zutil.h libstand_gzguts.h + +.for file in infback.c inffast.c inflate.c inftrees.c zutil.c +SRCS+= _${file} +CLEANFILES+= _${file} + +_${file}: ${file} + sed -e "s|zutil\.h|libstand_zutil.h|" \ + -e "s|gzguts\.h|libstand_gzguts.h|" \ + ${.ALLSRC} > ${.TARGET} +.endfor + +# depend on stand.h being able to be included multiple times +.for file in zutil.h gzguts.h +CLEANFILES+= libstand_${file} +libstand_${file}: ${file} + sed -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + -e 's||"stand.h"|' \ + ${.ALLSRC} > ${.TARGET} +.endfor + +# io routines +SRCS+= closeall.c dev.c ioctl.c nullfs.c stat.c \ + fstat.c close.c lseek.c open.c read.c write.c readdir.c + +# network routines +SRCS+= arp.c ether.c ip.c inet_ntoa.c in_cksum.c net.c udp.c netif.c rpc.c + +# network info services: +SRCS+= bootp.c rarp.c bootparam.c + +# boot filesystems +SRCS+= ufs.c nfs.c cd9660.c tftp.c gzipfs.c bzipfs.c +SRCS+= dosfs.c ext2fs.c +SRCS+= splitfs.c +SRCS+= pkgfs.c +.if ${MK_NAND} != "no" +SRCS+= nandfs.c +.endif + +# explicit_bzero +.PATH: ${SRCTOP}/sys/libkern +SRCS+= explicit_bzero.c + +.include +.include Copied and modified: head/sys/boot/libsa/Makefile.depend (from r324550, head/lib/libstand/Makefile.depend) ============================================================================== Copied and modified: head/sys/boot/libsa/__main.c (from r324550, head/lib/libstand/__main.c) ============================================================================== Copied and modified: head/sys/boot/libsa/amd64/_setjmp.S (from r324550, head/lib/libstand/amd64/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/arp.c (from r324550, head/lib/libstand/arp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/assert.c (from r324550, head/lib/libstand/assert.c) ============================================================================== Copied and modified: head/sys/boot/libsa/bcd.c (from r324550, head/lib/libstand/bcd.c) ============================================================================== Copied and modified: head/sys/boot/libsa/bootp.c (from r324550, head/lib/libstand/bootp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/bootp.h (from r324550, head/lib/libstand/bootp.h) ============================================================================== Copied and modified: head/sys/boot/libsa/bootparam.c (from r324550, head/lib/libstand/bootparam.c) ============================================================================== Copied and modified: head/sys/boot/libsa/bootparam.h (from r324550, head/lib/libstand/bootparam.h) ============================================================================== Copied and modified: head/sys/boot/libsa/bzipfs.c (from r324550, head/lib/libstand/bzipfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/cd9660.c (from r324550, head/lib/libstand/cd9660.c) ============================================================================== Copied and modified: head/sys/boot/libsa/close.c (from r324550, head/lib/libstand/close.c) ============================================================================== Copied and modified: head/sys/boot/libsa/closeall.c (from r324550, head/lib/libstand/closeall.c) ============================================================================== Copied and modified: head/sys/boot/libsa/dev.c (from r324550, head/lib/libstand/dev.c) ============================================================================== Copied and modified: head/sys/boot/libsa/dosfs.c (from r324550, head/lib/libstand/dosfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/dosfs.h (from r324550, head/lib/libstand/dosfs.h) ============================================================================== Copied and modified: head/sys/boot/libsa/environment.c (from r324550, head/lib/libstand/environment.c) ============================================================================== Copied and modified: head/sys/boot/libsa/ether.c (from r324550, head/lib/libstand/ether.c) ============================================================================== Copied and modified: head/sys/boot/libsa/ext2fs.c (from r324550, head/lib/libstand/ext2fs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/fstat.c (from r324550, head/lib/libstand/fstat.c) ============================================================================== Copied and modified: head/sys/boot/libsa/getopt.c (from r324550, head/lib/libstand/getopt.c) ============================================================================== Copied and modified: head/sys/boot/libsa/gets.c (from r324550, head/lib/libstand/gets.c) ============================================================================== Copied and modified: head/sys/boot/libsa/globals.c (from r324550, head/lib/libstand/globals.c) ============================================================================== Copied and modified: head/sys/boot/libsa/gzipfs.c (from r324550, head/lib/libstand/gzipfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/i386/_setjmp.S (from r324550, head/lib/libstand/i386/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/in_cksum.c (from r324550, head/lib/libstand/in_cksum.c) ============================================================================== Copied and modified: head/sys/boot/libsa/inet_ntoa.c (from r324550, head/lib/libstand/inet_ntoa.c) ============================================================================== Copied and modified: head/sys/boot/libsa/ioctl.c (from r324550, head/lib/libstand/ioctl.c) ============================================================================== Copied and modified: head/sys/boot/libsa/iodesc.h (from r324550, head/lib/libstand/iodesc.h) ============================================================================== Copied and modified: head/sys/boot/libsa/ip.c (from r324550, head/lib/libstand/ip.c) ============================================================================== Copied and modified: head/sys/boot/libsa/libstand.3 (from r324550, head/lib/libstand/libstand.3) ============================================================================== Copied and modified: head/sys/boot/libsa/lseek.c (from r324550, head/lib/libstand/lseek.c) ============================================================================== Copied and modified: head/sys/boot/libsa/mips/_setjmp.S (from r324550, head/lib/libstand/mips/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/nandfs.c (from r324550, head/lib/libstand/nandfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/net.c (from r324550, head/lib/libstand/net.c) ============================================================================== Copied and modified: head/sys/boot/libsa/net.h (from r324550, head/lib/libstand/net.h) ============================================================================== Copied and modified: head/sys/boot/libsa/netif.c (from r324550, head/lib/libstand/netif.c) ============================================================================== Copied and modified: head/sys/boot/libsa/netif.h (from r324550, head/lib/libstand/netif.h) ============================================================================== Copied and modified: head/sys/boot/libsa/nfs.c (from r324550, head/lib/libstand/nfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/nfsv2.h (from r324550, head/lib/libstand/nfsv2.h) ============================================================================== Copied and modified: head/sys/boot/libsa/nullfs.c (from r324550, head/lib/libstand/nullfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/open.c (from r324550, head/lib/libstand/open.c) ============================================================================== Copied and modified: head/sys/boot/libsa/pager.c (from r324550, head/lib/libstand/pager.c) ============================================================================== Copied and modified: head/sys/boot/libsa/pkgfs.c (from r324550, head/lib/libstand/pkgfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/powerpc/_setjmp.S (from r324550, head/lib/libstand/powerpc/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/powerpc/syncicache.c (from r324550, head/lib/libstand/powerpc/syncicache.c) ============================================================================== Copied and modified: head/sys/boot/libsa/printf.c (from r324550, head/lib/libstand/printf.c) ============================================================================== Copied and modified: head/sys/boot/libsa/qdivrem.c (from r324550, head/lib/libstand/qdivrem.c) ============================================================================== Copied and modified: head/sys/boot/libsa/quad.h (from r324550, head/lib/libstand/quad.h) ============================================================================== Copied and modified: head/sys/boot/libsa/random.c (from r324550, head/lib/libstand/random.c) ============================================================================== Copied and modified: head/sys/boot/libsa/rarp.c (from r324550, head/lib/libstand/rarp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/read.c (from r324550, head/lib/libstand/read.c) ============================================================================== Copied and modified: head/sys/boot/libsa/readdir.c (from r324550, head/lib/libstand/readdir.c) ============================================================================== Copied and modified: head/sys/boot/libsa/rpc.c (from r324550, head/lib/libstand/rpc.c) ============================================================================== Copied and modified: head/sys/boot/libsa/rpc.h (from r324550, head/lib/libstand/rpc.h) ============================================================================== Copied and modified: head/sys/boot/libsa/rpcv2.h (from r324550, head/lib/libstand/rpcv2.h) ============================================================================== Copied and modified: head/sys/boot/libsa/saioctl.h (from r324550, head/lib/libstand/saioctl.h) ============================================================================== Copied and modified: head/sys/boot/libsa/sbrk.c (from r324550, head/lib/libstand/sbrk.c) ============================================================================== Copied and modified: head/sys/boot/libsa/sparc64/_setjmp.S (from r324550, head/lib/libstand/sparc64/_setjmp.S) ============================================================================== Copied and modified: head/sys/boot/libsa/splitfs.c (from r324550, head/lib/libstand/splitfs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/stand.h (from r324550, head/lib/libstand/stand.h) ============================================================================== Copied and modified: head/sys/boot/libsa/stat.c (from r324550, head/lib/libstand/stat.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strcasecmp.c (from r324550, head/lib/libstand/strcasecmp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strdup.c (from r324550, head/lib/libstand/strdup.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strerror.c (from r324550, head/lib/libstand/strerror.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strtol.c (from r324550, head/lib/libstand/strtol.c) ============================================================================== Copied and modified: head/sys/boot/libsa/strtoul.c (from r324550, head/lib/libstand/strtoul.c) ============================================================================== Copied and modified: head/sys/boot/libsa/tftp.c (from r324550, head/lib/libstand/tftp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/tftp.h (from r324550, head/lib/libstand/tftp.h) ============================================================================== Copied and modified: head/sys/boot/libsa/twiddle.c (from r324550, head/lib/libstand/twiddle.c) ============================================================================== Copied and modified: head/sys/boot/libsa/udp.c (from r324550, head/lib/libstand/udp.c) ============================================================================== Copied and modified: head/sys/boot/libsa/ufs.c (from r324550, head/lib/libstand/ufs.c) ============================================================================== Copied and modified: head/sys/boot/libsa/uuid_from_string.c (from r324550, head/lib/libstand/uuid_from_string.c) ============================================================================== Copied and modified: head/sys/boot/libsa/uuid_to_string.c (from r324550, head/lib/libstand/uuid_to_string.c) ============================================================================== Copied and modified: head/sys/boot/libsa/write.c (from r324550, head/lib/libstand/write.c) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc.c (from r324550, head/lib/libstand/zalloc.c) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc_defs.h (from r324550, head/lib/libstand/zalloc_defs.h) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc_malloc.c (from r324550, head/lib/libstand/zalloc_malloc.c) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc_mem.h (from r324550, head/lib/libstand/zalloc_mem.h) ============================================================================== Copied and modified: head/sys/boot/libsa/zalloc_protos.h (from r324550, head/lib/libstand/zalloc_protos.h) ============================================================================== Modified: head/sys/boot/libstand32/Makefile ============================================================================== --- head/sys/boot/libstand32/Makefile Thu Oct 12 14:53:25 2017 (r324550) +++ head/sys/boot/libstand32/Makefile Thu Oct 12 14:56:28 2017 (r324551) @@ -9,8 +9,6 @@ LIBSTAND_CPUARCH=i386 .else LIBSTAND_CPUARCH=${MACHINE_CPUARCH} .endif -LIBSTAND_SRC= ${SASRC} -LIBC_SRC= ${SRCTOP}/lib/libc INTERNALLIB= INCS= MAN= Modified: head/sys/boot/userboot/libstand/Makefile ============================================================================== --- head/sys/boot/userboot/libstand/Makefile Thu Oct 12 14:53:25 2017 (r324550) +++ head/sys/boot/userboot/libstand/Makefile Thu Oct 12 14:56:28 2017 (r324551) @@ -3,11 +3,6 @@ .include .include "../Makefile.inc" -LIBSTAND_SRC= ${SASRC} +.PATH: ${SASRC} -INTERNALLIB= -INCS= -MAN= -.PATH: ${LIBSTAND_SRC} - -.include "${LIBSTAND_SRC}/Makefile" +.include "${SASRC}/Makefile" From owner-svn-src-head@freebsd.org Thu Oct 12 14:56:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E7BEE2BA3A; Thu, 12 Oct 2017 14:56:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CECB57E2A7; Thu, 12 Oct 2017 14:56:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEuhje035158; Thu, 12 Oct 2017 14:56:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEugQD035155; Thu, 12 Oct 2017 14:56:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121456.v9CEugQD035155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324552 - in head/sys/boot: . userboot userboot/libstand userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . userboot userboot/libstand userboot/userboot X-SVN-Commit-Revision: 324552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:56:44 -0000 Author: imp Date: Thu Oct 12 14:56:42 2017 New Revision: 324552 URL: https://svnweb.freebsd.org/changeset/base/324552 Log: Kill the userboot copy of libstand. It's not needed (it's now identical to libsa, and seems to have been for some time). Sponsored by: Netflix Deleted: head/sys/boot/userboot/libstand/Makefile head/sys/boot/userboot/libstand/Makefile.depend Modified: head/sys/boot/Makefile.inc head/sys/boot/userboot/Makefile head/sys/boot/userboot/userboot/Makefile Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Thu Oct 12 14:56:28 2017 (r324551) +++ head/sys/boot/Makefile.inc Thu Oct 12 14:56:42 2017 (r324552) @@ -10,8 +10,6 @@ SASRC=${SRCTOP}/lib/libstand LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a # Standalone library compiled for 32-bit version of the processor LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a -# Standalone library compiled for userboot -LIBSAU=${OBJTOP}/sys/boot/userboot/libstand/libstand.a CFLAGS+=-I${SASRC} Modified: head/sys/boot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/Makefile Thu Oct 12 14:56:28 2017 (r324551) +++ head/sys/boot/userboot/Makefile Thu Oct 12 14:56:42 2017 (r324552) @@ -2,7 +2,7 @@ .include -SUBDIR= ficl libstand test zfs userboot +SUBDIR= ficl test zfs userboot .include Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Thu Oct 12 14:56:28 2017 (r324551) +++ head/sys/boot/userboot/userboot/Makefile Thu Oct 12 14:56:42 2017 (r324552) @@ -58,7 +58,7 @@ LIBZFSBOOT= ${.OBJDIR}/../zfs/libzfsboot.a .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I. -DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} -LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSAU} +DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} +LDADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} .include From owner-svn-src-head@freebsd.org Thu Oct 12 14:56:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02E86E2BA6E; Thu, 12 Oct 2017 14:56:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1FEA7E340; Thu, 12 Oct 2017 14:56:49 +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 v9CEume5035216; Thu, 12 Oct 2017 14:56:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEumMv035209; Thu, 12 Oct 2017 14:56:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121456.v9CEumMv035209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324553 - in head/sys/boot: . libsa libsa32 libstand32 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: . libsa libsa32 libstand32 X-SVN-Commit-Revision: 324553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:56:50 -0000 Author: imp Date: Thu Oct 12 14:56:48 2017 New Revision: 324553 URL: https://svnweb.freebsd.org/changeset/base/324553 Log: Rename libstand.a to libsa.a and libstand32.a to libsa32.a Sponsored by: Netflix Added: head/sys/boot/libsa32/ head/sys/boot/libsa32/Makefile (contents, props changed) - copied, changed from r324552, head/sys/boot/libstand32/Makefile head/sys/boot/libsa32/Makefile.depend (contents, props changed) - copied, changed from r324552, head/sys/boot/libstand32/Makefile.depend Deleted: head/sys/boot/libstand32/Makefile head/sys/boot/libstand32/Makefile.depend Modified: head/sys/boot/Makefile.amd64 head/sys/boot/Makefile.i386 head/sys/boot/Makefile.inc head/sys/boot/Makefile.powerpc head/sys/boot/libsa/Makefile Modified: head/sys/boot/Makefile.amd64 ============================================================================== --- head/sys/boot/Makefile.amd64 Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/Makefile.amd64 Thu Oct 12 14:56:48 2017 (r324553) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR+= efi -SUBDIR+= libstand32 +SUBDIR+= libsa32 SUBDIR+= zfs SUBDIR+= userboot Modified: head/sys/boot/Makefile.i386 ============================================================================== --- head/sys/boot/Makefile.i386 Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/Makefile.i386 Thu Oct 12 14:56:48 2017 (r324553) @@ -1,7 +1,7 @@ # $FreeBSD$ SUBDIR+= efi -SUBDIR+= libstand32 +SUBDIR+= libsa32 SUBDIR+= zfs .if !defined(LOADER_NO_GELI_SUPPORT) Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/Makefile.inc Thu Oct 12 14:56:48 2017 (r324553) @@ -5,11 +5,11 @@ .if !defined(__BOOT_MAKEFILE_INC__) __BOOT_MAKEFILE_INC__=${MFILE} -SASRC=${SRCTOP}/lib/libstand -# Normal standalone library -LIBSA=${OBJTOP}/sys/boot/libsa/libstand.a +SASRC=${SRCTOP}/sys/boot/libsa +# Normal Standalone library +LIBSA=${OBJTOP}/sys/boot/libsa/libsa.a # Standalone library compiled for 32-bit version of the processor -LIBSA32=${OBJTOP}/sys/boot/libstand32/libstand.a +LIBSA32=${OBJTOP}/sys/boot/libsa32/libsa32.a CFLAGS+=-I${SASRC} Modified: head/sys/boot/Makefile.powerpc ============================================================================== --- head/sys/boot/Makefile.powerpc Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/Makefile.powerpc Thu Oct 12 14:56:48 2017 (r324553) @@ -4,6 +4,6 @@ SUBDIR+= fdt .endif -SUBDIR+= libstand32 +SUBDIR+= libsa32 SUBDIR+= ofw SUBDIR+= uboot Modified: head/sys/boot/libsa/Makefile ============================================================================== --- head/sys/boot/libsa/Makefile Thu Oct 12 14:56:42 2017 (r324552) +++ head/sys/boot/libsa/Makefile Thu Oct 12 14:56:48 2017 (r324553) @@ -17,7 +17,7 @@ INTERNALLIB= LIBSTAND_CPUARCH?=${MACHINE_CPUARCH} LIBC_SRC= ${SRCTOP}/lib/libc -LIB?= stand +LIB?= sa NO_PIC= WARNS?= 0 Copied and modified: head/sys/boot/libsa32/Makefile (from r324552, head/sys/boot/libstand32/Makefile) ============================================================================== --- head/sys/boot/libstand32/Makefile Thu Oct 12 14:56:42 2017 (r324552, copy source) +++ head/sys/boot/libsa32/Makefile Thu Oct 12 14:56:48 2017 (r324553) @@ -4,20 +4,18 @@ .include "../Makefile.inc" +LIB=sa32 .if ${MACHINE_CPUARCH} == "amd64" LIBSTAND_CPUARCH=i386 .else LIBSTAND_CPUARCH=${MACHINE_CPUARCH} .endif -INTERNALLIB= -INCS= -MAN= -.PATH: ${SASRC} .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" CFLAGS+= -m32 -I. .endif +.PATH: ${SASRC} .include "${SASRC}/Makefile" .if ${MACHINE_CPUARCH} == "amd64" Copied and modified: head/sys/boot/libsa32/Makefile.depend (from r324552, head/sys/boot/libstand32/Makefile.depend) ============================================================================== From owner-svn-src-head@freebsd.org Thu Oct 12 14:56:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C97E4E2BACF; Thu, 12 Oct 2017 14:56:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8868B7E3FF; Thu, 12 Oct 2017 14:56:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEutLK035279; Thu, 12 Oct 2017 14:56:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEusnF035268; Thu, 12 Oct 2017 14:56:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121456.v9CEusnF035268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324554 - in head/sys/boot: common i386/gptboot i386/gptzfsboot i386/zfsboot libsa uboot/lib X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: common i386/gptboot i386/gptzfsboot i386/zfsboot libsa uboot/lib X-SVN-Commit-Revision: 324554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:56:57 -0000 Author: imp Date: Thu Oct 12 14:56:54 2017 New Revision: 324554 URL: https://svnweb.freebsd.org/changeset/base/324554 Log: Move crc32.c, util.c and gpt.c over to libsa. Sponsored by: Netflix Added: head/sys/boot/libsa/crc32.c (contents, props changed) - copied, changed from r324553, head/sys/boot/common/crc32.c head/sys/boot/libsa/crc32.h (contents, props changed) - copied, changed from r324553, head/sys/boot/common/crc32.h head/sys/boot/libsa/gpt.c (contents, props changed) - copied, changed from r324553, head/sys/boot/common/gpt.c head/sys/boot/libsa/gpt.h (contents, props changed) - copied, changed from r324553, head/sys/boot/common/gpt.h head/sys/boot/libsa/util.c (contents, props changed) - copied, changed from r324553, head/sys/boot/common/util.c head/sys/boot/libsa/util.h (contents, props changed) - copied, changed from r324553, head/sys/boot/common/util.h Deleted: head/sys/boot/common/crc32.c head/sys/boot/common/crc32.h head/sys/boot/common/gpt.c head/sys/boot/common/gpt.h head/sys/boot/common/util.c head/sys/boot/common/util.h Modified: head/sys/boot/common/Makefile.inc head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/uboot/lib/Makefile Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/common/Makefile.inc Thu Oct 12 14:56:54 2017 (r324554) @@ -1,5 +1,7 @@ # $FreeBSD$ +.PATH: ${SRCTOP}/sys/boot/common ${SRCTOP}/sys/boot/libsa + SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c panic.c @@ -30,7 +32,6 @@ SRCS+= dev_net.c SRCS+= disk.c part.c CFLAGS+= -DLOADER_DISK_SUPPORT .if !defined(LOADER_NO_GPT_SUPPORT) -SRCS+= crc32.c CFLAGS+= -DLOADER_GPT_SUPPORT .endif .if !defined(LOADER_NO_MBR_SUPPORT) Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/i386/gptboot/Makefile Thu Oct 12 14:56:54 2017 (r324554) @@ -1,7 +1,9 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common +.include "../Makefile.inc" +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${SASRC} + FILES= gptboot MAN= gptboot.8 @@ -20,7 +22,7 @@ GPTBOOT_UFS?= UFS1_AND_UFS2 #GPTBOOT_UFS?= UFS2_ONLY #GPTBOOT_UFS?= UFS1_ONLY -CFLAGS= -DBOOTPROG=\"gptboot\" \ +CFLAGS+=-DBOOTPROG=\"gptboot\" \ -O1 \ -DGPT \ -D${GPTBOOT_UFS} \ Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/i386/gptzfsboot/Makefile Thu Oct 12 14:56:54 2017 (r324554) @@ -1,10 +1,10 @@ # $FreeBSD$ -.include +.include "../Makefile.inc" .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \ ${.CURDIR}/../zfsboot ${.CURDIR}/../common \ - ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein + ${.CURDIR}/../../../crypto/skein ${SASRC} FILES= gptzfsboot MAN= gptzfsboot.8 @@ -19,7 +19,7 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x0 -CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ +CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \ -O1 \ -DGPT -DZFS -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/i386/zfsboot/Makefile Thu Oct 12 14:56:54 2017 (r324554) @@ -1,7 +1,9 @@ # $FreeBSD$ +.include "../Makefile.inc" + .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common \ - ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein + ${.CURDIR}/../../../crypto/skein ${SASRC} FILES= zfsboot MAN= zfsboot.8 Copied and modified: head/sys/boot/libsa/crc32.c (from r324553, head/sys/boot/common/crc32.c) ============================================================================== Copied and modified: head/sys/boot/libsa/crc32.h (from r324553, head/sys/boot/common/crc32.h) ============================================================================== Copied and modified: head/sys/boot/libsa/gpt.c (from r324553, head/sys/boot/common/gpt.c) ============================================================================== Copied and modified: head/sys/boot/libsa/gpt.h (from r324553, head/sys/boot/common/gpt.h) ============================================================================== Copied and modified: head/sys/boot/libsa/util.c (from r324553, head/sys/boot/common/util.c) ============================================================================== Copied and modified: head/sys/boot/libsa/util.h (from r324553, head/sys/boot/common/util.h) ============================================================================== Modified: head/sys/boot/uboot/lib/Makefile ============================================================================== --- head/sys/boot/uboot/lib/Makefile Thu Oct 12 14:56:48 2017 (r324553) +++ head/sys/boot/uboot/lib/Makefile Thu Oct 12 14:56:54 2017 (r324554) @@ -8,7 +8,7 @@ LIB= uboot INTERNALLIB= WARNS?= 2 -SRCS= crc32.c console.c copy.c devicename.c elf_freebsd.c glue.c +SRCS= console.c copy.c devicename.c elf_freebsd.c glue.c SRCS+= module.c net.c reboot.c time.c CFLAGS+= -ffreestanding -msoft-float From owner-svn-src-head@freebsd.org Thu Oct 12 14:57:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C29C2E2BB1F; Thu, 12 Oct 2017 14:57:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 901787E482; Thu, 12 Oct 2017 14:57:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEv05P035337; Thu, 12 Oct 2017 14:57:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEv0Ye035336; Thu, 12 Oct 2017 14:57:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121457.v9CEv0Ye035336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324555 - head/sys/boot/i386/zfsboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/i386/zfsboot X-SVN-Commit-Revision: 324555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:57:01 -0000 Author: imp Date: Thu Oct 12 14:57:00 2017 New Revision: 324555 URL: https://svnweb.freebsd.org/changeset/base/324555 Log: Honor CFLAGS modifications in Makefile.inc by using += here. There's no hyper-small space constraints, so there's no reason to tightly control it. Sponsored by: Netflix Modified: head/sys/boot/i386/zfsboot/Makefile Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Thu Oct 12 14:56:54 2017 (r324554) +++ head/sys/boot/i386/zfsboot/Makefile Thu Oct 12 14:57:00 2017 (r324555) @@ -18,7 +18,7 @@ REL1= 0x700 ORG1= 0x7c00 ORG2= 0x2000 -CFLAGS= -DBOOTPROG=\"zfsboot\" \ +CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -O1 \ -DZFS -DBOOT2 \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ From owner-svn-src-head@freebsd.org Thu Oct 12 14:57:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A859E2BB72; Thu, 12 Oct 2017 14:57:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45F587E534; Thu, 12 Oct 2017 14:57:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CEv6Xp035395; Thu, 12 Oct 2017 14:57:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CEv5Ct035389; Thu, 12 Oct 2017 14:57:05 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121457.v9CEv5Ct035389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 14:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324556 - in head/sys/boot: common efi/boot1 i386/gptboot libsa powerpc/boot1.chrp sparc64/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: common efi/boot1 i386/gptboot libsa powerpc/boot1.chrp sparc64/boot1 X-SVN-Commit-Revision: 324556 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 14:57:07 -0000 Author: imp Date: Thu Oct 12 14:57:05 2017 New Revision: 324556 URL: https://svnweb.freebsd.org/changeset/base/324556 Log: Move ufsread.c Move ufsread.c from sys/boot/common (which used to be all the common files for /boot/loader, but grew to be all the common files for sys/boot, but that's now sys/boot/libsa's job) to sys/boot/libsa. Sponsored by: Netflix Added: head/sys/boot/libsa/ufsread.c (contents, props changed) - copied, changed from r324555, head/sys/boot/common/ufsread.c Deleted: head/sys/boot/common/ufsread.c Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/boot/sparc64/boot1/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Thu Oct 12 14:57:00 2017 (r324555) +++ head/sys/boot/efi/boot1/Makefile Thu Oct 12 14:57:05 2017 (r324556) @@ -2,7 +2,7 @@ MAN= -.include +.include "../Makefile.inc" MK_SSP= no @@ -120,7 +120,7 @@ boot1.efi: ${PROG} -j .rela.dyn -j .reloc -j .eh_frame \ --output-target=${EFI_TARGET} ${.ALLSRC} ${.TARGET} -boot1.o: ${.CURDIR}/../../common/ufsread.c +boot1.o: ${SASRC}/ufsread.c # The following inserts our objects into a template FAT file system # created by generate-fat.sh Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Thu Oct 12 14:57:00 2017 (r324555) +++ head/sys/boot/i386/gptboot/Makefile Thu Oct 12 14:57:05 2017 (r324556) @@ -78,7 +78,7 @@ gptboot.bin: gptboot.out gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} -gptboot.o: ${.CURDIR}/../../common/ufsread.c +gptboot.o: ${SASRC}/ufsread.c .if ${MACHINE_CPUARCH} == "amd64" beforedepend gptboot.o: machine Copied and modified: head/sys/boot/libsa/ufsread.c (from r324555, head/sys/boot/common/ufsread.c) ============================================================================== Modified: head/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile Thu Oct 12 14:57:00 2017 (r324555) +++ head/sys/boot/powerpc/boot1.chrp/Makefile Thu Oct 12 14:57:05 2017 (r324556) @@ -17,7 +17,8 @@ CFLAGS= -ffreestanding -msoft-float \ -D_STANDALONE LDFLAGS=-nostdlib -static -Wl,-N -.include "${.CURDIR}/../Makefile.inc" +.include "../Makefile.inc" + .PATH: ${.CURDIR}/../../../libkern ${.CURDIR}/../../../../lib/libc/powerpc/gen ${.CURDIR} # The following inserts out objects into a template HFS @@ -36,7 +37,7 @@ boot1.hfs: boot1.elf bootinfo.txt CLEANFILES= boot1.hfs -boot1.o: ${.CURDIR}/../../common/ufsread.c +boot1.o: ${SASRC}/ufsread.c .include Modified: head/sys/boot/sparc64/boot1/Makefile ============================================================================== --- head/sys/boot/sparc64/boot1/Makefile Thu Oct 12 14:57:00 2017 (r324555) +++ head/sys/boot/sparc64/boot1/Makefile Thu Oct 12 14:57:05 2017 (r324556) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include "../Makefile.inc" + PROG= boot1.elf INTERNALPROG= MAN= @@ -25,6 +27,6 @@ ${FILES}: boot1.aout boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC} -boot1.o: ${.CURDIR}/../../common/ufsread.c +boot1.o: ${SASRC}/ufsread.c .include From owner-svn-src-head@freebsd.org Thu Oct 12 15:16:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1727E2C656; Thu, 12 Oct 2017 15:16:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD4037FFF2; Thu, 12 Oct 2017 15:16:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CFGGOQ045932; Thu, 12 Oct 2017 15:16:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFGGkY045929; Thu, 12 Oct 2017 15:16:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121516.v9CFGGkY045929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 15:16:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324557 - in head/sys/boot/efi: include loader loader/arch/i386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot/efi: include loader loader/arch/i386 X-SVN-Commit-Revision: 324557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:16:18 -0000 Author: imp Date: Thu Oct 12 15:16:16 2017 New Revision: 324557 URL: https://svnweb.freebsd.org/changeset/base/324557 Log: Rename exit to efi_exit to avoid clashing with libsa exit definition Rename exit to efi_exit. It doesn't have the proper signature and conflicts with standard definition. Provide the standard definition as well. Sponsored by: Netflix Modified: head/sys/boot/efi/include/efilib.h head/sys/boot/efi/loader/arch/i386/exec.c head/sys/boot/efi/loader/efi_main.c Modified: head/sys/boot/efi/include/efilib.h ============================================================================== --- head/sys/boot/efi/include/efilib.h Thu Oct 12 14:57:05 2017 (r324556) +++ head/sys/boot/efi/include/efilib.h Thu Oct 12 15:16:16 2017 (r324557) @@ -95,7 +95,7 @@ void efi_time_fini(void); EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE* Xsystab); EFI_STATUS main(int argc, CHAR16 *argv[]); -void exit(EFI_STATUS status) __dead2; +void efi_exit(EFI_STATUS status) __dead2; void delay(int usecs); /* EFI environment initialization. */ Modified: head/sys/boot/efi/loader/arch/i386/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/i386/exec.c Thu Oct 12 14:57:05 2017 (r324556) +++ head/sys/boot/efi/loader/arch/i386/exec.c Thu Oct 12 15:16:16 2017 (r324557) @@ -36,12 +36,6 @@ __FBSDID("$FreeBSD$"); uint32_t __base; struct __v86 __v86; -/* XXX - Needed a definition here to implicitly define exit(); do not remove. */ -static void -exit(int x) -{ -} - void __v86int() { Modified: head/sys/boot/efi/loader/efi_main.c ============================================================================== --- head/sys/boot/efi/loader/efi_main.c Thu Oct 12 14:57:05 2017 (r324556) +++ head/sys/boot/efi/loader/efi_main.c Thu Oct 12 15:16:16 2017 (r324557) @@ -36,13 +36,20 @@ static EFI_PHYSICAL_ADDRESS heap; static UINTN heapsize; void -exit(EFI_STATUS exit_code) +efi_exit(EFI_STATUS exit_code) { BS->FreePages(heap, EFI_SIZE_TO_PAGES(heapsize)); BS->Exit(IH, exit_code, 0, NULL); } +void +exit(int status) +{ + + efi_exit(EFI_LOAD_ERROR); +} + static CHAR16 * arg_skipsep(CHAR16 *argp) { @@ -92,11 +99,11 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *sy setheap((void *)(uintptr_t)heap, (void *)(uintptr_t)(heap + heapsize)); - /* Use exit() from here on... */ + /* Use efi_exit() from here on... */ status = BS->HandleProtocol(IH, &image_protocol, (VOID**)&img); if (status != EFI_SUCCESS) - exit(status); + efi_exit(status); /* * Pre-process the (optional) load options. If the option string @@ -176,6 +183,6 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *sy argv[argc] = NULL; status = main(argc, argv); - exit(status); + efi_exit(status); return (status); } From owner-svn-src-head@freebsd.org Thu Oct 12 15:16:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08827E2C67D; Thu, 12 Oct 2017 15:16:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5AF880031; Thu, 12 Oct 2017 15:16:23 +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 v9CFGNB9045990; Thu, 12 Oct 2017 15:16:23 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFGMeI045985; Thu, 12 Oct 2017 15:16:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121516.v9CFGMeI045985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 15:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324558 - in head/sys/boot: arm/uboot libsa mips/uboot powerpc/ofw powerpc/uboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: arm/uboot libsa mips/uboot powerpc/ofw powerpc/uboot X-SVN-Commit-Revision: 324558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:16:24 -0000 Author: imp Date: Thu Oct 12 15:16:22 2017 New Revision: 324558 URL: https://svnweb.freebsd.org/changeset/base/324558 Log: Define prototype for exit and ensure references Define a prototype for exit in stand.h. Provide a reference to exit in a few conf.c files to ensure that its definition gets pulled in early. Since exit() is a MD routine, it isn't defined in libsa. However, libsa tends to be listed last and will soon have panic() in it which calls exit(). The reference to exit early ensures that the MD exit is available to satisfy linking for static libraries. Modified: head/sys/boot/arm/uboot/conf.c head/sys/boot/libsa/stand.h head/sys/boot/mips/uboot/conf.c head/sys/boot/powerpc/ofw/conf.c head/sys/boot/powerpc/uboot/conf.c Modified: head/sys/boot/arm/uboot/conf.c ============================================================================== --- head/sys/boot/arm/uboot/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/arm/uboot/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: head/sys/boot/libsa/stand.h ============================================================================== --- head/sys/boot/libsa/stand.h Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/libsa/stand.h Thu Oct 12 15:16:22 2017 (r324558) @@ -376,6 +376,7 @@ extern int null_readdir(struct open_file *f, struct di * Machine dependent functions and data, must be provided or stubbed by * the consumer */ +extern void exit(int); extern int getchar(void); extern int ischar(void); extern void putchar(int); Modified: head/sys/boot/mips/uboot/conf.c ============================================================================== --- head/sys/boot/mips/uboot/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/mips/uboot/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) &uboot_storage, Modified: head/sys/boot/powerpc/ofw/conf.c ============================================================================== --- head/sys/boot/powerpc/ofw/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/powerpc/ofw/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -36,6 +36,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into Modified: head/sys/boot/powerpc/uboot/conf.c ============================================================================== --- head/sys/boot/powerpc/uboot/conf.c Thu Oct 12 15:16:16 2017 (r324557) +++ head/sys/boot/powerpc/uboot/conf.c Thu Oct 12 15:16:22 2017 (r324558) @@ -35,6 +35,9 @@ __FBSDID("$FreeBSD$"); #include "dev_net.h" #endif +/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */ +void (*exitfn)(int) = exit; + /* * We could use linker sets for some or all of these, but * then we would have to control what ended up linked into From owner-svn-src-head@freebsd.org Thu Oct 12 15:16:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A2D7E2C6B8; Thu, 12 Oct 2017 15:16:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15F43800AE; Thu, 12 Oct 2017 15:16:29 +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 v9CFGSmi046046; Thu, 12 Oct 2017 15:16:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFGROI046043; Thu, 12 Oct 2017 15:16:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201710121516.v9CFGROI046043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 12 Oct 2017 15:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324559 - in head/sys/boot: common libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/boot: common libsa X-SVN-Commit-Revision: 324559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:16:29 -0000 Author: imp Date: Thu Oct 12 15:16:27 2017 New Revision: 324559 URL: https://svnweb.freebsd.org/changeset/base/324559 Log: Move panic back into libsa. It's documented in libstand(3) to belong there. Sponsored by: Netflix Added: head/sys/boot/libsa/panic.c (contents, props changed) - copied, changed from r324558, head/sys/boot/common/panic.c Deleted: head/sys/boot/common/panic.c Modified: head/sys/boot/common/Makefile.inc head/sys/boot/libsa/Makefile Modified: head/sys/boot/common/Makefile.inc ============================================================================== --- head/sys/boot/common/Makefile.inc Thu Oct 12 15:16:22 2017 (r324558) +++ head/sys/boot/common/Makefile.inc Thu Oct 12 15:16:27 2017 (r324559) @@ -4,7 +4,7 @@ SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c -SRCS+= module.c panic.c +SRCS+= module.c .if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64" SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c Modified: head/sys/boot/libsa/Makefile ============================================================================== --- head/sys/boot/libsa/Makefile Thu Oct 12 15:16:22 2017 (r324558) +++ head/sys/boot/libsa/Makefile Thu Oct 12 15:16:27 2017 (r324559) @@ -25,8 +25,8 @@ CFLAGS+= -I${SASRC} # standalone components and stuff we have modified locally SRCS+= gzguts.h zutil.h __main.c assert.c bcd.c environment.c getopt.c gets.c \ - globals.c pager.c printf.c strdup.c strerror.c strtol.c strtoul.c random.c \ - sbrk.c twiddle.c zalloc.c zalloc_malloc.c + globals.c pager.c panic.c printf.c strdup.c strerror.c strtol.c strtoul.c \ + random.c sbrk.c twiddle.c zalloc.c zalloc_malloc.c # private (pruned) versions of libc string functions SRCS+= strcasecmp.c Copied and modified: head/sys/boot/libsa/panic.c (from r324558, head/sys/boot/common/panic.c) ============================================================================== From owner-svn-src-head@freebsd.org Thu Oct 12 15:45:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84CB6E2D2C8; Thu, 12 Oct 2017 15:45:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51E4C81582; Thu, 12 Oct 2017 15:45:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CFjraJ058744; Thu, 12 Oct 2017 15:45:53 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFjrOu058741; Thu, 12 Oct 2017 15:45:53 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710121545.v9CFjrOu058741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Oct 2017 15:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324560 - in head: lib/libc/sys sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern X-SVN-Commit-Revision: 324560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:45:54 -0000 Author: emaste Date: Thu Oct 12 15:45:53 2017 New Revision: 324560 URL: https://svnweb.freebsd.org/changeset/base/324560 Log: allow posix_fallocate in capability mode posix_fallocate is logically equivalent to writing zero blocks to the desired file size and there is no reason to prevent calling it in capability mode. posix_fallocate already checked for the CAP_WRITE right, so we merely need to list it in capabilities.conf. Reviewed by: allanjude MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12640 Modified: head/lib/libc/sys/posix_fallocate.2 head/sys/kern/capabilities.conf head/sys/kern/vfs_syscalls.c Modified: head/lib/libc/sys/posix_fallocate.2 ============================================================================== --- head/lib/libc/sys/posix_fallocate.2 Thu Oct 12 15:16:27 2017 (r324559) +++ head/lib/libc/sys/posix_fallocate.2 Thu Oct 12 15:45:53 2017 (r324560) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd January 23, 2014 +.Dd October 12, 2017 .Dt POSIX_FALLOCATE 2 .Os .Sh NAME @@ -118,6 +118,10 @@ argument does not refer to a regular file. .It Bq Er ENOSPC There is insufficient free space remaining on the file system storage media. +.It Bq Er ENOTCAPABLE +The file descriptor +.Fa fd +has insufficient rights. .It Bq Er ESPIPE The .Fa fd Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Thu Oct 12 15:16:27 2017 (r324559) +++ head/sys/kern/capabilities.conf Thu Oct 12 15:45:53 2017 (r324560) @@ -488,6 +488,7 @@ poll ## ## Allow I/O-related file descriptors, subject to capability rights. ## +posix_fallocate pread preadv Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Thu Oct 12 15:16:27 2017 (r324559) +++ head/sys/kern/vfs_syscalls.c Thu Oct 12 15:45:53 2017 (r324560) @@ -4400,7 +4400,7 @@ kern_posix_fallocate(struct thread *td, int fd, off_t if (offset > OFF_MAX - len) return (EFBIG); AUDIT_ARG_FD(fd); - error = fget(td, fd, cap_rights_init(&rights, CAP_WRITE), &fp); + error = fget(td, fd, cap_rights_init(&rights, CAP_PWRITE), &fp); if (error != 0) return (error); AUDIT_ARG_FILE(td->td_proc, fp); From owner-svn-src-head@freebsd.org Thu Oct 12 15:48:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D709E2D378; Thu, 12 Oct 2017 15:48:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C67D8175A; Thu, 12 Oct 2017 15:48:38 +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 v9CFmbdB058886; Thu, 12 Oct 2017 15:48:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFmbxj058885; Thu, 12 Oct 2017 15:48:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710121548.v9CFmbxj058885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Oct 2017 15:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324561 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:48:38 -0000 Author: emaste Date: Thu Oct 12 15:48:37 2017 New Revision: 324561 URL: https://svnweb.freebsd.org/changeset/base/324561 Log: regen init_sysent.c r324560 Modified: head/sys/kern/init_sysent.c Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Oct 12 15:45:53 2017 (r324560) +++ head/sys/kern/init_sysent.c Thu Oct 12 15:48:37 2017 (r324561) @@ -581,7 +581,7 @@ struct sysent sysent[] = { { AS(rctl_get_limits_args), (sy_call_t *)sys_rctl_get_limits, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 527 = rctl_get_limits */ { AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */ { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ - { AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = posix_fallocate */ + { AS(posix_fallocate_args), (sy_call_t *)sys_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 530 = posix_fallocate */ { AS(posix_fadvise_args), (sy_call_t *)sys_posix_fadvise, AUE_POSIX_FADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = posix_fadvise */ { AS(wait6_args), (sy_call_t *)sys_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = wait6 */ { AS(cap_rights_limit_args), (sy_call_t *)sys_cap_rights_limit, AUE_CAP_RIGHTS_LIMIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 533 = cap_rights_limit */ From owner-svn-src-head@freebsd.org Thu Oct 12 15:53:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E795DE2DAB9; Thu, 12 Oct 2017 15:53:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B557681F83; Thu, 12 Oct 2017 15:53:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CFrs37063026; Thu, 12 Oct 2017 15:53:54 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CFrsmP063024; Thu, 12 Oct 2017 15:53:54 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201710121553.v9CFrsmP063024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 12 Oct 2017 15:53:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324562 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 324562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 15:53:56 -0000 Author: bz Date: Thu Oct 12 15:53:54 2017 New Revision: 324562 URL: https://svnweb.freebsd.org/changeset/base/324562 Log: Add rev16 instruction to the disassembler. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D12645 Modified: head/sys/arm/arm/disassem.c Modified: head/sys/arm/arm/disassem.c ============================================================================== --- head/sys/arm/arm/disassem.c Thu Oct 12 15:48:37 2017 (r324561) +++ head/sys/arm/arm/disassem.c Thu Oct 12 15:53:54 2017 (r324562) @@ -131,6 +131,7 @@ static const struct arm32_insn arm32_i[] = { { 0x0c500000, 0x04400000, "strb", "daW" }, { 0x0c500000, 0x04500000, "ldrb", "daW" }, #if __ARM_ARCH >= 6 + { 0x0fff0ff0, 0x06bf0fb0, "rev16", "dm" }, { 0xffffffff, 0xf57ff01f, "clrex", "c" }, { 0x0ff00ff0, 0x01800f90, "strex", "dmo" }, { 0x0ff00fff, 0x01900f9f, "ldrex", "do" }, From owner-svn-src-head@freebsd.org Thu Oct 12 18:00:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBEEFE3078B; Thu, 12 Oct 2017 18:00:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED0071D0B; Thu, 12 Oct 2017 18:00:30 +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 v9CI0U2Z016842; Thu, 12 Oct 2017 18:00:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CI0Ujt016841; Thu, 12 Oct 2017 18:00:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201710121800.v9CI0Ujt016841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Thu, 12 Oct 2017 18:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324563 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 324563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 18:00:31 -0000 Author: manu Date: Thu Oct 12 18:00:29 2017 New Revision: 324563 URL: https://svnweb.freebsd.org/changeset/base/324563 Log: a10_ehci: Remove the passby code It doesn't seems to be needed anymore and this make ehci working again on the Pine64. Thanks to jmcneill@ for the help. Tested on: Pine64 (A64), OrangePi One (H3), BananapiM2 (A31s) Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Thu Oct 12 15:53:54 2017 (r324562) +++ head/sys/arm/allwinner/a10_ehci.c Thu Oct 12 18:00:29 2017 (r324563) @@ -65,17 +65,10 @@ __FBSDID("$FreeBSD$"); #define EHCI_HC_DEVSTR "Allwinner Integrated USB 2.0 controller" -#define SW_USB_PMU_IRQ_ENABLE 0x800 - #define SW_SDRAM_REG_HPCR_USB1 (0x250 + ((1 << 2) * 4)) #define SW_SDRAM_REG_HPCR_USB2 (0x250 + ((1 << 2) * 5)) #define SW_SDRAM_BP_HPCR_ACCESS (1 << 0) -#define SW_ULPI_BYPASS (1 << 0) -#define SW_AHB_INCRX_ALIGN (1 << 8) -#define SW_AHB_INCR4 (1 << 9) -#define SW_AHB_INCR8 (1 << 10) - #define USB_CONF(d) \ (void *)ofw_bus_search_compatible((d), compat_data)->ocd_data @@ -124,7 +117,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-ehci", (uintptr_t)&a10_ehci_conf }, { "allwinner,sun8i-a83t-ehci", (uintptr_t)&a31_ehci_conf }, { "allwinner,sun8i-h3-ehci", (uintptr_t)&a31_ehci_conf }, - /* { "allwinner,sun50i-a64-ehci", (uintptr_t)&a31_ehci_conf }, */ + { "allwinner,sun50i-a64-ehci", (uintptr_t)&a31_ehci_conf }, { NULL, (uintptr_t)NULL } }; @@ -254,14 +247,6 @@ a10_ehci_attach(device_t self) } } - /* Enable passby */ - reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); - reg_value |= SW_AHB_INCR8; /* AHB INCR8 enable */ - reg_value |= SW_AHB_INCR4; /* AHB burst type INCR4 enable */ - reg_value |= SW_AHB_INCRX_ALIGN; /* AHB INCRX align enable */ - reg_value |= SW_ULPI_BYPASS; /* ULPI bypass enable */ - A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); - /* Configure port */ if (conf->sdram_init) { reg_value = A10_READ_4(sc, SW_SDRAM_REG_HPCR_USB2); @@ -332,14 +317,6 @@ a10_ehci_detach(device_t self) reg_value &= ~SW_SDRAM_BP_HPCR_ACCESS; A10_WRITE_4(sc, SW_SDRAM_REG_HPCR_USB2, reg_value); } - - /* Disable passby */ - reg_value = A10_READ_4(sc, SW_USB_PMU_IRQ_ENABLE); - reg_value &= ~SW_AHB_INCR8; /* AHB INCR8 disable */ - reg_value &= ~SW_AHB_INCR4; /* AHB burst type INCR4 disable */ - reg_value &= ~SW_AHB_INCRX_ALIGN; /* AHB INCRX align disable */ - reg_value &= ~SW_ULPI_BYPASS; /* ULPI bypass disable */ - A10_WRITE_4(sc, SW_USB_PMU_IRQ_ENABLE, reg_value); /* Disable clock */ TAILQ_FOREACH_SAFE(clk, &aw_sc->clk_list, next, clk_tmp) { From owner-svn-src-head@freebsd.org Thu Oct 12 18:11:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C04F5E30E50; Thu, 12 Oct 2017 18:11:14 +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 4D68B27A0; Thu, 12 Oct 2017 18:11:14 +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 v9CIB9xJ065299 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 12 Oct 2017 21:11:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v9CIB9xJ065299 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v9CIB9dw065298; Thu, 12 Oct 2017 21:11:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Oct 2017 21:11:09 +0300 From: Konstantin Belousov To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324560 - in head: lib/libc/sys sys/kern Message-ID: <20171012181109.GE2473@kib.kiev.ua> References: <201710121545.v9CFjrOu058741@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710121545.v9CFjrOu058741@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 18:11:14 -0000 On Thu, Oct 12, 2017 at 03:45:53PM +0000, Ed Maste wrote: > Author: emaste > Date: Thu Oct 12 15:45:53 2017 > New Revision: 324560 > URL: https://svnweb.freebsd.org/changeset/base/324560 > > Log: > allow posix_fallocate in capability mode > > posix_fallocate is logically equivalent to writing zero blocks to the > desired file size and there is no reason to prevent calling it in > capability mode. posix_fallocate already checked for the CAP_WRITE > right, so we merely need to list it in capabilities.conf. > > Reviewed by: allanjude > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D12640 > > Modified: > head/lib/libc/sys/posix_fallocate.2 > head/sys/kern/capabilities.conf You should also update compat/freebsd32. > head/sys/kern/vfs_syscalls.c From owner-svn-src-head@freebsd.org Thu Oct 12 18:30:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B76B6E3153E; Thu, 12 Oct 2017 18:30:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8754F3369; Thu, 12 Oct 2017 18:30:55 +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 v9CIUseR029280; Thu, 12 Oct 2017 18:30:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CIUsvS029279; Thu, 12 Oct 2017 18:30:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710121830.v9CIUsvS029279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Oct 2017 18:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324564 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 324564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 18:30:55 -0000 Author: emaste Date: Thu Oct 12 18:30:54 2017 New Revision: 324564 URL: https://svnweb.freebsd.org/changeset/base/324564 Log: allow posix_fallocate in 32-bit compat capability mode Reported by: kib MFC after: 2 weeks MFC with: r324560 Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/freebsd32/capabilities.conf Modified: head/sys/compat/freebsd32/capabilities.conf ============================================================================== --- head/sys/compat/freebsd32/capabilities.conf Thu Oct 12 18:00:29 2017 (r324563) +++ head/sys/compat/freebsd32/capabilities.conf Thu Oct 12 18:30:54 2017 (r324564) @@ -200,6 +200,7 @@ pdkill freebsd32_pipe pipe2 poll +freebsd32_posix_fallocate freebsd32_pread freebsd32_preadv profil From owner-svn-src-head@freebsd.org Thu Oct 12 18:31:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D754E316E5; Thu, 12 Oct 2017 18:31:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E132B3541; Thu, 12 Oct 2017 18:31:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CIVTHi030023; Thu, 12 Oct 2017 18:31:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CIVTip030022; Thu, 12 Oct 2017 18:31:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710121831.v9CIVTip030022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 12 Oct 2017 18:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324565 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 324565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 18:31:30 -0000 Author: emaste Date: Thu Oct 12 18:31:28 2017 New Revision: 324565 URL: https://svnweb.freebsd.org/changeset/base/324565 Log: regen freebsd32_sysent.c after r324564 (freebsd32_posix_fallocate) Modified: head/sys/compat/freebsd32/freebsd32_sysent.c Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Oct 12 18:30:54 2017 (r324564) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Oct 12 18:31:28 2017 (r324565) @@ -602,11 +602,11 @@ struct sysent freebsd32_sysent[] = { { AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */ { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ #ifdef PAD64_REQUIRED - { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_POSIX_FADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ #else - { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_POSIX_FALLOCATE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_POSIX_FADVISE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ #endif From owner-svn-src-head@freebsd.org Thu Oct 12 19:58:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 570D5E3341F; Thu, 12 Oct 2017 19:58:22 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24C2265007; Thu, 12 Oct 2017 19:58:22 +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 v9CJwLJn067067; Thu, 12 Oct 2017 19:58:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CJwLTx067066; Thu, 12 Oct 2017 19:58:21 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201710121958.v9CJwLTx067066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 12 Oct 2017 19:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324566 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 324566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 19:58:22 -0000 Author: bdrewery Date: Thu Oct 12 19:58:21 2017 New Revision: 324566 URL: https://svnweb.freebsd.org/changeset/base/324566 Log: Fix shadowed variable hidden by WARNS changing to 3 in r313006. Sponsored by: Dell EMC Isilon MFC after: 1 week Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Thu Oct 12 18:31:28 2017 (r324565) +++ head/tests/sys/kern/ptrace_test.c Thu Oct 12 19:58:21 2017 (r324566) @@ -3084,7 +3084,7 @@ ATF_TC_BODY(ptrace__PT_ATTACH_with_SBDRY_thread, tc) ATF_REQUIRE((child = fork()) != -1); if (child == 0) { pthread_t t[2]; - int error, cfd; + int cfd; error = pthread_barrier_wait(&barrier); if (error != 0 && error != PTHREAD_BARRIER_SERIAL_THREAD) From owner-svn-src-head@freebsd.org Thu Oct 12 20:04:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCAA8E33702; Thu, 12 Oct 2017 20:04:12 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: from vlakno.cz (mail.vlakno.cz [91.217.96.224]) by mx1.freebsd.org (Postfix) with ESMTP id 805A9654C1; Thu, 12 Oct 2017 20:04:11 +0000 (UTC) (envelope-from rdivacky@vlakno.cz) Received: by vlakno.cz (Postfix, from userid 1002) id D14BBDF7DBB; Thu, 12 Oct 2017 21:53:17 +0200 (CEST) Date: Thu, 12 Oct 2017 21:53:17 +0200 From: Roman Divacky To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324511 - head/contrib/binutils/bfd Message-ID: <20171012195317.GA3199@vlakno.cz> References: <201710110239.v9B2dKlx022588@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710110239.v9B2dKlx022588@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 20:04:12 -0000 Note that this allows to use C++ EH on a gcc built PPC64 world for applications built by clang++. Roman On Wed, Oct 11, 2017 at 02:39:20AM +0000, Justin Hibbits wrote: > Author: jhibbits > Date: Wed Oct 11 02:39:20 2017 > New Revision: 324511 > URL: https://svnweb.freebsd.org/changeset/base/324511 > > Log: > Do exception offset computations in 64 bits, not 32. > > This fixes clang-built binaries on a gcc powerpc64 world. Gets us one step > closer to a clang-built world. The same change was made in later upstream > binutils. > > Submitted by: rdivacky > MFC after: 2 weeks > > Modified: > head/contrib/binutils/bfd/elf-eh-frame.c > > Modified: head/contrib/binutils/bfd/elf-eh-frame.c > ============================================================================== > --- head/contrib/binutils/bfd/elf-eh-frame.c Wed Oct 11 00:31:54 2017 (r324510) > +++ head/contrib/binutils/bfd/elf-eh-frame.c Wed Oct 11 02:39:20 2017 (r324511) > @@ -1344,7 +1344,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, > > val = read_value (abfd, buf, per_width, > get_DW_EH_PE_signed (per_encoding)); > - val += ent->offset - ent->new_offset; > + val += (bfd_vma)ent->offset - ent->new_offset; > val -= extra_string + extra_data; > write_value (abfd, buf, val, per_width); > action &= ~4; > @@ -1400,7 +1400,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, > } > break; > case DW_EH_PE_pcrel: > - value += ent->offset - ent->new_offset; > + value += (bfd_vma)ent->offset - ent->new_offset; > address += sec->output_section->vma + ent->offset + 8; > break; > } > @@ -1428,7 +1428,7 @@ _bfd_elf_write_section_eh_frame (bfd *abfd, > if (value) > { > if ((ent->lsda_encoding & 0xf0) == DW_EH_PE_pcrel) > - value += ent->offset - ent->new_offset; > + value += (bfd_vma)ent->offset - ent->new_offset; > else if (ent->cie_inf->need_lsda_relative) > value -= (sec->output_section->vma + ent->new_offset + 8 > + ent->lsda_offset); > _______________________________________________ > 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 Oct 12 20:31:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCF1DE33EA1; Thu, 12 Oct 2017 20:31:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 591A465F80; Thu, 12 Oct 2017 20:31:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CKVAfh079601; Thu, 12 Oct 2017 20:31:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CKVAnh079600; Thu, 12 Oct 2017 20:31:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710122031.v9CKVAnh079600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 12 Oct 2017 20:31:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324567 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 324567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 20:31:11 -0000 Author: gjb Date: Thu Oct 12 20:31:10 2017 New Revision: 324567 URL: https://svnweb.freebsd.org/changeset/base/324567 Log: Add arm/armv7 checks to env_check(). Sponsored by: The FreeBSD Foundation Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Thu Oct 12 19:58:21 2017 (r324566) +++ head/release/release.sh Thu Oct 12 20:31:10 2017 (r324567) @@ -148,7 +148,7 @@ env_check() { WITH_COMPRESSED_IMAGES= NODOC=yes case ${EMBEDDED_TARGET}:${EMBEDDED_TARGET_ARCH} in - arm:armv6|arm64:aarch64) + arm:armv6|arm:armv7|arm64:aarch64) chroot_build_release_cmd="chroot_arm_build_release" ;; *) From owner-svn-src-head@freebsd.org Thu Oct 12 21:25:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54072E351AE; Thu, 12 Oct 2017 21:25:12 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FDD767A9F; Thu, 12 Oct 2017 21:25:12 +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 v9CLPBeH004345; Thu, 12 Oct 2017 21:25:11 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CLPBm7004344; Thu, 12 Oct 2017 21:25:11 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201710122125.v9CLPBm7004344@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 12 Oct 2017 21:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324568 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Commit-Revision: 324568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 21:25:12 -0000 Author: asomers Date: Thu Oct 12 21:25:11 2017 New Revision: 324568 URL: https://svnweb.freebsd.org/changeset/base/324568 Log: Optimize zpool_read_all_labels with AIO Read all labels in parallel instead of sequentially MFC after: 3 weeks X-MFC-With: 322854 Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D12495 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Oct 12 20:31:10 2017 (r324567) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Thu Oct 12 21:25:11 2017 (r324568) @@ -42,6 +42,7 @@ * using our derived config, and record the results. */ +#include #include #include #include @@ -919,13 +920,17 @@ zpool_read_label(int fd, nvlist_t **config) * Given a file descriptor, read the label information and return an nvlist * describing the configuration, if there is one. * returns the number of valid labels found + * If a label is found, returns it via config. The caller is responsible for + * freeing it. */ int zpool_read_all_labels(int fd, nvlist_t **config) { struct stat64 statbuf; + struct aiocb aiocbs[VDEV_LABELS]; + struct aiocb *aiocbps[VDEV_LABELS]; int l; - vdev_label_t *label; + vdev_label_t *labels; uint64_t state, txg, size; int nlabels = 0; @@ -935,19 +940,39 @@ zpool_read_all_labels(int fd, nvlist_t **config) return (0); size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t); - if ((label = malloc(sizeof (vdev_label_t))) == NULL) + if ((labels = calloc(VDEV_LABELS, sizeof (vdev_label_t))) == NULL) return (0); + memset(aiocbs, 0, sizeof(aiocbs)); for (l = 0; l < VDEV_LABELS; l++) { + aiocbs[l].aio_fildes = fd; + aiocbs[l].aio_offset = label_offset(size, l); + aiocbs[l].aio_buf = &labels[l]; + aiocbs[l].aio_nbytes = sizeof(vdev_label_t); + aiocbs[l].aio_lio_opcode = LIO_READ; + aiocbps[l] = &aiocbs[l]; + } + + if (lio_listio(LIO_WAIT, aiocbps, VDEV_LABELS, NULL) != 0) { + if (errno == EAGAIN || errno == EINTR || errno == EIO) { + for (l = 0; l < VDEV_LABELS; l++) { + errno = 0; + int r = aio_error(&aiocbs[l]); + if (r != EINVAL) + (void)aio_return(&aiocbs[l]); + } + } + return (0); + } + + for (l = 0; l < VDEV_LABELS; l++) { nvlist_t *temp = NULL; - /* TODO: use aio_read so we can read al 4 labels in parallel */ - if (pread64(fd, label, sizeof (vdev_label_t), - label_offset(size, l)) != sizeof (vdev_label_t)) + if (aio_return(&aiocbs[l]) != sizeof(vdev_label_t)) continue; - if (nvlist_unpack(label->vl_vdev_phys.vp_nvlist, - sizeof (label->vl_vdev_phys.vp_nvlist), &temp, 0) != 0) + if (nvlist_unpack(labels[l].vl_vdev_phys.vp_nvlist, + sizeof (labels[l].vl_vdev_phys.vp_nvlist), &temp, 0) != 0) continue; if (nvlist_lookup_uint64(temp, ZPOOL_CONFIG_POOL_STATE, @@ -970,7 +995,7 @@ zpool_read_all_labels(int fd, nvlist_t **config) nlabels++; } - free(label); + free(labels); return (nlabels); } From owner-svn-src-head@freebsd.org Thu Oct 12 21:26:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F05BBE35264; Thu, 12 Oct 2017 21:26:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF54E67C42; Thu, 12 Oct 2017 21:26:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CLQqpW004452; Thu, 12 Oct 2017 21:26:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CLQqAm004451; Thu, 12 Oct 2017 21:26:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201710122126.v9CLQqAm004451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 12 Oct 2017 21:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324569 - head/sys/dev/dpaa X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/dpaa X-SVN-Commit-Revision: 324569 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 21:26:54 -0000 Author: glebius Date: Thu Oct 12 21:26:52 2017 New Revision: 324569 URL: https://svnweb.freebsd.org/changeset/base/324569 Log: Fix build after r324446. Modified: head/sys/dev/dpaa/if_dtsec_rm.c Modified: head/sys/dev/dpaa/if_dtsec_rm.c ============================================================================== --- head/sys/dev/dpaa/if_dtsec_rm.c Thu Oct 12 21:25:11 2017 (r324568) +++ head/sys/dev/dpaa/if_dtsec_rm.c Thu Oct 12 21:26:52 2017 (r324569) @@ -347,7 +347,7 @@ dtsec_rm_fqr_mext_free(struct mbuf *m) if (bman_count(sc->sc_rx_pool) <= DTSEC_RM_POOL_RX_MAX_SIZE) bman_put_buffer(sc->sc_rx_pool, buffer); else - dtsec_rm_pool_rx_put_buffer(arg, buffer, NULL); + dtsec_rm_pool_rx_put_buffer(sc, buffer, NULL); } static e_RxStoreResponse From owner-svn-src-head@freebsd.org Thu Oct 12 21:57:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0320DE36199; Thu, 12 Oct 2017 21:57:00 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D23F569882; Thu, 12 Oct 2017 21:56:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CLux7B017134; Thu, 12 Oct 2017 21:56:59 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CLuwH4017132; Thu, 12 Oct 2017 21:56:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201710122156.v9CLuwH4017132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 12 Oct 2017 21:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324570 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 324570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 21:57:00 -0000 Author: adrian Date: Thu Oct 12 21:56:58 2017 New Revision: 324570 URL: https://svnweb.freebsd.org/changeset/base/324570 Log: [net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path. The duplicate detection code currently expects A-MSDU frames to be encaped - they're decap'ed /after/ duplicate detection. However for ath10k (and iwm hardware later on) the firmware supports doing A-MSDU decap in hardware - which shows up as multiple frames with the same sequence number and IV. This is the first part of decap handling - if we see a stretch of A-MSDU frames from the driver with the MORE bit set, then don't treat them as duplicates. This isn't 100% complete as crypto sequence number handling and "A-MSDU in A-MPDU" needs handling, but it's a start. This should be a glorified no-op for everyone. Please tell me if it isn't. Modified: head/sys/net80211/ieee80211_input.h head/sys/net80211/ieee80211_ioctl.h Modified: head/sys/net80211/ieee80211_input.h ============================================================================== --- head/sys/net80211/ieee80211_input.h Thu Oct 12 21:26:52 2017 (r324569) +++ head/sys/net80211/ieee80211_input.h Thu Oct 12 21:56:58 2017 (r324570) @@ -131,7 +131,39 @@ ishtinfooui(const uint8_t *frm) return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI); } +static __inline int +ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs) +{ + + return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU)); +} + /* + * Return 1 if the rxseq check should increment the sequence + * number. Return 0 if it's part of an AMSDU batch and it isn't + * the final frame in the decap'ed burst. + */ +static __inline int +ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs) +{ + /* No state? ok */ + if (rxs == NULL) + return (1); + + /* State but no AMSDU set? ok */ + if ((rxs->c_pktflags & IEEE80211_RX_F_AMSDU) == 0) + return (1); + + /* State, AMSDU set, then _MORE means "don't inc yet" */ + if (rxs->c_pktflags & IEEE80211_RX_F_AMSDU_MORE) { + return (0); + } + + /* Both are set, so return ok */ + return (1); +} + +/* * Check the current frame sequence number against the current TID * state and return whether it's in sequence or should be dropped. * @@ -238,7 +270,20 @@ ieee80211_check_rxseq(struct ieee80211_node *ni, struc goto fail; ok: - ni->ni_rxseqs[tid] = rxseq; + /* + * Only bump the sequence number if it's the last frame + * in a batch. That way frames in the rest of the batch + * get included, and the last frame in the batch kicks + * it next. + */ + if (ieee80211_check_rxseq_amsdu_more(rxs)) { + ni->ni_rxseqs[tid] = rxseq; + if (ieee80211_check_rxseq_amsdu(rxs)) + IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); + } else { + /* .. still waiting */ + IEEE80211_NODE_STAT(ni, rx_amsdu_more); + } return 1; Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Thu Oct 12 21:26:52 2017 (r324569) +++ head/sys/net80211/ieee80211_ioctl.h Thu Oct 12 21:56:58 2017 (r324570) @@ -84,7 +84,11 @@ struct ieee80211_nodestats { uint32_t ns_tx_deauth_code; /* last deauth reason */ uint32_t ns_tx_disassoc; /* disassociations */ uint32_t ns_tx_disassoc_code; /* last disassociation reason */ - uint32_t ns_spare[8]; + + /* Hardware A-MSDU decode */ + uint32_t ns_rx_amsdu_more; /* RX decap A-MSDU, more coming from A-MSDU */ + uint32_t ns_rx_amsdu_more_end; /* RX decap A-MSDU (or any other frame), no more coming */ + uint32_t ns_spare[6]; }; /* From owner-svn-src-head@freebsd.org Thu Oct 12 21:58:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E66EE36293; Thu, 12 Oct 2017 21:58:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C5B069A23; Thu, 12 Oct 2017 21:58:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CLwppu017239; Thu, 12 Oct 2017 21:58:51 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CLwpPX017238; Thu, 12 Oct 2017 21:58:51 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201710122158.v9CLwpPX017238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 12 Oct 2017 21:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324571 - head/sys/dev/ath X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath X-SVN-Commit-Revision: 324571 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 21:58:52 -0000 Author: adrian Date: Thu Oct 12 21:58:51 2017 New Revision: 324571 URL: https://svnweb.freebsd.org/changeset/base/324571 Log: [ath] Begin using the replacement EDCA functions. As part of ath10k and other chipset support, the EDCA stuff has to be moved to potentially be per-VAP. For hardware that doesn't support it (ie, everything that we currently support) it can just fetch the "current" global EDCA parameters for the NIC. This is one of those parameters that is linked to the currently active channel context / VAP in Linux mac80211 parlance. Tested: * ath(4), STA and AP modes Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Oct 12 21:56:58 2017 (r324570) +++ head/sys/dev/ath/if_ath.c Thu Oct 12 21:58:51 2017 (r324571) @@ -4049,9 +4049,13 @@ ath_txq_update(struct ath_softc *sc, int ac) #define ATH_EXPONENT_TO_VALUE(v) ((1<sc_ic; struct ath_txq *txq = sc->sc_ac2q[ac]; - struct wmeParams *wmep = &ic->ic_wme.wme_chanParams.cap_wmeParams[ac]; + struct chanAccParams chp; + struct wmeParams *wmep; struct ath_hal *ah = sc->sc_ah; HAL_TXQ_INFO qi; + + ieee80211_wme_ic_getparams(ic, &chp); + wmep = &chp.cap_wmeParams[ac]; ath_hal_gettxqueueprops(ah, txq->axq_qnum, &qi); #ifdef IEEE80211_SUPPORT_TDMA From owner-svn-src-head@freebsd.org Fri Oct 13 01:53:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D1E3E3A249; Fri, 13 Oct 2017 01:53:47 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 15F5B6F6AE; Fri, 13 Oct 2017 01:53:46 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 2pAPeEYz68LPZ2pAQeSJdy; Thu, 12 Oct 2017 19:53:40 -0600 X-Authority-Analysis: v=2.2 cv=e552ceh/ c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=wc-4pM-bQDIXAEspKtoA:9 a=vIDOfcrwHqujqwnU:21 a=sjZW-vsJ84S7-BPG:21 a=TocCdJf0WWuU3Xzv:21 a=CjuIK1q_8ugA: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 A6ECAF0; Thu, 12 Oct 2017 18:53:36 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v9D1rahI002918; Thu, 12 Oct 2017 18:53:36 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710130153.v9D1rahI002918@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Adrian Chadd cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324570 - head/sys/net80211 In-Reply-To: Message from Adrian Chadd of "Thu, 12 Oct 2017 21:56:58 -0000." <201710122156.v9CLuwH4017132@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 12 Oct 2017 18:53:36 -0700 X-CMAE-Envelope: MS4wfMzYFwiCim5A2HNVmkrmEzA1+Z6m3/64w+RCuBv/jv1AsTFnHQNLZdTUp59oBQASHJ0wHcVjaMg7aTBLMJA6PPlvdHvN4D9b6pUncbkCs8CUqzjzPMZ3 pK4t/bhZWmW3GRFyr28bdpk5MQ9p0d8WgQCgoprIjasfZox3kq3odWGLAuQIpTpmCf3fnQLxwNQSZ8m0jG655qLC7Q+/EndlVf7hvU/p5p2XJ7efp1F0mSG2 syvPI3HYIDD9T2dSeZ6fMCqL+xt8dE0hfhaAQPNbt0hkSW1fBQvPqkcSCCmqVwO+ X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 13 Oct 2017 01:53:47 -0000 In message <201710122156.v9CLuwH4017132@repo.freebsd.org>, Adrian Chadd writes: > Author: adrian > Date: Thu Oct 12 21:56:58 2017 > New Revision: 324570 > URL: https://svnweb.freebsd.org/changeset/base/324570 > > Log: > [net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path. > > The duplicate detection code currently expects A-MSDU frames to be encaped > - > they're decap'ed /after/ duplicate detection. > > However for ath10k (and iwm hardware later on) the firmware supports > doing A-MSDU decap in hardware - which shows up as multiple frames with > the same sequence number and IV. > > This is the first part of decap handling - if we see a stretch of A-MSDU > frames from the driver with the MORE bit set, then don't treat them > as duplicates. > > This isn't 100% complete as crypto sequence number handling and "A-MSDU in > A-MPDU" needs handling, but it's a start. > > This should be a glorified no-op for everyone. Please tell me if it isn't. > Hi Adrian, This is causing iwn in my laptop a bit of gas. wlan0: Ethernet address: 20:6a:8a:72:03:17 <118>Created wlan(4) interfaces: wlan0. <118>Created clone interfaces: lagg0. <5>bge0: link state changed to DOWN iwn0: iwn_read_firmware: ucode rev=0x12a80601 <118>Starting wpa_supplicant. <5>lagg0: link state changed to DOWN iwn0: iwn_read_firmware: ucode rev=0x12a80601 <118>Starting dhclient. <118>lagg0: no link ... Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x4 fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff8155cd59 stack pointer = 0x28:0xfffffe01491e4790 frame pointer = 0x28:0xfffffe01491e4830 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (irq265: iwn0) trap number = 12 panic: page fault cpuid = 0 time = 1507858438 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01491e4370 vpanic() at vpanic+0x19c/frame 0xfffffe01491e43f0 panic() at panic+0x43/frame 0xfffffe01491e4450 trap_fatal() at trap_fatal+0x34d/frame 0xfffffe01491e44a0 trap_pfault() at trap_pfault+0x49/frame 0xfffffe01491e4500 trap() at trap+0x2a9/frame 0xfffffe01491e46c0 calltrap() at calltrap+0x8/frame 0xfffffe01491e46c0 --- trap 0xc, rip = 0xffffffff8155cd59, rsp = 0xfffffe01491e4790, rbp = 0xfffffe01491e4830 --- sta_input() at sta_input+0xb89/frame 0xfffffe01491e4830 iwn_notif_intr() at iwn_notif_intr+0x15f7/frame 0xfffffe01491e4970 iwn_intr() at iwn_intr+0x5a0/frame 0xfffffe01491e49e0 intr_event_execute_handlers() at intr_event_execute_handlers+0xec/frame 0xfffffe01491e4a20 ithread_loop() at ithread_loop+0xd6/frame 0xfffffe01491e4a70 fork_exit() at fork_exit+0x85/frame 0xfffffe01491e4ab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe01491e4ab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 29s Dumping 704 out of 7978 MB:..3%..12%..21%..32%..41%..53%..62%..71%..82%..91% Loaded symbols for /boot/kernel/nullfs.ko #0 doadump (textdump=1) at pcpu.h:232 232 pcpu.h: No such file or directory. in pcpu.h (kgdb) bt #0 doadump (textdump=1) at pcpu.h:232 #1 0xffffffff80583eb6 in kern_reboot (howto=260) at /opt/src/svn-current/sys/kern/kern_shutdown.c:386 #2 0xffffffff805843a6 in vpanic (fmt=, ap=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 #3 0xffffffff805841c3 in panic (fmt=) at /opt/src/svn-current/sys/kern/kern_shutdown.c:710 #4 0xffffffff80886a8d in trap_fatal (frame=0xfffffe01491e46d0, eva=4) at /opt/src/svn-current/sys/amd64/amd64/trap.c:799 #5 0xffffffff80886ae9 in trap_pfault (frame=0xfffffe01491e46d0, usermode=0) at pcpu.h:232 #6 0xffffffff80886339 in trap (frame=0xfffffe01491e46d0) at /opt/src/svn-current/sys/amd64/amd64/trap.c:420 #7 0xffffffff8086acf1 in calltrap () at /opt/src/svn-current/sys/amd64/amd6 4/exception.S:237 #8 0xffffffff8155cd59 in sta_input (ni=0xfffffe0012651000, m=0xfffff80004040e00, rxs=0x0, rssi=63, nf=-95) at ieee80211_input.h:280 #9 0xffffffff81513987 in iwn_notif_intr () from /boot/kernel/if_iwn.ko #10 0xffffffff8150a270 in iwn_intr () from /boot/kernel/if_iwn.ko #11 0xffffffff80548dcc in intr_event_execute_handlers (p=, ie=0xfffff80002b06800) at /opt/src/svn-current/sys/kern/kern_intr.c:13 36 #12 0xffffffff80549496 in ithread_loop (arg=0xfffff80002b50c20) at /opt/src/svn-current/sys/kern/kern_intr.c:1349 #13 0xffffffff80546135 in fork_exit (callout=0xffffffff805493c0 , arg=0xfffff80002b50c20, frame=0xfffffe01491e4ac0) at /opt/src/svn-current/sys/kern/kern_fork.c:1044 #14 0xffffffff8086b2de in fork_trampoline () at /opt/src/svn-current/sys/amd 64/amd64/exception.S:651 #15 0x0000000000000000 in ?? () Current language: auto; currently minimal -- 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 Fri Oct 13 06:45:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B5FE3E986; Fri, 13 Oct 2017 06:45:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C759976107; Fri, 13 Oct 2017 06:45:37 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x22b.google.com with SMTP id k4so18896769wmc.1; Thu, 12 Oct 2017 23:45:37 -0700 (PDT) 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=LkFOsrHRWcFPKf+urX4HANpxEusyo47Vy3x7sa4GzK0=; b=NHmqBKg+mcGkclG36WVbvTNN/iNOiHCP5/dFjWC0x4xyyT9sD/zXNPUEm6n/1EKTaN dahUw7BU2vdMdge1PSrldbeBR3St9KF3A05DDmmjttoQ+5Hw0Eomc5KWWPq6JZYVwJme GR2Yc/QcnuZjXaj365mT1ngI9TaUOPKKojJ+5Tuy43aEqZEP3OCa4t+EFFTHkIO9GfbH 8xeP8b585kGQpHCVvV1bNJSm7SjWIea+SBXVW1BCaDxsI86lM8y7D0CfBOXjpkWZHxOt LBxIII8dzT8XexCmMeAGVkb+F6GvZ7OeV676DRX2zlt1YWztgVY5biQ4d5FnFLVbhvly gSGg== 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=LkFOsrHRWcFPKf+urX4HANpxEusyo47Vy3x7sa4GzK0=; b=tJjZPLXZDcUYRFYlsZqwiLXS3k4x/4w5e8mgYLsrgcrkYmlfkVnbGWcBpPHfGVJdmw oGS/6bX0IbOEwlRdSUNa67ijP1yR3RqtxUBu2YB6ZvhZf83VwZyKWFmlSVZ8BNpMNFqs P+vkCyAFJhH9KK9jgNj08/DLOG2Qj+SGWieoXXuffEHPSNyyWbrHmWR+E1GeNjkdsppL yUnttgumhYIJyxLLF6mpPpI6HFqEV156ya2R6schEs/S+nXS7dWTAuvcBnnzr9Sia6J2 Rxp4HQiTB0lgwJ+yc0Vm+5QKoOmbfESy+UF9ouiJphKgORkKPq0hf09iADsW9ifhALKh p8Pw== X-Gm-Message-State: AMCzsaVBoPF6v63DTy4kjt0qAzREXzDIS/kW/BwRdaxR8BlPiTu08Bm3 h2A68syccTZVH7zlBG3U+RxiGsPgvMIcltC4/NeewA== X-Google-Smtp-Source: AOwi7QC7Xx3swapV3Va7lYtGm9TMwKiFY9/IgUkbQaBTu63am3uasbq+kyXNW53XGXfEcBRgMEnTzs+G97ILTpLZBrU= X-Received: by 10.223.138.231 with SMTP id z36mr456520wrz.154.1507877136237; Thu, 12 Oct 2017 23:45:36 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.28.86.70 with HTTP; Thu, 12 Oct 2017 23:45:35 -0700 (PDT) In-Reply-To: <201710130153.v9D1rahI002918@slippy.cwsent.com> References: <201710122156.v9CLuwH4017132@repo.freebsd.org> <201710130153.v9D1rahI002918@slippy.cwsent.com> From: Adrian Chadd Date: Thu, 12 Oct 2017 23:45:35 -0700 X-Google-Sender-Auth: 9vsK9DtVncoQM-i96_olem1Uc6w Message-ID: Subject: Re: svn commit: r324570 - head/sys/net80211 To: Cy Schubert Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 06:45:38 -0000 god damnit. lemme go look at what's going on. thanks for the heads up! -a On 12 October 2017 at 18:53, Cy Schubert wrote: > In message <201710122156.v9CLuwH4017132@repo.freebsd.org>, Adrian Chadd > writes: >> Author: adrian >> Date: Thu Oct 12 21:56:58 2017 >> New Revision: 324570 >> URL: https://svnweb.freebsd.org/changeset/base/324570 >> >> Log: >> [net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path. >> >> The duplicate detection code currently expects A-MSDU frames to be encaped >> - >> they're decap'ed /after/ duplicate detection. >> >> However for ath10k (and iwm hardware later on) the firmware supports >> doing A-MSDU decap in hardware - which shows up as multiple frames with >> the same sequence number and IV. >> >> This is the first part of decap handling - if we see a stretch of A-MSDU >> frames from the driver with the MORE bit set, then don't treat them >> as duplicates. >> >> This isn't 100% complete as crypto sequence number handling and "A-MSDU in >> A-MPDU" needs handling, but it's a start. >> >> This should be a glorified no-op for everyone. Please tell me if it isn't. >> > > Hi Adrian, > > This is causing iwn in my laptop a bit of gas. > > wlan0: Ethernet address: 20:6a:8a:72:03:17 > <118>Created wlan(4) interfaces: wlan0. > <118>Created clone interfaces: lagg0. > <5>bge0: link state changed to DOWN > iwn0: iwn_read_firmware: ucode rev=0x12a80601 > <118>Starting wpa_supplicant. > <5>lagg0: link state changed to DOWN > iwn0: iwn_read_firmware: ucode rev=0x12a80601 > <118>Starting dhclient. > <118>lagg0: no link ... > > > Fatal trap 12: page fault while in kernel mode > cpuid = 0; apic id = 00 > fault virtual address = 0x4 > fault code = supervisor read data, page not present > instruction pointer = 0x20:0xffffffff8155cd59 > stack pointer = 0x28:0xfffffe01491e4790 > frame pointer = 0x28:0xfffffe01491e4830 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags = interrupt enabled, resume, IOPL = 0 > current process = 12 (irq265: iwn0) > trap number = 12 > panic: page fault > cpuid = 0 > time = 1507858438 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe01491e4370 > vpanic() at vpanic+0x19c/frame 0xfffffe01491e43f0 > panic() at panic+0x43/frame 0xfffffe01491e4450 > trap_fatal() at trap_fatal+0x34d/frame 0xfffffe01491e44a0 > trap_pfault() at trap_pfault+0x49/frame 0xfffffe01491e4500 > trap() at trap+0x2a9/frame 0xfffffe01491e46c0 > calltrap() at calltrap+0x8/frame 0xfffffe01491e46c0 > --- trap 0xc, rip = 0xffffffff8155cd59, rsp = 0xfffffe01491e4790, rbp = > 0xfffffe01491e4830 --- > sta_input() at sta_input+0xb89/frame 0xfffffe01491e4830 > iwn_notif_intr() at iwn_notif_intr+0x15f7/frame 0xfffffe01491e4970 > iwn_intr() at iwn_intr+0x5a0/frame 0xfffffe01491e49e0 > intr_event_execute_handlers() at intr_event_execute_handlers+0xec/frame > 0xfffffe01491e4a20 > ithread_loop() at ithread_loop+0xd6/frame 0xfffffe01491e4a70 > fork_exit() at fork_exit+0x85/frame 0xfffffe01491e4ab0 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe01491e4ab0 > --- trap 0, rip = 0, rsp = 0, rbp = 0 --- > Uptime: 29s > Dumping 704 out of 7978 MB:..3%..12%..21%..32%..41%..53%..62%..71%..82%..91% > > > Loaded symbols for /boot/kernel/nullfs.ko > #0 doadump (textdump=1) at pcpu.h:232 > 232 pcpu.h: No such file or directory. > in pcpu.h > (kgdb) bt > #0 doadump (textdump=1) at pcpu.h:232 > #1 0xffffffff80583eb6 in kern_reboot (howto=260) at > /opt/src/svn-current/sys/kern/kern_shutdown.c:386 > #2 0xffffffff805843a6 in vpanic (fmt=, ap= optimized out>) at /opt/src/svn-current/sys/kern/kern_shutdown.c:779 > #3 0xffffffff805841c3 in panic (fmt=) at > /opt/src/svn-current/sys/kern/kern_shutdown.c:710 > #4 0xffffffff80886a8d in trap_fatal (frame=0xfffffe01491e46d0, eva=4) at > /opt/src/svn-current/sys/amd64/amd64/trap.c:799 > #5 0xffffffff80886ae9 in trap_pfault (frame=0xfffffe01491e46d0, > usermode=0) at pcpu.h:232 > #6 0xffffffff80886339 in trap (frame=0xfffffe01491e46d0) at > /opt/src/svn-current/sys/amd64/amd64/trap.c:420 > #7 0xffffffff8086acf1 in calltrap () at /opt/src/svn-current/sys/amd64/amd6 > 4/exception.S:237 > #8 0xffffffff8155cd59 in sta_input (ni=0xfffffe0012651000, > m=0xfffff80004040e00, rxs=0x0, rssi=63, nf=-95) at ieee80211_input.h:280 > #9 0xffffffff81513987 in iwn_notif_intr () from /boot/kernel/if_iwn.ko > #10 0xffffffff8150a270 in iwn_intr () from /boot/kernel/if_iwn.ko > #11 0xffffffff80548dcc in intr_event_execute_handlers (p= out>, ie=0xfffff80002b06800) at /opt/src/svn-current/sys/kern/kern_intr.c:13 > 36 > #12 0xffffffff80549496 in ithread_loop (arg=0xfffff80002b50c20) at > /opt/src/svn-current/sys/kern/kern_intr.c:1349 > #13 0xffffffff80546135 in fork_exit (callout=0xffffffff805493c0 > , arg=0xfffff80002b50c20, frame=0xfffffe01491e4ac0) at > /opt/src/svn-current/sys/kern/kern_fork.c:1044 > #14 0xffffffff8086b2de in fork_trampoline () at /opt/src/svn-current/sys/amd > 64/amd64/exception.S:651 > #15 0x0000000000000000 in ?? () > Current language: auto; currently minimal > > > -- > 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 Fri Oct 13 06:49:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9F87E3EA80; Fri, 13 Oct 2017 06:49:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78BB07628E; Fri, 13 Oct 2017 06:49:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D6n7aP036283; Fri, 13 Oct 2017 06:49:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D6n7cI036282; Fri, 13 Oct 2017 06:49:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201710130649.v9D6n7cI036282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 13 Oct 2017 06:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324580 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 324580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 06:49:08 -0000 Author: adrian Date: Fri Oct 13 06:49:07 2017 New Revision: 324580 URL: https://svnweb.freebsd.org/changeset/base/324580 Log: [net80211] don't try to follow a NULL rxs pointer down the sink. It's smelly, and we already checked earlier whether we needed to. Modified: head/sys/net80211/ieee80211_input.h Modified: head/sys/net80211/ieee80211_input.h ============================================================================== --- head/sys/net80211/ieee80211_input.h Fri Oct 13 05:14:54 2017 (r324579) +++ head/sys/net80211/ieee80211_input.h Fri Oct 13 06:49:07 2017 (r324580) @@ -278,7 +278,7 @@ ok: */ if (ieee80211_check_rxseq_amsdu_more(rxs)) { ni->ni_rxseqs[tid] = rxseq; - if (ieee80211_check_rxseq_amsdu(rxs)) + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); } else { /* .. still waiting */ From owner-svn-src-head@freebsd.org Fri Oct 13 07:13:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A2E5E3F39B; Fri, 13 Oct 2017 07:13:50 +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 E6A6177410; Fri, 13 Oct 2017 07:13:49 +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 C56CD260444; Fri, 13 Oct 2017 09:13:40 +0200 (CEST) Subject: Re: svn commit: r324580 - head/sys/net80211 To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710130649.v9D6n7cI036282@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Fri, 13 Oct 2017 09:11:04 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201710130649.v9D6n7cI036282@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 07:13:50 -0000 On 10/13/17 08:49, Adrian Chadd wrote: > if (ieee80211_check_rxseq_amsdu_more(rxs)) { ^^^ does this line also need a NULL check? > ni->ni_rxseqs[tid] = rxseq; > - if (ieee80211_check_rxseq_amsdu(rxs)) > + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) > IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); --HPS From owner-svn-src-head@freebsd.org Fri Oct 13 07:45:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52C3EE3FA82; Fri, 13 Oct 2017 07:45:26 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::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 DAF587C0FF; Fri, 13 Oct 2017 07:45:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x236.google.com with SMTP id q132so19257715wmd.2; Fri, 13 Oct 2017 00:45:25 -0700 (PDT) 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=zn7+OzUVGR/0au3MSGLTP9Mls9+yX1oTJHpRWt5Rkaw=; b=rodULI+76OxMwFi1Xbk9ovnvShrsWsQoe5kq3k3F+E924fa/IAUtCceOAudTv0POxZ wHgP0EgtwqKRmLfl2qDQOJCf2ABXg/T4a9vW4cg8PogKTlMGWntdYEeakVN0V6y5jl2b C4exgKVkxxjBE+6E/omKcUzGiturJPWMWDv/Pk8C3P4T7v3edI/Ma57pSP/kXqpmn/Sx P2ALF85jtxu1EHlsPWChxjdsdZpBScBnX+AEGSqyKkgCQOdqTCPSPIqDGSH/Oer5diNk 2zx3LaNeggQiY39yDCNSLeueXc3zBXQyZGoXYx0a357njogJ6pnv0EE9OFvm30/cpvzr fQPw== 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=zn7+OzUVGR/0au3MSGLTP9Mls9+yX1oTJHpRWt5Rkaw=; b=Id4Wwtv0uuXo2Zca0G8Ly5rcO6XeP9IMvQaSKicQvPZ1edjytuySoDrU3T4XgdpR06 g0kGnEcNk5Yl/J0d2XUB604E/Hq1/VoVqQeMz23cDUS4onFj8GgQjLOSZ8MDDLrghiR8 iOhv0BAybnjqMxyvwA2GNGPWq9rjDSZSdH0nYNs/Uj/+FywZ7eplhKGITRyfezv9fVZc g+YW8eB41uAw9ZexzmNGeX4M4iOif5zJ5yIxxYnwEBAGrNSOwGIjyOEHptzijv9yTj1E Ct3t4WGBInB75/d3L8OCCm61M7mexJg9o7DV2U8MPjzV3kqqlfNT5ZeiX4NUTlXC73jV Hl+Q== X-Gm-Message-State: AMCzsaXu4t7U6JbrnMqpbKezsfsNdmbsMB+LiAVwF2w7cUTiDVhrdiPA sKa2pt0Z5UwmDOQKvUDgyfxd0NaRhLXHPrcqAX+Ylw== X-Google-Smtp-Source: AOwi7QCBox+IaU2uYQCatatZGdiULVMFdjpKGOeTJUncjdvKYjHUNF2ube3hT2EsR1arAvHOIHTbevarkfsdzVXC+MY= X-Received: by 10.223.157.141 with SMTP id p13mr606051wre.92.1507880724146; Fri, 13 Oct 2017 00:45:24 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.28.86.70 with HTTP; Fri, 13 Oct 2017 00:45:23 -0700 (PDT) In-Reply-To: References: <201710130649.v9D6n7cI036282@repo.freebsd.org> From: Adrian Chadd Date: Fri, 13 Oct 2017 00:45:23 -0700 X-Google-Sender-Auth: DUnEJCUbfJCmB2sjE1jQyEnyId0 Message-ID: Subject: Re: svn commit: r324580 - head/sys/net80211 To: Hans Petter Selasky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 07:45:26 -0000 no, it checks it. -a On 13 October 2017 at 00:11, Hans Petter Selasky wrote: > On 10/13/17 08:49, Adrian Chadd wrote: >> >> if (ieee80211_check_rxseq_amsdu_more(rxs)) { > > ^^^ does this line also need a NULL check? > > >> ni->ni_rxseqs[tid] = rxseq; >> - if (ieee80211_check_rxseq_amsdu(rxs)) >> + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) >> IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); > > > --HPS From owner-svn-src-head@freebsd.org Fri Oct 13 07:51:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28D07E3FE28; Fri, 13 Oct 2017 07:51:45 +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 D386D7C4FC; Fri, 13 Oct 2017 07:51:44 +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 AFBE5260444; Fri, 13 Oct 2017 09:51:42 +0200 (CEST) Subject: Re: svn commit: r324580 - head/sys/net80211 To: Adrian Chadd Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201710130649.v9D6n7cI036282@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Fri, 13 Oct 2017 09:49:06 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.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.23 Precedence: list List-Id: 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, 13 Oct 2017 07:51:45 -0000 On 10/13/17 09:45, Adrian Chadd wrote: > no, it checks it. > > > -a > > > On 13 October 2017 at 00:11, Hans Petter Selasky wrote: >> On 10/13/17 08:49, Adrian Chadd wrote: >>> >>> if (ieee80211_check_rxseq_amsdu_more(rxs)) { >> >> ^^^ does this line also need a NULL check? >> >> >>> ni->ni_rxseqs[tid] = rxseq; >>> - if (ieee80211_check_rxseq_amsdu(rxs)) >>> + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) >>> IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); >> >> >> --HPS > > Then why are you checking that pointer twice? Why not make ieee80211_check_rxseq_amsdu_more() return false, if rxs is NULL? --HPS From owner-svn-src-head@freebsd.org Fri Oct 13 09:21:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA093E42A38; Fri, 13 Oct 2017 09:21:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A471C807EB; Fri, 13 Oct 2017 09:21:42 +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 v9D9LfP9003052; Fri, 13 Oct 2017 09:21:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D9Lf7d003050; Fri, 13 Oct 2017 09:21:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130921.v9D9Lf7d003050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:21:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324590 - head/usr.sbin/i2c X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/usr.sbin/i2c X-SVN-Commit-Revision: 324590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:21:42 -0000 Author: avg Date: Fri Oct 13 09:21:41 2017 New Revision: 324590 URL: https://svnweb.freebsd.org/changeset/base/324590 Log: i2c(8): clean up and clarify read operation The code went to a lot of trouble to issue either a start+stop condition or a repeated start condition only to follow it with a stop condition and a read(2) call that issues a new start condition. So, fix the read in I2C_MODE_REPEATED_START mode by using I2CREAD ioctl within the running transaction. This obviously requires that the slave address has the read bit set which was not required before. Another problem was with width parameter of zero and I2C_MODE_REPEATED_START mode. In that case we issued a repeated start without any preceding start. While here, remove the redundant (unused) argument to I2CSTOP throughout the program. Also, clarify the meaning of -w option, especially "-w 0", in the manual page. Reviewed by: no one Differential Revision: https://reviews.freebsd.org/D12331 Modified: head/usr.sbin/i2c/i2c.8 head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.8 ============================================================================== --- head/usr.sbin/i2c/i2c.8 Fri Oct 13 09:14:05 2017 (r324589) +++ head/usr.sbin/i2c/i2c.8 Fri Oct 13 09:21:41 2017 (r324590) @@ -83,6 +83,10 @@ using selected addresses 'a:b:c'. This option is avail used. .It Fl o Ar offset offset within the device for data transfer (hex). +The default is zero. +Use +.Dq -w 0 +to disable writing of the offset to the slave. .It Fl r reset the controller. .It Fl s @@ -91,6 +95,12 @@ scan the bus for devices. be verbose. .It Fl w Ar 0|8|16 device addressing width (in bits). +This is used to determine how to pass +.Ar offset +specified with +.Fl o +to the slave. +Zero means that the offset is ignored and not passed to the slave at all. .El .Sh WARNINGS Great care must be taken when manipulating slave I2C devices with the Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Fri Oct 13 09:14:05 2017 (r324589) +++ head/usr.sbin/i2c/i2c.c Fri Oct 13 09:21:41 2017 (r324590) @@ -212,15 +212,14 @@ start_over: use_read_xfer = 1; goto start_over; } - cmd.slave = i << 1; - cmd.last = 1; - ioctl(fd, I2CSTOP, &cmd); + ioctl(fd, I2CSTOP); } if (error == 0) { ++num_found; printf("%02x ", i); } } + /* * If we found nothing, maybe START is not supported and returns a * generic error code such as EIO or ENXIO, so try again using reads. @@ -355,7 +354,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c } } - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) { err_msg = "ioctl: error sending stop condition"; goto err2; @@ -439,8 +438,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c } break; } - cmd.slave = i2c_opt.addr; - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) { err_msg = "ioctl: error sending stop condition"; goto err2; @@ -450,8 +448,7 @@ i2c_write(char *dev, struct options i2c_opt, char *i2c return (0); err1: - cmd.slave = i2c_opt.addr; - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) fprintf(stderr, "error sending stop condition\n"); err2: @@ -466,7 +463,7 @@ static int i2c_read(char *dev, struct options i2c_opt, char *i2c_buf) { struct iiccmd cmd; - int i, fd, error, bufsize; + int fd, error, bufsize; char *err_msg, data = 0, *buf; fd = open(dev, O_RDWR); @@ -503,23 +500,22 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_ } if (i2c_opt.mode == I2C_MODE_STOP_START) { - cmd.slave = i2c_opt.addr; - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) { err_msg = "error sending stop condition"; goto err2; } } } - cmd.slave = i2c_opt.addr; + cmd.slave = i2c_opt.addr | 1; cmd.count = 1; cmd.last = 0; cmd.buf = &data; - if (i2c_opt.mode == I2C_MODE_STOP_START) { + if (i2c_opt.mode == I2C_MODE_STOP_START || i2c_opt.width == 0) { error = ioctl(fd, I2CSTART, &cmd); if (error == -1) { err_msg = "ioctl: error sending start condition"; - goto err1; + goto err2; } } else if (i2c_opt.mode == I2C_MODE_REPEATED_START) { error = ioctl(fd, I2CRPTSTART, &cmd); @@ -529,26 +525,27 @@ i2c_read(char *dev, struct options i2c_opt, char *i2c_ goto err1; } } - error = ioctl(fd, I2CSTOP, &cmd); + + cmd.count = i2c_opt.count; + cmd.buf = i2c_buf; + cmd.last = 1; + error = ioctl(fd, I2CREAD, &cmd); if (error == -1) { - err_msg = "error sending stop condition"; - goto err2; + err_msg = "ioctl: error while reading"; + goto err1; } - for (i = 0; i < i2c_opt.count; i++) { - error = read(fd, &i2c_buf[i], 1); - if (error == -1) { - err_msg = "ioctl: error while reading"; - goto err1; - } + error = ioctl(fd, I2CSTOP); + if (error == -1) { + err_msg = "error sending stop condtion\n"; + goto err2; } close(fd); return (0); err1: - cmd.slave = i2c_opt.addr; - error = ioctl(fd, I2CSTOP, &cmd); + error = ioctl(fd, I2CSTOP); if (error == -1) fprintf(stderr, "error sending stop condition\n"); err2: From owner-svn-src-head@freebsd.org Fri Oct 13 09:42:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6157E42F20; Fri, 13 Oct 2017 09:42:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 922D780F7B; Fri, 13 Oct 2017 09:42:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9D9g5D6014352; Fri, 13 Oct 2017 09:42:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9D9g5oS014351; Fri, 13 Oct 2017 09:42:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201710130942.v9D9g5oS014351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 13 Oct 2017 09:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324591 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 09:42:06 -0000 Author: avg Date: Fri Oct 13 09:42:05 2017 New Revision: 324591 URL: https://svnweb.freebsd.org/changeset/base/324591 Log: remove process and jail directory machinations from dounmount The manipulations done by mountcheckdirs() are not that useful during the unmount, they can bring about unexpected security consequences. Thic change effectively reverts the change in r73241. The change also allows to simplify the handling of rootvnode global variable. Discussed with: mckusick, mjg, kib Reviewed by: trasz MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12366 Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Fri Oct 13 09:21:41 2017 (r324590) +++ head/sys/kern/vfs_mount.c Fri Oct 13 09:42:05 2017 (r324591) @@ -1262,7 +1262,7 @@ dounmount_cleanup(struct mount *mp, struct vnode *cove int dounmount(struct mount *mp, int flags, struct thread *td) { - struct vnode *coveredvp, *fsrootvp; + struct vnode *coveredvp; int error; uint64_t async_flag; int mnt_gen_r; @@ -1364,22 +1364,6 @@ dounmount(struct mount *mp, int flags, struct thread * MNT_IUNLOCK(mp); cache_purgevfs(mp, false); /* remove cache entries for this file sys */ vfs_deallocate_syncvnode(mp); - /* - * For forced unmounts, move process cdir/rdir refs on the fs root - * vnode to the covered vnode. For non-forced unmounts we want - * such references to cause an EBUSY error. - */ - if ((flags & MNT_FORCE) && - VFS_ROOT(mp, LK_EXCLUSIVE, &fsrootvp) == 0) { - if (mp->mnt_vnodecovered != NULL && - (mp->mnt_flag & MNT_IGNORE) == 0) - mountcheckdirs(fsrootvp, mp->mnt_vnodecovered); - if (fsrootvp == rootvnode) { - vrele(rootvnode); - rootvnode = NULL; - } - vput(fsrootvp); - } if ((mp->mnt_flag & MNT_RDONLY) != 0 || (flags & MNT_FORCE) != 0 || (error = VFS_SYNC(mp, MNT_WAIT)) == 0) error = VFS_UNMOUNT(mp, flags); @@ -1391,17 +1375,6 @@ dounmount(struct mount *mp, int flags, struct thread * * it doesn't exist anymore. */ if (error && error != ENXIO) { - if ((flags & MNT_FORCE) && - VFS_ROOT(mp, LK_EXCLUSIVE, &fsrootvp) == 0) { - if (mp->mnt_vnodecovered != NULL && - (mp->mnt_flag & MNT_IGNORE) == 0) - mountcheckdirs(mp->mnt_vnodecovered, fsrootvp); - if (rootvnode == NULL) { - rootvnode = fsrootvp; - vref(rootvnode); - } - vput(fsrootvp); - } MNT_ILOCK(mp); mp->mnt_kern_flag &= ~MNTK_NOINSMNTQ; if ((mp->mnt_flag & MNT_RDONLY) == 0) { @@ -1432,6 +1405,10 @@ dounmount(struct mount *mp, int flags, struct thread * VOP_UNLOCK(coveredvp, 0); } vfs_event_signal(NULL, VQ_UNMOUNT, 0); + if (rootvnode != NULL && mp == rootvnode->v_mount) { + vrele(rootvnode); + rootvnode = NULL; + } if (mp == rootdevmp) rootdevmp = NULL; vfs_mount_destroy(mp); From owner-svn-src-head@freebsd.org Fri Oct 13 11:01:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 444D6E447C1; Fri, 13 Oct 2017 11:01:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11B3383682; Fri, 13 Oct 2017 11:01:33 +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 v9DB1XaO047033; Fri, 13 Oct 2017 11:01:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DB1XGl047032; Fri, 13 Oct 2017 11:01:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201710131101.v9DB1XGl047032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 13 Oct 2017 11:01:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324592 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 324592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 11:01:34 -0000 Author: ae Date: Fri Oct 13 11:01:33 2017 New Revision: 324592 URL: https://svnweb.freebsd.org/changeset/base/324592 Log: Return 'errno' value from the table_do_modify_record(), it is expected by table_modify_record(). This makes quiet operations with tables really quiet. PR: 222953 MFC after: 1 week Modified: head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Fri Oct 13 09:42:05 2017 (r324591) +++ head/sbin/ipfw/tables.c Fri Oct 13 11:01:33 2017 (r324592) @@ -885,6 +885,8 @@ table_do_modify_record(int cmd, ipfw_obj_header *oh, sz += sizeof(*oh); error = do_get3(cmd, &oh->opheader, &sz); + if (error != 0) + error = errno; tent = (ipfw_obj_tentry *)(ctlv + 1); /* Copy result back to provided buffer */ memcpy(tent_base, ctlv + 1, sizeof(*tent) * count); From owner-svn-src-head@freebsd.org Fri Oct 13 11:11:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30509E44B2A; Fri, 13 Oct 2017 11:11:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1F1983E98; Fri, 13 Oct 2017 11:11:54 +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 v9DBBsb5051271; Fri, 13 Oct 2017 11:11:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DBBsPl051270; Fri, 13 Oct 2017 11:11:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201710131111.v9DBBsPl051270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 13 Oct 2017 11:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324593 - head/sys/netpfil/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw X-SVN-Commit-Revision: 324593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 11:11:55 -0000 Author: ae Date: Fri Oct 13 11:11:53 2017 New Revision: 324593 URL: https://svnweb.freebsd.org/changeset/base/324593 Log: Fix regression in handling O_FORWARD_IP opcode after r279948. To properly handle 'fwd tablearg,port' opcode, copy sin_port value from sockaddr_in structure stored in the opcode into corresponding hopstore field. PR: 222953 MFC after: 1 week Modified: head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Oct 13 11:01:33 2017 (r324592) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Oct 13 11:11:53 2017 (r324593) @@ -2442,6 +2442,7 @@ do { \ sa6->sin6_len = sizeof(*sa6); sa6->sin6_addr = TARG_VAL( chain, tablearg, nh6); + sa6->sin6_port = sa->sin_port; /* * Set sin6_scope_id only for * link-local unicast addresses. @@ -2455,6 +2456,8 @@ do { \ } else #endif { + args->hopstore.sin_port = + sa->sin_port; sa = args->next_hop = &args->hopstore; sa->sin_family = AF_INET; From owner-svn-src-head@freebsd.org Fri Oct 13 13:47:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDA5AE48B11; Fri, 13 Oct 2017 13:47:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C84164FA9; Fri, 13 Oct 2017 13:47:56 +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 v9DDltE8015909; Fri, 13 Oct 2017 13:47:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DDltxP015908; Fri, 13 Oct 2017 13:47:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131347.v9DDltxP015908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 13:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324594 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 324594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 13:47:56 -0000 Author: emaste Date: Fri Oct 13 13:47:55 2017 New Revision: 324594 URL: https://svnweb.freebsd.org/changeset/base/324594 Log: truss: mention 'H' in usage r295930 introduced the 'H' option to display thread IDs, but did not add the option to usage(). PR: 222837 Submitted by: Oliver Kiddle MFC after: 1 week Modified: head/usr.bin/truss/main.c Modified: head/usr.bin/truss/main.c ============================================================================== --- head/usr.bin/truss/main.c Fri Oct 13 11:11:53 2017 (r324593) +++ head/usr.bin/truss/main.c Fri Oct 13 13:47:55 2017 (r324594) @@ -57,8 +57,8 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n", - "usage: truss [-cfaedDS] [-o file] [-s strsize] -p pid", - " truss [-cfaedDS] [-o file] [-s strsize] command [args]"); + "usage: truss [-cfaedDHS] [-o file] [-s strsize] -p pid", + " truss [-cfaedDHS] [-o file] [-s strsize] command [args]"); exit(1); } From owner-svn-src-head@freebsd.org Fri Oct 13 13:53:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7034E48DE8; Fri, 13 Oct 2017 13:53:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A49AE654A5; Fri, 13 Oct 2017 13:53:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DDrJjA019843; Fri, 13 Oct 2017 13:53:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DDrJgm019842; Fri, 13 Oct 2017 13:53:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131353.v9DDrJgm019842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 13:53:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324595 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 13:53:21 -0000 Author: emaste Date: Fri Oct 13 13:53:19 2017 New Revision: 324595 URL: https://svnweb.freebsd.org/changeset/base/324595 Log: ANSIfy vm_kern.c PR: 222673 Submitted by: ota@j.email.ne.jp MFC after: 1 week Modified: head/sys/vm/vm_kern.c Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Fri Oct 13 13:47:55 2017 (r324594) +++ head/sys/vm/vm_kern.c Fri Oct 13 13:53:19 2017 (r324595) @@ -122,8 +122,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, max_kernel_address, CTLFLA * a mapping on demand through vm_fault() will result in a panic. */ vm_offset_t -kva_alloc(size) - vm_size_t size; +kva_alloc(vm_size_t size) { vm_offset_t addr; @@ -144,9 +143,7 @@ kva_alloc(size) * This routine may not block on kernel maps. */ void -kva_free(addr, size) - vm_offset_t addr; - vm_size_t size; +kva_free(vm_offset_t addr, vm_size_t size) { size = round_page(size); @@ -433,9 +430,7 @@ kmem_free(struct vmem *vmem, vm_offset_t addr, vm_size * This routine may block. */ vm_offset_t -kmap_alloc_wait(map, size) - vm_map_t map; - vm_size_t size; +kmap_alloc_wait(vm_map_t map, vm_size_t size) { vm_offset_t addr; @@ -473,10 +468,7 @@ kmap_alloc_wait(map, size) * waiting for memory in that map. */ void -kmap_free_wakeup(map, addr, size) - vm_map_t map; - vm_offset_t addr; - vm_size_t size; +kmap_free_wakeup(vm_map_t map, vm_offset_t addr, vm_size_t size) { vm_map_lock(map); @@ -520,8 +512,7 @@ kmem_init_zero_region(void) * `start' as allocated, and the range between `start' and `end' as free. */ void -kmem_init(start, end) - vm_offset_t start, end; +kmem_init(vm_offset_t start, vm_offset_t end) { vm_map_t m; From owner-svn-src-head@freebsd.org Fri Oct 13 14:14:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5DB0E494B4; Fri, 13 Oct 2017 14:14: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 mx1.freebsd.org (Postfix) with ESMTPS id 94CDA66326; Fri, 13 Oct 2017 14:14: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 v9DEEkOU028015; Fri, 13 Oct 2017 14:14:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DEEk4p028014; Fri, 13 Oct 2017 14:14:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201710131414.v9DEEk4p028014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 13 Oct 2017 14:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324597 - 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: 324597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 14:14:47 -0000 Author: hselasky Date: Fri Oct 13 14:14:46 2017 New Revision: 324597 URL: https://svnweb.freebsd.org/changeset/base/324597 Log: Don't call selrecord() outside the select system call in the LinuxKPI, because then td->td_sel is NULL and this will result in a segfault inside selrecord(). This happens when only using kqueue() to poll for read and write events. If select() and kqueue() is mixed there won't be a segfault. Reported by: Johannes Lundberg MFC after: 1 week Sponsored by: Mellanox Technologies 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 Oct 13 13:56:44 2017 (r324596) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Fri Oct 13 14:14:46 2017 (r324597) @@ -1021,6 +1021,8 @@ linux_dev_write(struct cdev *dev, struct uio *uio, int return (error); } +#define LINUX_POLL_TABLE_NORMAL ((poll_table *)1) + static int linux_dev_poll(struct cdev *dev, int events, struct thread *td) { @@ -1037,7 +1039,7 @@ linux_dev_poll(struct cdev *dev, int events, struct th filp->f_flags = file->f_flag; linux_set_current(td); if (filp->f_op->poll != NULL) - revents = filp->f_op->poll(filp, NULL) & events; + revents = filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL) & events; else revents = 0; @@ -1094,7 +1096,9 @@ linux_poll_wait(struct linux_file *filp, wait_queue_he [LINUX_FWQ_STATE_READY] = LINUX_FWQ_STATE_QUEUED, }; - selrecord(curthread, &filp->f_selinfo); + /* check if we are called inside the select system call */ + if (p == LINUX_POLL_TABLE_NORMAL) + selrecord(curthread, &filp->f_selinfo); switch (linux_poll_wakeup_state(&filp->f_wait_queue.state, state)) { case LINUX_FWQ_STATE_INIT: @@ -1438,10 +1442,9 @@ linux_file_poll(struct file *file, int events, struct filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; linux_set_current(td); - if (filp->f_op->poll != NULL) { - selrecord(td, &filp->f_selinfo); - revents = filp->f_op->poll(filp, NULL) & events; - } else + if (filp->f_op->poll != NULL) + revents = filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL) & events; + else revents = 0; return (revents); From owner-svn-src-head@freebsd.org Fri Oct 13 14:36:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEFB9E49C44; Fri, 13 Oct 2017 14:36:13 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 63F69673CB; Fri, 13 Oct 2017 14:36:12 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 314Le3T7LDJTW314NeZzv5; Fri, 13 Oct 2017 08:36:11 -0600 X-Authority-Analysis: v=2.2 cv=B4DJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=02M-m0pO-4AA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=qwL64G1b1rMNB4V27MIA:9 a=CjuIK1q_8ugA: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 9D3A8109; Fri, 13 Oct 2017 07:36:09 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v9DEa9Je003290; Fri, 13 Oct 2017 07:36:09 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201710131436.v9DEa9Je003290@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Adrian Chadd cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324580 - head/sys/net80211 In-Reply-To: Message from Adrian Chadd of "Fri, 13 Oct 2017 06:49:07 -0000." <201710130649.v9D6n7cI036282@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 13 Oct 2017 07:36:09 -0700 X-CMAE-Envelope: MS4wfGkw6bqRHkBxsAhx6E4xrKgOTZdla7vS3Y7/a38JEfeCrYssCjDjoPi8M65XvZgrbljRhk4owz39R867a83a29X6RRQrV1Y3nqmGO4vuoMbQKnz+TasH /d58wvntz2izWw5bvTz+uW9XvZszQbhrVdWudQPn7d/xl4ES/SxqNOjtkz9njDRbxj8kv2Tog5Rq3BNKcERNW0IpJ79VxYv/qU1wwsgDwu4n9+HOZr0M9AyL SmFJyYr1xcvpGDUgiRGj67SHPiPiq/kB5zOIqvKo/smweBhzYKGdvqIGZn7gKu4A X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 13 Oct 2017 14:36:13 -0000 In message <201710130649.v9D6n7cI036282@repo.freebsd.org>, Adrian Chadd writes: > Author: adrian > Date: Fri Oct 13 06:49:07 2017 > New Revision: 324580 > URL: https://svnweb.freebsd.org/changeset/base/324580 > > Log: > [net80211] don't try to follow a NULL rxs pointer down the sink. > > It's smelly, and we already checked earlier whether we needed to. > > Modified: > head/sys/net80211/ieee80211_input.h > > Modified: head/sys/net80211/ieee80211_input.h > ============================================================================= > = > --- head/sys/net80211/ieee80211_input.h Fri Oct 13 05:14:54 2017 > (r324579) > +++ head/sys/net80211/ieee80211_input.h Fri Oct 13 06:49:07 2017 > (r324580) > @@ -278,7 +278,7 @@ ok: > */ > if (ieee80211_check_rxseq_amsdu_more(rxs)) { > ni->ni_rxseqs[tid] = rxseq; > - if (ieee80211_check_rxseq_amsdu(rxs)) > + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) > IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); > } else { > /* .. still waiting */ > Thank you. This fixes it. -- 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 Fri Oct 13 15:02:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD17EE4A5E7; Fri, 13 Oct 2017 15:02:30 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 995DB683B6; Fri, 13 Oct 2017 15:02:30 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DF2T7Z050516; Fri, 13 Oct 2017 15:02:29 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DF2TmN050513; Fri, 13 Oct 2017 15:02:29 GMT (envelope-from br@FreeBSD.org) Message-Id: <201710131502.v9DF2TmN050513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 13 Oct 2017 15:02:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324598 - head/sys/dev/hwpmc X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/hwpmc X-SVN-Commit-Revision: 324598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 15:02:30 -0000 Author: br Date: Fri Oct 13 15:02:29 2017 New Revision: 324598 URL: https://svnweb.freebsd.org/changeset/base/324598 Log: o Support for Kabylake CPU PMCs (fall down to PMC_CPU_INTEL_SKYLAKE). o Fix bugs in events descriptions for Skylake, Skylake Xeon and Haswell. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12654 Modified: head/sys/dev/hwpmc/hwpmc_core.c head/sys/dev/hwpmc/hwpmc_intel.c head/sys/dev/hwpmc/pmc_events.h Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Oct 13 14:14:46 2017 (r324597) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Oct 13 15:02:29 2017 (r324598) @@ -720,8 +720,8 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(0CH_02H, 0x0C, 0x02, IAP_F_FM | IAP_F_CC2), IAPDESCR(0CH_03H, 0x0C, 0x03, IAP_F_FM | IAP_F_CA), - IAPDESCR(0DH_01H, 0x0D, 0x80, IAP_F_FM | IAP_F_SLX), - IAPDESCR(0DH_03H, 0x0D, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | + IAPDESCR(0DH_01H, 0x0D, 0x01, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(0DH_03H, 0x0D, 0x03, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_IB | IAP_F_IBX | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(0DH_80H, 0x0D, 0x80, IAP_F_FM | IAP_F_SL | IAP_F_SLX), @@ -1142,7 +1142,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_BW | IAP_F_BWX ), IAPDESCR(63H_02H, 0x63, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | - IAP_F_BW | IAP_F_BWX), + IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(64H, 0x64, IAP_M_CORE, IAP_F_CA | IAP_F_CC2), IAPDESCR(64H_40H, 0x64, 0x40, IAP_F_FM | IAP_F_CC), @@ -1425,11 +1425,11 @@ static struct iap_event_descr iap_events[] = { IAPDESCR(A6H_01H, 0xA6, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL | IAP_F_SLX), - IAPDESCR(A6H_40H, 0xA3, 0x40, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_02H, 0xA6, 0x02, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_04H, 0xA6, 0x04, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_08H, 0xA6, 0x08, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_10H, 0xA6, 0x10, IAP_F_FM | IAP_F_SL | IAP_F_SLX), + IAPDESCR(A6H_40H, 0xA6, 0x40, IAP_F_FM | IAP_F_SL | IAP_F_SLX), IAPDESCR(A7H_01H, 0xA7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM ), @@ -1446,7 +1446,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(ABH_02H, 0xAB, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_BW | IAP_F_BWX | - IAP_F_SLX), + IAP_F_SL | IAP_F_SLX), IAPDESCR(ACH_02H, 0xAC, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_SL), IAPDESCR(ACH_08H, 0xAC, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB | @@ -1486,7 +1486,8 @@ static struct iap_event_descr iap_events[] = { IAP_F_BW | IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(B1H_04H, 0xB1, 0x04, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_08H, 0xB1, 0x08, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SLX), + IAPDESCR(B1H_10H, 0xB1, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL | + IAP_F_SLX), IAPDESCR(B1H_1FH, 0xB1, 0x1F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_20H, 0xB1, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(B1H_3FH, 0xB1, 0x3F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1495,7 +1496,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_WM), IAPDESCR(B2H_01H, 0xB2, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | - IAP_F_SB | IAP_F_SBX | IAP_F_SLX), + IAP_F_SB | IAP_F_SBX | IAP_F_SL | IAP_F_SLX), IAPDESCR(B3H_01H, 0xB3, 0x01, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_WM | IAP_F_I7O), @@ -1656,7 +1657,7 @@ static struct iap_event_descr iap_events[] = { IAP_F_SL | IAP_F_SLX), IAPDESCR(C5H_01H, 0xC5, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | - IAP_F_BWX | IAP_F_SLX), + IAP_F_BWX | IAP_F_SL | IAP_F_SLX), IAPDESCR(C5H_02H, 0xC5, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_SL | IAP_F_SLX), IAPDESCR(C5H_04H, 0xC5, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB | Modified: head/sys/dev/hwpmc/hwpmc_intel.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_intel.c Fri Oct 13 14:14:46 2017 (r324597) +++ head/sys/dev/hwpmc/hwpmc_intel.c Fri Oct 13 15:02:29 2017 (r324598) @@ -179,8 +179,12 @@ pmc_intel_initialize(void) cputype = PMC_CPU_INTEL_IVYBRIDGE_XEON; nclasses = 3; break; + /* Skylake */ case 0x4e: case 0x5e: + /* Kabylake */ + case 0x8E: /* Per Intel document 325462-063US July 2017. */ + case 0x9E: /* Per Intel document 325462-063US July 2017. */ cputype = PMC_CPU_INTEL_SKYLAKE; nclasses = 3; break; Modified: head/sys/dev/hwpmc/pmc_events.h ============================================================================== --- head/sys/dev/hwpmc/pmc_events.h Fri Oct 13 14:14:46 2017 (r324597) +++ head/sys/dev/hwpmc/pmc_events.h Fri Oct 13 15:02:29 2017 (r324598) @@ -2030,7 +2030,7 @@ __PMC_EV_ALIAS("L2_RQSTS.PF_HIT", IAP_EVENT_24H_D8H) __PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_DATA_RD", IAP_EVENT_24H_E1H) \ __PMC_EV_ALIAS("L2_RQSTS.ALL_RFO", IAP_EVENT_24H_E2H) \ __PMC_EV_ALIAS("L2_RQSTS.ALL_CODE_RD", IAP_EVENT_24H_E4H) \ -__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_REFERENCES", IAP_EVENT_24H_F7H) \ +__PMC_EV_ALIAS("L2_RQSTS.ALL_DEMAND_REFERENCES", IAP_EVENT_24H_E7H) \ __PMC_EV_ALIAS("L2_RQSTS.ALL_PF", IAP_EVENT_24H_F8H) \ __PMC_EV_ALIAS("L2_RQSTS.REFERENCES", IAP_EVENT_24H_EFH) \ __PMC_EV_ALIAS("LONGEST_LAT_CACHE.REFERENCE", IAP_EVENT_2EH_4FH) \ From owner-svn-src-head@freebsd.org Fri Oct 13 15:16:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4376E4AA84; Fri, 13 Oct 2017 15:16:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E42769225; Fri, 13 Oct 2017 15:16:59 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DFGwOl055692; Fri, 13 Oct 2017 15:16:58 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DFGve3055680; Fri, 13 Oct 2017 15:16:57 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201710131516.v9DFGve3055680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 13 Oct 2017 15:16:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324599 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 324599 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 15:16:59 -0000 Author: gjb Date: Fri Oct 13 15:16:57 2017 New Revision: 324599 URL: https://svnweb.freebsd.org/changeset/base/324599 Log: Increase the arm/armv6 and arm/armv7 images from 2.5GB to 3GB, since the RPI2 (at least) does not fit in 2.5GB. While here, add a missing BOARDNAME to RPI2.conf. Sponsored by: The FreeBSD Foundation Modified: head/release/arm/BANANAPI.conf head/release/arm/BEAGLEBONE.conf head/release/arm/CUBIEBOARD.conf head/release/arm/CUBIEBOARD2.conf head/release/arm/CUBOX-HUMMINGBOARD.conf head/release/arm/GUMSTIX.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/RPI2.conf head/release/arm/WANDBOARD.conf Modified: head/release/arm/BANANAPI.conf ============================================================================== --- head/release/arm/BANANAPI.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/BANANAPI.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-bananapi" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/BEAGLEBONE.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-beaglebone" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" Modified: head/release/arm/CUBIEBOARD.conf ============================================================================== --- head/release/arm/CUBIEBOARD.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/CUBIEBOARD.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubieboard" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/CUBIEBOARD2.conf ============================================================================== --- head/release/arm/CUBIEBOARD2.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/CUBIEBOARD2.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x42000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="32m -b 1m" FAT_TYPE="16" Modified: head/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- head/release/arm/CUBOX-HUMMINGBOARD.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/CUBOX-HUMMINGBOARD.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-cubox-hummingboard" KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" Modified: head/release/arm/GUMSTIX.conf ============================================================================== --- head/release/arm/GUMSTIX.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/GUMSTIX.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-duovero" KERNEL="GUMSTIX" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/PANDABOARD.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-pandaboard" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x88000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="2m" FAT_TYPE="12" Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/RPI-B.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi" KERNEL="RPI-B" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="17m" FAT_TYPE="16" Modified: head/release/arm/RPI2.conf ============================================================================== --- head/release/arm/RPI2.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/RPI2.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,12 +9,13 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-rpi2" KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x2000000" -IMAGE_SIZE="2560M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="50m" FAT_TYPE="16" MD_ARGS="-x 63 -y 255" NODOC=1 +export BOARDNAME="RPI2" arm_install_uboot() { UBOOT_DIR="/usr/local/share/u-boot/u-boot-rpi2" Modified: head/release/arm/WANDBOARD.conf ============================================================================== --- head/release/arm/WANDBOARD.conf Fri Oct 13 15:02:29 2017 (r324598) +++ head/release/arm/WANDBOARD.conf Fri Oct 13 15:16:57 2017 (r324599) @@ -9,7 +9,7 @@ EMBEDDED_TARGET_ARCH="armv7" EMBEDDEDPORTS="sysutils/u-boot-wandboard" KERNEL="IMX6" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x12000000" -IMAGE_SIZE="1536M" +IMAGE_SIZE="3072M" PART_SCHEME="MBR" FAT_SIZE="50m -b 16384" FAT_TYPE="16" From owner-svn-src-head@freebsd.org Fri Oct 13 15:53:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EEFCE25897; Fri, 13 Oct 2017 15:53:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x234.google.com (mail-pf0-x234.google.com [IPv6:2607:f8b0:400e:c00::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 EF8286A91E; Fri, 13 Oct 2017 15:53:53 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x234.google.com with SMTP id p87so10743804pfj.3; Fri, 13 Oct 2017 08:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=e/ohyng964TPSBH4oUBa5V3+hwsQgiNR0xMrCDmj4+c=; b=Eb6sqsX1dDa+RERYw4DUUr/KenwglQdWW2x1l8voZW1uDqE4OG3UsUikNSSRrOJHcn jMR1ppTVP3kChNthwggESGzsuKDrR7EkxF858lpBGGXIHyW+OiKOL0si6ReDLaElWb49 nI6WHG5onCDyukm5lJp4kHcQn22GQ6ZhxVeb3i9D+VCOLhLCj2s5PBYQKiaG4zdOaOFc zptcdcZpPsXjYvvZ+Nb8oydeYditA14ICee3ssnKS5+tYI+zMg3W+1KikLCzGlmA4vNF kI+Y91Uq1PfusDm1/zsTzvwxDjLjXhwdj7ael/DTjP+koGFTAUw6YPYbBaxm2LKzNREt V3rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=e/ohyng964TPSBH4oUBa5V3+hwsQgiNR0xMrCDmj4+c=; b=fL/uhUhSg5EzTxqG8z8JMsYO70zkJS5So2YXVUhBuhK+4OvdMTHadIp3iQtaDJBY2o wMzJXil12tn9OQxCGjFYpK4I+tJrCZCjWbsAYyDJQdBGDJEYnP7lYcSNDt2DmWkVZA6w W2eIDl36L0LutVBiT8c7kkbbV61e01OPv0/+3P56Vaem3ZlkVNBebpam9bAS4cXvWejM R1Wst39zYaNW5u3mn/fqDOV/KZCPzYQy2B4eKtxXvrSVNGtur3SD9ThFCulAk1q3giN6 XHX2sLqoxcjYGu5SIgap2WAN3xgYgqEZXoTEBsFIT9mPt+HXXJeIRCJ7WVBv4+yNLSb7 8zVA== X-Gm-Message-State: AMCzsaViSFvWW/aloUnnlIexqyv/NmmVJTojQujBuXBeRaQ8l/1bTGNW h0SsVr3gptuHlash4IQU0YMvxEpr X-Google-Smtp-Source: AOwi7QAgWDi/Fl0Qd5M9GAagJjjFZE4MwVd1zGds6uitw0wrxDkoHWiXvx82AUgnx/w1H+Lgr/aMQg== X-Received: by 10.99.45.67 with SMTP id t64mr1706558pgt.62.1507910032873; Fri, 13 Oct 2017 08:53:52 -0700 (PDT) Received: from ?IPv6:2607:fb90:8126:a250:5921:4fdb:c0b6:5bc4? ([2607:fb90:8126:a250:5921:4fdb:c0b6:5bc4]) by smtp.gmail.com with ESMTPSA id l1sm3042387pff.77.2017.10.13.08.53.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 08:53:51 -0700 (PDT) Content-Type: text/plain; charset=cp932 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r324471 - head/sys/boot From: Ngie Cooper X-Mailer: iPhone Mail (15A421) In-Reply-To: Date: Fri, 13 Oct 2017 08:53:46 -0700 Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> To: Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 13 Oct 2017 15:53:54 -0000 > On Oct 9, 2017, at 21:57, Ngie Cooper (yaneurabeya) wrote: >=20 >=20 >> On Oct 9, 2017, at 21:56, Warner Losh wrote: >>=20 >> DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. >>=20 >> DO NOT MAKE ANY COMMITS TO sys/boot. >>=20 >> BACK OFF. >>=20 >> Seriously, though, extra changes create extra friction, and these changes= aren't worth any friction at all. I'm deleting LIBSAU and this guarantees a= conflict when I update. >>=20 >> So please, do not make any edits to sys/boot whatsoever, no matter how tr= ivial. >>=20 >> At least until I'm done. >=20 > Ok So... what=81fs the status? -Ngie= From owner-svn-src-head@freebsd.org Fri Oct 13 16:23:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63789E26489; Fri, 13 Oct 2017 16:23:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32BFA6B956; Fri, 13 Oct 2017 16:23:06 +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 v9DGN5cq085449; Fri, 13 Oct 2017 16:23:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DGN5gr085448; Fri, 13 Oct 2017 16:23:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201710131623.v9DGN5gr085448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 13 Oct 2017 16:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324600 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 324600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 16:23:06 -0000 Author: kib Date: Fri Oct 13 16:23:05 2017 New Revision: 324600 URL: https://svnweb.freebsd.org/changeset/base/324600 Log: Evaluate the real size of the sblk_zone. Submitted by: ota@j.email.ne.jp PR: 221356 Reviewed by: alc, markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D12660 Modified: head/sys/vm/swap_pager.c Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Oct 13 15:16:57 2017 (r324599) +++ head/sys/vm/swap_pager.c Fri Oct 13 16:23:05 2017 (r324600) @@ -541,6 +541,14 @@ swap_pager_swap_init(void) */ n -= ((n + 2) / 3); } while (n > 0); + + /* + * Often uma_zone_reserve_kva() cannot reserve exactly the + * requested size. Account for the difference when + * calculating swap_maxpages. + */ + n = uma_zone_get_max(swblk_zone); + if (n2 != n) printf("Swap blk zone entries reduced from %lu to %lu.\n", n2, n); From owner-svn-src-head@freebsd.org Fri Oct 13 16:31:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57600E269D8; Fri, 13 Oct 2017 16:31:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 276016C286; Fri, 13 Oct 2017 16:31:51 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DGVoSA089001; Fri, 13 Oct 2017 16:31:50 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DGVoLf089000; Fri, 13 Oct 2017 16:31:50 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201710131631.v9DGVoLf089000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 13 Oct 2017 16:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324601 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324601 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 16:31:51 -0000 Author: alc Date: Fri Oct 13 16:31:50 2017 New Revision: 324601 URL: https://svnweb.freebsd.org/changeset/base/324601 Log: Address two problems with sendfile(..., SF_NOCACHE) and apply one "optimization". First, sendfile(..., SF_NOCACHE) frees pages without checking whether those pages are mapped. This can leave the system with mappings to free or repurposed pages. Second, a page can be busied between the time of the current busy test and acquiring the object lock. Essentially, the test performed before the object lock is acquired can only be regarded as an optimization to short-circuit further work on the page. It cannot, however, be relied upon to prove that it is safe to free the page. Third, when sendfile(..., SF_NOCACHE) was originally implemented, vm_page_deactivate_noreuse() did not yet exist. Use vm_page_deactivate_noreuse() instead of vm_page_deactivate(), because it comes closer to freeing the page. In collaboration with: glebius Discussed with: gallatin, kib, markj X-MFC after: r324448 Modified: head/sys/kern/kern_sendfile.c Modified: head/sys/kern/kern_sendfile.c ============================================================================== --- head/sys/kern/kern_sendfile.c Fri Oct 13 16:23:05 2017 (r324600) +++ head/sys/kern/kern_sendfile.c Fri Oct 13 16:31:50 2017 (r324601) @@ -143,10 +143,23 @@ sendfile_free_page(vm_page_t pg, bool nocache) vm_page_free(pg); else if (nocache) { if (!vm_page_xbusied(pg) && VM_OBJECT_TRYWLOCK(obj)) { - vm_page_free(pg); + bool freed; + + /* Only free unmapped pages. */ + if (obj->ref_count == 0 || + !pmap_page_is_mapped(pg)) + /* + * The busy test before the object is + * locked cannot be relied upon. + */ + freed = vm_page_try_to_free(pg); + else + freed = false; VM_OBJECT_WUNLOCK(obj); + if (!freed) + vm_page_deactivate_noreuse(pg); } else - vm_page_deactivate(pg); + vm_page_deactivate_noreuse(pg); } } vm_page_unlock(pg); From owner-svn-src-head@freebsd.org Fri Oct 13 17:15:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 220A1E27BE3; Fri, 13 Oct 2017 17:15:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5A0D6DC9C; Fri, 13 Oct 2017 17:15:18 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DHFIe1007519; Fri, 13 Oct 2017 17:15:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DHFIKH007518; Fri, 13 Oct 2017 17:15:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131715.v9DHFIKH007518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 17:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324603 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 324603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 17:15:19 -0000 Author: emaste Date: Fri Oct 13 17:15:17 2017 New Revision: 324603 URL: https://svnweb.freebsd.org/changeset/base/324603 Log: ObsoleteFiles.inc: correct year on libstand removal Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Oct 13 17:11:08 2017 (r324602) +++ head/ObsoleteFiles.inc Fri Oct 13 17:15:17 2017 (r324603) @@ -38,7 +38,7 @@ # xargs -n1 | sort | uniq -d; # done -# 20161010: Remove libstand +# 20171010: Remove libstand OLD_FILES+=usr/lib/libstand.a OLD_FILES+=usr/lib/libstand_p.a OLD_FILES+=usr/include/stand.h From owner-svn-src-head@freebsd.org Fri Oct 13 18:23:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C30B2E296FA; Fri, 13 Oct 2017 18:23:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 90A38700AF; Fri, 13 Oct 2017 18:23:09 +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 v9DIN86w036614; Fri, 13 Oct 2017 18:23:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DIN8j3036613; Fri, 13 Oct 2017 18:23:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131823.v9DIN8j3036613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 18:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324604 - head/targets/pseudo/userland/gnu X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/targets/pseudo/userland/gnu X-SVN-Commit-Revision: 324604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 18:23:09 -0000 Author: emaste Date: Fri Oct 13 18:23:08 2017 New Revision: 324604 URL: https://svnweb.freebsd.org/changeset/base/324604 Log: Remove additional groff leftovers (r319664) Modified: head/targets/pseudo/userland/gnu/Makefile.depend Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Fri Oct 13 17:15:17 2017 (r324603) +++ head/targets/pseudo/userland/gnu/Makefile.depend Fri Oct 13 18:23:08 2017 (r324604) @@ -43,53 +43,6 @@ DIRDEPS = \ gnu/usr.bin/gperf/doc \ gnu/usr.bin/grep \ gnu/usr.bin/grep/doc \ - gnu/usr.bin/groff/contrib/mm \ - gnu/usr.bin/groff/doc \ - gnu/usr.bin/groff/font/devX100 \ - gnu/usr.bin/groff/font/devX100-12 \ - gnu/usr.bin/groff/font/devX75 \ - gnu/usr.bin/groff/font/devX75-12 \ - gnu/usr.bin/groff/font/devascii \ - gnu/usr.bin/groff/font/devcp1047 \ - gnu/usr.bin/groff/font/devdvi \ - gnu/usr.bin/groff/font/devhtml \ - gnu/usr.bin/groff/font/devkoi8-r \ - gnu/usr.bin/groff/font/devlatin1 \ - gnu/usr.bin/groff/font/devlbp \ - gnu/usr.bin/groff/font/devlj4 \ - gnu/usr.bin/groff/font/devps \ - gnu/usr.bin/groff/font/devutf8 \ - gnu/usr.bin/groff/man \ - gnu/usr.bin/groff/src/devices/grodvi \ - gnu/usr.bin/groff/src/devices/grohtml \ - gnu/usr.bin/groff/src/devices/grolbp \ - gnu/usr.bin/groff/src/devices/grolj4 \ - gnu/usr.bin/groff/src/devices/grops \ - gnu/usr.bin/groff/src/devices/grotty \ - gnu/usr.bin/groff/src/libs/libbib \ - gnu/usr.bin/groff/src/libs/libdriver \ - gnu/usr.bin/groff/src/libs/libgroff \ - gnu/usr.bin/groff/src/preproc/eqn \ - gnu/usr.bin/groff/src/preproc/grn \ - gnu/usr.bin/groff/src/preproc/html \ - gnu/usr.bin/groff/src/preproc/pic \ - gnu/usr.bin/groff/src/preproc/refer \ - gnu/usr.bin/groff/src/preproc/soelim \ - gnu/usr.bin/groff/src/preproc/tbl \ - gnu/usr.bin/groff/src/roff/groff \ - gnu/usr.bin/groff/src/roff/grog \ - gnu/usr.bin/groff/src/roff/nroff \ - gnu/usr.bin/groff/src/roff/psroff \ - gnu/usr.bin/groff/src/roff/troff \ - gnu/usr.bin/groff/src/utils/addftinfo \ - gnu/usr.bin/groff/src/utils/afmtodit \ - gnu/usr.bin/groff/src/utils/hpftodit \ - gnu/usr.bin/groff/src/utils/indxbib \ - gnu/usr.bin/groff/src/utils/lkbib \ - gnu/usr.bin/groff/src/utils/lookbib \ - gnu/usr.bin/groff/src/utils/pfbtops \ - gnu/usr.bin/groff/src/utils/tfmtodit \ - gnu/usr.bin/groff/tmac \ gnu/usr.bin/rcs/ci \ gnu/usr.bin/rcs/co \ gnu/usr.bin/rcs/ident \ From owner-svn-src-head@freebsd.org Fri Oct 13 18:30:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 499D3E2985D; Fri, 13 Oct 2017 18:30:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 182BB70399; Fri, 13 Oct 2017 18:30:33 +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 v9DIUWFo036910; Fri, 13 Oct 2017 18:30:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DIUW0I036909; Fri, 13 Oct 2017 18:30:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201710131830.v9DIUW0I036909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 13 Oct 2017 18:30:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324605 - head/targets/pseudo/userland/gnu X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/targets/pseudo/userland/gnu X-SVN-Commit-Revision: 324605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 18:30:33 -0000 Author: emaste Date: Fri Oct 13 18:30:32 2017 New Revision: 324605 URL: https://svnweb.freebsd.org/changeset/base/324605 Log: clean up remnants of removed GPL software send-pr r267486 texinfo r276551 ranlib r286332 sdiff r298823 rcs r307351 diff r317209 Modified: head/targets/pseudo/userland/gnu/Makefile.depend Modified: head/targets/pseudo/userland/gnu/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/gnu/Makefile.depend Fri Oct 13 18:23:08 2017 (r324604) +++ head/targets/pseudo/userland/gnu/Makefile.depend Fri Oct 13 18:30:32 2017 (r324605) @@ -28,10 +28,7 @@ DIRDEPS = \ gnu/usr.bin/binutils/libiberty \ gnu/usr.bin/binutils/libopcodes \ gnu/usr.bin/binutils/objdump \ - gnu/usr.bin/binutils/ranlib \ gnu/usr.bin/dialog \ - gnu/usr.bin/diff \ - gnu/usr.bin/diff/doc \ gnu/usr.bin/diff3 \ gnu/usr.bin/gdb/doc \ gnu/usr.bin/gdb/gdb \ @@ -43,26 +40,6 @@ DIRDEPS = \ gnu/usr.bin/gperf/doc \ gnu/usr.bin/grep \ gnu/usr.bin/grep/doc \ - gnu/usr.bin/rcs/ci \ - gnu/usr.bin/rcs/co \ - gnu/usr.bin/rcs/ident \ - gnu/usr.bin/rcs/lib \ - gnu/usr.bin/rcs/merge \ - gnu/usr.bin/rcs/rcs \ - gnu/usr.bin/rcs/rcsclean \ - gnu/usr.bin/rcs/rcsdiff \ - gnu/usr.bin/rcs/rcsfreeze \ - gnu/usr.bin/rcs/rcsmerge \ - gnu/usr.bin/rcs/rlog \ - gnu/usr.bin/sdiff \ - gnu/usr.bin/send-pr/doc \ - gnu/usr.bin/texinfo/doc \ - gnu/usr.bin/texinfo/info \ - gnu/usr.bin/texinfo/infokey \ - gnu/usr.bin/texinfo/install-info \ - gnu/usr.bin/texinfo/libtxi \ - gnu/usr.bin/texinfo/makeinfo \ - gnu/usr.bin/texinfo/texindex \ .if ${MK_GPL_DTC} != "no" DIRDEPS+= gnu/usr.bin/dtc From owner-svn-src-head@freebsd.org Fri Oct 13 19:27:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF05DE2ABC0; Fri, 13 Oct 2017 19:27:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE2A671C78; Fri, 13 Oct 2017 19:27:34 +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 v9DJRXW7061956; Fri, 13 Oct 2017 19:27:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DJRXth061955; Fri, 13 Oct 2017 19:27:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201710131927.v9DJRXth061955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 13 Oct 2017 19:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324606 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 324606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 19:27:35 -0000 Author: markj Date: Fri Oct 13 19:27:33 2017 New Revision: 324606 URL: https://svnweb.freebsd.org/changeset/base/324606 Log: Make the PHOLD in linux_wait_event_common() unconditional. After some in-progress work is committed, this would otherwise be the only instance of #if(n)def NO_SWAPPING in the tree. Moreover, the requisite opt_vm.h include was missing, so the PHOLD/PRELE calls were always being compiled in anyway. MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_schedule.c Fri Oct 13 18:30:32 2017 (r324605) +++ head/sys/compat/linuxkpi/common/src/linux_schedule.c Fri Oct 13 19:27:33 2017 (r324606) @@ -232,9 +232,7 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q * Our wait queue entry is on the stack - make sure it doesn't * get swapped out while we sleep. */ -#ifndef NO_SWAPPING PHOLD(task->task_thread->td_proc); -#endif sleepq_lock(task); if (atomic_load_acq_int(&task->state) != TASK_WAKING) { ret = linux_add_to_sleepqueue(task, "wevent", timeout, state); @@ -242,9 +240,7 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q sleepq_release(task); ret = linux_signal_pending_state(state, task) ? -ERESTARTSYS : 0; } -#ifndef NO_SWAPPING PRELE(task->task_thread->td_proc); -#endif PICKUP_GIANT(); From owner-svn-src-head@freebsd.org Fri Oct 13 19:41:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 765C6E2B31A; Fri, 13 Oct 2017 19:41:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44AB1722EF; Fri, 13 Oct 2017 19:41:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DJfZHc068157; Fri, 13 Oct 2017 19:41:35 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DJfZBt068155; Fri, 13 Oct 2017 19:41:35 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201710131941.v9DJfZBt068155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Oct 2017 19:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324607 - in head/sys/dev/usb: . serial X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys/dev/usb: . serial X-SVN-Commit-Revision: 324607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 19:41:36 -0000 Author: kp Date: Fri Oct 13 19:41:35 2017 New Revision: 324607 URL: https://svnweb.freebsd.org/changeset/base/324607 Log: Support the D-Link DWM-222 LTE Dongle Submitted by: Daniel Hänschke Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Oct 13 19:27:33 2017 (r324606) +++ head/sys/dev/usb/serial/u3g.c Fri Oct 13 19:41:35 2017 (r324607) @@ -236,6 +236,8 @@ static const STRUCT_USB_HOST_ID u3g_devs[] = { U3G_DEV(DLINK, DWR510, 0), U3G_DEV(DLINK, DWM157_CD, U3GINIT_SCSIEJECT), U3G_DEV(DLINK, DWM157, 0), + U3G_DEV(DLINK, DWM222_CD, U3GINIT_SCSIEJECT), + U3G_DEV(DLINK, DWM222, 0), U3G_DEV(DLINK3, DWM652, 0), U3G_DEV(HP, EV2200, 0), U3G_DEV(HP, HS2300, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Fri Oct 13 19:27:33 2017 (r324606) +++ head/sys/dev/usb/usbdevs Fri Oct 13 19:41:35 2017 (r324607) @@ -1673,8 +1673,10 @@ product DLINK DSB650TX2 0x4102 10/100 Ethernet product DLINK DUB1312 0x4a00 10/100/1000 Ethernet product DLINK DWM157 0x7d02 DWM-157 product DLINK DWR510 0x7e12 DWR-510 +product DLINK DWM222 0x7e35 DWM-222 product DLINK DWM157_CD 0xa707 DWM-157 CD-ROM Mode product DLINK DWR510_CD 0xa805 DWR-510 CD-ROM Mode +product DLINK DWM222_CD 0xab00 DWM-222 CD-ROM Mode product DLINK DSB650 0xabc1 10/100 Ethernet product DLINK DUBH7 0xf103 DUB-H7 USB 2.0 7-Port Hub product DLINK2 RTL8192SU_1 0x3300 RTL8192SU From owner-svn-src-head@freebsd.org Fri Oct 13 20:29:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5029E2C02B; Fri, 13 Oct 2017 20:29:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7436873AD5; Fri, 13 Oct 2017 20:29:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9DKTZG4088096; Fri, 13 Oct 2017 20:29:35 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DKTZqE088095; Fri, 13 Oct 2017 20:29:35 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201710132029.v9DKTZqE088095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 13 Oct 2017 20:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324608 - head/etc/devd X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/etc/devd X-SVN-Commit-Revision: 324608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 20:29:36 -0000 Author: kp Date: Fri Oct 13 20:29:35 2017 New Revision: 324608 URL: https://svnweb.freebsd.org/changeset/base/324608 Log: Regenerate usb.conf Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Fri Oct 13 19:41:35 2017 (r324607) +++ head/etc/devd/usb.conf Fri Oct 13 20:29:35 2017 (r324608) @@ -4744,6 +4744,14 @@ nomatch 32 { nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; + match "vendor" "0x17ef"; + match "product" "0x7205"; + action "kldload -n if_ure"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; match "vendor" "0x17f4"; match "product" "0xaaaa"; action "kldload -n uslcom"; @@ -5097,7 +5105,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x2001"; - match "product" "(0x7d02|0x7e12|0xa707|0xa805)"; + match "product" "(0x7d02|0x7e12|0x7e35|0xa707|0xa805|0xab00)"; action "kldload -n u3g"; }; @@ -5905,5 +5913,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2754 USB entries processed +# 2757 USB entries processed From owner-svn-src-head@freebsd.org Fri Oct 13 20:31:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3624E2C228; Fri, 13 Oct 2017 20:31:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 830FE73E0E; Fri, 13 Oct 2017 20:31:57 +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 v9DKVuBD089010; Fri, 13 Oct 2017 20:31:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DKVueS089009; Fri, 13 Oct 2017 20:31:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710132031.v9DKVueS089009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 13 Oct 2017 20:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324609 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 324609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 20:31:57 -0000 Author: mjg Date: Fri Oct 13 20:31:56 2017 New Revision: 324609 URL: https://svnweb.freebsd.org/changeset/base/324609 Log: mtx: change MTX_UNOWNED from 4 to 0 The value is spread all over the kernel and zeroing a register is cheaper/shorter than setting it up to an arbitrary value. Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. MFC after: 1 week Modified: head/sys/sys/mutex.h Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Fri Oct 13 20:29:35 2017 (r324608) +++ head/sys/sys/mutex.h Fri Oct 13 20:31:56 2017 (r324609) @@ -65,15 +65,11 @@ * State bits kept in mutex->mtx_lock, for the DEFAULT lock type. None of this, * with the exception of MTX_UNOWNED, applies to spin locks. */ +#define MTX_UNOWNED 0x00000000 /* Cookie for free mutex */ #define MTX_RECURSED 0x00000001 /* lock recursed (for MTX_DEF only) */ #define MTX_CONTESTED 0x00000002 /* lock contested (for MTX_DEF only) */ -#define MTX_UNOWNED 0x00000004 /* Cookie for free mutex */ -#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_UNOWNED) - -/* - * Value stored in mutex->mtx_lock to denote a destroyed mutex. - */ -#define MTX_DESTROYED (MTX_CONTESTED | MTX_UNOWNED) +#define MTX_DESTROYED 0x00000004 /* lock destroyed */ +#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_DESTROYED) /* * Prototypes From owner-svn-src-head@freebsd.org Fri Oct 13 20:54:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBE8AE2CAD6 for ; Fri, 13 Oct 2017 20:54:35 +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 BDDC27493F for ; Fri, 13 Oct 2017 20:54:35 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 9dff4aeb-b058-11e7-b50b-53dc5ecda239 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 9dff4aeb-b058-11e7-b50b-53dc5ecda239; Fri, 13 Oct 2017 20:53:51 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9DKsRQ7001870; Fri, 13 Oct 2017 14:54:27 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507928067.8386.84.camel@freebsd.org> Subject: Re: svn commit: r324609 - head/sys/sys From: Ian Lepore To: Mateusz Guzik , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 13 Oct 2017 14:54:27 -0600 In-Reply-To: <201710132031.v9DKVueS089009@repo.freebsd.org> References: <201710132031.v9DKVueS089009@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.23 Precedence: list List-Id: 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, 13 Oct 2017 20:54:36 -0000 On Fri, 2017-10-13 at 20:31 +0000, Mateusz Guzik wrote: > Author: mjg > Date: Fri Oct 13 20:31:56 2017 > New Revision: 324609 > URL: https://svnweb.freebsd.org/changeset/base/324609 > > Log: >   mtx: change MTX_UNOWNED from 4 to 0 >    >   The value is spread all over the kernel and zeroing a register is >   cheaper/shorter than setting it up to an arbitrary value. >    >   Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. >    >   MFC after: 1 week > If you MFC this, won't that break the ABI for modules compiled against earlier versions of the branch? Also, won't this trigger a need to recompile out of tree modules such as video drivers, virtualbox, etc?  Does that need an UPDATING entry? -- Ian From owner-svn-src-head@freebsd.org Fri Oct 13 21:01:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C723E2CD70; Fri, 13 Oct 2017 21:01:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::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 13DF374D88; Fri, 13 Oct 2017 21:01:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x235.google.com with SMTP id m189so6537777qke.4; Fri, 13 Oct 2017 14:01:47 -0700 (PDT) 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=g1a3zljyY/QJKiwyaoLYoGd+HUjU436xp0AdzzAJw/8=; b=u6jkEWsL8STll8u6LxjukvT4Kijhu4GCO4RYkY3cwJnaJvTSV1KLFB0j0xjvj+b5vv A9drLQIqnji8ANvYme/N2J/sPhOhCTGyL3Zq68dQmhB+G3FbtHOsu355F4SYvyNVUh0E 3AQcAuNRFEqh7fraUoyvqlHRXQtjJ18Z2d12poi5RgUWeApov1eEqLnCj6OiDzX8PH2D /v1zDXrbDGkopNrQiCdREWGbiJyc6XEkyPKB9/DpUKrdQ5P6IaJ88JqrVKPDnZ6FRjrM rBtpYqXDhnks2q5UUwx0ACmT4tmhgvRXHZ9zr2N9UO3S/5be9gts8uyqWihjmGW8404F rKEg== 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=g1a3zljyY/QJKiwyaoLYoGd+HUjU436xp0AdzzAJw/8=; b=Vijz3Sz2jmdm2xvBzx8yN/cEXWLgAW1A5AI4ikEoT+GH//KIiVw0GLwb0YcowVzEhk 3o7ZHg6waP/UaJ2n9ir9wilG4RvK2hnK//AevXWXDYCOB42mPLYWtTP5lwcQqpC3VniE Q+lvz3bEXFN0R7IedoqAKoYV5p8DskzhMgDKTGLfho2aV0NVNJVCk/djWMy13gNxAE4J fk6EPP3I2p2oU/ZPX6rUd6/KrJrraZN8U/JGfnvulJt6i4Bf5wKJCwq3iKk8+uX9wTKR HSDGGq0RWd7ayzUL9ZlKAgA2BPubriCWxnCEm4/4+N2q0a1pT5WvL4gSC290Dx64Yeb2 HV/Q== X-Gm-Message-State: AMCzsaVXPaBqF1hmgvOlsjmVxu44LwQUVXuDJ9mS1a1tjTHKarEB+QPH gfp9NZT5V46gIYDVxrSG3tDHBco7wCNGIrFRKYdTjg== X-Google-Smtp-Source: ABhQp+SOyNEUMSNMIVAx6Ur1M+9SB/Ow+TUoTHDYr7ifq4RmTlJkJfs7eyFjyjZ2yVrApJuqj/Y4z8koxcZVoDT86LM= X-Received: by 10.55.204.157 with SMTP id n29mr3604197qkl.243.1507928505814; Fri, 13 Oct 2017 14:01:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.51.167 with HTTP; Fri, 13 Oct 2017 14:01:45 -0700 (PDT) In-Reply-To: <1507928067.8386.84.camel@freebsd.org> References: <201710132031.v9DKVueS089009@repo.freebsd.org> <1507928067.8386.84.camel@freebsd.org> From: Mateusz Guzik Date: Fri, 13 Oct 2017 23:01:45 +0200 Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Ian Lepore Cc: Mateusz Guzik , "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.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 21:01:47 -0000 On Fri, Oct 13, 2017 at 10:54 PM, Ian Lepore wrote: > On Fri, 2017-10-13 at 20:31 +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Fri Oct 13 20:31:56 2017 > > New Revision: 324609 > > URL: https://svnweb.freebsd.org/changeset/base/324609 > > > > Log: > > mtx: change MTX_UNOWNED from 4 to 0 > > > > The value is spread all over the kernel and zeroing a register is > > cheaper/shorter than setting it up to an arbitrary value. > > > > Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. > > > > MFC after: 1 week > > > > If you MFC this, won't that break the ABI for modules compiled against > earlier versions of the branch? > > Also, won't this trigger a need to recompile out of tree modules such > as video drivers, virtualbox, etc? Does that need an UPDATING entry? > > -- Ian > > All modules (even ones provided with base) always call dedicated primitives, i.e. they never inspect the lock value. The only non-opaque part of locks (and annoying at that) is placememnt of the lock word, which right not is at the very end. This happens to matter when passing the lock around to funcs like _sleep which automagically determine what it is. I am considering a change for head which moves the word to the beginning instead and that probably wont be MFCable unless I come up with a reasonably non-terrible kludge. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Fri Oct 13 21:38:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E99E4E2D71D; Fri, 13 Oct 2017 21:38:05 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.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 D74CE75AEF; Fri, 13 Oct 2017 21:38:05 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=56550 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1e35uF-000CVH-Er; Fri, 13 Oct 2017 19:46:03 +0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r324471 - head/sys/boot From: Devin Teske In-Reply-To: Date: Fri, 13 Oct 2017 14:38:03 -0700 Cc: Devin Teske , Warner Losh , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <41ECAC77-1DCF-4107-A2EC-52141540013E@freebsd.org> References: <201710100453.v9A4rQ6W078536@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 13 Oct 2017 21:38:06 -0000 > On Oct 13, 2017, at 8:53 AM, Ngie Cooper = wrote: >=20 >=20 >> On Oct 9, 2017, at 21:57, Ngie Cooper (yaneurabeya) = wrote: >>=20 >>=20 >>> On Oct 9, 2017, at 21:56, Warner Losh wrote: >>>=20 >>> DO NOT MAKE EDITS TO sys/boot. YOU ARE CREATING CONFLICTS FOR ME. >>>=20 >>> DO NOT MAKE ANY COMMITS TO sys/boot. >>>=20 >>> BACK OFF. >>>=20 >>> Seriously, though, extra changes create extra friction, and these = changes aren't worth any friction at all. I'm deleting LIBSAU and this = guarantees a conflict when I update. >>>=20 >>> So please, do not make any edits to sys/boot whatsoever, no matter = how trivial. >>>=20 >>> At least until I'm done. >>=20 >> Ok >=20 > So... what=E2=80=99s the status? Your typo gave me an idea for a new tool ... Usage: whatfs path ... Return unique list of filesystems containing list of paths. Lol ;D E.g., "whatfs / /usr /usr/local /foo /bar" would list minimal filesystem = mountpoints containing all given paths --=20 Devin= From owner-svn-src-head@freebsd.org Fri Oct 13 21:54:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8584FE2DF3B; Fri, 13 Oct 2017 21:54:35 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FCDC76453; Fri, 13 Oct 2017 21:54:35 +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 v9DLsYrl026417; Fri, 13 Oct 2017 21:54:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9DLsYeC026414; Fri, 13 Oct 2017 21:54:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710132154.v9DLsYeC026414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 13 Oct 2017 21:54:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324610 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 324610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 21:54:35 -0000 Author: mjg Date: Fri Oct 13 21:54:34 2017 New Revision: 324610 URL: https://svnweb.freebsd.org/changeset/base/324610 Log: Reduce traffic on vm_cnt.v_free_count The variable is modified with the highly contended page free queue lock. It unnecessarily shares a cacheline with purely read-only fields and is re-read after the lock is dropped in the page allocation code making the hold time longer. Pad the variable just like the others and store the value as found with the lock held instead of re-reading. Provides a modest 1%-ish speed up in concurrent page faults. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D12665 Modified: head/sys/sys/vmmeter.h head/sys/vm/vm_page.c head/sys/vm/vm_phys.h Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Fri Oct 13 20:31:56 2017 (r324609) +++ head/sys/sys/vmmeter.h Fri Oct 13 21:54:34 2017 (r324610) @@ -131,7 +131,6 @@ struct vmmeter { u_int v_free_reserved; /* (c) pages reserved for deadlock */ u_int v_free_target; /* (c) pages desired free */ u_int v_free_min; /* (c) pages desired free */ - u_int v_free_count; /* (f) pages free */ u_int v_inactive_target; /* (c) pages desired inactive */ u_int v_pageout_free_min; /* (c) min pages reserved for kernel */ u_int v_interrupt_free_min; /* (c) reserved pages for int code */ @@ -141,6 +140,7 @@ struct vmmeter { u_int v_inactive_count VMMETER_ALIGNED; /* (a) pages inactive */ u_int v_laundry_count VMMETER_ALIGNED; /* (a) pages eligible for laundering */ + u_int v_free_count VMMETER_ALIGNED; /* (a) pages free */ }; #endif /* _KERNEL || _WANT_VMMETER */ @@ -208,10 +208,10 @@ vm_paging_target(void) * Returns TRUE if the pagedaemon needs to be woken up. */ static inline int -vm_paging_needed(void) +vm_paging_needed(u_int free_count) { - return (vm_cnt.v_free_count < vm_pageout_wakeup_thresh); + return (free_count < vm_pageout_wakeup_thresh); } /* Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Oct 13 20:31:56 2017 (r324609) +++ head/sys/vm/vm_page.c Fri Oct 13 21:54:34 2017 (r324610) @@ -1588,6 +1588,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi { vm_page_t m; int flags, req_class; + u_int free_count; KASSERT((object != NULL) == ((req & VM_ALLOC_NOOBJ) == 0) && (object != NULL || (req & VM_ALLOC_SBUSY) == 0) && @@ -1655,7 +1656,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi * At this point we had better have found a good page. */ KASSERT(m != NULL, ("missing page")); - vm_phys_freecnt_adj(m, -1); + free_count = vm_phys_freecnt_adj(m, -1); mtx_unlock(&vm_page_queue_free_mtx); vm_page_alloc_check(m); @@ -1713,7 +1714,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi * Don't wakeup too often - wakeup the pageout daemon when * we would be nearly out of memory. */ - if (vm_paging_needed()) + if (vm_paging_needed(free_count)) pagedaemon_wakeup(); return (m); @@ -1899,7 +1900,7 @@ retry: pmap_page_set_memattr(m, memattr); pindex++; } - if (vm_paging_needed()) + if (vm_paging_needed(vm_cnt.v_free_count)) pagedaemon_wakeup(); return (m_ret); } @@ -1948,7 +1949,7 @@ vm_page_t vm_page_alloc_freelist(int flind, int req) { vm_page_t m; - u_int flags; + u_int flags, free_count; int req_class; req_class = req & VM_ALLOC_CLASS_MASK; @@ -1980,7 +1981,7 @@ vm_page_alloc_freelist(int flind, int req) mtx_unlock(&vm_page_queue_free_mtx); return (NULL); } - vm_phys_freecnt_adj(m, -1); + free_count = vm_phys_freecnt_adj(m, -1); mtx_unlock(&vm_page_queue_free_mtx); vm_page_alloc_check(m); @@ -2002,7 +2003,7 @@ vm_page_alloc_freelist(int flind, int req) } /* Unmanaged pages don't use "act_count". */ m->oflags = VPO_UNMANAGED; - if (vm_paging_needed()) + if (vm_paging_needed(free_count)) pagedaemon_wakeup(); return (m); } Modified: head/sys/vm/vm_phys.h ============================================================================== --- head/sys/vm/vm_phys.h Fri Oct 13 20:31:56 2017 (r324609) +++ head/sys/vm/vm_phys.h Fri Oct 13 21:54:34 2017 (r324610) @@ -112,13 +112,13 @@ vm_phys_domain(vm_page_t m) #endif } -static inline void +static inline u_int vm_phys_freecnt_adj(vm_page_t m, int adj) { mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); - vm_cnt.v_free_count += adj; vm_phys_domain(m)->vmd_free_count += adj; + return (vm_cnt.v_free_count += adj); } #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Fri Oct 13 23:23:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C098FE2FF3E; Fri, 13 Oct 2017 23:23:16 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) (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 C5EAD7D237; Fri, 13 Oct 2017 23:23:15 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: by mail-wm0-f68.google.com with SMTP id l68so24329456wmd.5; Fri, 13 Oct 2017 16:23:15 -0700 (PDT) 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=EvZHU20KIboxgZ2fZ1LTFSEBkb6+C/w8x5VJ0HZMIvw=; b=pq6BvDWtqP9UUSeF+DFyl8b+FMoXANFybHoeucacDsrtd/Th/7//slNwBIlA1f/tT4 Q2TZTgAyTmke76cuUpuC73bkhqztvMdwUXxAecEVdX+ChMxRVi8bG3QOaL3pE94cmyeB S+rsrCUatrqzzXOAEKimKb3i2TYEPFSeRq2E0RjE7SknXZa56BA9jK61XGw8muy+9ftb hl48xJN9Y4/RMvxZVRjk+WN8PSfKYoU2HUYRWTFsTaT8AOOcXNw1I58AFgeuHpfd1Bwj QJqbB/G74rQiXaRS5Hc/ZVP+dHLFJgg5xcr6tmtwSSofn1LjJZIPqzem3WwZUM6Nie8f plCg== X-Gm-Message-State: AMCzsaWVsaGkoh27J9rx4+/o4ZvcFsUrr4HZqBGvz+uliwdfRIYK9Vte VM1uTMQSuQBPe0y4iQm16FxzJw== X-Received: by 10.80.212.43 with SMTP id t43mr3650708edh.89.1507930730448; Fri, 13 Oct 2017 14:38:50 -0700 (PDT) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com. [74.125.82.41]) by smtp.gmail.com with ESMTPSA id w10sm1350687edj.11.2017.10.13.14.38.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 14:38:50 -0700 (PDT) Received: by mail-wm0-f41.google.com with SMTP id m72so23793291wmc.1; Fri, 13 Oct 2017 14:38:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TZwlEfuj9jOi7FabU9neKmvrNwyQAu5XrUDyU5XOiEYBJR+2fd+msIdRvKsOGSrJ32xoCvvPJT65HYeYPeEVA= X-Received: by 10.28.111.206 with SMTP id c75mr2481479wmi.123.1507930729982; Fri, 13 Oct 2017 14:38:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.143.20 with HTTP; Fri, 13 Oct 2017 14:38:49 -0700 (PDT) In-Reply-To: <201710132031.v9DKVueS089009@repo.freebsd.org> References: <201710132031.v9DKVueS089009@repo.freebsd.org> From: Svatopluk Kraus Date: Fri, 13 Oct 2017 23:38:49 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Oct 2017 23:23:16 -0000 MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you removed it actually. I have very bad feeling about it. But maybe, it's really possible and in that case, a very good explanation should be provided. Svata On Fri, Oct 13, 2017 at 10:31 PM, Mateusz Guzik wrote: > Author: mjg > Date: Fri Oct 13 20:31:56 2017 > New Revision: 324609 > URL: https://svnweb.freebsd.org/changeset/base/324609 > > Log: > mtx: change MTX_UNOWNED from 4 to 0 > > The value is spread all over the kernel and zeroing a register is > cheaper/shorter than setting it up to an arbitrary value. > > Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. > > MFC after: 1 week > > Modified: > head/sys/sys/mutex.h > > Modified: head/sys/sys/mutex.h > ============================================================================== > --- head/sys/sys/mutex.h Fri Oct 13 20:29:35 2017 (r324608) > +++ head/sys/sys/mutex.h Fri Oct 13 20:31:56 2017 (r324609) > @@ -65,15 +65,11 @@ > * State bits kept in mutex->mtx_lock, for the DEFAULT lock type. None of this, > * with the exception of MTX_UNOWNED, applies to spin locks. > */ > +#define MTX_UNOWNED 0x00000000 /* Cookie for free mutex */ > #define MTX_RECURSED 0x00000001 /* lock recursed (for MTX_DEF only) */ > #define MTX_CONTESTED 0x00000002 /* lock contested (for MTX_DEF only) */ > -#define MTX_UNOWNED 0x00000004 /* Cookie for free mutex */ > -#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_UNOWNED) > - > -/* > - * Value stored in mutex->mtx_lock to denote a destroyed mutex. > - */ > -#define MTX_DESTROYED (MTX_CONTESTED | MTX_UNOWNED) > +#define MTX_DESTROYED 0x00000004 /* lock destroyed */ > +#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_DESTROYED) > > /* > * Prototypes > From owner-svn-src-head@freebsd.org Sat Oct 14 00:30:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C0A8E311C0 for ; Sat, 14 Oct 2017 00:30:54 +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 42A067E9DC for ; Sat, 14 Oct 2017 00:30:53 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: d8281d00-b076-11e7-b50b-53dc5ecda239 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id d8281d00-b076-11e7-b50b-53dc5ecda239; Sat, 14 Oct 2017 00:30:14 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v9E0Uok2002286; Fri, 13 Oct 2017 18:30:50 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1507941050.8386.88.camel@freebsd.org> Subject: Re: svn commit: r324609 - head/sys/sys From: Ian Lepore To: Svatopluk Kraus , Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 13 Oct 2017 18:30:50 -0600 In-Reply-To: References: <201710132031.v9DKVueS089009@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.23 Precedence: list List-Id: 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, 14 Oct 2017 00:30:54 -0000 On Fri, 2017-10-13 at 23:38 +0200, Svatopluk Kraus wrote: > MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you > removed it actually. I have very bad feeling about it. But maybe, it's > really possible and in that case, a very good explanation should be > provided. > > Svata > The part that scares me is that DESTROYED may have been defined as CONTESTED|UNOWNED for subtle and clever reasons lost in the mists of time.  Any of the places that are testing the MTX_CONTESTED bit may have been relying somehow on the fact that a destroyed mutex has that bit set. Then again, maybe Mateusz has carefully analyzed all this stuff, and we should just relax. :) -- Ian > > On Fri, Oct 13, 2017 at 10:31 PM, Mateusz Guzik > wrote: > > > > Author: mjg > > Date: Fri Oct 13 20:31:56 2017 > > New Revision: 324609 > > URL: https://svnweb.freebsd.org/changeset/base/324609 > > > > Log: > >   mtx: change MTX_UNOWNED from 4 to 0 > > > >   The value is spread all over the kernel and zeroing a register is > >   cheaper/shorter than setting it up to an arbitrary value. > > > >   Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. > > > >   MFC after:    1 week > > > > Modified: > >   head/sys/sys/mutex.h > > > > Modified: head/sys/sys/mutex.h > > =================================================================== > > =========== > > --- head/sys/sys/mutex.h        Fri Oct 13 20:29:35 > > 2017        (r324608) > > +++ head/sys/sys/mutex.h        Fri Oct 13 20:31:56 > > 2017        (r324609) > > @@ -65,15 +65,11 @@ > >   * State bits kept in mutex->mtx_lock, for the DEFAULT lock type. > > None of this, > >   * with the exception of MTX_UNOWNED, applies to spin locks. > >   */ > > +#define        MTX_UNOWNED     0x00000000      /* Cookie for free > > mutex */ > >  #define        MTX_RECURSED    0x00000001      /* lock recursed > > (for MTX_DEF only) */ > >  #define        MTX_CONTESTED   0x00000002      /* lock contested > > (for MTX_DEF only) */ > > -#define MTX_UNOWNED    0x00000004      /* Cookie for free mutex */ > > -#define        MTX_FLAGMASK    (MTX_RECURSED | MTX_CONTESTED | > > MTX_UNOWNED) > > - > > -/* > > - * Value stored in mutex->mtx_lock to denote a destroyed mutex. > > - */ > > -#define        MTX_DESTROYED   (MTX_CONTESTED | MTX_UNOWNED) > > +#define        MTX_DESTROYED   0x00000004      /* lock destroyed > > */ > > +#define        MTX_FLAGMASK    (MTX_RECURSED | MTX_CONTESTED | > > MTX_DESTROYED) > > > >  /* > >   * Prototypes > > From owner-svn-src-head@freebsd.org Sat Oct 14 00:47:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8478CE31663; Sat, 14 Oct 2017 00:47: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 mx1.freebsd.org (Postfix) with ESMTPS id 43FCD7F10E; Sat, 14 Oct 2017 00:47: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 v9E0lUwM098014; Sat, 14 Oct 2017 00:47:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9E0lUhq098013; Sat, 14 Oct 2017 00:47:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710140047.v9E0lUhq098013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Oct 2017 00:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324613 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 324613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 00:47:31 -0000 Author: mjg Date: Sat Oct 14 00:47:30 2017 New Revision: 324613 URL: https://svnweb.freebsd.org/changeset/base/324613 Log: mtx: fix up owner_mtx after r324609 Now that MTX_UNOWNED is 0 the test was alwayas false. Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Fri Oct 13 22:40:57 2017 (r324612) +++ head/sys/kern/kern_mutex.c Sat Oct 14 00:47:30 2017 (r324613) @@ -217,7 +217,7 @@ owner_mtx(const struct lock_object *lock, struct threa m = (const struct mtx *)lock; x = m->mtx_lock; *owner = (struct thread *)(x & ~MTX_FLAGMASK); - return (x != MTX_UNOWNED); + return (*owner != NULL); } #endif From owner-svn-src-head@freebsd.org Sat Oct 14 00:48:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB0DE316E2; Sat, 14 Oct 2017 00:48:52 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 711EA7F25A; Sat, 14 Oct 2017 00:48:52 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x22e.google.com with SMTP id k123so6993450qke.3; Fri, 13 Oct 2017 17:48:52 -0700 (PDT) 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=JYP+bGdufTSW0oHxoVMiCBMU+GO+sK6BofgAzqc4jHc=; b=Ku/Z0w0XDbD9OxyYY/gXdNzGyRNt3augkmpyx/XSrbp9UtrYZ37y5TBXHrWsnx69uE /sCGi0cepUHKjbgX/eEIA5yRpxbRl2S5uKddkKqb/UpG0QMY2O4HJtEaW/zk9Rx36YyC +3TwDFSw/wlQfuoGp/ZMrnD7bKfay7Q6jhjFv9F7+xgJYSUzOeb3Sh+ov2LjIuqn/RxW D4lD/I+X7VZh7SjgCLOSMNYVCD9CeIWLu9e7UDtzP2J9rrt5GP3wL5wUky2urnAzifwU q0zcPtCSI05zi31jnKH9FjH/7/86t+2+iBwI7qMBYbTMX+qEHjE9VdxuIclyOiLXX8Lq vEsw== 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=JYP+bGdufTSW0oHxoVMiCBMU+GO+sK6BofgAzqc4jHc=; b=fcteHWjjaVgWILqZsguoWBbYOQslA81zZQrwYDq0pIyCksYQhX+XgO/oliHyGhzQRZ kggkCah/fZt9xwnSTr/tPDDljpqUJE+EIQLl6X5liRPuwm0JDdKYcBii7VWyJr9rCFDi 8jH039BqpYc9jvdiuse9ghO4dJ/Eam++g0MoRJ9DupFu8N/IEgTM03u/0zn5fae+4uuA HJrEw7+rxh5dME+8n3HAQuxk72daCARxOo1q4EHsuyCjUsctnSulGgNT3vp44BkMpVr1 fwDFMRfIG/Pz2FuA7GwoXXErqTOY/72hY4I4tEqIm9OCztENpTOk7hYZg2qMy4RFJqJs W1sA== X-Gm-Message-State: AMCzsaX5WtOmZQT4+9E6kyHDaY092Z90TV6K5TLr5SuwiARahAe02W6o vUZyO3NjcSi0sgjYIiIh7WAyDZBawWh8UmI9ecUs9A== X-Google-Smtp-Source: AOwi7QC9OmHJxCrn6dk1TB1TITye4ytY5nMkLgp4jGq+QK8NIAm2Py9ZO7+bh3zaEZSbPWC88umxpahhLd27aZDzn6s= X-Received: by 10.55.215.22 with SMTP id m22mr4671927qki.119.1507942131329; Fri, 13 Oct 2017 17:48:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.46.107 with HTTP; Fri, 13 Oct 2017 17:48:49 -0700 (PDT) In-Reply-To: <1507941050.8386.88.camel@freebsd.org> References: <201710132031.v9DKVueS089009@repo.freebsd.org> <1507941050.8386.88.camel@freebsd.org> From: Mateusz Guzik Date: Sat, 14 Oct 2017 02:48:49 +0200 Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Ian Lepore Cc: Svatopluk Kraus , Mateusz Guzik , "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.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 00:48:52 -0000 On Sat, Oct 14, 2017 at 2:30 AM, Ian Lepore wrote: > On Fri, 2017-10-13 at 23:38 +0200, Svatopluk Kraus wrote: > > MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you > > removed it actually. I have very bad feeling about it. But maybe, it's > > really possible and in that case, a very good explanation should be > > provided. > > > > Svata > > > > The part that scares me is that DESTROYED may have been defined as > CONTESTED|UNOWNED for subtle and clever reasons lost in the mists of > time. Any of the places that are testing the MTX_CONTESTED bit may > have been relying somehow on the fact that a destroyed mutex has that > bit set. > > Then again, maybe Mateusz has carefully analyzed all this stuff, and we > should just relax. :) > > I highly doubt there was anything clever going on. Rather, someone wanted to somehow denote a destroyed mutex, but did not want to introduce an additional flag - they are not free since the field shares the value with the address of the owner. That is, adding flags requires increasing alignment of struct thread and that adds to memory usage. Thus they combined the flags in a way which can never happen under normal circumstances. mtx_destroy explicitly sets the value to MTX_DESTROYED, so there is no change here. MTX_UNOWNED is *not* used as a flag. If you grep the tree you will see it is only used in direct comparisons. That said, I reviewed all users again and a minor bug was introduced in owner_mtx (only used by dtrace). For some reason it grabs the owner, but the instead of checking if it grabbed anything it checks the flag (fixed in r324613). So that's my bad. Justification for the change was provided in the commit message: it makes .text smaller on amd64 and probably all architectures. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Oct 14 04:27:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84C8CE3C12A; Sat, 14 Oct 2017 04:27:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5186C2FB4; Sat, 14 Oct 2017 04:27:59 +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 v9E4Rwjw092980; Sat, 14 Oct 2017 04:27:58 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9E4RwUc092979; Sat, 14 Oct 2017 04:27:58 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201710140427.v9E4RwUc092979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 14 Oct 2017 04:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324614 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 324614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 04:27:59 -0000 Author: mjg Date: Sat Oct 14 04:27:58 2017 New Revision: 324614 URL: https://svnweb.freebsd.org/changeset/base/324614 Log: Fix wrong v_free_count annotation - (f) instead of (a) Reported by: alc Modified: head/sys/sys/vmmeter.h Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Sat Oct 14 00:47:30 2017 (r324613) +++ head/sys/sys/vmmeter.h Sat Oct 14 04:27:58 2017 (r324614) @@ -140,7 +140,7 @@ struct vmmeter { u_int v_inactive_count VMMETER_ALIGNED; /* (a) pages inactive */ u_int v_laundry_count VMMETER_ALIGNED; /* (a) pages eligible for laundering */ - u_int v_free_count VMMETER_ALIGNED; /* (a) pages free */ + u_int v_free_count VMMETER_ALIGNED; /* (f) pages free */ }; #endif /* _KERNEL || _WANT_VMMETER */ From owner-svn-src-head@freebsd.org Sat Oct 14 05:12:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD92AE3CFC1; Sat, 14 Oct 2017 05:12:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::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 974C163606; Sat, 14 Oct 2017 05:12:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id 17so11882084pfn.12; Fri, 13 Oct 2017 22:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Q5LUKRAsgEXzTrvcau/RxZ79hMFdORYi51iujfOn+/c=; b=fCAqTR508n3I46XKmAFjK2qkyL1bNmtmPedciP0TunbW8tGOZK876x7mQiiHfQ6Ysv KRGbMcmQy94Eiwg+hd9f6o5vdjBYv1A+m9veBUlIWJnujrQSAEa8ppzqU9HCy6Oo+1vD dudvGU35Zfqf80V/otEhi4hU7grn6rLHZw11FXXWa2eBpVedC5fXpkM7ClvUilxv4mY4 cH/vG5afjERSiH/axuQ81SFTldN4j616xeNQY+RXg7sCfx3LlUjIJm1JD0ihxWKC7U3w XMETPDL9HKHXmuogo94Lw1OFQYsKrKn0evBytGhKScvT00vL5IGJUXzT/trEyeAjBw8u xvCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Q5LUKRAsgEXzTrvcau/RxZ79hMFdORYi51iujfOn+/c=; b=ABZASdWTw3MAz4bN8S8aNw/Vvw91oOiCUKncUKAc0T/A81m/DyNhPBiVAH54SuYDUp kXN34gLfF5ZUPA5SpYWLUCJXebCs7lJjBGpgjB8PE/zB0IltEnt9SELT9LuRkEDzPa6C HqQqAlzteAb6x9RqOWKYNsdiYKude2D28WL9mw03TCwCeOuv8JcZPi+CdLrWQSf1q4RO dfiwLO59Ke6rh2eZYT52fa3UJ/Q/EzN50DkNjPR6y9vWHs3ziHMSc2z6MDtnnHNW2cM9 hqoF9/qELfghcNtf9DNZvVTsseceXm17tckE7xuQ+QCW0KAJ8NxqTReEJ4JNVpPWIsUP TGzA== X-Gm-Message-State: AMCzsaWnITeDGrpjE+Tt6tSXR/Zjk5eDoCY8UH5Sc4qDHl3eWGMS2I8x xTdvdY5FF6ZC6BtYIEL7nqzPPmXt X-Google-Smtp-Source: AOwi7QB72wThSF6iJ9GnnBcz9W1l6ApIKkvt3KeKWiy/vR451win+wb0q45AVx3jSHwDwS6ZBAKiSQ== X-Received: by 10.99.172.83 with SMTP id z19mr3111462pgn.46.1507957937666; Fri, 13 Oct 2017 22:12:17 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id o128sm4730490pfg.118.2017.10.13.22.12.16 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Oct 2017 22:12:16 -0700 (PDT) Subject: Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C4B17B83-4374-47E5-8CC4-F3496C26AE87"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201710112153.v9BLroeR007323@repo.freebsd.org> Date: Fri, 13 Oct 2017 22:12:22 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> References: <201710112153.v9BLroeR007323@repo.freebsd.org> To: Matt Joras X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 05:12:18 -0000 --Apple-Mail=_C4B17B83-4374-47E5-8CC4-F3496C26AE87 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Oct 11, 2017, at 14:53, Matt Joras wrote: >=20 > Author: mjoras > Date: Wed Oct 11 21:53:50 2017 > New Revision: 324541 > URL: https://svnweb.freebsd.org/changeset/base/324541 >=20 > Log: > Add clearing function for unr(9). >=20 > Previously before you could call unrhdr_delete you needed to > individually free every allocated unit. It is useful to be able to = tear > down the unr without having to go through this process, as it is > significantly faster than freeing the individual units. >=20 > Reviewed by: cem, lidl > Approved by: rstone (mentor) > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D12591 >=20 > Modified: > head/share/man/man9/Makefile > head/share/man/man9/unr.9 > head/sys/kern/subr_unit.c > head/sys/sys/systm.h >=20 > Modified: head/share/man/man9/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/man/man9/Makefile Wed Oct 11 20:36:22 2017 = (r324540) > +++ head/share/man/man9/Makefile Wed Oct 11 21:53:50 2017 = (r324541) > @@ -414,6 +414,7 @@ MAN=3D accept_filter.9 \ > MLINKS=3D unr.9 alloc_unr.9 \ > unr.9 alloc_unrl.9 \ > unr.9 alloc_unr_specific.9 \ > + unr.9 clear_unrhdr.9 \ > unr.9 delete_unrhdr.9 \ > unr.9 free_unr.9 \ > unr.9 new_unrhdr.9 >=20 > Modified: head/share/man/man9/unr.9 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/share/man/man9/unr.9 Wed Oct 11 20:36:22 2017 = (r324540) > +++ head/share/man/man9/unr.9 Wed Oct 11 21:53:50 2017 = (r324541) > @@ -24,11 +24,12 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd July 5, 2010 > +.Dd October 4, 2017 > .Dt UNR 9 > .Os > .Sh NAME > .Nm new_unrhdr , > +.Nm clear_unrhdr , > .Nm delete_unrhdr , > .Nm alloc_unr , > .Nm alloc_unr_specific , > @@ -39,6 +40,8 @@ > .Ft "struct unrhdr *" > .Fn new_unrhdr "int low" "int high" "struct mtx *mutex" > .Ft void > +.Fn clear_unrhdr "struct unrhdr *uh" > +.Ft void > .Fn delete_unrhdr "struct unrhdr *uh" > .Ft int > .Fn alloc_unr "struct unrhdr *uh" > @@ -70,8 +73,16 @@ is not > .Dv NULL , > it is used for locking when allocating and freeing units. > Otherwise, internal mutex is used. > +.It Fn clear_unrhdr uh > +Clear all units from the specified unit number allocator entity. > +This function resets the entity as if it were just initialized with > +.Fn new_unrhdr . > .It Fn delete_unrhdr uh > -Destroy specified unit number allocator entity. > +Delete specified unit number allocator entity. > +This function frees the memory associated with the entity, it does = not free > +any units. > +To free all units use > +.Fn clear_unrhdr . > .It Fn alloc_unr uh > Return a new unit number. > The lowest free number is always allocated. >=20 > Modified: head/sys/kern/subr_unit.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017 = (r324540) > +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017 = (r324541) > @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh) > Free(uh); > } >=20 > +void > +clear_unrhdr(struct unrhdr *uh) > +{ > + struct unr *up, *uq; > + > + KASSERT(TAILQ_EMPTY(&uh->ppfree), > + ("unrhdr has postponed item for free")); > + up =3D TAILQ_FIRST(&uh->head); > + while (up !=3D NULL) { Could this be done with TAILQ_FOREACH_SAFE? -Ngie --Apple-Mail=_C4B17B83-4374-47E5-8CC4-F3496C26AE87 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZ4Zy3AAoJEPWDqSZpMIYVK7gQAL21exfm7Dzwiv+5DPPjurWW H7YkznsfYSDNIEuSx7TJJuQ4iawtShKYh8+fyGeKSDwclwqqVaKZqeqOUqUOCYch xt4U7cA7MJbSru6l8pn8Vc3B78dEWLZw/1PrAhbhjI7nT8fWMiNJeP9Bs26Px4QE 91YYHHoopqKh/gRI3tstPFmqCTzKgBbUgvS3BsPHC/M6tlgR+AWoZw6AK2O2FuMt EU6nxbBk5Lw2WLY2Daf7I+GA19bS2homXGQO5yHO3UTtyI6NgjXoEGUgKwnJATmT ibQVRNh38gGWC+ov808VkL9KHLqzgZvc1+aXG645DdylTN3pZM4lSGw2KY8FaF0p D8AZRq8bMQS8h2GBHQXDKYX1FITkd9IbqU8P+RPVAQoOn9RW7neTc/Kja+UCP8I/ P/lIhjPqFlsH+dHKMIevU9GbCSLHKPzNnxs4uG1Rjk/doqClnHCwvl+Of1Um7KoP +gJpSiWji1Yk/TH/DD9rZ9ZWIxE8ussgLiUWMHen09y5e/doLfz7jpB4pXwbeoQ1 m88B6KJB1xTkmKnH6KUauWOe7ALxqomPwMu8BJLuqCjIo6LSgWcs6oc41qiZa1wb iByiSw6u6RCo/Rhzhzlvud3vpIA8SfcaYi7jhz1IMal2zzj2PfhFK863ARCST2nl dCfFjNoP0fNp6sScEg0v =poKv -----END PGP SIGNATURE----- --Apple-Mail=_C4B17B83-4374-47E5-8CC4-F3496C26AE87-- From owner-svn-src-head@freebsd.org Sat Oct 14 06:33:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCCD8E3EA25; Sat, 14 Oct 2017 06:33:16 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: from mail-pf0-f179.google.com (mail-pf0-f179.google.com [209.85.192.179]) (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 B862A657ED; Sat, 14 Oct 2017 06:33:16 +0000 (UTC) (envelope-from matt.joras@gmail.com) Received: by mail-pf0-f179.google.com with SMTP id t188so9493341pfd.10; Fri, 13 Oct 2017 23:33:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VcaZbJcjay7JIjFtVGFUTdbtp43sKzMaf9hlyzHLXPc=; b=V1Tw4YBgL++KFPUy+pTMQfw30coUQcfthMsj0x/qdBG4xzAt+GtjpL5GL2yHjdLUx7 Ba9uv7fOVEflwO+/oYWH1Lq2Ndx5uM6JRBBk6p/Ra1OeBCKH6kGJpy+DGv54e/tcoTMz IMtHpM7Bkzng2wXZg1oVydU/n44WjaruF4b+5BeXFFBy1lfRSml4+XUAI1ubv/XHpaEn RlSgQJYtci8z/YbDHuhHSibpbzKRsSzHUVQTaEkMXUsJ3fgj2DZpUj+aNNzrRRVjWt2l 78bm7y6eJHkf+2oGYbh9xz36BM2tSb01kLwOSISR0f+Hav2hZIM2rRM39SLDO/bjAqh0 MUxg== X-Gm-Message-State: AMCzsaX4eHJpi99mcQyoSDu8iaaBKQ3YyvUtlOt+JtuGMUxoEwSluGZQ DffW9wrYdw662bXu33VSoRobQkZl X-Google-Smtp-Source: AOwi7QCExboDykYgUlEoHtrZ/QmzooUYm/8WXkhbZrwqRrX4dhbgf7UGQ4sgyZvL7+c7jILfOiI08g== X-Received: by 10.99.111.197 with SMTP id k188mr3175995pgc.344.1507959391308; Fri, 13 Oct 2017 22:36:31 -0700 (PDT) Received: from [192.168.2.122] (174-24-242-218.tukw.qwest.net. [174.24.242.218]) by smtp.gmail.com with ESMTPSA id s83sm4907881pfg.104.2017.10.13.22.36.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Oct 2017 22:36:30 -0700 (PDT) Subject: Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys To: "Ngie Cooper (yaneurabeya)" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201710112153.v9BLroeR007323@repo.freebsd.org> <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> From: Matt Joras Message-ID: Date: Fri, 13 Oct 2017 22:36:26 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 14 Oct 2017 06:33:17 -0000 On 10/13/2017 22:12, Ngie Cooper (yaneurabeya) wrote: >> Modified: head/sys/kern/subr_unit.c >> ============================================================================== >> --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017 (r324540) >> +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017 (r324541) >> @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh) >> Free(uh); >> } >> >> +void >> +clear_unrhdr(struct unrhdr *uh) >> +{ >> + struct unr *up, *uq; >> + >> + KASSERT(TAILQ_EMPTY(&uh->ppfree), >> + ("unrhdr has postponed item for free")); >> + up = TAILQ_FIRST(&uh->head); >> + while (up != NULL) { > Could this be done with TAILQ_FOREACH_SAFE? > -Ngie Yes but it is arguably inferior to do so. This while loop is theoretically faster since there is no need to individually remove the elements when you intend to delete every element. Matt From owner-svn-src-head@freebsd.org Sat Oct 14 09:47:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A26BE42F4A; Sat, 14 Oct 2017 09:47:38 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) (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 251016AA9C; Sat, 14 Oct 2017 09:47:37 +0000 (UTC) (envelope-from onwahe@gmail.com) Received: by mail-wm0-f65.google.com with SMTP id q124so25312095wmb.0; Sat, 14 Oct 2017 02:47:37 -0700 (PDT) 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=mpK+llHje6RNi7gY1C/bEDuPGt/xW0V8xLkxBh1tBlE=; b=fnQWSwj5e0V2h2a77CEilM+iJXkCA7Je0B60sTWitled1XCPfghDPd3CB8h8OlVhb5 LUbCqxUP4flKEMZkdgexcgWRCg32DrGIuBF1jko3lNEgdoA9kax2k8LouIjkkbgN3bSq dz7bGzkayMATwOsuLN4S+fQzynSlY+n9ytNR+41Nqe9TBMIlSqLGVD7h2TOZz4B9Y1cd LNBL3QFpLYrpXrXk8ptXvjkZ6sdaqhXhjFJfUX9u4lKEHXjfPva7X6vrthIwRlTIo/lV LgF9nc3qCvlkDGMOIKt2aVpiGVbayjVwU704qFrRjpUxCyLET6KyiAq+8pdJ7BCaQjZj 0G9A== X-Gm-Message-State: AMCzsaUBYXaRXKFUl9aFsRh0OQzWayyj9mR3oMzrJ4ttCYy380tzO/lJ N2LNKmJfQTVoQ5SlIos+5DUzESOV X-Received: by 10.80.203.66 with SMTP id h2mr5406195edi.54.1507973015906; Sat, 14 Oct 2017 02:23:35 -0700 (PDT) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com. [74.125.82.42]) by smtp.gmail.com with ESMTPSA id j6sm1922250edj.58.2017.10.14.02.23.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Oct 2017 02:23:35 -0700 (PDT) Received: by mail-wm0-f42.google.com with SMTP id q124so25248301wmb.0; Sat, 14 Oct 2017 02:23:35 -0700 (PDT) X-Google-Smtp-Source: ABhQp+QbD7o2Q2XMN5kAqA9L7FxLsl6efFJ833w8gUKOcKtmCv3usQS5K6F/5H339isEH4mH3Wg/vG7cAIfmlYvpQVg= X-Received: by 10.28.132.69 with SMTP id g66mr3726166wmd.13.1507973014970; Sat, 14 Oct 2017 02:23:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.143.20 with HTTP; Sat, 14 Oct 2017 02:23:34 -0700 (PDT) In-Reply-To: References: <201710132031.v9DKVueS089009@repo.freebsd.org> <1507941050.8386.88.camel@freebsd.org> From: Svatopluk Kraus Date: Sat, 14 Oct 2017 11:23:34 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Mateusz Guzik Cc: Ian Lepore , Mateusz Guzik , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 09:47:38 -0000 On Sat, Oct 14, 2017 at 2:48 AM, Mateusz Guzik wrote: > On Sat, Oct 14, 2017 at 2:30 AM, Ian Lepore wrote: >> >> On Fri, 2017-10-13 at 23:38 +0200, Svatopluk Kraus wrote: >> > MTX_UNOWNED is a flag. You did not change its value from 4 to 0, you >> > removed it actually. I have very bad feeling about it. But maybe, it's >> > really possible and in that case, a very good explanation should be >> > provided. >> > >> > Svata >> > >> >> The part that scares me is that DESTROYED may have been defined as >> CONTESTED|UNOWNED for subtle and clever reasons lost in the mists of >> time. Any of the places that are testing the MTX_CONTESTED bit may >> have been relying somehow on the fact that a destroyed mutex has that >> bit set. >> >> Then again, maybe Mateusz has carefully analyzed all this stuff, and we >> should just relax. :) >> > > I highly doubt there was anything clever going on. Rather, someone wanted > to somehow denote a destroyed mutex, but did not want to introduce an > additional flag - they are not free since the field shares the value with > the > address of the owner. That is, adding flags requires increasing alignment > of struct thread and that adds to memory usage. Thus they combined the > flags in a way which can never happen under normal circumstances. > > mtx_destroy explicitly sets the value to MTX_DESTROYED, so there is no > change here. > > MTX_UNOWNED is *not* used as a flag. If you grep the tree you will see > it is only used in direct comparisons. > > That said, I reviewed all users again and a minor bug was introduced in > owner_mtx (only used by dtrace). For some reason it grabs the owner, > but the instead of checking if it grabbed anything it checks the flag > (fixed in r324613). So that's my bad. > > Justification for the change was provided in the commit message: it makes > .text smaller on amd64 and probably all architectures. > > -- > Mateusz Guzik I did not lack an explanation why you did it, but why it's possible and safe. Something like this: ----------------- (1) MTX_UNOWNED even if defined like a flag was never used like a flag. It was used like a value set for unowned mutex and test accordingly. There is no logical operation (AND, OR, ...) done with MTX_UNOWNED in code. There are only assignments and checks for equality there. Thus, we can change its value and do not pretend that it's a flag anymore. As mutex owner thread pointer and mutex flags are kept in one variable together, setting MTX_UNOWNED value to 0 is more appropriate and brings some benefits. However, MTX_DESTROYED flag must be distinguish from MTX_CONTESTED one now, so there is no savings considering mutex flags. (2) MTX_UNONWED value is used only internally within mutex implemention, thus this change should be quite safe. ----------------- However, I suggest to do something with MTX_UNOWNED leak in sys/dev/syscons/syscons.c. i.e. to make mtx_unowned() public and use it instead. Further, MTX_DESTROYED is not used like a flag too. So, was its redefinition really needed? In other words, isn't MTX_CONTESTED flag without owner thread pointer set enough? Also, I would prefer to have some explanation to be in mutex.h about all of this. At least to not mess flags with values in definitions without explanation. Svata From owner-svn-src-head@freebsd.org Sat Oct 14 10:03:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29665E435EC; Sat, 14 Oct 2017 10:03:01 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0589D6B1D4; Sat, 14 Oct 2017 10:03:00 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9EA30jq032716; Sat, 14 Oct 2017 10:03:00 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9EA2xfh032706; Sat, 14 Oct 2017 10:02:59 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201710141002.v9EA2xfh032706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 14 Oct 2017 10:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324615 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 324615 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 10:03:01 -0000 Author: tuexen Date: Sat Oct 14 10:02:59 2017 New Revision: 324615 URL: https://svnweb.freebsd.org/changeset/base/324615 Log: Code cleanup, not functional change. This avoids taking a pointer of a packed structure which allows simpler compilation of the userland stack. MFC after: 1 week Modified: head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctp_constants.h Sat Oct 14 10:02:59 2017 (r324615) @@ -97,10 +97,6 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_DEFAULT_VRF_SIZE 4 -/* constants for rto calc */ -#define sctp_align_safe_nocopy 0 -#define sctp_align_unsafe_makecopy 1 - /* JRS - Values defined for the HTCP algorithm */ #define ALPHA_BASE (1<<7) /* 1.0 with shift << 7 */ #define BETA_MIN (1<<6) /* 0.5 with shift << 7 */ Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctp_indata.c Sat Oct 14 10:02:59 2017 (r324615) @@ -3058,7 +3058,6 @@ sctp_process_segment_range(struct sctp_tcb *stcb, stru &stcb->asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy, SCTP_RTT_FROM_DATA); *rto_ok = 0; } @@ -4030,7 +4029,6 @@ sctp_express_handle_sack(struct sctp_tcb *stcb, uint32 sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy, SCTP_RTT_FROM_DATA); rto_ok = 0; } @@ -4636,7 +4634,6 @@ hopeless_peer: sctp_calculate_rto(stcb, asoc, tp1->whoTo, &tp1->sent_rcv_time, - sctp_align_safe_nocopy, SCTP_RTT_FROM_DATA); rto_ok = 0; } Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctp_input.c Sat Oct 14 10:02:59 2017 (r324615) @@ -517,7 +517,7 @@ sctp_process_init_ack(struct mbuf *m, int iphlen, int asoc->primary_destination, SCTP_FROM_SCTP_INPUT + SCTP_LOC_3); /* calculate the RTO */ - net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, sctp_align_safe_nocopy, + net->RTO = sctp_calculate_rto(stcb, asoc, net, &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); retval = sctp_send_cookie_echo(m, offset, stcb, net); if (retval < 0) { @@ -639,7 +639,7 @@ sctp_handle_heartbeat_ack(struct sctp_heartbeat_chunk tv.tv_sec = cp->heartbeat.hb_info.time_value_1; tv.tv_usec = cp->heartbeat.hb_info.time_value_2; /* Now lets do a RTO with this */ - r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, sctp_align_safe_nocopy, + r_net->RTO = sctp_calculate_rto(stcb, &stcb->asoc, r_net, &tv, SCTP_RTT_FROM_NON_DATA); if (!(r_net->dest_state & SCTP_ADDR_REACHABLE)) { r_net->dest_state |= SCTP_ADDR_REACHABLE; @@ -1487,6 +1487,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle struct sctp_init_ack_chunk *initack_cp, initack_buf; struct sctp_nets *net; struct mbuf *op_err; + struct timeval old; int init_offset, initack_offset, i; int retval; int spec_flag = 0; @@ -1647,10 +1648,11 @@ sctp_process_cookie_existing(struct mbuf *m, int iphle * since we did not send a HB make sure we don't * double things */ + old.tv_sec = cookie->time_entered.tv_sec; + old.tv_usec = cookie->time_entered.tv_usec; net->hb_responded = 1; net->RTO = sctp_calculate_rto(stcb, asoc, net, - &cookie->time_entered, - sctp_align_unsafe_makecopy, + &old, SCTP_RTT_FROM_NON_DATA); if (stcb->asoc.sctp_autoclose_ticks && @@ -2367,10 +2369,13 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, in } (void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered); if ((netp != NULL) && (*netp != NULL)) { + struct timeval old; + /* calculate the RTT and set the encaps port */ + old.tv_sec = cookie->time_entered.tv_sec; + old.tv_usec = cookie->time_entered.tv_usec; (*netp)->RTO = sctp_calculate_rto(stcb, asoc, *netp, - &cookie->time_entered, sctp_align_unsafe_makecopy, - SCTP_RTT_FROM_NON_DATA); + &old, SCTP_RTT_FROM_NON_DATA); } /* respond with a COOKIE-ACK */ sctp_send_cookie_ack(stcb); @@ -2936,7 +2941,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c SCTP_STAT_INCR_GAUGE32(sctps_currestab); if (asoc->overall_error_count == 0) { net->RTO = sctp_calculate_rto(stcb, asoc, net, - &asoc->time_entered, sctp_align_safe_nocopy, + &asoc->time_entered, SCTP_RTT_FROM_NON_DATA); } (void)SCTP_GETTIME_TIMEVAL(&asoc->time_entered); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctp_output.c Sat Oct 14 10:02:59 2017 (r324615) @@ -5501,6 +5501,7 @@ sctp_send_initiate_ack(struct sctp_inpcb *inp, struct struct sctp_paramhdr *ph; union sctp_sockstore *over_addr; struct sctp_scoping scp; + struct timeval now; #ifdef INET struct sockaddr_in *dst4 = (struct sockaddr_in *)dst; struct sockaddr_in *src4 = (struct sockaddr_in *)src; @@ -5601,7 +5602,9 @@ do_a_abort: memset(&stc, 0, sizeof(struct sctp_state_cookie)); /* the time I built cookie */ - (void)SCTP_GETTIME_TIMEVAL(&stc.time_entered); + (void)SCTP_GETTIME_TIMEVAL(&now); + stc.time_entered.tv_sec = now.tv_sec; + stc.time_entered.tv_usec = now.tv_usec; /* populate any tie tags */ if (asoc != NULL) { Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctputil.c Sat Oct 14 10:02:59 2017 (r324615) @@ -2422,8 +2422,8 @@ uint32_t sctp_calculate_rto(struct sctp_tcb *stcb, struct sctp_association *asoc, struct sctp_nets *net, - struct timeval *told, - int safe, int rtt_from_sack) + struct timeval *old, + int rtt_from_sack) { /*- * given an association and the starting time of the current RTT @@ -2432,19 +2432,8 @@ sctp_calculate_rto(struct sctp_tcb *stcb, int32_t rtt; /* RTT in ms */ uint32_t new_rto; int first_measure = 0; - struct timeval now, then, *old; + struct timeval now; - /* Copy it out for sparc64 */ - if (safe == sctp_align_unsafe_makecopy) { - old = &then; - memcpy(&then, told, sizeof(struct timeval)); - } else if (safe == sctp_align_safe_nocopy) { - old = told; - } else { - /* error */ - SCTP_PRINTF("Huh, bad rto calc call\n"); - return (0); - } /************************/ /* 1. calculate new RTT */ /************************/ Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sat Oct 14 04:27:58 2017 (r324614) +++ head/sys/netinet/sctputil.h Sat Oct 14 10:02:59 2017 (r324615) @@ -135,7 +135,7 @@ void uint32_t sctp_calculate_rto(struct sctp_tcb *, struct sctp_association *, - struct sctp_nets *, struct timeval *, int, int); + struct sctp_nets *, struct timeval *, int); uint32_t sctp_calculate_len(struct mbuf *); From owner-svn-src-head@freebsd.org Sat Oct 14 15:16:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70FD7E4973C; Sat, 14 Oct 2017 15:16:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x22d.google.com (mail-qt0-x22d.google.com [IPv6:2607:f8b0:400d:c0d::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 20F3F72F3A; Sat, 14 Oct 2017 15:16:10 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x22d.google.com with SMTP id f15so24502130qtf.7; Sat, 14 Oct 2017 08:16:10 -0700 (PDT) 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=opTdpQUfje3NYh95R37aKLvadG2jBp5lyBKb3Fi/Vq4=; b=Nny+qOxlfNYalM2n4BRD1REAxkGZ0H2o7XW/xMPaXq8lHTpUUuzIIT8MyJVKDKceeo O/jCIO7jUpQ0k9aWpq/qdzo8VL8mcN9Z7N2nLHE+EMcaRwJVjzPXT7gGbAdZT5C2rbXg mfG/t6iLPu38XhXvQckpSXxW8OtK7zJhy0b49psEQIfSyey/rUc8KOnC8IFFz1uQ6Eac xDzYwIYGkLzTCt7Pq5G6kjp205h3+ocCEHHalKce+r6vNloGrJbXFfjZm63MGGhPEQ65 WdrEkWtc/97ZT83iNh4GGWmDbog6K8vieJN+nNmOYTSOvKwaBUgSOIrKsJCgIQWtjQdj zn2g== 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=opTdpQUfje3NYh95R37aKLvadG2jBp5lyBKb3Fi/Vq4=; b=nmvlt2bnqCLY2F/SDiObP9F02i0icfZWOkXYGH4fu7aIFCCRzZOxEkmfDymNTLKP1l Q9tYiLNzWEqcEPSCzz37dGBRWsYaIEBIYjWePq3WjRP17xKZRvUGcyvFtnyphPQsUNF7 o0WNLsx/9PTj0ZovO+vVc2by19QvkA5HXt1LKTR6hxpqYwiS34UHM9VeptnykCSmYKqt s4ONpzT4TOxKuz5wG7UgbZec25WJeRsTYVzweoPUwsh7HDmxqfjWX/EhKCEz1DtgHZuf 0mZto2Hix2mH7XXL8vJ6tU+pXR2rK5pdhCm2lxahxjN0Nj5JobWxqJ1gKNPtmEMRdpas /xdw== X-Gm-Message-State: AMCzsaVg+WMqVC/4TYdvR6C8smIYvG/u8jTp7RHaQdx9YPWhVLVOw5bw 9gXtewYFVp8D0xU44qb7owHS++nzf4j5M6tWFy7WMQ== X-Google-Smtp-Source: ABhQp+T+naHyeVTQxCd+En91UkuMYg9h8zTXLCFG6STVwpc/Ql5mHWrkfYDe0hikvvSNY9VVnx5sQAp+dIEoA0yYM2U= X-Received: by 10.237.63.202 with SMTP id w10mr2191990qth.56.1507994169185; Sat, 14 Oct 2017 08:16:09 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.51.167 with HTTP; Sat, 14 Oct 2017 08:16:08 -0700 (PDT) In-Reply-To: References: <201710132031.v9DKVueS089009@repo.freebsd.org> <1507941050.8386.88.camel@freebsd.org> From: Mateusz Guzik Date: Sat, 14 Oct 2017 17:16:08 +0200 Message-ID: Subject: Re: svn commit: r324609 - head/sys/sys To: Svatopluk Kraus Cc: Ian Lepore , Mateusz Guzik , "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.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 15:16:10 -0000 On Sat, Oct 14, 2017 at 11:23 AM, Svatopluk Kraus wrote: > On Sat, Oct 14, 2017 at 2:48 AM, Mateusz Guzik wrote: > > Justification for the change was provided in the commit message: it makes > > .text smaller on amd64 and probably all architectures. > > > > I did not lack an explanation why you did it, but why it's possible > and safe. Something like this: > ----------------- > (1) MTX_UNOWNED even if defined like a flag was never used like a > flag. It was used like a value set for unowned mutex and test > accordingly. There is no logical operation (AND, OR, ...) done with > MTX_UNOWNED in code. There are only assignments and checks for > equality there. Thus, we can change its value and do not pretend that > it's a flag anymore. As mutex owner thread pointer and mutex flags are > kept in one variable together, setting MTX_UNOWNED value to 0 is more > appropriate and brings some benefits. However, MTX_DESTROYED flag must > be distinguish from MTX_CONTESTED one now, so there is no savings > considering mutex flags. > (2) MTX_UNONWED value is used only internally within mutex > implemention, thus this change should be quite safe. > ----------------- > I guess that's a fair point, I figured some people may be wondering why switching to 0 makes any difference. On the other hand anyone worried about var usage can easily grep. Next time I'll be more verbose. > > However, I suggest to do something with MTX_UNOWNED leak in > sys/dev/syscons/syscons.c. i.e. to make mtx_unowned() public and use > it instead. Further, MTX_DESTROYED is not used like a flag too. So, > was its redefinition really needed? In other words, isn't > MTX_CONTESTED flag without owner thread pointer set enough? Also, I > would prefer to have some explanation to be in mutex.h about all of > this. At least to not mess flags with values in definitions without > explanation. > > The code in syscons looks extremely fishy, I don't know what to do with it yet. Testing for ownership should be avoidable with trylock. What you are proposing is an equivalent to the previous trick, but requires reading the lock owner. All places testing for MTX_DESTROYED would have to be updated which is an avoidable churn right now. Not employing the hack makes the flags self-explanatory. If a need for a new flag arises there are still 2 free bits and if that's not enough we can alter the current code. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Sat Oct 14 18:03:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DDF0E28A1C; Sat, 14 Oct 2017 18:03:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::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 5A6A8771AE; Sat, 14 Oct 2017 18:03:13 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id z11so12774798pfk.4; Sat, 14 Oct 2017 11:03:13 -0700 (PDT) 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=CUIss13Wa8vx+Oci+FoPgz43g4shiToZEU6EoGW64+4=; b=ghgU3aR4xZo7Mb73daflc5gj3wjF1d2QMvGtJm39TX7csOxLD4e1BHzIUix/JQfNUp WMk+s7qqAZ3GzUnjhPdzn3f0551Bf3An6oC1JeIjbnIhTpKBXnjY3TX9QvIEt29o6DGb jEdymFDiwka/9tiPxFv1okHc8VZUTs6c+6q3yx3049ZFNOV0zzus+NAGEkKV8w51YbJK kmAcnRPBFB0YBBsEwkLW/sYeJzVrzFc5/LjPid2xzAMUgIV+3NtrBGljYvtEPyqvnGk1 LW6HuMzaOEDDj86zDBcrWMWiNwFmkMwwZWuazc4N9SvkVRuWGJ/CestxkQopmyZI2cu9 W2AQ== 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=CUIss13Wa8vx+Oci+FoPgz43g4shiToZEU6EoGW64+4=; b=TDR3kgqJGCYpUguirnGpNW7qcobX6oJvKRhMno4PLfPFkAfyqFj7w8aXhisleKRVc8 CPN/3qAAaQQ/WUj8UwvNsmsIGeqTlDNvsA+wlRVHvh4jSIAJbsmqbbOKCGn/fneMEu0n MjIR9Sa3uRZ5ojOKAFr7rx7d/OWu1FJBHqyiXnAMkxLCDhq+6uQ/5BOvPyPuyra9DHIT hPMO1s102geqvOWfmq3uC1FTc/lFNEtIW+EtlOBLZoil5EW1TAM8iLGS0Rn7SUNNkWLL cXBbmoGBCgQLKrY9ev0RR6pdiujQaEBMUUze10mJ2bXZ313S82gfVhf5HC8D262lzz/3 iwQA== X-Gm-Message-State: AMCzsaVYH6XNpHhrO0dA+7OUH9Zpai+xdDEt/bMv1VNe0fjfjuSHODWz CFhmR/uACX83jwUB+dx4Giz8fw== X-Google-Smtp-Source: AOwi7QBd6FiS717/dtw2AwF8biBVTsIYmF3wkX6brA5S7lBLE3+UvZpzUmpJxZT6i4uk7cpDRDsF1Q== X-Received: by 10.84.246.204 with SMTP id j12mr4598153plt.240.1508004192411; Sat, 14 Oct 2017 11:03:12 -0700 (PDT) Received: from raichu (toroon0560w-lp140-01-69-159-39-234.dsl.bell.ca. [69.159.39.234]) by smtp.gmail.com with ESMTPSA id c73sm9306691pfd.139.2017.10.14.11.03.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Oct 2017 11:03:10 -0700 (PDT) Sender: Mark Johnston Date: Sat, 14 Oct 2017 14:03:05 -0400 From: Mark Johnston To: Matt Joras Cc: "Ngie Cooper (yaneurabeya)" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r324541 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20171014180305.GA75158@raichu> References: <201710112153.v9BLroeR007323@repo.freebsd.org> <365AD758-5761-4BD4-A80E-8EF2EA84EAAA@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 14 Oct 2017 18:03:13 -0000 On Fri, Oct 13, 2017 at 10:36:26PM -0700, Matt Joras wrote: > On 10/13/2017 22:12, Ngie Cooper (yaneurabeya) wrote: > >> Modified: head/sys/kern/subr_unit.c > >> ============================================================================== > >> --- head/sys/kern/subr_unit.c Wed Oct 11 20:36:22 2017 (r324540) > >> +++ head/sys/kern/subr_unit.c Wed Oct 11 21:53:50 2017 (r324541) > >> @@ -366,6 +366,27 @@ delete_unrhdr(struct unrhdr *uh) > >> Free(uh); > >> } > >> > >> +void > >> +clear_unrhdr(struct unrhdr *uh) > >> +{ > >> + struct unr *up, *uq; > >> + > >> + KASSERT(TAILQ_EMPTY(&uh->ppfree), > >> + ("unrhdr has postponed item for free")); > >> + up = TAILQ_FIRST(&uh->head); > >> + while (up != NULL) { > > Could this be done with TAILQ_FOREACH_SAFE? > > -Ngie > > > Yes but it is arguably inferior to do so. This while loop is > theoretically faster since there is no need to individually remove the > elements when you intend to delete every element. TAILQ_FOREACH_SAFE just fetches the next element at the beginning of each loop iteration rather than at the end, same as the current implementation of clear_unrhdr() does. There's no change to the code generated by clang when I replace your loop with: TAILQ_FOREACH_SAFE(up, &uh->head, list, uq) { if (up->ptr != uh) { Free(up->ptr); } Free(up); } From owner-svn-src-head@freebsd.org Sat Oct 14 18:38:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24C04E2964B; Sat, 14 Oct 2017 18:38:38 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E39D57C23E; Sat, 14 Oct 2017 18:38:37 +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 v9EIcbw0047311; Sat, 14 Oct 2017 18:38:37 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9EIcaOQ047300; Sat, 14 Oct 2017 18:38:36 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201710141838.v9EIcaOQ047300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 14 Oct 2017 18:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324619 - in head/usr.bin/procstat: . tests X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in head/usr.bin/procstat: . tests X-SVN-Commit-Revision: 324619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 18:38:38 -0000 Author: brooks Date: Sat Oct 14 18:38:36 2017 New Revision: 324619 URL: https://svnweb.freebsd.org/changeset/base/324619 Log: Switch procstat from subcommand flags to verbs - Use an enumerated value instead of separate flags for commands - Look for a verb if no command flag is set - Lookup the "xocontainer" value based on the command - Document the new command verbs in the man-page Submitted by: kdrakehp@zoho.com Differential Revision: https://reviews.freebsd.org/D10916 Modified: head/usr.bin/procstat/procstat.1 head/usr.bin/procstat/procstat.c head/usr.bin/procstat/procstat.h head/usr.bin/procstat/procstat_args.c head/usr.bin/procstat/procstat_auxv.c head/usr.bin/procstat/procstat_basic.c head/usr.bin/procstat/procstat_bin.c head/usr.bin/procstat/procstat_cred.c head/usr.bin/procstat/procstat_cs.c head/usr.bin/procstat/procstat_files.c head/usr.bin/procstat/procstat_kstack.c head/usr.bin/procstat/procstat_ptlwpinfo.c head/usr.bin/procstat/procstat_rlimit.c head/usr.bin/procstat/procstat_rusage.c head/usr.bin/procstat/procstat_sigs.c head/usr.bin/procstat/procstat_threads.c head/usr.bin/procstat/procstat_vm.c head/usr.bin/procstat/tests/procstat_test.sh Modified: head/usr.bin/procstat/procstat.1 ============================================================================== --- head/usr.bin/procstat/procstat.1 Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat.1 Sat Oct 14 18:38:36 2017 (r324619) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 3, 2017 +.Dd October 14, 2017 .Dt PROCSTAT 1 .Os .Sh NAME @@ -34,14 +34,75 @@ .Sh SYNOPSIS .Nm .Op Fl -libxo -.Op Fl CHhn +.Op Fl h .Op Fl M Ar core .Op Fl N Ar system .Op Fl w Ar interval -.Op Fl b | c | e | f | i | j | k | l | L | r | s | S | t | v | x -.Op Fl a | Ar pid | Ar core ... +.Ar command +.Op Ar pid ... | Ar core ... +.Nm +.Op Fl -libxo +.Fl a +.Op Fl h +.Op Fl M Ar core +.Op Fl N Ar system +.Op Fl w Ar interval +.Ar command +.Nm +.Op Fl -libxo +.Op Fl h +.Op Fl M Ar core +.Op Fl N Ar system +.Op Fl w Ar interval +.Oo +.Fl b | +.Fl c | +.Fl e | +.Fl f Oo Fl C Oc | +.Fl i Oo Fl n Oc | +.Fl j Oo Fl n Oc | +.Fl k Oo Fl k Oc | +.Fl l | +.Fl r Oo Fl H Oc | +.Fl s | +.Fl S | +.Fl t | +.Fl v | +.Fl x +.Oc +.Op Ar pid ... | Ar core ... +.Nm +.Op Fl -libxo +.Fl a +.Op Fl h +.Op Fl M Ar core +.Op Fl N Ar system +.Op Fl w Ar interval +.Oo +.Fl b | +.Fl c | +.Fl e | +.Fl f Oo Fl C Oc | +.Fl i Oo Fl n Oc | +.Fl j Oo Fl n Oc | +.Fl k Oo Fl k Oc | +.Fl l | +.Fl r Oo Fl H Oc | +.Fl s | +.Fl S | +.Fl t | +.Fl v | +.Fl x +.Oc +.Nm +.Op Fl -libxo +.Fl L +.Op Fl h +.Op Fl M Ar core +.Op Fl N Ar system +.Op Fl w Ar interval +.Ar core ... .Sh DESCRIPTION -The .Nm utility displays detailed information about the processes identified by the .Ar pid @@ -51,49 +112,89 @@ flag is used, all processes. It can also display information extracted from a process core file, if the core file is specified as the argument. .Pp -By default, basic process statistics are printed; one of the following -options may be specified in order to select more detailed process information -for printing: -.Bl -tag -width indent -.It Fl -libxo -Generate output via +If the +.Fl -libxo +flag is specified the output is generated via .Xr libxo 3 in a selection of different human and machine readable formats. See .Xr xo_parse_args 3 for details on command line arguments. -.It Fl b +.Pp +The following commands are available: +.Bl -tag -width indent +.It Ar basic +Print basic process statistics (this is the default). +.It Ar binary | Fl b Display binary information for the process. -.It Fl c +.Pp +Substring commands are accepted. +.It Ar argument(s) | Fl c Display command line arguments for the process. -.It Fl e +.Pp +Substring commands are accepted. +.It Ar environment | Fl e Display environment variables for the process. -.It Fl f +.Pp +Substring commands are accepted. +.It Ar file(s) | Ar fd(s) | Fl f Display file descriptor information for the process. -.It Fl i +.Pp +If the +.Fl C +subcommand flag is used then additional capability information is printed. +.It Ar signal(s) | Fl i Display signal pending and disposition information for the process. -.It Fl j +.Pp +If the +.Fl n +subcommand option is used, the signal numbers are shown instead of signal +names. +.Pp +Substring commands are accepted. +.It Ar tsignal(s) | Fl j Display signal pending and blocked information for the process's threads. -.It Fl k +.Pp +If the +.Fl n +subcommand option is used, the signal numbers are shown instead of signal +names. +.Pp +Substring commands are accepted. +.It Ar kstack | Fl k Display the stacks of kernel threads in the process, excluding stacks of threads currently running on a CPU and threads with stacks swapped to disk. -If the flag is repeated, function offsets as well as function names are -printed. -.It Fl l +.Pp +If the +.Fl v +subcommand option is used (or the command flag is repeated), function +offsets as well as function names are printed. +.It Ar rlimit | Fl l Display resource limits for the process. -.It Fl L +.It Ar ptlwpinfo | Fl L Display LWP info for the process pertaining to its signal driven exit. -.It Fl r +.It Ar rusage | Fl r Display resource usage information for the process. -.It Fl s +.Pp +If the +.Fl v +.Pq or Fl H +subcommand flag +is used then per-thread statistics are printed, rather than per-process +statistics. +The second field in the table will list the thread ID to which the row of +information corresponds. +.It Ar credential(s) | Fl s Display security credential information for the process. -.It Fl S +.Pp +Substring commands are accepted. +.It Ar cpuset | Ar cs | Fl S Display the cpuset information for the thread. -.It Fl t +.It Ar thread(s) | Fl t Display thread information for the process. -.It Fl v +.It Ar vm | Fl v Display virtual memory mappings for the process. -.It Fl x +.It Ar auxv | Fl x Display ELF auxiliary vector for the process. .El .Pp @@ -110,23 +211,6 @@ of the requested process information. If the .Fl w flag is not specified, the output will not repeat. -.Pp -The -.Fl C -flag requests the printing of additional capability information in the file -descriptor view. -.Pp -The -.Fl H -flag may be used to request per-thread statistics rather than per-process -statistics for some options. -For those options, the second field in the table will list the thread ID -to which the row of information corresponds. -The -.Fl H -flag is implied for the -.Fl S -mode. .Pp Information for VM, file descriptor, and cpuset options is available only to the owner of a process or the superuser. Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat.c Sat Oct 14 18:38:36 2017 (r324619) @@ -42,37 +42,111 @@ #include "procstat.h" -static int aflag, bflag, cflag, eflag, fflag, iflag, jflag, kflag; -static int lflag, Lflag, rflag, sflag, tflag, vflag, xflag, Sflag; -int hflag, nflag, Cflag, Hflag; +enum { + PS_CMP_NORMAL = 0x00, + PS_CMP_PLURAL = 0x01, + PS_CMP_SUBSTR = 0x02 +}; +struct procstat_cmd { + const char *command; + const char *xocontainer; + const char *usage; + void (*cmd)(struct procstat *, struct kinfo_proc *); + void (*opt)(int, char * const *); + int cmp; +}; + +int procstat_opts = 0; + +static void cmdopt_none(int argc, char * const argv[]); +static void cmdopt_verbose(int argc, char * const argv[]); +static void cmdopt_signals(int argc, char * const argv[]); +static void cmdopt_rusage(int argc, char * const argv[]); +static void cmdopt_files(int argc, char * const argv[]); +static void cmdopt_cpuset(int argc, char * const argv[]); + +static const struct procstat_cmd cmd_table[] = { + { "argument", "arguments", NULL, &procstat_args, &cmdopt_none, + PS_CMP_PLURAL | PS_CMP_SUBSTR }, + { "auxv", "auxv", NULL, &procstat_auxv, &cmdopt_none, PS_CMP_NORMAL }, + { "basic", "basic", NULL, &procstat_basic, &cmdopt_none, + PS_CMP_NORMAL }, + { "binary", "binary", NULL, &procstat_bin, &cmdopt_none, + PS_CMP_SUBSTR }, + { "cpuset", "cs", NULL, &procstat_cs, &cmdopt_cpuset, PS_CMP_NORMAL }, + { "cs", "cs", NULL, &procstat_cs, &cmdopt_cpuset, PS_CMP_NORMAL }, + { "credential", "credentials", NULL, &procstat_cred, &cmdopt_none, + PS_CMP_PLURAL | PS_CMP_SUBSTR }, + { "environment", "environment", NULL, &procstat_env, &cmdopt_none, + PS_CMP_SUBSTR }, + { "fd", "files", "[-C]", &procstat_files, &cmdopt_files, + PS_CMP_PLURAL }, + { "file", "files", "[-C]", &procstat_files, &cmdopt_files, + PS_CMP_PLURAL }, + { "kstack", "kstack", "[-v]", &procstat_kstack, &cmdopt_verbose, + PS_CMP_NORMAL }, + { "ptlwpinfo", "ptlwpinfo", NULL, &procstat_ptlwpinfo, &cmdopt_none, + PS_CMP_NORMAL }, + { "rlimit", "rlimit", NULL, &procstat_rlimit, &cmdopt_none, + PS_CMP_NORMAL }, + { "rusage", "rusage", "[-Ht]", &procstat_rusage, &cmdopt_rusage, + PS_CMP_NORMAL }, + { "signal", "signals", "[-n]", &procstat_sigs, &cmdopt_signals, + PS_CMP_PLURAL | PS_CMP_SUBSTR }, + { "thread", "threads", NULL, &procstat_threads, &cmdopt_none, + PS_CMP_PLURAL }, + { "tsignal", "thread_signals", "[-n]", &procstat_threads_sigs, + &cmdopt_signals, PS_CMP_PLURAL | PS_CMP_SUBSTR }, + { "vm", "vm", NULL, &procstat_vm, &cmdopt_none, PS_CMP_NORMAL } +}; + static void usage(void) { + size_t i, l; + int multi; - xo_error( - "usage: procstat [--libxo] [-Hhn] [-M core] " - "[-N system] [-w interval]\n" - " [-S | -b | -c | -e | -i | -j | -k | -kk | " - "-l | -r | -s | \n" - " -t | -v | -x]\n" - " [-a | pid ... | core ...]\n" - " procstat [--libxo] -Cf [-hn] [-M core] " - "[-N system] [-a | pid ... | core ...]\n" - " [-S | -b | -c | -e | -i | -j | -k | -kk | " - "-l | -r | -s | \n" - " procstat [--libxo] -L [-hn] [-M core] " - "[-N system] [-w interval]\n" - " [-S | -b | -c | -e | -i | -j | -k | -kk | " - "-l | -r | -s | \n" - " -t | -v | -x]\n" - " [core ...]\n"); + xo_error("usage: procstat [--libxo] [-h] [-M core] [-N system]" + " [-w interval] command\n" + " [pid ... | core ...]\n" + " procstat [--libxo] -a [-h] [-M core] [-N system] " + " [-w interval] command\n" + " procstat [--libxo] [-h] [-M core] [-N system]" + " [-w interval]\n" + " [-S | -b | -c | -e | -f [-C] | -i [-n] | " + "-j [-n] | -k [-k] |\n" + " -l | -r [-H] | -s | -t | -v | -x] " + "[pid ... | core ...]\n" + " procstat [--libxo] -a [-h] [-M core] [-N system]" + " [-w interval]\n" + " [-S | -b | -c | -e | -f [-C] | -i [-n] | " + "-j [-n] | -k [-k] |\n" + " -l | -r [-H] | -s | -t | -v | -x]\n" + " procstat [--libxo] -L [-h] [-M core] [-N system] core ...\n" + "Available commands:\n"); + for (i = 0, l = nitems(cmd_table); i < l; i++) { + multi = i + 1 < l && cmd_table[i].cmd == cmd_table[i + 1].cmd; + xo_error(" %s%s%s", multi ? "[" : "", + cmd_table[i].command, (cmd_table[i].cmp & PS_CMP_PLURAL) ? + "(s)" : ""); + for (; i + 1 < l && cmd_table[i].cmd == cmd_table[i + 1].cmd; + i++) + xo_error(" | %s%s", cmd_table[i + 1].command, + (cmd_table[i].cmp & PS_CMP_PLURAL) ? "(s)" : ""); + if (multi) + xo_error("]"); + if (cmd_table[i].usage != NULL) + xo_error(" %s", cmd_table[i].usage); + xo_error("\n"); + } xo_finish(); exit(EX_USAGE); } static void -procstat(struct procstat *prstat, struct kinfo_proc *kipp) +procstat(const struct procstat_cmd *cmd, struct procstat *prstat, + struct kinfo_proc *kipp) { char *pidstr = NULL; @@ -80,40 +154,7 @@ procstat(struct procstat *prstat, struct kinfo_proc *k if (pidstr == NULL) xo_errc(1, ENOMEM, "Failed to allocate memory in procstat()"); xo_open_container(pidstr); - - if (bflag) - procstat_bin(prstat, kipp); - else if (cflag) - procstat_args(prstat, kipp); - else if (eflag) - procstat_env(prstat, kipp); - else if (fflag) - procstat_files(prstat, kipp); - else if (iflag) - procstat_sigs(prstat, kipp); - else if (jflag) - procstat_threads_sigs(prstat, kipp); - else if (kflag) - procstat_kstack(prstat, kipp, kflag); - else if (lflag) - procstat_rlimit(prstat, kipp); - else if (Lflag) - procstat_ptlwpinfo(prstat); - else if (rflag) - procstat_rusage(prstat, kipp); - else if (sflag) - procstat_cred(prstat, kipp); - else if (tflag) - procstat_threads(prstat, kipp); - else if (vflag) - procstat_vm(prstat, kipp); - else if (xflag) - procstat_auxv(prstat, kipp); - else if (Sflag) - procstat_cs(prstat, kipp); - else - procstat_basic(kipp); - + cmd->cmd(prstat, kipp); xo_close_container(pidstr); free(pidstr); } @@ -157,122 +198,158 @@ kinfo_proc_thread_name(const struct kinfo_proc *kipp) return (name); } +static const struct procstat_cmd * +getcmd(const char *str) +{ + const struct procstat_cmd *cmd; + size_t i, l; + int cmp, s; + + if (str == NULL) + return (NULL); + cmd = NULL; + if ((l = strlen(str)) == 0) + return (getcmd("basic")); + s = l > 1 && strcasecmp(str + l - 1, "s") == 0; + for (i = 0; i < nitems(cmd_table); i++) { + /* + * After the first match substring matches are disabled, + * allowing subsequent full matches to take precedence. + */ + if (cmd == NULL && (cmd_table[i].cmp & PS_CMP_SUBSTR)) + cmp = strncasecmp(str, cmd_table[i].command, l - + ((cmd_table[i].cmp & PS_CMP_PLURAL) && s ? 1 : 0)); + else if ((cmd_table[i].cmp & PS_CMP_PLURAL) && s && + l == strlen(cmd_table[i].command) + 1) + cmp = strncasecmp(str, cmd_table[i].command, l - 1); + else + cmp = strcasecmp(str, cmd_table[i].command); + if (cmp == 0) + cmd = &cmd_table[i]; + } + return (cmd); +} + int main(int argc, char *argv[]) { - int ch, interval, tmp; + int ch, interval; int i; struct kinfo_proc *p; + const struct procstat_cmd *cmd; struct procstat *prstat, *cprstat; long l; pid_t pid; char *dummy; char *nlistf, *memf; - const char *xocontainer; + int aflag; int cnt; interval = 0; + cmd = NULL; memf = nlistf = NULL; + aflag = 0; argc = xo_parse_args(argc, argv); - xocontainer = "basic"; while ((ch = getopt(argc, argv, "abCcefHhijkLlM:N:nrSstvw:x")) != -1) { switch (ch) { - case 'C': - Cflag++; - break; - - case 'H': - Hflag++; - break; - - case 'M': - memf = optarg; - break; - case 'N': - nlistf = optarg; - break; - case 'S': - Sflag++; - xocontainer = "cs"; - break; case 'a': aflag++; break; - case 'b': - bflag++; - xocontainer = "binary"; + if (cmd != NULL) + usage(); + cmd = getcmd("binary"); break; - + case 'C': + procstat_opts |= PS_OPT_CAPABILITIES; + break; case 'c': - cflag++; - xocontainer = "arguments"; + if (cmd != NULL) + usage(); + cmd = getcmd("arguments"); break; - case 'e': - eflag++; - xocontainer = "environment"; + if (cmd != NULL) + usage(); + cmd = getcmd("environment"); break; - case 'f': - fflag++; - xocontainer = "files"; + if (cmd != NULL) + usage(); + cmd = getcmd("files"); break; - + case 'H': + procstat_opts |= PS_OPT_PERTHREAD; + break; + case 'h': + procstat_opts |= PS_OPT_NOHEADER; + break; case 'i': - iflag++; - xocontainer = "signals"; + if (cmd != NULL) + usage(); + cmd = getcmd("signals"); break; - case 'j': - jflag++; - xocontainer = "thread_signals"; + if (cmd != NULL) + usage(); + cmd = getcmd("tsignals"); break; - case 'k': - kflag++; - xocontainer = "kstack"; + if (cmd->cmd == procstat_kstack) { + if ((procstat_opts & PS_OPT_VERBOSE) != 0) + usage(); + procstat_opts |= PS_OPT_VERBOSE; + } else { + if (cmd != NULL) + usage(); + cmd = getcmd("kstack"); + } break; - + case 'L': + if (cmd != NULL) + usage(); + cmd = getcmd("ptlwpinfo"); + break; case 'l': - lflag++; - xocontainer = "rlimit"; + if (cmd != NULL) + usage(); + cmd = getcmd("rlimit"); break; - - case 'L': - Lflag++; - xocontainer = "ptlwpinfo"; + case 'M': + memf = optarg; break; - + case 'N': + nlistf = optarg; + break; case 'n': - nflag++; + procstat_opts |= PS_OPT_SIGNUM; break; - - case 'h': - hflag++; - break; - case 'r': - rflag++; - xocontainer = "rusage"; + if (cmd != NULL) + usage(); + cmd = getcmd("rusage"); break; - + case 'S': + if (cmd != NULL) + usage(); + cmd = getcmd("cpuset"); + break; case 's': - sflag++; - xocontainer = "credentials"; + if (cmd != NULL) + usage(); + cmd = getcmd("credentials"); break; - case 't': - tflag++; - xocontainer = "threads"; + if (cmd != NULL) + usage(); + cmd = getcmd("threads"); break; - case 'v': - vflag++; - xocontainer = "vm"; + if (cmd != NULL) + usage(); + cmd = getcmd("vm"); break; - case 'w': l = strtol(optarg, &dummy, 10); if (*dummy != '\0') @@ -281,12 +358,11 @@ main(int argc, char *argv[]) usage(); interval = l; break; - case 'x': - xflag++; - xocontainer = "auxv"; + if (cmd != NULL) + usage(); + cmd = getcmd("auxv"); break; - case '?': default: usage(); @@ -296,24 +372,31 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - /* We require that either 0 or 1 mode flags be set. */ - tmp = bflag + cflag + eflag + fflag + iflag + jflag + (kflag ? 1 : 0) + - lflag + rflag + sflag + tflag + vflag + xflag + Sflag; - if (!(tmp == 0 || tmp == 1)) - usage(); + if (cmd == NULL && argv[0] != NULL && (cmd = getcmd(argv[0])) != NULL) { + if ((procstat_opts & PS_SUBCOMMAND_OPTS) != 0) + usage(); + if (cmd->opt != NULL) { + optreset = 1; + optind = 1; + cmd->opt(argc, argv); + argc -= optind; + argv += optind; + } else { + argc -= 1; + argv += 1; + } + } else { + if (cmd == NULL) + cmd = getcmd("basic"); + if (cmd->cmd != procstat_files && + (procstat_opts & PS_OPT_CAPABILITIES) != 0) + usage(); + } - /* We allow -k to be specified up to twice, but not more. */ - if (kflag > 2) - usage(); - /* Must specify either the -a flag or a list of pids. */ if (!(aflag == 1 && argc == 0) && !(aflag == 0 && argc > 0)) usage(); - /* Only allow -C with -f. */ - if (Cflag && !fflag) - usage(); - if (memf != NULL) prstat = procstat_open_kvm(nlistf, memf); else @@ -323,7 +406,7 @@ main(int argc, char *argv[]) do { xo_set_version(PROCSTAT_XO_VERSION); xo_open_container("procstat"); - xo_open_container(xocontainer); + xo_open_container(cmd->xocontainer); if (aflag) { p = procstat_getprocs(prstat, KERN_PROC_PROC, 0, &cnt); @@ -331,10 +414,10 @@ main(int argc, char *argv[]) xo_errx(1, "procstat_getprocs()"); kinfo_proc_sort(p, cnt); for (i = 0; i < cnt; i++) { - procstat(prstat, &p[i]); + procstat(cmd, prstat, &p[i]); /* Suppress header after first process. */ - hflag = 1; + procstat_opts |= PS_OPT_NOHEADER; xo_flush(); } procstat_freeprocs(prstat, p); @@ -351,7 +434,7 @@ main(int argc, char *argv[]) if (p == NULL) xo_errx(1, "procstat_getprocs()"); if (cnt != 0) - procstat(prstat, p); + procstat(cmd, prstat, p); procstat_freeprocs(prstat, p); } else { cprstat = procstat_open_core(argv[i]); @@ -364,15 +447,15 @@ main(int argc, char *argv[]) if (p == NULL) xo_errx(1, "procstat_getprocs()"); if (cnt != 0) - procstat(cprstat, p); + procstat(cmd, cprstat, p); procstat_freeprocs(cprstat, p); procstat_close(cprstat); } /* Suppress header after first process. */ - hflag = 1; + procstat_opts |= PS_OPT_NOHEADER; } - xo_close_container(xocontainer); + xo_close_container(cmd->xocontainer); xo_close_container("procstat"); xo_finish(); if (interval) @@ -382,4 +465,96 @@ main(int argc, char *argv[]) procstat_close(prstat); exit(0); +} + +void +cmdopt_none(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "")) != -1) { + switch (ch) { + case '?': + default: + usage(); + } + } +} + +void +cmdopt_verbose(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "v")) != -1) { + switch (ch) { + case 'v': + procstat_opts |= PS_OPT_VERBOSE; + break; + case '?': + default: + usage(); + } + } +} + +void +cmdopt_signals(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "n")) != -1) { + switch (ch) { + case 'n': + procstat_opts |= PS_OPT_SIGNUM; + break; + case '?': + default: + usage(); + } + } +} + +void +cmdopt_rusage(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "Ht")) != -1) { + switch (ch) { + case 'H': + /* FALLTHROUGH */ + case 't': + procstat_opts |= PS_OPT_PERTHREAD; + break; + case '?': + default: + usage(); + } + } +} + +void +cmdopt_files(int argc, char * const argv[]) +{ + int ch; + + while ((ch = getopt(argc, argv, "C")) != -1) { + switch (ch) { + case 'C': + procstat_opts |= PS_OPT_CAPABILITIES; + break; + case '?': + default: + usage(); + } + } +} + +void +cmdopt_cpuset(int argc, char * const argv[]) +{ + + procstat_opts |= PS_OPT_PERTHREAD; + cmdopt_none(argc, argv); } Modified: head/usr.bin/procstat/procstat.h ============================================================================== --- head/usr.bin/procstat/procstat.h Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat.h Sat Oct 14 18:38:36 2017 (r324619) @@ -35,23 +35,34 @@ #define PROCSTAT_XO_VERSION "1" -extern int hflag, nflag, Cflag, Hflag; +enum { + PS_OPT_CAPABILITIES = 0x01, + PS_OPT_NOHEADER = 0x02, + PS_OPT_PERTHREAD = 0x04, + PS_OPT_SIGNUM = 0x08, + PS_OPT_VERBOSE = 0x10 +}; +#define PS_SUBCOMMAND_OPTS \ + (PS_OPT_CAPABILITIES | PS_OPT_SIGNUM | \ + PS_OPT_PERTHREAD | PS_OPT_VERBOSE) + +extern int procstat_opts; + struct kinfo_proc; void kinfo_proc_sort(struct kinfo_proc *kipp, int count); const char * kinfo_proc_thread_name(const struct kinfo_proc *kipp); void procstat_args(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_auxv(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_basic(struct kinfo_proc *kipp); +void procstat_basic(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_bin(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_cred(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_cs(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_env(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_files(struct procstat *prstat, struct kinfo_proc *kipp); -void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp, - int kflag); -void procstat_ptlwpinfo(struct procstat *prstat); +void procstat_kstack(struct procstat *prstat, struct kinfo_proc *kipp); +void procstat_ptlwpinfo(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_rlimit(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_rusage(struct procstat *prstat, struct kinfo_proc *kipp); void procstat_sigs(struct procstat *prstat, struct kinfo_proc *kipp); Modified: head/usr.bin/procstat/procstat_args.c ============================================================================== --- head/usr.bin/procstat/procstat_args.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_args.c Sat Oct 14 18:38:36 2017 (r324619) @@ -47,7 +47,7 @@ procstat_args(struct procstat *procstat, struct kinfo_ int i; char **args; - if (!hflag) { + if ((procstat_opts & PS_OPT_NOHEADER) == 0) { xo_emit("{T:/%5s %-16s %-53s}\n", "PID", "COMM", "ARGS"); } @@ -74,7 +74,7 @@ procstat_env(struct procstat *procstat, struct kinfo_p int i; char **envs; - if (!hflag) { + if ((procstat_opts & PS_OPT_NOHEADER) == 0) { xo_emit("{T:/%5s %-16s %-53s}\n", "PID", "COMM", "ENVIRONMENT"); } Modified: head/usr.bin/procstat/procstat_auxv.c ============================================================================== --- head/usr.bin/procstat/procstat_auxv.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_auxv.c Sat Oct 14 18:38:36 2017 (r324619) @@ -51,7 +51,7 @@ procstat_auxv(struct procstat *procstat, struct kinfo_ u_int count, i; static char prefix[256]; - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %-16s %-16s %-16s}\n", "PID", "COMM", "AUXV", "VALUE"); Modified: head/usr.bin/procstat/procstat_basic.c ============================================================================== --- head/usr.bin/procstat/procstat_basic.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_basic.c Sat Oct 14 18:38:36 2017 (r324619) @@ -39,10 +39,10 @@ #include "procstat.h" void -procstat_basic(struct kinfo_proc *kipp) +procstat_basic(struct procstat *procstat __unused, struct kinfo_proc *kipp) { - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %5s %5s %5s %5s %3s %-8s %-9s %-13s %-12s}\n", "PID", "PPID", "PGID", "SID", "TSID", "THR", "LOGIN", "WCHAN", "EMUL", "COMM"); Modified: head/usr.bin/procstat/procstat_bin.c ============================================================================== --- head/usr.bin/procstat/procstat_bin.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_bin.c Sat Oct 14 18:38:36 2017 (r324619) @@ -46,7 +46,7 @@ procstat_bin(struct procstat *prstat, struct kinfo_pro int osrel; static char pathname[PATH_MAX]; - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %-16s %8s %s}\n", "PID", "COMM", "OSREL", "PATH"); Modified: head/usr.bin/procstat/procstat_cred.c ============================================================================== --- head/usr.bin/procstat/procstat_cred.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_cred.c Sat Oct 14 18:38:36 2017 (r324619) @@ -48,7 +48,7 @@ procstat_cred(struct procstat *procstat, struct kinfo_ unsigned int i, ngroups; gid_t *groups; - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %-16s %5s %5s %5s %5s %5s %5s %5s %5s %-15s}\n", "PID", "COMM", "EUID", "RUID", "SVUID", "EGID", "RGID", "SVGID", "UMASK", "FLAGS", "GROUPS"); Modified: head/usr.bin/procstat/procstat_cs.c ============================================================================== --- head/usr.bin/procstat/procstat_cs.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_cs.c Sat Oct 14 18:38:36 2017 (r324619) @@ -52,7 +52,7 @@ procstat_cs(struct procstat *procstat, struct kinfo_pr unsigned int count, i; int once, twice, lastcpu, cpu; - if (!hflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) xo_emit("{T:/%5s %6s %-19s %-19s %2s %4s %-7s}\n", "PID", "TID", "COMM", "TDNAME", "CPU", "CSID", "CPU MASK"); Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sat Oct 14 17:51:25 2017 (r324618) +++ head/usr.bin/procstat/procstat_files.c Sat Oct 14 18:38:36 2017 (r324619) @@ -303,7 +303,8 @@ procstat_files(struct procstat *procstat, struct kinfo */ capwidth = 0; head = procstat_getfiles(procstat, kipp, 0); - if (head != NULL && Cflag) { + if (head != NULL && + (procstat_opts & PS_OPT_CAPABILITIES) != 0) { STAILQ_FOREACH(fst, head, next) { width = width_capability(&fst->fs_cap_rights); if (width > capwidth) @@ -313,8 +314,8 @@ procstat_files(struct procstat *procstat, struct kinfo capwidth = strlen("CAPABILITIES"); } - if (!hflag) { - if (Cflag) + if ((procstat_opts & PS_OPT_NOHEADER) == 0) { + if ((procstat_opts & PS_OPT_CAPABILITIES) != 0) xo_emit("{T:/%5s %-16s %5s %1s %-8s %-*s " "%-3s %-12s}\n", "PID", "COMM", "FD", "T", "FLAGS", capwidth, "CAPABILITIES", "PRO", @@ -417,7 +418,7 @@ procstat_files(struct procstat *procstat, struct kinfo break; } xo_emit("{d:fd_type/%1s/%s} ", str); - if (!Cflag) { + if ((procstat_opts & PS_OPT_CAPABILITIES) == 0) { str = "-"; if (fst->fs_type == PS_FST_TYPE_VNODE) { error = procstat_get_vnode_info(procstat, fst, @@ -514,7 +515,7 @@ procstat_files(struct procstat *procstat, struct kinfo xo_emit("{elq:fd_flags/lock_held}"); xo_close_list("fd_flags"); - if (!Cflag) { + if ((procstat_opts & PS_OPT_CAPABILITIES) == 0) { if (fst->fs_ref_count > -1) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Oct 14 19:02:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7250DE29E4B; Sat, 14 Oct 2017 19:02:53 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34E307D07E; Sat, 14 Oct 2017 19:02:53 +0000 (UTC) (envelope-from fsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9EJ2qJo060280; Sat, 14 Oct 2017 19:02:52 GMT (envelope-from fsu@FreeBSD.org) Received: (from fsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9EJ2q3G060278; Sat, 14 Oct 2017 19:02:52 GMT (envelope-from fsu@FreeBSD.org) Message-Id: <201710141902.v9EJ2q3G060278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fsu set sender to fsu@FreeBSD.org using -f From: Fedor Uporov Date: Sat, 14 Oct 2017 19:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324620 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: fsu X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 324620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 19:02:53 -0000 Author: fsu Date: Sat Oct 14 19:02:52 2017 New Revision: 324620 URL: https://svnweb.freebsd.org/changeset/base/324620 Log: Add extended attributes support to fuse kernel module. Author: kem Reviewed by: cem, pfg (mentor) Approved by: pfg (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12485 Modified: head/sys/fs/fuse/fuse_ipc.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_ipc.c ============================================================================== --- head/sys/fs/fuse/fuse_ipc.c Sat Oct 14 18:38:36 2017 (r324619) +++ head/sys/fs/fuse/fuse_ipc.c Sat Oct 14 19:02:52 2017 (r324620) @@ -636,23 +636,20 @@ fuse_body_audit(struct fuse_ticket *ftick, size_t blen break; case FUSE_SETXATTR: - panic("FUSE_SETXATTR implementor has forgotten to define a" - " response body format check"); + err = (blen == 0) ? 0 : EINVAL; break; case FUSE_GETXATTR: - panic("FUSE_GETXATTR implementor has forgotten to define a" - " response body format check"); - break; - case FUSE_LISTXATTR: - panic("FUSE_LISTXATTR implementor has forgotten to define a" - " response body format check"); + /* + * These can have varying response lengths, and 0 length + * isn't necessarily invalid. + */ + err = 0; break; case FUSE_REMOVEXATTR: - panic("FUSE_REMOVEXATTR implementor has forgotten to define a" - " response body format check"); + err = (blen == 0) ? 0 : EINVAL; break; case FUSE_FLUSH: Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Sat Oct 14 18:38:36 2017 (r324619) +++ head/sys/fs/fuse/fuse_vnops.c Sat Oct 14 19:02:52 2017 (r324620) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -112,10 +113,13 @@ __FBSDID("$FreeBSD$"); static vop_access_t fuse_vnop_access; static vop_close_t fuse_vnop_close; static vop_create_t fuse_vnop_create; +static vop_deleteextattr_t fuse_vnop_deleteextattr; static vop_fsync_t fuse_vnop_fsync; static vop_getattr_t fuse_vnop_getattr; +static vop_getextattr_t fuse_vnop_getextattr; static vop_inactive_t fuse_vnop_inactive; static vop_link_t fuse_vnop_link; +static vop_listextattr_t fuse_vnop_listextattr; static vop_lookup_t fuse_vnop_lookup; static vop_mkdir_t fuse_vnop_mkdir; static vop_mknod_t fuse_vnop_mknod; @@ -128,6 +132,7 @@ static vop_remove_t fuse_vnop_remove; static vop_rename_t fuse_vnop_rename; static vop_rmdir_t fuse_vnop_rmdir; static vop_setattr_t fuse_vnop_setattr; +static vop_setextattr_t fuse_vnop_setextattr; static vop_strategy_t fuse_vnop_strategy; static vop_symlink_t fuse_vnop_symlink; static vop_write_t fuse_vnop_write; @@ -140,10 +145,13 @@ struct vop_vector fuse_vnops = { .vop_access = fuse_vnop_access, .vop_close = fuse_vnop_close, .vop_create = fuse_vnop_create, + .vop_deleteextattr = fuse_vnop_deleteextattr, .vop_fsync = fuse_vnop_fsync, .vop_getattr = fuse_vnop_getattr, + .vop_getextattr = fuse_vnop_getextattr, .vop_inactive = fuse_vnop_inactive, .vop_link = fuse_vnop_link, + .vop_listextattr = fuse_vnop_listextattr, .vop_lookup = fuse_vnop_lookup, .vop_mkdir = fuse_vnop_mkdir, .vop_mknod = fuse_vnop_mknod, @@ -157,6 +165,7 @@ struct vop_vector fuse_vnops = { .vop_rename = fuse_vnop_rename, .vop_rmdir = fuse_vnop_rmdir, .vop_setattr = fuse_vnop_setattr, + .vop_setextattr = fuse_vnop_setextattr, .vop_strategy = fuse_vnop_strategy, .vop_symlink = fuse_vnop_symlink, .vop_write = fuse_vnop_write, @@ -1956,6 +1965,383 @@ fuse_vnop_putpages(struct vop_putpages_args *ap) } } return rtvals[0]; +} + +static const char extattr_namespace_separator = '.'; + +/* + struct vop_getextattr_args { + struct vop_generic_args a_gen; + struct vnode *a_vp; + int a_attrnamespace; + const char *a_name; + struct uio *a_uio; + size_t *a_size; + struct ucred *a_cred; + struct thread *a_td; + }; +*/ +static int +fuse_vnop_getextattr(struct vop_getextattr_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct fuse_dispatcher fdi = {0}; + struct fuse_getxattr_in *get_xattr_in; + struct fuse_getxattr_out *get_xattr_out; + struct mount *mp = vnode_mount(vp); + char *prefix; + size_t len; + char *attr_str; + struct thread *td = ap->a_td; + struct ucred *cred = ap->a_cred; + int err = 0; + + fuse_trace_printf_vnop(); + + if (fuse_isdeadfs(vp)) + return ENXIO; + + /* Default to looking for user attributes. */ + if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM) + prefix = EXTATTR_NAMESPACE_SYSTEM_STRING; + else + prefix = EXTATTR_NAMESPACE_USER_STRING; + + len = strlen(prefix) + sizeof(extattr_namespace_separator) + + strlen(ap->a_name) + 1; + + fdisp_init(&fdi, len + sizeof(*get_xattr_in)); + fdisp_make_vp(&fdi, FUSE_GETXATTR, vp, td, cred); + + get_xattr_in = fdi.indata; + /* + * Check to see whether we're querying the available size or + * issuing the actual request. If we pass in 0, we get back struct + * fuse_getxattr_out. If we pass in a non-zero size, we get back + * that much data, without the struct fuse_getxattr_out header. + */ + if (ap->a_size != NULL) + get_xattr_in->size = 0; + else + get_xattr_in->size = uio->uio_resid; + + attr_str = (char *)fdi.indata + sizeof(*get_xattr_in); + snprintf(attr_str, len, "%s%c%s", prefix, extattr_namespace_separator, + ap->a_name); + + err = fdisp_wait_answ(&fdi); + + if (err != 0) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_GETXATTR); + debug_printf("getxattr: got err=%d from daemon\n", err); + goto out; + } + + /* + * If we get to this point (i.e. no error), we should have a valid + * answer of some sort. i.e. non-zero iosize and a valid pointer. + */ + if ((fdi.answ == NULL) || (fdi.iosize == 0)) { + debug_printf("getxattr: err = 0, but answ = %p, iosize = %zu\n", + fdi.answ, fdi.iosize); + err = EINVAL; + goto out; + } + get_xattr_out = fdi.answ; + + if (ap->a_size != NULL) { + *ap->a_size = get_xattr_out->size; + } else if (fdi.iosize > 0) { + err = uiomove(fdi.answ, fdi.iosize, uio); + } else { + err = EINVAL; + } + +out: + fdisp_destroy(&fdi); + return (err); +} + +/* + struct vop_setextattr_args { + struct vop_generic_args a_gen; + struct vnode *a_vp; + int a_attrnamespace; + const char *a_name; + struct uio *a_uio; + struct ucred *a_cred; + struct thread *a_td; + }; +*/ +static int +fuse_vnop_setextattr(struct vop_setextattr_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct fuse_dispatcher fdi = {0}; + struct fuse_setxattr_in *set_xattr_in; + struct mount *mp = vnode_mount(vp); + char *prefix; + size_t len; + char *attr_str; + struct thread *td = ap->a_td; + struct ucred *cred = ap->a_cred; + int err = 0; + + fuse_trace_printf_vnop(); + + if (fuse_isdeadfs(vp)) + return ENXIO; + + /* Default to looking for user attributes. */ + if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM) + prefix = EXTATTR_NAMESPACE_SYSTEM_STRING; + else + prefix = EXTATTR_NAMESPACE_USER_STRING; + + len = strlen(prefix) + sizeof(extattr_namespace_separator) + + strlen(ap->a_name) + 1; + + fdisp_init(&fdi, len + sizeof(*set_xattr_in) + uio->uio_resid); + fdisp_make_vp(&fdi, FUSE_SETXATTR, vp, td, cred); + + set_xattr_in = fdi.indata; + set_xattr_in->size = uio->uio_resid; + + attr_str = (char *)fdi.indata + sizeof(*set_xattr_in); + snprintf(attr_str, len, "%s%c%s", prefix, extattr_namespace_separator, + ap->a_name); + + err = uiomove((char *)fdi.indata + sizeof(*set_xattr_in) + len, + uio->uio_resid, uio); + if (err != 0) { + debug_printf("setxattr: got error %d from uiomove\n", err); + goto out; + } + + err = fdisp_wait_answ(&fdi); + + if (err != 0) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_SETXATTR); + debug_printf("setxattr: got err=%d from daemon\n", err); + goto out; + } + +out: + fdisp_destroy(&fdi); + return (err); +} + +/* + * The Linux / FUSE extended attribute list is simply a collection of + * NUL-terminated strings. The FreeBSD extended attribute list is a single + * byte length followed by a non-NUL terminated string. So, this allows + * conversion of the Linux / FUSE format to the FreeBSD format in place. + * Linux attribute names are reported with the namespace as a prefix (e.g. + * "user.attribute_name"), but in FreeBSD they are reported without the + * namespace prefix (e.g. "attribute_name"). So, we're going from: + * + * user.attr_name1\0user.attr_name2\0 + * + * to: + * + * attr_name1attr_name2 + * + * Where "" is a single byte number of characters in the attribute name. + * + * Args: + * prefix - exattr namespace prefix string + * list, list_len - input list with namespace prefixes + * bsd_list, bsd_list_len - output list compatible with bsd vfs + */ +static int +fuse_xattrlist_convert(char *prefix, const char *list, int list_len, + char *bsd_list, int *bsd_list_len) +{ + int len, pos, dist_to_next, prefix_len; + + pos = 0; + *bsd_list_len = 0; + prefix_len = strlen(prefix); + + while (pos < list_len && list[pos] != '\0') { + dist_to_next = strlen(&list[pos]) + 1; + if (bcmp(&list[pos], prefix, prefix_len) == 0 && + list[pos + prefix_len] == extattr_namespace_separator) { + len = dist_to_next - + (prefix_len + sizeof(extattr_namespace_separator)) - 1; + if (len >= EXTATTR_MAXNAMELEN) + return (ENAMETOOLONG); + + bsd_list[*bsd_list_len] = len; + memcpy(&bsd_list[*bsd_list_len + 1], + &list[pos + prefix_len + + sizeof(extattr_namespace_separator)], len); + + *bsd_list_len += len + 1; + } + + pos += dist_to_next; + } + + return (0); +} + +/* + struct vop_listextattr_args { + struct vop_generic_args a_gen; + struct vnode *a_vp; + int a_attrnamespace; + struct uio *a_uio; + size_t *a_size; + struct ucred *a_cred; + struct thread *a_td; + }; +*/ +static int +fuse_vnop_listextattr(struct vop_listextattr_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct uio *uio = ap->a_uio; + struct fuse_dispatcher fdi = {0}; + struct fuse_getxattr_in *get_xattr_in; + struct fuse_getxattr_out *get_xattr_out; + struct mount *mp = vnode_mount(vp); + size_t len; + char *prefix; + char *attr_str; + char *bsd_list = NULL; + int bsd_list_len; + struct thread *td = ap->a_td; + struct ucred *cred = ap->a_cred; + int err = 0; + + fuse_trace_printf_vnop(); + + if (fuse_isdeadfs(vp)) + return ENXIO; + + /* + * Add space for a NUL and the period separator if enabled. + * Default to looking for user attributes. + */ + if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM) + prefix = EXTATTR_NAMESPACE_SYSTEM_STRING; + else + prefix = EXTATTR_NAMESPACE_USER_STRING; + + len = strlen(prefix) + sizeof(extattr_namespace_separator) + 1; + + fdisp_init(&fdi, sizeof(*get_xattr_in) + len); + fdisp_make_vp(&fdi, FUSE_LISTXATTR, vp, td, cred); + + get_xattr_in = fdi.indata; + if (ap->a_size != NULL) + get_xattr_in->size = 0; + else + get_xattr_in->size = uio->uio_resid + sizeof(*get_xattr_out); + + + attr_str = (char *)fdi.indata + sizeof(*get_xattr_in); + snprintf(attr_str, len, "%s%c", prefix, extattr_namespace_separator); + + err = fdisp_wait_answ(&fdi); + if (err != 0) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_LISTXATTR); + debug_printf("listextattr: got err=%d from daemon\n", err); + goto out; + } + + if ((fdi.answ == NULL) || (fdi.iosize == 0)) { + err = EINVAL; + goto out; + } + get_xattr_out = fdi.answ; + + if (ap->a_size != NULL) { + *ap->a_size = get_xattr_out->size; + } else if (fdi.iosize > 0) { + /* + * The Linux / FUSE attribute list format isn't the same + * as FreeBSD's format. So we need to transform it into + * FreeBSD's format before giving it to the user. + */ + bsd_list = malloc(fdi.iosize, M_TEMP, M_WAITOK); + err = fuse_xattrlist_convert(prefix, fdi.answ, fdi.iosize, + bsd_list, &bsd_list_len); + if (err != 0) + goto out; + + err = uiomove(bsd_list, bsd_list_len, uio); + } else { + debug_printf("listextattr: returned iosize %zu for %s attribute list is " + "too small\n", fdi.iosize, prefix); + err = EINVAL; + } + +out: + free(bsd_list, M_TEMP); + fdisp_destroy(&fdi); + return (err); +} + +/* + struct vop_deleteextattr_args { + struct vop_generic_args a_gen; + struct vnode *a_vp; + int a_attrnamespace; + const char *a_name; + struct ucred *a_cred; + struct thread *a_td; + }; +*/ +static int +fuse_vnop_deleteextattr(struct vop_deleteextattr_args *ap) +{ + struct vnode *vp = ap->a_vp; + struct fuse_dispatcher fdi = {0}; + struct mount *mp = vnode_mount(vp); + char *prefix; + size_t len; + char *attr_str; + struct thread *td = ap->a_td; + struct ucred *cred = ap->a_cred; + int err; + + fuse_trace_printf_vnop(); + + if (fuse_isdeadfs(vp)) + return ENXIO; + + /* Default to looking for user attributes. */ + if (ap->a_attrnamespace == EXTATTR_NAMESPACE_SYSTEM) + prefix = EXTATTR_NAMESPACE_SYSTEM_STRING; + else + prefix = EXTATTR_NAMESPACE_USER_STRING; + + len = strlen(prefix) + sizeof(extattr_namespace_separator) + + strlen(ap->a_name) + 1; + + fdisp_init(&fdi, len); + fdisp_make_vp(&fdi, FUSE_REMOVEXATTR, vp, td, cred); + + attr_str = fdi.indata; + snprintf(attr_str, len, "%s%c%s", prefix, extattr_namespace_separator, + ap->a_name); + + err = fdisp_wait_answ(&fdi); + if (err != 0) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_REMOVEXATTR); + debug_printf("removexattr: got err=%d from daemon\n", err); + } + + fdisp_destroy(&fdi); + return (err); } /* From owner-svn-src-head@freebsd.org Sat Oct 14 23:25:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04B83E2F5A4; Sat, 14 Oct 2017 23:25:46 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5E4583A6A; Sat, 14 Oct 2017 23:25:45 +0000 (UTC) (envelope-from rlibby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9ENPiHY068918; Sat, 14 Oct 2017 23:25:44 GMT (envelope-from rlibby@FreeBSD.org) Received: (from rlibby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9ENPiXG068917; Sat, 14 Oct 2017 23:25:44 GMT (envelope-from rlibby@FreeBSD.org) Message-Id: <201710142325.v9ENPiXG068917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rlibby set sender to rlibby@FreeBSD.org using -f From: Ryan Libby Date: Sat, 14 Oct 2017 23:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r324621 - head/sys/dev/mlx4/mlx4_en X-SVN-Group: head X-SVN-Commit-Author: rlibby X-SVN-Commit-Paths: head/sys/dev/mlx4/mlx4_en X-SVN-Commit-Revision: 324621 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 23:25:46 -0000 Author: rlibby Date: Sat Oct 14 23:25:44 2017 New Revision: 324621 URL: https://svnweb.freebsd.org/changeset/base/324621 Log: mlx4: use enum constants instead of const vars for case exprs Follow up from r324201 to fix compilation with gcc, which complains about non-ICE case expressions. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D12675 Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Sat Oct 14 19:02:52 2017 (r324620) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c Sat Oct 14 23:25:44 2017 (r324621) @@ -558,26 +558,28 @@ mlx4_en_rx_mb(struct mlx4_en_priv *priv, struct mlx4_e static __inline int mlx4_en_rss_hash(__be16 status, int udp_rss) { - const __be16 status_all = cpu_to_be16( + enum { + status_all = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | MLX4_CQE_STATUS_IPV4F | MLX4_CQE_STATUS_IPV6 | MLX4_CQE_STATUS_TCP | - MLX4_CQE_STATUS_UDP); - const __be16 status_ipv4_tcp = cpu_to_be16( + MLX4_CQE_STATUS_UDP), + status_ipv4_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | - MLX4_CQE_STATUS_TCP); - const __be16 status_ipv6_tcp = cpu_to_be16( + MLX4_CQE_STATUS_TCP), + status_ipv6_tcp = cpu_to_be16( MLX4_CQE_STATUS_IPV6 | - MLX4_CQE_STATUS_TCP); - const __be16 status_ipv4_udp = cpu_to_be16( + MLX4_CQE_STATUS_TCP), + status_ipv4_udp = cpu_to_be16( MLX4_CQE_STATUS_IPV4 | - MLX4_CQE_STATUS_UDP); - const __be16 status_ipv6_udp = cpu_to_be16( + MLX4_CQE_STATUS_UDP), + status_ipv6_udp = cpu_to_be16( MLX4_CQE_STATUS_IPV6 | - MLX4_CQE_STATUS_UDP); - const __be16 status_ipv4 = cpu_to_be16(MLX4_CQE_STATUS_IPV4); - const __be16 status_ipv6 = cpu_to_be16(MLX4_CQE_STATUS_IPV6); + MLX4_CQE_STATUS_UDP), + status_ipv4 = cpu_to_be16(MLX4_CQE_STATUS_IPV4), + status_ipv6 = cpu_to_be16(MLX4_CQE_STATUS_IPV6) + }; status &= status_all; switch (status) { From owner-svn-src-head@freebsd.org Sat Oct 14 23:34:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53BC8E2F80E; Sat, 14 Oct 2017 23:34:05 +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 CC12D83E5A; Sat, 14 Oct 2017 23:34:04 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id l23so13204530lfk.10; Sat, 14 Oct 2017 16:34:04 -0700 (PDT) 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=dtXxX9hxzvPa5UAlCvInepabY0joi+ZZofuyX3ayniQ=; b=jR0YNG0KwE6LCfH33G5lWnQHTkAFsopXr1KQVC0IIQ2FvVY4CrEnPRky65LB6UJxqE F1ynVoax8/jDK+OuFyLC/svpEP/agLlv6s60pmSNjUmXugxit2PbkMxXp0xHQdbzeAor KpFmOM+i0hkn47pQu0Ri+bvgKzZ+v5hevV3LFIExgrZ1Ar+B+YZ+aWFx3KLGdfYsuXBv CVgT0HKbBEUj/2M3xW+FKrxNgqCe3Sj3y0JlSTe8iZwya1vvRKkpGSL63zJEc17+PtSi pcAAGRbhDDyGv4YW8nJVmKwBmFIFvVSiNnZ0kLfNM5v9Lcyd+QtFqNduy+az8FHpBbPf PNdA== 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=dtXxX9hxzvPa5UAlCvInepabY0joi+ZZofuyX3ayniQ=; b=U9ysHGQUjctrYSwO1NKh5kPzUjQ0IA/8JGXMgJFJ+jDC8+vhzrppOCPkmIYtXsMWMN 9FtisXnZpx0IivjjONhX6IRMiFYI5I2tPO+4sNXUf71VEJALZzTqMa393e0qo7yLMOFz n6WLbHfKU6AsNf02MwjoLEKd/eOVAZfUZ6mdtHPbIu3TfozsffMf6a3yKlevK9mve2T1 3ruzKYevZjPK4KjAIXzifCpXghPAjEXf7Hp8EK89ueW/SJmXzZuJvvKj3WbeT1PmYB6+ TR2d7o/emEhFOFK50J6/X/UzDu0+MeJmwtJCFwDviN34pH3RtAcYkXF0GM2qA4EDczf9 nsyg== X-Gm-Message-State: AMCzsaXu+9OaJiU8cT8meIYhPMHHT0+/gvGJ96FJyF81vZr9tYfJ8dvd gRKITBPH1JzVAmBAbB9KgO1bTR9C/7xTVN4E//E= X-Google-Smtp-Source: AOwi7QAJcP+il4lB9fVqk+MLD8qbcMU9wwivr5Yg0/A9lxVEH5xrgcuryowrf/Vx0GeJfXXSIIvEaIvknjLjyNw4gck= X-Received: by 10.46.41.6 with SMTP id u6mr2512058lje.130.1508024041568; Sat, 14 Oct 2017 16:34:01 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.7.153 with HTTP; Sat, 14 Oct 2017 16:34:00 -0700 (PDT) In-Reply-To: <201710141902.v9EJ2q3G060278@repo.freebsd.org> References: <201710141902.v9EJ2q3G060278@repo.freebsd.org> From: Alan Somers Date: Sat, 14 Oct 2017 17:34:00 -0600 X-Google-Sender-Auth: 0Nwl9HGIrgk4JAq7FLnsXv0CE9w Message-ID: Subject: Re: svn commit: r324620 - head/sys/fs/fuse To: Fedor Uporov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Oct 2017 23:34:05 -0000 On Sat, Oct 14, 2017 at 1:02 PM, Fedor Uporov wrote: > Author: fsu > Date: Sat Oct 14 19:02:52 2017 > New Revision: 324620 > URL: https://svnweb.freebsd.org/changeset/base/324620 > > Log: > Add extended attributes support to fuse kernel module. > > Author: kem > Reviewed by: cem, pfg (mentor) > Approved by: pfg (mentor) > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D12485 +1 Also, this should be mentioned in the release notes.