From owner-svn-src-head@freebsd.org Sun Nov 19 00:31: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 11F2ADE0E76; Sun, 19 Nov 2017 00:31:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D50383231; Sun, 19 Nov 2017 00:31:16 +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 vAJ0VFAU016690; Sun, 19 Nov 2017 00:31:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJ0VE9m016670; Sun, 19 Nov 2017 00:31:14 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711190031.vAJ0VE9m016670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 19 Nov 2017 00:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325988 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 325988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 00:31:17 -0000 Author: emaste Date: Sun Nov 19 00:31:13 2017 New Revision: 325988 URL: https://svnweb.freebsd.org/changeset/base/325988 Log: ANSIfy sys/libkern PR: 223641 Submitted by: ota@j.email.ne.jp MFC after: 1 week Modified: head/sys/libkern/ashrdi3.c head/sys/libkern/bcmp.c head/sys/libkern/bsearch.c head/sys/libkern/cmpdi2.c head/sys/libkern/divdi3.c head/sys/libkern/lshrdi3.c head/sys/libkern/mcount.c head/sys/libkern/moddi3.c head/sys/libkern/qdivrem.c head/sys/libkern/random.c head/sys/libkern/scanc.c head/sys/libkern/strcmp.c head/sys/libkern/strlcat.c head/sys/libkern/strsep.c head/sys/libkern/strtol.c head/sys/libkern/strtoul.c head/sys/libkern/ucmpdi2.c head/sys/libkern/udivdi3.c head/sys/libkern/umoddi3.c Modified: head/sys/libkern/ashrdi3.c ============================================================================== --- head/sys/libkern/ashrdi3.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/ashrdi3.c Sun Nov 19 00:31:13 2017 (r325988) @@ -40,9 +40,7 @@ __FBSDID("$FreeBSD$"); * Shift a (signed) quad value right (arithmetic shift right). */ quad_t -__ashrdi3(a, shift) - quad_t a; - qshift_t shift; +__ashrdi3(quad_t a, qshift_t shift) { union uu aa; Modified: head/sys/libkern/bcmp.c ============================================================================== --- head/sys/libkern/bcmp.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/bcmp.c Sun Nov 19 00:31:13 2017 (r325988) @@ -42,9 +42,7 @@ typedef const unsigned long *culp; * bcmp -- vax cmpc3 instruction */ int -bcmp(b1, b2, length) - const void *b1, *b2; - size_t length; +bcmp(const void *b1, const void *b2, size_t length) { #if BYTE_ORDER == LITTLE_ENDIAN /* Modified: head/sys/libkern/bsearch.c ============================================================================== --- head/sys/libkern/bsearch.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/bsearch.c Sun Nov 19 00:31:13 2017 (r325988) @@ -53,12 +53,8 @@ __FBSDID("$FreeBSD$"); * look at item 3. */ void * -bsearch(key, base0, nmemb, size, compar) - const void *key; - const void *base0; - size_t nmemb; - size_t size; - int (*compar)(const void *, const void *); +bsearch(const void *key, const void *base0, size_t nmemb, size_t size, + int (*compar)(const void *, const void *)) { const char *base = base0; size_t lim; Modified: head/sys/libkern/cmpdi2.c ============================================================================== --- head/sys/libkern/cmpdi2.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/cmpdi2.c Sun Nov 19 00:31:13 2017 (r325988) @@ -42,8 +42,7 @@ __FBSDID("$FreeBSD$"); * signed. */ int -__cmpdi2(a, b) - quad_t a, b; +__cmpdi2(quad_t a, quad_t b) { union uu aa, bb; Modified: head/sys/libkern/divdi3.c ============================================================================== --- head/sys/libkern/divdi3.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/divdi3.c Sun Nov 19 00:31:13 2017 (r325988) @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); * ??? if -1/2 should produce -1 on this machine, this code is wrong */ quad_t -__divdi3(a, b) - quad_t a, b; +__divdi3(quad_t a, quad_t b) { u_quad_t ua, ub, uq; int neg; Modified: head/sys/libkern/lshrdi3.c ============================================================================== --- head/sys/libkern/lshrdi3.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/lshrdi3.c Sun Nov 19 00:31:13 2017 (r325988) @@ -40,9 +40,7 @@ __FBSDID("$FreeBSD$"); * Shift an (unsigned) quad value right (logical shift right). */ quad_t -__lshrdi3(a, shift) - quad_t a; - qshift_t shift; +__lshrdi3(quad_t a, qshift_t shift) { union uu aa; Modified: head/sys/libkern/mcount.c ============================================================================== --- head/sys/libkern/mcount.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/mcount.c Sun Nov 19 00:31:13 2017 (r325988) @@ -56,8 +56,7 @@ __FBSDID("$FreeBSD$"); * both frompcindex and frompc. Any reasonable, modern compiler will * perform this optimization. */ -_MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */ - uintfptr_t frompc, selfpc; +_MCOUNT_DECL(uintfptr_t frompc, uintfptr_t selfpc) /* _mcount; may be static, inline, etc */ { #ifdef GUPROF int delta; @@ -245,8 +244,7 @@ MCOUNT #ifdef GUPROF void -mexitcount(selfpc) - uintfptr_t selfpc; +mexitcount(uintfptr_t selfpc) { struct gmonparam *p; uintfptr_t selfpcdiff; Modified: head/sys/libkern/moddi3.c ============================================================================== --- head/sys/libkern/moddi3.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/moddi3.c Sun Nov 19 00:31:13 2017 (r325988) @@ -43,8 +43,7 @@ __FBSDID("$FreeBSD$"); * If -1/2 should produce -1 on this machine, this code is wrong. */ quad_t -__moddi3(a, b) - quad_t a, b; +__moddi3(quad_t a, quad_t b) { u_quad_t ua, ub, ur; int neg; Modified: head/sys/libkern/qdivrem.c ============================================================================== --- head/sys/libkern/qdivrem.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/qdivrem.c Sun Nov 19 00:31:13 2017 (r325988) @@ -77,8 +77,7 @@ __shl(digit *p, int len, int sh) * leading zeros). */ u_quad_t -__qdivrem(uq, vq, arq) - u_quad_t uq, vq, *arq; +__qdivrem(u_quad_t uq, u_quad_t vq, u_quad_t *arq) { union uu tmp; digit *u, *v, *q; Modified: head/sys/libkern/random.c ============================================================================== --- head/sys/libkern/random.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/random.c Sun Nov 19 00:31:13 2017 (r325988) @@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$"); static u_long randseed = 937186357; /* after srandom(1), NSHUFF counted */ void -srandom(seed) - u_long seed; +srandom(u_long seed) { int i; Modified: head/sys/libkern/scanc.c ============================================================================== --- head/sys/libkern/scanc.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/scanc.c Sun Nov 19 00:31:13 2017 (r325988) @@ -35,10 +35,7 @@ __FBSDID("$FreeBSD$"); #include int -scanc(size, cp, table, mask0) - u_int size; - const u_char *cp, table[]; - int mask0; +scanc(u_int size, const u_char *cp, const u_char table[], int mask0) { const u_char *end; u_char mask; Modified: head/sys/libkern/strcmp.c ============================================================================== --- head/sys/libkern/strcmp.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/strcmp.c Sun Nov 19 00:31:13 2017 (r325988) @@ -39,8 +39,7 @@ __FBSDID("$FreeBSD$"); * Compare strings. */ int -strcmp(s1, s2) - const char *s1, *s2; +strcmp(const char *s1, const char *s2) { while (*s1 == *s2++) if (*s1++ == 0) Modified: head/sys/libkern/strlcat.c ============================================================================== --- head/sys/libkern/strlcat.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/strlcat.c Sun Nov 19 00:31:13 2017 (r325988) @@ -44,10 +44,7 @@ __FBSDID("$FreeBSD$"); * If retval >= siz, truncation occurred. */ size_t -strlcat(dst, src, siz) - char *dst; - const char *src; - size_t siz; +strlcat(char *dst, const char *src, size_t siz) { char *d = dst; const char *s = src; Modified: head/sys/libkern/strsep.c ============================================================================== --- head/sys/libkern/strsep.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/strsep.c Sun Nov 19 00:31:13 2017 (r325988) @@ -48,9 +48,7 @@ __FBSDID("$FreeBSD$"); * If *stringp is NULL, strsep returns NULL. */ char * -strsep(stringp, delim) - char **stringp; - const char *delim; +strsep(char **stringp, const char *delim) { char *s; const char *spanp; Modified: head/sys/libkern/strtol.c ============================================================================== --- head/sys/libkern/strtol.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/strtol.c Sun Nov 19 00:31:13 2017 (r325988) @@ -47,10 +47,7 @@ __FBSDID("$FreeBSD$"); * alphabets and digits are each contiguous. */ long -strtol(nptr, endptr, base) - const char *nptr; - char **endptr; - int base; +strtol(const char *nptr, char **endptr, int base) { const char *s = nptr; unsigned long acc; Modified: head/sys/libkern/strtoul.c ============================================================================== --- head/sys/libkern/strtoul.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/strtoul.c Sun Nov 19 00:31:13 2017 (r325988) @@ -47,10 +47,7 @@ __FBSDID("$FreeBSD$"); * alphabets and digits are each contiguous. */ unsigned long -strtoul(nptr, endptr, base) - const char *nptr; - char **endptr; - int base; +strtoul(const char *nptr, char **endptr, int base) { const char *s = nptr; unsigned long acc; Modified: head/sys/libkern/ucmpdi2.c ============================================================================== --- head/sys/libkern/ucmpdi2.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/ucmpdi2.c Sun Nov 19 00:31:13 2017 (r325988) @@ -41,8 +41,7 @@ __FBSDID("$FreeBSD$"); * Neither a nor b are considered signed. */ int -__ucmpdi2(a, b) - u_quad_t a, b; +__ucmpdi2(u_quad_t a, u_quad_t b) { union uu aa, bb; Modified: head/sys/libkern/udivdi3.c ============================================================================== --- head/sys/libkern/udivdi3.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/udivdi3.c Sun Nov 19 00:31:13 2017 (r325988) @@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$"); * Divide two unsigned quads. */ u_quad_t -__udivdi3(a, b) - u_quad_t a, b; +__udivdi3(u_quad_t a, u_quad_t b) { return (__qdivrem(a, b, (u_quad_t *)0)); Modified: head/sys/libkern/umoddi3.c ============================================================================== --- head/sys/libkern/umoddi3.c Sat Nov 18 21:39:54 2017 (r325987) +++ head/sys/libkern/umoddi3.c Sun Nov 19 00:31:13 2017 (r325988) @@ -40,8 +40,7 @@ __FBSDID("$FreeBSD$"); * Return remainder after dividing two unsigned quads. */ u_quad_t -__umoddi3(a, b) - u_quad_t a, b; +__umoddi3(u_quad_t a, u_quad_t b) { u_quad_t r; From owner-svn-src-head@freebsd.org Sun Nov 19 00:58: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 3B1D1DE15C1 for ; Sun, 19 Nov 2017 00:58:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic303-18.consmr.mail.bf2.yahoo.com (sonic303-18.consmr.mail.bf2.yahoo.com [74.6.131.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F10BA3E6C for ; Sun, 19 Nov 2017 00:58:16 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1511053095; bh=aMnoalbIavUK4ugI4V/Tn7ZQfncwA1rISSYggXi9cFQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=W96oemePM64DsjB+yh8XdXc5xT+aJZRvHoj4acT63L+a304PmVK5UCmHectgJbOo6BNcR4Jx7JQQOomw70mZXVNWLwb8ODyyzc2kbvpcEukwiTHh3CLx8n3Th52xBX3unrpPjzGoySHSVgBDqywCr+2Tl4oEF9KFwgVTdoKsrboepE9ZCgjcTxonrU+kTc1ZhREUiXJNEm2/kLWuFNH2llJmoYUxkEpaFmzLhD54Lert3dCA2ctzGxEclugt/ddscaVyzODsYu18JWzrF4DWsWdMv4SxPlupHmcS/v0OyTWNgVdlaqIuOtfZPGLM9B0f2nC8tPdDDuX58x/aSyt6fg== X-YMail-OSG: mefxPyYVM1kM3YjzyEoTe.3UAVQ9USb3Osnscy0xagY4339Oc7DJ68vdsXXTrjn 6NUTnTnLaaFtYx8bUK.KGv4uAE_6QC3xewb._9eDiIZQLVAwUwtXQLIHQ4vA3cCqzX99sNcvXT0D 8.8lnzW9TWOm_RbgYemLgbLXeSG9IsnXLI_RNhL4Z6rY6g8562N6HYsC1Ti5Yvqg19FEcnSoTC1v GzFlc604pkMTexch7TPZAWVtGeDhHkvtV1bBTTBAdgZZvt7rtQFL4gh7mSnHODTMz8uM785WTbRw IYPvwy_vrXeiz9Nn2Eqa.CFHTT9VpNlgQ1avPhn0cBm0qojuy3I1U5NkegzemyHJn415_q7Drd5C OEwJTt9hsQGskds3A0BLVztXZ2MVnIFY.N7lhwvIyi_QtxdxYVilAyVuUU7cLNbLrZEyUGyztqpX TzgW7iKE9sS94dJ7CuJlQOkuLs_OfmlDRrtdKFDulXYo1V9rRNWy.r6HXBpGLFXm0ndE_qMWZ Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.bf2.yahoo.com with HTTP; Sun, 19 Nov 2017 00:58:15 +0000 Received: from smtpgate102.mail.bf1.yahoo.com (EHLO [192.168.0.3]) ([72.30.28.113]) by smtp411.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID -586774714; Sun, 19 Nov 2017 00:37:57 +0000 (UTC) Subject: Re: svn commit: r325954 - in head: . share/mk sys/conf usr.sbin/config To: Brooks Davis , Stefan Esser Cc: Stefan Esser , src-committers , "svn-src-all@freebsd.org" , rgrimes@freebsd.org, "svn-src-head@freebsd.org" , "O. Hartmann" , Warner Losh References: <201711180134.vAI1Y2ks064138@pdx.rh.CN85.dnsmgr.net> <29499AF9-FC0A-4CDA-9657-B092B3F9A0D0@FreeBSD.org> <04747a89-4dc7-a476-dc32-a158ee1f5240@freebsd.org> <75597b23-7a8c-34ad-736b-8d68ce7dea06@FreeBSD.org> <0186512e-dc90-6d00-c048-d87a9c1948a3@freebsd.org> <20171118225340.GF35747@spindle.one-eyed-alien.net> From: Pedro Giffuni Message-ID: <1db2e302-192c-0c9c-5987-6a2eb117d2a8@FreeBSD.org> Date: Sat, 18 Nov 2017 19:37:57 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171118225340.GF35747@spindle.one-eyed-alien.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 00:58:17 -0000 On 11/18/17 17:53, Brooks Davis wrote: > On Sat, Nov 18, 2017 at 05:14:28PM +0100, Stefan Esser wrote: >> Am 18.11.17 um 16:01 schrieb Pedro Giffuni: >>> Hi; >>> >>> On 11/18/17 09:15, Stefan Esser wrote: >>>> Am 18.11.17 um 03:31 schrieb Pedro Giffuni: >>>>>> On Nov 17, 2017, at 20:34, Rodney W. Grimes >>>>>> wrote: >>>>>> >>>>>> [ Charset UTF-8 unsupported, converting... ] >>>>>>> Kib@ posted to arch that we were removing it, nobody objected, we removed >>>>>>> it. If it was a working feature that might have a few users, that's one >>>>>>> thing. But I don't think make lint has actually worked in at least a decade. >>>>>> Thats a sad state of affairs. >>>>>> >>>>> t?s not sad, just the way things are, modern compilers are doing much of >>>>> the checking older tools like lint used to do.. OpenBSD and DragonflyBSD >>>>> both killed lint ages ago. >>>>> >>>>> OTOH, we should probably consider other tools, like sparse: >>>>> >>>>> https://sparse.wiki.kernel.org/index.php/Main_Page >>>>> ? The license is fine and it plays nice with the compiler. >>>> It builds on -CURRENT, but the Makefile needs some tweaks (it does >>>> not find LLVM or Gtk+-2.0, even though they are present on my system). >>>> >>>> I'll work on a port over the weekend ... >>> Thanks! >> I've got a port that builds all of sparse except sparse-llvm. The sources >> use GNU extensions, and I do not think it is worth the effort to provide >> standard compliant replacements for them at this time. >> >> Building sparc?se-llvm will take some more effort and require the LLVM port >> to be installed, since it references headers not installed by our system >> compiler. It is an optional component, but one we definitely should have. >> >> I'm not sure how to proceed, but the easiest path forward is to make the >> LLVM support optional and depend on one particular LLVM version (i.e. 4.0 >> for now) built from a port if the option is enabled. >> >>> For it to be really useful we still would have to add annotations to the >>> kernel headers. >> Well, those could be added over time ... >> >>> I just resurrected a recent proposal from brooks@ into the IdeasPage: >>> >>> https://wiki.freebsd.org/IdeasPage#Userspace_Address_Space_Annotation >>> >>> It is actually a fun project but my hands are full! >> The port was easy, so far, I'll commit it without sparse-llvm for now. >> LLVM support will follow when I've got the remaining build issues resolved. > I wrote up a port a month or so ago, but I didn't commit it > because I belive they authors of sparse failed to understand how C > qualifiers work and the __user annotations used in linux are harmful as > a result. The problem is that they annotate the data not the pointer. > You can make a case for this for the address space annotations, but I > believe it's completely wrong for the anti-derefernce guards. Hmm ... I was expecting we could use it for a check-mode build but never for ship anything resulting from it. Now it seems like something that we should not fiddle with but instead leave to the llvm developers to implement. > I'd hoped that that the linux style __user annotations would be a > good match for the __capability annotations we use in CHERI to denote > pointers that are capabilities (fat pointers), but they aren't usable. > This makes me sad, but I will object to adding these annotations to > our tree. (Some of the other annotations look ok, but I've not tested > further after this disappointment.) OK, so it's better to know that. The ports tree has devel/splint. Disclaimer: I have never played with isplint and it's copyleft, but I doubt we want to bring another lint-like utility to the tree, so perhaps the license doesn't matter in this case. Pedro. > -- Brooks From owner-svn-src-head@freebsd.org Sun Nov 19 02:16: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 31558DE4FD0; Sun, 19 Nov 2017 02:16:13 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2ECE65D2A; Sun, 19 Nov 2017 02:16:12 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAJ2GCoW062095; Sun, 19 Nov 2017 02:16:12 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJ2GCAb062094; Sun, 19 Nov 2017 02:16:12 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201711190216.vAJ2GCAb062094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Sun, 19 Nov 2017 02:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325990 - head/release/packages X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/release/packages X-SVN-Commit-Revision: 325990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 02:16:13 -0000 Author: brd (doc,ports committer) Date: Sun Nov 19 02:16:11 2017 New Revision: 325990 URL: https://svnweb.freebsd.org/changeset/base/325990 Log: Add missing call to services_mkdb to build the services.db Approved by: gjb Modified: head/release/packages/runtime.ucl Modified: head/release/packages/runtime.ucl ============================================================================== --- head/release/packages/runtime.ucl Sun Nov 19 00:32:16 2017 (r325989) +++ head/release/packages/runtime.ucl Sun Nov 19 02:16:11 2017 (r325990) @@ -20,6 +20,7 @@ scripts: { post-install = < Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78821DE8A2B; Sun, 19 Nov 2017 03:14:11 +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 3A90C686C0; Sun, 19 Nov 2017 03:14:11 +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 vAJ3EARg087585; Sun, 19 Nov 2017 03:14:10 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJ3EAuZ087584; Sun, 19 Nov 2017 03:14:10 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201711190314.vAJ3EAuZ087584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 19 Nov 2017 03:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325991 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 325991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 03:14:11 -0000 Author: kevans Date: Sun Nov 19 03:14:10 2017 New Revision: 325991 URL: https://svnweb.freebsd.org/changeset/base/325991 Log: aw_nmi: add support for a31/a83t's r_intc We currently support the a83t's r_intc in a somewhat hack-ish way; our .dts describes it as nmi_intc, and uses a subset of the actual register space to make it line up with a20/a31 nmi offsets. This breaks with the recent 4.14 update describing r_intc using the full register space, so update aw_nmi to use the correct register offsets with the right compat data in a way that doesn't break our current dts with nmi_intc or upstream with r_intc described. Reviewed by: manu Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D13122 Modified: head/sys/arm/allwinner/aw_nmi.c Modified: head/sys/arm/allwinner/aw_nmi.c ============================================================================== --- head/sys/arm/allwinner/aw_nmi.c Sun Nov 19 02:16:11 2017 (r325990) +++ head/sys/arm/allwinner/aw_nmi.c Sun Nov 19 03:14:10 2017 (r325991) @@ -57,6 +57,10 @@ __FBSDID("$FreeBSD$"); #define A31_NMI_IRQ_ENABLE_REG 0x34 #define NMI_IRQ_ENABLE (1U << 0) +#define R_NMI_IRQ_CTRL_REG 0x0c +#define R_NMI_IRQ_PENDING_REG 0x10 +#define R_NMI_IRQ_ENABLE_REG 0x40 + #define SC_NMI_READ(_sc, _reg) bus_read_4(_sc->res[0], _reg) #define SC_NMI_WRITE(_sc, _reg, _val) bus_write_4(_sc->res[0], _reg, _val) @@ -73,21 +77,43 @@ struct aw_nmi_intr { enum intr_trigger tri; }; +struct aw_nmi_reg_cfg { + uint8_t ctrl_reg; + uint8_t pending_reg; + uint8_t enable_reg; +}; + struct aw_nmi_softc { device_t dev; struct resource * res[2]; void * intrcookie; struct aw_nmi_intr intr; - uint8_t enable_reg; + struct aw_nmi_reg_cfg * cfg; }; -#define A20_NMI 1 -#define A31_NMI 2 +static struct aw_nmi_reg_cfg a20_nmi_cfg = { + .ctrl_reg = NMI_IRQ_CTRL_REG, + .pending_reg = NMI_IRQ_PENDING_REG, + .enable_reg = A20_NMI_IRQ_ENABLE_REG, +}; -static struct ofw_compat_data compat_data[] = { - {"allwinner,sun7i-a20-sc-nmi", A20_NMI}, - {"allwinner,sun6i-a31-sc-nmi", A31_NMI}, +static struct aw_nmi_reg_cfg a31_nmi_cfg = { + .ctrl_reg = NMI_IRQ_CTRL_REG, + .pending_reg = NMI_IRQ_PENDING_REG, + .enable_reg = A31_NMI_IRQ_ENABLE_REG, +}; +static struct aw_nmi_reg_cfg a83t_r_nmi_cfg = { + .ctrl_reg = R_NMI_IRQ_CTRL_REG, + .pending_reg = R_NMI_IRQ_PENDING_REG, + .enable_reg = R_NMI_IRQ_ENABLE_REG, +}; + +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun7i-a20-sc-nmi", (uintptr_t)&a20_nmi_cfg}, + {"allwinner,sun6i-a31-sc-nmi", (uintptr_t)&a31_nmi_cfg}, + {"allwinner,sun6i-a31-r-intc", (uintptr_t)&a83t_r_nmi_cfg}, + {"allwinner,sun8i-a83t-r-intc", (uintptr_t)&a83t_r_nmi_cfg}, {NULL, 0}, }; @@ -98,13 +124,13 @@ aw_nmi_intr(void *arg) sc = arg; - if (SC_NMI_READ(sc, NMI_IRQ_PENDING_REG) == 0) { + if (SC_NMI_READ(sc, sc->cfg->pending_reg) == 0) { device_printf(sc->dev, "Spurious interrupt\n"); return (FILTER_HANDLED); } if (intr_isrc_dispatch(&sc->intr.isrc, curthread->td_intr_frame) != 0) { - SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE); device_printf(sc->dev, "Stray interrupt, NMI disabled\n"); } @@ -118,7 +144,7 @@ aw_nmi_enable_intr(device_t dev, struct intr_irqsrc *i sc = device_get_softc(dev); - SC_NMI_WRITE(sc, sc->enable_reg, NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, NMI_IRQ_ENABLE); } static void @@ -128,7 +154,7 @@ aw_nmi_disable_intr(device_t dev, struct intr_irqsrc * sc = device_get_softc(dev); - SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE); } static int @@ -254,7 +280,7 @@ aw_nmi_setup_intr(device_t dev, struct intr_irqsrc *is icfg = NMI_IRQ_LOW_EDGE; } - SC_NMI_WRITE(sc, NMI_IRQ_CTRL_REG, icfg); + SC_NMI_WRITE(sc, sc->cfg->ctrl_reg, icfg); return (0); } @@ -271,7 +297,7 @@ aw_nmi_teardown_intr(device_t dev, struct intr_irqsrc sc->intr.pol = INTR_POLARITY_CONFORM; sc->intr.tri = INTR_TRIGGER_CONFORM; - SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE); } return (0); @@ -284,7 +310,7 @@ aw_nmi_pre_ithread(device_t dev, struct intr_irqsrc *i sc = device_get_softc(dev); aw_nmi_disable_intr(dev, isrc); - SC_NMI_WRITE(sc, NMI_IRQ_PENDING_REG, NMI_IRQ_ACK); + SC_NMI_WRITE(sc, sc->cfg->pending_reg, NMI_IRQ_ACK); } static void @@ -303,7 +329,7 @@ aw_nmi_post_filter(device_t dev, struct intr_irqsrc *i sc = device_get_softc(dev); arm_irq_memory_barrier(0); - SC_NMI_WRITE(sc, NMI_IRQ_PENDING_REG, NMI_IRQ_ACK); + SC_NMI_WRITE(sc, sc->cfg->pending_reg, NMI_IRQ_ACK); } static int @@ -327,6 +353,8 @@ aw_nmi_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + sc->cfg = (struct aw_nmi_reg_cfg *) + ofw_bus_search_compatible(dev, compat_data)->ocd_data; if (bus_alloc_resources(dev, aw_nmi_res_spec, sc->res) != 0) { device_printf(dev, "can't allocate device resources\n"); @@ -339,18 +367,9 @@ aw_nmi_attach(device_t dev) return (ENXIO); } - switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { - case A20_NMI: - sc->enable_reg = A20_NMI_IRQ_ENABLE_REG; - break; - case A31_NMI: - sc->enable_reg = A31_NMI_IRQ_ENABLE_REG; - break; - } - /* Disable and clear interrupts */ - SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); - SC_NMI_WRITE(sc, NMI_IRQ_PENDING_REG, NMI_IRQ_ACK); + SC_NMI_WRITE(sc, sc->cfg->enable_reg, !NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, sc->cfg->pending_reg, NMI_IRQ_ACK); xref = OF_xref_from_node(ofw_bus_get_node(dev)); /* Register our isrc */ From owner-svn-src-head@freebsd.org Sun Nov 19 03:51: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 6F588DEA0B5; Sun, 19 Nov 2017 03:51:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C48A69C3F; Sun, 19 Nov 2017 03:51:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAJ3plWU004967; Sun, 19 Nov 2017 03:51:47 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJ3plK3004966; Sun, 19 Nov 2017 03:51:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711190351.vAJ3plK3004966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 19 Nov 2017 03:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325993 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 325993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 03:51:48 -0000 Author: delphij Date: Sun Nov 19 03:51:47 2017 New Revision: 325993 URL: https://svnweb.freebsd.org/changeset/base/325993 Log: Remove unused header. Modified: head/sys/fs/tmpfs/tmpfs_fifoops.c Modified: head/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_fifoops.c Sun Nov 19 03:18:29 2017 (r325992) +++ head/sys/fs/tmpfs/tmpfs_fifoops.c Sun Nov 19 03:51:47 2017 (r325993) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include From owner-svn-src-head@freebsd.org Sun Nov 19 03:52: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 212B4DEA0C1; Sun, 19 Nov 2017 03:52:05 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E140269D3A; Sun, 19 Nov 2017 03:52:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAJ3q48M005027; Sun, 19 Nov 2017 03:52:04 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJ3q4UO005026; Sun, 19 Nov 2017 03:52:04 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711190352.vAJ3q4UO005026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 19 Nov 2017 03:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325994 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 325994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 03:52:05 -0000 Author: delphij Date: Sun Nov 19 03:52:03 2017 New Revision: 325994 URL: https://svnweb.freebsd.org/changeset/base/325994 Log: Remove unused header. Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c Modified: head/sys/fs/nfsclient/nfs_clnfsiod.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnfsiod.c Sun Nov 19 03:51:47 2017 (r325993) +++ head/sys/fs/nfsclient/nfs_clnfsiod.c Sun Nov 19 03:52:03 2017 (r325994) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-head@freebsd.org Sun Nov 19 09:07:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBEE2DF0136; Sun, 19 Nov 2017 09:07:25 +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 9320470FFA; Sun, 19 Nov 2017 09:07:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 6388B3CA37D; Sun, 19 Nov 2017 20:07:16 +1100 (AEDT) Date: Sun, 19 Nov 2017 20:07:08 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325988 - head/sys/libkern In-Reply-To: <201711190031.vAJ0VE9m016670@repo.freebsd.org> Message-ID: <20171119173822.J974@besplex.bde.org> References: <201711190031.vAJ0VE9m016670@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cK6QihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=80m6lczO4wBwIgPAK6UA:9 a=Ccn6Gyzn9UGJyg3Y:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 09:07:26 -0000 On Sun, 19 Nov 2017, Ed Maste wrote: > Log: > ANSIfy sys/libkern > > PR: 223641 > Submitted by: ota@j.email.ne.jp > MFC after: 1 week This churns libkern further away from its "vendor" version which is mostly in libc. I'm still waiting for you to back out previous churning of kern/md4.c involving "ANSI"fication. > Modified: head/sys/libkern/ashrdi3.c The vendor version is in libc/quad. It hasn't been ANSIfied. It ws identical with the libkern version except for changing the include path to quad.h and a more gratuitous difference to remove sccsid. The last 2 differences are in most files in libkern and this will not be described again. > Modified: head/sys/libkern/bcmp.c The vendor version is in libc/string. It has been ANSIfied, but the libkern version has large churning to "optimize" it. It is the libkern version that should have been optimized, since bcmp is unimportant in the kernel and in most applications, but applications have a wider range so a few might benefit from optimizing it. bcmp is actually optimized in the kernel in support.[sS] for all arches except powerpc and riscv, so optimizing the kernel MI version of it is especially unimportant. In libc where MD optimizations are more important, they are also not done for arm, arm64 and sparc64. libc bcmp uses simple bytewise comparison. libkern bcmp was optimized in 1999. The optimizations are only for little endian, so they only apply to 3/4 of the arches that don't have an MD version (to riscv but not the big endian part of powerpc). The optimizations are to compare longwords, and this requires complications for endianness. > Modified: head/sys/libkern/bsearch.c The vendor version is in libc/stdlib. It has been ANSIfied. It has an extra entry point for bsearch_b() and some macros for this. It has the following gratuitous differences: - libc version copyright comment not marked for indent protection using "/*-" (this has been subverted to have another meaning which I forget). - correct non-difference: libc rccsid not removed. It is ifdefed with LIBC_SCCSID so it has no effect in the kernel, so removing it in other places in libkern was churning. - missing blank line near ids in both and differences in #include's confuse diff -u into showing identical lines as changed. libc/stdlib sources mostly have the style bug of not separating the sccsid from _FBSDID(). - COMPAR() macro only used in libc. It is needed for bsearch_b() there, but is only used once so the macro for it is just an obfuscation. heapsort.c uses the same macro bt defines its own version with many more style bugs and uses it 4 times so it is needed there. - COMPAR() only has the style bug of not having an explicit '*' before its function pointer dereference in libc - only the libkern version has not so proper const poisoning for the assignment to 'base'. At least it doesn't use __DECONST(). - only the libkern version has proper const poisoning for the assignment to 'base' The kernel needs const poisoning more since it is compiled at higher warning levels, but -Wcast-qual is too strict in the kernel too so is usually (?) not enabled and/or is broken in clang. > Modified: head/sys/libkern/cmpdi2.c > ... > Modified: head/sys/libkern/divdi3.c > ... > Modified: head/sys/libkern/lshrdi3.c Like ashrdi3.c (not ANSIfied in libc/quad). > Modified: head/sys/libkern/mcount.c > ============================================================================== > --- head/sys/libkern/mcount.c Sat Nov 18 21:39:54 2017 (r325987) > +++ head/sys/libkern/mcount.c Sun Nov 19 00:31:13 2017 (r325988) > @@ -56,8 +56,7 @@ __FBSDID("$FreeBSD$"); > * both frompcindex and frompc. Any reasonable, modern compiler will > * perform this optimization. > */ > -_MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */ > - uintfptr_t frompc, selfpc; > +_MCOUNT_DECL(uintfptr_t frompc, uintfptr_t selfpc) /* _mcount; may be static, inline, etc */ The vendor version is in libc/gmon. The above declaration was already correctly ANSIfied in libc/gmon. This unimproves the style by keeping the comment misplaced at the right of the code where it is a larger style bug than before -- not the line is too long. ANSIfication in libc/gmon put it on a separate line. > @@ -245,8 +244,7 @@ MCOUNT > > #ifdef GUPROF > void > -mexitcount(selfpc) > - uintfptr_t selfpc; > +mexitcount(uintfptr_t selfpc) > { > struct gmonparam *p; > uintfptr_t selfpcdiff; This isn't ANSIfied in libc/gmon. The file still isn't ANSIfied in libkern -- it still has many old-old-style function definitions near the end for functions taking no args. The libkern version has nontrivial extensions for the kernel, and a couple of gratuitous differences in common code. I use a merged version in some trees. libc should support high resolution profiling too, but still doesn't even support wide counters for ordinary profiling (its 16-bit counters were not wide enough 30 years ago. They now overflow in 8 seconds with profhz = 8192, and profhz = 8192 was not high enough 20 years ago). > Modified: head/sys/libkern/moddi3.c Like ashrdi3.c (not ANSIfied in libc/quad). > Modified: head/sys/libkern/qdivrem.c Like ashrdi3.c (not ANSIfied in libc/quad), plus: - only libkern has renamed shl to __shl. This is a static function so doesn't need renaming except to simplify debugging, and changing it is less needed where it is changed. - only libkern has renamed one variable named n to nn. 'n' is a local variable with a style bug (nested declaration) to give the larger style bug of shadowing it > Modified: head/sys/libkern/random.c The vendor version is in libc/stdlib. The vendor version is very different -- libkern still uses the 1998 ACM LCG without even the fixes for that in libc. The libc version has always been obfuscated by ifdefs and by being in both rand.c and random.c. Together with a worse comment style in libc, this makes diffs unreadable. Actually, the worst of the ifdefs has been removed in libc. It was USE_WEAK_SEEDING for an even worse LCG. libkern never used that. libc random.c has been fully ANSIfied, but libkern random.c still uses random() instead of random(void) and libc/stdlib/rand.c still uses main(). > Modified: head/sys/libkern/scanc.c There is no vendor version for this. > Modified: head/sys/libkern/strcmp.c The vendor version is in libc/string. It has been ANSIfied, but the commit that did that also made another style fix. This change catches up with half of the older change. > Modified: head/sys/libkern/strlcat.c The vendor version is in libc/string. It has been ANSIfied, and also C99ified (add 'restrict' -- the kernel mostly hasn't been C99ified yet, and is missing 'restrict' in most places). It has many other differences, apparently from updating only it to the NetBSD version in 2015: - large change to copyright from BSD to Miller (no clauses 1, 2 or 3, and reformat lots) - remove rccsid only in libc - longer variable names - other changes hard to see due to renaming. > Modified: head/sys/libkern/strsep.c The vendor version is in libc/string. It has been ANSIfied. This is about the only file changed in this commit that doesn't have any gratuitous differences after the change. > Modified: head/sys/libkern/strtol.c The vendor version is in libc/stdio. The libkern version is missing several fixes: - special error handling for invalid bases - fix overflow bugs (?) in overflow checks - support 'restrict' and is missing several regressions: - lossage in copyright - fix const poisoning using __DECONST() - uglier locale stuff. > Modified: head/sys/libkern/strtoul.c The vendor version is in libc/stdio. Like strtol.c except fewer fixes and more regressions: - also lose indent protection in copyright and "From" near copyright - overflow check was correct, but remove bogus casts in it. > Modified: head/sys/libkern/ucmpdi2.c Like ashrdi3.c (not ANSIfied in libc/quad), plus __ARM_EABI__ support misplaced in this previously MI file, and lexical style bugs in this support. > Modified: head/sys/libkern/udivdi3.c > ... > Modified: head/sys/libkern/umoddi3.c Like ashrdi3.c (not ANSIfied in libc/quad). All of these files were ANSI conformant with fill prototypes in 1995 if not in 1993. Many files aren't C99 conformant since they are missing 'restrict'. I consider this a feature. It reduces churning. Full "ANSI"fication would also use const a lot to increase churning. I don't know the exact rules for 'restrict', but it is apparently OK to only declare functions as 'restrict' in their prototype and omit this in their function definition. The function definition clearly doesn't need 'restrict' or even 'const' for the compiler to see what it does and check this against the prototype, but it is an obfuscation to use different qualifiers even if the standard allows this. memcpy() in libc is an example -- it doesn't use 'restrict' in the implementation. memcpy() in the kernel doesn't even have 'restrict' in the prototype, and this is not wrong except for compiler bugs involving using builtin memcpy(), since the kernel is freestanding so its memcpy() doesn't have to be standard. But the freestanding case should be even more careful about qualifiers for "standard" functions since the compiler shouldn't know anything about the functions that is not in the prototype. Bruce From owner-svn-src-head@freebsd.org Sun Nov 19 09:51: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 B85BBDF09D4; Sun, 19 Nov 2017 09:51:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 6F921721BB; Sun, 19 Nov 2017 09:51:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id EDFB8D6314A; Sun, 19 Nov 2017 20:21:10 +1100 (AEDT) Date: Sun, 19 Nov 2017 20:21:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni cc: Stefan Esser , rgrimes@freebsd.org, "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers , Warner Losh , "O. Hartmann" Subject: Re: svn commit: r325954 - in head: . share/mk sys/conf usr.sbin/config In-Reply-To: <75597b23-7a8c-34ad-736b-8d68ce7dea06@FreeBSD.org> Message-ID: <20171119200731.U974@besplex.bde.org> References: <201711180134.vAI1Y2ks064138@pdx.rh.CN85.dnsmgr.net> <29499AF9-FC0A-4CDA-9657-B092B3F9A0D0@FreeBSD.org> <04747a89-4dc7-a476-dc32-a158ee1f5240@freebsd.org> <75597b23-7a8c-34ad-736b-8d68ce7dea06@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=VwQbUJbxAAAA:8 a=x4kcjblwntydQM_CTLwA:9 a=CjuIK1q_8ugA:10 a=pXTjMIipiugA:10 a=AjGcO6oz07-iQ99wixmX:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 09:51:32 -0000 On Sat, 18 Nov 2017, Pedro Giffuni wrote: > On 11/18/17 09:15, Stefan Esser wrote: >>> >>> OTOH, we should probably consider other tools, like sparse: >>> >>> https://sparse.wiki.kernel.org/index.php/Main_Page >>> The license is fine and it plays nice with the compiler. >> It builds on -CURRENT, but the Makefile needs some tweaks (it does >> not find LLVM or Gtk+-2.0, even though they are present on my system). >> >> I'll work on a port over the weekend ... > > Thanks! > For it to be really useful we still would have to add annotations to the > kernel headers. Not just kernel headers, but also user headers and applications. Ugh, it is the annotations that are the main cost of supporting lint (or any other checker that needs some). Bruce From owner-svn-src-head@freebsd.org Sun Nov 19 10:05: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 C1BD5DF0F0E; Sun, 19 Nov 2017 10:05:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 856977287A; Sun, 19 Nov 2017 10:05:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 79335D69D98; Sun, 19 Nov 2017 21:05:42 +1100 (AEDT) Date: Sun, 19 Nov 2017 21:05:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: Bruce Evans , "Rodney W. Grimes" , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r325954 - in head: . share/mk sys/conf usr.sbin/config In-Reply-To: Message-ID: <20171119202123.I974@besplex.bde.org> References: <201711180134.vAI1Y2ks064138@pdx.rh.CN85.dnsmgr.net> <20171118190422.V949@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=t8Cu4Vj2PK0HrKrpQfMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 10:05:44 -0000 On Sat, 18 Nov 2017, Warner Losh wrote: > On Sat, Nov 18, 2017 at 3:42 AM, Bruce Evans wrote: > >> since it flags all c99 and newer usages as syntax errors. We've been >>>>> >>>> >> This shouldn't break use of lint on K&R or C90 sources. But types.h is >> broken. It no longer supports K&R, C90, or most other things that are >> supposed to be controlled by the visibility ifdefs in it. > > Thanks for this insightful analysis. I've clipped the rest of it, which is > more of the same. It can't support the new C compiler construct, and we've > managed to break the old ones. Plus it gives lots of warnings that aren't Lint is just the messenger (until its annotations like NOTREACHED are also removed). It can support old C compiler constructs like it used to, including pre-standard ones that new C compilers/checks might not support. > useful and doesn't understand several of the idioms we've started using > heavily in the kernel (such as forward struct declaration). Since many of > these problems are in the system kernel headers, the break all non-trivial > uses of lint. > > None of these things are ever going to be fixed. It's quite likely the We are never going to fix feature test macros like _POSIX_SOURCE? Then removing support for them would give much simpler sources. > kernel will never again compile on anything older than a c99 compiler. > While we have a lot of ifdefs to attempt to support older compilers, it's > almost all certainly bit-rotted from lack of use. The headers and libraries (non-source parts) should not be limited by the language used to compile the kernel. Pascal is not supported, but old variants of C require only a small amount of code relative to new variants, so should remain supported. Kernels don't actually compile with a C99 compiler. They need -std=gnu99 plus lots of underscores to use extensions. The kernel is misconfigured with -std=isomumble:1999 -fms-extensions and only compiles because this doesn't give strict C99 (+ ms extensions but no gnu extensions). Userland is configured correctly with -std=gnu99. Bruce From owner-svn-src-head@freebsd.org Sun Nov 19 11: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 090D9DF2321; Sun, 19 Nov 2017 11:21:18 +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 C196674528; Sun, 19 Nov 2017 11:21:17 +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 vAJBLGjt015449; Sun, 19 Nov 2017 11:21:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJBLGiE015448; Sun, 19 Nov 2017 11:21:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711191121.vAJBLGiE015448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Nov 2017 11:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325995 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 325995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 11:21:18 -0000 Author: kib Date: Sun Nov 19 11:21:16 2017 New Revision: 325995 URL: https://svnweb.freebsd.org/changeset/base/325995 Log: Fix build. Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if_fddisubr.c Modified: head/sys/net/if_fddisubr.c ============================================================================== --- head/sys/net/if_fddisubr.c Sun Nov 19 03:52:03 2017 (r325994) +++ head/sys/net/if_fddisubr.c Sun Nov 19 11:21:16 2017 (r325995) @@ -1,6 +1,6 @@ +/*- * SPDX-License-Identifier: BSD-4-Clause * -/*- * Copyright (c) 1995, 1996 * Matt Thomas . All rights reserved. * Copyright (c) 1982, 1989, 1993 From owner-svn-src-head@freebsd.org Sun Nov 19 11:33: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 EA51BDF27D5; Sun, 19 Nov 2017 11:33:47 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B3E2A74E03; Sun, 19 Nov 2017 11:33:47 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAJBXkVQ020890; Sun, 19 Nov 2017 11:33:46 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJBXkVO020889; Sun, 19 Nov 2017 11:33:46 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201711191133.vAJBXkVO020889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Sun, 19 Nov 2017 11:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r325997 - in head/stand: fdt/dts libstand32 userboot/ficl userboot/libstand userboot/zfs X-SVN-Group: head X-SVN-Commit-Author: nyan X-SVN-Commit-Paths: in head/stand: fdt/dts libstand32 userboot/ficl userboot/libstand userboot/zfs X-SVN-Commit-Revision: 325997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 11:33:48 -0000 Author: nyan Date: Sun Nov 19 11:33:46 2017 New Revision: 325997 URL: https://svnweb.freebsd.org/changeset/base/325997 Log: Remove empty directories. Deleted: head/stand/fdt/dts/ head/stand/libstand32/ head/stand/userboot/ficl/ head/stand/userboot/libstand/ head/stand/userboot/zfs/ From owner-svn-src-head@freebsd.org Sun Nov 19 12:12:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A78E4DF3C3B; Sun, 19 Nov 2017 12:12:50 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45AC57640A; Sun, 19 Nov 2017 12:12:50 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id g130so3222757wme.0; Sun, 19 Nov 2017 04:12:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=VbLKUPYzHFI1C3ZS7+HulQfVoMs/e7oVk0aZ0h+ggf0=; b=NL710Dhrid2wuD3vJ5P+lKoU/ix/IG5G7E0CMIv0yN9Jlj8L8DV9t2cLLA5p0E7LAZ nD185HaG5SRCZ4SLYOcNpG2g2yju1EKsPuJF8VfirtSiUQJmBqR1kbjVXrcxuMSZwY0o QahVY5AdJDH9W+gPeD7SppwvtHxmxjXMYgbPaPF2aHTr5eqDKWEj0D1VxyRjztBYASzQ wviDYX5Vv99S+hu3/sohQlMB/HyorlvXitgI7IdWjJdKOEZdCQ9PEragoo49tnA210lk wgQwCHIK4x3ynD/1UorQhSg46I8UgwGr+qLWDzSPje6v6ZymzlYGEFtNAMHbe/N2hZ3f MnFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=VbLKUPYzHFI1C3ZS7+HulQfVoMs/e7oVk0aZ0h+ggf0=; b=EzTVWUSa5KakrzTRKpSCw4WtVyaGU3ZkEG0aRY40dq5hd36VFXT8MSF/PBbp42EDtH QjB9VBHv1cQPvHcwVmo96qC9qrQTKZh4wScpbEJioj48OtMmZmjJbHQng8b+f2qL5OnN wEqyC8G9hNWELdPN8GP5y93iUMSvW8khkoMXR2IqMONVdCMXeSjZ0teAetH9j5kS4yq9 9DlHT2IlP1/zf0Qgyjy+Od+a7FcCp0hSfd02lCjgHiH5vtDgCW0i2AvaHj3sWiJRgsw+ ogNcc5Wa2NREAqnCICcHaQgGlYEWHxK5Z5TAHGmBzp8ekYCFkswnrQDu2Tb1b282BF0J ESag== X-Gm-Message-State: AJaThX7FZDjX4AEqwhsfPoQmfLy81IZLG22NKVSzMYWsYjmMSGD1tI3M uEAKvU3HDTTxKmx1S6h+PO0B8Q== X-Google-Smtp-Source: AGs4zMbPoshvwdm7jVCZxoWnu5l4KlLcaialyIFSFixnQBWqoX9rKFGNLMPiXQ/5ENfPPLMBT3ygYQ== X-Received: by 10.28.48.143 with SMTP id w137mr8302349wmw.3.1511093568775; Sun, 19 Nov 2017 04:12:48 -0800 (PST) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id y2sm3657744wrd.3.2017.11.19.04.12.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Nov 2017 04:12:47 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sun, 19 Nov 2017 12:12:45 +0000 From: Edward Tomasz Napierala To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325965 - head/libexec/rtld-elf Message-ID: <20171119121245.GA88868@brick> Mail-Followup-To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711181321.vAIDLM6S028725@repo.freebsd.org> <20171118141007.GI2272@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171118141007.GI2272@kib.kiev.ua> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 12:12:50 -0000 On 1118T1610, Konstantin Belousov wrote: > On Sat, Nov 18, 2017 at 01:21:22PM +0000, Edward Tomasz Napierala wrote: > > Author: trasz > > Date: Sat Nov 18 13:21:22 2017 > > New Revision: 325965 > > URL: https://svnweb.freebsd.org/changeset/base/325965 > > > > Log: > > Increase rtld initial memory pool size from 32kB to 128kB. > > > > The old value was probably fine back in 1998, when that code was imported > > (although the comments still mention VAX, which was quite obsolete by then); > > now, however, it's too small to handle our libc, which results in some > > additional calls to munmap/mmap later on. Asking for more virtual address > > space is virtually free, and syscalls are not, thus the change. > > > > It was suggested by kib@ that this might be a symptom of a deeper problem. > > It doesn't only affect libc, though - the change also improves rtld memory > > management for eg KDE libraries. I guess it's just a natural bloat. > This is not what I said. > > My guess was that the large allocation you see in the ktrace output as > coming from rtld was really an allocation of the TLS segment, and it was > so large because libc has that large TLS segment. You did not checked this > guess against the actual code. Right, I stand corrected. > If my guess is true, I do not see a point in the change you made: the > memory consumption is externally imposed on rtld, and we should not try > to tailor it to single, whenever important, consumer. Here's where I disagree. The rtld is not some abstract concept, it's one of the components of the operating system, and it can and should be tweaked to match real life situations. Especially when it affects virtually all of its use cases, as is the case with libc. From owner-svn-src-head@freebsd.org Sun Nov 19 15:29: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 6EEF9D94A52 for ; Sun, 19 Nov 2017 15:29:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic313-24.consmr.mail.ne1.yahoo.com (sonic313-24.consmr.mail.ne1.yahoo.com [66.163.185.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 317007C7EC for ; Sun, 19 Nov 2017 15:29:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1511105366; bh=y1gZ5L6twbFN1EfXshf8uQ1AWzJKdN4hBCRYyb45R+0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=Zu3+kcO678n+LnApiLHoc2MaQxhO7hZiih8CiY2/ituCgAyH11NBeq3iDRGLQjmgD2hF44PuAL8Wn9o6uUKO22TobSzWKu0Yv0wRW9X9IyJBJxU3emVTV9CmmM8Tanu5/GAnsr64KOY/sUJR1iqc9Zbs2pEi31aQOefX0yaR3NYM6UGB6fAdhJeoDKbX8/sXstv78hUrkLPzmR1s77jwuB+31n5b7ZGe7wa3zosAA8iEGR8CAGkZc29d3KObpcoaf23musMSOLSS7+HeavPgY0feQiK1AAdtbWqECJIt5J1gqxw7DDmSFDhQz9riCEYRaGCn7AmDT7lMdAMQCIGE2g== X-YMail-OSG: oq9vNaAVM1l5RxVeGRBFun37MlVjaHJn33LMo258nWG6vdyW3Iz2EzUAjwaGw5l ucc801deJZb9v16me79Jls442lVq3wiYzDxx2ymti0MK8PLmkgDPbA.sEM8rUvTGXXzsAwFwXxEn JIAsFD5rFrw3kBrWCdYRPoNs5FrmLTPD6wqXqlMqSZk7ohhfOd7QozBGdXURVRYkr3ZhUPmS5cxU klYb6STq1AQ8ZdWHfMmnt9CwQu35WV3WzafTwGoxQvyJSoe_2dd5aNqlhL3p_MtqR7SF7g3f9U76 e4izZvu2LzxFdI._VuW2Q9ix7UBMGCEvPQi2czCF3KQPCSAgUkyN4fKQzKQFkdddN87FB5Lg_NKi .Dl1RJktTyB7K2u2MJjyiDDnzbwTKss_hX53ohbHTm0mLjvV.73yVkZLe0_cMjKmcqXOXNx1D7BC wV7HaepnOiqixDN9G1cLeEDvf0jFkQVEfmoV6DfM_j8E5HX8KlzGGV8SozlnvMW3oytbaqmrbdzA ZLLaCEB3uz5ErH5aoHnseOnurXQYu4iD0RaZtWKVc4yXFrA-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 Nov 2017 15:29:26 +0000 Received: from [127.0.0.1] by smtp209.mail.ne1.yahoo.com with NNFMP; 19 Nov 2017 15:29:21 -0000 X-Yahoo-Newman-Id: 178688.53340.bm@smtp209.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: oq9vNaAVM1l5RxVeGRBFun37MlVjaHJn33LMo258nWG6vdy W3Iz2EzUAjwaGw5lucc801deJZb9v16me79Jls442lVq3wiYzDxx2ymti0MK 8PLmkgDPbA.sEM8rUvTGXXzsAwFwXxEnJIAsFD5rFrw3kBrWCdYRPoNs5Frm LTPD6wqXqlMqSZk7ohhfOd7QozBGdXURVRYkr3ZhUPmS5cxUklYb6STq1AQ8 ZdWHfMmnt9CwQu35WV3WzafTwGoxQvyJSoe_2dd5aNqlhL3p_MtqR7SF7g3f 9U76e4izZvu2LzxFdI._VuW2Q9ix7UBMGCEvPQi2czCF3KQPCSAgUkyN4fKQ zKQFkdddN87FB5Lg_NKi.Dl1RJktTyB7K2u2MJjyiDDnzbwTKss_hX53ohbH Tm0mLjvV.73yVkZLe0_cMjKmcqXOXNx1D7BCwV7HaepnOiqixDN9G1cLeEDv f0jFkQVEfmoV6DfM_j8E5HX8KlzGGV8SozlnvMW3oytbaqmrbdzAZLLaCEB3 uz5ErH5aoHnseOnurXQYu4iD0RaZtWKVc4yXFrA-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r325954 - in head: . share/mk sys/conf usr.sbin/config To: Bruce Evans , Warner Losh Cc: "Rodney W. Grimes" , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201711180134.vAI1Y2ks064138@pdx.rh.CN85.dnsmgr.net> <20171118190422.V949@besplex.bde.org> <20171119202123.I974@besplex.bde.org> From: Pedro Giffuni Message-ID: Date: Sun, 19 Nov 2017 10:29:20 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171119202123.I974@besplex.bde.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 15:29:33 -0000 On 11/19/17 05:05, Bruce Evans wrote: > On Sat, 18 Nov 2017, Warner Losh wrote: > >> On Sat, Nov 18, 2017 at 3:42 AM, Bruce Evans >> wrote: >> >>> since it flags all c99 and newer usages as syntax errors. We've been >>>>>> >>>>> >>> This shouldn't break use of lint on K&R or C90 sources. But types.h is >>> broken.  It no longer supports K&R, C90, or most other things that are >>> supposed to be controlled by the visibility ifdefs in it. >> >> Thanks for this insightful analysis. I've clipped the rest of it, >> which is >> more of the same. It can't support the new C compiler construct, and >> we've >> managed to break the old ones. Plus it gives lots of warnings that >> aren't > > Lint is just the messenger (until its annotations like NOTREACHED are > also > removed).  It can support old C compiler constructs like it used to, > including pre-standard ones that new C compilers/checks might not > support. > FWIW, I don't think we should remove the LINT annotations: they are recognized by Coverity. I don't see us adding them in new code but removing them would trigger a bunch of false positives in Coverity. >> useful and doesn't understand several of the idioms we've started using >> heavily in the kernel (such as forward struct declaration). Since >> many of >> these problems are in the system kernel headers, the break all >> non-trivial >> uses of lint. >> >> None of these things are ever going to be fixed. It's quite likely the > > We are never going to fix feature test macros like _POSIX_SOURCE? Then > removing support for them would give much simpler sources. > I think the point here is that having xlint was never a step towards fixing such issues. It was also poorly maintained: I recall being the last one to look at merging changes from NetBSD, so I know how bad it was. It would be nice to have a replacement, but a quick look doesn't show anything interesting. Solaris/illumos has a lint utility but I am not sure the illumos guys find that too useful either. I guess it would be useful for upstreaming stuff to openZFS though so a port is welcome. >> kernel will never again compile on anything older than a c99 compiler. >> While we have a lot of ifdefs to attempt to support older compilers, >> it's >> almost all certainly bit-rotted from lack of use. > > The headers and libraries (non-source parts) should not be limited by the > language used to compile the kernel.  Pascal is not supported, but old > variants of C require only a small amount of code relative to new > variants, > so should remain supported. > > Kernels don't actually compile with a C99 compiler.  They need -std=gnu99 > plus lots of underscores to use extensions.  The kernel is misconfigured > with -std=isomumble:1999 -fms-extensions and only compiles because this > doesn't give strict C99 (+ ms extensions but no gnu extensions). Userland > is configured correctly with -std=gnu99. > This brings back the older discussion about being realistic and deprecating older compilers that no one uses any more. Yes, we should avoid breaking existing stuff (however old) in ports but no one is expecting to build modern FreeBSD with gcc 3.4 or even gcc 4.1. We did what we could with gcc 4.2.1 but it's time is also over. All IMHO, of course. Pedro. From owner-svn-src-head@freebsd.org Sun Nov 19 15:40: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 C87F4D94F93 for ; Sun, 19 Nov 2017 15:40:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic313-24.consmr.mail.ne1.yahoo.com (sonic313-24.consmr.mail.ne1.yahoo.com [66.163.185.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9827F7CD7A for ; Sun, 19 Nov 2017 15:40:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1511106029; bh=gCqw5J3CwwGg3tOmT3faTondRnukpL9pbOfd/uiFnus=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=EC/kQhiYYhvvfjraCql++MCIG0fKS+KGF+M3h3G5OrVlZIn9lFwtbym6t8axuoWIj554Ih39vynyBiAP3cUvZ83jeOEAw112kCJ4aOMrHnpuMusUjXz5aFN5ADbhQDQDAh4gIBPEnShf32l2pwv9dr+M7CDZFk23QoogANHHuDEU5oK4Ga0MZp5tNnpDr/iAQrR0wUi0eBPOBn+O1+U9UFV6EKNExCTLe0iqB7suHSonP4ZjEEvGS+hZQFroU0xFrUdCE3w69BgSEZLdwqDwKF2eRUhvGNfQobvq8l+Z/QMoDn1EevnJQWvuStRwR3aw1mclBW0lH9YW2wXQ8N2M+A== X-YMail-OSG: dDDqrwMVM1lPkwZXulRB9koN8H.TiwxbN71COUb_t74.SnXkUKpqreGlXW8UjKn ChxgGXEwFSeDWj2yHnYKoCqWJRyz_O8tIc.k4rnVdYpVOaHQfpY92kLjZNEw0tPXngPaXadqzNrM 10gAFaHBIWCusRIFkVzDeuwDJf4_ximQlxt9eqdKNj1nS2Ea8a0MZRMeRPjxw1YP6iE1eTly4U3X nH.ISFvCWJxVKFfIrNxky5sBy4gqQ6VG05uSl7XhyjHpAqAfROUuMd.hbzZyHupLeTHV8VbNyGiS z_i3_coulOnvjr5bFGsXsxWH1Bu7A9nsJY1WVbny2geGYa0OIzzcBjO9iwZsxvW9O.7KBI8_BaCb 7DezgJdMHsmON5Ut2iOTYkeJ1yeVnvShawykPu6gSHLB7YX8LQDrGsTgS_u9tWTmJDJFwGaOFl_e s7BGopSZEJUaelcbfUnuPcGn80eWX3RFj8DfUPYpoZ67l7tNIwE8ONawtypcLhe1o9WlgNWhmTby V5JqIvQ1cf6QevUNDEQTwh70x3jGBZFVYhPpNK2eA Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 Nov 2017 15:40:29 +0000 Received: from [127.0.0.1] by smtp202.mail.ne1.yahoo.com with NNFMP; 19 Nov 2017 15:40:25 -0000 X-Yahoo-Newman-Id: 474714.97390.bm@smtp202.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: dDDqrwMVM1lPkwZXulRB9koN8H.TiwxbN71COUb_t74.SnX kUKpqreGlXW8UjKnChxgGXEwFSeDWj2yHnYKoCqWJRyz_O8tIc.k4rnVdYpV OaHQfpY92kLjZNEw0tPXngPaXadqzNrM10gAFaHBIWCusRIFkVzDeuwDJf4_ ximQlxt9eqdKNj1nS2Ea8a0MZRMeRPjxw1YP6iE1eTly4U3XnH.ISFvCWJxV KFfIrNxky5sBy4gqQ6VG05uSl7XhyjHpAqAfROUuMd.hbzZyHupLeTHV8VbN yGiSz_i3_coulOnvjr5bFGsXsxWH1Bu7A9nsJY1WVbny2geGYa0OIzzcBjO9 iwZsxvW9O.7KBI8_BaCb7DezgJdMHsmON5Ut2iOTYkeJ1yeVnvShawykPu6g SHLB7YX8LQDrGsTgS_u9tWTmJDJFwGaOFl_es7BGopSZEJUaelcbfUnuPcGn 80eWX3RFj8DfUPYpoZ67l7tNIwE8ONawtypcLhe1o9WlgNWhmTbyV5JqIvQ1 cf6QevUNDEQTwh70x3jGBZFVYhPpNK2eA X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r325965 - head/libexec/rtld-elf To: trasz@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711181321.vAIDLM6S028725@repo.freebsd.org> <20171118141007.GI2272@kib.kiev.ua> <20171119121245.GA88868@brick> From: Pedro Giffuni Message-ID: Date: Sun, 19 Nov 2017 10:40:24 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171119121245.GA88868@brick> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 15:40:30 -0000 On 11/19/17 07:12, Edward Tomasz Napierala wrote: > On 1118T1610, Konstantin Belousov wrote: >> On Sat, Nov 18, 2017 at 01:21:22PM +0000, Edward Tomasz Napierala wrote: >>> Author: trasz >>> Date: Sat Nov 18 13:21:22 2017 >>> New Revision: 325965 >>> URL: https://svnweb.freebsd.org/changeset/base/325965 >>> >>> Log: >>> Increase rtld initial memory pool size from 32kB to 128kB. >>> >>> The old value was probably fine back in 1998, when that code was imported >>> (although the comments still mention VAX, which was quite obsolete by then); >>> now, however, it's too small to handle our libc, which results in some >>> additional calls to munmap/mmap later on. Asking for more virtual address >>> space is virtually free, and syscalls are not, thus the change. >>> >>> It was suggested by kib@ that this might be a symptom of a deeper problem. >>> It doesn't only affect libc, though - the change also improves rtld memory >>> management for eg KDE libraries. I guess it's just a natural bloat. >> This is not what I said. >> >> My guess was that the large allocation you see in the ktrace output as >> coming from rtld was really an allocation of the TLS segment, and it was >> so large because libc has that large TLS segment. You did not checked this >> guess against the actual code. > Right, I stand corrected. > >> If my guess is true, I do not see a point in the change you made: the >> memory consumption is externally imposed on rtld, and we should not try >> to tailor it to single, whenever important, consumer. > Here's where I disagree. The rtld is not some abstract concept, it's one > of the components of the operating system, and it can and should be tweaked > to match real life situations. Especially when it affects virtually all > of its use cases, as is the case with libc. > > Being pragmatic ... Determining such values is almost always a trial-and-error process. Perhaps 64k is makes everyone (especially KDE) happy? Pedro. From owner-svn-src-head@freebsd.org Sun Nov 19 16:48: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 051A3DB93D9; Sun, 19 Nov 2017 16:48:57 +0000 (UTC) (envelope-from etnapierala@gmail.com) 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 87E957E824; Sun, 19 Nov 2017 16:48:56 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id 5so13396162wmk.1; Sun, 19 Nov 2017 08:48:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=1YkeN+p23nbdptuvHybnmTSqCTgV/W5/Dz1nbJARj/Q=; b=g6cYBsSWZ2mSP8mKOnZk5Mp38aHgd/hq92fPExqd+T0lfK2whEijQGpp+8IOjEabv/ d9BN9ctytMOj0GYvkm68Wea7Mp/EQhBQVqp7fzFcumEUfyz/GBurRNU10j5pF/fyRnDo 6mp28D6tfL7W066+Z2xlcL4HP/VmVaKKEUsXYbMN6+gdJrGjopmt+LmpdeAGdjVW0WxN zITih6iRE8HLjCEeUq2YKGywUHnBhG7pq30ZIl6gVfVUfqEdXzHbyNRDmHHDze5aYLZi 7l4Gk/DUnY38+dKjcA997Qa+P4LGg+Mzqr343JZ40Mg2Ak6JDE1Y49Uy3eIhv4J6TlPh o66A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=1YkeN+p23nbdptuvHybnmTSqCTgV/W5/Dz1nbJARj/Q=; b=TKXcqbRmS4S1D+NKLYUi9WSbg/BgiT24R0Vz8cdqM8e4yHQ4gxo+d8z6qCg3BEbb0B zzVZBQu2OFb/7HLyOifp/IrC7SU1ULE/7xCoSrvh0ssPb9u47nInxfCWwyQdnE1kLH2u QBZ3L6+kXg9KmFL2YwcHXxKOdnU2LV8Fg78jfL0pGzptoKgF9CR7dbs82FkWKKfDBks3 7LI4GQ5ixKjWvMqJ+awhKwIr/beBlvENL5DmIsFqvUx4/F1aAnEIjS1FqIWQv2VpboyT ddJ+D/LM80USK2ddTAn44t2flkXibhpBPFN3z/+Zze2yHR6ZMVTUNW2ZCTSpI585Qm0e w2LQ== X-Gm-Message-State: AJaThX4uJYnVtuQC6kiN9qcXxcpL5BLdG3pDwtL9eOHA2FqBcgl/rypO 4NIT5XgdMXJG4NAHv5CBriaL0g== X-Google-Smtp-Source: AGs4zMbGUjB1oRB+hUrmp8YZuWO5/yW0XUqFdH+xBdvV9c+aMHiSFTcnIjdJoSJOPu/ot/jUthB79Q== X-Received: by 10.28.126.14 with SMTP id z14mr7469017wmc.121.1511110134543; Sun, 19 Nov 2017 08:48:54 -0800 (PST) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id b47sm1217999wra.94.2017.11.19.08.48.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Nov 2017 08:48:53 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sun, 19 Nov 2017 16:48:51 +0000 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Pedro Giffuni Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325965 - head/libexec/rtld-elf Message-ID: <20171119164851.GA89581@brick> Mail-Followup-To: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711181321.vAIDLM6S028725@repo.freebsd.org> <20171118141007.GI2272@kib.kiev.ua> <20171119121245.GA88868@brick> 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.25 Precedence: list List-Id: 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, 19 Nov 2017 16:48:57 -0000 On 1119T1040, Pedro Giffuni wrote: > > > On 11/19/17 07:12, Edward Tomasz Napierala wrote: > > On 1118T1610, Konstantin Belousov wrote: > >> On Sat, Nov 18, 2017 at 01:21:22PM +0000, Edward Tomasz Napierala wrote: > >>> Author: trasz > >>> Date: Sat Nov 18 13:21:22 2017 > >>> New Revision: 325965 > >>> URL: https://svnweb.freebsd.org/changeset/base/325965 > >>> > >>> Log: > >>> Increase rtld initial memory pool size from 32kB to 128kB. > >>> > >>> The old value was probably fine back in 1998, when that code was imported > >>> (although the comments still mention VAX, which was quite obsolete by then); > >>> now, however, it's too small to handle our libc, which results in some > >>> additional calls to munmap/mmap later on. Asking for more virtual address > >>> space is virtually free, and syscalls are not, thus the change. > >>> > >>> It was suggested by kib@ that this might be a symptom of a deeper problem. > >>> It doesn't only affect libc, though - the change also improves rtld memory > >>> management for eg KDE libraries. I guess it's just a natural bloat. > >> This is not what I said. > >> > >> My guess was that the large allocation you see in the ktrace output as > >> coming from rtld was really an allocation of the TLS segment, and it was > >> so large because libc has that large TLS segment. You did not checked this > >> guess against the actual code. > > Right, I stand corrected. > > > >> If my guess is true, I do not see a point in the change you made: the > >> memory consumption is externally imposed on rtld, and we should not try > >> to tailor it to single, whenever important, consumer. > > Here's where I disagree. The rtld is not some abstract concept, it's one > > of the components of the operating system, and it can and should be tweaked > > to match real life situations. Especially when it affects virtually all > > of its use cases, as is the case with libc. > > > > > > Being pragmatic ... > > Determining such values is almost always a trial-and-error process. > Perhaps 64k is makes everyone (especially KDE) happy? It was determined by trial and error. 128k is the smallest one that removes the need for addidional call to mmap on startup - not for KDE, but for every binary linked with libc, including true(1). Running kdeinit4 still results in a few such calls - although fewer than before (the value also affects the size of subsequent rtld allocations). From owner-svn-src-head@freebsd.org Sun Nov 19 20:13: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 93C66DBD8A6; Sun, 19 Nov 2017 20:13:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FDD4378A; Sun, 19 Nov 2017 20:13:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAJKDBVT037736; Sun, 19 Nov 2017 20:13:11 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJKDBbe037735; Sun, 19 Nov 2017 20:13:11 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201711192013.vAJKDBbe037735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 19 Nov 2017 20:13:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326000 - head/usr.sbin/wlandebug X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/usr.sbin/wlandebug X-SVN-Commit-Revision: 326000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 20:13:12 -0000 Author: avos Date: Sun Nov 19 20:13:11 2017 New Revision: 326000 URL: https://svnweb.freebsd.org/changeset/base/326000 Log: wlandebug(8): allow fallback to old behavior + improve name checks. - Treat passed interface name as original if ifconfig_get_orig_name() fails. - Reject interface name if it does not start from "wlan". Modified: head/usr.sbin/wlandebug/wlandebug.c Modified: head/usr.sbin/wlandebug/wlandebug.c ============================================================================== --- head/usr.sbin/wlandebug/wlandebug.c Sun Nov 19 12:36:03 2017 (r325999) +++ head/usr.sbin/wlandebug/wlandebug.c Sun Nov 19 20:13:11 2017 (r326000) @@ -169,15 +169,19 @@ get_orig_iface_name(char *oid, size_t oid_size, char * char *orig_name; h = ifconfig_open(); - if (ifconfig_get_orig_name(h, name, &orig_name) < 0) - errc(1, ifconfig_err_errno(h), "cannot get interface name"); + if (ifconfig_get_orig_name(h, name, &orig_name) < 0) { + /* check for original interface name. */ + orig_name = name; + } - if (strlen(orig_name) < strlen("wlan") + 1) + if (strlen(orig_name) < strlen("wlan") + 1 || + strncmp(orig_name, "wlan", 4) != 0) errx(1, "expecting a wlan interface name"); ifconfig_close(h); setoid(oid, oid_size, orig_name); - free(orig_name); + if (orig_name != name) + free(orig_name); } int From owner-svn-src-head@freebsd.org Sun Nov 19 20:18: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 35ACCDBDA8B; Sun, 19 Nov 2017 20:18:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0275539B7; Sun, 19 Nov 2017 20:18:22 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAJKIMu3037947; Sun, 19 Nov 2017 20:18:22 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAJKIM73037946; Sun, 19 Nov 2017 20:18:22 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201711192018.vAJKIM73037946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 19 Nov 2017 20:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326001 - head/etc X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/etc X-SVN-Commit-Revision: 326001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 20:18:23 -0000 Author: avos Date: Sun Nov 19 20:18:21 2017 New Revision: 326001 URL: https://svnweb.freebsd.org/changeset/base/326001 Log: Reduce code duplication for wlan(4) interface creation in network.subr. Since wlandebug(8) can accept any (original or changed) interface name this part may be simplified a bit. Modified: head/etc/network.subr Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sun Nov 19 20:13:11 2017 (r326000) +++ head/etc/network.subr Sun Nov 19 20:18:21 2017 (r326001) @@ -1270,22 +1270,14 @@ wlan_up() fi if expr $child : 'wlan[0-9][0-9]*$' >/dev/null 2>&1; then ${IFCONFIG_CMD} $child create ${create_args} && cfg=0 - if [ $? -eq 0 ]; then - _list="$_list $child" - fi - if [ -n "${debug_flags}" ]; then - wlandebug -i $child ${debug_flags} - fi else - i=`${IFCONFIG_CMD} wlan create ${create_args}` - # XXXGL: wlandebug should accept any name - if [ -n "${debug_flags}" ]; then - wlandebug -i $i ${debug_flags} - fi - ${IFCONFIG_CMD} $i name $child && cfg=0 - if [ $? -eq 0 ]; then - _list="$_list $child" - fi + ${IFCONFIG_CMD} wlan create ${create_args} name $child && cfg=0 + fi + if [ $? -eq 0 ]; then + _list="$_list $child" + fi + if [ -n "${debug_flags}" ]; then + wlandebug -i $child ${debug_flags} fi done done From owner-svn-src-head@freebsd.org Sun Nov 19 22:38: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 46380DBFFDD for ; Sun, 19 Nov 2017 22:38:15 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-101.reflexion.net [208.70.210.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 CD417664AF for ; Sun, 19 Nov 2017 22:38:13 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 16257 invoked from network); 19 Nov 2017 22:38:07 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 19 Nov 2017 22:38:07 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sun, 19 Nov 2017 17:38:07 -0500 (EST) Received: (qmail 22903 invoked from network); 19 Nov 2017 22:38:07 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 19 Nov 2017 22:38:07 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id CE6FDEC8F85; Sun, 19 Nov 2017 14:38:06 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r325954 - in head: . share/mk sys/conf usr.sbin/config Message-Id: <59284FA3-1659-49D0-A860-366B98B02209@dsl-only.net> Date: Sun, 19 Nov 2017 14:38:06 -0800 To: Pedro Giffuni , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 19 Nov 2017 22:38:15 -0000 Pedro Giffuni pfg at FreeBSD.org wrote on Sun Nov 19 15:29:33 UTC 2017 : > Yes, we should > avoid breaking existing stuff (however old) in ports but no one is > expecting to build modern FreeBSD with gcc 3.4 or even gcc 4.1. We did > what we could with gcc 4.2.1 but it's time is also over. Unfortunately for powerpc64 no alternative works fully. For example: A) With a buildworld by clang and C++ programs linked against the system libraries, any C++ exception thrown causes the program to crash: clang generates bad code in the library. B) Modern gcc's build a lib32 based on generating a messed up crtbeginS.o content (bad register usage) and so 32-bit programs crash. As far as I know gcc 4.2.1 is still the only environment that generally works for powerpc64. [There is no devel/powerpc-gcc like there is a devel/powerpc64-gcc and I've never managed to to make a working powerpc build from a gcc other than 4.2.1 . (A) prevents clang from counting as working overall. So powerpc may be in the same boat as powerpc64 as far as having a known way to build without gcc 4.2.1 goes.] === Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Sun Nov 19 23:43: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 B4398DC1143 for ; Sun, 19 Nov 2017 23:43:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic313-25.consmr.mail.ne1.yahoo.com (sonic313-25.consmr.mail.ne1.yahoo.com [66.163.185.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83980680F2 for ; Sun, 19 Nov 2017 23:43:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1511135011; bh=fxjTF9rCWY42fReGABg0CgPYnlHMCIvOtSrNldRT5bs=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=X7kT7M2vaks2kfjpXjnU0y7Zlh9n9nOWZA94hUNHPbc2VK62WCYh62rX4DdhNSRQ6MgOFrkfREIYc0z3SARJ2bWn/AhjtW7YKZjpOhiwujT7HWu367cS+oeeOE97+Bhyi1gpGncoEYj5HqTcKmZcb5uINY8nIi4+aXu03A/KN9DIogL7hD0STNQjljQcYH56a2fMIVMhfqgq0+qhuCXCeJIPXHXAvr1pfr8/Qgg+TiIO5fKmbAjsIVcSJp3dC3te5wRCTEp2RKGJAsBN/wcDQRuI4HE7cBTXDmtQotGheT6qABpek70NHLvofgBk4oM9KU91ILU+95oVB+2YIf02Ng== X-YMail-OSG: hL10RfQVM1mVmwu021eIqlrAtuWNnQTJoHgCkf0lXGdrjr4YwNS62k5mAEvzxx2 69O1mEqyr8VKcz4I5GLbFzMv_8zpQ0cUAYad7hM35TxJmaHO80qDj8oJhksI.z28ZBDY6UFBIOjk hnGGRNLeL..zGd0wGQgyNAj09xEvVEFwGwRFDrpsGdO1eXmCPr9eEKyvFYiUdN9Mkgotu9D5ccsK tSuoAlJdd4JKR04E_YmjUZKvVIsSxESn5LvpaVSitandfadv4ktum56SKBdk95wVQvocdP5pPi7_ MfDwFX.P9FeXaOGdQrrLFibRRqSt30iw1MbFnhYLC8WPfLgoyzkn6TohUXOZjsXcC9hwrZSsA.9V Z34GLkPrDC.vVDQQNkPFwiV1mwGJa1zD4XwHMdmobfM6RwzO_KGeF2Lo9FEdsD3ad6gyzRARyJ9f or4e4Aj5g9fzm6pw.348b2RYaEo98TtaCk1Lb8nuU0XVv0N2Pfa1cltPhrdiuZWxy3zRi0AZlzH7 i8PArGt58DdqQ5zbiXrZU2HCc9koom.xEC41YeWkr Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Sun, 19 Nov 2017 23:43:31 +0000 Received: from [127.0.0.1] by smtp111.mail.ne1.yahoo.com with NNFMP; 19 Nov 2017 23:43:28 -0000 X-Yahoo-Newman-Id: 568694.82086.bm@smtp111.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: hL10RfQVM1mVmwu021eIqlrAtuWNnQTJoHgCkf0lXGdrjr4 YwNS62k5mAEvzxx269O1mEqyr8VKcz4I5GLbFzMv_8zpQ0cUAYad7hM35TxJ maHO80qDj8oJhksI.z28ZBDY6UFBIOjkhnGGRNLeL..zGd0wGQgyNAj09xEv VEFwGwRFDrpsGdO1eXmCPr9eEKyvFYiUdN9Mkgotu9D5ccsKtSuoAlJdd4JK R04E_YmjUZKvVIsSxESn5LvpaVSitandfadv4ktum56SKBdk95wVQvocdP5p Pi7_MfDwFX.P9FeXaOGdQrrLFibRRqSt30iw1MbFnhYLC8WPfLgoyzkn6Toh UXOZjsXcC9hwrZSsA.9VZ34GLkPrDC.vVDQQNkPFwiV1mwGJa1zD4XwHMdmo bfM6RwzO_KGeF2Lo9FEdsD3ad6gyzRARyJ9for4e4Aj5g9fzm6pw.348b2RY aEo98TtaCk1Lb8nuU0XVv0N2Pfa1cltPhrdiuZWxy3zRi0AZlzH7i8PArGt5 8DdqQ5zbiXrZU2HCc9koom.xEC41YeWkr X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r325954 - in head: . share/mk sys/conf usr.sbin/config To: Mark Millard , svn-src-head@freebsd.org References: <59284FA3-1659-49D0-A860-366B98B02209@dsl-only.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <26aaac2e-01d5-a11c-1182-39363d5cafc5@FreeBSD.org> Date: Sun, 19 Nov 2017 18:43:25 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <59284FA3-1659-49D0-A860-366B98B02209@dsl-only.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Nov 2017 23:43:38 -0000 .... On 19/11/2017 17:38, Mark Millard wrote: > Pedro Giffuni pfg at FreeBSD.org wrote on > Sun Nov 19 15:29:33 UTC 2017 : > >> Yes, we should >> avoid breaking existing stuff (however old) in ports but no one is >> expecting to build modern FreeBSD with gcc 3.4 or even gcc 4.1. We did >> what we could with gcc 4.2.1 but it's time is also over. > Unfortunately for powerpc64 no alternative > works fully. For example: > > A) With a buildworld by clang and C++ programs linked against > the system libraries, any C++ exception thrown causes the > program to crash: clang generates bad code in the library. > > B) Modern gcc's build a lib32 based on generating a messed up > crtbeginS.o content (bad register usage) and so 32-bit > programs crash. > > As far as I know gcc 4.2.1 is still the only environment that > generally works for powerpc64. Hmm ... At some point some of the newer GCC was generating good code. I have had reports of openoffice-devel working on FreeBSD powerpc64 and, even on x86, openoffice stopped building with our base gcc. > [There is no devel/powerpc-gcc like there is a devel/powerpc64-gcc > and I've never managed to to make a working powerpc build from a > gcc other than 4.2.1 . (A) prevents clang from counting as working > overall. So powerpc may be in the same boat as powerpc64 as far as > having a known way to build without gcc 4.2.1 goes.] At least PPC64 is alive, I am afraid that I don't see a solution for sparc64. But this is very off-topic to lint issue :). Pedro. From owner-svn-src-head@freebsd.org Mon Nov 20 00:18:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BFC1DDB091 for ; Mon, 20 Nov 2017 00:18:25 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-122.reflexion.net [208.70.210.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 303B168D2C for ; Mon, 20 Nov 2017 00:18:24 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 21782 invoked from network); 20 Nov 2017 00:11:38 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 20 Nov 2017 00:11:38 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sun, 19 Nov 2017 19:11:38 -0500 (EST) Received: (qmail 8008 invoked from network); 20 Nov 2017 00:11:38 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 20 Nov 2017 00:11:38 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id E4869EC8F85; Sun, 19 Nov 2017 16:11:37 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r325954 - in head: . share/mk sys/conf usr.sbin/config From: Mark Millard In-Reply-To: <26aaac2e-01d5-a11c-1182-39363d5cafc5@FreeBSD.org> Date: Sun, 19 Nov 2017 16:11:37 -0800 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4DCBA4BA-1803-4B8F-B232-7558227E4002@dsl-only.net> References: <59284FA3-1659-49D0-A860-366B98B02209@dsl-only.net> <26aaac2e-01d5-a11c-1182-39363d5cafc5@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 00:18:25 -0000 [As long as things do not go the direction of eliminating gcc 4.2.1 being able to do buildworld and buildkernel for certain architectures, I agree that this would stay an off-topic subject.] On 2017-Nov-19, at 3:43 PM, Pedro Giffuni wrote: > .... > On 19/11/2017 17:38, Mark Millard wrote: >> Pedro Giffuni pfg at FreeBSD.org wrote on >> Sun Nov 19 15:29:33 UTC 2017 : >>=20 >>> Yes, we should >>> avoid breaking existing stuff (however old) in ports but no one is >>> expecting to build modern FreeBSD with gcc 3.4 or even gcc 4.1. We = did >>> what we could with gcc 4.2.1 but it's time is also over. >> Unfortunately for powerpc64 no alternative >> works fully. For example: >>=20 >> A) With a buildworld by clang and C++ programs linked against >> the system libraries, any C++ exception thrown causes the >> program to crash: clang generates bad code in the library. >>=20 >> B) Modern gcc's build a lib32 based on generating a messed up >> crtbeginS.o content (bad register usage) and so 32-bit >> programs crash. >>=20 >> As far as I know gcc 4.2.1 is still the only environment that >> generally works for powerpc64. > Hmm ... > At some point some of the newer GCC was generating good code. > I have had reports of openoffice-devel working on FreeBSD powerpc64 = and, > even on x86, openoffice stopped building with our base gcc. openoffice likely does not depend on lib32 (support of 32-bit code under a powerpc64 environment) even being present, much less working? As far as I know, for powerpc64 WITHOUT_LIB32=3D buildworld, devel/powerpc64-gcc is sufficient. It is WITH_LIB32=3D coverage that makes it insufficient overall. Anything that does not depend on lib32 likely works as well as on other architectures. >> [There is no devel/powerpc-gcc like there is a devel/powerpc64-gcc >> and I've never managed to to make a working powerpc build from a >> gcc other than 4.2.1 . (A) prevents clang from counting as working >> overall. So powerpc may be in the same boat as powerpc64 as far as >> having a known way to build without gcc 4.2.1 goes.] > At least PPC64 is alive, I am afraid that I don't see a solution for = sparc64. I do not have direct experience for sparc*'s but I'd not be surprised. > But this is very off-topic to lint issue :). As long as things do not go the direction of eliminating gcc 4.2.1 being able to do buildworld and buildkernel for certain architectures, I agree that this would stay an off-topic subject. =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Mon Nov 20 01:40:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADA89DDD0AB for ; Mon, 20 Nov 2017 01:40:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1.freebsd.org (Postfix) with SMTP id 75F8B6AEFA for ; Mon, 20 Nov 2017 01:40:55 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: (qmail 84728 invoked by uid 99); 20 Nov 2017 01:40:49 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Nov 2017 01:40:49 +0000 Received: from [192.168.0.8] (unknown [186.80.205.98]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id DAA8E1A003E; Mon, 20 Nov 2017 01:40:47 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r325954 - in head: . share/mk sys/conf usr.sbin/config From: Pedro Giffuni In-Reply-To: <4DCBA4BA-1803-4B8F-B232-7558227E4002@dsl-only.net> Date: Sun, 19 Nov 2017 20:40:40 -0500 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <297A2FDE-6105-4F64-921B-9510066F0420@FreeBSD.org> References: <59284FA3-1659-49D0-A860-366B98B02209@dsl-only.net> <26aaac2e-01d5-a11c-1182-39363d5cafc5@FreeBSD.org> <4DCBA4BA-1803-4B8F-B232-7558227E4002@dsl-only.net> To: Mark Millard X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 01:40:55 -0000 > On Nov 19, 2017, at 19:11, Mark Millard wrote: >=20 > [As long as things do not go the direction of > eliminating gcc 4.2.1 being able to do buildworld > and buildkernel for certain architectures, I > agree that this would stay an off-topic subject.] >=20 > On 2017-Nov-19, at 3:43 PM, Pedro Giffuni wrote: >=20 >> .... >> On 19/11/2017 17:38, Mark Millard wrote: >>> Pedro Giffuni pfg at FreeBSD.org wrote on >>> Sun Nov 19 15:29:33 UTC 2017 : >>>=20 >>>> Yes, we should >>>> avoid breaking existing stuff (however old) in ports but no one is >>>> expecting to build modern FreeBSD with gcc 3.4 or even gcc 4.1. We = did >>>> what we could with gcc 4.2.1 but it's time is also over. >>> Unfortunately for powerpc64 no alternative >>> works fully. For example: >>>=20 >>> A) With a buildworld by clang and C++ programs linked against >>> the system libraries, any C++ exception thrown causes the >>> program to crash: clang generates bad code in the library. >>>=20 >>> B) Modern gcc's build a lib32 based on generating a messed up >>> crtbeginS.o content (bad register usage) and so 32-bit >>> programs crash. >>>=20 >>> As far as I know gcc 4.2.1 is still the only environment that >>> generally works for powerpc64. >> Hmm ... >> At some point some of the newer GCC was generating good code. >> I have had reports of openoffice-devel working on FreeBSD powerpc64 = and, >> even on x86, openoffice stopped building with our base gcc. >=20 > openoffice likely does not depend on lib32 (support of 32-bit > code under a powerpc64 environment) even being present, much > less working? >=20 Yes, right: it=E2=80=99s pretty native: either all 64 bit or all 32 = bit.. The port had endianness issues but once Curtis Hamilton fixed those the = port worked. For the record: AOO generally needs two things: working java and a = low-level "bridges" code. I don=E2=80=99t have access to the platform but patches to build the = arch-dependent =E2=80=9Cbridges=E2=80=9D code with clang would be very = welcome. > As far as I know, for powerpc64 WITHOUT_LIB32=3D buildworld, > devel/powerpc64-gcc is sufficient. It is WITH_LIB32=3D coverage > that makes it insufficient overall. Anything that does not > depend on lib32 likely works as well as on other architectures. >=20 >>> [There is no devel/powerpc-gcc like there is a devel/powerpc64-gcc >>> and I've never managed to to make a working powerpc build from a >>> gcc other than 4.2.1 . (A) prevents clang from counting as working >>> overall. So powerpc may be in the same boat as powerpc64 as far as >>> having a known way to build without gcc 4.2.1 goes.] >> At least PPC64 is alive, I am afraid that I don't see a solution for = sparc64. >=20 > I do not have direct experience for sparc*'s but I'd > not be surprised. >=20 >> But this is very off-topic to lint issue :). >=20 > As long as things do not go the direction of > eliminating gcc 4.2.1 being able to do buildworld > and buildkernel for certain architectures, I > agree that this would stay an off-topic subject. >=20 I have no interest in killing any platform but we are reaching a point = where, other than being unmaintained, gcc-4.2.1 won=E2=80=99t be able to = build newer clang or gcc. Pedro. From owner-svn-src-head@freebsd.org Mon Nov 20 02:19: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 C088DDDDAD1 for ; Mon, 20 Nov 2017 02:19:12 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-115.reflexion.net [208.70.210.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75B316BE66 for ; Mon, 20 Nov 2017 02:19:12 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 4501 invoked from network); 20 Nov 2017 02:19:05 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 20 Nov 2017 02:19:05 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Sun, 19 Nov 2017 21:19:05 -0500 (EST) Received: (qmail 31593 invoked from network); 20 Nov 2017 02:19:05 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 20 Nov 2017 02:19:05 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 8178CEC8F85; Sun, 19 Nov 2017 18:19:04 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r325954 - in head: . share/mk sys/conf usr.sbin/config From: Mark Millard In-Reply-To: <297A2FDE-6105-4F64-921B-9510066F0420@FreeBSD.org> Date: Sun, 19 Nov 2017 18:19:04 -0800 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7230AC67-7F9A-4FE2-BC32-B2BA8091206D@dsl-only.net> References: <59284FA3-1659-49D0-A860-366B98B02209@dsl-only.net> <26aaac2e-01d5-a11c-1182-39363d5cafc5@FreeBSD.org> <4DCBA4BA-1803-4B8F-B232-7558227E4002@dsl-only.net> <297A2FDE-6105-4F64-921B-9510066F0420@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 02:19:12 -0000 [Continuing the gcc 4.2.1 side issue a bit.] On 2017-Nov-19, at 5:40 PM, Pedro Giffuni wrote: >> On Nov 19, 2017, at 19:11, Mark Millard wrote: >>=20 >> [As long as things do not go the direction of >> eliminating gcc 4.2.1 being able to do buildworld >> and buildkernel for certain architectures, I >> agree that this would stay an off-topic subject.] >>=20 >> On 2017-Nov-19, at 3:43 PM, Pedro Giffuni wrote: >>=20 >>> .... >>> On 19/11/2017 17:38, Mark Millard wrote: >>>> Pedro Giffuni pfg at FreeBSD.org wrote on >>>> Sun Nov 19 15:29:33 UTC 2017 : >>>>=20 >>>>> Yes, we should >>>>> avoid breaking existing stuff (however old) in ports but no one is >>>>> expecting to build modern FreeBSD with gcc 3.4 or even gcc 4.1. We = did >>>>> what we could with gcc 4.2.1 but it's time is also over. >>>> Unfortunately for powerpc64 no alternative >>>> works fully. For example: >>>>=20 >>>> A) With a buildworld by clang and C++ programs linked against >>>> the system libraries, any C++ exception thrown causes the >>>> program to crash: clang generates bad code in the library. >>>>=20 >>>> B) Modern gcc's build a lib32 based on generating a messed up >>>> crtbeginS.o content (bad register usage) and so 32-bit >>>> programs crash. >>>>=20 >>>> As far as I know gcc 4.2.1 is still the only environment that >>>> generally works for powerpc64. >>> Hmm ... >>> At some point some of the newer GCC was generating good code. >>> I have had reports of openoffice-devel working on FreeBSD powerpc64 = and, >>> even on x86, openoffice stopped building with our base gcc. >>=20 >> openoffice likely does not depend on lib32 (support of 32-bit >> code under a powerpc64 environment) even being present, much >> less working? >>=20 >=20 > Yes, right: it=E2=80=99s pretty native: either all 64 bit or all 32 = bit.. > The port had endianness issues but once Curtis Hamilton fixed those = the port worked. > For the record: AOO generally needs two things: working java and a = low-level "bridges" code. > I don=E2=80=99t have access to the platform but patches to build the = arch-dependent =E2=80=9Cbridges=E2=80=9D code with clang would be very = welcome. >=20 >> As far as I know, for powerpc64 WITHOUT_LIB32=3D buildworld, >> devel/powerpc64-gcc is sufficient. It is WITH_LIB32=3D coverage >> that makes it insufficient overall. Anything that does not >> depend on lib32 likely works as well as on other architectures. >>=20 >>>> [There is no devel/powerpc-gcc like there is a devel/powerpc64-gcc >>>> and I've never managed to to make a working powerpc build from a >>>> gcc other than 4.2.1 . (A) prevents clang from counting as working >>>> overall. So powerpc may be in the same boat as powerpc64 as far as >>>> having a known way to build without gcc 4.2.1 goes.] >>> At least PPC64 is alive, I am afraid that I don't see a solution for = sparc64. >>=20 >> I do not have direct experience for sparc*'s but I'd >> not be surprised. >>=20 >>> But this is very off-topic to lint issue :). >>=20 >> As long as things do not go the direction of >> eliminating gcc 4.2.1 being able to do buildworld >> and buildkernel for certain architectures, I >> agree that this would stay an off-topic subject. >>=20 >=20 > I have no interest in killing any platform but we are reaching a point = where, other than being unmaintained, gcc-4.2.1 won=E2=80=99t be able to = build newer clang or gcc. gcc 4.2.1 has not been able to build the system clang for a long time. Getting from a gcc 4.2.1 powerpc64 or powerpc to a clang-based one is a pain when self hosting. Cross building with clang in use is handier when one has a supporting context for such. gcc* tends to have a bootstrapping stage available that builds xgcc (as I remember the name), avoiding modern stuff to get xgcc built. xgcc builds the full gcc* build, avoiding the original host compiler. This may still work with gcc 4.2.1 . I've not tried in a long time. Avoiding a full-bootstrap for a gcc* requires something more modern than gcc 4.2.1 . =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Mon Nov 20 04:32: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 5EB35DE119C; Mon, 20 Nov 2017 04:32:02 +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 223E06F7B8; Mon, 20 Nov 2017 04:32:02 +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 vAK4W1rq047728; Mon, 20 Nov 2017 04:32:01 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAK4W1OE047727; Mon, 20 Nov 2017 04:32:01 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711200432.vAK4W1OE047727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 20 Nov 2017 04:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326004 - head/sys/dev/dpaa X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/dpaa X-SVN-Commit-Revision: 326004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 04:32:03 -0000 Author: jhibbits Date: Mon Nov 20 04:32:01 2017 New Revision: 326004 URL: https://svnweb.freebsd.org/changeset/base/326004 Log: Eliminate 1 XX_VirtToPhys() and 2 XX_PhysToVirt() calls from if_dtsec(4) XX_VirtToPhys(), by way of pmap_kextract(), is an expensive operation. Profiling via dtrace during a series of iperf tests I found 16111 / 30432 stack frames were located in mmu_booke_kextract(), so eliminating this expensive call should improve performance slightly. XX_PhysToVirt() is not as expensive, but redundant calls in this context is wasteful. 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 Mon Nov 20 03:40:50 2017 (r326003) +++ head/sys/dev/dpaa/if_dtsec_rm.c Mon Nov 20 04:32:01 2017 (r326004) @@ -358,10 +358,12 @@ dtsec_rm_fqr_rx_callback(t_Handle app, t_Handle fqr, t { struct dtsec_softc *sc; struct mbuf *m; + void *frame_va; m = NULL; sc = app; + frame_va = DPAA_FD_GET_ADDR(frame); KASSERT(DPAA_FD_GET_FORMAT(frame) == e_DPAA_FD_FORMAT_TYPE_SHORT_SBSF, ("%s(): Got unsupported frame format 0x%02X!", __func__, DPAA_FD_GET_FORMAT(frame))); @@ -379,8 +381,8 @@ dtsec_rm_fqr_rx_callback(t_Handle app, t_Handle fqr, t if (m == NULL) goto err; - m_extadd(m, DPAA_FD_GET_ADDR(frame), FM_PORT_BUFFER_SIZE, - dtsec_rm_fqr_mext_free, DPAA_FD_GET_ADDR(frame), sc, 0, + m_extadd(m, frame_va, FM_PORT_BUFFER_SIZE, + dtsec_rm_fqr_mext_free, frame_va, sc, 0, EXT_NET_DRV); m->m_pkthdr.rcvif = sc->sc_ifnet; @@ -392,7 +394,7 @@ dtsec_rm_fqr_rx_callback(t_Handle app, t_Handle fqr, t return (e_RX_STORE_RESPONSE_CONTINUE); err: - bman_put_buffer(sc->sc_rx_pool, DPAA_FD_GET_ADDR(frame)); + bman_put_buffer(sc->sc_rx_pool, frame_va); if (m != NULL) m_freem(m); @@ -545,7 +547,6 @@ dtsec_rm_if_start_locked(struct dtsec_softc *sc) unsigned int qlen, i; struct mbuf *m0, *m; vm_offset_t vaddr; - vm_paddr_t paddr; t_DpaaFD fd; DTSEC_LOCK_ASSERT(sc); @@ -602,8 +603,7 @@ dtsec_rm_if_start_locked(struct dtsec_softc *sc) dsize = m->m_len; vaddr = (vm_offset_t)m->m_data; while (dsize > 0 && i < DPAA_NUM_OF_SG_TABLE_ENTRY) { - paddr = XX_VirtToPhys((void *)vaddr); - ssize = PAGE_SIZE - (paddr & PAGE_MASK); + ssize = PAGE_SIZE - (vaddr & PAGE_MASK); if (m->m_len < ssize) ssize = m->m_len; From owner-svn-src-head@freebsd.org Mon Nov 20 08:52: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 2242DDE572F; Mon, 20 Nov 2017 08:52:36 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB89B75D75; Mon, 20 Nov 2017 08:52:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAK8qY8V057422; Mon, 20 Nov 2017 08:52:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAK8qYPI057414; Mon, 20 Nov 2017 08:52:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711200852.vAK8qYPI057414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 20 Nov 2017 08:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326010 - in head: contrib/less usr.bin/less X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: contrib/less usr.bin/less X-SVN-Commit-Revision: 326010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 08:52:36 -0000 Author: delphij Date: Mon Nov 20 08:52:33 2017 New Revision: 326010 URL: https://svnweb.freebsd.org/changeset/base/326010 Log: MFV r326007: less v529. MFC after: 2 weeks Added: head/contrib/less/fmt.uni - copied unchanged from r326007, vendor/less/dist/fmt.uni Deleted: head/contrib/less/mkhelp.c Modified: head/contrib/less/NEWS head/contrib/less/README head/contrib/less/ch.c head/contrib/less/charset.c head/contrib/less/cmd.h head/contrib/less/cmdbuf.c head/contrib/less/command.c head/contrib/less/compose.uni head/contrib/less/cvt.c head/contrib/less/decode.c head/contrib/less/edit.c head/contrib/less/filename.c head/contrib/less/forwback.c head/contrib/less/funcs.h head/contrib/less/help.c head/contrib/less/ifile.c head/contrib/less/input.c head/contrib/less/jump.c head/contrib/less/less.h head/contrib/less/less.hlp head/contrib/less/less.nro head/contrib/less/lessecho.nro head/contrib/less/lesskey.c head/contrib/less/lesskey.nro head/contrib/less/line.c head/contrib/less/main.c head/contrib/less/mark.c head/contrib/less/mkutable head/contrib/less/optfunc.c head/contrib/less/option.h head/contrib/less/opttbl.c head/contrib/less/output.c head/contrib/less/pattern.h head/contrib/less/position.c head/contrib/less/prompt.c head/contrib/less/screen.c head/contrib/less/search.c head/contrib/less/signal.c head/contrib/less/tags.c head/contrib/less/ubin.uni head/contrib/less/version.c head/contrib/less/wide.uni head/usr.bin/less/defines.h Directory Properties: head/contrib/less/ (props changed) Modified: head/contrib/less/NEWS ============================================================================== --- head/contrib/less/NEWS Mon Nov 20 08:12:40 2017 (r326009) +++ head/contrib/less/NEWS Mon Nov 20 08:52:33 2017 (r326010) @@ -11,17 +11,59 @@ ====================================================================== - Major changes between "less" versions 487 and 491 + Major changes between "less" versions 487 and 529 * Don't output terminal init sequence if using -F and file fits on one screen. -* Use ANSI prototypes in funcs.h declarations. +* When using -S, mark truncated lines with a special character. + The character can be changed or disabled via the new --rscroll option. -* Fix some const mismatches. +* New command M marks the last line displayed on the screen. -* Remove "register" in variable declarations. +* New command ESC-m removes a line mark. +* Status column (enabled via -J) now shows mark letters. + +* Status column shows search matches even if highlighting is disabled via -G. + +* A second ESC-u command will clear search match markers in the status column. + +* Do same ANSI escape code filtering for tag matching that we do for + searching, to help when viewing syntax-highlighted code. + +* Catch SIGTERM and clean up before exiting. + +* Fix bug initializing default charset on Windows. + +* Handle keypad ENTER key correctly if it sends something other than newline. + +* Fix buffering bug when using stdin with a LESSOPEN pipe. + +* On Windows, allow 'u' in -D option to enable underlining. + +* On Windows, use underline in sgr mode. + +* On Windows, convert UTF-8 to multibyte if console is not UTF-8. + +* Update Unicode tables to 2017-03-08. + +* Pass-thru Unicode formating chars (Cf type) instead of treating them + as binary chars. But treat them as binary if -U is set. + +* Fix erroneous binary file warning when UTF-8 file contains ANSI SGR sequences. + +* Fix bugs when using LESSOPEN and switching between stdin and other files. + +* Fix some bugs handling filenames containing shell metacharacters. + * Fix some memory leaks. + +* Allow some debugging environment variables to be set in lesskey file. + +* Code improvements: + . Use ANSI prototypes in funcs.h declarations. + . Fix some const mismatches. + . Remove archaic "register" in variable declarations. ====================================================================== Modified: head/contrib/less/README ============================================================================== --- head/contrib/less/README Mon Nov 20 08:12:40 2017 (r326009) +++ head/contrib/less/README Mon Nov 20 08:52:33 2017 (r326010) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 491 + Less, version 529 - This is the distribution of less, version 491, released 07 Apr 2017. + This is the distribution of less, version 529, released 13 Nov 2017. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or @@ -23,6 +23,7 @@ Please report any problems to bug-less@gnu.org. See http://www.greenwoodsoftware.com/less for the latest info. + Source repository is at https://github.com/gwsw/less.git. ========================================================================= Modified: head/contrib/less/ch.c ============================================================================== --- head/contrib/less/ch.c Mon Nov 20 08:12:40 2017 (r326009) +++ head/contrib/less/ch.c Mon Nov 20 08:52:33 2017 (r326010) @@ -867,13 +867,12 @@ ch_init(f, flags) calloc(1, sizeof(struct filestate)); thisfile->buflist.next = thisfile->buflist.prev = END_OF_CHAIN; thisfile->nbufs = 0; - thisfile->flags = 0; + thisfile->flags = flags; thisfile->fpos = 0; thisfile->block = 0; thisfile->offset = 0; thisfile->file = -1; thisfile->fsize = NULL_POSITION; - ch_flags = flags; init_hashtbl(); /* * Try to seek; set CH_CANSEEK if it works. @@ -898,7 +897,7 @@ ch_close() if (thisfile == NULL) return; - if (ch_flags & (CH_CANSEEK|CH_POPENED|CH_HELPFILE)) + if ((ch_flags & (CH_CANSEEK|CH_POPENED|CH_HELPFILE)) && !(ch_flags & CH_KEEPOPEN)) { /* * We can seek or re-open, so we don't need to keep buffers. Modified: head/contrib/less/charset.c ============================================================================== --- head/contrib/less/charset.c Mon Nov 20 08:12:40 2017 (r326009) +++ head/contrib/less/charset.c Mon Nov 20 08:52:33 2017 (r326010) @@ -22,6 +22,13 @@ #include "charset.h" +#if MSDOS_COMPILER==WIN32C +#define WIN32_LEAN_AND_MEAN +#include +#endif + +extern int bs_mode; + public int utf_mode = 0; /* @@ -215,7 +222,13 @@ icharset(name, no_error) { ichardef(p->desc); if (p->p_flag != NULL) + { +#if MSDOS_COMPILER==WIN32C + *(p->p_flag) = 1 + (GetConsoleOutputCP() != CP_UTF8); +#else *(p->p_flag) = 1; +#endif + } return (1); } } @@ -251,16 +264,17 @@ ilocale() /* * Define the printing format for control (or binary utf) chars. */ - static void -setbinfmt(s, fmtvarptr, default_fmt) + public void +setfmt(s, fmtvarptr, attrptr, default_fmt) char *s; char **fmtvarptr; + int *attrptr; char *default_fmt; { if (s && utf_mode) { /* It would be too hard to account for width otherwise. */ - char *t = s; + char constant *t = s; while (*t) { if (*t < ' ' || *t > '~') @@ -282,15 +296,15 @@ setbinfmt(s, fmtvarptr, default_fmt) * Select the attributes if it starts with "*". */ attr: - if (*s == '*') + if (*s == '*' && s[1] != '\0') { switch (s[1]) { - case 'd': binattr = AT_BOLD; break; - case 'k': binattr = AT_BLINK; break; - case 's': binattr = AT_STANDOUT; break; - case 'u': binattr = AT_UNDERLINE; break; - default: binattr = AT_NORMAL; break; + case 'd': *attrptr = AT_BOLD; break; + case 'k': *attrptr = AT_BLINK; break; + case 's': *attrptr = AT_STANDOUT; break; + case 'u': *attrptr = AT_UNDERLINE; break; + default: *attrptr = AT_NORMAL; break; } s += 2; } @@ -305,7 +319,15 @@ set_charset() { char *s; +#if MSDOS_COMPILER==WIN32C /* + * If the Windows console is using UTF-8, we'll use it too. + */ + if (GetConsoleOutputCP() == CP_UTF8) + if (icharset("utf-8", 1)) + return; +#endif + /* * See if environment variable LESSCHARSET is defined. */ s = lgetenv("LESSCHARSET"); @@ -354,6 +376,7 @@ set_charset() * rather than from predefined charset entry. */ ilocale(); +#else #if MSDOS_COMPILER /* * Default to "dos". @@ -383,10 +406,10 @@ init_charset() set_charset(); s = lgetenv("LESSBINFMT"); - setbinfmt(s, &binfmt, "*s<%02X>"); + setfmt(s, &binfmt, &binattr, "*s<%02X>"); s = lgetenv("LESSUTFBINFMT"); - setbinfmt(s, &utfbinfmt, ""); + setfmt(s, &utfbinfmt, &binattr, ""); } /* @@ -543,34 +566,19 @@ is_utf8_well_formed(ss, slen) } /* - * Return number of invalid UTF-8 sequences found in a buffer. + * Skip bytes until a UTF-8 lead byte (11xxxxxx) or ASCII byte (0xxxxxxx) is found. */ - public int -utf_bin_count(data, len) - char *data; - int len; + public void +utf_skip_to_lead(pp, limit) + char **pp; + char *limit; { - int bin_count = 0; - while (len > 0) - { - if (is_utf8_well_formed(data, len)) - { - int clen = utf_len(*data & 0377); - data += clen; - len -= clen; - } else - { - /* Skip to next lead byte. */ - bin_count++; - do { - ++data; - --len; - } while (len > 0 && !IS_UTF8_LEAD(*data & 0377)); - } - } - return (bin_count); + do { + ++(*pp); + } while (*pp < limit && !IS_UTF8_LEAD((*pp)[0] & 0377) && !IS_ASCII_OCTET((*pp)[0])); } + /* * Get the value of a UTF-8 character. */ @@ -690,9 +698,9 @@ step_char(pp, dir, limit) { /* It's easy if chars are one byte. */ if (dir > 0) - ch = (LWCHAR) ((p < limit) ? *p++ : 0); + ch = (LWCHAR) (unsigned char) ((p < limit) ? *p++ : 0); else - ch = (LWCHAR) ((p > limit) ? *--p : 0); + ch = (LWCHAR) (unsigned char) ((p > limit) ? *--p : 0); } else if (dir > 0) { len = utf_len(*p); @@ -740,6 +748,10 @@ DECLARE_RANGE_TABLE_START(wide) #include "wide.uni" DECLARE_RANGE_TABLE_END(wide) +DECLARE_RANGE_TABLE_START(fmt) +#include "fmt.uni" +DECLARE_RANGE_TABLE_END(fmt) + /* comb_table is special pairs, not ranges. */ static struct wchar_range comb_table[] = { {0x0644,0x0622}, {0x0644,0x0623}, {0x0644,0x0625}, {0x0644,0x0627}, @@ -780,7 +792,8 @@ is_in_table(ch, table) is_composing_char(ch) LWCHAR ch; { - return is_in_table(ch, &compose_table); + return is_in_table(ch, &compose_table) || + (bs_mode != BS_CONTROL && is_in_table(ch, &fmt_table)); } /* @@ -790,7 +803,21 @@ is_composing_char(ch) is_ubin_char(ch) LWCHAR ch; { - return is_in_table(ch, &ubin_table); + int ubin = is_in_table(ch, &ubin_table) || + (bs_mode == BS_CONTROL && is_in_table(ch, &fmt_table)); +#if MSDOS_COMPILER==WIN32C + if (!ubin && utf_mode == 2 && ch < 0x10000) + { + /* + * Consider it binary if it can't be converted. + */ + BOOL used_default = TRUE; + WideCharToMultiByte(GetConsoleOutputCP(), WC_NO_BEST_FIT_CHARS, (LPCWSTR) &ch, 1, NULL, 0, NULL, &used_default); + if (used_default) + ubin = 1; + } +#endif + return ubin; } /* Modified: head/contrib/less/cmd.h ============================================================================== --- head/contrib/less/cmd.h Mon Nov 20 08:12:40 2017 (r326009) +++ head/contrib/less/cmd.h Mon Nov 20 08:52:33 2017 (r326010) @@ -8,129 +8,131 @@ */ -#define MAX_USERCMD 1000 -#define MAX_CMDLEN 16 +#define MAX_USERCMD 1000 +#define MAX_CMDLEN 16 -#define A_B_LINE 2 -#define A_B_SCREEN 3 -#define A_B_SCROLL 4 -#define A_B_SEARCH 5 -#define A_DIGIT 6 -#define A_DISP_OPTION 7 -#define A_DEBUG 8 -#define A_EXAMINE 9 -#define A_FIRSTCMD 10 -#define A_FREPAINT 11 -#define A_F_LINE 12 -#define A_F_SCREEN 13 -#define A_F_SCROLL 14 -#define A_F_SEARCH 15 -#define A_GOEND 16 -#define A_GOLINE 17 -#define A_GOMARK 18 -#define A_HELP 19 -#define A_NEXT_FILE 20 -#define A_PERCENT 21 -#define A_PREFIX 22 -#define A_PREV_FILE 23 -#define A_QUIT 24 -#define A_REPAINT 25 -#define A_SETMARK 26 -#define A_SHELL 27 -#define A_STAT 28 -#define A_FF_LINE 29 -#define A_BF_LINE 30 -#define A_VERSION 31 -#define A_VISUAL 32 -#define A_F_WINDOW 33 -#define A_B_WINDOW 34 -#define A_F_BRACKET 35 -#define A_B_BRACKET 36 -#define A_PIPE 37 -#define A_INDEX_FILE 38 -#define A_UNDO_SEARCH 39 -#define A_FF_SCREEN 40 -#define A_LSHIFT 41 -#define A_RSHIFT 42 -#define A_AGAIN_SEARCH 43 -#define A_T_AGAIN_SEARCH 44 -#define A_REVERSE_SEARCH 45 -#define A_T_REVERSE_SEARCH 46 -#define A_OPT_TOGGLE 47 -#define A_OPT_SET 48 -#define A_OPT_UNSET 49 -#define A_F_FOREVER 50 -#define A_GOPOS 51 -#define A_REMOVE_FILE 52 -#define A_NEXT_TAG 53 -#define A_PREV_TAG 54 -#define A_FILTER 55 -#define A_F_UNTIL_HILITE 56 -#define A_GOEND_BUF 57 -#define A_LLSHIFT 58 -#define A_RRSHIFT 59 +#define A_B_LINE 2 +#define A_B_SCREEN 3 +#define A_B_SCROLL 4 +#define A_B_SEARCH 5 +#define A_DIGIT 6 +#define A_DISP_OPTION 7 +#define A_DEBUG 8 +#define A_EXAMINE 9 +#define A_FIRSTCMD 10 +#define A_FREPAINT 11 +#define A_F_LINE 12 +#define A_F_SCREEN 13 +#define A_F_SCROLL 14 +#define A_F_SEARCH 15 +#define A_GOEND 16 +#define A_GOLINE 17 +#define A_GOMARK 18 +#define A_HELP 19 +#define A_NEXT_FILE 20 +#define A_PERCENT 21 +#define A_PREFIX 22 +#define A_PREV_FILE 23 +#define A_QUIT 24 +#define A_REPAINT 25 +#define A_SETMARK 26 +#define A_SHELL 27 +#define A_STAT 28 +#define A_FF_LINE 29 +#define A_BF_LINE 30 +#define A_VERSION 31 +#define A_VISUAL 32 +#define A_F_WINDOW 33 +#define A_B_WINDOW 34 +#define A_F_BRACKET 35 +#define A_B_BRACKET 36 +#define A_PIPE 37 +#define A_INDEX_FILE 38 +#define A_UNDO_SEARCH 39 +#define A_FF_SCREEN 40 +#define A_LSHIFT 41 +#define A_RSHIFT 42 +#define A_AGAIN_SEARCH 43 +#define A_T_AGAIN_SEARCH 44 +#define A_REVERSE_SEARCH 45 +#define A_T_REVERSE_SEARCH 46 +#define A_OPT_TOGGLE 47 +#define A_OPT_SET 48 +#define A_OPT_UNSET 49 +#define A_F_FOREVER 50 +#define A_GOPOS 51 +#define A_REMOVE_FILE 52 +#define A_NEXT_TAG 53 +#define A_PREV_TAG 54 +#define A_FILTER 55 +#define A_F_UNTIL_HILITE 56 +#define A_GOEND_BUF 57 +#define A_LLSHIFT 58 +#define A_RRSHIFT 59 +#define A_CLRMARK 62 +#define A_SETMARKBOT 63 -#define A_INVALID 100 -#define A_NOACTION 101 -#define A_UINVALID 102 -#define A_END_LIST 103 -#define A_SPECIAL_KEY 104 +#define A_INVALID 100 +#define A_NOACTION 101 +#define A_UINVALID 102 +#define A_END_LIST 103 +#define A_SPECIAL_KEY 104 -#define A_SKIP 127 +#define A_SKIP 127 -#define A_EXTRA 0200 +#define A_EXTRA 0200 /* Line editing characters */ -#define EC_BACKSPACE 1 -#define EC_LINEKILL 2 -#define EC_RIGHT 3 -#define EC_LEFT 4 -#define EC_W_LEFT 5 -#define EC_W_RIGHT 6 -#define EC_INSERT 7 -#define EC_DELETE 8 -#define EC_HOME 9 -#define EC_END 10 -#define EC_W_BACKSPACE 11 -#define EC_W_DELETE 12 -#define EC_UP 13 -#define EC_DOWN 14 -#define EC_EXPAND 15 -#define EC_F_COMPLETE 17 -#define EC_B_COMPLETE 18 -#define EC_LITERAL 19 -#define EC_ABORT 20 +#define EC_BACKSPACE 1 +#define EC_LINEKILL 2 +#define EC_RIGHT 3 +#define EC_LEFT 4 +#define EC_W_LEFT 5 +#define EC_W_RIGHT 6 +#define EC_INSERT 7 +#define EC_DELETE 8 +#define EC_HOME 9 +#define EC_END 10 +#define EC_W_BACKSPACE 11 +#define EC_W_DELETE 12 +#define EC_UP 13 +#define EC_DOWN 14 +#define EC_EXPAND 15 +#define EC_F_COMPLETE 17 +#define EC_B_COMPLETE 18 +#define EC_LITERAL 19 +#define EC_ABORT 20 -#define EC_NOACTION 101 -#define EC_UINVALID 102 +#define EC_NOACTION 101 +#define EC_UINVALID 102 /* Flags for editchar() */ -#define EC_PEEK 01 -#define EC_NOHISTORY 02 -#define EC_NOCOMPLETE 04 -#define EC_NORIGHTLEFT 010 +#define EC_PEEK 01 +#define EC_NOHISTORY 02 +#define EC_NOCOMPLETE 04 +#define EC_NORIGHTLEFT 010 /* Environment variable stuff */ -#define EV_OK 01 +#define EV_OK 01 /* Special keys (keys which output different strings on different terminals) */ -#define SK_SPECIAL_KEY CONTROL('K') -#define SK_RIGHT_ARROW 1 -#define SK_LEFT_ARROW 2 -#define SK_UP_ARROW 3 -#define SK_DOWN_ARROW 4 -#define SK_PAGE_UP 5 -#define SK_PAGE_DOWN 6 -#define SK_HOME 7 -#define SK_END 8 -#define SK_DELETE 9 -#define SK_INSERT 10 -#define SK_CTL_LEFT_ARROW 11 -#define SK_CTL_RIGHT_ARROW 12 -#define SK_CTL_DELETE 13 -#define SK_F1 14 -#define SK_BACKTAB 15 -#define SK_CTL_BACKSPACE 16 -#define SK_CONTROL_K 40 +#define SK_SPECIAL_KEY CONTROL('K') +#define SK_RIGHT_ARROW 1 +#define SK_LEFT_ARROW 2 +#define SK_UP_ARROW 3 +#define SK_DOWN_ARROW 4 +#define SK_PAGE_UP 5 +#define SK_PAGE_DOWN 6 +#define SK_HOME 7 +#define SK_END 8 +#define SK_DELETE 9 +#define SK_INSERT 10 +#define SK_CTL_LEFT_ARROW 11 +#define SK_CTL_RIGHT_ARROW 12 +#define SK_CTL_DELETE 13 +#define SK_F1 14 +#define SK_BACKTAB 15 +#define SK_CTL_BACKSPACE 16 +#define SK_CONTROL_K 40 Modified: head/contrib/less/cmdbuf.c ============================================================================== --- head/contrib/less/cmdbuf.c Mon Nov 20 08:12:40 2017 (r326009) +++ head/contrib/less/cmdbuf.c Mon Nov 20 08:52:33 2017 (r326010) @@ -40,7 +40,7 @@ static int in_completion = 0; static char *tk_text; static char *tk_original; static char *tk_ipoint; -static char *tk_trial; +static char *tk_trial = NULL; static struct textlist tk_tlist; #endif @@ -427,8 +427,9 @@ cmd_right() cmd_left() { char *ncp; - int width, bswidth; - + int width = 0; + int bswidth = 0; + if (cp <= cmdbuf) { /* Already at the beginning of the line */ @@ -1223,6 +1224,13 @@ cmd_char(c) *cmd_mbc_buf = c; if (IS_ASCII_OCTET(c)) cmd_mbc_buf_len = 1; +#if MSDOS_COMPILER || OS2 + else if (c == (unsigned char) '\340' && IS_ASCII_OCTET(peekcc())) + { + /* Assume a special key. */ + cmd_mbc_buf_len = 1; + } +#endif else if (IS_UTF8_LEAD(c)) { cmd_mbc_buf_len = utf_len(c); Modified: head/contrib/less/command.c ============================================================================== --- head/contrib/less/command.c Mon Nov 20 08:12:40 2017 (r326009) +++ head/contrib/less/command.c Mon Nov 20 08:52:33 2017 (r326010) @@ -27,6 +27,7 @@ extern int quit_if_one_screen; extern int squished; extern int sc_width; extern int sc_height; +extern char *kent; extern int swindow; extern int jump_sline; extern int quitting; @@ -38,9 +39,11 @@ extern int hshift; extern int bs_mode; extern int show_attn; extern int less_is_more; +extern int status_col; extern POSITION highest_hilite; +extern POSITION start_attnpos; +extern POSITION end_attnpos; extern char *every_first_cmd; -extern char *curr_altfilename; extern char version[]; extern struct scrpos initial_scrpos; extern IFILE curr_ifile; @@ -57,7 +60,6 @@ extern int screen_trashed; /* The screen has been over extern int shift_count; extern int oldbot; extern int forw_prompt; -extern int same_pos_bell; #if SHELL_ESCAPE static char *shellcmd = NULL; /* For holding last shell command for "!!" */ @@ -77,10 +79,10 @@ static int save_bs_mode; static char pipec; #endif +/* Stack of ungotten chars (via ungetcc) */ struct ungot { struct ungot *ug_next; - char ug_char; - char ug_end_command; + LWCHAR ug_char; }; static struct ungot* ungot = NULL; @@ -94,9 +96,7 @@ static void multi_search(); static void cmd_exec() { -#if HILITE_SEARCH - clear_attn(); -#endif + clear_attn(); clear_bot(); flush(); } @@ -303,11 +303,21 @@ is_erase_char(c) } /* + * Is a character a carriage return or newline? + */ + static int +is_newline_char(c) + int c; +{ + return (c == '\n' || c == '\r'); +} + +/* * Handle the first char of an option (after the initial dash). */ static int mca_opt_first_char(c) - int c; + int c; { int flag = (optflag & ~OPT_NO_PROMPT); if (flag == OPT_NO_TOGGLE) @@ -427,7 +437,7 @@ mca_opt_char(c) if (optgetname) { /* We're getting a long option name. */ - if (c != '\n' && c != '\r') + if (!is_newline_char(c)) return (mca_opt_nonfirst_char(c)); if (curropt == NULL) { @@ -595,7 +605,7 @@ mca_char(c) /* * The multichar command is terminated by a newline. */ - if (c == '\n' || c == '\r') + if (is_newline_char(c)) { /* * Execute the command. @@ -693,7 +703,7 @@ prompt() { constant char *p; - if (ungot != NULL && !ungot->ug_end_command) + if (ungot != NULL && ungot->ug_char != CHAR_END_COMMAND) { /* * No prompt necessary if commands are from @@ -775,74 +785,122 @@ dispversion() } /* + * Return a character to complete a partial command, if possible. + */ + static LWCHAR +getcc_end_command() +{ + switch (mca) + { + case A_DIGIT: + /* We have a number but no command. Treat as #g. */ + return ('g'); + case A_F_SEARCH: + case A_B_SEARCH: + /* We have "/string" but no newline. Add the \n. */ + return ('\n'); + default: + /* Some other incomplete command. Let user complete it. */ + return (getchr()); + } +} + +/* * Get command character. * The character normally comes from the keyboard, * but may come from ungotten characters * (characters previously given to ungetcc or ungetsc). */ - public int -getcc() + static LWCHAR +getccu() { + LWCHAR c; if (ungot == NULL) { - /* - * Normal case: no ungotten chars, so get one from the user. - */ - return (getchr()); - } - - /* - * Return the next ungotten char. - */ + /* Normal case: no ungotten chars. + * Get char from the user. */ + c = getchr(); + } else { + /* Ungotten chars available: + * Take the top of stack (most recent). */ struct ungot *ug = ungot; - char c = ug->ug_char; - int end_command = ug->ug_end_command; + c = ug->ug_char; ungot = ug->ug_next; free(ug); - if (end_command) - { - /* - * Command is incomplete, so try to complete it. - */ - switch (mca) - { - case A_DIGIT: - /* - * We have a number but no command. Treat as #g. - */ - return ('g'); - case A_F_SEARCH: - case A_B_SEARCH: - /* - * We have "/string" but no newline. Add the \n. - */ - return ('\n'); + if (c == CHAR_END_COMMAND) + c = getcc_end_command(); + } + return (c); +} - default: - /* - * Some other incomplete command. Let user complete it. - */ - return (getchr()); - } +/* + * Get a command character, but if we receive the orig sequence, + * convert it to the repl sequence. + */ + static LWCHAR +getcc_repl(orig, repl, gr_getc, gr_ungetc) + char const* orig; + char const* repl; + LWCHAR (*gr_getc)(VOID_PARAM); + void (*gr_ungetc)(LWCHAR); +{ + LWCHAR c; + LWCHAR keys[16]; + int ki = 0; + + c = (*gr_getc)(); + if (orig == NULL || orig[0] == '\0') + return c; + for (;;) + { + keys[ki] = c; + if (c != orig[ki] || ki >= sizeof(keys)-1) + { + /* This is not orig we have been receiving. + * If we have stashed chars in keys[], + * unget them and return the first one. */ + while (ki > 0) + (*gr_ungetc)(keys[ki--]); + return keys[0]; } - return (c); + if (orig[++ki] == '\0') + { + /* We've received the full orig sequence. + * Return the repl sequence. */ + ki = strlen(repl)-1; + while (ki > 0) + (*gr_ungetc)(repl[ki--]); + return repl[0]; + } + /* We've received a partial orig sequence (ki chars of it). + * Get next char and see if it continues to match orig. */ + c = (*gr_getc)(); } } /* + * Get command character. + */ + public int +getcc() +{ + /* Replace kent (keypad Enter) with a newline. */ + return getcc_repl(kent, "\n", getccu, ungetcc); +} + +/* * "Unget" a command character. * The next getcc() will return this character. */ public void ungetcc(c) - int c; + LWCHAR c; { struct ungot *ug = (struct ungot *) ecalloc(1, sizeof(struct ungot)); - ug->ug_char = (char) c; - ug->ug_end_command = (c == CHAR_END_COMMAND); + ug->ug_char = c; ug->ug_next = ungot; ungot = ug; } @@ -862,6 +920,17 @@ ungetsc(s) } /* + * Peek the next command character, without consuming it. + */ + public LWCHAR +peekcc() +{ + LWCHAR c = getcc(); + ungetcc(c); + return c; +} + +/* * Search for a pattern, possibly in multiple files. * If SRCH_FIRST_FILE is set, begin searching at the first file. * If SRCH_PAST_EOF is set, continue the search thru multiple files. @@ -1477,6 +1546,9 @@ commands() break; case A_UNDO_SEARCH: + /* + * Clear search string highlighting. + */ undo_search(); break; @@ -1495,60 +1567,54 @@ commands() break; case A_EXAMINE: -#if EXAMINE /* * Edit a new file. Get the filename. */ - if (secure) +#if EXAMINE + if (!secure) { - error("Command not available", NULL_PARG); - break; + start_mca(A_EXAMINE, "Examine: ", ml_examine, 0); + c = getcc(); + goto again; } - start_mca(A_EXAMINE, "Examine: ", ml_examine, 0); - c = getcc(); - goto again; -#else +#endif error("Command not available", NULL_PARG); break; -#endif case A_VISUAL: /* * Invoke an editor on the input file. */ #if EDITOR - if (secure) + if (!secure) { - error("Command not available", NULL_PARG); + if (ch_getflags() & CH_HELPFILE) + break; + if (strcmp(get_filename(curr_ifile), "-") == 0) + { + error("Cannot edit standard input", NULL_PARG); + break; + } + if (get_altfilename(curr_ifile) != NULL) + { + error("WARNING: This file was viewed via LESSOPEN", + NULL_PARG); + } + start_mca(A_SHELL, "!", ml_shell, 0); + /* + * Expand the editor prototype string + * and pass it to the system to execute. + * (Make sure the screen is displayed so the + * expansion of "+%lm" works.) + */ + make_display(); + cmd_exec(); + lsystem(pr_expand(editproto, 0), (char*)NULL); break; } - if (ch_getflags() & CH_HELPFILE) - break; - if (strcmp(get_filename(curr_ifile), "-") == 0) - { - error("Cannot edit standard input", NULL_PARG); - break; - } - if (curr_altfilename != NULL) - { - error("WARNING: This file was viewed via LESSOPEN", - NULL_PARG); - } - start_mca(A_SHELL, "!", ml_shell, 0); - /* - * Expand the editor prototype string - * and pass it to the system to execute. - * (Make sure the screen is displayed so the - * expansion of "+%lm" works.) - */ - make_display(); - cmd_exec(); - lsystem(pr_expand(editproto, 0), (char*)NULL); - break; -#else +#endif error("Command not available", NULL_PARG); break; -#endif case A_NEXT_FILE: /* @@ -1594,6 +1660,9 @@ commands() break; case A_NEXT_TAG: + /* + * Jump to the next tag in the current tag list. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Nov 20 15:03: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 65385DEDB61; Mon, 20 Nov 2017 15:03:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A5701792; Mon, 20 Nov 2017 15:03:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKF34EM016920; Mon, 20 Nov 2017 15:03:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKF34ET016918; Mon, 20 Nov 2017 15:03:04 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711201503.vAKF34ET016918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 20 Nov 2017 15:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326013 - head/release/arm64 X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/arm64 X-SVN-Commit-Revision: 326013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 15:03:05 -0000 Author: gjb Date: Mon Nov 20 15:03:03 2017 New Revision: 326013 URL: https://svnweb.freebsd.org/changeset/base/326013 Log: Use chroot(8) when invoking realpath(1) when setting BOOTFILES, otherwise realpath(1) exits due to a nonexistent directory. Sponsored by: The FreeBSD Foundation Modified: head/release/arm64/PINE64.conf head/release/arm64/RPI3.conf Modified: head/release/arm64/PINE64.conf ============================================================================== --- head/release/arm64/PINE64.conf Mon Nov 20 09:24:01 2017 (r326012) +++ head/release/arm64/PINE64.conf Mon Nov 20 15:03:03 2017 (r326013) @@ -31,7 +31,7 @@ arm_install_uboot() { env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ WITH_UNIFIED_OBJDIR=yes \ make -C ${WORLDDIR}/stand -V .OBJDIR)" - BOOTFILES="$(realpath ${BOOTFILES})" + BOOTFILES="$(chroot ${CHROOTDIR} realpath ${BOOTFILES})" chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/boot1/boot1.efi \ Modified: head/release/arm64/RPI3.conf ============================================================================== --- head/release/arm64/RPI3.conf Mon Nov 20 09:24:01 2017 (r326012) +++ head/release/arm64/RPI3.conf Mon Nov 20 15:03:03 2017 (r326013) @@ -44,7 +44,7 @@ arm_install_uboot() { env TARGET=${EMBEDDED_TARGET} TARGET_ARCH=${EMBEDDED_TARGET_ARCH} \ WITH_UNIFIED_OBJDIR=yes \ make -C ${WORLDDIR}/stand -V .OBJDIR)" - BOOTFILES="$(realpath ${BOOTFILES})" + BOOTFILES="$(chroot ${CHROOTDIR} realpath ${BOOTFILES})" chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/boot1/boot1.efi \ From owner-svn-src-head@freebsd.org Mon Nov 20 16:57: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 78D78DF0EC9; Mon, 20 Nov 2017 16:57:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::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 419E864B56; Mon, 20 Nov 2017 16:57:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id i38so16427794iod.2; Mon, 20 Nov 2017 08:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=vizLhdMJBtKlp2/yhy9NSSL6KcnBeC1IP+HKZ6NRD2c=; b=GgHFiij81Qd9TIC/OBYmFAZiQobBGowB4y8z0b32imk/a9zMximLqsZkdxueMFhqdJ 23YLp+8nsHm4ua5YLUYHDi14QESe6jYCsvtT9J6cfGi+xJmUeJY4tQ9rFyJGtwnAHycp VDMbKoJ8CF7OovB3NyUOyrGdYm7/I0IQsa2vikuGucD51dCzuS15R1Pkj0g9yJLPe48g 5SfaIK+JB3YW86+Jo9/fJGlnXI854HM27QIPwE2Qr/ap1V6nDTUCpCRDDBURDpPH/ZVN 5fAoe7+ED4CNoAj57dz2LR7KvSTXuR3dotZXW6pdD/Nqfs5GWxKkAxaIVKzaUag2h0I6 65Pg== 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=vizLhdMJBtKlp2/yhy9NSSL6KcnBeC1IP+HKZ6NRD2c=; b=WEhrAux9VW8HpB7zH70XfrMTiepRt5i3mtShZAkPtRQzbKc/qoxcDbo6hoF3uLcGgf 0/Sy5IGHDqLepHK/nTrCa+2iplgWsvCB26kNsQAN6KsnRKlpfYcnH1ABUL+I9JTUU68q As4YSaanQKPnkWaRplPeJqroS56UqAq9dEA8bUCbvOhvp0LkiKShNrnHbe6UE1PIkAD1 HVCofmXsHmHz+vKIrB0ruDSC5nRXfxH2OK282hY87TpSWZRbIhFt4O7Az5qvXePb8LX7 IzkYnxNRnFehvKEMjJVvdHFRs4CPrdDMa0+LmxO2SWiIgr8fBYsAhCaTwXQXRUWuoiav PJBA== X-Gm-Message-State: AJaThX5+3j2WKWdpMa9NJ8ylz6Iw9Gd6pDdRwaRZWH99cMVStQIUNtaX c/ZPHFLb7J07ZKNXOjAJhDj6B/1tttZsmd7BG3Q= X-Google-Smtp-Source: AGs4zMb2oJLM8wa68S7FJCydaShs5dPhpkdjMnAAiAo20E4lLp2zHOujdq+ume4Kpmd9xnTSrbv9K9dHpEWBcTSk0tg= X-Received: by 10.107.164.156 with SMTP id d28mr13072917ioj.257.1511197024349; Mon, 20 Nov 2017 08:57:04 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.14.208 with HTTP; Mon, 20 Nov 2017 08:56:43 -0800 (PST) In-Reply-To: <20171119173822.J974@besplex.bde.org> References: <201711190031.vAJ0VE9m016670@repo.freebsd.org> <20171119173822.J974@besplex.bde.org> From: Ed Maste Date: Mon, 20 Nov 2017 11:56:43 -0500 X-Google-Sender-Auth: TpakeNVdgLOPkuYoFVCU8fMMwDQ Message-ID: Subject: Re: svn commit: r325988 - head/sys/libkern To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 16:57:05 -0000 Hi Bruce, notes on a few of the points you raised (I'll look at others later): On 19 November 2017 at 04:07, Bruce Evans wrote: > > The vendor version is in libc/string. It has been ANSIfied, but the > libkern version has large churning to "optimize" it. It is the libkern > version that should have been optimized, since bcmp is unimportant in > the kernel and in most applications, but applications have a wider range > so a few might benefit from optimizing it. I presume you meant "it is the _libc_ version that should have been optimized", but could also read this as a distinction between optimized and scare-quotes "optimized." > bcmp is actually optimized > in the kernel in support.[sS] for all arches except powerpc and riscv, > so optimizing the kernel MI version of it is especially unimportant. > In libc where MD optimizations are more important, they are also not > done for arm, arm64 and sparc64. This could make a nice small project for someone to take on. > - libc version copyright comment not marked for indent protection using > "/*-" (this has been subverted to have another meaning which I forget). I don't believe there's another meaning. IIRC imp@ has pointed out that it means precisely what you've mentioned above. >> Modified: head/sys/libkern/cmpdi2.c >> Modified: head/sys/libkern/divdi3.c >> Modified: head/sys/libkern/lshrdi3.c > > Like ashrdi3.c (not ANSIfied in libc/quad). Ok, I will update libc/quad to match. > The above declaration was already correctly ANSIfied in libc/gmon. This > unimproves the style by keeping the comment misplaced at the right of the > code where it is a larger style bug than before -- not the line is too long. > ANSIfication in libc/gmon put it on a separate line. Will update the comment along with other mcount tidying. >> Modified: head/sys/libkern/strcmp.c > > The vendor version is in libc/string. It has been ANSIfied, but the commit > that did that also made another style fix. This change catches up with half > of the older change. Will update. From owner-svn-src-head@freebsd.org Mon Nov 20 19:05: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 F422FDF2FE0 for ; Mon, 20 Nov 2017 19:05:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B4EB068588 for ; Mon, 20 Nov 2017 19:05:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22d.google.com with SMTP id x28so13240491ita.0 for ; Mon, 20 Nov 2017 11:05:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Mc2oeDUaObUVVjBiG0/hTSjex6O5hYNtWMeGt/gaFc8=; b=kDXNRr9QkiJIDY7QvObZqtYZeWf8M2BGE+D3ZTy4g9lcrYj+HfwgmQYdMfse64hy5r fqP/IWMGs++s9v0KsS5unWgSF4/nJhGoRYgI0EHaBwniFw2gbqvHw38jPzD+NUbYznIX jWQWoiV14zrN+OnBPPjl1/iwWj2VNhclwqPLRqpo0F3oyjeGt2eedMH1mHi40kxDTdTF l5zI0KaZcOBsBZUUmcDe7FiCCCGKuYxVlqm0tX6jvgO/UOHdqXFZ1bs23T4JKOHPKMY1 XSBzAcMJcerDogy/+eUbmI+rZRC8aGQXd+QHYqmrtVamuIotcU0nHd4TpuCBKBpsJ1Hh 7Cxw== 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=Mc2oeDUaObUVVjBiG0/hTSjex6O5hYNtWMeGt/gaFc8=; b=UVUdmi+sHG4012Hq6NGbMqQQiA+Juk4u6SoTsrIO0AhmotMImOBInLZsOcVyWoHvXy ufzTSeszVkz0JV3YKYeJxqnPxF3o552VJm3vseni0CQBgBD2enoy/qPpjQpOloANt2K6 Im8riRif2btLiPEORyCDrqM9wpSdXeNZOwhNd99YR+CP9EnraZGViTmlFh7qJ60QHnYA uZkLzkjUzj3JFmTTIYhhms+zh4mh56DpjJdTI3vYQlz2DaIxBrRNRmAG3+xNOrGfkpzA MYrWO2o3xN51CPZ45KYeT3RntaxufAIvq2sK4Lf/IgdbBEqY55wr9cr8Z2q9Oo8kE8k8 KnTw== X-Gm-Message-State: AJaThX5A4m8npgHoLNrQtf3j9Ow9XQ4nESUL7anfu8IgM7BqWlEke9JT Jd9oHwcjzYS7oSpz/wSKQG5EQk9av/d1Y67Fl5JCbw== X-Google-Smtp-Source: AGs4zMbrigKhNRTkwJfYDDOvT7tSy8RJXCfrEFDMjtkTGr2xmi3p1gXJya15lWRwMfRhsO5vCrmwYApTW3H9qGs8Xeo= X-Received: by 10.36.94.129 with SMTP id h123mr14933363itb.64.1511204755782; Mon, 20 Nov 2017 11:05:55 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Mon, 20 Nov 2017 11:05:54 -0800 (PST) X-Originating-IP: [67.135.20.194] Received: by 10.79.108.204 with HTTP; Mon, 20 Nov 2017 11:05:54 -0800 (PST) In-Reply-To: References: <201711190031.vAJ0VE9m016670@repo.freebsd.org> <20171119173822.J974@besplex.bde.org> From: Warner Losh Date: Mon, 20 Nov 2017 12:05:54 -0700 X-Google-Sender-Auth: kJDC1RM9Hh95M8b_J6BBgpLNCaw Message-ID: Subject: Re: svn commit: r325988 - head/sys/libkern To: Ed Maste Cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 19:05:57 -0000 On Nov 20, 2017 9:57 AM, "Ed Maste" wrote: Hi Bruce, notes on a few of the points you raised (I'll look at others later): On 19 November 2017 at 04:07, Bruce Evans wrote: > > The vendor version is in libc/string. It has been ANSIfied, but the > libkern version has large churning to "optimize" it. It is the libkern > version that should have been optimized, since bcmp is unimportant in > the kernel and in most applications, but applications have a wider range > so a few might benefit from optimizing it. I presume you meant "it is the _libc_ version that should have been optimized", but could also read this as a distinction between optimized and scare-quotes "optimized." > bcmp is actually optimized > in the kernel in support.[sS] for all arches except powerpc and riscv, > so optimizing the kernel MI version of it is especially unimportant. > In libc where MD optimizations are more important, they are also not > done for arm, arm64 and sparc64. This could make a nice small project for someone to take on. > - libc version copyright comment not marked for indent protection using > "/*-" (this has been subverted to have another meaning which I forget). I don't believe there's another meaning. IIRC imp@ has pointed out that it means precisely what you've mentioned above. All our copyright notices are marked for protection from indent. I made that change. It was so that we could filter out all the extra junk quickly in the conformance scripts people were writing. And these things should be protected from indent too. Warner >> Modified: head/sys/libkern/cmpdi2.c >> Modified: head/sys/libkern/divdi3.c >> Modified: head/sys/libkern/lshrdi3.c > > Like ashrdi3.c (not ANSIfied in libc/quad). Ok, I will update libc/quad to match. > The above declaration was already correctly ANSIfied in libc/gmon. This > unimproves the style by keeping the comment misplaced at the right of the > code where it is a larger style bug than before -- not the line is too long. > ANSIfication in libc/gmon put it on a separate line. Will update the comment along with other mcount tidying. >> Modified: head/sys/libkern/strcmp.c > > The vendor version is in libc/string. It has been ANSIfied, but the commit > that did that also made another style fix. This change catches up with half > of the older change. Will update. From owner-svn-src-head@freebsd.org Mon Nov 20 19:17: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 E63A9DF326F; Mon, 20 Nov 2017 19:17:44 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B35D968B53; Mon, 20 Nov 2017 19:17:44 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKJHhTs021267; Mon, 20 Nov 2017 19:17:43 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJHhwS021266; Mon, 20 Nov 2017 19:17:43 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201711201917.vAKJHhwS021266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 20 Nov 2017 19:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326019 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 326019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 19:17:45 -0000 Author: wulf Date: Mon Nov 20 19:17:43 2017 New Revision: 326019 URL: https://svnweb.freebsd.org/changeset/base/326019 Log: evdev: Export EVDEV_SUPPORT kernel option through feature facility Suggested by: netchild Reviewed by: gonzo Approved by: gonzo (mentor) MFC after: 1 week Modified: head/sys/dev/evdev/evdev.c Modified: head/sys/dev/evdev/evdev.c ============================================================================== --- head/sys/dev/evdev/evdev.c Mon Nov 20 19:05:53 2017 (r326018) +++ head/sys/dev/evdev/evdev.c Mon Nov 20 19:17:43 2017 (r326019) @@ -50,6 +50,9 @@ #ifdef FEATURE FEATURE(evdev, "Input event devices support"); +#ifdef EVDEV_SUPPORT +FEATURE(evdev_support, "Evdev support in hybrid drivers"); +#endif #endif enum evdev_sparse_result From owner-svn-src-head@freebsd.org Mon Nov 20 19:20:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E268DF32FE; Mon, 20 Nov 2017 19:20:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ADA668CD0; Mon, 20 Nov 2017 19:20:06 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKJK5dN021409; Mon, 20 Nov 2017 19:20:05 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJK5Mw021408; Mon, 20 Nov 2017 19:20:05 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201711201920.vAKJK5Mw021408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 20 Nov 2017 19:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326020 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 326020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 19:20:06 -0000 Author: wulf Date: Mon Nov 20 19:20:05 2017 New Revision: 326020 URL: https://svnweb.freebsd.org/changeset/base/326020 Log: Fix evdev codes for slash and asterisk numpad keys of AT-keyboards Reviewed by: gonzo Approved by: gonzo (mentor) MFC after: 2 weeks Modified: head/sys/dev/evdev/evdev_utils.c Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Mon Nov 20 19:17:43 2017 (r326019) +++ head/sys/dev/evdev/evdev_utils.c Mon Nov 20 19:20:05 2017 (r326020) @@ -131,7 +131,7 @@ static uint16_t evdev_at_set1_scancodes[] = { KEY_APOSTROPHE, KEY_GRAVE, KEY_LEFTSHIFT, KEY_BACKSLASH, KEY_Z, KEY_X, KEY_C, KEY_V, KEY_B, KEY_N, KEY_M, KEY_COMMA, - KEY_DOT, KEY_SLASH, KEY_RIGHTSHIFT, NONE, + KEY_DOT, KEY_SLASH, KEY_RIGHTSHIFT, KEY_KPASTERISK, KEY_LEFTALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, /* 0x40 - 0x5f */ @@ -167,7 +167,7 @@ static uint16_t evdev_at_set1_scancodes[] = { NONE, NONE, NONE, NONE, NONE, NONE, KEY_VOLUMEDOWN, NONE, KEY_VOLUMEUP, NONE, KEY_HOMEPAGE, NONE, - NONE, KEY_KPASTERISK, NONE, KEY_SYSRQ, + NONE, KEY_KPSLASH, NONE, KEY_SYSRQ, KEY_RIGHTALT, NONE, NONE, NONE, NONE, NONE, NONE, NONE, /* 0x40 - 0x5f. 0xE0 prefixed */ From owner-svn-src-head@freebsd.org Mon Nov 20 19:25: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 D0A05DF34F3; Mon, 20 Nov 2017 19:25:23 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 932C16912C; Mon, 20 Nov 2017 19:25:23 +0000 (UTC) (envelope-from wulf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKJPMiR025431; Mon, 20 Nov 2017 19:25:22 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJPMDG025430; Mon, 20 Nov 2017 19:25:22 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <201711201925.vAKJPMDG025430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Mon, 20 Nov 2017 19:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326021 - head/sys/dev/evdev X-SVN-Group: head X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: head/sys/dev/evdev X-SVN-Commit-Revision: 326021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 19:25:23 -0000 Author: wulf Date: Mon Nov 20 19:25:22 2017 New Revision: 326021 URL: https://svnweb.freebsd.org/changeset/base/326021 Log: evdev: change USB scancode 0x54 from KEY_SLASH to KEY_KPSLASH Submitted by: dumbbell Reviewed by: gonzo, wulf Approved by: gonzo (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D12983 Modified: head/sys/dev/evdev/evdev_utils.c Modified: head/sys/dev/evdev/evdev_utils.c ============================================================================== --- head/sys/dev/evdev/evdev_utils.c Mon Nov 20 19:20:05 2017 (r326020) +++ head/sys/dev/evdev/evdev_utils.c Mon Nov 20 19:25:22 2017 (r326021) @@ -64,7 +64,7 @@ static uint16_t evdev_usb_scancodes[256] = { KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP, KEY_DELETE, KEY_END, KEY_PAGEDOWN, KEY_RIGHT, KEY_LEFT, KEY_DOWN, KEY_UP, KEY_NUMLOCK, - KEY_SLASH, KEY_KPASTERISK, KEY_KPMINUS, KEY_KPPLUS, + KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS, KEY_KPPLUS, KEY_KPENTER, KEY_KP1, KEY_KP2, KEY_KP3, KEY_KP4, KEY_KP5, KEY_KP6, KEY_KP7, /* 0x60 - 0x7f */ From owner-svn-src-head@freebsd.org Mon Nov 20 19:36: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 D05DBDF385C; Mon, 20 Nov 2017 19:36:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EC99696FB; Mon, 20 Nov 2017 19:36:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKJaXpl029716; Mon, 20 Nov 2017 19:36:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJaLSd029596; Mon, 20 Nov 2017 19:36:21 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711201936.vAKJaLSd029596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Nov 2017 19:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326022 - in head/sys/dev: bce bwi bxe cfi cy dpms e1000 et fb fdc fxp ic ixgb ixgbe md mge mii mps mpt mpt/mpilib nmdm oce ofw sio tws usb usb/controller usb/misc usb/net virtio virtio... X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys/dev: bce bwi bxe cfi cy dpms e1000 et fb fdc fxp ic ixgb ixgbe md mge mii mps mpt mpt/mpilib nmdm oce ofw sio tws usb usb/controller usb/misc usb/net virtio virtio/balloon virtio/block vir... X-SVN-Commit-Revision: 326022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 19:36:34 -0000 Author: pfg Date: Mon Nov 20 19:36:21 2017 New Revision: 326022 URL: https://svnweb.freebsd.org/changeset/base/326022 Log: sys/dev: further adoption of SPDX licensing ID tags. Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Modified: head/sys/dev/bce/if_bce.c head/sys/dev/bce/if_bcefw.h head/sys/dev/bce/if_bcereg.h head/sys/dev/bwi/bwimac.c head/sys/dev/bwi/bwimac.h head/sys/dev/bwi/bwiphy.c head/sys/dev/bwi/bwiphy.h head/sys/dev/bwi/bwirf.c head/sys/dev/bwi/bwirf.h head/sys/dev/bwi/if_bwi.c head/sys/dev/bwi/if_bwireg.h head/sys/dev/bwi/if_bwivar.h head/sys/dev/bxe/57710_init_values.c head/sys/dev/bxe/57710_int_offsets.h head/sys/dev/bxe/57711_init_values.c head/sys/dev/bxe/57711_int_offsets.h head/sys/dev/bxe/57712_init_values.c head/sys/dev/bxe/57712_int_offsets.h head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_dcb.h head/sys/dev/bxe/bxe_debug.c head/sys/dev/bxe/bxe_elink.c head/sys/dev/bxe/bxe_elink.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/bxe_stats.h head/sys/dev/bxe/ecore_fw_defs.h head/sys/dev/bxe/ecore_hsi.h head/sys/dev/bxe/ecore_init.h head/sys/dev/bxe/ecore_init_ops.h head/sys/dev/bxe/ecore_mfw_req.h head/sys/dev/bxe/ecore_reg.h head/sys/dev/bxe/ecore_sp.c head/sys/dev/bxe/ecore_sp.h head/sys/dev/cfi/cfi_bus_fdt.c head/sys/dev/cfi/cfi_core.c head/sys/dev/cfi/cfi_dev.c head/sys/dev/cfi/cfi_reg.h head/sys/dev/cfi/cfi_var.h head/sys/dev/cy/cyreg.h head/sys/dev/dpms/dpms.c head/sys/dev/e1000/e1000_80003es2lan.c head/sys/dev/e1000/e1000_80003es2lan.h head/sys/dev/e1000/e1000_82540.c head/sys/dev/e1000/e1000_82541.c head/sys/dev/e1000/e1000_82541.h head/sys/dev/e1000/e1000_82542.c head/sys/dev/e1000/e1000_82543.c head/sys/dev/e1000/e1000_82543.h head/sys/dev/e1000/e1000_82571.c head/sys/dev/e1000/e1000_82571.h head/sys/dev/e1000/e1000_82575.c head/sys/dev/e1000/e1000_82575.h head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_api.h head/sys/dev/e1000/e1000_defines.h head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_i210.c head/sys/dev/e1000/e1000_i210.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_mac.c head/sys/dev/e1000/e1000_mac.h head/sys/dev/e1000/e1000_manage.c head/sys/dev/e1000/e1000_manage.h head/sys/dev/e1000/e1000_mbx.c head/sys/dev/e1000/e1000_mbx.h head/sys/dev/e1000/e1000_nvm.c head/sys/dev/e1000/e1000_nvm.h head/sys/dev/e1000/e1000_osdep.c head/sys/dev/e1000/e1000_osdep.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/e1000_phy.h head/sys/dev/e1000/e1000_regs.h head/sys/dev/e1000/e1000_vf.c head/sys/dev/e1000/e1000_vf.h head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/et/if_et.c head/sys/dev/et/if_etreg.h head/sys/dev/et/if_etvar.h head/sys/dev/fb/gallant12x22.c head/sys/dev/fdc/fdc.c head/sys/dev/fxp/inphy.c head/sys/dev/fxp/inphyreg.h head/sys/dev/fxp/rcvbundl.h head/sys/dev/ic/esp.h head/sys/dev/ic/i8253reg.h head/sys/dev/ic/nec765.h head/sys/dev/ic/ns16550.h head/sys/dev/ixgb/if_ixgb.c head/sys/dev/ixgb/if_ixgb.h head/sys/dev/ixgb/if_ixgb_osdep.h head/sys/dev/ixgb/ixgb_ee.c head/sys/dev/ixgb/ixgb_ee.h head/sys/dev/ixgb/ixgb_hw.c head/sys/dev/ixgb/ixgb_hw.h head/sys/dev/ixgb/ixgb_ids.h head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_82598.c head/sys/dev/ixgbe/ixgbe_82598.h head/sys/dev/ixgbe/ixgbe_82599.c head/sys/dev/ixgbe/ixgbe_82599.h head/sys/dev/ixgbe/ixgbe_api.c head/sys/dev/ixgbe/ixgbe_api.h head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_common.h head/sys/dev/ixgbe/ixgbe_dcb.c head/sys/dev/ixgbe/ixgbe_dcb.h head/sys/dev/ixgbe/ixgbe_dcb_82598.c head/sys/dev/ixgbe/ixgbe_dcb_82598.h head/sys/dev/ixgbe/ixgbe_dcb_82599.c head/sys/dev/ixgbe/ixgbe_dcb_82599.h head/sys/dev/ixgbe/ixgbe_mbx.c head/sys/dev/ixgbe/ixgbe_mbx.h head/sys/dev/ixgbe/ixgbe_osdep.h head/sys/dev/ixgbe/ixgbe_phy.c head/sys/dev/ixgbe/ixgbe_phy.h head/sys/dev/ixgbe/ixgbe_type.h head/sys/dev/ixgbe/ixgbe_vf.c head/sys/dev/ixgbe/ixgbe_vf.h head/sys/dev/ixgbe/ixgbe_x540.c head/sys/dev/ixgbe/ixgbe_x540.h head/sys/dev/md/md.c head/sys/dev/mge/if_mge.c head/sys/dev/mge/if_mgevar.h head/sys/dev/mii/e1000phyreg.h head/sys/dev/mii/truephy.c head/sys/dev/mii/truephyreg.h head/sys/dev/mps/mps_ioctl.h head/sys/dev/mps/mps_user.c head/sys/dev/mpt/mpilib/mpi.h head/sys/dev/mpt/mpilib/mpi_cnfg.h head/sys/dev/mpt/mpilib/mpi_fc.h head/sys/dev/mpt/mpilib/mpi_init.h head/sys/dev/mpt/mpilib/mpi_ioc.h head/sys/dev/mpt/mpilib/mpi_lan.h head/sys/dev/mpt/mpilib/mpi_log_fc.h head/sys/dev/mpt/mpilib/mpi_log_sas.h head/sys/dev/mpt/mpilib/mpi_raid.h head/sys/dev/mpt/mpilib/mpi_sas.h head/sys/dev/mpt/mpilib/mpi_targ.h head/sys/dev/mpt/mpilib/mpi_tool.h head/sys/dev/mpt/mpilib/mpi_type.h head/sys/dev/mpt/mpt_user.c head/sys/dev/nmdm/nmdm.c head/sys/dev/oce/oce_hw.c head/sys/dev/oce/oce_hw.h head/sys/dev/oce/oce_if.c head/sys/dev/oce/oce_if.h head/sys/dev/oce/oce_mbox.c head/sys/dev/oce/oce_queue.c head/sys/dev/oce/oce_sysctl.c head/sys/dev/oce/oce_util.c head/sys/dev/ofw/openfirmio.c head/sys/dev/ofw/openfirmio.h head/sys/dev/sio/sio.c head/sys/dev/sio/sioreg.h head/sys/dev/sio/siovar.h head/sys/dev/tws/tws.c head/sys/dev/tws/tws.h head/sys/dev/tws/tws_hdm.c head/sys/dev/tws/tws_hdm.h head/sys/dev/tws/tws_services.c head/sys/dev/tws/tws_services.h head/sys/dev/tws/tws_user.c head/sys/dev/tws/tws_user.h head/sys/dev/usb/controller/ehci_mv.c head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/if_udavreg.h head/sys/dev/usb/usb_pf.c head/sys/dev/usb/usb_pf.h head/sys/dev/virtio/balloon/virtio_balloon.h head/sys/dev/virtio/block/virtio_blk.h head/sys/dev/virtio/network/virtio_net.h head/sys/dev/virtio/pci/virtio_pci.h head/sys/dev/virtio/virtio.h head/sys/dev/virtio/virtio_ring.h head/sys/dev/vx/if_vx_pci.c head/sys/dev/vxge/include/vxge-debug.h head/sys/dev/vxge/include/vxge-defs.h head/sys/dev/vxge/include/vxge-list.h head/sys/dev/vxge/include/vxge-os-debug.h head/sys/dev/vxge/include/vxge-os-pal.h head/sys/dev/vxge/include/vxge-queue.h head/sys/dev/vxge/include/vxgehal-config.h head/sys/dev/vxge/include/vxgehal-ll.h head/sys/dev/vxge/include/vxgehal-mgmt.h head/sys/dev/vxge/include/vxgehal-mgmtaux.h head/sys/dev/vxge/include/vxgehal-stats.h head/sys/dev/vxge/include/vxgehal-status.h head/sys/dev/vxge/include/vxgehal-types.h head/sys/dev/vxge/include/vxgehal-version.h head/sys/dev/vxge/vxge-firmware.h head/sys/dev/vxge/vxge-osdep.h head/sys/dev/vxge/vxge.c head/sys/dev/vxge/vxge.h head/sys/dev/vxge/vxgehal/vxge-queue.c head/sys/dev/vxge/vxgehal/vxgehal-blockpool.c head/sys/dev/vxge/vxgehal/vxgehal-blockpool.h head/sys/dev/vxge/vxgehal/vxgehal-channel.c head/sys/dev/vxge/vxgehal/vxgehal-channel.h head/sys/dev/vxge/vxgehal/vxgehal-common-reg.h head/sys/dev/vxge/vxgehal/vxgehal-config-priv.h head/sys/dev/vxge/vxgehal/vxgehal-config.c head/sys/dev/vxge/vxgehal/vxgehal-debug.h head/sys/dev/vxge/vxgehal/vxgehal-device.c head/sys/dev/vxge/vxgehal/vxgehal-device.h head/sys/dev/vxge/vxgehal/vxgehal-doorbells.c head/sys/dev/vxge/vxgehal/vxgehal-doorbells.h head/sys/dev/vxge/vxgehal/vxgehal-driver.c head/sys/dev/vxge/vxgehal/vxgehal-driver.h head/sys/dev/vxge/vxgehal/vxgehal-fifo.c head/sys/dev/vxge/vxgehal/vxgehal-fifo.h head/sys/dev/vxge/vxgehal/vxgehal-ifmsg.c head/sys/dev/vxge/vxgehal/vxgehal-ifmsg.h head/sys/dev/vxge/vxgehal/vxgehal-legacy-reg.h head/sys/dev/vxge/vxgehal/vxgehal-memrepair-reg.h head/sys/dev/vxge/vxgehal/vxgehal-mgmt.c head/sys/dev/vxge/vxgehal/vxgehal-mgmtaux.c head/sys/dev/vxge/vxgehal/vxgehal-mm.c head/sys/dev/vxge/vxgehal/vxgehal-mm.h head/sys/dev/vxge/vxgehal/vxgehal-mrpcim-reg.h head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.h head/sys/dev/vxge/vxgehal/vxgehal-pcicfgmgmt-reg.h head/sys/dev/vxge/vxgehal/vxgehal-regdefs.h head/sys/dev/vxge/vxgehal/vxgehal-regs.h head/sys/dev/vxge/vxgehal/vxgehal-ring.c head/sys/dev/vxge/vxgehal/vxgehal-ring.h head/sys/dev/vxge/vxgehal/vxgehal-srpcim-reg.h head/sys/dev/vxge/vxgehal/vxgehal-srpcim.c head/sys/dev/vxge/vxgehal/vxgehal-srpcim.h head/sys/dev/vxge/vxgehal/vxgehal-swapper.c head/sys/dev/vxge/vxgehal/vxgehal-swapper.h head/sys/dev/vxge/vxgehal/vxgehal-toc-reg.h head/sys/dev/vxge/vxgehal/vxgehal-virtualpath.c head/sys/dev/vxge/vxgehal/vxgehal-virtualpath.h head/sys/dev/vxge/vxgehal/vxgehal-vpath-reg.h head/sys/dev/vxge/vxgehal/vxgehal-vpmgmt-reg.h head/sys/dev/vxge/vxgehal/vxgehal.h head/sys/dev/vxge/vxgell-version.h head/sys/dev/xen/pcifront/pcifront.c Modified: head/sys/dev/bce/if_bce.c ============================================================================== --- head/sys/dev/bce/if_bce.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bce/if_bce.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2006-2014 QLogic Corporation * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bce/if_bcefw.h ============================================================================== --- head/sys/dev/bce/if_bcefw.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bce/if_bcefw.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2006-2014 QLogic Corporation * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bce/if_bcereg.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2006-2014 QLogic Corporation * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bwi/bwimac.c ============================================================================== --- head/sys/dev/bwi/bwimac.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bwi/bwimac.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/bwi/bwimac.h ============================================================================== --- head/sys/dev/bwi/bwimac.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bwi/bwimac.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/bwi/bwiphy.c ============================================================================== --- head/sys/dev/bwi/bwiphy.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bwi/bwiphy.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/bwi/bwiphy.h ============================================================================== --- head/sys/dev/bwi/bwiphy.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bwi/bwiphy.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/bwi/bwirf.c ============================================================================== --- head/sys/dev/bwi/bwirf.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bwi/bwirf.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/bwi/bwirf.h ============================================================================== --- head/sys/dev/bwi/bwirf.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bwi/bwirf.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bwi/if_bwi.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/bwi/if_bwireg.h ============================================================================== --- head/sys/dev/bwi/if_bwireg.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bwi/if_bwireg.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/bwi/if_bwivar.h ============================================================================== --- head/sys/dev/bwi/if_bwivar.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bwi/if_bwivar.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 The DragonFly Project. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/bxe/57710_init_values.c ============================================================================== --- head/sys/dev/bxe/57710_init_values.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/57710_init_values.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/57710_int_offsets.h ============================================================================== --- head/sys/dev/bxe/57710_int_offsets.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/57710_int_offsets.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/57711_init_values.c ============================================================================== --- head/sys/dev/bxe/57711_init_values.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/57711_init_values.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/57711_int_offsets.h ============================================================================== --- head/sys/dev/bxe/57711_int_offsets.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/57711_int_offsets.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/57712_init_values.c ============================================================================== --- head/sys/dev/bxe/57712_init_values.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/57712_init_values.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/57712_int_offsets.h ============================================================================== --- head/sys/dev/bxe/57712_int_offsets.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/57712_int_offsets.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/bxe.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/bxe.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/bxe_dcb.h ============================================================================== --- head/sys/dev/bxe/bxe_dcb.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/bxe_dcb.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/bxe_debug.c ============================================================================== --- head/sys/dev/bxe/bxe_debug.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/bxe_debug.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/bxe_elink.c ============================================================================== --- head/sys/dev/bxe/bxe_elink.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/bxe_elink.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/bxe_elink.h ============================================================================== --- head/sys/dev/bxe/bxe_elink.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/bxe_elink.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/bxe_stats.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/bxe_stats.h ============================================================================== --- head/sys/dev/bxe/bxe_stats.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/bxe_stats.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/ecore_fw_defs.h ============================================================================== --- head/sys/dev/bxe/ecore_fw_defs.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/ecore_fw_defs.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/ecore_hsi.h ============================================================================== --- head/sys/dev/bxe/ecore_hsi.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/ecore_hsi.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/ecore_init.h ============================================================================== --- head/sys/dev/bxe/ecore_init.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/ecore_init.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/ecore_init_ops.h ============================================================================== --- head/sys/dev/bxe/ecore_init_ops.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/ecore_init_ops.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/ecore_mfw_req.h ============================================================================== --- head/sys/dev/bxe/ecore_mfw_req.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/ecore_mfw_req.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/ecore_reg.h ============================================================================== --- head/sys/dev/bxe/ecore_reg.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/ecore_reg.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/ecore_sp.c ============================================================================== --- head/sys/dev/bxe/ecore_sp.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/ecore_sp.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/bxe/ecore_sp.h ============================================================================== --- head/sys/dev/bxe/ecore_sp.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/bxe/ecore_sp.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2007-2017 QLogic Corporation. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/cfi/cfi_bus_fdt.c ============================================================================== --- head/sys/dev/cfi/cfi_bus_fdt.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/cfi/cfi_bus_fdt.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007, Juniper Networks, Inc. * All rights reserved. * Modified: head/sys/dev/cfi/cfi_core.c ============================================================================== --- head/sys/dev/cfi/cfi_core.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/cfi/cfi_core.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007, Juniper Networks, Inc. * Copyright (c) 2012-2013, SRI International * All rights reserved. Modified: head/sys/dev/cfi/cfi_dev.c ============================================================================== --- head/sys/dev/cfi/cfi_dev.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/cfi/cfi_dev.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007, Juniper Networks, Inc. * Copyright (c) 2012-2013, SRI International * All rights reserved. Modified: head/sys/dev/cfi/cfi_reg.h ============================================================================== --- head/sys/dev/cfi/cfi_reg.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/cfi/cfi_reg.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007, Juniper Networks, Inc. * Copyright (c) 2012-2013, SRI International * All rights reserved. Modified: head/sys/dev/cfi/cfi_var.h ============================================================================== --- head/sys/dev/cfi/cfi_var.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/cfi/cfi_var.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007, Juniper Networks, Inc. * Copyright (c) 2012-2013, SRI International * All rights reserved. Modified: head/sys/dev/cy/cyreg.h ============================================================================== --- head/sys/dev/cy/cyreg.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/cy/cyreg.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1995 Bruce Evans. * All rights reserved. * Modified: head/sys/dev/dpms/dpms.c ============================================================================== --- head/sys/dev/dpms/dpms.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/dpms/dpms.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2008 Yahoo!, Inc. * All rights reserved. * Written by: John Baldwin Modified: head/sys/dev/e1000/e1000_80003es2lan.c ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_80003es2lan.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_80003es2lan.h ============================================================================== --- head/sys/dev/e1000/e1000_80003es2lan.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_80003es2lan.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82540.c ============================================================================== --- head/sys/dev/e1000/e1000_82540.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82540.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82541.c ============================================================================== --- head/sys/dev/e1000/e1000_82541.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82541.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82541.h ============================================================================== --- head/sys/dev/e1000/e1000_82541.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82541.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82542.c ============================================================================== --- head/sys/dev/e1000/e1000_82542.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82542.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82543.c ============================================================================== --- head/sys/dev/e1000/e1000_82543.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82543.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82543.h ============================================================================== --- head/sys/dev/e1000/e1000_82543.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82543.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82571.c ============================================================================== --- head/sys/dev/e1000/e1000_82571.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82571.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82571.h ============================================================================== --- head/sys/dev/e1000/e1000_82571.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82571.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82575.c ============================================================================== --- head/sys/dev/e1000/e1000_82575.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82575.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_82575.h ============================================================================== --- head/sys/dev/e1000/e1000_82575.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_82575.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_api.c ============================================================================== --- head/sys/dev/e1000/e1000_api.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_api.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_api.h ============================================================================== --- head/sys/dev/e1000/e1000_api.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_api.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_defines.h ============================================================================== --- head/sys/dev/e1000/e1000_defines.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_defines.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_hw.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_i210.c ============================================================================== --- head/sys/dev/e1000/e1000_i210.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_i210.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_i210.h ============================================================================== --- head/sys/dev/e1000/e1000_i210.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_i210.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_ich8lan.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_ich8lan.h ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_ich8lan.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_mac.c ============================================================================== --- head/sys/dev/e1000/e1000_mac.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_mac.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_mac.h ============================================================================== --- head/sys/dev/e1000/e1000_mac.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_mac.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_manage.c ============================================================================== --- head/sys/dev/e1000/e1000_manage.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_manage.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_manage.h ============================================================================== --- head/sys/dev/e1000/e1000_manage.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_manage.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_mbx.c ============================================================================== --- head/sys/dev/e1000/e1000_mbx.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_mbx.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_mbx.h ============================================================================== --- head/sys/dev/e1000/e1000_mbx.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_mbx.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_nvm.c ============================================================================== --- head/sys/dev/e1000/e1000_nvm.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_nvm.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_nvm.h ============================================================================== --- head/sys/dev/e1000/e1000_nvm.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_nvm.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_osdep.c ============================================================================== --- head/sys/dev/e1000/e1000_osdep.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_osdep.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_osdep.h ============================================================================== --- head/sys/dev/e1000/e1000_osdep.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_osdep.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_phy.c ============================================================================== --- head/sys/dev/e1000/e1000_phy.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_phy.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_phy.h ============================================================================== --- head/sys/dev/e1000/e1000_phy.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_phy.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_regs.h ============================================================================== --- head/sys/dev/e1000/e1000_regs.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_regs.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_vf.c ============================================================================== --- head/sys/dev/e1000/e1000_vf.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_vf.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/e1000_vf.h ============================================================================== --- head/sys/dev/e1000/e1000_vf.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/e1000_vf.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2015, Intel Corporation All rights reserved. Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/if_em.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2016 Matt Macy * All rights reserved. * Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/e1000/if_em.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2016 Matt Macy * All rights reserved. * Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/et/if_et.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 Sepherosa Ziehau. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/et/if_etreg.h ============================================================================== --- head/sys/dev/et/if_etreg.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/et/if_etreg.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 Sepherosa Ziehau. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/et/if_etvar.h ============================================================================== --- head/sys/dev/et/if_etvar.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/et/if_etvar.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 Sepherosa Ziehau. All rights reserved. * * This code is derived from software contributed to The DragonFly Project Modified: head/sys/dev/fb/gallant12x22.c ============================================================================== --- head/sys/dev/fb/gallant12x22.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/fb/gallant12x22.c Mon Nov 20 19:36:21 2017 (r326022) @@ -2,6 +2,8 @@ /* $NetBSD: gallant12x22.h,v 1.2 1999/05/18 21:51:58 ad Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/dev/fdc/fdc.c ============================================================================== --- head/sys/dev/fdc/fdc.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/fdc/fdc.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2004 Poul-Henning Kamp * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. Modified: head/sys/dev/fxp/inphy.c ============================================================================== --- head/sys/dev/fxp/inphy.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/fxp/inphy.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2001 Jonathan Lemon * All rights reserved. * Modified: head/sys/dev/fxp/inphyreg.h ============================================================================== --- head/sys/dev/fxp/inphyreg.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/fxp/inphyreg.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2001 Jonathan Lemon * All rights reserved. * Modified: head/sys/dev/fxp/rcvbundl.h ============================================================================== --- head/sys/dev/fxp/rcvbundl.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/fxp/rcvbundl.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- +SPDX-License-Identifier: BSD-3-Clause + Copyright (c) 1999-2001, Intel Corporation All rights reserved. Modified: head/sys/dev/ic/esp.h ============================================================================== --- head/sys/dev/ic/esp.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ic/esp.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1995 Sean Eric Fagan. * All rights reserved. * Modified: head/sys/dev/ic/i8253reg.h ============================================================================== --- head/sys/dev/ic/i8253reg.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ic/i8253reg.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 The Regents of the University of California. * All rights reserved. * Modified: head/sys/dev/ic/nec765.h ============================================================================== --- head/sys/dev/ic/nec765.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ic/nec765.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991 The Regents of the University of California. * All rights reserved. * Modified: head/sys/dev/ic/ns16550.h ============================================================================== --- head/sys/dev/ic/ns16550.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ic/ns16550.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991 The Regents of the University of California. * All rights reserved. * Modified: head/sys/dev/ixgb/if_ixgb.c ============================================================================== --- head/sys/dev/ixgb/if_ixgb.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgb/if_ixgb.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /******************************************************************************* +SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2004, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgb/if_ixgb.h ============================================================================== --- head/sys/dev/ixgb/if_ixgb.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgb/if_ixgb.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /******************************************************************************* +SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2004, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgb/if_ixgb_osdep.h ============================================================================== --- head/sys/dev/ixgb/if_ixgb_osdep.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgb/if_ixgb_osdep.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /******************************************************************************* +SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2004, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgb/ixgb_ee.c ============================================================================== --- head/sys/dev/ixgb/ixgb_ee.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgb/ixgb_ee.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /******************************************************************************* + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2004, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgb/ixgb_ee.h ============================================================================== --- head/sys/dev/ixgb/ixgb_ee.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgb/ixgb_ee.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /******************************************************************************* + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2004, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgb/ixgb_hw.c ============================================================================== --- head/sys/dev/ixgb/ixgb_hw.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgb/ixgb_hw.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /******************************************************************************* + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2004, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgb/ixgb_hw.h ============================================================================== --- head/sys/dev/ixgb/ixgb_hw.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgb/ixgb_hw.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /******************************************************************************* + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2004, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgb/ixgb_ids.h ============================================================================== --- head/sys/dev/ixgb/ixgb_ids.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgb/ixgb_ids.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /******************************************************************************* + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2004, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_82598.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82598.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_82598.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_82598.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82598.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_82598.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82599.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_82599.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_82599.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_82599.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_82599.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_api.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_api.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_api.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_api.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_api.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_api.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_common.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_common.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_common.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_common.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_common.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_common.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_dcb.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_dcb.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_dcb.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_dcb.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_dcb.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_dcb.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_dcb_82598.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_dcb_82598.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_dcb_82598.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_dcb_82598.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_dcb_82598.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_dcb_82598.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_dcb_82599.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_dcb_82599.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_dcb_82599.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_dcb_82599.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_dcb_82599.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_dcb_82599.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_mbx.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_mbx.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_mbx.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_mbx.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_mbx.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_mbx.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_osdep.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe_osdep.h Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_osdep.h Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2001-2017, Intel Corporation All rights reserved. Modified: head/sys/dev/ixgbe/ixgbe_phy.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe_phy.c Mon Nov 20 19:25:22 2017 (r326021) +++ head/sys/dev/ixgbe/ixgbe_phy.c Mon Nov 20 19:36:21 2017 (r326022) @@ -1,4 +1,5 @@ /****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Nov 20 19:43: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 4690ADF3B32; Mon, 20 Nov 2017 19:43:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A847E69C47; Mon, 20 Nov 2017 19:43:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKJht5u033742; Mon, 20 Nov 2017 19:43:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJhjWn033633; Mon, 20 Nov 2017 19:43:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711201943.vAKJhjWn033633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Nov 2017 19:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326023 - in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm arm/arm arm/freescale/imx arm/include arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion arm/ti arm/versatile arm... X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 amd64/include amd64/vmm arm/arm arm/freescale/imx arm/include arm/mv arm/mv/discovery arm/mv/kirkwood arm/mv/orion arm/ti arm/versatile arm/xscale/ixp425 bsm compat... X-SVN-Commit-Revision: 326023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 19:43:57 -0000 Author: pfg Date: Mon Nov 20 19:43:44 2017 New Revision: 326023 URL: https://svnweb.freebsd.org/changeset/base/326023 Log: sys: further adoption of SPDX licensing ID tags. Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Modified: head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/amd64/amd64/bpf_jit_machdep.h head/sys/amd64/amd64/fpu.c head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/mem.c head/sys/amd64/amd64/sys_machdep.c head/sys/amd64/amd64/uio_machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/include/asm.h head/sys/amd64/include/asmacros.h head/sys/amd64/include/cpu.h head/sys/amd64/include/cpufunc.h head/sys/amd64/include/exec.h head/sys/amd64/include/fpu.h head/sys/amd64/include/in_cksum.h head/sys/amd64/include/limits.h head/sys/amd64/include/md_var.h head/sys/amd64/include/pcb.h head/sys/amd64/include/pmap.h head/sys/amd64/include/proc.h head/sys/amd64/include/profile.h head/sys/amd64/include/reloc.h head/sys/amd64/include/segments.h head/sys/amd64/include/tss.h head/sys/amd64/vmm/vmm_stat.h head/sys/arm/arm/mem.c head/sys/arm/arm/sys_machdep.c head/sys/arm/arm/uio_machdep.c head/sys/arm/freescale/imx/imx_common.c head/sys/arm/include/_limits.h head/sys/arm/include/asm.h head/sys/arm/include/endian.h head/sys/arm/include/exec.h head/sys/arm/include/float.h head/sys/arm/include/ieee.h head/sys/arm/include/in_cksum.h head/sys/arm/include/limits.h head/sys/arm/include/md_var.h head/sys/arm/include/pmap.h head/sys/arm/include/signal.h head/sys/arm/include/stdarg.h head/sys/arm/include/vmparam.h head/sys/arm/mv/discovery/discovery.c head/sys/arm/mv/kirkwood/kirkwood.c head/sys/arm/mv/mv_common.c head/sys/arm/mv/mv_pci.c head/sys/arm/mv/mvreg.h head/sys/arm/mv/mvwin.h head/sys/arm/mv/orion/db88f5xxx.c head/sys/arm/mv/orion/orion.c head/sys/arm/mv/rtc.c head/sys/arm/ti/ti_edma3.c head/sys/arm/versatile/versatile_common.c head/sys/arm/xscale/ixp425/if_npereg.h head/sys/arm/xscale/ixp425/ixp425_npe.c head/sys/arm/xscale/ixp425/ixp425_npereg.h head/sys/arm/xscale/ixp425/ixp425_qmgr.c head/sys/arm/xscale/ixp425/ixp425_qmgr.h head/sys/bsm/audit.h head/sys/bsm/audit_domain.h head/sys/bsm/audit_errno.h head/sys/bsm/audit_fcntl.h head/sys/bsm/audit_internal.h head/sys/bsm/audit_kevents.h head/sys/bsm/audit_record.h head/sys/bsm/audit_socket_type.h head/sys/compat/freebsd32/freebsd32_ioctl.c head/sys/compat/freebsd32/freebsd32_ioctl.h head/sys/conf/newvers.sh head/sys/conf/systags.sh head/sys/crypto/sha1.c head/sys/crypto/sha1.h head/sys/ddb/db_ps.c head/sys/ddb/ddb.h head/sys/fs/cd9660/cd9660_bmap.c head/sys/fs/cd9660/cd9660_lookup.c head/sys/fs/cd9660/cd9660_mount.h head/sys/fs/cd9660/cd9660_node.c head/sys/fs/cd9660/cd9660_node.h head/sys/fs/cd9660/cd9660_rrip.c head/sys/fs/cd9660/cd9660_rrip.h head/sys/fs/cd9660/cd9660_util.c head/sys/fs/cd9660/cd9660_vfsops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/cd9660/iso.h head/sys/fs/cd9660/iso_rrip.h head/sys/fs/deadfs/dead_vnops.c head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_mount.h head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/fs.h head/sys/fs/ext2fs/inode.h head/sys/fs/fdescfs/fdesc.h head/sys/fs/fdescfs/fdesc_vfsops.c head/sys/fs/fdescfs/fdesc_vnops.c head/sys/fs/fifofs/fifo_vnops.c head/sys/fs/fuse/fuse.h head/sys/fs/fuse/fuse_debug.h head/sys/fs/fuse/fuse_device.c head/sys/fs/fuse/fuse_file.c head/sys/fs/fuse/fuse_file.h head/sys/fs/fuse/fuse_internal.c head/sys/fs/fuse/fuse_internal.h head/sys/fs/fuse/fuse_io.c head/sys/fs/fuse/fuse_io.h head/sys/fs/fuse/fuse_ipc.c head/sys/fs/fuse/fuse_ipc.h head/sys/fs/fuse/fuse_kernel.h head/sys/fs/fuse/fuse_main.c head/sys/fs/fuse/fuse_node.c head/sys/fs/fuse/fuse_node.h head/sys/fs/fuse/fuse_param.h head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/nfs/nfs.h head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfsm_subs.h head/sys/fs/nfs/nfsport.h head/sys/fs/nfs/nfsproto.h head/sys/fs/nfs/nfsrvcache.h head/sys/fs/nfs/rpcv2.h head/sys/fs/nfs/xdr_subs.h head/sys/fs/nfsclient/nfs.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clkrpc.c head/sys/fs/nfsclient/nfs_clnfsiod.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clsubs.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsclient/nfsmount.h head/sys/fs/nfsclient/nfsnode.h head/sys/fs/nfsserver/nfs_nfsdcache.c head/sys/fs/nfsserver/nfs_nfsdkrpc.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdsubs.c head/sys/fs/nullfs/null.h head/sys/fs/nullfs/null_subr.c head/sys/fs/nullfs/null_vfsops.c head/sys/fs/nullfs/null_vnops.c head/sys/fs/procfs/procfs.h head/sys/fs/procfs/procfs_dbregs.c head/sys/fs/procfs/procfs_fpregs.c head/sys/fs/procfs/procfs_map.c head/sys/fs/procfs/procfs_mem.c head/sys/fs/procfs/procfs_note.c head/sys/fs/procfs/procfs_osrel.c head/sys/fs/procfs/procfs_regs.c head/sys/fs/procfs/procfs_status.c head/sys/fs/procfs/procfs_type.c head/sys/fs/unionfs/union.h head/sys/fs/unionfs/union_subr.c head/sys/fs/unionfs/union_vfsops.c head/sys/fs/unionfs/union_vnops.c head/sys/i386/i386/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.h head/sys/i386/i386/genassym.c head/sys/i386/i386/in_cksum.c head/sys/i386/i386/mem.c head/sys/i386/i386/sys_machdep.c head/sys/i386/i386/uio_machdep.c head/sys/i386/include/asm.h head/sys/i386/include/asmacros.h head/sys/i386/include/cpu.h head/sys/i386/include/cpufunc.h head/sys/i386/include/exec.h head/sys/i386/include/in_cksum.h head/sys/i386/include/limits.h head/sys/i386/include/md_var.h head/sys/i386/include/npx.h head/sys/i386/include/param.h head/sys/i386/include/pcb.h head/sys/i386/include/pmap.h head/sys/i386/include/proc.h head/sys/i386/include/profile.h head/sys/i386/include/reloc.h head/sys/i386/include/segments.h head/sys/i386/include/signal.h head/sys/i386/include/tss.h head/sys/i386/include/varargs.h head/sys/i386/include/vmparam.h head/sys/isa/isareg.h head/sys/isa/rtc.h head/sys/kern/kern_clock.c head/sys/kern/kern_cons.c head/sys/kern/kern_descrip.c head/sys/kern/kern_exit.c head/sys/kern/kern_fork.c head/sys/kern/kern_ktrace.c head/sys/kern/kern_lockf.c head/sys/kern/kern_malloc.c head/sys/kern/kern_mib.c head/sys/kern/kern_proc.c head/sys/kern/kern_prot.c head/sys/kern/kern_resource.c head/sys/kern/kern_rmlock.c head/sys/kern/kern_shutdown.c head/sys/kern/kern_sig.c head/sys/kern/kern_synch.c head/sys/kern/kern_sysctl.c head/sys/kern/kern_time.c head/sys/kern/kern_timeout.c head/sys/kern/kern_xxx.c head/sys/kern/sched_4bsd.c head/sys/kern/subr_autoconf.c head/sys/kern/subr_blist.c head/sys/kern/subr_clock.c head/sys/kern/subr_hash.c head/sys/kern/subr_log.c head/sys/kern/subr_mchain.c head/sys/kern/subr_param.c head/sys/kern/subr_pcpu.c head/sys/kern/subr_prf.c head/sys/kern/subr_prof.c head/sys/kern/subr_rtc.c head/sys/kern/subr_scanf.c head/sys/kern/subr_sglist.c head/sys/kern/subr_uio.c head/sys/kern/sys_generic.c head/sys/kern/sys_socket.c head/sys/kern/tty_compat.c head/sys/kern/tty_info.c head/sys/kern/uipc_domain.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_mbuf2.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/kern/uipc_syscalls.c head/sys/kern/uipc_usrreq.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_default.c head/sys/kern/vfs_export.c head/sys/kern/vfs_init.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_mount.c head/sys/kern/vfs_mountroot.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/kern/vfs_vnops.c head/sys/libkern/arm/muldi3.c head/sys/libkern/ashldi3.c head/sys/libkern/ashrdi3.c head/sys/libkern/bcmp.c head/sys/libkern/bsearch.c head/sys/libkern/cmpdi2.c head/sys/libkern/divdi3.c head/sys/libkern/ffs.c head/sys/libkern/ffsl.c head/sys/libkern/fls.c head/sys/libkern/flsl.c head/sys/libkern/flsll.c head/sys/libkern/fnmatch.c head/sys/libkern/lshrdi3.c head/sys/libkern/mcount.c head/sys/libkern/memchr.c head/sys/libkern/memcmp.c head/sys/libkern/moddi3.c head/sys/libkern/qdivrem.c head/sys/libkern/qsort.c head/sys/libkern/quad.h head/sys/libkern/random.c head/sys/libkern/scanc.c head/sys/libkern/strcat.c head/sys/libkern/strchr.c head/sys/libkern/strcmp.c head/sys/libkern/strcpy.c head/sys/libkern/strncmp.c head/sys/libkern/strncpy.c head/sys/libkern/strrchr.c head/sys/libkern/strsep.c head/sys/libkern/strtol.c head/sys/libkern/strtoq.c head/sys/libkern/strtoul.c head/sys/libkern/strtouq.c head/sys/libkern/ucmpdi2.c head/sys/libkern/udivdi3.c head/sys/libkern/umoddi3.c head/sys/mips/cavium/cvmx_config.h head/sys/mips/cavium/octe/cavium-ethernet.h head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-common.h head/sys/mips/cavium/octe/ethernet-defines.h head/sys/mips/cavium/octe/ethernet-headers.h head/sys/mips/cavium/octe/ethernet-mdio.c head/sys/mips/cavium/octe/ethernet-mdio.h head/sys/mips/cavium/octe/ethernet-mem.c head/sys/mips/cavium/octe/ethernet-mem.h head/sys/mips/cavium/octe/ethernet-rgmii.c head/sys/mips/cavium/octe/ethernet-rx.c head/sys/mips/cavium/octe/ethernet-rx.h head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-spi.c head/sys/mips/cavium/octe/ethernet-tx.c head/sys/mips/cavium/octe/ethernet-tx.h head/sys/mips/cavium/octe/ethernet-util.h head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octe/wrapper-cvmx-includes.h head/sys/mips/cavium/octeon_ds1337.c head/sys/mips/cavium/octeon_ebt3000_cf.c head/sys/mips/cavium/octeon_irq.h head/sys/mips/cavium/octeon_pcmap_regs.h head/sys/mips/cavium/octopcireg.h head/sys/mips/include/_align.h head/sys/mips/include/_limits.h head/sys/mips/include/asm.h head/sys/mips/include/cpu.h head/sys/mips/include/cpuregs.h head/sys/mips/include/endian.h head/sys/mips/include/exec.h head/sys/mips/include/float.h head/sys/mips/include/fls64.h head/sys/mips/include/ieee.h head/sys/mips/include/in_cksum.h head/sys/mips/include/limits.h head/sys/mips/include/md_var.h head/sys/mips/include/mips_opcode.h head/sys/mips/include/param.h head/sys/mips/include/pcb.h head/sys/mips/include/pmap.h head/sys/mips/include/proc.h head/sys/mips/include/profile.h head/sys/mips/include/ptrace.h head/sys/mips/include/reg.h head/sys/mips/include/regdef.h head/sys/mips/include/regnum.h head/sys/mips/include/signal.h head/sys/mips/include/sysarch.h head/sys/mips/include/trap.h head/sys/mips/include/ucontext.h head/sys/mips/include/varargs.h head/sys/mips/include/vmparam.h head/sys/mips/mips/autoconf.c head/sys/mips/mips/genassym.c head/sys/mips/mips/machdep.c head/sys/mips/mips/mem.c head/sys/mips/mips/pm_machdep.c head/sys/mips/mips/pmap.c head/sys/mips/mips/trap.c head/sys/mips/mips/uio_machdep.c head/sys/mips/mips/vm_machdep.c head/sys/mips/rmi/board.h head/sys/mips/rmi/dev/iic/at24co2n.c head/sys/mips/rmi/dev/iic/max6657.c head/sys/mips/rmi/dev/nlge/if_nlge.c head/sys/mips/rmi/dev/nlge/if_nlge.h head/sys/mips/rmi/dev/sec/desc.h head/sys/mips/rmi/dev/sec/rmilib.c head/sys/mips/rmi/dev/sec/rmilib.h head/sys/mips/rmi/dev/sec/rmisec.c head/sys/mips/rmi/dev/xlr/atx_cpld.h head/sys/mips/rmi/dev/xlr/debug.h head/sys/mips/rmi/dev/xlr/xgmac_mdio.h head/sys/mips/rmi/fmn.c head/sys/mips/rmi/interrupt.h head/sys/mips/rmi/iodi.c head/sys/mips/rmi/iomap.h head/sys/mips/rmi/msgring.c head/sys/mips/rmi/msgring.cfg head/sys/mips/rmi/msgring.h head/sys/mips/rmi/pic.h head/sys/mips/rmi/rmi_boot_info.h head/sys/mips/rmi/rmi_mips_exts.h head/sys/mips/rmi/xlr_i2c.c head/sys/mips/rmi/xlr_pci.c head/sys/mips/rmi/xlr_pcmcia.c head/sys/net/bpf.c head/sys/net/bpf.h head/sys/net/bpf_buffer.c head/sys/net/bpf_filter.c head/sys/net/bpf_jitter.c head/sys/net/bpf_jitter.h head/sys/net/bpfdesc.h head/sys/net/if.c head/sys/net/if.h head/sys/net/if_arc.h head/sys/net/if_arp.h head/sys/net/if_clone.c head/sys/net/if_clone.h head/sys/net/if_disc.c head/sys/net/if_dl.h head/sys/net/if_edsc.c head/sys/net/if_ethersubr.c head/sys/net/if_fwsubr.c head/sys/net/if_gif.c head/sys/net/if_gif.h head/sys/net/if_llc.h head/sys/net/if_loop.c head/sys/net/if_stf.c head/sys/net/if_types.h head/sys/net/if_var.h head/sys/net/ifq.h head/sys/net/pfkeyv2.h head/sys/net/radix.c head/sys/net/radix.h head/sys/net/radix_mpath.c head/sys/net/radix_mpath.h head/sys/net/raw_cb.c head/sys/net/raw_cb.h head/sys/net/raw_usrreq.c head/sys/net/route.c head/sys/net/route.h head/sys/net/rtsock.c head/sys/net/slcompress.c head/sys/net/slcompress.h head/sys/netinet/icmp6.h head/sys/netinet/icmp_var.h head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h head/sys/netinet/igmp.c head/sys/netinet/igmp.h head/sys/netinet/igmp_var.h head/sys/netinet/in.c head/sys/netinet/in.h head/sys/netinet/in_cksum.c head/sys/netinet/in_gif.c head/sys/netinet/in_pcb.c head/sys/netinet/in_pcb.h head/sys/netinet/in_proto.c head/sys/netinet/in_systm.h head/sys/netinet/in_var.h head/sys/netinet/ip.h head/sys/netinet/ip6.h head/sys/netinet/ip_divert.c head/sys/netinet/ip_ecn.c head/sys/netinet/ip_ecn.h head/sys/netinet/ip_encap.c head/sys/netinet/ip_encap.h head/sys/netinet/ip_icmp.c head/sys/netinet/ip_icmp.h head/sys/netinet/ip_input.c head/sys/netinet/ip_mroute.c head/sys/netinet/ip_mroute.h head/sys/netinet/ip_options.c head/sys/netinet/ip_options.h head/sys/netinet/ip_output.c head/sys/netinet/ip_var.h head/sys/netinet/pim.h head/sys/netinet/pim_var.h head/sys/netinet/raw_ip.c head/sys/netinet/sctp.h head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_asconf.h head/sys/netinet/sctp_auth.c head/sys/netinet/sctp_auth.h head/sys/netinet/sctp_bsd_addr.c head/sys/netinet/sctp_bsd_addr.h head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_constants.h head/sys/netinet/sctp_crc32.c head/sys/netinet/sctp_crc32.h head/sys/netinet/sctp_dtrace_declare.h head/sys/netinet/sctp_dtrace_define.h head/sys/netinet/sctp_header.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_input.h head/sys/netinet/sctp_lock_bsd.h head/sys/netinet/sctp_os.h head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_peeloff.c head/sys/netinet/sctp_peeloff.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_timer.h head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet/tcp.h head/sys/netinet/tcp_debug.c head/sys/netinet/tcp_debug.h head/sys/netinet/tcp_fsm.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_seq.h head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.h head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/netinet/tcpip.h head/sys/netinet/udp.h head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/dest6.c head/sys/netinet6/frag6.c head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6.h head/sys/netinet6/in6_cksum.c head/sys/netinet6/in6_gif.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_ifattach.h head/sys/netinet6/in6_pcb.c head/sys/netinet6/in6_pcb.h head/sys/netinet6/in6_proto.c head/sys/netinet6/in6_rmx.c head/sys/netinet6/in6_src.c head/sys/netinet6/in6_var.h head/sys/netinet6/ip6_ecn.h head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/ip6_mroute.h head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h head/sys/netinet6/ip6protosw.h head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c head/sys/netinet6/pim6.h head/sys/netinet6/pim6_var.h head/sys/netinet6/raw_ip6.c head/sys/netinet6/raw_ip6.h head/sys/netinet6/route6.c head/sys/netinet6/scope6.c head/sys/netinet6/scope6_var.h head/sys/netinet6/sctp6_usrreq.c head/sys/netinet6/sctp6_var.h head/sys/netinet6/tcp6_var.h head/sys/netinet6/udp6_usrreq.c head/sys/netinet6/udp6_var.h head/sys/netipsec/ah.h head/sys/netipsec/esp.h head/sys/netipsec/ipcomp.h head/sys/netipsec/ipcomp_var.h head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec6.h head/sys/netipsec/key.c head/sys/netipsec/key.h head/sys/netipsec/key_debug.c head/sys/netipsec/key_debug.h head/sys/netipsec/key_var.h head/sys/netipsec/keydb.h head/sys/netipsec/keysock.c head/sys/netipsec/keysock.h head/sys/netpfil/pf/in4_cksum.c head/sys/nfs/nfs_common.h head/sys/nfs/nfs_diskless.c head/sys/nfs/nfs_nfssvc.c head/sys/nfs/nfsdiskless.h head/sys/nfs/nfsproto.h head/sys/nfs/nfssvc.h head/sys/nfs/xdr_subs.h head/sys/nfsclient/nfs.h head/sys/nfsclient/nfsargs.h head/sys/nfsclient/nfsm_subs.h head/sys/nfsclient/nfsmount.h head/sys/nfsclient/nfsnode.h head/sys/nfsclient/nfsstats.h head/sys/nfsserver/nfs.h head/sys/nfsserver/nfsm_subs.h head/sys/nfsserver/nfsrvcache.h head/sys/nfsserver/nfsrvstats.h head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c head/sys/powerpc/fpu/fpu_add.c head/sys/powerpc/fpu/fpu_arith.h head/sys/powerpc/fpu/fpu_compare.c head/sys/powerpc/fpu/fpu_div.c head/sys/powerpc/fpu/fpu_emu.h head/sys/powerpc/fpu/fpu_explode.c head/sys/powerpc/fpu/fpu_implode.c head/sys/powerpc/fpu/fpu_instr.h head/sys/powerpc/fpu/fpu_mul.c head/sys/powerpc/fpu/fpu_sqrt.c head/sys/powerpc/fpu/fpu_subr.c head/sys/powerpc/include/_limits.h head/sys/powerpc/include/_stdint.h head/sys/powerpc/include/asm.h head/sys/powerpc/include/cpu.h head/sys/powerpc/include/endian.h head/sys/powerpc/include/exec.h head/sys/powerpc/include/float.h head/sys/powerpc/include/floatingpoint.h head/sys/powerpc/include/fpu.h head/sys/powerpc/include/frame.h head/sys/powerpc/include/hid.h head/sys/powerpc/include/ieee.h head/sys/powerpc/include/in_cksum.h head/sys/powerpc/include/limits.h head/sys/powerpc/include/pcb.h head/sys/powerpc/include/pio.h head/sys/powerpc/include/platform.h head/sys/powerpc/include/pmap.h head/sys/powerpc/include/proc.h head/sys/powerpc/include/psl.h head/sys/powerpc/include/pte.h head/sys/powerpc/include/ptrace.h head/sys/powerpc/include/reloc.h head/sys/powerpc/include/sigframe.h head/sys/powerpc/include/signal.h head/sys/powerpc/include/stdarg.h head/sys/powerpc/include/sysarch.h head/sys/powerpc/include/tlb.h head/sys/powerpc/include/trap.h head/sys/powerpc/include/ucontext.h head/sys/powerpc/include/varargs.h head/sys/powerpc/include/vmparam.h head/sys/powerpc/powermac/cudavar.h head/sys/powerpc/powerpc/bcopy.c head/sys/powerpc/powerpc/genassym.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/powerpc/mem.c head/sys/powerpc/powerpc/uio_machdep.c head/sys/rpc/auth.h head/sys/rpc/auth_none.c head/sys/rpc/auth_unix.c head/sys/rpc/authunix_prot.c head/sys/rpc/clnt.h head/sys/rpc/clnt_dg.c head/sys/rpc/clnt_vc.c head/sys/rpc/krpc.h head/sys/rpc/nettype.h head/sys/rpc/pmap_prot.h head/sys/rpc/rpc.h head/sys/rpc/rpc_callmsg.c head/sys/rpc/rpc_com.h head/sys/rpc/rpc_generic.c head/sys/rpc/rpc_msg.h head/sys/rpc/rpc_prot.c head/sys/rpc/rpcb_clnt.c head/sys/rpc/rpcb_clnt.h head/sys/rpc/rpcb_prot.c head/sys/rpc/rpcb_prot.h head/sys/rpc/rpcm_subs.h head/sys/rpc/rpcsec_gss/rpcsec_gss.c head/sys/rpc/rpcsec_gss/rpcsec_gss_int.h head/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c head/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c head/sys/rpc/svc.c head/sys/rpc/svc.h head/sys/rpc/svc_auth.c head/sys/rpc/svc_auth.h head/sys/rpc/svc_auth_unix.c head/sys/rpc/svc_dg.c head/sys/rpc/svc_generic.c head/sys/rpc/svc_vc.c head/sys/rpc/types.h head/sys/rpc/xdr.h head/sys/security/audit/audit.c head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c head/sys/security/audit/audit_bsm.c head/sys/security/audit/audit_bsm_klib.c head/sys/security/audit/audit_private.h head/sys/security/audit/audit_syscalls.c head/sys/security/audit/audit_worker.c head/sys/security/audit/bsm_domain.c head/sys/security/audit/bsm_errno.c head/sys/security/audit/bsm_fcntl.c head/sys/security/audit/bsm_socket_type.c head/sys/security/audit/bsm_token.c head/sys/sparc64/include/_types.h head/sys/sparc64/include/asm.h head/sys/sparc64/include/bus_common.h head/sys/sparc64/include/cpu.h head/sys/sparc64/include/endian.h head/sys/sparc64/include/float.h head/sys/sparc64/include/floatingpoint.h head/sys/sparc64/include/ieee.h head/sys/sparc64/include/in_cksum.h head/sys/sparc64/include/iommureg.h head/sys/sparc64/include/md_var.h head/sys/sparc64/include/pmap.h head/sys/sparc64/include/proc.h head/sys/sparc64/include/ptrace.h head/sys/sparc64/include/reg.h head/sys/sparc64/include/reloc.h head/sys/sparc64/include/setjmp.h head/sys/sparc64/include/signal.h head/sys/sparc64/include/sysarch.h head/sys/sparc64/include/varargs.h head/sys/sparc64/include/vmparam.h head/sys/sparc64/sparc64/in_cksum.c head/sys/sparc64/sparc64/intr_machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mem.c head/sys/sparc64/sparc64/pmap.c head/sys/sparc64/sparc64/trap.c head/sys/sparc64/sparc64/uio_machdep.c head/sys/sparc64/sparc64/vm_machdep.c head/sys/sys/_callout.h head/sys/sys/_iovec.h head/sys/sys/_kstack_cache.h head/sys/sys/_rmlock.h head/sys/sys/_sigset.h head/sys/sys/_sockaddr_storage.h head/sys/sys/_termios.h head/sys/sys/_timespec.h head/sys/sys/acct.h head/sys/sys/bio.h head/sys/sys/bitstring.h head/sys/sys/blist.h head/sys/sys/buf.h head/sys/sys/callout.h head/sys/sys/cdefs.h head/sys/sys/cfictl.h head/sys/sys/conf.h head/sys/sys/cons.h head/sys/sys/ctype.h head/sys/sys/dir.h head/sys/sys/dirent.h head/sys/sys/disklabel.h head/sys/sys/diskmbr.h head/sys/sys/dkstat.h head/sys/sys/domain.h head/sys/sys/errno.h head/sys/sys/exec.h head/sys/sys/fbio.h head/sys/sys/fcntl.h head/sys/sys/file.h head/sys/sys/filedesc.h head/sys/sys/filio.h head/sys/sys/gmon.h head/sys/sys/imgact.h head/sys/sys/imgact_aout.h head/sys/sys/ioccom.h head/sys/sys/ioctl.h head/sys/sys/ioctl_compat.h head/sys/sys/ipc.h head/sys/sys/ktrace.h head/sys/sys/libkern.h head/sys/sys/limits.h head/sys/sys/lockf.h head/sys/sys/malloc.h head/sys/sys/mbuf.h head/sys/sys/mdioctl.h head/sys/sys/mman.h head/sys/sys/mount.h head/sys/sys/mpt_ioctl.h head/sys/sys/msgbuf.h head/sys/sys/mtio.h head/sys/sys/namei.h head/sys/sys/nlist_aout.h head/sys/sys/param.h head/sys/sys/pcpu.h head/sys/sys/proc.h head/sys/sys/protosw.h head/sys/sys/ptrace.h head/sys/sys/queue.h head/sys/sys/reboot.h head/sys/sys/resource.h head/sys/sys/resourcevar.h head/sys/sys/rmlock.h head/sys/sys/select.h head/sys/sys/selinfo.h head/sys/sys/sglist.h head/sys/sys/sigio.h head/sys/sys/signal.h head/sys/sys/signalvar.h head/sys/sys/sockbuf.h head/sys/sys/socket.h head/sys/sys/socketvar.h head/sys/sys/sockio.h head/sys/sys/sockopt.h head/sys/sys/stat.h head/sys/sys/sun_disklabel.h head/sys/sys/sysctl.h head/sys/sys/sysent.h head/sys/sys/syslimits.h head/sys/sys/syslog.h head/sys/sys/systm.h head/sys/sys/time.h head/sys/sys/timeb.h head/sys/sys/times.h head/sys/sys/timespec.h head/sys/sys/ttycom.h head/sys/sys/ttydefaults.h head/sys/sys/types.h head/sys/sys/ucred.h head/sys/sys/uio.h head/sys/sys/un.h head/sys/sys/unistd.h head/sys/sys/unpcb.h head/sys/sys/user.h head/sys/sys/utsname.h head/sys/sys/vmmeter.h head/sys/sys/vnode.h head/sys/sys/wait.h head/sys/tools/makeobjops.awk head/sys/tools/vnode_if.awk head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_inode.c head/sys/ufs/ffs/ffs_subr.c head/sys/ufs/ffs/ffs_tables.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/ffs_vnops.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/dir.h head/sys/ufs/ufs/inode.h head/sys/ufs/ufs/quota.h head/sys/ufs/ufs/ufs_bmap.c head/sys/ufs/ufs/ufs_extern.h head/sys/ufs/ufs/ufs_inode.c head/sys/ufs/ufs/ufs_lookup.c head/sys/ufs/ufs/ufs_quota.c head/sys/ufs/ufs/ufs_vfsops.c head/sys/ufs/ufs/ufs_vnops.c head/sys/ufs/ufs/ufsmount.h head/sys/vm/device_pager.c head/sys/vm/pmap.h head/sys/vm/swap_pager.h head/sys/vm/vm.h head/sys/vm/vm_extern.h head/sys/vm/vm_glue.c head/sys/vm/vm_init.c head/sys/vm/vm_kern.c head/sys/vm/vm_kern.h head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/sys/vm/vm_meter.c head/sys/vm/vm_mmap.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.h head/sys/vm/vm_pager.c head/sys/vm/vm_pager.h head/sys/vm/vm_param.h head/sys/vm/vm_unix.c head/sys/vm/vnode_pager.h head/sys/x86/include/_limits.h head/sys/x86/include/endian.h head/sys/x86/include/float.h head/sys/x86/include/frame.h head/sys/x86/include/psl.h head/sys/x86/include/ptrace.h head/sys/x86/include/reg.h head/sys/x86/include/segments.h head/sys/x86/include/setjmp.h head/sys/x86/include/signal.h head/sys/x86/include/specialreg.h head/sys/x86/include/stdarg.h head/sys/x86/include/sysarch.h head/sys/x86/include/trap.h head/sys/x86/isa/clock.c head/sys/x86/isa/icu.h head/sys/x86/isa/isa_dma.c head/sys/x86/isa/nmi.c head/sys/x86/x86/delay.c head/sys/x86/x86/msi.c Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy) * Copyright (C) 2005-2017 Jung-uk Kim * All rights reserved. Modified: head/sys/amd64/amd64/bpf_jit_machdep.h ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/amd64/bpf_jit_machdep.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy) * Copyright (C) 2005-2016 Jung-uk Kim * All rights reserved. Modified: head/sys/amd64/amd64/fpu.c ============================================================================== --- head/sys/amd64/amd64/fpu.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/amd64/fpu.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 William Jolitz. * Copyright (c) 1991 The Regents of the University of California. * All rights reserved. Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/amd64/genassym.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1990 The Regents of the University of California. * All rights reserved. * Modified: head/sys/amd64/amd64/mem.c ============================================================================== --- head/sys/amd64/amd64/mem.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/amd64/mem.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988 University of Utah. * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. * All rights reserved. Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/amd64/sys_machdep.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2003 Peter Wemm. * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. Modified: head/sys/amd64/amd64/uio_machdep.c ============================================================================== --- head/sys/amd64/amd64/uio_machdep.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/amd64/uio_machdep.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2004 Alan L. Cox * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/ia32/ia32_signal.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2003 Peter Wemm * Copyright (c) 1982, 1987, 1990 The Regents of the University of California. * All rights reserved. Modified: head/sys/amd64/include/asm.h ============================================================================== --- head/sys/amd64/include/asm.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/asm.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/sys/amd64/include/asmacros.h ============================================================================== --- head/sys/amd64/include/asmacros.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/asmacros.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 The Regents of the University of California. * All rights reserved. * Modified: head/sys/amd64/include/cpu.h ============================================================================== --- head/sys/amd64/include/cpu.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/cpu.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/cpufunc.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2003 Peter Wemm. * Copyright (c) 1993 The Regents of the University of California. * All rights reserved. Modified: head/sys/amd64/include/exec.h ============================================================================== --- head/sys/amd64/include/exec.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/exec.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/amd64/include/fpu.h ============================================================================== --- head/sys/amd64/include/fpu.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/fpu.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/sys/amd64/include/in_cksum.h ============================================================================== --- head/sys/amd64/include/in_cksum.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/in_cksum.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/sys/amd64/include/limits.h ============================================================================== --- head/sys/amd64/include/limits.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/limits.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/md_var.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1995 Bruce D. Evans. * All rights reserved. * Modified: head/sys/amd64/include/pcb.h ============================================================================== --- head/sys/amd64/include/pcb.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/pcb.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2003 Peter Wemm. * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. Modified: head/sys/amd64/include/pmap.h ============================================================================== --- head/sys/amd64/include/pmap.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/pmap.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2003 Peter Wemm. * Copyright (c) 1991 Regents of the University of California. * All rights reserved. Modified: head/sys/amd64/include/proc.h ============================================================================== --- head/sys/amd64/include/proc.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/proc.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991 Regents of the University of California. * All rights reserved. * Modified: head/sys/amd64/include/profile.h ============================================================================== --- head/sys/amd64/include/profile.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/profile.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/amd64/include/reloc.h ============================================================================== --- head/sys/amd64/include/reloc.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/reloc.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/segments.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1990 William F. Jolitz * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. Modified: head/sys/amd64/include/tss.h ============================================================================== --- head/sys/amd64/include/tss.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/include/tss.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/sys/amd64/vmm/vmm_stat.h ============================================================================== --- head/sys/amd64/vmm/vmm_stat.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/amd64/vmm/vmm_stat.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. * Modified: head/sys/arm/arm/mem.c ============================================================================== --- head/sys/arm/arm/mem.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/arm/mem.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988 University of Utah. * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. * All rights reserved. Modified: head/sys/arm/arm/sys_machdep.c ============================================================================== --- head/sys/arm/arm/sys_machdep.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/arm/sys_machdep.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/sys/arm/arm/uio_machdep.c ============================================================================== --- head/sys/arm/arm/uio_machdep.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/arm/uio_machdep.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2004 Alan L. Cox * Copyright (c) 1982, 1986, 1991, 1993 * The Regents of the University of California. All rights reserved. Modified: head/sys/arm/freescale/imx/imx_common.c ============================================================================== --- head/sys/arm/freescale/imx/imx_common.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/freescale/imx/imx_common.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2008-2011 MARVELL INTERNATIONAL LTD. * Copyright (c) 2012, 2013 The FreeBSD Foundation * All rights reserved. Modified: head/sys/arm/include/_limits.h ============================================================================== --- head/sys/arm/include/_limits.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/_limits.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/asm.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,6 +1,8 @@ /* $NetBSD: asm.h,v 1.5 2003/08/07 16:26:53 agc Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/sys/arm/include/endian.h ============================================================================== --- head/sys/arm/include/endian.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/endian.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2001 David E. O'Brien * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/include/exec.h ============================================================================== --- head/sys/arm/include/exec.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/exec.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2001 David E. O'Brien * All rights reserved. * Modified: head/sys/arm/include/float.h ============================================================================== --- head/sys/arm/include/float.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/float.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989 Regents of the University of California. * All rights reserved. * Modified: head/sys/arm/include/ieee.h ============================================================================== --- head/sys/arm/include/ieee.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/ieee.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,6 +1,8 @@ /* $NetBSD: ieee754.h,v 1.4 2003/10/27 02:30:26 simonb Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/arm/include/in_cksum.h ============================================================================== --- head/sys/arm/include/in_cksum.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/in_cksum.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/sys/arm/include/limits.h ============================================================================== --- head/sys/arm/include/limits.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/limits.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/md_var.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1995 Bruce D. Evans. * All rights reserved. * Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/pmap.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2016 Svatopluk Kraus * Copyright (c) 2016 Michal Meloun * All rights reserved. Modified: head/sys/arm/include/signal.h ============================================================================== --- head/sys/arm/include/signal.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/signal.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1986, 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/arm/include/stdarg.h ============================================================================== --- head/sys/arm/include/stdarg.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/stdarg.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2002 David E. O'Brien. All rights reserved. * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/include/vmparam.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,6 +1,8 @@ /* $NetBSD: vmparam.h,v 1.26 2003/08/07 16:27:47 agc Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988 The Regents of the University of California. * All rights reserved. * Modified: head/sys/arm/mv/discovery/discovery.c ============================================================================== --- head/sys/arm/mv/discovery/discovery.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/mv/discovery/discovery.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. * All rights reserved. * Modified: head/sys/arm/mv/kirkwood/kirkwood.c ============================================================================== --- head/sys/arm/mv/kirkwood/kirkwood.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/mv/kirkwood/kirkwood.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. * All rights reserved. * Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/mv/mv_common.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2008-2011 MARVELL INTERNATIONAL LTD. * All rights reserved. * Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/mv/mv_pci.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2008 MARVELL INTERNATIONAL LTD. * Copyright (c) 2010 The FreeBSD Foundation * Copyright (c) 2010-2015 Semihalf Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/mv/mvreg.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2007-2011 MARVELL INTERNATIONAL LTD. * All rights reserved. * Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/mv/mvwin.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2007-2011 MARVELL INTERNATIONAL LTD. * All rights reserved. * Modified: head/sys/arm/mv/orion/db88f5xxx.c ============================================================================== --- head/sys/arm/mv/orion/db88f5xxx.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/mv/orion/db88f5xxx.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. * All rights reserved. * Modified: head/sys/arm/mv/orion/orion.c ============================================================================== --- head/sys/arm/mv/orion/orion.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/mv/orion/orion.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. * All rights reserved. * Modified: head/sys/arm/mv/rtc.c ============================================================================== --- head/sys/arm/mv/rtc.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/mv/rtc.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2008 MARVELL INTERNATIONAL LTD. * All rights reserved. * Modified: head/sys/arm/ti/ti_edma3.c ============================================================================== --- head/sys/arm/ti/ti_edma3.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/ti/ti_edma3.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ * Copyright (c) 2012 Damjan Marion * All rights reserved. Modified: head/sys/arm/versatile/versatile_common.c ============================================================================== --- head/sys/arm/versatile/versatile_common.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/versatile/versatile_common.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2008-2011 MARVELL INTERNATIONAL LTD. * All rights reserved. * Modified: head/sys/arm/xscale/ixp425/if_npereg.h ============================================================================== --- head/sys/arm/xscale/ixp425/if_npereg.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/xscale/ixp425/if_npereg.h Mon Nov 20 19:43:44 2017 (r326023) @@ -30,6 +30,8 @@ */ /* + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2001-2005, Intel Corporation. * All rights reserved. * Modified: head/sys/arm/xscale/ixp425/ixp425_npe.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npe.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/xscale/ixp425/ixp425_npe.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2006-2008 Sam Leffler, Errno Consulting * All rights reserved. * Modified: head/sys/arm/xscale/ixp425/ixp425_npereg.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npereg.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/xscale/ixp425/ixp425_npereg.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2006 Sam Leffler, Errno Consulting * All rights reserved. * Modified: head/sys/arm/xscale/ixp425/ixp425_qmgr.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_qmgr.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/xscale/ixp425/ixp425_qmgr.c Mon Nov 20 19:43:44 2017 (r326023) @@ -28,6 +28,8 @@ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2001-2005, Intel Corporation. * All rights reserved. * Modified: head/sys/arm/xscale/ixp425/ixp425_qmgr.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_qmgr.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/arm/xscale/ixp425/ixp425_qmgr.h Mon Nov 20 19:43:44 2017 (r326023) @@ -30,6 +30,8 @@ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2001-2005, Intel Corporation. * All rights reserved. * Modified: head/sys/bsm/audit.h ============================================================================== --- head/sys/bsm/audit.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/bsm/audit.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2005-2009 Apple Inc. * Copyright (c) 2016 Robert N. M. Watson * All rights reserved. Modified: head/sys/bsm/audit_domain.h ============================================================================== --- head/sys/bsm/audit_domain.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/bsm/audit_domain.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2008 Apple Inc. * All rights reserved. * Modified: head/sys/bsm/audit_errno.h ============================================================================== --- head/sys/bsm/audit_errno.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/bsm/audit_errno.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2008 Apple Inc. * All rights reserved. * Modified: head/sys/bsm/audit_fcntl.h ============================================================================== --- head/sys/bsm/audit_fcntl.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/bsm/audit_fcntl.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009 Apple Inc. * All rights reserved. * Modified: head/sys/bsm/audit_internal.h ============================================================================== --- head/sys/bsm/audit_internal.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/bsm/audit_internal.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2005-2008 Apple Inc. * Copyright (c) 2005 SPARTA, Inc. * All rights reserved. Modified: head/sys/bsm/audit_kevents.h ============================================================================== --- head/sys/bsm/audit_kevents.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/bsm/audit_kevents.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2005-2009 Apple Inc. * All rights reserved. * Modified: head/sys/bsm/audit_record.h ============================================================================== --- head/sys/bsm/audit_record.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/bsm/audit_record.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2005-2009 Apple Inc. * All rights reserved. * Modified: head/sys/bsm/audit_socket_type.h ============================================================================== --- head/sys/bsm/audit_socket_type.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/bsm/audit_socket_type.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2008 Apple Inc. * All rights reserved. * Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/compat/freebsd32/freebsd32_ioctl.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2008 David E. O'Brien * All rights reserved. * Modified: head/sys/compat/freebsd32/freebsd32_ioctl.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_ioctl.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/compat/freebsd32/freebsd32_ioctl.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2008 David E. O'Brien * All rights reserved. * Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/conf/newvers.sh Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ #!/bin/sh - +# SPDX-License-Identifier: BSD-3-Clause +# # # Copyright (c) 1984, 1986, 1990, 1993 # The Regents of the University of California. All rights reserved. Modified: head/sys/conf/systags.sh ============================================================================== --- head/sys/conf/systags.sh Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/conf/systags.sh Mon Nov 20 19:43:44 2017 (r326023) @@ -1,5 +1,7 @@ #! /bin/sh # +# SPDX-License-Identifier: BSD-3-Clause +# # Copyright (c) 1992, 1993 # The Regents of the University of California. All rights reserved. # Modified: head/sys/crypto/sha1.c ============================================================================== --- head/sys/crypto/sha1.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/crypto/sha1.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,5 +1,7 @@ /* $KAME: sha1.c,v 1.5 2000/11/08 06:13:08 itojun Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * Modified: head/sys/crypto/sha1.h ============================================================================== --- head/sys/crypto/sha1.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/crypto/sha1.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,7 +1,9 @@ /* $FreeBSD$ */ /* $KAME: sha1.h,v 1.5 2000/03/27 04:36:23 sumikawa Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. * Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/ddb/db_ps.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 The Regents of the University of California. * All rights reserved. * Modified: head/sys/ddb/ddb.h ============================================================================== --- head/sys/ddb/ddb.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/ddb/ddb.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993, Garrett A. Wollman. * Copyright (c) 1993, University of Vermont and State Agricultural College. * All rights reserved. Modified: head/sys/fs/cd9660/cd9660_bmap.c ============================================================================== --- head/sys/fs/cd9660/cd9660_bmap.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_bmap.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/cd9660_lookup.c ============================================================================== --- head/sys/fs/cd9660/cd9660_lookup.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_lookup.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/cd9660_mount.h ============================================================================== --- head/sys/fs/cd9660/cd9660_mount.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_mount.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1995 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/cd9660_node.c ============================================================================== --- head/sys/fs/cd9660/cd9660_node.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_node.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1986, 1989, 1994, 1995 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/cd9660_node.h ============================================================================== --- head/sys/fs/cd9660/cd9660_node.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_node.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/cd9660_rrip.c ============================================================================== --- head/sys/fs/cd9660/cd9660_rrip.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_rrip.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/cd9660_rrip.h ============================================================================== --- head/sys/fs/cd9660/cd9660_rrip.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_rrip.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/cd9660_util.c ============================================================================== --- head/sys/fs/cd9660/cd9660_util.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_util.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/cd9660_vfsops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vfsops.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_vfsops.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/cd9660_vnops.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/iso.h ============================================================================== --- head/sys/fs/cd9660/iso.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/iso.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/cd9660/iso_rrip.h ============================================================================== --- head/sys/fs/cd9660/iso_rrip.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/cd9660/iso_rrip.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/deadfs/dead_vnops.c ============================================================================== --- head/sys/fs/deadfs/dead_vnops.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/deadfs/dead_vnops.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_alloc.c Mon Nov 20 19:43:44 2017 (r326023) @@ -5,6 +5,8 @@ * University of Utah, Department of Computer Science */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_balloc.c Mon Nov 20 19:43:44 2017 (r326023) @@ -5,6 +5,8 @@ * University of Utah, Department of Computer Science */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_bmap.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1991, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_extern.h Mon Nov 20 19:43:44 2017 (r326023) @@ -5,6 +5,8 @@ * University of Utah, Department of Computer Science */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_inode.c Mon Nov 20 19:43:44 2017 (r326023) @@ -5,6 +5,8 @@ * University of Utah, Department of Computer Science */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_lookup.c Mon Nov 20 19:43:44 2017 (r326023) @@ -5,6 +5,8 @@ * University of Utah, Department of Computer Science */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/sys/fs/ext2fs/ext2_mount.h ============================================================================== --- head/sys/fs/ext2fs/ext2_mount.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_mount.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_subr.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_subr.c Mon Nov 20 19:43:44 2017 (r326023) @@ -5,6 +5,8 @@ * University of Utah, Department of Computer Science */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_vfsops.c Mon Nov 20 19:43:44 2017 (r326023) @@ -5,6 +5,8 @@ * University of Utah, Department of Computer Science */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/ext2_vnops.c Mon Nov 20 19:43:44 2017 (r326023) @@ -5,6 +5,8 @@ * University of Utah, Department of Computer Science */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/sys/fs/ext2fs/fs.h ============================================================================== --- head/sys/fs/ext2fs/fs.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/fs.h Mon Nov 20 19:43:44 2017 (r326023) @@ -5,6 +5,8 @@ * University of Utah, Department of Computer Science */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1986, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/ext2fs/inode.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1982, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/sys/fs/fdescfs/fdesc.h ============================================================================== --- head/sys/fs/fdescfs/fdesc.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/fdescfs/fdesc.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/fdescfs/fdesc_vfsops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vfsops.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993, 1995 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/fdescfs/fdesc_vnops.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/fifofs/fifo_vnops.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1995 * The Regents of the University of California. * Copyright (c) 2005 Robert N. M. Watson Modified: head/sys/fs/fuse/fuse.h ============================================================================== --- head/sys/fs/fuse/fuse.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/fuse/fuse.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007-2009 Google Inc. * All rights reserved. * Modified: head/sys/fs/fuse/fuse_debug.h ============================================================================== --- head/sys/fs/fuse/fuse_debug.h Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/fuse/fuse_debug.h Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007-2009 Google Inc. * All rights reserved. * Modified: head/sys/fs/fuse/fuse_device.c ============================================================================== --- head/sys/fs/fuse/fuse_device.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/fuse/fuse_device.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007-2009 Google Inc. * All rights reserved. * Modified: head/sys/fs/fuse/fuse_file.c ============================================================================== --- head/sys/fs/fuse/fuse_file.c Mon Nov 20 19:36:21 2017 (r326022) +++ head/sys/fs/fuse/fuse_file.c Mon Nov 20 19:43:44 2017 (r326023) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Nov 20 19:45: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 65716DF3BEB; Mon, 20 Nov 2017 19:45:37 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08BFA69DC3; Mon, 20 Nov 2017 19:45:36 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKJjaBY033935; Mon, 20 Nov 2017 19:45:36 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJjSU7033854; Mon, 20 Nov 2017 19:45:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711201945.vAKJjSU7033854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Nov 2017 19:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326024 - in head/include: . arpa protocols rpc rpcsvc X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/include: . arpa protocols rpc rpcsvc X-SVN-Commit-Revision: 326024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 19:45:37 -0000 Author: pfg Date: Mon Nov 20 19:45:28 2017 New Revision: 326024 URL: https://svnweb.freebsd.org/changeset/base/326024 Log: include: further adoption of SPDX licensing ID tags. Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Modified: head/include/_ctype.h head/include/a.out.h head/include/ar.h head/include/arpa/ftp.h head/include/arpa/inet.h head/include/arpa/nameser.h head/include/arpa/nameser_compat.h head/include/arpa/telnet.h head/include/arpa/tftp.h head/include/assert.h head/include/ctype.h head/include/db.h head/include/dirent.h head/include/dlfcn.h head/include/err.h head/include/fnmatch.h head/include/fstab.h head/include/fts.h head/include/glob.h head/include/grp.h head/include/limits.h head/include/locale.h head/include/memory.h head/include/mpool.h head/include/ndbm.h head/include/netdb.h head/include/nlist.h head/include/paths.h head/include/protocols/dumprestore.h head/include/protocols/routed.h head/include/protocols/rwhod.h head/include/protocols/talkd.h head/include/protocols/timed.h head/include/pthread_np.h head/include/pwd.h head/include/ranlib.h head/include/regex.h head/include/resolv.h head/include/rpc/auth.h head/include/rpc/auth_des.h head/include/rpc/auth_kerb.h head/include/rpc/auth_unix.h head/include/rpc/clnt.h head/include/rpc/clnt_soc.h head/include/rpc/des.h head/include/rpc/des_crypt.h head/include/rpc/nettype.h head/include/rpc/pmap_clnt.h head/include/rpc/pmap_prot.h head/include/rpc/pmap_rmt.h head/include/rpc/raw.h head/include/rpc/rpc.h head/include/rpc/rpc_com.h head/include/rpc/rpc_msg.h head/include/rpc/rpcb_clnt.h head/include/rpc/rpcent.h head/include/rpc/svc.h head/include/rpc/svc_auth.h head/include/rpc/svc_dg.h head/include/rpc/svc_soc.h head/include/rpc/xdr.h head/include/rpcsvc/nis_tags.h head/include/runetype.h head/include/setjmp.h head/include/signal.h head/include/stab.h head/include/stddef.h head/include/stdio.h head/include/stdlib.h head/include/string.h head/include/sysexits.h head/include/tar.h head/include/termios.h head/include/time.h head/include/timeconv.h head/include/ttyent.h head/include/unistd.h head/include/utime.h Modified: head/include/_ctype.h ============================================================================== --- head/include/_ctype.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/_ctype.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/a.out.h ============================================================================== --- head/include/a.out.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/a.out.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/ar.h ============================================================================== --- head/include/ar.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/ar.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/arpa/ftp.h ============================================================================== --- head/include/arpa/ftp.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/arpa/ftp.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/arpa/inet.h ============================================================================== --- head/include/arpa/inet.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/arpa/inet.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * ++Copyright++ 1983, 1993 * - * Copyright (c) 1983, 1993 Modified: head/include/arpa/nameser.h ============================================================================== --- head/include/arpa/nameser.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/arpa/nameser.h Mon Nov 20 19:45:28 2017 (r326024) @@ -15,7 +15,9 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/arpa/nameser_compat.h ============================================================================== --- head/include/arpa/nameser_compat.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/arpa/nameser_compat.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,7 @@ -/* Copyright (c) 1983, 1989 +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1983, 1989 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/include/arpa/telnet.h ============================================================================== --- head/include/arpa/telnet.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/arpa/telnet.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/arpa/tftp.h ============================================================================== --- head/include/arpa/tftp.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/arpa/tftp.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/**- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/assert.h ============================================================================== --- head/include/assert.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/assert.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/ctype.h ============================================================================== --- head/include/ctype.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/ctype.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/db.h ============================================================================== --- head/include/db.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/db.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/include/dirent.h ============================================================================== --- head/include/dirent.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/dirent.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/dlfcn.h ============================================================================== --- head/include/dlfcn.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/dlfcn.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * Modified: head/include/err.h ============================================================================== --- head/include/err.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/err.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/fnmatch.h ============================================================================== --- head/include/fnmatch.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/fnmatch.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/fstab.h ============================================================================== --- head/include/fstab.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/fstab.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/fts.h ============================================================================== --- head/include/fts.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/fts.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/glob.h ============================================================================== --- head/include/glob.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/glob.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/grp.h ============================================================================== --- head/include/grp.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/grp.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/limits.h ============================================================================== --- head/include/limits.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/limits.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/locale.h ============================================================================== --- head/include/locale.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/locale.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/memory.h ============================================================================== --- head/include/memory.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/memory.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/mpool.h ============================================================================== --- head/include/mpool.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/mpool.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/include/ndbm.h ============================================================================== --- head/include/ndbm.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/ndbm.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/netdb.h ============================================================================== --- head/include/netdb.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/netdb.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1980, 1983, 1988, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/nlist.h ============================================================================== --- head/include/nlist.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/nlist.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/paths.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/protocols/dumprestore.h ============================================================================== --- head/include/protocols/dumprestore.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/protocols/dumprestore.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/protocols/routed.h ============================================================================== --- head/include/protocols/routed.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/protocols/routed.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/protocols/rwhod.h ============================================================================== --- head/include/protocols/rwhod.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/protocols/rwhod.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/protocols/talkd.h ============================================================================== --- head/include/protocols/talkd.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/protocols/talkd.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/protocols/timed.h ============================================================================== --- head/include/protocols/timed.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/protocols/timed.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/pthread_np.h ============================================================================== --- head/include/pthread_np.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/pthread_np.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1996-98 John Birrell . * All rights reserved. * Modified: head/include/pwd.h ============================================================================== --- head/include/pwd.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/pwd.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/ranlib.h ============================================================================== --- head/include/ranlib.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/ranlib.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/regex.h ============================================================================== --- head/include/regex.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/regex.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Henry Spencer. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/include/resolv.h ============================================================================== --- head/include/resolv.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/resolv.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Portions Copyright (C) 2004, 2005, 2008, 2009 Internet Systems Consortium, Inc. ("ISC") * Portions Copyright (C) 1995-2003 Internet Software Consortium. * Modified: head/include/rpc/auth.h ============================================================================== --- head/include/rpc/auth.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/auth.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: auth.h,v 1.15 2000/06/02 22:57:55 fvdl Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/auth_des.h ============================================================================== --- head/include/rpc/auth_des.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/auth_des.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* @(#)auth_des.h 2.2 88/07/29 4.0 RPCSRC; from 1.3 88/02/08 SMI */ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/auth_kerb.h ============================================================================== --- head/include/rpc/auth_kerb.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/auth_kerb.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,5 +1,7 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/auth_unix.h ============================================================================== --- head/include/rpc/auth_unix.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/auth_unix.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/clnt.h ============================================================================== --- head/include/rpc/clnt.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/clnt.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: clnt.h,v 1.14 2000/06/02 22:57:55 fvdl Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2010, Oracle America, Inc. * All rights reserved. * Modified: head/include/rpc/clnt_soc.h ============================================================================== --- head/include/rpc/clnt_soc.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/clnt_soc.h Mon Nov 20 19:45:28 2017 (r326024) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/des.h ============================================================================== --- head/include/rpc/des.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/des.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* @(#)des.h 2.2 88/08/10 4.0 RPCSRC; from 2.7 88/02/08 SMI */ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/des_crypt.h ============================================================================== --- head/include/rpc/des_crypt.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/des_crypt.h Mon Nov 20 19:45:28 2017 (r326024) @@ -6,6 +6,8 @@ * Copyright (C) 1986, Sun Microsystems, Inc. */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/nettype.h ============================================================================== --- head/include/rpc/nettype.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/nettype.h Mon Nov 20 19:45:28 2017 (r326024) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/pmap_clnt.h ============================================================================== --- head/include/rpc/pmap_clnt.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/pmap_clnt.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: pmap_clnt.h,v 1.9 2000/06/02 22:57:55 fvdl Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/pmap_prot.h ============================================================================== --- head/include/rpc/pmap_prot.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/pmap_prot.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: pmap_prot.h,v 1.8 2000/06/02 22:57:55 fvdl Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/pmap_rmt.h ============================================================================== --- head/include/rpc/pmap_rmt.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/pmap_rmt.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: pmap_rmt.h,v 1.7 1998/02/11 23:01:23 lukem Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/raw.h ============================================================================== --- head/include/rpc/raw.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/raw.h Mon Nov 20 19:45:28 2017 (r326024) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/rpc.h ============================================================================== --- head/include/rpc/rpc.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/rpc.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: rpc.h,v 1.13 2000/06/02 22:57:56 fvdl Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/rpc_com.h ============================================================================== --- head/include/rpc/rpc_com.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/rpc_com.h Mon Nov 20 19:45:28 2017 (r326024) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/rpc_msg.h ============================================================================== --- head/include/rpc/rpc_msg.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/rpc_msg.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: rpc_msg.h,v 1.11 2000/06/02 22:57:56 fvdl Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/rpcb_clnt.h ============================================================================== --- head/include/rpc/rpcb_clnt.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/rpcb_clnt.h Mon Nov 20 19:45:28 2017 (r326024) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/rpcent.h ============================================================================== --- head/include/rpc/rpcent.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/rpcent.h Mon Nov 20 19:45:28 2017 (r326024) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/svc.h ============================================================================== --- head/include/rpc/svc.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/svc.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: svc.h,v 1.17 2000/06/02 22:57:56 fvdl Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/svc_auth.h ============================================================================== --- head/include/rpc/svc_auth.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/svc_auth.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: svc_auth.h,v 1.8 2000/06/02 22:57:57 fvdl Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/svc_dg.h ============================================================================== --- head/include/rpc/svc_dg.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/svc_dg.h Mon Nov 20 19:45:28 2017 (r326024) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/svc_soc.h ============================================================================== --- head/include/rpc/svc_soc.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/svc_soc.h Mon Nov 20 19:45:28 2017 (r326024) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpc/xdr.h ============================================================================== --- head/include/rpc/xdr.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpc/xdr.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,6 +1,8 @@ /* $NetBSD: xdr.h,v 1.19 2000/07/17 05:00:45 matt Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2009, Sun Microsystems, Inc. * All rights reserved. * Modified: head/include/rpcsvc/nis_tags.h ============================================================================== --- head/include/rpcsvc/nis_tags.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/rpcsvc/nis_tags.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2010, Oracle America, Inc. * * Redistribution and use in source and binary forms, with or without Modified: head/include/runetype.h ============================================================================== --- head/include/runetype.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/runetype.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/setjmp.h ============================================================================== --- head/include/setjmp.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/setjmp.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/signal.h ============================================================================== --- head/include/signal.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/signal.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/stab.h ============================================================================== --- head/include/stab.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/stab.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/stddef.h ============================================================================== --- head/include/stddef.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/stddef.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/stdio.h ============================================================================== --- head/include/stdio.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/stdio.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/stdlib.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/string.h ============================================================================== --- head/include/string.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/string.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/sysexits.h ============================================================================== --- head/include/sysexits.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/sysexits.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/tar.h ============================================================================== --- head/include/tar.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/tar.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. * Modified: head/include/termios.h ============================================================================== --- head/include/termios.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/termios.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/include/time.h ============================================================================== --- head/include/time.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/time.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/timeconv.h ============================================================================== --- head/include/timeconv.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/timeconv.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/include/ttyent.h ============================================================================== --- head/include/ttyent.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/ttyent.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/unistd.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/include/utime.h ============================================================================== --- head/include/utime.h Mon Nov 20 19:43:44 2017 (r326023) +++ head/include/utime.h Mon Nov 20 19:45:28 2017 (r326024) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * From owner-svn-src-head@freebsd.org Mon Nov 20 19:50:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFB80DF3CBB; Mon, 20 Nov 2017 19:50:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D0A16A153; Mon, 20 Nov 2017 19:50:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKJnx01034257; Mon, 20 Nov 2017 19:49:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJnmmr034145; Mon, 20 Nov 2017 19:49:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711201949.vAKJnmmr034145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Nov 2017 19:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326025 - in head: bin/cat bin/chflags bin/chmod bin/cp bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/hostname bin/kill bin/ln bin/ls bin/mkdir bin/mv bin/pax bin/ps bin/pwd... X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: bin/cat bin/chflags bin/chmod bin/cp bin/date bin/dd bin/df bin/domainname bin/echo bin/ed bin/hostname bin/kill bin/ln bin/ls bin/mkdir bin/mv bin/pax bin/ps bin/pwd bin/realpath bin/rm bin/... X-SVN-Commit-Revision: 326025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 19:50:00 -0000 Author: pfg Date: Mon Nov 20 19:49:47 2017 New Revision: 326025 URL: https://svnweb.freebsd.org/changeset/base/326025 Log: General further adoption of SPDX licensing ID tags. Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Modified: head/bin/cat/cat.c head/bin/chflags/chflags.c head/bin/chmod/chmod.c head/bin/cp/cp.c head/bin/cp/extern.h head/bin/cp/utils.c head/bin/date/date.c head/bin/date/extern.h head/bin/date/netdate.c head/bin/dd/args.c head/bin/dd/conv.c head/bin/dd/conv_tab.c head/bin/dd/dd.c head/bin/dd/dd.h head/bin/dd/extern.h head/bin/dd/misc.c head/bin/dd/position.c head/bin/df/df.c head/bin/domainname/domainname.c head/bin/echo/echo.c head/bin/ed/cbc.c head/bin/hostname/hostname.c head/bin/kill/kill.c head/bin/ln/ln.c head/bin/ls/cmp.c head/bin/ls/extern.h head/bin/ls/ls.c head/bin/ls/ls.h head/bin/ls/print.c head/bin/ls/util.c head/bin/mkdir/mkdir.c head/bin/mv/mv.c head/bin/pax/ar_io.c head/bin/pax/ar_subs.c head/bin/pax/buf_subs.c head/bin/pax/cache.c head/bin/pax/cache.h head/bin/pax/cpio.c head/bin/pax/cpio.h head/bin/pax/extern.h head/bin/pax/file_subs.c head/bin/pax/ftree.c head/bin/pax/ftree.h head/bin/pax/gen_subs.c head/bin/pax/options.c head/bin/pax/options.h head/bin/pax/pat_rep.c head/bin/pax/pat_rep.h head/bin/pax/pax.c head/bin/pax/pax.h head/bin/pax/sel_subs.c head/bin/pax/sel_subs.h head/bin/pax/tables.c head/bin/pax/tables.h head/bin/pax/tar.c head/bin/pax/tar.h head/bin/pax/tty_subs.c head/bin/ps/extern.h head/bin/ps/fmt.c head/bin/ps/keyword.c head/bin/ps/nlist.c head/bin/ps/print.c head/bin/ps/ps.c head/bin/ps/ps.h head/bin/pwd/pwd.c head/bin/realpath/realpath.c head/bin/rm/rm.c head/bin/rmdir/rmdir.c head/bin/sh/bltin/bltin.h head/bin/sh/bltin/echo.c head/bin/sh/mail.h head/bin/sh/main.c head/bin/sh/main.h head/bin/sh/memalloc.c head/bin/sh/memalloc.h head/bin/sh/miscbltin.c head/bin/sh/mknodes.c head/bin/sh/mksyntax.c head/bin/sh/myhistedit.h head/bin/sh/mystring.c head/bin/sh/mystring.h head/bin/sh/options.c head/bin/sh/options.h head/bin/sh/output.c head/bin/sh/output.h head/bin/sh/parser.c head/bin/sh/parser.h head/bin/sh/redir.c head/bin/sh/redir.h head/bin/sh/shell.h head/bin/sh/show.c head/bin/sh/show.h head/bin/sh/trap.c head/bin/sh/trap.h head/bin/sh/var.c head/bin/sh/var.h head/lib/libc/amd64/SYS.h head/lib/libc/arm/SYS.h head/lib/libc/compat-43/creat.c head/lib/libc/compat-43/gethostid.c head/lib/libc/compat-43/getwd.c head/lib/libc/compat-43/killpg.c head/lib/libc/compat-43/sethostid.c head/lib/libc/compat-43/setpgrp.c head/lib/libc/compat-43/setrgid.c head/lib/libc/compat-43/setruid.c head/lib/libc/compat-43/sigcompat.c head/lib/libc/db/btree/bt_close.c head/lib/libc/db/btree/bt_conv.c head/lib/libc/db/btree/bt_debug.c head/lib/libc/db/btree/bt_delete.c head/lib/libc/db/btree/bt_get.c head/lib/libc/db/btree/bt_open.c head/lib/libc/db/btree/bt_overflow.c head/lib/libc/db/btree/bt_page.c head/lib/libc/db/btree/bt_put.c head/lib/libc/db/btree/bt_search.c head/lib/libc/db/btree/bt_seq.c head/lib/libc/db/btree/bt_split.c head/lib/libc/db/btree/bt_utils.c head/lib/libc/db/btree/btree.h head/lib/libc/db/btree/extern.h head/lib/libc/db/db/db.c head/lib/libc/db/hash/extern.h head/lib/libc/db/hash/hash.c head/lib/libc/db/hash/hash.h head/lib/libc/db/hash/hash_bigkey.c head/lib/libc/db/hash/hash_buf.c head/lib/libc/db/hash/hash_func.c head/lib/libc/db/hash/hash_log2.c head/lib/libc/db/hash/hash_page.c head/lib/libc/db/hash/ndbm.c head/lib/libc/db/hash/page.h head/lib/libc/db/mpool/mpool.c head/lib/libc/db/recno/extern.h head/lib/libc/db/recno/rec_close.c head/lib/libc/db/recno/rec_delete.c head/lib/libc/db/recno/rec_get.c head/lib/libc/db/recno/rec_open.c head/lib/libc/db/recno/rec_put.c head/lib/libc/db/recno/rec_search.c head/lib/libc/db/recno/rec_seq.c head/lib/libc/db/recno/rec_utils.c head/lib/libc/db/recno/recno.h head/lib/libc/db/test/btree.tests/main.c head/lib/libc/db/test/dbtest.c head/lib/libc/db/test/hash.tests/driver2.c head/lib/libc/db/test/hash.tests/tcreat3.c head/lib/libc/db/test/hash.tests/tdel.c head/lib/libc/db/test/hash.tests/thash4.c head/lib/libc/db/test/hash.tests/tread2.c head/lib/libc/db/test/hash.tests/tseq.c head/lib/libc/db/test/hash.tests/tverify.c head/lib/libc/gen/__xuname.c head/lib/libc/gen/_spinlock_stub.c head/lib/libc/gen/alarm.c head/lib/libc/gen/assert.c head/lib/libc/gen/clock.c head/lib/libc/gen/closedir.c head/lib/libc/gen/confstr.c head/lib/libc/gen/crypt.c head/lib/libc/gen/daemon.c head/lib/libc/gen/devname.c head/lib/libc/gen/disklabel.c head/lib/libc/gen/err.c head/lib/libc/gen/errlst.c head/lib/libc/gen/exec.c head/lib/libc/gen/feature_present.c head/lib/libc/gen/fnmatch.c head/lib/libc/gen/fstab.c head/lib/libc/gen/fts-compat.c head/lib/libc/gen/fts-compat.h head/lib/libc/gen/fts.c head/lib/libc/gen/gen-private.h head/lib/libc/gen/getbootfile.c head/lib/libc/gen/getbsize.c head/lib/libc/gen/getcap.c head/lib/libc/gen/getcwd.c head/lib/libc/gen/getdomainname.c head/lib/libc/gen/getgrouplist.c head/lib/libc/gen/gethostname.c head/lib/libc/gen/getloadavg.c head/lib/libc/gen/getlogin.c head/lib/libc/gen/getmntinfo.c head/lib/libc/gen/getnetgrent.c head/lib/libc/gen/getosreldate.c head/lib/libc/gen/getpagesize.c head/lib/libc/gen/getttyent.c head/lib/libc/gen/getusershell.c head/lib/libc/gen/getvfsbyname.c head/lib/libc/gen/glob.c head/lib/libc/gen/initgroups.c head/lib/libc/gen/isatty.c head/lib/libc/gen/nice.c head/lib/libc/gen/nlist.c head/lib/libc/gen/opendir.c head/lib/libc/gen/pause.c head/lib/libc/gen/popen.c head/lib/libc/gen/psignal.c head/lib/libc/gen/pw_scan.c head/lib/libc/gen/pw_scan.h head/lib/libc/gen/raise.c head/lib/libc/gen/readdir.c head/lib/libc/gen/rewinddir.c head/lib/libc/gen/scandir.c head/lib/libc/gen/seekdir.c head/lib/libc/gen/setdomainname.c head/lib/libc/gen/sethostname.c head/lib/libc/gen/setjmperr.c head/lib/libc/gen/setmode.c head/lib/libc/gen/siginterrupt.c head/lib/libc/gen/siglist.c head/lib/libc/gen/signal.c head/lib/libc/gen/sigsetops.c head/lib/libc/gen/sleep.c head/lib/libc/gen/strtofflags.c head/lib/libc/gen/sysconf.c head/lib/libc/gen/sysctl.c head/lib/libc/gen/syslog.c head/lib/libc/gen/telldir.c head/lib/libc/gen/telldir.h head/lib/libc/gen/termios.c head/lib/libc/gen/time.c head/lib/libc/gen/times.c head/lib/libc/gen/timezone.c head/lib/libc/gen/ttyname.c head/lib/libc/gen/ttyslot.c head/lib/libc/gen/ualarm.c head/lib/libc/gen/uname.c head/lib/libc/gen/usleep.c head/lib/libc/gen/utime.c head/lib/libc/gen/valloc.c head/lib/libc/gen/wait.c head/lib/libc/gen/wait3.c head/lib/libc/gen/waitpid.c head/lib/libc/gmon/gmon.c head/lib/libc/gmon/mcount.c head/lib/libc/i386/SYS.h head/lib/libc/iconv/_strtol.h head/lib/libc/iconv/_strtoul.h head/lib/libc/include/libc_private.h head/lib/libc/include/spinlock.h head/lib/libc/inet/inet_addr.c head/lib/libc/inet/inet_lnaof.c head/lib/libc/inet/inet_makeaddr.c head/lib/libc/inet/inet_netof.c head/lib/libc/inet/inet_network.c head/lib/libc/inet/inet_ntoa.c head/lib/libc/locale/ascii.c head/lib/libc/locale/gbk.c head/lib/libc/locale/isctype.c head/lib/libc/locale/iswctype.c head/lib/libc/locale/localeconv.c head/lib/libc/locale/none.c head/lib/libc/locale/rune.c head/lib/libc/locale/runetype.c head/lib/libc/locale/setlocale.c head/lib/libc/locale/setrunelocale.c head/lib/libc/locale/table.c head/lib/libc/locale/tolower.c head/lib/libc/locale/toupper.c head/lib/libc/locale/wcstoimax.c head/lib/libc/locale/wcstol.c head/lib/libc/locale/wcstoll.c head/lib/libc/locale/wcstoul.c head/lib/libc/locale/wcstoull.c head/lib/libc/locale/wcstoumax.c head/lib/libc/locale/wcwidth.c head/lib/libc/net/gai_strerror.c head/lib/libc/net/getaddrinfo.c head/lib/libc/net/gethostbydns.c head/lib/libc/net/gethostbyht.c head/lib/libc/net/getnameinfo.c head/lib/libc/net/getnetbydns.c head/lib/libc/net/getnetbyht.c head/lib/libc/net/getproto.c head/lib/libc/net/getprotoent.c head/lib/libc/net/getprotoname.c head/lib/libc/net/getservent.c head/lib/libc/net/ip6opt.c head/lib/libc/net/linkaddr.c head/lib/libc/net/map_v4v6.c head/lib/libc/net/name6.c head/lib/libc/net/rcmd.c head/lib/libc/net/rcmdsh.c head/lib/libc/net/recv.c head/lib/libc/net/rthdr.c head/lib/libc/net/sctp_sys_calls.c head/lib/libc/net/send.c head/lib/libc/net/vars.c head/lib/libc/powerpc/SYS.h head/lib/libc/powerpc64/SYS.h head/lib/libc/quad/TESTS/divrem.c head/lib/libc/quad/TESTS/mul.c head/lib/libc/quad/adddi3.c head/lib/libc/quad/anddi3.c head/lib/libc/quad/ashldi3.c head/lib/libc/quad/ashrdi3.c head/lib/libc/quad/cmpdi2.c head/lib/libc/quad/divdi3.c head/lib/libc/quad/fixdfdi.c head/lib/libc/quad/fixsfdi.c head/lib/libc/quad/fixunsdfdi.c head/lib/libc/quad/fixunssfdi.c head/lib/libc/quad/floatdidf.c head/lib/libc/quad/floatdisf.c head/lib/libc/quad/floatunsdidf.c head/lib/libc/quad/iordi3.c head/lib/libc/quad/lshldi3.c head/lib/libc/quad/lshrdi3.c head/lib/libc/quad/moddi3.c head/lib/libc/quad/muldi3.c head/lib/libc/quad/negdi2.c head/lib/libc/quad/notdi2.c head/lib/libc/quad/qdivrem.c head/lib/libc/quad/quad.h head/lib/libc/quad/subdi3.c head/lib/libc/quad/ucmpdi2.c head/lib/libc/quad/udivdi3.c head/lib/libc/quad/umoddi3.c head/lib/libc/quad/xordi3.c head/lib/libc/regex/cname.h head/lib/libc/regex/engine.c head/lib/libc/regex/regcomp.c head/lib/libc/regex/regerror.c head/lib/libc/regex/regex2.h head/lib/libc/regex/regexec.c head/lib/libc/regex/regfree.c head/lib/libc/regex/utils.h head/lib/libc/resolv/herror.c head/lib/libc/resolv/res_comp.c head/lib/libc/resolv/res_debug.c head/lib/libc/resolv/res_init.c head/lib/libc/resolv/res_mkquery.c head/lib/libc/resolv/res_query.c head/lib/libc/resolv/res_send.c head/lib/libc/rpc/auth_des.c head/lib/libc/rpc/auth_none.c head/lib/libc/rpc/auth_unix.c head/lib/libc/rpc/authdes_prot.c head/lib/libc/rpc/authunix_prot.c head/lib/libc/rpc/bindresvport.c head/lib/libc/rpc/clnt_bcast.c head/lib/libc/rpc/clnt_dg.c head/lib/libc/rpc/clnt_generic.c head/lib/libc/rpc/clnt_perror.c head/lib/libc/rpc/clnt_raw.c head/lib/libc/rpc/clnt_simple.c head/lib/libc/rpc/clnt_vc.c head/lib/libc/rpc/des_crypt.c head/lib/libc/rpc/des_soft.c head/lib/libc/rpc/getnetconfig.c head/lib/libc/rpc/getnetpath.c head/lib/libc/rpc/getpublickey.c head/lib/libc/rpc/getrpcent.c head/lib/libc/rpc/getrpcport.c head/lib/libc/rpc/key_call.c head/lib/libc/rpc/key_prot_xdr.c head/lib/libc/rpc/netname.c head/lib/libc/rpc/netnamer.c head/lib/libc/rpc/pmap_clnt.c head/lib/libc/rpc/pmap_getmaps.c head/lib/libc/rpc/pmap_getport.c head/lib/libc/rpc/pmap_prot.c head/lib/libc/rpc/pmap_prot2.c head/lib/libc/rpc/pmap_rmt.c head/lib/libc/rpc/rpc_callmsg.c head/lib/libc/rpc/rpc_com.h head/lib/libc/rpc/rpc_commondata.c head/lib/libc/rpc/rpc_dtablesize.c head/lib/libc/rpc/rpc_generic.c head/lib/libc/rpc/rpc_prot.c head/lib/libc/rpc/rpc_soc.c head/lib/libc/rpc/rpcb_clnt.c head/lib/libc/rpc/rpcb_prot.c head/lib/libc/rpc/rpcb_st_xdr.c head/lib/libc/rpc/rpcdname.c head/lib/libc/rpc/rtime.c head/lib/libc/rpc/svc.c head/lib/libc/rpc/svc_auth.c head/lib/libc/rpc/svc_auth_des.c head/lib/libc/rpc/svc_auth_unix.c head/lib/libc/rpc/svc_dg.c head/lib/libc/rpc/svc_generic.c head/lib/libc/rpc/svc_raw.c head/lib/libc/rpc/svc_run.c head/lib/libc/rpc/svc_simple.c head/lib/libc/rpc/svc_vc.c head/lib/libc/sparc64/SYS.h head/lib/libc/sparc64/fpu/fpu.c head/lib/libc/sparc64/fpu/fpu_add.c head/lib/libc/sparc64/fpu/fpu_arith.h head/lib/libc/sparc64/fpu/fpu_compare.c head/lib/libc/sparc64/fpu/fpu_emu.h head/lib/libc/stdio/_flock_stub.c head/lib/libc/stdio/asprintf.c head/lib/libc/stdio/clrerr.c head/lib/libc/stdio/fclose.c head/lib/libc/stdio/fdopen.c head/lib/libc/stdio/feof.c head/lib/libc/stdio/ferror.c head/lib/libc/stdio/fflush.c head/lib/libc/stdio/fgetc.c head/lib/libc/stdio/fgetln.c head/lib/libc/stdio/fgetpos.c head/lib/libc/stdio/fgets.c head/lib/libc/stdio/fileno.c head/lib/libc/stdio/findfp.c head/lib/libc/stdio/flags.c head/lib/libc/stdio/floatio.h head/lib/libc/stdio/fopen.c head/lib/libc/stdio/fprintf.c head/lib/libc/stdio/fpurge.c head/lib/libc/stdio/fputc.c head/lib/libc/stdio/fputs.c head/lib/libc/stdio/fread.c head/lib/libc/stdio/freopen.c head/lib/libc/stdio/fscanf.c head/lib/libc/stdio/fseek.c head/lib/libc/stdio/fsetpos.c head/lib/libc/stdio/ftell.c head/lib/libc/stdio/funopen.c head/lib/libc/stdio/fvwrite.c head/lib/libc/stdio/fvwrite.h head/lib/libc/stdio/fwalk.c head/lib/libc/stdio/fwrite.c head/lib/libc/stdio/getc.c head/lib/libc/stdio/getchar.c head/lib/libc/stdio/gets.c head/lib/libc/stdio/getw.c head/lib/libc/stdio/glue.h head/lib/libc/stdio/local.h head/lib/libc/stdio/makebuf.c head/lib/libc/stdio/mktemp.c head/lib/libc/stdio/perror.c head/lib/libc/stdio/printf-pos.c head/lib/libc/stdio/printf.c head/lib/libc/stdio/printfcommon.h head/lib/libc/stdio/printflocal.h head/lib/libc/stdio/putc.c head/lib/libc/stdio/putchar.c head/lib/libc/stdio/puts.c head/lib/libc/stdio/putw.c head/lib/libc/stdio/refill.c head/lib/libc/stdio/remove.c head/lib/libc/stdio/rewind.c head/lib/libc/stdio/rget.c head/lib/libc/stdio/scanf.c head/lib/libc/stdio/setbuf.c head/lib/libc/stdio/setbuffer.c head/lib/libc/stdio/setvbuf.c head/lib/libc/stdio/snprintf.c head/lib/libc/stdio/sprintf.c head/lib/libc/stdio/sscanf.c head/lib/libc/stdio/stdio.c head/lib/libc/stdio/tempnam.c head/lib/libc/stdio/tmpfile.c head/lib/libc/stdio/tmpnam.c head/lib/libc/stdio/ungetc.c head/lib/libc/stdio/vfprintf.c head/lib/libc/stdio/vfscanf.c head/lib/libc/stdio/vfwprintf.c head/lib/libc/stdio/vfwscanf.c head/lib/libc/stdio/vprintf.c head/lib/libc/stdio/vscanf.c head/lib/libc/stdio/vsnprintf.c head/lib/libc/stdio/vsprintf.c head/lib/libc/stdio/vsscanf.c head/lib/libc/stdio/vswscanf.c head/lib/libc/stdio/wbuf.c head/lib/libc/stdio/wsetup.c head/lib/libc/stdio/xprintf.c head/lib/libc/stdio/xprintf_float.c head/lib/libc/stdio/xprintf_int.c head/lib/libc/stdio/xprintf_str.c head/lib/libc/stdio/xprintf_time.c head/lib/libc/stdlib/abort.c head/lib/libc/stdlib/abs.c head/lib/libc/stdlib/atexit.c head/lib/libc/stdlib/atexit.h head/lib/libc/stdlib/atof.c head/lib/libc/stdlib/atoi.c head/lib/libc/stdlib/atol.c head/lib/libc/stdlib/atoll.c head/lib/libc/stdlib/bsearch.c head/lib/libc/stdlib/div.c head/lib/libc/stdlib/exit.c head/lib/libc/stdlib/getopt.c head/lib/libc/stdlib/getsubopt.c head/lib/libc/stdlib/heapsort.c head/lib/libc/stdlib/labs.c head/lib/libc/stdlib/ldiv.c head/lib/libc/stdlib/merge.c head/lib/libc/stdlib/qsort.c head/lib/libc/stdlib/radixsort.c head/lib/libc/stdlib/rand.c head/lib/libc/stdlib/random.c head/lib/libc/stdlib/strtoimax.c head/lib/libc/stdlib/strtol.c head/lib/libc/stdlib/strtoll.c head/lib/libc/stdlib/strtoq.c head/lib/libc/stdlib/strtoul.c head/lib/libc/stdlib/strtoull.c head/lib/libc/stdlib/strtoumax.c head/lib/libc/stdlib/strtouq.c head/lib/libc/stdlib/system.c head/lib/libc/string/bcmp.c head/lib/libc/string/bcopy.c head/lib/libc/string/ffs.c head/lib/libc/string/ffsl.c head/lib/libc/string/ffsll.c head/lib/libc/string/fls.c head/lib/libc/string/flsl.c head/lib/libc/string/flsll.c head/lib/libc/string/memccpy.c head/lib/libc/string/memchr.c head/lib/libc/string/memcmp.c head/lib/libc/string/memset.c head/lib/libc/string/stpcpy.c head/lib/libc/string/strcasecmp.c head/lib/libc/string/strcasestr.c head/lib/libc/string/strcat.c head/lib/libc/string/strchr.c head/lib/libc/string/strcmp.c head/lib/libc/string/strcpy.c head/lib/libc/string/strdup.c head/lib/libc/string/strerror.c head/lib/libc/string/strmode.c head/lib/libc/string/strncat.c head/lib/libc/string/strncmp.c head/lib/libc/string/strncpy.c head/lib/libc/string/strnstr.c head/lib/libc/string/strpbrk.c head/lib/libc/string/strrchr.c head/lib/libc/string/strsep.c head/lib/libc/string/strsignal.c head/lib/libc/string/strstr.c head/lib/libc/string/strtok.c head/lib/libc/string/swab.c head/lib/libc/string/wcpcpy.c head/lib/libc/string/wcscmp.c head/lib/libc/string/wcsncmp.c head/lib/libc/string/wcsncpy.c head/lib/libc/string/wcsstr.c head/lib/libc/string/wcstok.c head/lib/libc/string/wcswidth.c head/lib/libc/sys/__error.c head/lib/libc/xdr/xdr.c head/lib/libc/xdr/xdr_array.c head/lib/libc/xdr/xdr_float.c head/lib/libc/xdr/xdr_mem.c head/lib/libc/xdr/xdr_rec.c head/lib/libc/xdr/xdr_reference.c head/lib/libc/xdr/xdr_sizeof.c head/lib/libc/xdr/xdr_stdio.c head/lib/libcompat/4.3/re_comp.c head/lib/libcompat/4.3/rexec.c head/lib/libcompat/4.4/cuserid.c head/lib/libcrypt/misc.c head/lib/libgssapi/gss_buffer_set.c head/lib/libgssapi/gss_display_status.c head/lib/libgssapi/gss_inquire_cred_by_oid.c head/lib/libgssapi/gss_oid_to_str.c head/lib/libgssapi/gss_pseudo_random.c head/lib/libgssapi/gss_release_oid.c head/lib/libgssapi/gss_set_cred_option.c head/lib/libgssapi/gss_set_sec_context_option.c head/lib/libiconv_modules/BIG5/citrus_big5.c head/lib/libiconv_modules/EUC/citrus_euc.c head/lib/libiconv_modules/UTF8/citrus_utf8.c head/lib/libipsec/ipsec_dump_policy.c head/lib/libipsec/ipsec_get_policylen.c head/lib/libipsec/ipsec_strerror.c head/lib/libipsec/ipsec_strerror.h head/lib/libipsec/libpfkey.h head/lib/libipsec/pfkey.c head/lib/libipsec/pfkey_dump.c head/lib/libipsec/policy_parse.y head/lib/libipsec/policy_token.l head/lib/libipsec/test-policy.c head/lib/libkvm/kvm.c head/lib/libkvm/kvm.h head/lib/libkvm/kvm_amd64.c head/lib/libkvm/kvm_arm.c head/lib/libkvm/kvm_cptime.c head/lib/libkvm/kvm_getloadavg.c head/lib/libkvm/kvm_i386.c head/lib/libkvm/kvm_pcpu.c head/lib/libkvm/kvm_powerpc.c head/lib/libkvm/kvm_powerpc64.c head/lib/libkvm/kvm_private.h head/lib/libkvm/kvm_proc.c head/lib/libkvm/kvm_sparc64.c head/lib/libnetbsd/sys/cdefs.h head/lib/libnetbsd/util.h head/lib/libpam/modules/pam_lastlog/pam_lastlog.c head/lib/librpcsec_gss/rpcsec_gss.c head/lib/librpcsec_gss/rpcsec_gss_int.h head/lib/librpcsec_gss/rpcsec_gss_prot.c head/lib/librpcsec_gss/svc_rpcsec_gss.c head/lib/libthr/thread/thr_clean.c head/lib/libthr/thread/thr_condattr.c head/lib/libthr/thread/thr_equal.c head/lib/libthr/thread/thr_exit.c head/lib/libthr/thread/thr_fork.c head/lib/libthr/thread/thr_getprio.c head/lib/libthr/thread/thr_info.c head/lib/libthr/thread/thr_kill.c head/lib/libthr/thread/thr_multi_np.c head/lib/libthr/thread/thr_mutexattr.c head/lib/libthr/thread/thr_resume_np.c head/lib/libthr/thread/thr_self.c head/lib/libthr/thread/thr_setprio.c head/lib/libthr/thread/thr_single_np.c head/lib/libthr/thread/thr_spec.c head/lib/libthr/thread/thr_spinlock.c head/lib/libthr/thread/thr_suspend_np.c head/lib/libthr/thread/thr_symbols.c head/lib/libthr/thread/thr_syscalls.c head/lib/libthr/thread/thr_yield.c head/lib/libthread_db/arch/mips/libpthread_md.c head/lib/libutil/hexdump.c head/lib/libutil/login_tty.c head/lib/libutil/pty.c head/lib/libutil/pw_util.c head/lib/libutil/uucplock.c head/lib/liby/main.c head/lib/liby/yyerror.c head/lib/ncurses/ncurses/pathnames.h head/lib/ncurses/ncurses/termcap.c head/libexec/bootpd/rtmsg.c head/libexec/comsat/comsat.c head/libexec/fingerd/fingerd.c head/libexec/fingerd/pathnames.h head/libexec/ftpd/extern.h head/libexec/ftpd/ftpcmd.y head/libexec/ftpd/ftpd.c head/libexec/ftpd/logwtmp.c head/libexec/ftpd/pathnames.h head/libexec/ftpd/popen.c head/libexec/getty/extern.h head/libexec/getty/gettytab.h head/libexec/getty/init.c head/libexec/getty/main.c head/libexec/getty/pathnames.h head/libexec/getty/subr.c head/libexec/mknetid/parse_group.c head/libexec/rbootd/bpf.c head/libexec/rbootd/conf.c head/libexec/rbootd/defs.h head/libexec/rbootd/parseconf.c head/libexec/rbootd/pathnames.h head/libexec/rbootd/rbootd.c head/libexec/rbootd/rmp.h head/libexec/rbootd/rmp_var.h head/libexec/rbootd/rmpproto.c head/libexec/rbootd/utils.c head/libexec/revnetgroup/parse_netgroup.c head/libexec/rpc.rstatd/rstatd.c head/libexec/rpc.rusersd/extern.h head/libexec/rpc.rusersd/rusers_proc.c head/libexec/rpc.rusersd/rusersd.c head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/rtld_printf.c head/libexec/talkd/announce.c head/libexec/talkd/print.c head/libexec/talkd/process.c head/libexec/talkd/table.c head/libexec/talkd/talkd.c head/libexec/tftpd/tftpd.c head/sbin/bsdlabel/pathnames.h head/sbin/clri/clri.c head/sbin/devd/devd.cc head/sbin/dhclient/alloc.c head/sbin/dhclient/bpf.c head/sbin/dhclient/clparse.c head/sbin/dhclient/conflex.c head/sbin/dhclient/convert.c head/sbin/dhclient/dhclient.c head/sbin/dhclient/dhcp.h head/sbin/dhclient/dhcpd.h head/sbin/dhclient/dhctoken.h head/sbin/dhclient/dispatch.c head/sbin/dhclient/errwarn.c head/sbin/dhclient/hash.c head/sbin/dhclient/inet.c head/sbin/dhclient/options.c head/sbin/dhclient/packet.c head/sbin/dhclient/parse.c head/sbin/dhclient/tables.c head/sbin/dhclient/tree.c head/sbin/dhclient/tree.h head/sbin/dmesg/dmesg.c head/sbin/dump/dump.h head/sbin/dump/dumprmt.c head/sbin/dump/itime.c head/sbin/dump/main.c head/sbin/dump/optr.c head/sbin/dump/pathnames.h head/sbin/dump/tape.c head/sbin/dump/traverse.c head/sbin/dump/unctime.c head/sbin/dumpfs/dumpfs.c head/sbin/dumpon/dumpon.c head/sbin/fsck/fsck.c head/sbin/fsck/fsutil.c head/sbin/fsck/preen.c head/sbin/fsck_ffs/dir.c head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/gjournal.c head/sbin/fsck_ffs/globs.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/pass1.c head/sbin/fsck_ffs/pass1b.c head/sbin/fsck_ffs/pass2.c head/sbin/fsck_ffs/pass3.c head/sbin/fsck_ffs/pass4.c head/sbin/fsck_ffs/pass5.c head/sbin/fsck_ffs/setup.c head/sbin/fsck_ffs/utilities.c head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_link.c head/sbin/ifconfig/ifclone.c head/sbin/ifconfig/ifconfig.c head/sbin/init/init.c head/sbin/init/pathnames.h head/sbin/mknod/mknod.c head/sbin/mount/getmntopts.c head/sbin/mount/mntopts.h head/sbin/mount/mount.c head/sbin/mount/mount_fs.c head/sbin/mount/pathnames.h head/sbin/mount/vfslist.c head/sbin/mount_cd9660/mount_cd9660.c head/sbin/mount_nfs/mount_nfs.c head/sbin/mount_nullfs/mount_nullfs.c head/sbin/mount_udf/mount_udf.c head/sbin/mount_unionfs/mount_unionfs.c head/sbin/newfs/mkfs.c head/sbin/newfs/newfs.c head/sbin/newfs/newfs.h head/sbin/nfsiod/nfsiod.c head/sbin/ping/ping.c head/sbin/ping6/ping6.c head/sbin/quotacheck/preen.c head/sbin/quotacheck/quotacheck.c head/sbin/quotacheck/quotacheck.h head/sbin/reboot/reboot.c head/sbin/restore/dirs.c head/sbin/restore/extern.h head/sbin/restore/interactive.c head/sbin/restore/main.c head/sbin/restore/restore.c head/sbin/restore/restore.h head/sbin/restore/symtab.c head/sbin/restore/tape.c head/sbin/restore/utilities.c head/sbin/route/route.c head/sbin/routed/defs.h head/sbin/routed/if.c head/sbin/routed/input.c head/sbin/routed/main.c head/sbin/routed/output.c head/sbin/routed/parms.c head/sbin/routed/pathnames.h head/sbin/routed/radix.c head/sbin/routed/radix.h head/sbin/routed/rdisc.c head/sbin/routed/rtquery/rtquery.c head/sbin/routed/table.c head/sbin/routed/trace.c head/sbin/savecore/savecore.c head/sbin/setkey/parse.y head/sbin/setkey/setkey.c head/sbin/setkey/test-pfkey.c head/sbin/setkey/test-policy.c head/sbin/setkey/token.l head/sbin/setkey/vchar.h head/sbin/shutdown/shutdown.c head/sbin/sunlabel/sunlabel.c head/sbin/swapon/swapon.c head/sbin/sysctl/sysctl.c head/sbin/tunefs/tunefs.c head/sbin/umount/umount.c head/share/examples/tests/tests/atf/cp_test.sh head/share/examples/tests/tests/atf/printf_test.c head/share/examples/tests/tests/plain/printf_test.c head/tools/regression/aio/aiop/aiop.c head/tools/regression/posixsem/posixsem.c head/tools/regression/posixsem/test.c head/tools/regression/posixsem/test.h head/tools/test/hwpmc/pmctest.py head/tools/tools/cxgbtool/cxgbtool.c head/tools/tools/pirtool/pirtable.h head/tools/tools/pirtool/pirtool.c head/tools/tools/vxge/vxge_cmn.h head/tools/tools/vxge/vxge_info.c head/tools/tools/vxge/vxge_info.h head/tools/tools/vxge/vxge_log.c head/tools/tools/vxge/vxge_log.h head/usr.bin/apply/apply.c head/usr.bin/ar/ar.c head/usr.bin/banner/banner.c head/usr.bin/basename/basename.c head/usr.bin/biff/biff.c head/usr.bin/calendar/calendar.c head/usr.bin/calendar/calendar.h head/usr.bin/calendar/day.c head/usr.bin/calendar/io.c head/usr.bin/calendar/locale.c head/usr.bin/calendar/pathnames.h head/usr.bin/calendar/pom.c head/usr.bin/cap_mkdb/cap_mkdb.c head/usr.bin/chpass/table.c head/usr.bin/cksum/cksum.c head/usr.bin/cksum/crc.c head/usr.bin/cksum/extern.h head/usr.bin/cksum/print.c head/usr.bin/cksum/sum1.c head/usr.bin/cksum/sum2.c head/usr.bin/cmp/cmp.c head/usr.bin/cmp/extern.h head/usr.bin/cmp/misc.c head/usr.bin/cmp/regular.c head/usr.bin/cmp/special.c head/usr.bin/col/col.c head/usr.bin/colrm/colrm.c head/usr.bin/column/column.c head/usr.bin/comm/comm.c head/usr.bin/compress/compress.c head/usr.bin/compress/zopen.c head/usr.bin/ctags/C.c head/usr.bin/ctags/ctags.c head/usr.bin/ctags/ctags.h head/usr.bin/ctags/fortran.c head/usr.bin/ctags/lisp.c head/usr.bin/ctags/print.c head/usr.bin/ctags/tree.c head/usr.bin/ctags/yacc.c head/usr.bin/cut/cut.c head/usr.bin/dirname/dirname.c head/usr.bin/du/du.c head/usr.bin/env/env.c head/usr.bin/expand/expand.c head/usr.bin/false/false.c head/usr.bin/find/extern.h head/usr.bin/find/find.c head/usr.bin/find/find.h head/usr.bin/find/function.c head/usr.bin/find/ls.c head/usr.bin/find/main.c head/usr.bin/find/misc.c head/usr.bin/find/operator.c head/usr.bin/find/option.c head/usr.bin/finger/extern.h head/usr.bin/finger/finger.c head/usr.bin/finger/finger.h head/usr.bin/finger/lprint.c head/usr.bin/finger/net.c head/usr.bin/finger/sprint.c head/usr.bin/finger/util.c head/usr.bin/fold/fold.c head/usr.bin/from/from.c head/usr.bin/fstat/fstat.c head/usr.bin/gcore/extern.h head/usr.bin/gcore/gcore.c head/usr.bin/gprof/amd64.h head/usr.bin/gprof/aout.c head/usr.bin/gprof/arcs.c head/usr.bin/gprof/arm.h head/usr.bin/gprof/dfn.c head/usr.bin/gprof/elf.c head/usr.bin/gprof/gprof.c head/usr.bin/gprof/gprof.h head/usr.bin/gprof/hertz.c head/usr.bin/gprof/i386.h head/usr.bin/gprof/lookup.c head/usr.bin/gprof/mips.h head/usr.bin/gprof/pathnames.h head/usr.bin/gprof/powerpc.h head/usr.bin/gprof/printgprof.c head/usr.bin/gprof/printlist.c head/usr.bin/gprof/sparc64.h head/usr.bin/gzip/zuncompress.c head/usr.bin/head/head.c head/usr.bin/hexdump/conv.c head/usr.bin/hexdump/display.c head/usr.bin/hexdump/hexdump.c head/usr.bin/hexdump/hexdump.h head/usr.bin/hexdump/hexsyntax.c head/usr.bin/hexdump/odsyntax.c head/usr.bin/hexdump/parse.c head/usr.bin/id/id.c head/usr.bin/join/join.c head/usr.bin/jot/jot.c head/usr.bin/kdump/kdump.c head/usr.bin/ktrace/ktrace.c head/usr.bin/ktrace/ktrace.h head/usr.bin/ktrace/subr.c head/usr.bin/lam/lam.c head/usr.bin/last/last.c head/usr.bin/lastcomm/lastcomm.c head/usr.bin/lastcomm/pathnames.h head/usr.bin/leave/leave.c head/usr.bin/lex/initparse.c head/usr.bin/lock/lock.c head/usr.bin/logger/logger.c head/usr.bin/login/login_audit.c head/usr.bin/login/pathnames.h head/usr.bin/logname/logname.c head/usr.bin/look/look.c head/usr.bin/look/pathnames.h head/usr.bin/lorder/lorder.sh head/usr.bin/m4/eval.c head/usr.bin/m4/extern.h head/usr.bin/m4/look.c head/usr.bin/m4/main.c head/usr.bin/m4/mdef.h head/usr.bin/m4/misc.c head/usr.bin/m4/pathnames.h head/usr.bin/m4/stdd.h head/usr.bin/mail/cmd1.c head/usr.bin/mail/cmd2.c head/usr.bin/mail/cmd3.c head/usr.bin/mail/cmdtab.c head/usr.bin/mail/collect.c head/usr.bin/mail/def.h head/usr.bin/mail/edit.c head/usr.bin/mail/extern.h head/usr.bin/mail/fio.c head/usr.bin/mail/getname.c head/usr.bin/mail/glob.h head/usr.bin/mail/head.c head/usr.bin/mail/lex.c head/usr.bin/mail/list.c head/usr.bin/mail/main.c head/usr.bin/mail/names.c head/usr.bin/mail/pathnames.h head/usr.bin/mail/popen.c head/usr.bin/mail/quit.c head/usr.bin/mail/rcv.h head/usr.bin/mail/send.c head/usr.bin/mail/strings.c head/usr.bin/mail/temp.c head/usr.bin/mail/tty.c head/usr.bin/mail/util.c head/usr.bin/mail/v7.local.c head/usr.bin/mail/vars.c head/usr.bin/mail/version.c head/usr.bin/mesg/mesg.c head/usr.bin/mkdep/mkdep.gcc.sh head/usr.bin/mkdep/mkdep.sh head/usr.bin/mkfifo/mkfifo.c head/usr.bin/mklocale/extern.h head/usr.bin/mklocale/ldef.h head/usr.bin/mklocale/lex.l head/usr.bin/mklocale/yacc.y head/usr.bin/mkstr/mkstr.c head/usr.bin/msgs/msgs.c head/usr.bin/msgs/pathnames.h head/usr.bin/mt/mt.c head/usr.bin/netstat/if.c head/usr.bin/netstat/inet6.c head/usr.bin/netstat/ipsec.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/pfkey.c head/usr.bin/netstat/route.c head/usr.bin/netstat/sctp.c head/usr.bin/netstat/unix.c head/usr.bin/nice/nice.c head/usr.bin/nohup/nohup.c head/usr.bin/pagesize/pagesize.sh head/usr.bin/paste/paste.c head/usr.bin/patch/mkpath.c head/usr.bin/printenv/printenv.c head/usr.bin/printf/printf.c head/usr.bin/quota/quota.c head/usr.bin/renice/renice.c head/usr.bin/rev/rev.c head/usr.bin/rs/rs.c head/usr.bin/ruptime/ruptime.c head/usr.bin/rwho/rwho.c head/usr.bin/script/script.c head/usr.bin/sed/compile.c head/usr.bin/sed/defs.h head/usr.bin/sed/extern.h head/usr.bin/sed/main.c head/usr.bin/sed/misc.c head/usr.bin/sed/process.c head/usr.bin/shar/shar.sh head/usr.bin/showmount/showmount.c head/usr.bin/split/split.c head/usr.bin/su/su.c head/usr.bin/systat/cmds.c head/usr.bin/systat/cmdtab.c head/usr.bin/systat/devs.c head/usr.bin/systat/extern.h head/usr.bin/systat/fetch.c head/usr.bin/systat/icmp.c head/usr.bin/systat/icmp6.c head/usr.bin/systat/iostat.c head/usr.bin/systat/ip.c head/usr.bin/systat/ip6.c head/usr.bin/systat/keyboard.c head/usr.bin/systat/main.c head/usr.bin/systat/netcmds.c head/usr.bin/systat/netstat.c head/usr.bin/systat/pigs.c head/usr.bin/systat/swap.c head/usr.bin/systat/systat.h head/usr.bin/systat/tcp.c head/usr.bin/systat/vmstat.c head/usr.bin/tail/extern.h head/usr.bin/tail/forward.c head/usr.bin/tail/misc.c head/usr.bin/tail/read.c head/usr.bin/tail/reverse.c head/usr.bin/tail/tail.c head/usr.bin/talk/ctl.c head/usr.bin/talk/ctl_transact.c head/usr.bin/talk/display.c head/usr.bin/talk/get_addrs.c head/usr.bin/talk/get_names.c head/usr.bin/talk/init_disp.c head/usr.bin/talk/invite.c head/usr.bin/talk/io.c head/usr.bin/talk/look_up.c head/usr.bin/talk/msgs.c head/usr.bin/talk/talk.c head/usr.bin/talk/talk.h head/usr.bin/talk/talk_ctl.h head/usr.bin/tcopy/tcopy.c head/usr.bin/tee/tee.c head/usr.bin/tftp/main.c head/usr.bin/tftp/tftp.c head/usr.bin/tftp/tftp.h head/usr.bin/time/time.c head/usr.bin/tip/libacu/biz22.c head/usr.bin/tip/libacu/biz31.c head/usr.bin/tip/libacu/courier.c head/usr.bin/tip/libacu/df.c head/usr.bin/tip/libacu/dn11.c head/usr.bin/tip/libacu/hayes.c head/usr.bin/tip/libacu/t3000.c head/usr.bin/tip/libacu/v3451.c head/usr.bin/tip/libacu/v831.c head/usr.bin/tip/libacu/ventel.c head/usr.bin/tip/tip/acu.c head/usr.bin/tip/tip/acutab.c head/usr.bin/tip/tip/cmds.c head/usr.bin/tip/tip/cmdtab.c head/usr.bin/tip/tip/cu.c head/usr.bin/tip/tip/hunt.c head/usr.bin/tip/tip/log.c head/usr.bin/tip/tip/partab.c head/usr.bin/tip/tip/pathnames.h head/usr.bin/tip/tip/remote.c head/usr.bin/tip/tip/tip.c head/usr.bin/tip/tip/tip.h head/usr.bin/tip/tip/tipout.c head/usr.bin/tip/tip/uucplock.c head/usr.bin/tip/tip/value.c head/usr.bin/tip/tip/vars.c head/usr.bin/touch/touch.c head/usr.bin/tput/clear.sh head/usr.bin/tput/tput.c head/usr.bin/tr/extern.h head/usr.bin/tr/str.c head/usr.bin/tr/tr.c head/usr.bin/true/true.c head/usr.bin/tset/extern.h head/usr.bin/tset/map.c head/usr.bin/tset/misc.c head/usr.bin/tset/set.c head/usr.bin/tset/term.c head/usr.bin/tset/tset.c head/usr.bin/tset/wrterm.c head/usr.bin/tsort/tsort.c head/usr.bin/tty/tty.c head/usr.bin/ul/ul.c head/usr.bin/unexpand/unexpand.c head/usr.bin/uniq/uniq.c head/usr.bin/uudecode/uudecode.c head/usr.bin/uuencode/uuencode.c head/usr.bin/vgrind/extern.h head/usr.bin/vgrind/pathnames.h head/usr.bin/vgrind/regexp.c head/usr.bin/vgrind/vfontedpr.c head/usr.bin/vgrind/vgrind.sh head/usr.bin/vmstat/vmstat.c head/usr.bin/w/extern.h head/usr.bin/w/pr_time.c head/usr.bin/w/proc_compare.c head/usr.bin/w/w.c head/usr.bin/wall/ttymsg.c head/usr.bin/wall/wall.c head/usr.bin/wc/wc.c head/usr.bin/what/what.c head/usr.bin/whois/whois.c head/usr.bin/write/write.c head/usr.bin/xargs/pathnames.h head/usr.bin/xargs/xargs.c head/usr.bin/xinstall/xinstall.c head/usr.bin/xstr/pathnames.h head/usr.bin/xstr/xstr.c head/usr.bin/yes/yes.c head/usr.sbin/accton/accton.c head/usr.sbin/arp/arp.c head/usr.sbin/chown/chown.c head/usr.sbin/chroot/chroot.c head/usr.sbin/config/config.h head/usr.sbin/config/config.y head/usr.sbin/config/lang.l head/usr.sbin/config/main.c head/usr.sbin/config/mkheaders.c head/usr.sbin/config/mkmakefile.c head/usr.sbin/config/mkoptions.c head/usr.sbin/crashinfo/crashinfo.sh head/usr.sbin/edquota/edquota.c head/usr.sbin/edquota/pathnames.h head/usr.sbin/ifmcstat/ifmcstat.c head/usr.sbin/ifmcstat/printb.c head/usr.sbin/inetd/inetd.c head/usr.sbin/inetd/inetd.h head/usr.sbin/inetd/pathnames.h head/usr.sbin/iostat/iostat.c head/usr.sbin/ip6addrctl/ip6addrctl.c head/usr.sbin/kgmon/kgmon.c head/usr.sbin/lpr/common_source/displayq.c head/usr.sbin/lpr/common_source/lp.h head/usr.sbin/lpr/common_source/lp.local.h head/usr.sbin/lpr/common_source/pathnames.h head/usr.sbin/lpr/common_source/rmjob.c head/usr.sbin/lpr/common_source/startdaemon.c head/usr.sbin/lpr/filters/lpf.c head/usr.sbin/lpr/lpc/cmds.c head/usr.sbin/lpr/lpc/cmdtab.c head/usr.sbin/lpr/lpc/extern.h head/usr.sbin/lpr/lpc/lpc.c head/usr.sbin/lpr/lpc/lpc.h head/usr.sbin/lpr/lpd/extern.h head/usr.sbin/lpr/lpd/lpd.c head/usr.sbin/lpr/lpd/lpdchar.c head/usr.sbin/lpr/lpd/modes.c head/usr.sbin/lpr/lpd/printjob.c head/usr.sbin/lpr/lpd/recvjob.c head/usr.sbin/lpr/lpq/lpq.c head/usr.sbin/lpr/lprm/lprm.c head/usr.sbin/lpr/lptest/lptest.c head/usr.sbin/lpr/pac/pac.c head/usr.sbin/makefs/ffs/ffs_alloc.c head/usr.sbin/makefs/ffs/ffs_balloc.c head/usr.sbin/makefs/ffs/ffs_extern.h head/usr.sbin/makefs/ffs/ffs_subr.c head/usr.sbin/makefs/ffs/mkfs.c head/usr.sbin/makefs/ffs/ufs_bmap.c head/usr.sbin/makefs/ffs/ufs_inode.h head/usr.sbin/mld6query/mld6.c head/usr.sbin/mountd/mountd.c head/usr.sbin/mountd/pathnames.h head/usr.sbin/mptutil/mpt_cam.c head/usr.sbin/mptutil/mpt_cmd.c head/usr.sbin/mptutil/mpt_config.c head/usr.sbin/mptutil/mpt_drive.c head/usr.sbin/mptutil/mpt_evt.c head/usr.sbin/mptutil/mpt_show.c head/usr.sbin/mptutil/mpt_volume.c head/usr.sbin/mptutil/mptutil.c head/usr.sbin/mptutil/mptutil.h head/usr.sbin/nandsim/nandsim_rcfile.c head/usr.sbin/nandsim/nandsim_rcfile.h head/usr.sbin/ndp/ndp.c head/usr.sbin/nfsd/nfsd.c head/usr.sbin/pciconf/cap.c head/usr.sbin/pciconf/pciconf.h head/usr.sbin/ppp/slcompress.c head/usr.sbin/ppp/slcompress.h head/usr.sbin/pstat/pstat.c head/usr.sbin/pwd_mkdb/pwd_mkdb.c head/usr.sbin/quotaon/quotaon.c head/usr.sbin/repquota/repquota.c head/usr.sbin/rip6query/rip6query.c head/usr.sbin/rmt/rmt.c head/usr.sbin/route6d/misc/cksum.c head/usr.sbin/route6d/route6d.c head/usr.sbin/route6d/route6d.h head/usr.sbin/rpcbind/check_bound.c head/usr.sbin/rpcbind/pmap_svc.c head/usr.sbin/rpcbind/rpcb_stat.c head/usr.sbin/rpcbind/rpcb_svc.c head/usr.sbin/rpcbind/rpcb_svc_4.c head/usr.sbin/rpcbind/rpcb_svc_com.c head/usr.sbin/rpcbind/rpcbind.c head/usr.sbin/rpcbind/rpcbind.h head/usr.sbin/rpcbind/warmstart.c head/usr.sbin/rrenumd/lexer.l head/usr.sbin/rrenumd/parser.y head/usr.sbin/rrenumd/rrenumd.c head/usr.sbin/rtadvd/advcap.c head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/config.h head/usr.sbin/rtadvd/if.c head/usr.sbin/rtadvd/if.h head/usr.sbin/rtadvd/rrenum.c head/usr.sbin/rtadvd/rrenum.h head/usr.sbin/rtadvd/rtadvd.c head/usr.sbin/rtadvd/rtadvd.h head/usr.sbin/rtadvd/timer.c head/usr.sbin/rtadvd/timer.h head/usr.sbin/rtadvd/timer_subr.c head/usr.sbin/rtadvd/timer_subr.h head/usr.sbin/rtsold/dump.c head/usr.sbin/rtsold/if.c head/usr.sbin/rtsold/probe.c head/usr.sbin/rtsold/rtsock.c head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h head/usr.sbin/rwhod/rwhod.c head/usr.sbin/setfib/setfib.c head/usr.sbin/syslogd/pathnames.h head/usr.sbin/syslogd/syslogd.c head/usr.sbin/timed/timed/acksend.c head/usr.sbin/timed/timed/byteorder.c head/usr.sbin/timed/timed/candidate.c head/usr.sbin/timed/timed/cksum.c head/usr.sbin/timed/timed/correct.c head/usr.sbin/timed/timed/extern.h head/usr.sbin/timed/timed/globals.h head/usr.sbin/timed/timed/master.c head/usr.sbin/timed/timed/measure.c head/usr.sbin/timed/timed/networkdelta.c head/usr.sbin/timed/timed/pathnames.h head/usr.sbin/timed/timed/readmsg.c head/usr.sbin/timed/timed/slave.c head/usr.sbin/timed/timed/timed.c head/usr.sbin/timed/timedc/cmds.c head/usr.sbin/timed/timedc/cmdtab.c head/usr.sbin/timed/timedc/extern.h head/usr.sbin/timed/timedc/timedc.c head/usr.sbin/timed/timedc/timedc.h head/usr.sbin/traceroute6/traceroute6.c head/usr.sbin/trpt/trpt.c head/usr.sbin/vipw/vipw.c Modified: head/bin/cat/cat.c ============================================================================== --- head/bin/cat/cat.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/cat/cat.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/chflags/chflags.c ============================================================================== --- head/bin/chflags/chflags.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/chflags/chflags.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/chmod/chmod.c ============================================================================== --- head/bin/chmod/chmod.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/chmod/chmod.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/cp/cp.c ============================================================================== --- head/bin/cp/cp.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/cp/cp.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/cp/extern.h ============================================================================== --- head/bin/cp/extern.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/cp/extern.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/cp/utils.c ============================================================================== --- head/bin/cp/utils.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/cp/utils.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/date/date.c ============================================================================== --- head/bin/date/date.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/date/date.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1985, 1987, 1988, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/date/extern.h ============================================================================== --- head/bin/date/extern.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/date/extern.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/date/netdate.c ============================================================================== --- head/bin/date/netdate.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/date/netdate.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/dd/args.c ============================================================================== --- head/bin/dd/args.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/dd/args.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/dd/conv.c ============================================================================== --- head/bin/dd/conv.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/dd/conv.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/dd/conv_tab.c ============================================================================== --- head/bin/dd/conv_tab.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/dd/conv_tab.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/dd/dd.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/dd/dd.h ============================================================================== --- head/bin/dd/dd.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/dd/dd.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/dd/extern.h ============================================================================== --- head/bin/dd/extern.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/dd/extern.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/dd/misc.c ============================================================================== --- head/bin/dd/misc.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/dd/misc.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/dd/position.c ============================================================================== --- head/bin/dd/position.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/dd/position.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/df/df.c ============================================================================== --- head/bin/df/df.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/df/df.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1980, 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. Modified: head/bin/domainname/domainname.c ============================================================================== --- head/bin/domainname/domainname.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/domainname/domainname.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/echo/echo.c ============================================================================== --- head/bin/echo/echo.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/echo/echo.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ed/cbc.c ============================================================================== --- head/bin/ed/cbc.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ed/cbc.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,5 +1,7 @@ /* cbc.c: This file contains the encryption routines for the ed line editor */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 The Regents of the University of California. * All rights reserved. * Modified: head/bin/hostname/hostname.c ============================================================================== --- head/bin/hostname/hostname.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/hostname/hostname.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/kill/kill.c ============================================================================== --- head/bin/kill/kill.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/kill/kill.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1988, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ln/ln.c ============================================================================== --- head/bin/ln/ln.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ln/ln.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1987, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ls/cmp.c ============================================================================== --- head/bin/ls/cmp.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ls/cmp.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ls/extern.h ============================================================================== --- head/bin/ls/extern.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ls/extern.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ls/ls.c ============================================================================== --- head/bin/ls/ls.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ls/ls.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ls/ls.h ============================================================================== --- head/bin/ls/ls.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ls/ls.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ls/print.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ls/util.c ============================================================================== --- head/bin/ls/util.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ls/util.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/mkdir/mkdir.c ============================================================================== --- head/bin/mkdir/mkdir.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/mkdir/mkdir.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1992, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/mv/mv.c ============================================================================== --- head/bin/mv/mv.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/mv/mv.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/pax/ar_io.c ============================================================================== --- head/bin/pax/ar_io.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/ar_io.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/ar_subs.c ============================================================================== --- head/bin/pax/ar_subs.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/ar_subs.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/buf_subs.c ============================================================================== --- head/bin/pax/buf_subs.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/buf_subs.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/cache.c ============================================================================== --- head/bin/pax/cache.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/cache.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/cache.h ============================================================================== --- head/bin/pax/cache.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/cache.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/cpio.c ============================================================================== --- head/bin/pax/cpio.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/cpio.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/cpio.h ============================================================================== --- head/bin/pax/cpio.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/cpio.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/extern.h ============================================================================== --- head/bin/pax/extern.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/extern.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/file_subs.c ============================================================================== --- head/bin/pax/file_subs.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/file_subs.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/ftree.c ============================================================================== --- head/bin/pax/ftree.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/ftree.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/ftree.h ============================================================================== --- head/bin/pax/ftree.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/ftree.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/gen_subs.c ============================================================================== --- head/bin/pax/gen_subs.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/gen_subs.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/options.c ============================================================================== --- head/bin/pax/options.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/options.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/options.h ============================================================================== --- head/bin/pax/options.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/options.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/pat_rep.c ============================================================================== --- head/bin/pax/pat_rep.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/pat_rep.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/pat_rep.h ============================================================================== --- head/bin/pax/pat_rep.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/pat_rep.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/pax.c ============================================================================== --- head/bin/pax/pax.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/pax.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/pax.h ============================================================================== --- head/bin/pax/pax.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/pax.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/sel_subs.c ============================================================================== --- head/bin/pax/sel_subs.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/sel_subs.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/sel_subs.h ============================================================================== --- head/bin/pax/sel_subs.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/sel_subs.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/tables.c ============================================================================== --- head/bin/pax/tables.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/tables.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/tables.h ============================================================================== --- head/bin/pax/tables.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/tables.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/tar.c ============================================================================== --- head/bin/pax/tar.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/tar.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/tar.h ============================================================================== --- head/bin/pax/tar.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/tar.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/pax/tty_subs.c ============================================================================== --- head/bin/pax/tty_subs.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pax/tty_subs.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992 Keith Muller. * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. Modified: head/bin/ps/extern.h ============================================================================== --- head/bin/ps/extern.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ps/extern.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ps/fmt.c ============================================================================== --- head/bin/ps/fmt.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ps/fmt.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ps/keyword.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ps/nlist.c ============================================================================== --- head/bin/ps/nlist.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ps/nlist.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ps/print.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ps/ps.c ============================================================================== --- head/bin/ps/ps.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ps/ps.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/ps/ps.h ============================================================================== --- head/bin/ps/ps.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/ps/ps.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/pwd/pwd.c ============================================================================== --- head/bin/pwd/pwd.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/pwd/pwd.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/realpath/realpath.c ============================================================================== --- head/bin/realpath/realpath.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/realpath/realpath.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/rm/rm.c ============================================================================== --- head/bin/rm/rm.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/rm/rm.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/rmdir/rmdir.c ============================================================================== --- head/bin/rmdir/rmdir.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/rmdir/rmdir.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/bltin/bltin.h ============================================================================== --- head/bin/sh/bltin/bltin.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/bltin/bltin.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/bltin/echo.c ============================================================================== --- head/bin/sh/bltin/echo.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/bltin/echo.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/mail.h ============================================================================== --- head/bin/sh/mail.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/mail.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/main.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/main.h ============================================================================== --- head/bin/sh/main.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/main.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/memalloc.c ============================================================================== --- head/bin/sh/memalloc.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/memalloc.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/memalloc.h ============================================================================== --- head/bin/sh/memalloc.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/memalloc.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/miscbltin.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/mknodes.c ============================================================================== --- head/bin/sh/mknodes.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/mknodes.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/mksyntax.c ============================================================================== --- head/bin/sh/mksyntax.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/mksyntax.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/myhistedit.h ============================================================================== --- head/bin/sh/myhistedit.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/myhistedit.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/mystring.c ============================================================================== --- head/bin/sh/mystring.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/mystring.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/mystring.h ============================================================================== --- head/bin/sh/mystring.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/mystring.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/options.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/options.h ============================================================================== --- head/bin/sh/options.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/options.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/output.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/output.h ============================================================================== --- head/bin/sh/output.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/output.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/parser.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/parser.h ============================================================================== --- head/bin/sh/parser.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/parser.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/redir.c ============================================================================== --- head/bin/sh/redir.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/redir.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/redir.h ============================================================================== --- head/bin/sh/redir.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/redir.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/shell.h ============================================================================== --- head/bin/sh/shell.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/shell.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/show.c ============================================================================== --- head/bin/sh/show.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/show.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/show.h ============================================================================== --- head/bin/sh/show.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/show.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1995 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/trap.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/trap.h ============================================================================== --- head/bin/sh/trap.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/trap.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/var.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/bin/sh/var.h ============================================================================== --- head/bin/sh/var.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/bin/sh/var.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/amd64/SYS.h ============================================================================== --- head/lib/libc/amd64/SYS.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/amd64/SYS.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/lib/libc/arm/SYS.h ============================================================================== --- head/lib/libc/arm/SYS.h Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/arm/SYS.h Mon Nov 20 19:49:47 2017 (r326025) @@ -1,6 +1,8 @@ /* $NetBSD: SYS.h,v 1.8 2003/08/07 16:42:02 agc Exp $ */ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * Modified: head/lib/libc/compat-43/creat.c ============================================================================== --- head/lib/libc/compat-43/creat.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/compat-43/creat.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/compat-43/gethostid.c ============================================================================== --- head/lib/libc/compat-43/gethostid.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/compat-43/gethostid.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/compat-43/getwd.c ============================================================================== --- head/lib/libc/compat-43/getwd.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/compat-43/getwd.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/compat-43/killpg.c ============================================================================== --- head/lib/libc/compat-43/killpg.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/compat-43/killpg.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/compat-43/sethostid.c ============================================================================== --- head/lib/libc/compat-43/sethostid.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/compat-43/sethostid.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/compat-43/setpgrp.c ============================================================================== --- head/lib/libc/compat-43/setpgrp.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/compat-43/setpgrp.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/compat-43/setrgid.c ============================================================================== --- head/lib/libc/compat-43/setrgid.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/compat-43/setrgid.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/compat-43/setruid.c ============================================================================== --- head/lib/libc/compat-43/setruid.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/compat-43/setruid.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/compat-43/sigcompat.c ============================================================================== --- head/lib/libc/compat-43/sigcompat.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/compat-43/sigcompat.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1989, 1993 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/db/btree/bt_close.c ============================================================================== --- head/lib/libc/db/btree/bt_close.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/db/btree/bt_close.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/db/btree/bt_conv.c ============================================================================== --- head/lib/libc/db/btree/bt_conv.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/db/btree/bt_conv.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * Modified: head/lib/libc/db/btree/bt_debug.c ============================================================================== --- head/lib/libc/db/btree/bt_debug.c Mon Nov 20 19:45:28 2017 (r326024) +++ head/lib/libc/db/btree/bt_debug.c Mon Nov 20 19:49:47 2017 (r326025) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1990, 1993, 1994 * The Regents of the University of California. All rights reserved. * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Nov 20 19:50: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 C8D54DF3F33; Mon, 20 Nov 2017 19:50:49 +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 458506A454; Mon, 20 Nov 2017 19:50:49 +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 vAKJomQY034343; Mon, 20 Nov 2017 19:50:48 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJomR2034342; Mon, 20 Nov 2017 19:50:48 GMT (envelope-from np@FreeBSD.org) Message-Id: <201711201950.vAKJomR2034342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 20 Nov 2017 19:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326026 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 326026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 19:50:50 -0000 Author: np Date: Mon Nov 20 19:50:48 2017 New Revision: 326026 URL: https://svnweb.freebsd.org/changeset/base/326026 Log: cxgbe(4): Add a custom board to the device id list. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Nov 20 19:49:47 2017 (r326025) +++ head/sys/dev/cxgbe/t4_main.c Mon Nov 20 19:50:48 2017 (r326026) @@ -677,6 +677,7 @@ struct { /* Custom */ {0x6480, "Chelsio T6225 80"}, {0x6481, "Chelsio T62100 81"}, + {0x6484, "Chelsio T62100 84"}, }; #ifdef TCP_OFFLOAD From owner-svn-src-head@freebsd.org Mon Nov 20 19:56: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 716B9DF417E; Mon, 20 Nov 2017 19:56:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DA796A7F8; Mon, 20 Nov 2017 19:56:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKJuCDj038601; Mon, 20 Nov 2017 19:56:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKJuCRj038598; Mon, 20 Nov 2017 19:56:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711201956.vAKJuCRj038598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Nov 2017 19:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326027 - in head: include/arpa sys/arm/xscale/ixp425 sys/conf X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: include/arpa sys/arm/xscale/ixp425 sys/conf X-SVN-Commit-Revision: 326027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 19:56:13 -0000 Author: pfg Date: Mon Nov 20 19:56:11 2017 New Revision: 326027 URL: https://svnweb.freebsd.org/changeset/base/326027 Log: Indent protection and some other oops from the prvious commits. Modified: head/include/arpa/tftp.h head/sys/arm/xscale/ixp425/if_npereg.h head/sys/conf/newvers.sh Modified: head/include/arpa/tftp.h ============================================================================== --- head/include/arpa/tftp.h Mon Nov 20 19:50:48 2017 (r326026) +++ head/include/arpa/tftp.h Mon Nov 20 19:56:11 2017 (r326027) @@ -1,4 +1,4 @@ -/**- +/*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 1983, 1993 Modified: head/sys/arm/xscale/ixp425/if_npereg.h ============================================================================== --- head/sys/arm/xscale/ixp425/if_npereg.h Mon Nov 20 19:50:48 2017 (r326026) +++ head/sys/arm/xscale/ixp425/if_npereg.h Mon Nov 20 19:56:11 2017 (r326027) @@ -29,7 +29,7 @@ * $FreeBSD$ */ -/* +/*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2001-2005, Intel Corporation. Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Mon Nov 20 19:50:48 2017 (r326026) +++ head/sys/conf/newvers.sh Mon Nov 20 19:56:11 2017 (r326027) @@ -1,6 +1,6 @@ #!/bin/sh - -# SPDX-License-Identifier: BSD-3-Clause # +# SPDX-License-Identifier: BSD-3-Clause # # Copyright (c) 1984, 1986, 1990, 1993 # The Regents of the University of California. All rights reserved. From owner-svn-src-head@freebsd.org Mon Nov 20 20:05: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 A7EBDDF4470; Mon, 20 Nov 2017 20:05:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 750C66AFB6; Mon, 20 Nov 2017 20:05:31 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKK5UWG042765; Mon, 20 Nov 2017 20:05:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKK5UhN042764; Mon, 20 Nov 2017 20:05:30 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711202005.vAKK5UhN042764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 20 Nov 2017 20:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326028 - head/lib/libc/iconv X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/lib/libc/iconv X-SVN-Commit-Revision: 326028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 20:05:31 -0000 Author: pfg Date: Mon Nov 20 20:05:30 2017 New Revision: 326028 URL: https://svnweb.freebsd.org/changeset/base/326028 Log: iconv: Fix a pointer mismatch. Catch NULL pointer earlier, check for empty string later. Apparently this fixes a GCC8 warning. Obtained from: NetBSD (CVS Rev. 1.21, 1.22) through DragonFlyBSD MFC after: 1 week Modified: head/lib/libc/iconv/citrus_none.c Modified: head/lib/libc/iconv/citrus_none.c ============================================================================== --- head/lib/libc/iconv/citrus_none.c Mon Nov 20 19:56:11 2017 (r326027) +++ head/lib/libc/iconv/citrus_none.c Mon Nov 20 20:05:30 2017 (r326028) @@ -164,7 +164,7 @@ _citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __r struct iconv_hooks *hooks) { - if (s == NULL) { + if (*s == NULL) { *nresult = 0; return (0); } @@ -176,7 +176,7 @@ _citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __r if (pwc != NULL) *pwc = (_wc_t)(unsigned char) **s; - *nresult = *s == '\0' ? 0 : 1; + *nresult = **s == '\0' ? 0 : 1; if ((hooks != NULL) && (hooks->wc_hook != NULL)) hooks->wc_hook(*pwc, hooks->data); From owner-svn-src-head@freebsd.org Mon Nov 20 20:53: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 D58E1DF52E1; Mon, 20 Nov 2017 20:53:04 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A22CC6CA44; Mon, 20 Nov 2017 20:53:04 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKKr3OH063463; Mon, 20 Nov 2017 20:53:03 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKKr3Gk063462; Mon, 20 Nov 2017 20:53:03 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201711202053.vAKKr3Gk063462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 20 Nov 2017 20:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326029 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 20:53:04 -0000 Author: scottl Date: Mon Nov 20 20:53:03 2017 New Revision: 326029 URL: https://svnweb.freebsd.org/changeset/base/326029 Log: Update a comment in brelse() to match reality. Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Nov 20 20:05:30 2017 (r326028) +++ head/sys/kern/vfs_bio.c Mon Nov 20 20:53:03 2017 (r326029) @@ -2340,9 +2340,18 @@ brelse(struct buf *bp) !(bp->b_flags & B_INVAL)) { /* * Failed write, redirty. All errors except ENXIO (which - * means the device is gone) are expected to be potentially - * transient - underlying media might work if tried again - * after EIO, and memory might be available after an ENOMEM. + * means the device is gone) are treated as being + * transient. + * + * XXX Treating EIO as transient is not correct; the + * contract with the local storage device drivers is that + * they will only return EIO once the I/O is no longer + * retriable. Network I/O also respects this through the + * guarantees of TCP and/or the internal retries of NFS. + * ENOMEM might be transient, but we also have no way of + * knowing when its ok to retry/reschedule. In general, + * this entire case should be made obsolete through better + * error handling/recovery and resource scheduling. * * Do this also for buffers that failed with ENXIO, but have * non-empty dependencies - the soft updates code might need From owner-svn-src-head@freebsd.org Mon Nov 20 20:55: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 E948DDF53BA; Mon, 20 Nov 2017 20:55:42 +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 B63F76CBFC; Mon, 20 Nov 2017 20:55:42 +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 vAKKtf9N063606; Mon, 20 Nov 2017 20:55:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKKtfEd063604; Mon, 20 Nov 2017 20:55:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711202055.vAKKtfEd063604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 20 Nov 2017 20:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326030 - in head: lib usr.bin X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: lib usr.bin X-SVN-Commit-Revision: 326030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 20:55:43 -0000 Author: emaste Date: Mon Nov 20 20:55:41 2017 New Revision: 326030 URL: https://svnweb.freebsd.org/changeset/base/326030 Log: Install strings unconditionally Previously it was enabled by WITH_/WITHOUT_TOOLCHAIN, but it is commonly expected to be available and may have non-toolchain consumers. As it is now taken from the BSD-licensed ELF Tool Chain project, just install it unconditionally. PR: 213665, 223725 Reviewed by: bdrewery MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8398 Modified: head/lib/Makefile head/usr.bin/Makefile Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Nov 20 20:53:03 2017 (r326029) +++ head/lib/Makefile Mon Nov 20 20:55:41 2017 (r326030) @@ -44,6 +44,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ ${_libdl} \ libdwarf \ libedit \ + libelftc \ libevent \ libexecinfo \ libexpat \ @@ -136,7 +137,7 @@ SUBDIR.${MK_CLANG}+= clang SUBDIR.${MK_CUSE}+= libcuse SUBDIR.${MK_CXX}+= libdevdctl -SUBDIR.${MK_TOOLCHAIN}+=libelftc libpe +SUBDIR.${MK_TOOLCHAIN}+=libpe SUBDIR.${MK_DIALOG}+= libdpv SUBDIR.${MK_FILE}+= libmagic SUBDIR.${MK_GPIO}+= libgpio Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon Nov 20 20:53:03 2017 (r326029) +++ head/usr.bin/Makefile Mon Nov 20 20:55:41 2017 (r326030) @@ -150,6 +150,7 @@ SUBDIR= alias \ split \ stat \ stdbuf \ + strings \ su \ systat \ tabs \ @@ -277,7 +278,6 @@ SUBDIR.${MK_TOOLCHAIN}+= readelf SUBDIR.${MK_TOOLCHAIN}+= rpcgen SUBDIR.${MK_TOOLCHAIN}+= unifdef SUBDIR.${MK_TOOLCHAIN}+= size -SUBDIR.${MK_TOOLCHAIN}+= strings SUBDIR.${MK_TOOLCHAIN}+= xstr SUBDIR.${MK_TOOLCHAIN}+= yacc SUBDIR.${MK_VI}+= vi From owner-svn-src-head@freebsd.org Mon Nov 20 21:38:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A72F1DF61B7; Mon, 20 Nov 2017 21:38:25 +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 73E8D6E36F; Mon, 20 Nov 2017 21:38:25 +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 vAKLcOGV080934; Mon, 20 Nov 2017 21:38:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKLcOxL080933; Mon, 20 Nov 2017 21:38:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201711202138.vAKLcOxL080933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 20 Nov 2017 21:38:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326031 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 326031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 21:38:25 -0000 Author: cem Date: Mon Nov 20 21:38:24 2017 New Revision: 326031 URL: https://svnweb.freebsd.org/changeset/base/326031 Log: msdosfs(5): Reflect READONLY attribute in file mode Msdosfs allows setting READONLY by clearing the owner write bit of the file mode. (While here, correct the misspelling of S_IWUSR as VWRITE. No functional change.) In msdosfs_getattr, intuitively reflect that READONLY attribute to userspace in the file mode. Reported by: Karl Denninger Sponsored by: Dell EMC Isilon Modified: head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Mon Nov 20 20:55:41 2017 (r326030) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Mon Nov 20 21:38:24 2017 (r326031) @@ -287,6 +287,8 @@ msdosfs_getattr(struct vop_getattr_args *ap) vap->va_fileid = fileid; mode = S_IRWXU|S_IRWXG|S_IRWXO; + if (dep->de_Attributes & ATTR_READONLY) + mode &= ~(S_IWUSR|S_IWGRP|S_IWOTH); vap->va_mode = mode & (ap->a_vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); vap->va_uid = pmp->pm_uid; @@ -502,7 +504,7 @@ msdosfs_setattr(struct vop_setattr_args *ap) } if (vp->v_type != VDIR) { /* We ignore the read and execute bits. */ - if (vap->va_mode & VWRITE) + if (vap->va_mode & S_IWUSR) dep->de_Attributes &= ~ATTR_READONLY; else dep->de_Attributes |= ATTR_READONLY; From owner-svn-src-head@freebsd.org Mon Nov 20 21:56: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 5AE77DF693C; Mon, 20 Nov 2017 21:56:27 +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 273BF6F09C; Mon, 20 Nov 2017 21:56:27 +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 vAKLuQj6089052; Mon, 20 Nov 2017 21:56:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKLuQBt089051; Mon, 20 Nov 2017 21:56:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711202156.vAKLuQBt089051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 Nov 2017 21:56:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326032 - head/sbin/camcontrol X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sbin/camcontrol X-SVN-Commit-Revision: 326032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 21:56:27 -0000 Author: asomers Date: Mon Nov 20 21:56:25 2017 New Revision: 326032 URL: https://svnweb.freebsd.org/changeset/base/326032 Log: Print ZAC device type in "camcontrol identify" output ZAC (Zoned-device ATA Command set) is the standard for addressing SMR (shingled magnetic recording) devices over SATA. Drives indicate their support for ZAC in their IDENTIFY block. Print whether and how a drive supports ZAC in the output of "camcontrol identify". Reviewed by: ken, imp MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13171 Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Mon Nov 20 21:38:24 2017 (r326031) +++ head/sbin/camcontrol/camcontrol.c Mon Nov 20 21:56:25 2017 (r326032) @@ -1403,6 +1403,18 @@ atacapprint(struct ata_params *parm) parm->media_rotation_rate); } + printf("Zoned-Device Commands "); + switch (parm->support3 & ATA_SUPPORT_ZONE_MASK) { + case ATA_SUPPORT_ZONE_DEV_MANAGED: + printf("device managed\n"); + break; + case ATA_SUPPORT_ZONE_HOST_AWARE: + printf("host aware\n"); + break; + default: + printf("no\n"); + } + printf("\nFeature " "Support Enabled Value Vendor\n"); printf("read ahead %s %s\n", From owner-svn-src-head@freebsd.org Mon Nov 20 21:57: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 5846ADF69AA; Mon, 20 Nov 2017 21:57:05 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 258076F1F5; Mon, 20 Nov 2017 21:57:05 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKLv43m089118; Mon, 20 Nov 2017 21:57:04 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKLv4EJ089117; Mon, 20 Nov 2017 21:57:04 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201711202157.vAKLv4EJ089117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 20 Nov 2017 21:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326033 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 326033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 21:57:05 -0000 Author: shurd Date: Mon Nov 20 21:57:04 2017 New Revision: 326033 URL: https://svnweb.freebsd.org/changeset/base/326033 Log: Fix off-by-one error in bit_nclear() usage bit_nclear() takes the bit numbers for the start and end bits, not the start and a count. This was resulting in memory corruption past the end of the bitstr_t. Sponsored by: Limelight Networks Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Nov 20 21:56:25 2017 (r326032) +++ head/sys/net/iflib.c Mon Nov 20 21:57:04 2017 (r326033) @@ -2025,7 +2025,7 @@ iflib_fl_setup(iflib_fl_t fl) if_ctx_t ctx = rxq->ifr_ctx; if_softc_ctx_t sctx = &ctx->ifc_softc_ctx; - bit_nclear(fl->ifl_rx_bitmap, 0, fl->ifl_size); + bit_nclear(fl->ifl_rx_bitmap, 0, fl->ifl_size - 1); /* ** Free current RX buffer structs and their mbufs */ From owner-svn-src-head@freebsd.org Mon Nov 20 21:57: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 83925DF69FD; Mon, 20 Nov 2017 21:57:24 +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 622F46F33A; Mon, 20 Nov 2017 21:57:24 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id D8D585A9F27; Mon, 20 Nov 2017 21:57:16 +0000 (UTC) Date: Mon, 20 Nov 2017 21:57:16 +0000 From: Brooks Davis To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325965 - head/libexec/rtld-elf Message-ID: <20171120215716.GA2442@spindle.one-eyed-alien.net> References: <201711181321.vAIDLM6S028725@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <201711181321.vAIDLM6S028725@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Nov 2017 21:57:24 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 18, 2017 at 01:21:22PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Sat Nov 18 13:21:22 2017 > New Revision: 325965 > URL: https://svnweb.freebsd.org/changeset/base/325965 >=20 > Log: > Increase rtld initial memory pool size from 32kB to 128kB. > =20 > The old value was probably fine back in 1998, when that code was import= ed > (although the comments still mention VAX, which was quite obsolete by t= hen); > now, however, it's too small to handle our libc, which results in some > additional calls to munmap/mmap later on. Asking for more virtual addr= ess > space is virtually free, and syscalls are not, thus the change. Not specificaly about this commit, but a general comment: The power-of-2 sized buckets used by this allocator are likely suboptimal both in terms of space use (largely irrelevent in practice) and cache effects (in particular, unnecessicary false sharing of TLS segments). There is probably a fair bit of room for optimization here. -- Brooks --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJaE0+8AAoJEKzQXbSebgfAAhcH/24sopp2YZqH4t8QUOuQrOzE t+7y4BPiFNEACGiPJzdi+CYU3zKkNeZ1oINa8hQk4qJHKh84TgStxt2jbA4i7o15 Qb1VE9InSGiGg6Za96/dzbgH3oQm6leuFAICDQ2GRjucm+F3KwfxwxmQZvmee36S yjfrQTDTaLh99K+e0GBGqaHIzFnDH1XOs8Pzk1L5Mhx9Zr+6FV1jhFwvZTKP3P6M KMtGjz3quNuLky1QGyZzAxDEb45x9Uwm1IAx0iegFptJ5Ewts+hU0NMfymRN7oTe cIYiGfKsUlojchQawml1Uu6a6tlCyvj5VDRBYHQOgzIBbaDnrsntRRmkbDo1aTk= =SUiO -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- From owner-svn-src-head@freebsd.org Mon Nov 20 22: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 217AEDF6C1D; Mon, 20 Nov 2017 22:01:47 +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 D7ADB6F70B; Mon, 20 Nov 2017 22:01:46 +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 vAKM1jl8089353; Mon, 20 Nov 2017 22:01:45 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKM1jf2089349; Mon, 20 Nov 2017 22:01:45 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711202201.vAKM1jf2089349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 Nov 2017 22:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326034 - in head: lib/libcam/tests sys/cam X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: lib/libcam/tests sys/cam X-SVN-Commit-Revision: 326034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 22:01:47 -0000 Author: asomers Date: Mon Nov 20 22:01:45 2017 New Revision: 326034 URL: https://svnweb.freebsd.org/changeset/base/326034 Log: Fix multiple bugs in cam_strmatch * Wrongly matches strings that are shorter than the pattern * Fails to match negative character sets * Fails to match character sets that aren't at the end of the pattern * Fails to match character ranges Reviewed by: imp MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13173 Added: head/lib/libcam/tests/cam_test.c (contents, props changed) Modified: head/lib/libcam/tests/Makefile head/lib/libcam/tests/libcam_test.c head/sys/cam/cam.c Modified: head/lib/libcam/tests/Makefile ============================================================================== --- head/lib/libcam/tests/Makefile Mon Nov 20 21:57:04 2017 (r326033) +++ head/lib/libcam/tests/Makefile Mon Nov 20 22:01:45 2017 (r326034) @@ -1,6 +1,7 @@ # $FreeBSD$ ATF_TESTS_C+= libcam_test +ATF_TESTS_C+= cam_test LIBADD+= cam Added: head/lib/libcam/tests/cam_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcam/tests/cam_test.c Mon Nov 20 22:01:45 2017 (r326034) @@ -0,0 +1,111 @@ +/*- + * Copyright (c) 2017 Spectra Logic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* Tests functions in sys/cam/cam.c */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#define ATF_CHECK_NE(x, y) ATF_CHECK((x) != (y)) + +ATF_TC_WITHOUT_HEAD(cam_strmatch); +ATF_TC_BODY(cam_strmatch, tc) +{ + /* Basic fixed patterns */ + ATF_CHECK_EQ(0, cam_strmatch("foo", "foo", 3)); + ATF_CHECK_NE(0, cam_strmatch("foo", "bar", 3)); + ATF_CHECK_NE(0, cam_strmatch("foo", "foobar", 3)); + + /* The str is not necessarily null-terminated */ + ATF_CHECK_EQ(0, cam_strmatch("fooxuehfxeuf", "foo", 3)); + ATF_CHECK_NE(0, cam_strmatch("foo\0bar", "foo", 7)); + + /* Eat trailing spaces, which get added by SAT */ + ATF_CHECK_EQ(0, cam_strmatch("foo ", "foo", 16)); + + /* '*' matches everything, like shell globbing */ + ATF_CHECK_EQ(0, cam_strmatch("foobar", "foo*", 6)); + ATF_CHECK_EQ(0, cam_strmatch("foobar", "*bar", 6)); + ATF_CHECK_NE(0, cam_strmatch("foobar", "foo*x", 6)); + ATF_CHECK_EQ(0, cam_strmatch("foobarbaz", "*bar*", 9)); + /* Even NUL */ + ATF_CHECK_EQ(0, cam_strmatch("foo\0bar", "foo*", 7)); + /* Or nothing */ + ATF_CHECK_EQ(0, cam_strmatch("foo", "foo*", 3)); + /* But stuff after the * still must match */ + ATF_CHECK_NE(0, cam_strmatch("foo", "foo*x", 3)); + + /* '?' matches exactly one single character */ + ATF_CHECK_EQ(0, cam_strmatch("foobar", "foo?ar", 6)); + ATF_CHECK_NE(0, cam_strmatch("foo", "foo?", 3)); + /* Even NUL */ + ATF_CHECK_EQ(0, cam_strmatch("foo\0bar", "foo?bar", 7)); + + /* '[]' contains a set of characters */ + ATF_CHECK_EQ(0, cam_strmatch("foobar", "foo[abc]ar", 6)); + ATF_CHECK_EQ(0, cam_strmatch("foobar", "foo[b]ar", 6)); + ATF_CHECK_NE(0, cam_strmatch("foobar", "foo[ac]ar", 6)); + + /* '[]' can contain a range of characters, too */ + ATF_CHECK_EQ(0, cam_strmatch("foobar", "foo[a-c]ar", 6)); + ATF_CHECK_EQ(0, cam_strmatch("fooxar", "foo[a-cx]ar", 6)); + ATF_CHECK_NE(0, cam_strmatch("foodar", "foo[a-c]ar", 6)); + + /* Back-to-back '[]' character sets */ + ATF_CHECK_EQ(0, cam_strmatch("foobar", "fo[a-z][abc]ar", 6)); + ATF_CHECK_NE(0, cam_strmatch("foAbar", "fo[a-z][abc]ar", 6)); + ATF_CHECK_NE(0, cam_strmatch("foodar", "fo[a-z][abc]ar", 6)); + + /* A '^' negates a set of characters */ + ATF_CHECK_NE(0, cam_strmatch("foobar", "foo[^abc]ar", 6)); + ATF_CHECK_NE(0, cam_strmatch("foobar", "foo[^b]ar", 6)); + ATF_CHECK_EQ(0, cam_strmatch("foobar", "foo[^ac]ar", 6)); + ATF_CHECK_NE(0, cam_strmatch("foobar", "foo[^a-c]ar", 6)); + ATF_CHECK_NE(0, cam_strmatch("fooxar", "foo[^a-cx]ar", 6)); + ATF_CHECK_EQ(0, cam_strmatch("foodar", "foo[^a-c]ar", 6)); + + /* Outside of '[]' a ']' is just an ordinary character */ + ATF_CHECK_EQ(0, cam_strmatch("f]o", "f]o", 3)); + ATF_CHECK_NE(0, cam_strmatch("foo", "f]o", 3)); + + /* Matching a literal '[' requires specifying a range */ + ATF_CHECK_EQ(0, cam_strmatch("f[o", "f[[]o", 3)); + ATF_CHECK_NE(0, cam_strmatch("foo", "f[[]o", 3)); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, cam_strmatch); + + return (atf_no_error()); +} Modified: head/lib/libcam/tests/libcam_test.c ============================================================================== --- head/lib/libcam/tests/libcam_test.c Mon Nov 20 21:57:04 2017 (r326033) +++ head/lib/libcam/tests/libcam_test.c Mon Nov 20 22:01:45 2017 (r326034) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +/* Tests functions in lib/libcam/camlib.c */ + #include __FBSDID("$FreeBSD$"); Modified: head/sys/cam/cam.c ============================================================================== --- head/sys/cam/cam.c Mon Nov 20 21:57:04 2017 (r326033) +++ head/sys/cam/cam.c Mon Nov 20 22:01:45 2017 (r326034) @@ -240,24 +240,29 @@ cam_strmatch(const u_int8_t *str, const u_int8_t *patt ok = 0; sc = *str++; str_len--; + pattern++; if ((negate_range = (*pattern == '^')) != 0) pattern++; - while (((pc = *pattern) != ']') && *pattern != '\0') { - pattern++; + while ((*pattern != ']') && *pattern != '\0') { if (*pattern == '-') { if (pattern[1] == '\0') /* Bad pattern */ return (1); if (sc >= pc && sc <= pattern[1]) ok = 1; - pattern += 2; - } else if (pc == sc) + pattern++; + } else if (*pattern == sc) ok = 1; + pc = *pattern; + pattern++; } if (ok == negate_range) return (1); + pattern++; } else if (*pattern == '?') { - /* NB: || *str == ' ' of the old code is a bug and was removed */ - /* if you add it back, keep this the last if before the naked else */ + /* + * NB: || *str == ' ' of the old code is a bug and was + * removed. If you add it back, keep this the last if + * before the naked else */ pattern++; str++; str_len--; @@ -269,6 +274,17 @@ cam_strmatch(const u_int8_t *str, const u_int8_t *patt str_len--; } } + + /* '*' is allowed to match nothing, so gobble it */ + while (*pattern == '*') + pattern++; + + if ( *pattern != '\0') { + /* Pattern not fully consumed. Not a match */ + return (1); + } + + /* Eat trailing spaces, which get added by SAT */ while (str_len > 0 && *str == ' ') { str++; str_len--; From owner-svn-src-head@freebsd.org Mon Nov 20 22:18:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50743DF70DA; Mon, 20 Nov 2017 22:18:25 +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 1D89F6FE9C; Mon, 20 Nov 2017 22:18:25 +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 vAKMIOYC097472; Mon, 20 Nov 2017 22:18:24 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKMIOb9097471; Mon, 20 Nov 2017 22:18:24 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201711202218.vAKMIOb9097471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 20 Nov 2017 22:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326035 - head/sys/mips/beri X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/sys/mips/beri X-SVN-Commit-Revision: 326035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 22:18:25 -0000 Author: brooks Date: Mon Nov 20 22:18:24 2017 New Revision: 326035 URL: https://svnweb.freebsd.org/changeset/base/326035 Log: Remove a couple variables that are unused after r325790. Reported by: rpokala Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Mon Nov 20 22:01:45 2017 (r326034) +++ head/sys/mips/beri/beri_machdep.c Mon Nov 20 22:18:24 2017 (r326035) @@ -174,9 +174,7 @@ platform_start(__register_t a0, __register_t a1, __re char **envp = (char **)a2; long memsize; #ifdef FDT - char buf[2048]; /* early stack supposedly big enough */ vm_offset_t dtbp; - phandle_t chosen; void *kmdp; #endif int i; From owner-svn-src-head@freebsd.org Mon Nov 20 22:27: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 3268EDF7370; Mon, 20 Nov 2017 22:27:35 +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 F05B570446; Mon, 20 Nov 2017 22:27:34 +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 vAKMRY1Y001933; Mon, 20 Nov 2017 22:27:34 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKMRYvW001932; Mon, 20 Nov 2017 22:27:34 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711202227.vAKMRYvW001932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 Nov 2017 22:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326036 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 326036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 22:27:35 -0000 Author: asomers Date: Mon Nov 20 22:27:33 2017 New Revision: 326036 URL: https://svnweb.freebsd.org/changeset/base/326036 Log: da(4): Short-circuit unnecessary BIO_FLUSH commands sys/cam/scsi/scsi_da.c Complete BIO_FLUSH commands immediately if the da(4) device hasn't been written to since the last flush. If we haven't written to the device, there is no reason to send a flush. Submitted by: gibbs Reviewed by: imp MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13106 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:18:24 2017 (r326035) +++ head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:27:33 2017 (r326036) @@ -3038,6 +3038,18 @@ more: } case BIO_FLUSH: /* + * If we don't support sync cache, or the disk + * isn't dirty, FLUSH is a no-op. Use the + * allocated * CCB for the next bio if one is + * available. + */ + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) != 0 || + (softc->flags & DA_FLAG_DIRTY) == 0) { + biodone(bp); + goto skipstate; + } + + /* * BIO_FLUSH doesn't currently communicate * range data, so we synchronize the cache * over the whole disk. We also force @@ -3052,6 +3064,15 @@ more: /*lb_count*/0, SSD_FULL_SIZE, da_default_timeout*1000); + /* + * Clear the dirty flag before sending the command. + * Either this sync cache will be successful, or it + * will fail after a retry. If it fails, it is + * unlikely to be successful if retried later, so + * we'll save ourselves time by just marking the + * device clean. + */ + softc->flags &= ~DA_FLAG_DIRTY; break; case BIO_ZONE: { int error, queue_ccb; From owner-svn-src-head@freebsd.org Mon Nov 20 22:30: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 CA866DF743B; Mon, 20 Nov 2017 22:30:08 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::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 4E36B70612; Mon, 20 Nov 2017 22:30:08 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x232.google.com with SMTP id i14so11895497lfc.1; Mon, 20 Nov 2017 14:30:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HeT7p5XXdOVxxxfpKmYI80cUQflUFOJTur5AhArZTMY=; b=OQ+wG8lQwEr0KbKAzFavcrABpKtwxEZu8mW+utjRGMwWbMNVdIvSW6lCVVpMInTzkl jD91iE7w7YF4pIW+59mG12sPV+hI+lNBrMoOcJ4vbLcEuKLSBxgW+QIvfDxXzdfI890b Mro8ATyLxM48cUPML8jpkHKRYKIggeyVwIKKGbBxGiPI6nSh8H/Djf5mDXvxzCUq3O5C rye58ABEfxdmpaQkOtLsJ3mckJB1Y99J6mjiH8vOxJbZnSfGSj31eVRUxy3N5dAeWbI9 m02bdUt6axIUQvDoPOZykltOUjyPxdNmwDUlv4XeKrCiOTOVZE57H2odyLZPZ6pWQ8S3 S3UA== 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=HeT7p5XXdOVxxxfpKmYI80cUQflUFOJTur5AhArZTMY=; b=uOks5x2+qZi7lBagv7b027rBQyLjqkqG54I2aXS6Jqc1FVHOD7aJF6qcLZiYVZSlRl JFLzLi7zA1QSJGrlA9ulc/RSsW8vpd199cAsbmRclJuGY+3JpbpjvfJKbXbM4rqjp442 vKQnqx2E8vlb1afOb4U/Hzjb6MNItDoI6EN1tXYRr/WT7qypv5w8fyhNuoR4xvitFQ89 rB5uGywL59JquJUhW+xp0yt6uZS9zkI1jNKI1Ge68aCAr6YE5TcEK+BlN6lnHG8t6VSo duQO3uU+AClK/giUxmlkGbjUZtG2pECc53KVYEjbvEln3JebRF+dGWXGaSZxMIOQgDpH Mk9g== X-Gm-Message-State: AJaThX4+P58ebLf5HhNVYLam0xdziIxEcNcNPZOOl/dBvS/1Je+OFrOk YRkS0wIUn0wIVZbU5IgycmF9cFdsLWYlp2gM1SE= X-Google-Smtp-Source: AGs4zMZScp+5XvlZqJkQt5FPphqysEPiwjxYgQHq/Wsahx1PqmINqfaHlZcwgc3171QCexU/8oYmNrAcMmqwstp4FC0= X-Received: by 10.46.8.2 with SMTP id 2mr4218745lji.99.1511217006037; Mon, 20 Nov 2017 14:30:06 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.76.19 with HTTP; Mon, 20 Nov 2017 14:30:05 -0800 (PST) In-Reply-To: <201608190430.u7J4UTqU025924@repo.freebsd.org> References: <201608190430.u7J4UTqU025924@repo.freebsd.org> From: Alan Somers Date: Mon, 20 Nov 2017 15:30:05 -0700 X-Google-Sender-Auth: 3YaCtO5AL4uurGIzgV6ATtpiAOk Message-ID: Subject: Re: svn commit: r304443 - head/sys/cam To: Warner Losh Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 22:30:08 -0000 Can we MFC this now? Perhaps in tandem with 326034 ? On Thu, Aug 18, 2016 at 10:30 PM, Warner Losh wrote: > Author: imp > Date: Fri Aug 19 04:30:29 2016 > New Revision: 304443 > URL: https://svnweb.freebsd.org/changeset/base/304443 > > Log: > Improve the pattern matching so that internal *'s work, as well as > [set] notation. This fixes pattern matching for recently added drives > that would set the NCQ Trim being broken incorrectly. > > PR: 210686 > Tested-by: Tomoaki AOKI > MFC After: 3 days > > Modified: > head/sys/cam/cam.c From owner-svn-src-head@freebsd.org Mon Nov 20 22:41: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 82E38DF77B9; Mon, 20 Nov 2017 22:41:23 +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 503D170CA0; Mon, 20 Nov 2017 22:41: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 vAKMfMeG008435; Mon, 20 Nov 2017 22:41:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKMfMpO008434; Mon, 20 Nov 2017 22:41:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711202241.vAKMfMpO008434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 20 Nov 2017 22:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326037 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 326037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 22:41:23 -0000 Author: imp Date: Mon Nov 20 22:41:22 2017 New Revision: 326037 URL: https://svnweb.freebsd.org/changeset/base/326037 Log: Add -mno-avx2 for clang as well as -mno-avx. We don't want either of them when asking for no SIMD. Reviewed by: emaste@ Sponsored by: Netflix Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Nov 20 22:27:33 2017 (r326036) +++ head/share/mk/bsd.cpu.mk Mon Nov 20 22:41:22 2017 (r326037) @@ -393,7 +393,7 @@ CFLAGS += ${_CPUCFLAGS} # (-mfpmath= is not supported) # .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS_NO_SIMD.clang= -mno-avx +CFLAGS_NO_SIMD.clang= -mno-avx -mno-avx2 CFLAGS_NO_SIMD= -mno-mmx -mno-sse .endif CFLAGS_NO_SIMD += ${CFLAGS_NO_SIMD.${COMPILER_TYPE}} From owner-svn-src-head@freebsd.org Mon Nov 20 22:42: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 3CDBBDF7822; Mon, 20 Nov 2017 22:42:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0484F70E94; Mon, 20 Nov 2017 22:42:20 +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 vAKMgKSE010089; Mon, 20 Nov 2017 22:42:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKMgIu6010067; Mon, 20 Nov 2017 22:42:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711202242.vAKMgIu6010067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 20 Nov 2017 22:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326038 - in head/stand: . arm/uboot efi efi/fdt fdt i386 mips/beri mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/boot1.chrp powerpc/kboot powerpc/ofw powerpc/ps3 power... X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . arm/uboot efi efi/fdt fdt i386 mips/beri mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/boot1.chrp powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64 uboot/fd... X-SVN-Commit-Revision: 326038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 22:42:21 -0000 Author: imp Date: Mon Nov 20 22:42:17 2017 New Revision: 326038 URL: https://svnweb.freebsd.org/changeset/base/326038 Log: Move some more common stuff up to Makefile.inc. In particular, the no simd / no float stuff is centeralized here. Also centralise -ffreestanding since it is specified everywhere. This, along with a change to share/mk/bsd.cpu.mk to include -mno-avx2 in CFLAGS_NO_SIMD should fix building for newer machines (eg with CPUTYPE=haswell) where clang was generating avx2 instructions. Sponsored by: Netflix Modified: head/stand/Makefile.inc head/stand/arm/uboot/Makefile head/stand/efi/Makefile.inc head/stand/efi/fdt/Makefile head/stand/fdt/Makefile head/stand/i386/Makefile.inc head/stand/mips/beri/Makefile.inc head/stand/mips/beri/boot2/Makefile head/stand/mips/beri/loader/Makefile head/stand/mips/uboot/Makefile head/stand/ofw/libofw/Makefile head/stand/powerpc/boot1.chrp/Makefile head/stand/powerpc/kboot/Makefile head/stand/powerpc/ofw/Makefile head/stand/powerpc/ps3/Makefile head/stand/powerpc/uboot/Makefile head/stand/sparc64/Makefile.inc head/stand/uboot/fdt/Makefile head/stand/uboot/lib/Makefile head/stand/usb/Makefile head/stand/usb/Makefile.test head/stand/userboot/userboot/Makefile Modified: head/stand/Makefile.inc ============================================================================== --- head/stand/Makefile.inc Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/Makefile.inc Mon Nov 20 22:42:17 2017 (r326038) @@ -9,6 +9,20 @@ CFLAGS+=-I${SASRC} SSP_CFLAGS= +# Add in the no float / no SIMD stuff and announce we're freestanding +CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS+= -mgeneral-regs-only +.else +CFLAGS+= -msoft-float +.endif + +.if ${MACHINE_CPUARCH} == "i386" || (${MACHINE_CPUARCH} == "amd64" && ${DO32:U0} == 1) +CFLAGS+= -march=i386 +CFLAGS.gcc+= -mpreferred-stack-boundary=2 +.endif + + .if ${MACHINE_CPUARCH} == "arm" # 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). Modified: head/stand/arm/uboot/Makefile ============================================================================== --- head/stand/arm/uboot/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/arm/uboot/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -33,8 +33,6 @@ HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -ffreestanding -msoft-float - LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS+= -Wl,-znotext Modified: head/stand/efi/Makefile.inc ============================================================================== --- head/stand/efi/Makefile.inc Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/efi/Makefile.inc Mon Nov 20 22:42:17 2017 (r326038) @@ -1,23 +1,13 @@ # $FreeBSD$ -.if ${MACHINE_CPUARCH} == "i386" -CFLAGS+= -march=i386 -CFLAGS+= -mno-aes -.endif - # Options used when building app-specific efi components # See conf/kern.mk for the correct set of these -CFLAGS+= -ffreestanding -Wformat ${CFLAGS_NO_SIMD} +CFLAGS+= -Wformat LDFLAGS+= -nostdlib -.if ${MACHINE_CPUARCH} != "aarch64" -CFLAGS+= -msoft-float -.endif - .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -fshort-wchar CFLAGS+= -mno-red-zone -CFLAGS+= -mno-aes .endif .if ${MACHINE_CPUARCH} == "aarch64" Modified: head/stand/efi/fdt/Makefile ============================================================================== --- head/stand/efi/fdt/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/efi/fdt/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -10,13 +10,6 @@ WARNS?= 6 SRCS= efi_fdt.c -CFLAGS+= -ffreestanding -.if ${MACHINE_CPUARCH} == "aarch64" -CFLAGS+= -mgeneral-regs-only -.else -CFLAGS+= -msoft-float -.endif - # EFI library headers CFLAGS+= -I${EFISRC}/include CFLAGS+= -I${EFISRC}/include/${MACHINE} Modified: head/stand/fdt/Makefile ============================================================================== --- head/stand/fdt/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/fdt/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -16,12 +16,6 @@ SRCS+= fdt_loader_cmd.c fdt_overlay.c CFLAGS+= -I${SYSDIR}/contrib/libfdt/ -I${LDRSRC} -CFLAGS+= -ffreestanding - -.if ${MACHINE_CPUARCH} == "powerpc" || ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" -CFLAGS+= -msoft-float -.endif - CFLAGS+= -Wformat -Wall .include Modified: head/stand/i386/Makefile.inc ============================================================================== --- head/stand/i386/Makefile.inc Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/i386/Makefile.inc Mon Nov 20 22:42:17 2017 (r326038) @@ -3,9 +3,6 @@ # $FreeBSD$ LOADER_ADDRESS?=0x200000 -CFLAGS+= -march=i386 -ffreestanding -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float LDFLAGS+= -nostdlib # BTX components Modified: head/stand/mips/beri/Makefile.inc ============================================================================== --- head/stand/mips/beri/Makefile.inc Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/mips/beri/Makefile.inc Mon Nov 20 22:42:17 2017 (r326038) @@ -1,6 +1,5 @@ # $FreeBSD$ -CFLAGS+= -ffreestanding LDFLAGS+= -nostdlib .include "../Makefile.inc" Modified: head/stand/mips/beri/boot2/Makefile ============================================================================== --- head/stand/mips/beri/boot2/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/mips/beri/boot2/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -47,15 +47,13 @@ MAN= AFLAGS= -G0 -CFLAGS= -ffreestanding \ - -I${.CURDIR} \ +CFLAGS+= -I${.CURDIR} \ -I${SASRC} \ -I${LDRSRC} \ -D_KERNEL \ -Wall \ -G0 \ -fno-pic -mno-abicalls \ - -msoft-float \ -g LDFLAGS= -nostdlib \ Modified: head/stand/mips/beri/loader/Makefile ============================================================================== --- head/stand/mips/beri/loader/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/mips/beri/loader/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -83,7 +83,6 @@ CFLAGS+= -I${.CURDIR} CFLAGS+= -G0 \ -fno-pic \ -mno-abicalls \ - -msoft-float \ -g LDFLAGS= -nostdlib \ Modified: head/stand/mips/uboot/Makefile ============================================================================== --- head/stand/mips/uboot/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/mips/uboot/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -29,7 +29,7 @@ HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" -CFLAGS+= -ffreestanding -msoft-float -g +CFLAGS+= -g LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_CPUARCH} Modified: head/stand/ofw/libofw/Makefile ============================================================================== --- head/stand/ofw/libofw/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/ofw/libofw/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -14,9 +14,7 @@ SRCS+= devicename_stubs.c # Pick up the bootstrap header for some interface items CFLAGS+= -I${LDRSRC} -CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "powerpc" -CFLAGS+= -msoft-float SRCS+= ppc64_elf_freebsd.c .endif Modified: head/stand/powerpc/boot1.chrp/Makefile ============================================================================== --- head/stand/powerpc/boot1.chrp/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/powerpc/boot1.chrp/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -13,9 +13,7 @@ SRCS= boot1.c ashldi3.c syncicache.c MAN= -CFLAGS= -ffreestanding -msoft-float \ - -I${LDRSRC} -I${SYSDIR} -I${SASRC} \ - -D_STANDALONE +CFLAGS= -I${LDRSRC} -I${SYSDIR} -I${SASRC} -D_STANDALONE LDFLAGS=-nostdlib -static -Wl,-N .PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR} Modified: head/stand/powerpc/kboot/Makefile ============================================================================== --- head/stand/powerpc/kboot/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/powerpc/kboot/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -32,7 +32,7 @@ HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM +CFLAGS+= -Wall -DAIM # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} Modified: head/stand/powerpc/ofw/Makefile ============================================================================== --- head/stand/powerpc/ofw/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/powerpc/ofw/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -34,7 +34,6 @@ HELP_FILES+= ${FDTSRC}/help.fdt .PATH: ${SYSDIR}/libkern -CFLAGS+= -ffreestanding -msoft-float # load address. set in linker script RELOC?= 0x1C00000 CFLAGS+= -DRELOC=${RELOC} Modified: head/stand/powerpc/ps3/Makefile ============================================================================== --- head/stand/powerpc/ps3/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/powerpc/ps3/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -30,7 +30,7 @@ HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -Wall -ffreestanding -msoft-float -DAIM +CFLAGS+= -Wall -DAIM # load address. set in linker script RELOC?= 0x0 CFLAGS+= -DRELOC=${RELOC} Modified: head/stand/powerpc/uboot/Makefile ============================================================================== --- head/stand/powerpc/uboot/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/powerpc/uboot/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -25,8 +25,6 @@ HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern -CFLAGS+= -ffreestanding - LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.powerpc .include "${BOOTSRC}/uboot.mk" Modified: head/stand/sparc64/Makefile.inc ============================================================================== --- head/stand/sparc64/Makefile.inc Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/sparc64/Makefile.inc Mon Nov 20 22:42:17 2017 (r326038) @@ -1,6 +1,5 @@ # $FreeBSD$ -CFLAGS+= -ffreestanding LDFLAGS+= -nostdlib .include "../Makefile.inc" Modified: head/stand/uboot/fdt/Makefile ============================================================================== --- head/stand/uboot/fdt/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/uboot/fdt/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -10,8 +10,6 @@ WARNS?= 2 SRCS= uboot_fdt.c -CFLAGS+= -ffreestanding -msoft-float - # U-Boot library headers CFLAGS+= -I${UBOOTSRC}/lib Modified: head/stand/uboot/lib/Makefile ============================================================================== --- head/stand/uboot/lib/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/uboot/lib/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -11,8 +11,6 @@ WARNS?= 2 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 - .if ${LOADER_DISK_SUPPORT:Uyes} == "yes" SRCS+= disk.c .endif Modified: head/stand/usb/Makefile ============================================================================== --- head/stand/usb/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/usb/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -36,15 +36,10 @@ INTERNALLIB= CFLAGS+= -DBOOTPROG=\"usbloader\" CFLAGS+= -ffunction-sections -fdata-sections -CFLAGS+= -ffreestanding CFLAGS+= -Wformat -Wall CFLAGS+= -g CFLAGS+= -fno-pic -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 .endif Modified: head/stand/usb/Makefile.test ============================================================================== --- head/stand/usb/Makefile.test Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/usb/Makefile.test Mon Nov 20 22:42:17 2017 (r326038) @@ -38,10 +38,6 @@ SRCS= CFLAGS+= -Wall CFLAGS+= -g -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -march=i386 -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -.endif .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 .endif Modified: head/stand/userboot/userboot/Makefile ============================================================================== --- head/stand/userboot/userboot/Makefile Mon Nov 20 22:41:22 2017 (r326037) +++ head/stand/userboot/userboot/Makefile Mon Nov 20 22:42:17 2017 (r326038) @@ -36,7 +36,6 @@ SRCS+= vers.c CFLAGS+= -Wall CFLAGS+= -I${BOOTSRC}/userboot -CFLAGS+= -ffreestanding CWARNFLAGS.main.c += -Wno-implicit-function-declaration From owner-svn-src-head@freebsd.org Mon Nov 20 22:55: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 51303DF7A4E; Mon, 20 Nov 2017 22:55:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2079071342; Mon, 20 Nov 2017 22:55:04 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKMt3nd014205; Mon, 20 Nov 2017 22:55:03 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKMt2nP014201; Mon, 20 Nov 2017 22:55:02 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711202255.vAKMt2nP014201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 Nov 2017 22:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326039 - in head: etc/mtree usr.bin/head usr.bin/head/tests X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: etc/mtree usr.bin/head usr.bin/head/tests X-SVN-Commit-Revision: 326039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 22:55:04 -0000 Author: asomers Date: Mon Nov 20 22:55:02 2017 New Revision: 326039 URL: https://svnweb.freebsd.org/changeset/base/326039 Log: Add ATF tests for head(1) Submitted by: Fred Schlecter Reviewed by: asomers, jilles MFC after: 3 weeks Differential Revision: https://github.com/freebsd/freebsd/pull/127 Added: head/usr.bin/head/tests/ head/usr.bin/head/tests/Makefile (contents, props changed) head/usr.bin/head/tests/head_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/head/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Nov 20 22:42:17 2017 (r326038) +++ head/etc/mtree/BSD.tests.dist Mon Nov 20 22:55:02 2017 (r326039) @@ -660,6 +660,8 @@ .. gzip .. + head + .. hexdump .. ident Modified: head/usr.bin/head/Makefile ============================================================================== --- head/usr.bin/head/Makefile Mon Nov 20 22:42:17 2017 (r326038) +++ head/usr.bin/head/Makefile Mon Nov 20 22:55:02 2017 (r326039) @@ -1,6 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + PROG= head + +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .include Added: head/usr.bin/head/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/head/tests/Makefile Mon Nov 20 22:55:02 2017 (r326039) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PACKAGE= tests + +ATF_TESTS_SH= head_test + +.include Added: head/usr.bin/head/tests/head_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/head/tests/head_test.sh Mon Nov 20 22:55:02 2017 (r326039) @@ -0,0 +1,132 @@ +# Copyright (c) 2017 Fred Schlechter +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +atf_test_case empty_file +empty_file_head() { + atf_set "descr" "Test head(1)'s handling of an empty file" +} +empty_file_body() { + touch infile expectfile + head infile > outfile + head < infile > outpipe + atf_check cmp expectfile outfile + atf_check cmp expectfile outpipe +} + +atf_test_case default_no_options +default_no_options_head() { + atf_set "descr" "Test head(1)'s default mode" +} +default_no_options_body() { + #head(1) is supposed to default to 10 lines of output. Verify that it does that. + jot -b test 10 > expectfile + jot -b test 100 > infile + head infile > outfile + atf_check -e empty cmp expectfile outfile +} + +atf_test_case line_count +line_count_head() { + atf_set "descr" "Test head(1)'s -n option" +} +line_count_body() { + jot -b test 100 > outfile + head -n 50 outfile > expectfile + atf_check -o inline:" 50 expectfile\n" wc -l expectfile +} + +atf_test_case byte_count +byte_count_head() { + atf_set "descr" "Test head(1)'s -c option" +} +byte_count_body() { + jot -b test 100 > outfile + head -c 50 outfile > expectfile + atf_check -o inline:" 50 expectfile\n" wc -c expectfile +} + +atf_test_case sparse_file_text_at_beginning +sparse_file_text_at_beginning_head() { + atf_set "descr" "Test head(1)'s handling of a sparse file with text at the beginning of the file" +} +sparse_file_text_at_beginning_body () { + jot -b test 10 > outfile + truncate -s +1K outfile + head -c 512 outfile > expectfile + atf_check -o inline:" 512 expectfile\n" wc -c expectfile +} + +atf_test_case sparse_file_text_at_end +sparse_file_text_at_end_head() { + atf_set "descr" "Test head(1)'s handling of a sparse file with text at the end of the file" +} +sparse_file_text_at_end_body () { + truncate -s +1K infile + echo test >> infile + head -c 4096 < infile > outpipe + atf_check cmp infile outpipe +} + +atf_test_case missing_line_count +missing_line_count_head() { + atf_set "descr" "Test head(1)'s handling of a missing line count arg" +} +missing_line_count_body () { + jot -b test 100 > outfile + atf_check -s not-exit:0 -e not-empty head -n outfile +} + +atf_test_case invalid_line_count +invalid_line_count_head() { + atf_set "descr" "Test head(1)'s handling of an invalid line count arg" +} +invalid_line_count_body () { + jot -b test 100 > outfile + atf_check -s not-exit:0 -e not-empty head -n -10 outfile +} + +atf_test_case read_from_stdin +read_from_stdin_head() { + atf_set "descr" "Test head(1)'s reading of stdin" +} +read_from_stdin_body() { + #head(1) defaults to head -n 10 if no args are given. + jot -b test 10 > outfile + jot -b test 20 | head > expectfile + atf_check cmp outfile expectfile +} + +atf_init_test_cases() { + atf_add_test_case empty_file + atf_add_test_case default_no_options + atf_add_test_case line_count + atf_add_test_case byte_count + atf_add_test_case sparse_file_text_at_beginning + atf_add_test_case sparse_file_text_at_end + atf_add_test_case missing_line_count + atf_add_test_case invalid_line_count + atf_add_test_case read_from_stdin +} From owner-svn-src-head@freebsd.org Mon Nov 20 23:45: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 A4C19D9475C; Mon, 20 Nov 2017 23:45:43 +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 710DB72D13; Mon, 20 Nov 2017 23:45:43 +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 vAKNjghf034932; Mon, 20 Nov 2017 23:45:42 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKNjgCa034930; Mon, 20 Nov 2017 23:45:42 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711202345.vAKNjgCa034930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 Nov 2017 23:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326040 - in head/sys/cam: ata scsi X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head/sys/cam: ata scsi X-SVN-Commit-Revision: 326040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 23:45:43 -0000 Author: asomers Date: Mon Nov 20 23:45:42 2017 New Revision: 326040 URL: https://svnweb.freebsd.org/changeset/base/326040 Log: Quirk Seagate ST8000AS0003-2HH Like its predecessor ST8000AS0002, this is a drive-managed SMR drive, but doesn't declare that in its ATA identify data. MFC after: 3 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Mon Nov 20 22:55:02 2017 (r326039) +++ head/sys/cam/ata/ata_da.c Mon Nov 20 23:45:42 2017 (r326040) @@ -753,7 +753,7 @@ static struct ada_quirk_entry ada_quirk_table[] = * Drive Managed SATA hard drive. This drive doesn't report * in firmware that it is a drive managed SMR drive. */ - { T_DIRECT, SIP_MEDIA_FIXED, "*", "ST8000AS0002*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "*", "ST8000AS000[23]*", "*" }, /*quirks*/ADA_Q_SMR_DM }, { Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:55:02 2017 (r326039) +++ head/sys/cam/scsi/scsi_da.c Mon Nov 20 23:45:42 2017 (r326040) @@ -1346,7 +1346,7 @@ static struct da_quirk_entry da_quirk_table[] = * Drive Managed SATA hard drive. This drive doesn't report * in firmware that it is a drive managed SMR drive. */ - { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST8000AS0002*", "*" }, + { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "ST8000AS000[23]*", "*" }, /*quirks*/DA_Q_SMR_DM }, { From owner-svn-src-head@freebsd.org Mon Nov 20 23:51: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 08E85D94AF0; Mon, 20 Nov 2017 23:51:53 +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 C5A7F73201; Mon, 20 Nov 2017 23:51:52 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAKNpps5038294; Mon, 20 Nov 2017 23:51:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAKNppEG038293; Mon, 20 Nov 2017 23:51:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711202351.vAKNppEG038293@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 Nov 2017 23:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326041 - head/usr.sbin/periodic X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/usr.sbin/periodic X-SVN-Commit-Revision: 326041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 20 Nov 2017 23:51:53 -0000 Author: asomers Date: Mon Nov 20 23:51:51 2017 New Revision: 326041 URL: https://svnweb.freebsd.org/changeset/base/326041 Log: periodic: fix exit status for nonexistent arguments When called with an absolute pathname, periodic should attempt to execute every script in that directory. If the directory does not exist, it should print an error and exit 1. Due to a copy/paste mistake in r231568, it exits 0 in that case. Reported by: devel/hs-ShellCheck MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13070 Modified: head/usr.sbin/periodic/periodic.sh Modified: head/usr.sbin/periodic/periodic.sh ============================================================================== --- head/usr.sbin/periodic/periodic.sh Mon Nov 20 23:45:42 2017 (r326040) +++ head/usr.sbin/periodic/periodic.sh Mon Nov 20 23:51:51 2017 (r326041) @@ -103,7 +103,7 @@ case $arg in dirlist="$arg" else echo "$0: $arg not found" >&2 - continue + exit 1 fi ;; *) dirlist= From owner-svn-src-head@freebsd.org Tue Nov 21 01:18: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 C340CDB9F9F; Tue, 21 Nov 2017 01:18:59 +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 90298757C5; Tue, 21 Nov 2017 01:18:59 +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 vAL1IwZR072580; Tue, 21 Nov 2017 01:18:58 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL1IwDZ072579; Tue, 21 Nov 2017 01:18:58 GMT (envelope-from np@FreeBSD.org) Message-Id: <201711210118.vAL1IwDZ072579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 21 Nov 2017 01:18:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326042 - head/sys/dev/cxgbe/cudbg X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/cudbg X-SVN-Commit-Revision: 326042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 01:18:59 -0000 Author: np Date: Tue Nov 21 01:18:58 2017 New Revision: 326042 URL: https://svnweb.freebsd.org/changeset/base/326042 Log: cxgbe(4): Fix unsafe mailbox access in cudbg. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/cudbg/cudbg_lib.c Modified: head/sys/dev/cxgbe/cudbg/cudbg_lib.c ============================================================================== --- head/sys/dev/cxgbe/cudbg/cudbg_lib.c Mon Nov 20 23:51:51 2017 (r326041) +++ head/sys/dev/cxgbe/cudbg/cudbg_lib.c Tue Nov 21 01:18:58 2017 (r326042) @@ -77,10 +77,17 @@ static void read_sge_ctxt(struct cudbg_init *pdbg_init struct adapter *padap = pdbg_init->adap; int rc = -1; - if (is_fw_attached(pdbg_init)) + if (is_fw_attached(pdbg_init)) { + rc = begin_synchronized_op(padap, NULL, SLEEP_OK | INTR_OK, + "t4cudf"); + if (rc != 0) + goto out; rc = t4_sge_ctxt_rd(padap, padap->mbox, cid, ctype, data); + end_synchronized_op(padap, 0); + } +out: if (rc) t4_sge_ctxt_rd_bd(padap, cid, ctype, data); } @@ -2720,7 +2727,12 @@ static void cudbg_t4_fwcache(struct cudbg_init *pdbg_i if (is_fw_attached(pdbg_init)) { /* Flush uP dcache before reading edcX/mcX */ - rc = t4_fwcache(padap, FW_PARAM_DEV_FWCACHE_FLUSH); + rc = begin_synchronized_op(padap, NULL, SLEEP_OK | INTR_OK, + "t4cudl"); + if (rc == 0) { + rc = t4_fwcache(padap, FW_PARAM_DEV_FWCACHE_FLUSH); + end_synchronized_op(padap, 0); + } if (rc) { if (pdbg_init->verbose) @@ -3331,6 +3343,9 @@ static int collect_tid(struct cudbg_init *pdbg_init, para[5] = FW_PARAM_PFVF_A(SERVER_START); para[6] = FW_PARAM_PFVF_A(SERVER_END); + rc = begin_synchronized_op(padap, NULL, SLEEP_OK | INTR_OK, "t4cudq"); + if (rc) + goto err; mbox = padap->mbox; pf = padap->pf; rc = t4_query_params(padap, mbox, pf, 0, 7, para, val); @@ -3417,6 +3432,7 @@ static int collect_tid(struct cudbg_init *pdbg_init, rc = compress_buff(&scratch_buff, dbg_buff); err1: + end_synchronized_op(padap, 0); release_scratch_buff(&scratch_buff, dbg_buff); err: return rc; @@ -3602,8 +3618,13 @@ static int collect_mps_tcam(struct cudbg_init *pdbg_in htons(V_FW_LDST_CMD_FID(FW_LDST_MPS_RPLC) | V_FW_LDST_CMD_IDX(i)); - rc = t4_wr_mbox(padap, padap->mbox, &ldst_cmd, - sizeof(ldst_cmd), &ldst_cmd); + rc = begin_synchronized_op(padap, NULL, + SLEEP_OK | INTR_OK, "t4cudm"); + if (rc == 0) { + rc = t4_wr_mbox(padap, padap->mbox, &ldst_cmd, + sizeof(ldst_cmd), &ldst_cmd); + end_synchronized_op(padap, 0); + } if (rc) mps_rpl_backdoor(padap, &mps_rplc); From owner-svn-src-head@freebsd.org Tue Nov 21 01:32: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 B6C4EDBAF5E; Tue, 21 Nov 2017 01:32:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::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 8D8CD76447; Tue, 21 Nov 2017 01:32:52 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id w127so17742722iow.11; Mon, 20 Nov 2017 17:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=cBVSh1XG3yd2j+GEKPYoXRuOqXI6inQacfVCRza/B60=; b=Hk+D3t98aB/RjpJ2CNCLLJyo0KePDpXam0NeH5UG3qlHRKj4KgPFT493Y4fjRyAItH SIKIipwHk9x5uqqAdpEVVCPYyp5NNUv/PmX2vGvPDoUuxhxJjiI+ZZrQSrumlVaOb/UI Y5LVS7lj1PECRTElw+k/PCtOShs9AaxJBZCGCoPK6/6XQBkT3FeXM2uEjbK5fk+k8Ynh 0RkMREmRl7G/5sG7ywsdXhk03l2MqcheudRmsBYvmCh1vyeEPiUawSpLGpvFOxqdF4Qk Ycv7OpVl44IxAhwd2nzFNKEbw1zGOaKT3W5TiLyLEItFrfHr1LUCHTiB3Vys79SCxCsD R4xg== 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=cBVSh1XG3yd2j+GEKPYoXRuOqXI6inQacfVCRza/B60=; b=OCa2Tcw4LC2jxcSZtUD1aovoLUpEyOhweN55spsZyUMtO3w5F0rnNBzGlDPDjToeid cSnaMawXhrz5AXMwu+LbL97EB6wU67i/4rP8hs1cUbegM/XPrpIBLd8l6TqUwfwmQ33J AyyHBLZIZH+xkLZrbp1jBk6TpwyUWCW0beCQJPfCJ2Jzt7OkYqAa/JGYUpqtBa/v2+GL CHsx12IFsalE1ii6IYEjrVMHmSfMkTwAPAkwbdBWftGl9wBfN9+PRuA0n0ZFRPl6WfMw onOw4vQnQIWnx5Kr/+xetI1ZR9arqRsZVPY5jm3JQVBlfEyJoT5deGijwW3VlZslZ/sZ yOsg== X-Gm-Message-State: AJaThX4lj7OYpuN+x36D1EqsBsd8ixPbAPGjhtIVqzEbcFu/T3mO77/p S2ppWBF4i08Yuy+eCCM+Tie/4v9ySL+pYrg2Z1p6vTSf X-Google-Smtp-Source: AGs4zMaoornndwwBGlSbjFyelihO08e0awTjaZuvWmjRWF+HTkQHUbLC+olebZ5zYaIwjNus3TGyXlkyiQg6NByo5OM= X-Received: by 10.107.20.129 with SMTP id 123mr16304760iou.36.1511227971443; Mon, 20 Nov 2017 17:32:51 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.14.208 with HTTP; Mon, 20 Nov 2017 17:32:31 -0800 (PST) In-Reply-To: <201711202255.vAKMt2nP014201@repo.freebsd.org> References: <201711202255.vAKMt2nP014201@repo.freebsd.org> From: Ed Maste Date: Mon, 20 Nov 2017 20:32:31 -0500 X-Google-Sender-Auth: 9hy1qGf7ob-uymuIuR950rhoD3o Message-ID: Subject: Re: svn commit: r326039 - in head: etc/mtree usr.bin/head usr.bin/head/tests To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 01:32:52 -0000 On 20 November 2017 at 17:55, Alan Somers wrote: > Author: asomers > Date: Mon Nov 20 22:55:02 2017 > New Revision: 326039 > URL: https://svnweb.freebsd.org/changeset/base/326039 > > Log: > Add ATF tests for head(1) > > Submitted by: Fred Schlecter > Reviewed by: asomers, jilles > MFC after: 3 weeks > Differential Revision: https://github.com/freebsd/freebsd/pull/127 It's certainly a good idea to capture the source of changes that come in via GitHub pull requests, but the 'Differential Revision' field is specifically for reviews in our own hosted Phabricator instance. We don't have an officially established metadata field for changes that come in via pull requests at the moment. I'd suggest we just go with: Pull request: https://github.com/freebsd/freebsd/pull/127 From owner-svn-src-head@freebsd.org Tue Nov 21 01:35: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 035B8DBB0D0; Tue, 21 Nov 2017 01:35:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BECE37660D; Tue, 21 Nov 2017 01:35:08 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x22e.google.com with SMTP id x13so89964iti.4; Mon, 20 Nov 2017 17:35:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=HrCLRBr0Z8YjphnmbQt8LRmSWAMUSYd2B4znlYlNZP4=; b=MJzA7ssAN93sE1l1ABp6R+nIYuashTsjGiKJZ85iiL5Q0nmaLkCzVpRMREU6+RW6eL hIhids3ZGdEg1Mb+cmO4F1SX6LmLpgnczDYo37tmSX5Vgexczp8K/KRfD3/y+uT1BuS0 VKam3V726MyiphNm1gZzB2RsoXOkSkXesDgJR632j/8Nikqqlmu6LBhabVR97PS9fI6F CiyiVTsaZucs3x80r95OoefiD7WmzCZzXtpdQpJpCA7sGdei0Sdwb3VG1QqCjHVnEGtV 1pNSsupMK5Fgi3Zdk8rIdahJaQKTy7hO0nPaIIvTyeC/uw9/b5u8DnDY3Elw0LfwjDZF MjRw== 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=HrCLRBr0Z8YjphnmbQt8LRmSWAMUSYd2B4znlYlNZP4=; b=NpvcYEtAz5DMqceU04U2kVt1UI0jLyLLdhcdtIMzN9KsxNOpOxva/wWtdMHU7FyeFF 1ntdhedO7S8274sF4atCewWyqzI2wUOy397Bgw3ZwsFW2yuVmF4BBXZCB844FQvG5CIV mApOZ/RP9RSwkv6cqubOqvNtHFkMv40x0GEQWRnnFzMQJBgjFPYNWTG0arBnkf8vqp7R doJ8zgTARnbSusgKMjfkdif58dmVDoT05tQkGBMB+7za3cgChAWQp7iDONer+rKhCLfM 45bUK32VzA1p1Ou+ERDrGmJhf4Q1dBfzwHjGiocU5KL45CMwO4tXkullaO525M03/cwF xLlA== X-Gm-Message-State: AJaThX73H11tXLDmsUhiAIxGzgZ3k7/X91aiT9crD6pKmCVTwmseEqye HO395lGBrj0QLqo+zn8l0snJDhSpyfkOfSNlpNXd89ul X-Google-Smtp-Source: AGs4zMZFP8ltGbWD7T2hXYAe/LbVIzC+V0j9CqnYAH//JHUWkqg9VgxCpMYzRO3zkaZGwEP75BCKqfQs2vdoo80H05g= X-Received: by 10.36.9.133 with SMTP id 127mr5262058itm.69.1511228108017; Mon, 20 Nov 2017 17:35:08 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.14.208 with HTTP; Mon, 20 Nov 2017 17:34:47 -0800 (PST) In-Reply-To: References: <201711202255.vAKMt2nP014201@repo.freebsd.org> From: Ed Maste Date: Mon, 20 Nov 2017 20:34:47 -0500 X-Google-Sender-Auth: fGWgIVqRZBpHWcoOFw8ipf6-kWM Message-ID: Subject: Re: svn commit: r326039 - in head: etc/mtree usr.bin/head usr.bin/head/tests To: Alan Somers Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 01:35:09 -0000 On 20 November 2017 at 20:32, Ed Maste wrote: > I'd suggest we just go with: > Pull request: https://github.com/freebsd/freebsd/pull/127 In fact, imp@ has already used this format for a number of changes from pull requests, e.g. r314407, r314408, r314422... From owner-svn-src-head@freebsd.org Tue Nov 21 01:36: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 E4D03DBB1A5; Tue, 21 Nov 2017 01:36:36 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::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 66A9A76787; Tue, 21 Nov 2017 01:36:36 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x232.google.com with SMTP id o41so12232052lfi.2; Mon, 20 Nov 2017 17:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4+dBNyQs6EvvuvdYMHCtNu7d27AX7z1EWoET2A18ZQE=; b=RvqzKlJoYOuvwHoRd1lRg49S5m6eHTgAj6kWnrbEAp4Z5phJB/reYbQdn3jSUXADRm EkGrjJatawORdYYsjicbNylBCLjYPvExuE+olXeBGVbizsIY8J8wHvhbwAt0OBoNEp21 kwRA/+t/VkKg8KxI7Uz5TjytSWh/BrNx1OvOYFJxAQ3enSTEegYetC/diDmJZpJcV8s9 0m4cOJ9Tny9oKFHVUk5hHAgHUi2Ww2NEUjTMZGx7eigNxJgPv+RJjwKYToU2gQEzgOtU 0CizgLpzmoTHYwbfjewpEG+IN22XBgmtj3VVOjIG87l0OAQ6XbYJDd4gwZA0L7hYrwCy b/Cw== 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=4+dBNyQs6EvvuvdYMHCtNu7d27AX7z1EWoET2A18ZQE=; b=UXe0wNf2W2w9T/t+O0aEokbfPVY9JWdeKzKSP4LWCZi+q2DUNB1k8laFiSThExiD0T 1/rk19SLyI57xNTscqUiU3EjjOrn67xMMT1hzHWTJqhCd3ylh16Pqic9UzEkKNeWfcjk kqaB+QoAkBLvwvRlE18UsZL4H25Q7aKRhfIKXnkhAVKaXbmUZXvhncmdEazwE/0Mq7Eq AdQLKuLp2S9YB2wIxwsGF7tTiHveOSFVdw44AJvqRXebg7X+PLFZA0+fAV15LkKFHYJ8 131+Qx0oZklgAMsuOVbOthIVrlt2IFToF9ZjArCmCkhzW4j8Ipa3iXI3y7gAWmaJSGbI 3Yeg== X-Gm-Message-State: AJaThX7G85M0Q8uQw2oYKobLxvi8/i7DLoDQKIcsVflzTQCUEhqR3F48 lSMXhihaoMhMR7R0+I3O5gZgIrT1itL9gRdO/EA= X-Google-Smtp-Source: AGs4zMbpKPrXu+0WrdwRpFYtVufAtCTHfGEwQ5cshHGzrQFhH4/5rATL20IZ2UxYHzTEs/IwBJKBrBUTM4gBepMF8NM= X-Received: by 10.46.88.4 with SMTP id m4mr5131946ljb.15.1511228194133; Mon, 20 Nov 2017 17:36:34 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.76.19 with HTTP; Mon, 20 Nov 2017 17:36:33 -0800 (PST) In-Reply-To: References: <201711202255.vAKMt2nP014201@repo.freebsd.org> From: Alan Somers Date: Mon, 20 Nov 2017 18:36:33 -0700 X-Google-Sender-Auth: 17Pqa5wkt8IBnc4_PDQpF2rFnkM Message-ID: Subject: Re: svn commit: r326039 - in head: etc/mtree usr.bin/head usr.bin/head/tests To: Ed Maste Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 01:36:37 -0000 On Mon, Nov 20, 2017 at 6:32 PM, Ed Maste wrote: > On 20 November 2017 at 17:55, Alan Somers wrote: >> Author: asomers >> Date: Mon Nov 20 22:55:02 2017 >> New Revision: 326039 >> URL: https://svnweb.freebsd.org/changeset/base/326039 >> >> Log: >> Add ATF tests for head(1) >> >> Submitted by: Fred Schlecter >> Reviewed by: asomers, jilles >> MFC after: 3 weeks >> Differential Revision: https://github.com/freebsd/freebsd/pull/127 > > It's certainly a good idea to capture the source of changes that come > in via GitHub pull requests, but the 'Differential Revision' field is > specifically for reviews in our own hosted Phabricator instance. > > We don't have an officially established metadata field for changes > that come in via pull requests at the moment. I'd suggest we just go > with: > Pull request: https://github.com/freebsd/freebsd/pull/127 Are there any automated tools that care about the "Differential Revision" field? If so, they should be able to tell the difference between GitHub revisions and Phabricator revisions based on the URL. Using "Differential Revision" instead of "Pull request" is handy, because it's part of the standard commit template, which encourages consistency. -Alan From owner-svn-src-head@freebsd.org Tue Nov 21 01:46:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B442DBBEB3 for ; Tue, 21 Nov 2017 01:46:37 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2C3977119 for ; Tue, 21 Nov 2017 01:46:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id m11so5880516iti.1 for ; Mon, 20 Nov 2017 17:46:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=EvVpkClr5S/1D+yZ4XXljZzJzYHWhug2R8ro14IVsGE=; b=GWaFouNqDLKuIakjH9gWMeOGTN3P2NaCdVuAS6sRn9BcTBaCDDbJ5/xa4UwjQUvfFi DsPIy5QZRzObYbNlmEWcUIDg6bBGbGYNDgFxajp5iOIpmwZypWGoIT2/EkLYws6KzX7Y oXoAlJNhV+qdihs1G63/YHMQi4/GKdNVc+urkCl9rdXCy7ucnFDbj8KoztXV8aTe/nTJ cCLzwoZNklsz+feD2raXt7LFWO48IRVclXoQdy374tOVL24EZSTaND+S3c4kQWWaHRUW 3rwxtH7TN1TRDKkt/heps+tqvZkWNScR1qjRwEVnu7bCYzYuSPAXaySftjCf/2YeSr2l 6cEg== 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=EvVpkClr5S/1D+yZ4XXljZzJzYHWhug2R8ro14IVsGE=; b=lnYPNZRDvHx5crZKhhpGR09curB1+Fi/vhoZsbXfn0jzMZd9rgugWSm2nE5kEi1YIB s8L2lHhcDAmeBswQ53x6Je8ArIOaqdB1MfANzdPZRreJ2x8CdHpKUkcr5MZ3nI5XDGgt f8PIRQef9SFq/oWWkgDLaka4kPjnu5WSFvwyIoBfwRKQOB3fgBU8XLF65b5G/32XAcnJ 10Rh8DVFNcs9MZgN7rB2A2zfXu16rFjV2PlVU19MSxr2l37zwTxGYUvHtdnW6bSs4hjS /Ah6yJx8AreWd8Ka+TlfInNynAMkhbcF2gI3Kz6T+znSnyhKkAoYz7fkEXZQMPgrK+kH cX3Q== X-Gm-Message-State: AJaThX4zEStMN7wVgKzWl/e/ZYsS+nxq7UOPM41ER60tzTjXlTHYmUKw yNY1nmUc6sg95FrosTej2I2YonoRamBTb9fIAOmexw== X-Google-Smtp-Source: AGs4zMa+C8QVFeWnX0Oa9H7QM/anlrGdY+uMiNPdvhHSfTDSCBeH2PfHbXs6o+AsdjEGCzZvO08ai4rBqW6Czwyoq3k= X-Received: by 10.36.94.129 with SMTP id h123mr16195675itb.64.1511228795938; Mon, 20 Nov 2017 17:46:35 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Mon, 20 Nov 2017 17:46:34 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:48:c6cd:13c1:8d48] Received: by 10.79.108.204 with HTTP; Mon, 20 Nov 2017 17:46:34 -0800 (PST) In-Reply-To: References: <201711202255.vAKMt2nP014201@repo.freebsd.org> From: Warner Losh Date: Mon, 20 Nov 2017 18:46:34 -0700 X-Google-Sender-Auth: cjeYAgCjrPa5oJoVTPgvwHZo7-k Message-ID: Subject: Re: svn commit: r326039 - in head: etc/mtree usr.bin/head usr.bin/head/tests To: Alan Somers Cc: Ed Maste , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 01:46:37 -0000 On Nov 20, 2017 6:36 PM, "Alan Somers" wrote: On Mon, Nov 20, 2017 at 6:32 PM, Ed Maste wrote: > On 20 November 2017 at 17:55, Alan Somers wrote: >> Author: asomers >> Date: Mon Nov 20 22:55:02 2017 >> New Revision: 326039 >> URL: https://svnweb.freebsd.org/changeset/base/326039 >> >> Log: >> Add ATF tests for head(1) >> >> Submitted by: Fred Schlecter >> Reviewed by: asomers, jilles >> MFC after: 3 weeks >> Differential Revision: https://github.com/freebsd/ freebsd/pull/127 > > It's certainly a good idea to capture the source of changes that come > in via GitHub pull requests, but the 'Differential Revision' field is > specifically for reviews in our own hosted Phabricator instance. > > We don't have an officially established metadata field for changes > that come in via pull requests at the moment. I'd suggest we just go > with: > Pull request: https://github.com/freebsd/freebsd/pull/127 Are there any automated tools that care about the "Differential Revision" field? If so, they should be able to tell the difference between GitHub revisions and Phabricator revisions based on the URL. Using "Differential Revision" instead of "Pull request" is handy, because it's part of the standard commit template, which encourages consistency. We should add Pull Request: to the template. Differential Revision really is a specific thing for phabricator... Warner From owner-svn-src-head@freebsd.org Tue Nov 21 01:48: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 7AEC2DBD1AD; Tue, 21 Nov 2017 01:48:57 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-ot0-x229.google.com (mail-ot0-x229.google.com [IPv6:2607:f8b0:4003:c0f::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 3B9237736A; Tue, 21 Nov 2017 01:48:57 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-ot0-x229.google.com with SMTP id o23so9284975otd.1; Mon, 20 Nov 2017 17:48:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JR4Lko8EosNWgRdkdgB8H5bFGJjqxRUYegH80+w2aAw=; b=mPF8ytACuBWo66zwQ+7DMSTqawQaDfzbafqxPgAaxzpxfdJJb3WtaZBfidfz0DiXtz 8chLUXAWRD3YLkJWZceL10DawoqYkNVebvEZ3R5Bn0xh6928qC8PoXJyF9AhuYqaaFsC cb8JhndbZbQ+pjPrsttQFhcwNhcFBLXIvRn9EOXVARwakp/9hb2iYoCgOwnrlqLzIAMm kQ8HpAEVWUE0WZHplj5RSCknmKbB7WxW0JiIgLi07Em3faDUBdfozktegsk5ZtWlhK6X HXaq2whXfMaW0853YuE7BiMlprr/LDc6GRaBPpsAluOhsCxfaTbSlbuEK9MxKUzL3MHe riew== 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=JR4Lko8EosNWgRdkdgB8H5bFGJjqxRUYegH80+w2aAw=; b=oAe5K0qf1KYYCXDd6+oaT27/BTTTaKA5NBQUXaBhd41xWwgJpw1y249eU58rpdAx3b JqNx5+O6vFjWJ+RkNN+B1I6nnhygB9pR381U9G84No599cZ98FaVFM3EByf7RKgyTUgW Fj80cE955PYsyi6eLRJWnBXNG/X3neTYppiq9WQocsHzWaMuhUF3ZYJVOSxT9OfO/oZ0 YXWYsTdvNvmrVS3qsc/aDZmExGw/Wzjaky3DeDcR+Uye1nMRDOauarxeeg8TaHumNSss OTGmoOPiyPyMzgfa2TD6wx5FitY6aalZJ4y3iurcSlUDKI0iuL9WdhNtkqbI6hrqA36V ZPWg== X-Gm-Message-State: AJaThX7qb7bSOKobGtVf/8eXGhQdLco42V1JgXOL91J6AiaExLscYGuH Z+9RINPtcUbaF9QI+zJwZwRSdBqEZ9O2E7tFaF4HVA== X-Google-Smtp-Source: AGs4zMaZ7ZNGOaHwv280w3bDXaNisSxtFS7+DTfWbH51UP7Q2jatqe2va2pnXdWzZ3vyJE36oWzag9rP+z00J8BoJno= X-Received: by 10.157.54.157 with SMTP id h29mr9765297otc.0.1511228936478; Mon, 20 Nov 2017 17:48:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.35.228 with HTTP; Mon, 20 Nov 2017 17:48:55 -0800 (PST) In-Reply-To: References: <201711202255.vAKMt2nP014201@repo.freebsd.org> From: Benjamin Kaduk Date: Mon, 20 Nov 2017 19:48:55 -0600 Message-ID: Subject: Re: svn commit: r326039 - in head: etc/mtree usr.bin/head usr.bin/head/tests To: Alan Somers Cc: Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 01:48:57 -0000 On Mon, Nov 20, 2017 at 7:36 PM, Alan Somers wrote: > > > Are there any automated tools that care about the "Differential > Revision" field? If so, they should be able to tell the difference > between GitHub revisions and Phabricator revisions based on the URL. > Yes, Phabricator itself uses the link to close out the review. > Using "Differential Revision" instead of "Pull request" is handy, > because it's part of the standard commit template, which encourages > consistency. > As Warner says, we could just add a new thing to the template instead of overloading an existing one for convenience. -Ben From owner-svn-src-head@freebsd.org Tue Nov 21 01:54: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 BAAF5DBDA68; Tue, 21 Nov 2017 01:54:49 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8741577948; Tue, 21 Nov 2017 01:54:49 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAL1smhG088876; Tue, 21 Nov 2017 01:54:48 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL1smBF088873; Tue, 21 Nov 2017 01:54:48 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201711210154.vAL1smBF088873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 21 Nov 2017 01:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326043 - in head/sys/mips: include mips X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys/mips: include mips X-SVN-Commit-Revision: 326043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 01:54:49 -0000 Author: landonf Date: Tue Nov 21 01:54:48 2017 New Revision: 326043 URL: https://svnweb.freebsd.org/changeset/base/326043 Log: Preemptively map MIPS INTRNG interrupts on non-FDT MIPS targets This replaces a partial workaround introduced in r305527 that was incompatible with nested INTRNG interrupt controllers if not also using FDT. On non-FDT MIPS INTRNG targets, we now preemptively produce a set of fixed mappings for the MIPS IRQ range during nexus attach. On FDT targets, OFW_BUS_MAP_INTR() remains responsible for mapping the MIPS IRQs. Approved by: adrian (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12385 Modified: head/sys/mips/include/intr.h head/sys/mips/mips/mips_pic.c head/sys/mips/mips/nexus.c Modified: head/sys/mips/include/intr.h ============================================================================== --- head/sys/mips/include/intr.h Tue Nov 21 01:18:58 2017 (r326042) +++ head/sys/mips/include/intr.h Tue Nov 21 01:54:48 2017 (r326043) @@ -55,16 +55,23 @@ #define NIRQ MIPS_NIRQ #endif +#ifndef FDT +#define MIPS_PIC_XREF 1 /**< unique xref */ +#endif + #define INTR_IRQ_NSPC_SWI 4 +/* MIPS32 PIC APIs */ +int mips_pic_map_fixed_intrs(void); +int mips_pic_activate_intr(device_t child, struct resource *r); +int mips_pic_deactivate_intr(device_t child, struct resource *r); + /* MIPS compatibility for legacy mips code */ void cpu_init_interrupts(void); void cpu_establish_hardintr(const char *, driver_filter_t *, driver_intr_t *, void *, int, int, void **); void cpu_establish_softintr(const char *, driver_filter_t *, void (*)(void*), void *, int, int, void **); -int cpu_create_intr_map(int); -struct resource *cpu_get_irq_resource(int); /* MIPS interrupt C entry point */ void cpu_intr(struct trapframe *); Modified: head/sys/mips/mips/mips_pic.c ============================================================================== --- head/sys/mips/mips/mips_pic.c Tue Nov 21 01:18:58 2017 (r326042) +++ head/sys/mips/mips/mips_pic.c Tue Nov 21 01:54:48 2017 (r326043) @@ -2,8 +2,12 @@ * Copyright (c) 2015 Alexander Kabaev * Copyright (c) 2006 Oleksandr Tymoshenko * Copyright (c) 2002-2004 Juli Mallett + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Landon Fuller + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -44,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -69,24 +74,56 @@ __FBSDID("$FreeBSD$"); #define NSOFT_IRQS 2 #define NREAL_IRQS (NHARD_IRQS + NSOFT_IRQS) -static int mips_pic_intr(void *); +struct mips_pic_softc; +static int mips_pic_intr(void *); +static struct mips_pic_intr *mips_pic_find_intr(struct resource *r); +static int mips_pic_map_fixed_intr(u_int irq, + struct mips_pic_intr **mapping); +static void cpu_establish_intr(struct mips_pic_softc *sc, + const char *name, driver_filter_t *filt, + void (*handler)(void*), void *arg, int irq, + int flags, void **cookiep); + +#define INTR_MAP_DATA_MIPS INTR_MAP_DATA_PLAT_1 + struct intr_map_data_mips_pic { struct intr_map_data hdr; u_int irq; }; +/** + * MIPS interrupt state; available prior to MIPS PIC device attachment. + */ +static struct mips_pic_intr { + u_int mips_irq; /**< MIPS IRQ# 0-7 */ + u_int intr_irq; /**< INTRNG IRQ#, or INTR_IRQ_INVALID if unmapped */ + u_int consumers; /**< INTRNG activation refcount */ + struct resource *res; /**< resource shared by all interrupt handlers registered via + cpu_establish_hardintr() or cpu_establish_softintr(); NULL + if no interrupt handlers are yet registered. */ +} mips_pic_intrs[] = { + { 0, INTR_IRQ_INVALID, 0, NULL }, + { 1, INTR_IRQ_INVALID, 0, NULL }, + { 2, INTR_IRQ_INVALID, 0, NULL }, + { 3, INTR_IRQ_INVALID, 0, NULL }, + { 4, INTR_IRQ_INVALID, 0, NULL }, + { 5, INTR_IRQ_INVALID, 0, NULL }, + { 6, INTR_IRQ_INVALID, 0, NULL }, + { 7, INTR_IRQ_INVALID, 0, NULL }, +}; + +struct mtx mips_pic_mtx; +MTX_SYSINIT(mips_pic_mtx, &mips_pic_mtx, "mips intr controller mutex", MTX_DEF); + struct mips_pic_irqsrc { struct intr_irqsrc isrc; - struct resource *res; u_int irq; }; struct mips_pic_softc { device_t pic_dev; struct mips_pic_irqsrc pic_irqs[NREAL_IRQS]; - struct rman pic_irq_rman; - struct mtx mutex; uint32_t nirqs; }; @@ -145,7 +182,7 @@ pic_xref(device_t dev) #ifdef FDT return (OF_xref_from_node(ofw_bus_get_node(dev))); #else - return (0); + return (MIPS_PIC_XREF); #endif } @@ -159,14 +196,7 @@ mips_pic_register_isrcs(struct mips_pic_softc *sc) for (irq = 0; irq < sc->nirqs; irq++) { sc->pic_irqs[irq].irq = irq; - sc->pic_irqs[irq].res = rman_reserve_resource(&sc->pic_irq_rman, - irq, irq, 1, RF_ACTIVE, sc->pic_dev); - if (sc->pic_irqs[irq].res == NULL) { - device_printf(sc->pic_dev, - "%s failed to alloc resource for irq %u", - __func__, irq); - return (ENOMEM); - } + isrc = PIC_INTR_ISRC(sc, irq); if (irq < NSOFT_IRQS) { name = "sint"; @@ -203,21 +233,9 @@ mips_pic_attach(device_t dev) sc->pic_dev = dev; pic_sc = sc; - /* Initialize mutex */ - mtx_init(&sc->mutex, "PIC lock", "", MTX_SPIN); - /* Set the number of interrupts */ sc->nirqs = nitems(sc->pic_irqs); - /* Init the IRQ rman */ - sc->pic_irq_rman.rm_type = RMAN_ARRAY; - sc->pic_irq_rman.rm_descr = "MIPS PIC IRQs"; - if (rman_init(&sc->pic_irq_rman) != 0 || - rman_manage_region(&sc->pic_irq_rman, 0, sc->nirqs - 1) != 0) { - device_printf(dev, "failed to setup IRQ rman\n"); - goto cleanup; - } - /* Register the interrupts */ if (mips_pic_register_isrcs(sc) != 0) { device_printf(dev, "could not register PIC ISRCs\n"); @@ -326,7 +344,7 @@ mips_pic_map_intr(device_t dev, struct intr_map_data * *isrcp = PIC_INTR_ISRC(sc, daf->cells[0]); } else #endif - if (data->type == INTR_MAP_DATA_PLAT_1) { + if (data->type == INTR_MAP_DATA_MIPS) { struct intr_map_data_mips_pic *mpd; mpd = (struct intr_map_data_mips_pic *)data; @@ -396,73 +414,292 @@ EARLY_DRIVER_MODULE(cpupic, nexus, mips_pic_driver, mi BUS_PASS_INTERRUPT); #endif -void -cpu_init_interrupts(void) +/** + * Return the MIPS interrupt map entry for @p r, or NULL if no such entry has + * been created. + */ +static struct mips_pic_intr * +mips_pic_find_intr(struct resource *r) { + struct mips_pic_intr *intr; + rman_res_t irq; + + irq = rman_get_start(r); + if (irq != rman_get_end(r) || rman_get_size(r) != 1) + return (NULL); + + mtx_lock(&mips_pic_mtx); + for (size_t i = 0; i < nitems(mips_pic_intrs); i++) { + intr = &mips_pic_intrs[i]; + + if (intr->intr_irq != irq) + continue; + + mtx_unlock(&mips_pic_mtx); + return (intr); + } + mtx_unlock(&mips_pic_mtx); + + /* Not found */ + return (NULL); } +/** + * Allocate a fixed IRQ mapping for the given MIPS @p irq, or return the + * existing mapping if @p irq was previously mapped. + * + * @param irq The MIPS IRQ to be mapped. + * @param[out] mapping On success, will be populated with the interrupt + * mapping. + * + * @retval 0 success + * @retval EINVAL if @p irq is not a valid MIPS IRQ#. + * @retval non-zero If allocating the MIPS IRQ mapping otherwise fails, a + * regular unix error code will be returned. + */ +static int +mips_pic_map_fixed_intr(u_int irq, struct mips_pic_intr **mapping) +{ + struct mips_pic_intr *intr; + struct intr_map_data_mips_pic *data; + device_t pic_dev; + uintptr_t xref; + + if (irq < 0 || irq >= nitems(mips_pic_intrs)) + return (EINVAL); + + mtx_lock(&mips_pic_mtx); + + /* Fetch corresponding interrupt entry */ + intr = &mips_pic_intrs[irq]; + KASSERT(intr->mips_irq == irq, + ("intr %u found at index %u", intr->mips_irq, irq)); + + /* Already mapped? */ + if (intr->intr_irq != INTR_IRQ_INVALID) { + mtx_unlock(&mips_pic_mtx); + *mapping = intr; + return (0); + } + + /* Map the interrupt */ + data = (struct intr_map_data_mips_pic *)intr_alloc_map_data( + INTR_MAP_DATA_MIPS, sizeof(*data), M_WAITOK | M_ZERO); + data->irq = intr->mips_irq; + +#ifdef FDT + /* PIC must be attached on FDT devices */ + KASSERT(pic_sc != NULL, ("%s: no pic", __func__)); + + pic_dev = pic_sc->pic_dev; + xref = pic_xref(pic_dev); +#else /* !FDT */ + /* PIC has a fixed xref, and may not have been attached yet */ + pic_dev = NULL; + if (pic_sc != NULL) + pic_dev = pic_sc->pic_dev; + + xref = MIPS_PIC_XREF; +#endif /* FDT */ + + KASSERT(intr->intr_irq == INTR_IRQ_INVALID, ("duplicate map")); + intr->intr_irq = intr_map_irq(pic_dev, xref, &data->hdr); + *mapping = intr; + + mtx_unlock(&mips_pic_mtx); + return (0); +} + +/** + * + * Produce fixed IRQ mappings for all MIPS IRQs. + * + * Non-FDT/OFW MIPS targets do not provide an equivalent to OFW_BUS_MAP_INTR(); + * it is instead necessary to reserve INTRNG IRQ# 0-7 for use by MIPS device + * drivers that assume INTRNG IRQs 0-7 are directly mapped to MIPS IRQs 0-7. + * + * XXX: There is no support in INTRNG for reserving a fixed IRQ range. However, + * we should be called prior to any other interrupt mapping requests, and work + * around this by iteratively allocating the required 0-7 MIP IRQ# range. + * + * @retval 0 success + * @retval non-zero If allocating the MIPS IRQ mappings otherwise fails, a + * regular unix error code will be returned. + */ int -cpu_create_intr_map(int irq) +mips_pic_map_fixed_intrs(void) { - struct intr_map_data_mips_pic *mips_pic_data; - intptr_t iparent; - size_t len; - u_int new_irq; + int error; - len = sizeof(*mips_pic_data); - iparent = pic_xref(pic_sc->pic_dev); + for (u_int i = 0; i < nitems(mips_pic_intrs); i++) { + struct mips_pic_intr *intr; - /* Allocate mips_pic data and fill it in */ - mips_pic_data = (struct intr_map_data_mips_pic *)intr_alloc_map_data( - INTR_MAP_DATA_PLAT_1, len, M_WAITOK | M_ZERO); - mips_pic_data->irq = irq; + if ((error = mips_pic_map_fixed_intr(i, &intr))) + return (error); - /* Get the new irq number */ - new_irq = intr_map_irq(pic_sc->pic_dev, iparent, - (struct intr_map_data *)mips_pic_data); + /* INTRNG IRQs 0-7 must be directly mapped to MIPS IRQs 0-7 */ + if (intr->intr_irq != intr->mips_irq) { + panic("invalid IRQ mapping: %u->%u", intr->intr_irq, + intr->mips_irq); + } + } - /* Adjust the resource accordingly */ - rman_set_start(pic_sc->pic_irqs[irq].res, new_irq); - rman_set_end(pic_sc->pic_irqs[irq].res, new_irq); + return (0); +} - /* Activate the new irq */ - return (intr_activate_irq(pic_sc->pic_dev, pic_sc->pic_irqs[irq].res)); +/** + * If @p r references a MIPS interrupt mapped by the MIPS32 interrupt + * controller, handle interrupt activation internally. + * + * Otherwise, delegate directly to intr_activate_irq(). + */ +int +mips_pic_activate_intr(device_t child, struct resource *r) +{ + struct mips_pic_intr *intr; + int error; + + /* Is this one of our shared MIPS interrupts? */ + if ((intr = mips_pic_find_intr(r)) == NULL) { + /* Delegate to standard INTRNG activation */ + return (intr_activate_irq(child, r)); + } + + /* Bump consumer count and request activation if required */ + mtx_lock(&mips_pic_mtx); + if (intr->consumers == UINT_MAX) { + mtx_unlock(&mips_pic_mtx); + return (ENOMEM); + } + + if (intr->consumers == 0) { + if ((error = intr_activate_irq(child, r))) { + mtx_unlock(&mips_pic_mtx); + return (error); + } + } + + intr->consumers++; + mtx_unlock(&mips_pic_mtx); + + return (0); } -struct resource * -cpu_get_irq_resource(int irq) +/** + * If @p r references a MIPS interrupt mapped by the MIPS32 interrupt + * controller, handle interrupt deactivation internally. + * + * Otherwise, delegate directly to intr_deactivate_irq(). + */ +int +mips_pic_deactivate_intr(device_t child, struct resource *r) { + struct mips_pic_intr *intr; + int error; - KASSERT(pic_sc != NULL, ("%s: no pic", __func__)); + /* Is this one of our shared MIPS interrupts? */ + if ((intr = mips_pic_find_intr(r)) == NULL) { + /* Delegate to standard INTRNG deactivation */ + return (intr_deactivate_irq(child, r)); + } - if (irq < 0 || irq >= pic_sc->nirqs) - panic("%s called for unknown irq %d", __func__, irq); + /* Decrement consumer count and request deactivation if required */ + mtx_lock(&mips_pic_mtx); + KASSERT(intr->consumers > 0, ("refcount overrelease")); - return pic_sc->pic_irqs[irq].res; + if (intr->consumers == 1) { + if ((error = intr_deactivate_irq(child, r))) { + mtx_unlock(&mips_pic_mtx); + return (error); + } + } + intr->consumers--; + + mtx_unlock(&mips_pic_mtx); + return (0); } void +cpu_init_interrupts(void) +{ +} + +/** + * Provide backwards-compatible support for registering a MIPS interrupt handler + * directly, without allocating a bus resource. + */ +static void +cpu_establish_intr(struct mips_pic_softc *sc, const char *name, + driver_filter_t *filt, void (*handler)(void*), void *arg, int irq, + int flags, void **cookiep) +{ + struct mips_pic_intr *intr; + struct resource *res; + int rid; + int error; + + rid = -1; + + /* Fetch (or create) a fixed mapping */ + if ((error = mips_pic_map_fixed_intr(irq, &intr))) + panic("Unable to map IRQ %d: %d", irq, error); + + /* Fetch the backing resource, if any */ + mtx_lock(&mips_pic_mtx); + res = intr->res; + mtx_unlock(&mips_pic_mtx); + + /* Allocate our IRQ resource */ + if (res == NULL) { + /* Optimistically perform resource allocation */ + rid = intr->intr_irq; + res = bus_alloc_resource(sc->pic_dev, SYS_RES_IRQ, &rid, + intr->intr_irq, intr->intr_irq, 1, RF_SHAREABLE|RF_ACTIVE); + + if (res != NULL) { + /* Try to update intr->res */ + mtx_lock(&mips_pic_mtx); + if (intr->res == NULL) { + intr->res = res; + } + mtx_unlock(&mips_pic_mtx); + + /* If intr->res was updated concurrently, free our local + * resource allocation */ + if (intr->res != res) { + bus_release_resource(sc->pic_dev, SYS_RES_IRQ, + rid, res); + } + } else { + /* Maybe someone else allocated it? */ + mtx_lock(&mips_pic_mtx); + res = intr->res; + mtx_unlock(&mips_pic_mtx); + } + + if (res == NULL) { + panic("Unable to allocate IRQ %d->%u resource", irq, + intr->intr_irq); + } + } + + error = bus_setup_intr(sc->pic_dev, res, flags, filt, handler, arg, + cookiep); + if (error) + panic("Unable to add IRQ %d handler: %d", irq, error); +} + +void cpu_establish_hardintr(const char *name, driver_filter_t *filt, void (*handler)(void*), void *arg, int irq, int flags, void **cookiep) { - int res; + KASSERT(pic_sc != NULL, ("%s: no pic", __func__)); - /* - * We have 6 levels, but thats 0 - 5 (not including 6) - */ if (irq < 0 || irq >= NHARD_IRQS) panic("%s called for unknown hard intr %d", __func__, irq); - KASSERT(pic_sc != NULL, ("%s: no pic", __func__)); - - irq += NSOFT_IRQS; - - res = cpu_create_intr_map(irq); - if (res != 0) panic("Unable to create map for hard IRQ %d", irq); - - res = intr_setup_irq(pic_sc->pic_dev, pic_sc->pic_irqs[irq].res, filt, - handler, arg, flags, cookiep); - if (res != 0) panic("Unable to add hard IRQ %d handler", irq); + cpu_establish_intr(pic_sc, name, filt, handler, arg, irq+NSOFT_IRQS, + flags, cookiep); } void @@ -470,18 +707,12 @@ cpu_establish_softintr(const char *name, driver_filter void (*handler)(void*), void *arg, int irq, int flags, void **cookiep) { - int res; + KASSERT(pic_sc != NULL, ("%s: no pic", __func__)); - if (irq < 0 || irq > NSOFT_IRQS) + if (irq < 0 || irq >= NSOFT_IRQS) panic("%s called for unknown soft intr %d", __func__, irq); - KASSERT(pic_sc != NULL, ("%s: no pic", __func__)); - - res = cpu_create_intr_map(irq); - if (res != 0) panic("Unable to create map for soft IRQ %d", irq); - - res = intr_setup_irq(pic_sc->pic_dev, pic_sc->pic_irqs[irq].res, filt, - handler, arg, flags, cookiep); - if (res != 0) panic("Unable to add soft IRQ %d handler", irq); + cpu_establish_intr(pic_sc, name, filt, handler, arg, irq, flags, + cookiep); } Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Tue Nov 21 01:18:58 2017 (r326042) +++ head/sys/mips/mips/nexus.c Tue Nov 21 01:54:48 2017 (r326043) @@ -76,7 +76,11 @@ __FBSDID("$FreeBSD$"); #define dprintf(x, arg...) #endif /* NEXUS_DEBUG */ -#define NUM_MIPS_IRQS 6 +#ifdef INTRNG +#define NUM_MIPS_IRQS NIRQ /* Any INTRNG-mapped IRQ */ +#else +#define NUM_MIPS_IRQS 6 /* HW IRQs only */ +#endif static MALLOC_DEFINE(M_NEXUSDEV, "nexusdev", "Nexus device"); @@ -200,7 +204,13 @@ nexus_probe(device_t dev) static int nexus_attach(device_t dev) { +#if defined(INTRNG) && !defined(FDT) + int error; + if ((error = mips_pic_map_fixed_intrs())) + return (error); +#endif + bus_generic_probe(dev); bus_enumerate_hinted_children(dev); bus_generic_attach(dev); @@ -291,7 +301,7 @@ nexus_alloc_resource(device_t bus, device_t child, int * and we know what the resources for this device are (ie. they aren't * maintained by a child bus), then work out the start/end values. */ - if (isdefault) { + if (!passthrough && isdefault) { rle = resource_list_find(&ndev->nx_resources, type, *rid); if (rle == NULL) return (NULL); @@ -432,21 +442,12 @@ nexus_activate_resource(device_t bus, device_t child, rman_set_bushandle(r, (bus_space_handle_t)(uintptr_t)vaddr); } else if (type == SYS_RES_IRQ) { #ifdef INTRNG -#ifdef FDT - err = intr_activate_irq(child, r); + err = mips_pic_activate_intr(child, r); if (err != 0) { rman_deactivate_resource(r); return (err); } -#else - /* - * INTRNG without FDT needs to have the interrupt properly - * mapped first. cpu_create_intr_map() will do that and - * call intr_activate_irq() at the end. - */ - cpu_create_intr_map(rman_get_start(r)); #endif -#endif } return (rman_activate_resource(r)); @@ -468,7 +469,7 @@ nexus_deactivate_resource(device_t bus, device_t child rman_set_bushandle(r, 0); } else if (type == SYS_RES_IRQ) { #ifdef INTRNG - intr_deactivate_irq(child, r); + mips_pic_deactivate_intr(child, r); #endif } @@ -480,12 +481,7 @@ nexus_setup_intr(device_t dev, device_t child, struct driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep) { #ifdef INTRNG - struct resource *r = res; - -#ifndef FDT - r = cpu_get_irq_resource(rman_get_start(r)); -#endif - return (intr_setup_irq(child, r, filt, intr, arg, flags, cookiep)); + return (intr_setup_irq(child, res, filt, intr, arg, flags, cookiep)); #else int irq; register_t s; From owner-svn-src-head@freebsd.org Tue Nov 21 02:38: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 6AE18DC183F; Tue, 21 Nov 2017 02:38:35 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::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 E0D8D7978B; Tue, 21 Nov 2017 02:38:34 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x235.google.com with SMTP id m1so12334957lfj.9; Mon, 20 Nov 2017 18:38:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9tuPzII056eb3D11Y+bjg9bFWR620WNYwxcbTny9CCk=; b=BoJlyssY8nLVdLaUPGTB8fTdsbRkJv/40GOctNghL2sP1wN5vEiNffuMyFONpHdiPS ImT7bBNBbNHZPuXDEfSNA5Y1mI7xslmLaxvTxc/86djiEI9ULa+1FNjJOZsKvW6PrWo/ dO2Zv2MPH7nj9u/K7gIRgIiINKNua09/thJLxPMcmzHV29BmhJJ3XAeqA9JS/SwDQiug Se6U1pY7R4IErHmF+Jnyn2FMBEZQEuXvW/YkL6Qdzj0x1eX8ltTKVfDTviWHYGArTbco tJPSM/p4ZpsoyFx1K10AFZ953wyGQRqxIdcId1TFymkLm6rP41mQNhBWPBxrBownn0a0 ABJA== 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=9tuPzII056eb3D11Y+bjg9bFWR620WNYwxcbTny9CCk=; b=Jt6biotzglXHHyTmVymK/5tCw/pzHgGhbJ6aVW3DOk7dtUBQPYj3LkKXZhkQQIu68D jtknmV6Yd6u5dQznC5ZgMs8fFzxNfHeOcPA+uaSv34qUM9waxq2UzdP8iuU7zW6TDvwv AvVPW5MFnebwAL/I/YOlXMimyF1uYOGKdY4WwlRsuCQtJLNV+vzvT259Lq00DIhbgee5 5SBnWlp/rZnZYewL7OXl6Lf6rAU1VUDhoVRWKVE+yutKjIhLAFpQazL3RN2F5vmwVzwt kmnIztmmXvbt3zyKB8Mv25w0FMMhCJJ1pFEjon3IIxeGzqvusLUB1lKNsKnhpRfIfvSM pQSA== X-Gm-Message-State: AJaThX6iamKX1b0QJVd1Ttvmh0AZgnmdTrptowifJqmC4a+CZR1ov9B7 YhNnYbkhTZpy8/XDBVzOpOQhuN0qFtrt4dFBX7E= X-Google-Smtp-Source: AGs4zMaFKHn5rcIkohVkDSopn/O8pkhnFDrmQwpsOGV3wVxFFFCzz2hP59oHUy9CuT45NX7nkQiiHvLnJhEDXR5L7A4= X-Received: by 10.25.216.88 with SMTP id p85mr4938136lfg.21.1511231911953; Mon, 20 Nov 2017 18:38:31 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.76.19 with HTTP; Mon, 20 Nov 2017 18:38:31 -0800 (PST) In-Reply-To: References: <201711202255.vAKMt2nP014201@repo.freebsd.org> From: Alan Somers Date: Mon, 20 Nov 2017 19:38:31 -0700 X-Google-Sender-Auth: fuu5daOZ4WdNIGBzVcHgb5MiV5c Message-ID: Subject: Re: svn commit: r326039 - in head: etc/mtree usr.bin/head usr.bin/head/tests To: Benjamin Kaduk Cc: Ed Maste , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 02:38:35 -0000 On Mon, Nov 20, 2017 at 6:48 PM, Benjamin Kaduk wrote: > On Mon, Nov 20, 2017 at 7:36 PM, Alan Somers wrote: >> >> >> Are there any automated tools that care about the "Differential >> Revision" field? If so, they should be able to tell the difference >> between GitHub revisions and Phabricator revisions based on the URL. > > > > Yes, Phabricator itself uses the link to close out the review. > > >> >> Using "Differential Revision" instead of "Pull request" is handy, >> because it's part of the standard commit template, which encourages >> consistency. > > > As Warner says, we could just add a new thing to the template instead > of overloading an existing one for convenience. > > -Ben Okeedookee. Here you go: https://reviews.freebsd.org/D13179 https://reviews.freebsd.org/D13178 -Alan From owner-svn-src-head@freebsd.org Tue Nov 21 03:12: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 BFA3CDDB6E1; Tue, 21 Nov 2017 03:12:17 +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 8C7C97B166; Tue, 21 Nov 2017 03:12:17 +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 vAL3CGmh022764; Tue, 21 Nov 2017 03:12:16 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL3CG1x022763; Tue, 21 Nov 2017 03:12:16 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711210312.vAL3CG1x022763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 21 Nov 2017 03:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326045 - head/sys/powerpc/booke X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/booke X-SVN-Commit-Revision: 326045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 03:12:17 -0000 Author: jhibbits Date: Tue Nov 21 03:12:16 2017 New Revision: 326045 URL: https://svnweb.freebsd.org/changeset/base/326045 Log: Check the page table before TLB1 in pmap_kextract() The vast majority of pmap_kextract() calls are looking for a physical memory address, not a device address. By checking the page table first this saves the formerly inevitable 64 (on e500mc and derivatives) iteration loop through TLB1 in the most common cases. Benchmarking this on the P5020 (e5500 core) yields a 300% throughput improvement on dtsec(4) (115Mbit/s -> 460Mbit/s) measured with iperf. Benchmarked on the P1022 (e500v2 core, 16 TLB1 entries) yields a 50% throughput improvement on tsec(4) (~93Mbit/s -> 165Mbit/s) measured with iperf. MFC after: 1 week Relnotes: Maybe (significant performance improvement) Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Nov 21 02:09:59 2017 (r326044) +++ head/sys/powerpc/booke/pmap.c Tue Nov 21 03:12:16 2017 (r326045) @@ -2089,18 +2089,23 @@ static vm_paddr_t mmu_booke_kextract(mmu_t mmu, vm_offset_t va) { tlb_entry_t e; + vm_paddr_t p; int i; - /* Check TLB1 mappings */ - for (i = 0; i < TLB1_ENTRIES; i++) { - tlb1_read_entry(&e, i); - if (!(e.mas1 & MAS1_VALID)) - continue; - if (va >= e.virt && va < e.virt + e.size) - return (e.phys + (va - e.virt)); + p = pte_vatopa(mmu, kernel_pmap, va); + + if (p == 0) { + /* Check TLB1 mappings */ + for (i = 0; i < TLB1_ENTRIES; i++) { + tlb1_read_entry(&e, i); + if (!(e.mas1 & MAS1_VALID)) + continue; + if (va >= e.virt && va < e.virt + e.size) + return (e.phys + (va - e.virt)); + } } - return (pte_vatopa(mmu, kernel_pmap, va)); + return (p); } /* From owner-svn-src-head@freebsd.org Tue Nov 21 03:15: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 C7667DDBB39; Tue, 21 Nov 2017 03:15:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D7AF7B4BD; Tue, 21 Nov 2017 03:15:34 +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 vAL3FWGg022924; Tue, 21 Nov 2017 03:15:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL3FWHE022923; Tue, 21 Nov 2017 03:15:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711210315.vAL3FWHE022923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 21 Nov 2017 03:15:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326046 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 326046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 03:15:37 -0000 Author: emaste Date: Tue Nov 21 03:15:32 2017 New Revision: 326046 URL: https://svnweb.freebsd.org/changeset/base/326046 Log: dt_modtext: return error on archs lacking an implementation Reported by: mmel Reviewed by: markj MFC after: 1 week MFC with: r325042 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13176 Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Nov 21 03:12:16 2017 (r326045) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Tue Nov 21 03:15:32 2017 (r326046) @@ -808,7 +808,7 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, { printf("%s:%s(%d): aarch64 not implemented\n", __FUNCTION__, __FILE__, __LINE__); - return (0); + return (-1); } #elif defined(__arm__) /* XXX */ @@ -818,7 +818,7 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, { printf("%s:%s(%d): arm not implemented\n", __FUNCTION__, __FILE__, __LINE__); - return (0); + return (-1); } #elif defined(__mips__) /* XXX */ @@ -828,7 +828,7 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, { printf("%s:%s(%d): MIPS not implemented\n", __FUNCTION__, __FILE__, __LINE__); - return (0); + return (-1); } #elif defined(__powerpc__) /* The sentinel is 'xor r3,r3,r3'. */ @@ -919,7 +919,7 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, { printf("%s:%s(%d): RISC-V implementation required\n", __FUNCTION__, __FILE__, __LINE__); - return (0); + return (-1); } #elif defined(__sparc) From owner-svn-src-head@freebsd.org Tue Nov 21 05:30: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 6A877DE22C0 for ; Tue, 21 Nov 2017 05:30:19 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-121.reflexion.net [208.70.210.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BD707FE45 for ; Tue, 21 Nov 2017 05:30:18 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 16124 invoked from network); 21 Nov 2017 05:30:12 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 21 Nov 2017 05:30:12 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Tue, 21 Nov 2017 00:30:12 -0500 (EST) Received: (qmail 22641 invoked from network); 21 Nov 2017 05:30:12 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 21 Nov 2017 05:30:12 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id C1C47EC8B7B; Mon, 20 Nov 2017 21:30:11 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r326038 - in head/stand: . arm/uboot efi efi/fdt fdt i386 mips/beri mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/boot1.chrp powerpc/kboot powerpc/ofw powerpc/ps3 power... Message-Id: <2434FC04-1FF3-48B0-8743-78412673616F@dsl-only.net> Date: Mon, 20 Nov 2017 21:30:11 -0800 To: Warner Losh , svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 05:30:19 -0000 It looks to me like head/stand/powerpc/boot1.chrp/Makefile might have +=3D vs. =3D issues compared to the other examples: Warner Losh imp at FreeBSD.org wrote on Mon Nov 20 22:42:21 UTC 2017 : Modified: head/stand/powerpc/boot1.chrp/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/stand/powerpc/boot1.chrp/Makefile Mon Nov 20 22:41:22 2017 = (r326037) +++ head/stand/powerpc/boot1.chrp/Makefile Mon Nov 20 22:42:17 2017 = (r326038) @@ -13,9 +13,7 @@ SRCS=3D boot1.c ashldi3.c syncicache.c =20 MAN=3D =20 -CFLAGS=3D -ffreestanding -msoft-float \ - -I${LDRSRC} -I${SYSDIR} -I${SASRC} \ - -D_STANDALONE +CFLAGS=3D -I${LDRSRC} -I${SYSDIR} -I${SASRC} -D_STANDALONE LDFLAGS=3D-nostdlib -static -Wl,-N =20 .PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR} but the other files tend to use +=3D for at least CFLAGS. In one case you converted an =3D into only using +=3D locally: -CFLAGS=3D -ffreestanding \ - -I${.CURDIR} \ +CFLAGS+=3D -I${.CURDIR} \ (Generally the mix seems to be as it was before the changes but it likely looked odd before the changes when the files were view together.) There are also examples like: LDFLAGS=3D -nostdlib -static -T = ${.CURDIR}/ldscript.${MACHINE_CPUARCH} LDFLAGS+=3D -Wl,-znotext and others with just =3D . But some files seem to always use +=3D for LDFLAGS. May be a round of =3D vs. +=3D checking is appropriate for the involved files? =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Tue Nov 21 05:35: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 4AE2CDE2619; Tue, 21 Nov 2017 05:35:23 +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 14CB98023B; Tue, 21 Nov 2017 05:35: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 vAL5ZMFv080475; Tue, 21 Nov 2017 05:35:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL5ZMEw080474; Tue, 21 Nov 2017 05:35:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711210535.vAL5ZMEw080474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 21 Nov 2017 05:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326047 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 326047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 05:35:23 -0000 Author: imp Date: Tue Nov 21 05:35:21 2017 New Revision: 326047 URL: https://svnweb.freebsd.org/changeset/base/326047 Log: Implement efi media tagging for MBR partitioning types. Sponsored by: Netflix Modified: head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue Nov 21 03:15:32 2017 (r326046) +++ head/sys/geom/part/g_part_mbr.c Tue Nov 21 05:35:21 2017 (r326047) @@ -303,11 +303,14 @@ g_part_mbr_destroy(struct g_part_table *basetable, str } static void -g_part_mbr_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, +g_part_mbr_dumpconf(struct g_part_table *basetable, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { struct g_part_mbr_entry *entry; + struct g_part_mbr_table *table; + uint32_t dsn; + table = (struct g_part_mbr_table *)basetable; entry = (struct g_part_mbr_entry *)baseentry; if (indent == NULL) { /* conftxt: libdisk compatibility */ @@ -318,6 +321,11 @@ g_part_mbr_dumpconf(struct g_part_table *table, struct entry->ent.dp_typ); if (entry->ent.dp_flag & 0x80) sbuf_printf(sb, "%sactive\n", indent); + dsn = le32dec(table->mbr + DOSDSNOFF); + sbuf_printf(sb, "%sHD(%d,MBR,%d,%#jx,%#jx)", indent, + entry->base.gpe_index, dsn, (intmax_t)entry->base.gpe_start, + (intmax_t)(entry->base.gpe_end - entry->base.gpe_start + 1)); + sbuf_printf(sb, "\n"); } else { /* confxml: scheme information */ } From owner-svn-src-head@freebsd.org Tue Nov 21 05:42: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 0A498DE2844; Tue, 21 Nov 2017 05:42:15 +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 D843E8067F; Tue, 21 Nov 2017 05:42:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAL5gERj083863; Tue, 21 Nov 2017 05:42:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL5gDxO083856; Tue, 21 Nov 2017 05:42:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711210542.vAL5gDxO083856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 21 Nov 2017 05:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326048 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 326048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 05:42:15 -0000 Author: imp Date: Tue Nov 21 05:42:13 2017 New Revision: 326048 URL: https://svnweb.freebsd.org/changeset/base/326048 Log: Remove trailing whitespace (one I just introduced and a bunch of others in the same directory). Sponsored by: Netflix Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part_apm.c head/sys/geom/part/g_part_bsd.c head/sys/geom/part/g_part_bsd64.c head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Nov 21 05:35:21 2017 (r326047) +++ head/sys/geom/part/g_part.c Tue Nov 21 05:42:13 2017 (r326048) @@ -1352,7 +1352,7 @@ g_part_ctl_resize(struct gctl_req *req, struct g_part_ /* Deny shrinking of an opened partition. */ gctl_error(req, "%d", EBUSY); return (EBUSY); - } + } } error = G_PART_RESIZE(table, entry, gpp); Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Tue Nov 21 05:35:21 2017 (r326047) +++ head/sys/geom/part/g_part_apm.c Tue Nov 21 05:42:13 2017 (r326048) @@ -207,7 +207,7 @@ apm_read_ent(struct g_consumer *cp, uint32_t blk, stru } static int -g_part_apm_add(struct g_part_table *basetable, struct g_part_entry *baseentry, +g_part_apm_add(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_apm_entry *entry; Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Tue Nov 21 05:35:21 2017 (r326047) +++ head/sys/geom/part/g_part_bsd.c Tue Nov 21 05:42:13 2017 (r326048) @@ -72,7 +72,7 @@ static int g_part_bsd_destroy(struct g_part_table *, s static void g_part_bsd_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_bsd_dumpto(struct g_part_table *, struct g_part_entry *); -static int g_part_bsd_modify(struct g_part_table *, struct g_part_entry *, +static int g_part_bsd_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static const char *g_part_bsd_name(struct g_part_table *, struct g_part_entry *, char *, size_t); @@ -256,7 +256,7 @@ g_part_bsd_destroy(struct g_part_table *basetable, str } static void -g_part_bsd_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, +g_part_bsd_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { struct g_part_bsd_entry *entry; @@ -275,7 +275,7 @@ g_part_bsd_dumpconf(struct g_part_table *table, struct } static int -g_part_bsd_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) +g_part_bsd_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { struct g_part_bsd_entry *entry; @@ -471,7 +471,7 @@ g_part_bsd_read(struct g_part_table *basetable, struct } static const char * -g_part_bsd_type(struct g_part_table *basetable, struct g_part_entry *baseentry, +g_part_bsd_type(struct g_part_table *basetable, struct g_part_entry *baseentry, char *buf, size_t bufsz) { struct g_part_bsd_entry *entry; Modified: head/sys/geom/part/g_part_bsd64.c ============================================================================== --- head/sys/geom/part/g_part_bsd64.c Tue Nov 21 05:35:21 2017 (r326047) +++ head/sys/geom/part/g_part_bsd64.c Tue Nov 21 05:42:13 2017 (r326048) @@ -127,7 +127,7 @@ static int g_part_bsd64_destroy(struct g_part_table *, static void g_part_bsd64_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_bsd64_dumpto(struct g_part_table *, struct g_part_entry *); -static int g_part_bsd64_modify(struct g_part_table *, struct g_part_entry *, +static int g_part_bsd64_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static const char *g_part_bsd64_name(struct g_part_table *, struct g_part_entry *, char *, size_t); @@ -409,7 +409,7 @@ g_part_bsd64_dumpconf(struct g_part_table *basetable, } static int -g_part_bsd64_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) +g_part_bsd64_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { struct g_part_bsd64_entry *entry; @@ -577,7 +577,7 @@ invalid_label: } static const char * -g_part_bsd64_type(struct g_part_table *basetable, struct g_part_entry *baseentry, +g_part_bsd64_type(struct g_part_table *basetable, struct g_part_entry *baseentry, char *buf, size_t bufsz) { struct g_part_bsd64_entry *entry; Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Tue Nov 21 05:35:21 2017 (r326047) +++ head/sys/geom/part/g_part_ebr.c Tue Nov 21 05:42:13 2017 (r326048) @@ -80,7 +80,7 @@ static int g_part_ebr_dumpto(struct g_part_table *, st static void g_part_ebr_fullname(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); #endif -static int g_part_ebr_modify(struct g_part_table *, struct g_part_entry *, +static int g_part_ebr_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static const char *g_part_ebr_name(struct g_part_table *, struct g_part_entry *, char *, size_t); @@ -322,11 +322,11 @@ g_part_ebr_destroy(struct g_part_table *basetable, str } static void -g_part_ebr_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, +g_part_ebr_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { struct g_part_ebr_entry *entry; - + entry = (struct g_part_ebr_entry *)baseentry; if (indent == NULL) { /* conftxt: libdisk compatibility */ @@ -343,7 +343,7 @@ g_part_ebr_dumpconf(struct g_part_table *table, struct } static int -g_part_ebr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) +g_part_ebr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { struct g_part_ebr_entry *entry; @@ -595,7 +595,7 @@ g_part_ebr_setunset(struct g_part_table *table, struct } static const char * -g_part_ebr_type(struct g_part_table *basetable, struct g_part_entry *baseentry, +g_part_ebr_type(struct g_part_table *basetable, struct g_part_entry *baseentry, char *buf, size_t bufsz) { struct g_part_ebr_entry *entry; @@ -667,7 +667,7 @@ g_part_ebr_write(struct g_part_table *basetable, struc p[7] = entry->ent.dp_ecyl; le32enc(p + 8, entry->ent.dp_start); le32enc(p + 12, entry->ent.dp_size); - + next = LIST_NEXT(baseentry, gpe_entry); while (next != NULL && next->gpe_deleted) next = LIST_NEXT(next, gpe_entry); Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Tue Nov 21 05:35:21 2017 (r326047) +++ head/sys/geom/part/g_part_gpt.c Tue Nov 21 05:42:13 2017 (r326048) @@ -699,11 +699,11 @@ g_part_gpt_destroy(struct g_part_table *basetable, str } static void -g_part_gpt_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, +g_part_gpt_dumpconf(struct g_part_table *table, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { struct g_part_gpt_entry *entry; - + entry = (struct g_part_gpt_entry *)baseentry; if (indent == NULL) { /* conftxt: libdisk compatibility */ @@ -743,7 +743,7 @@ g_part_gpt_dumpconf(struct g_part_table *table, struct } static int -g_part_gpt_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) +g_part_gpt_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { struct g_part_gpt_entry *entry; @@ -866,7 +866,7 @@ g_part_gpt_probe(struct g_part_table *table, struct g_ &error); if (buf == NULL) return (error); - res = memcmp(buf, GPT_HDR_SIG, 8); + res = memcmp(buf, GPT_HDR_SIG, 8); g_free(buf); return ((res == 0) ? pri : ENXIO); } @@ -1108,13 +1108,13 @@ g_part_gpt_setunset(struct g_part_table *basetable, } static const char * -g_part_gpt_type(struct g_part_table *basetable, struct g_part_entry *baseentry, +g_part_gpt_type(struct g_part_table *basetable, struct g_part_entry *baseentry, char *buf, size_t bufsz) { struct g_part_gpt_entry *entry; struct uuid *type; struct g_part_uuid_alias *uap; - + entry = (struct g_part_gpt_entry *)baseentry; type = &entry->ent.ent_type; for (uap = &gpt_uuid_alias_match[0]; uap->uuid; uap++) Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue Nov 21 05:35:21 2017 (r326047) +++ head/sys/geom/part/g_part_mbr.c Tue Nov 21 05:42:13 2017 (r326048) @@ -77,7 +77,7 @@ static int g_part_mbr_destroy(struct g_part_table *, s static void g_part_mbr_dumpconf(struct g_part_table *, struct g_part_entry *, struct sbuf *, const char *); static int g_part_mbr_dumpto(struct g_part_table *, struct g_part_entry *); -static int g_part_mbr_modify(struct g_part_table *, struct g_part_entry *, +static int g_part_mbr_modify(struct g_part_table *, struct g_part_entry *, struct g_part_parms *); static const char *g_part_mbr_name(struct g_part_table *, struct g_part_entry *, char *, size_t); @@ -303,13 +303,13 @@ g_part_mbr_destroy(struct g_part_table *basetable, str } static void -g_part_mbr_dumpconf(struct g_part_table *basetable, struct g_part_entry *baseentry, +g_part_mbr_dumpconf(struct g_part_table *basetable, struct g_part_entry *baseentry, struct sbuf *sb, const char *indent) { struct g_part_mbr_entry *entry; struct g_part_mbr_table *table; uint32_t dsn; - + table = (struct g_part_mbr_table *)basetable; entry = (struct g_part_mbr_entry *)baseentry; if (indent == NULL) { @@ -332,7 +332,7 @@ g_part_mbr_dumpconf(struct g_part_table *basetable, st } static int -g_part_mbr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) +g_part_mbr_dumpto(struct g_part_table *table, struct g_part_entry *baseentry) { struct g_part_mbr_entry *entry; @@ -560,7 +560,7 @@ g_part_mbr_setunset(struct g_part_table *table, struct } static const char * -g_part_mbr_type(struct g_part_table *basetable, struct g_part_entry *baseentry, +g_part_mbr_type(struct g_part_table *basetable, struct g_part_entry *baseentry, char *buf, size_t bufsz) { struct g_part_mbr_entry *entry; From owner-svn-src-head@freebsd.org Tue Nov 21 05:50: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 747B8DE2CF1 for ; Tue, 21 Nov 2017 05:50:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AA198091E for ; Tue, 21 Nov 2017 05:50:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id u42so18191995ioi.9 for ; Mon, 20 Nov 2017 21:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=bCwmJ5+dVKANx9tYfhOxVea27Mlqa89CbkFrif9k7vE=; b=pDdIWgpIGbidHdoqyYIclUjlM7bVOf3lnOJ3x/SbPblztjPJR+/7tH9Jn61CBdCMyX 6IKpg59luE5rHJvQuf0hgICrdp/DKUD/eyvO33VWK1Df7hRUQflTp2QTp7KVLD8D7uMh vDgwETZ7swPMWQUuCcqSizUPdJKKwLdQJb0upoUAur4iTL7CmutcwBoCyEPjnWd3OgxP Xu3Up0QU00G/UaxTqCvY3yIFi/DcpCeSMqbeON4LdxQ+jX0rnzepdi9SHT6pl/7yC2zF i3Lko7hV8xKC0WsO1UjfZyMG80GpkU3zjMp0Y87V981WectEcYbkGHYMl1MSzOlfBk1P WR4A== 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=bCwmJ5+dVKANx9tYfhOxVea27Mlqa89CbkFrif9k7vE=; b=F9aAEWvWXROzP19b1CkvwoRllM24iKHSu8RglQTdkabYq+aFoDfwZxr5xvGniXzhOF j5a14iUtYVOb2kiWnvoyVVlLDl0YTrT1udJb7tTvXcysKdlqoSJ8g/TVWpWHGFbO41Ku d/zdQm83Xyubl5tYMZjLlYhq9RunVt++CvTf9OfzIX3djTgXManGV+8WeVo23Dc9kxGN 3mgwRXIYBOVKqH9Rz5dKCXoqC4uSQUuVDHFXo0Xb9ssaAKS8eBJPgNNZy2m5A/Ny3ZhV REMgH5xabEaxM1MN2lL5xtWUP0K0W19VYGwWgi/fxJxBqTe8M1i9dAVnN/cCGnvtFZTU zR1g== X-Gm-Message-State: AJaThX7sl2zBVZ3FpD3SQx+nxQYtwlbBPUmxS7gC1ywcA6h5ht/7jTn4 8ZhDkcyC6L7n+zUoEGhxDo3fPH3w6KK0UA1CDEzfrw== X-Google-Smtp-Source: AGs4zMYUMirf2rHA9HHrwsX+9yvnmjzdyh0ROV80FSVy6f9d9MWPkAjH1uC/C3Z47SA9sp5nhBnOHLZhaTtbjqD6Fyg= X-Received: by 10.107.48.197 with SMTP id w188mr14056250iow.301.1511243426487; Mon, 20 Nov 2017 21:50:26 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Mon, 20 Nov 2017 21:50:25 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c91c:5e34:ef38:d5a] In-Reply-To: <2434FC04-1FF3-48B0-8743-78412673616F@dsl-only.net> References: <2434FC04-1FF3-48B0-8743-78412673616F@dsl-only.net> From: Warner Losh Date: Mon, 20 Nov 2017 22:50:25 -0700 X-Google-Sender-Auth: iTfnd3j5q87oMInuN6Djqo7cLlI Message-ID: Subject: Re: svn commit: r326038 - in head/stand: . arm/uboot efi efi/fdt fdt i386 mips/beri mips/beri/boot2 mips/beri/loader mips/uboot ofw/libofw powerpc/boot1.chrp powerpc/kboot powerpc/ofw powerpc/ps3 power... To: Mark Millard Cc: Warner Losh , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 05:50:27 -0000 On Mon, Nov 20, 2017 at 10:30 PM, Mark Millard wrote: > It looks to me like head/stand/powerpc/boot1.chrp/Makefile might > have += vs. = issues compared to the other examples: > > Warner Losh imp at FreeBSD.org wrote on > Mon Nov 20 22:42:21 UTC 2017 : > > Modified: head/stand/powerpc/boot1.chrp/Makefile > ============================================================ > ================== > --- head/stand/powerpc/boot1.chrp/Makefile Mon Nov 20 22:41:22 2017 > (r326037) > +++ head/stand/powerpc/boot1.chrp/Makefile Mon Nov 20 22:42:17 2017 > (r326038) > @@ -13,9 +13,7 @@ SRCS= boot1.c ashldi3.c syncicache.c > > MAN= > > -CFLAGS= -ffreestanding -msoft-float \ > - -I${LDRSRC} -I${SYSDIR} -I${SASRC} \ > - -D_STANDALONE > +CFLAGS= -I${LDRSRC} -I${SYSDIR} -I${SASRC} -D_STANDALONE > LDFLAGS=-nostdlib -static -Wl,-N > > .PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR} > > but the other files tend to use += for at least CFLAGS. In > one case you converted an = into only using += locally: > > -CFLAGS= -ffreestanding \ > - -I${.CURDIR} \ > +CFLAGS+= -I${.CURDIR} \ > > (Generally the mix seems to be as it was before > the changes but it likely looked odd before the > changes when the files were view together.) > > There are also examples like: > > LDFLAGS= -nostdlib -static -T ${.CURDIR}/ldscript.${MACHINE_ > CPUARCH} > LDFLAGS+= -Wl,-znotext > > and others with just = . But some files seem to always > use += for LDFLAGS. > > May be a round of = vs. += checking is appropriate > for the involved files? > Yea. I've done it once or twice already. It's quite likely another pass may be necessary, so it doesn't surprise me you've found at least one places that needs a good close look... There's a few places LDFLAGS are used, and it seems everywhere it has -nostdlib, and maybe a few others. And there's likely a few places where some of the defines need to be moved around to. Warner From owner-svn-src-head@freebsd.org Tue Nov 21 06:12:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9EC0DE3DAA; Tue, 21 Nov 2017 06:12:22 +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 973CC17B4; Tue, 21 Nov 2017 06:12:22 +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 vAL6CLAg096993; Tue, 21 Nov 2017 06:12:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL6CLwO096992; Tue, 21 Nov 2017 06:12:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711210612.vAL6CLwO096992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 21 Nov 2017 06:12:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326049 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 326049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 06:12:22 -0000 Author: imp Date: Tue Nov 21 06:12:21 2017 New Revision: 326049 URL: https://svnweb.freebsd.org/changeset/base/326049 Log: While the EFI spec allows numbers to be in many forms, libefivar produces hex numbers for the dsn. Since that come is from EDK2, change this for symmetry, by generating the dsn as a hex number. Noticed by: gpart list | grep efimedia | awk -F: '{print $2;}' | \ sed -e 's/^ *//g;s/,,/,/' | grep MBR | efidp -p | efidp -f Sponsored by: Netflix Modified: head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Tue Nov 21 05:42:13 2017 (r326048) +++ head/sys/geom/part/g_part_mbr.c Tue Nov 21 06:12:21 2017 (r326049) @@ -322,7 +322,7 @@ g_part_mbr_dumpconf(struct g_part_table *basetable, st if (entry->ent.dp_flag & 0x80) sbuf_printf(sb, "%sactive\n", indent); dsn = le32dec(table->mbr + DOSDSNOFF); - sbuf_printf(sb, "%sHD(%d,MBR,%d,%#jx,%#jx)", indent, + sbuf_printf(sb, "%sHD(%d,MBR,%#08x,%#jx,%#jx)", indent, entry->base.gpe_index, dsn, (intmax_t)entry->base.gpe_start, (intmax_t)(entry->base.gpe_end - entry->base.gpe_start + 1)); sbuf_printf(sb, "\n"); From owner-svn-src-head@freebsd.org Tue Nov 21 06:36: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 4C557DE4961; Tue, 21 Nov 2017 06:36:45 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DEB22540; Tue, 21 Nov 2017 06:36:44 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from [10.1.254.16] (cerberus.brkt.com [208.185.168.138]) (authenticated bits=0) by mail.xcllnt.net (8.15.2/8.15.2) with ESMTPSA id vAL6MtxX007783 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 20 Nov 2017 22:22:56 -0800 (PST) (envelope-from marcel@xcllnt.net) From: Marcel Moolenaar Message-Id: Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Subject: Re: svn commit: r326045 - head/sys/powerpc/booke Date: Mon, 20 Nov 2017 22:22:50 -0800 In-Reply-To: <201711210312.vAL3CG1x022763@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Justin Hibbits References: <201711210312.vAL3CG1x022763@repo.freebsd.org> X-Mailer: Apple Mail (2.3445.4.7) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail.xcllnt.net [50.0.150.214]); Mon, 20 Nov 2017 22:22:56 -0800 (PST) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 06:36:45 -0000 > On Nov 20, 2017, at 7:12 PM, Justin Hibbits = wrote: >=20 > Author: jhibbits > Date: Tue Nov 21 03:12:16 2017 > New Revision: 326045 > URL: https://svnweb.freebsd.org/changeset/base/326045 >=20 > Log: > Check the page table before TLB1 in pmap_kextract() >=20 > The vast majority of pmap_kextract() calls are looking for a physical = memory > address, not a device address. By checking the page table first this = saves > the formerly inevitable 64 (on e500mc and derivatives) iteration loop > through TLB1 in the most common cases. >=20 > Benchmarking this on the P5020 (e5500 core) yields a 300% throughput > improvement on dtsec(4) (115Mbit/s -> 460Mbit/s) measured with iperf. >=20 > Benchmarked on the P1022 (e500v2 core, 16 TLB1 entries) yields a 50% > throughput improvement on tsec(4) (~93Mbit/s -> 165Mbit/s) measured = with > iperf. Nice! --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@freebsd.org Tue Nov 21 07:35:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3F53DE5FD2; Tue, 21 Nov 2017 07:35:25 +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 80C753D0A; Tue, 21 Nov 2017 07:35:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAL7ZO3B029971; Tue, 21 Nov 2017 07:35:24 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL7ZO8x029970; Tue, 21 Nov 2017 07:35:24 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711210735.vAL7ZO8x029970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 21 Nov 2017 07:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326050 - head/usr.sbin/efidp X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efidp X-SVN-Commit-Revision: 326050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 07:35:25 -0000 Author: imp Date: Tue Nov 21 07:35:24 2017 New Revision: 326050 URL: https://svnweb.freebsd.org/changeset/base/326050 Log: Document what the command line arguments actually do. List some of the size limitations. Sponsored by: Netflix Modified: head/usr.sbin/efidp/efidp.8 Modified: head/usr.sbin/efidp/efidp.8 ============================================================================== --- head/usr.sbin/efidp/efidp.8 Tue Nov 21 06:12:21 2017 (r326049) +++ head/usr.sbin/efidp/efidp.8 Tue Nov 21 07:35:24 2017 (r326050) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2017 +.Dd November 21, 2017 .Dt EFIDP 8 .Os .Sh NAME @@ -36,16 +36,35 @@ .Op Fl -parse .Op Fl -format .Sh DESCRIPTION -This program manages +This program converts .Dq Unified Extensible Firmware Interface .Pq UEFI -Device Paths, as defined in the UEFI standard. +Device Paths, as defined in the UEFI standard, to and from binary form. +Binary and textual forms are defined in Chapter 9 of the UEFI +Specification. +.Pp +.Bl -tag -width 20m +.It Fl f Fl -format +Formats a binary UEFI Device Path into its canonical UTF-8 textual form. +A binary Device Path can be no longer than 8192 bytes. +The textual form must fit into 4096 bytes. +.It Fl p Fl -parse +Parses a UEFI Device Path UTF-8 specification and outputs the binary +Device Path form. +Only one device path is parsed, even if there are multiple present in +the input. +Leading white space is ignored. +The resulting binary Device Path can be no longer than 8192 bytes. +.El .Sh SEE ALSO Appendix A of the UEFI specification has the format for GUIDs. All GUIDs .Dq Globally Unique Identifiers have the format described in RFC 4122. -.El +.Pp +The Unified Extensible Firmware Interface Specification is available +from +.Pa www.uefi.org . .Sh HISTORY The .Nm From owner-svn-src-head@freebsd.org Tue Nov 21 07:35: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 3C84EDE5FFC; Tue, 21 Nov 2017 07:35:31 +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 08FC93D58; Tue, 21 Nov 2017 07:35:30 +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 vAL7ZUZL030025; Tue, 21 Nov 2017 07:35:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL7ZULl030024; Tue, 21 Nov 2017 07:35:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711210735.vAL7ZULl030024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 21 Nov 2017 07:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326051 - head/usr.sbin/efidp X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/efidp X-SVN-Commit-Revision: 326051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 07:35:31 -0000 Author: imp Date: Tue Nov 21 07:35:29 2017 New Revision: 326051 URL: https://svnweb.freebsd.org/changeset/base/326051 Log: This program is more useful if it skips leading whitespace when parsing a textual UEFI Device Path, since otherwise it things the passed in path is a filename. While here, reduce the repetition of 8192. Sponsored by: Netflix Modified: head/usr.sbin/efidp/efidp.c Modified: head/usr.sbin/efidp/efidp.c ============================================================================== --- head/usr.sbin/efidp/efidp.c Tue Nov 21 07:35:24 2017 (r326050) +++ head/usr.sbin/efidp/efidp.c Tue Nov 21 07:35:29 2017 (r326051) @@ -27,6 +27,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include #include @@ -133,16 +134,22 @@ main(int argc, char **argv) } else if (flag_parse) { efidp dp; ssize_t dplen; - char *str; + char *str, *walker; - dp = malloc(8192); + dplen = 8192; + dp = malloc(dplen); str = realloc(data, len + 1); if (str == NULL || dp == NULL) errx(1, "Can't allocate memory."); str[len] = '\0'; - dplen = efidp_parse_device_path(str, dp, 8192); + walker = str; + while (isspace(*walker)) + walker++; + dplen = efidp_parse_device_path(walker, dp, dplen); if (dplen == -1) - errx(1, "Can't parse %s", str); + errx(1, "Can't parse %s", walker); write(STDOUT_FILENO, dp, dplen); + free(dp); + free(str); } } From owner-svn-src-head@freebsd.org Tue Nov 21 08:14: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 D7A1BDE7308; Tue, 21 Nov 2017 08:14:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E6C86446D; Tue, 21 Nov 2017 08:14:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAL8EUx5047093; Tue, 21 Nov 2017 08:14:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAL8EUgM047088; Tue, 21 Nov 2017 08:14:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711210814.vAL8EUgM047088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 21 Nov 2017 08:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326052 - head/usr.bin/gzip X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.bin/gzip X-SVN-Commit-Revision: 326052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 08:14:31 -0000 Author: delphij Date: Tue Nov 21 08:14:30 2017 New Revision: 326052 URL: https://svnweb.freebsd.org/changeset/base/326052 Log: Support SIGINFO. Obtained from: NetBSD MFC after: 2 weeks Modified: head/usr.bin/gzip/gzip.1 head/usr.bin/gzip/gzip.c head/usr.bin/gzip/unbzip2.c head/usr.bin/gzip/unpack.c head/usr.bin/gzip/unxz.c Modified: head/usr.bin/gzip/gzip.1 ============================================================================== --- head/usr.bin/gzip/gzip.1 Tue Nov 21 07:35:29 2017 (r326051) +++ head/usr.bin/gzip/gzip.1 Tue Nov 21 08:14:30 2017 (r326052) @@ -1,6 +1,6 @@ -.\" $NetBSD: gzip.1,v 1.26 2015/10/27 07:36:18 mrg Exp $ +.\" $NetBSD: gzip.1,v 1.30 2017/10/22 17:36:49 abhinav Exp $ .\" -.\" Copyright (c) 1997, 2003, 2004 Matthew R. Green +.\" Copyright (c) 1997, 2003, 2004, 2008, 2009, 2015, 2017 Matthew R. Green .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,11 +25,13 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd October 26, 2015 +.Dd November 21, 2017 .Dt GZIP 1 .Os .Sh NAME -.Nm gzip +.Nm gzip , +.Nm gunzip , +.Nm zcat .Nd compression/decompression tool using Lempel-Ziv coding (LZ77) .Sh SYNOPSIS .Nm @@ -112,67 +114,68 @@ or .Sh OPTIONS The following options are available: .Bl -tag -width XXrXXXrecursiveX -.It Fl 1 , -fast +.It Fl 1 , Fl Fl fast .It Fl 2 , 3 , 4 , 5 , 6 , 7 , 8 -.It Fl 9 , -best +.It Fl 9 , Fl Fl best These options change the compression level used, with the .Fl 1 option being the fastest, with less compression, and the .Fl 9 option being the slowest, with optimal compression. The default compression level is 6. -.It Fl c , -stdout , -to-stdout +.It Fl c , Fl Fl stdout , Fl Fl to-stdout This option specifies that output will go to the standard output stream, leaving files intact. -.It Fl d , -decompress , -uncompress +.It Fl d , Fl Fl decompress , Fl Fl uncompress This option selects decompression rather than compression. -.It Fl f , -force +.It Fl f , Fl Fl force This option turns on force mode. This allows files with multiple links, symbolic links to regular files, overwriting of pre-existing files, reading from or writing to a terminal, and when combined with the .Fl c option, allowing non-compressed data to pass through unchanged. -.It Fl h , -help +.It Fl h , Fl Fl help This option prints a usage summary and exits. -.It Fl k , -keep -Keep (do not delete) input files during compression -or decompression. +.It Fl k , Fl Fl keep +This option prevents +.Nm +from deleting input files after (de)compression. .It Fl L , -license This option prints .Nm license. -.It Fl l , -list +.It Fl l , Fl Fl list This option displays information about the file's compressed and uncompressed size, ratio, uncompressed name. With the .Fl v option, it also displays the compression method, CRC, date and time embedded in the file. -.It Fl N , -name +.It Fl N , Fl Fl name This option causes the stored filename in the input file to be used as the output file. -.It Fl n , -no-name +.It Fl n , Fl Fl no-name This option stops the filename and timestamp from being stored in the output file. -.It Fl q , -quiet +.It Fl q , Fl Fl quiet With this option, no warnings or errors are printed. -.It Fl r , -recursive +.It Fl r , Fl Fl recursive This option is used to .Nm the files in a directory tree individually, using the .Xr fts 3 library. -.It Fl S Ar suffix , Fl -suffix Ar suffix +.It Fl S Ar suffix , Fl Fl suffix Ar suffix This option changes the default suffix from .gz to .Ar suffix . -.It Fl t , -test +.It Fl t , Fl Fl test This option will test compressed files for integrity. -.It Fl V , -version +.It Fl V , Fl Fl version This option prints the version of the .Nm program. -.It Fl v , -verbose +.It Fl v , Fl Fl verbose This option turns on verbose mode, which prints the compression ratio for each file compressed. .El @@ -189,6 +192,13 @@ The utility exits 0 on success, 1 on errors, and 2 if a warning occurs. +.Sh SIGNALS +.Nm +responds to the following signals: +.Bl -tag -width indent +.It Dv SIGINFO +Report progress to standard error. +.El .Sh SEE ALSO .Xr bzip2 1 , .Xr compress 1 , @@ -213,7 +223,8 @@ This implementation of .Nm was ported based on the .Nx -.Nm , +.Nm +version 20170803, and first appeared in .Fx 7.0 . .Sh AUTHORS Modified: head/usr.bin/gzip/gzip.c ============================================================================== --- head/usr.bin/gzip/gzip.c Tue Nov 21 07:35:29 2017 (r326051) +++ head/usr.bin/gzip/gzip.c Tue Nov 21 08:14:30 2017 (r326052) @@ -1,7 +1,8 @@ -/* $NetBSD: gzip.c,v 1.109 2015/10/27 07:36:18 mrg Exp $ */ +/* $NetBSD: gzip.c,v 1.112 2017/08/23 13:04:17 christos Exp $ */ /*- - * Copyright (c) 1997, 1998, 2003, 2004, 2006 Matthew R. Green + * Copyright (c) 1997, 1998, 2003, 2004, 2006, 2008, 2009, 2010, 2011, 2015, 2017 + * Matthew R. Green * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -29,8 +30,8 @@ #include #ifndef lint -__COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006\ - Matthew R. Green. All rights reserved."); +__COPYRIGHT("@(#) Copyright (c) 1997, 1998, 2003, 2004, 2006, 2008,\ + 2009, 2010, 2011, 2015, 2017 Matthew R. Green. All rights reserved."); __FBSDID("$FreeBSD$"); #endif /* not lint */ @@ -158,7 +159,7 @@ static suffixes_t suffixes[] = { #define NUM_SUFFIXES (nitems(suffixes)) #define SUFFIX_MAXLEN 30 -static const char gzip_version[] = "FreeBSD gzip 20150413"; +static const char gzip_version[] = "FreeBSD gzip 20171121"; #ifndef SMALL static const char gzip_copyright[] = \ @@ -192,8 +193,10 @@ static int dflag; /* decompress mode */ static int lflag; /* list mode */ static int numflag = 6; /* gzip -1..-9 value */ -#ifndef SMALL +static const char *remove_file = NULL; /* file to be removed upon SIGINT */ + static int fflag; /* force mode */ +#ifndef SMALL static int kflag; /* don't delete input files */ static int nflag; /* don't save name/timestamp */ static int Nflag; /* don't restore name/timestamp */ @@ -201,7 +204,7 @@ static int qflag; /* quiet mode */ static int rflag; /* recursive mode */ static int tflag; /* test */ static int vflag; /* verbose mode */ -static const char *remove_file = NULL; /* file to be removed upon SIGINT */ +static sig_atomic_t print_info = 0; #else #define qflag 0 #define tflag 0 @@ -209,7 +212,7 @@ static const char *remove_file = NULL; /* file to be r static int exit_value = 0; /* exit value */ -static char *infile; /* name of file coming in */ +static const char *infile; /* name of file coming in */ static void maybe_err(const char *fmt, ...) __printflike(1, 2) __dead2; #if !defined(NO_BZIP2_SUPPORT) || !defined(NO_PACK_SUPPORT) || \ @@ -236,14 +239,26 @@ static void usage(void) __dead2; static void display_version(void) __dead2; #ifndef SMALL static void display_license(void); -static void sigint_handler(int); #endif static const suffixes_t *check_suffix(char *, int); static ssize_t read_retry(int, void *, size_t); +static ssize_t write_retry(int, const void *, size_t); #ifdef SMALL +#define infile_set(f,t) infile_set(f) +#endif +static void infile_set(const char *newinfile, off_t total); + +#ifdef SMALL #define unlink_input(f, sb) unlink(f) +#define check_siginfo() /* nothing */ +#define setup_signals() /* nothing */ +#define infile_newdata(t) /* nothing */ #else +static off_t infile_total; /* total expected to read/write */ +static off_t infile_current; /* current read/write */ + +static void check_siginfo(void); static off_t cat_fd(unsigned char *, size_t, off_t *, int fd); static void prepend_gzip(char *, int *, char ***); static void handle_dir(char *); @@ -251,6 +266,9 @@ static void print_verbage(const char *, const char *, static void print_test(const char *, int); static void copymodes(int fd, const struct stat *, const char *file); static int check_outfile(const char *outfile); +static void setup_signals(void); +static void infile_newdata(size_t newdata); +static void infile_clear(void); #endif #ifndef NO_BZIP2_SUPPORT @@ -308,10 +326,11 @@ main(int argc, char **argv) #endif int ch; + setup_signals(); + #ifndef SMALL if ((gzip = getenv("GZIP")) != NULL) prepend_gzip(gzip, &argc, &argv); - signal(SIGINT, sigint_handler); #endif /* @@ -587,7 +606,7 @@ gz_compress(int in, int out, off_t *gsizep, const char origname = ""; } - i = snprintf(outbufp, BUFLEN, "%c%c%c%c%c%c%c%c%c%c%s", + i = snprintf(outbufp, BUFLEN, "%c%c%c%c%c%c%c%c%c%c%s", GZIP_MAGIC0, GZIP_MAGIC1, Z_DEFLATED, *origname ? ORIG_NAME : 0, mtime & 0xff, @@ -596,7 +615,7 @@ gz_compress(int in, int out, off_t *gsizep, const char (mtime >> 24) & 0xff, numflag == 1 ? 4 : numflag == 9 ? 2 : 0, OS_CODE, origname); - if (i >= BUFLEN) + if (i >= BUFLEN) /* this need PATH_MAX > BUFLEN ... */ maybe_err("snprintf"); if (*origname) @@ -617,7 +636,7 @@ gz_compress(int in, int out, off_t *gsizep, const char crc = crc32(0L, Z_NULL, 0); for (;;) { if (z.avail_out == 0) { - if (write(out, outbufp, BUFLEN) != BUFLEN) { + if (write_retry(out, outbufp, BUFLEN) != BUFLEN) { maybe_warn("write"); out_tot = -1; goto out; @@ -637,6 +656,7 @@ gz_compress(int in, int out, off_t *gsizep, const char } if (in_size == 0) break; + infile_newdata(in_size); crc = crc32(crc, (const Bytef *)inbufp, (unsigned)in_size); in_tot += in_size; @@ -666,7 +686,7 @@ gz_compress(int in, int out, off_t *gsizep, const char len = (char *)z.next_out - outbufp; - w = write(out, outbufp, len); + w = write_retry(out, outbufp, len); if (w == -1 || (size_t)w != len) { maybe_warn("write"); out_tot = -1; @@ -686,7 +706,7 @@ gz_compress(int in, int out, off_t *gsizep, const char goto out; } - i = snprintf(outbufp, BUFLEN, "%c%c%c%c%c%c%c%c", + i = snprintf(outbufp, BUFLEN, "%c%c%c%c%c%c%c%c", (int)crc & 0xff, (int)(crc >> 8) & 0xff, (int)(crc >> 16) & 0xff, @@ -697,7 +717,7 @@ gz_compress(int in, int out, off_t *gsizep, const char (int)(in_tot >> 24) & 0xff); if (i != 8) maybe_err("snprintf"); - if (write(out, outbufp, i) != i) { + if (write_retry(out, outbufp, i) != i) { maybe_warn("write"); in_tot = -1; } else @@ -774,6 +794,7 @@ gz_uncompress(int in, int out, char *pre, size_t prele out_tot = 0; for (;;) { + check_siginfo(); if ((z.avail_in == 0 || needmore) && done_reading == 0) { ssize_t in_size; @@ -790,6 +811,7 @@ gz_uncompress(int in, int out, char *pre, size_t prele } else if (in_size == 0) { done_reading = 1; } + infile_newdata(in_size); z.avail_in += in_size; needmore = 0; @@ -962,7 +984,7 @@ gz_uncompress(int in, int out, char *pre, size_t prele /* don't write anything with -t */ tflag == 0 && #endif - write(out, outbufp, wr) != wr) { + write_retry(out, outbufp, wr) != wr) { maybe_warn("error writing to output"); goto stop_and_fail; } @@ -1083,7 +1105,7 @@ copymodes(int fd, const struct stat *sbp, const char * (void)fchmod(fd, DEFFILEMODE & ~mask); (void)umask(mask); - return; + return; } sb = *sbp; @@ -1190,15 +1212,58 @@ unlink_input(const char *file, const struct stat *sb) } static void -sigint_handler(int signo __unused) +got_sigint(int signo __unused) { if (remove_file != NULL) unlink(remove_file); _exit(2); } + +static void +got_siginfo(int signo __unused) +{ + + print_info = 1; +} + +static void +setup_signals(void) +{ + + signal(SIGINFO, got_siginfo); + signal(SIGINT, got_sigint); +} + +static void +infile_newdata(size_t newdata) +{ + + infile_current += newdata; +} #endif +static void +infile_set(const char *newinfile, off_t total) +{ + + if (newinfile) + infile = newinfile; +#ifndef SMALL + infile_total = total; +#endif +} + +static void +infile_clear(void) +{ + + infile = NULL; +#ifndef SMALL + infile_total = infile_current = 0; +#endif +} + static const suffixes_t * check_suffix(char *file, int xlate) { @@ -1229,7 +1294,7 @@ file_compress(char *file, char *outfile, size_t outsiz { int in; int out; - off_t size, insize; + off_t size, in_size; #ifndef SMALL struct stat isb, osb; const suffixes_t *suff; @@ -1249,14 +1314,24 @@ file_compress(char *file, char *outfile, size_t outsiz } #endif +#ifndef SMALL + if (fstat(in, &isb) != 0) { + close(in); + maybe_warn("can't stat %s", file); + return -1; + } + infile_set(file, isb.st_size); +#endif + if (cflag == 0) { #ifndef SMALL if (isb.st_nlink > 1 && fflag == 0) { - maybe_warnx("%s has %ju other link%s -- skipping", - file, (uintmax_t)isb.st_nlink - 1, - (isb.st_nlink - 1) == 1 ? "" : "s"); + maybe_warnx("%s has %ju other link%s -- " + "skipping", file, + (uintmax_t)isb.st_nlink - 1, + isb.st_nlink == 1 ? "" : "s"); close(in); - return (-1); + return -1; } if (fflag == 0 && (suff = check_suffix(file, 0)) && @@ -1295,19 +1370,19 @@ file_compress(char *file, char *outfile, size_t outsiz } else out = STDOUT_FILENO; - insize = gz_compress(in, out, &size, basename(file), (uint32_t)isb.st_mtime); + in_size = gz_compress(in, out, &size, basename(file), (uint32_t)isb.st_mtime); (void)close(in); /* - * If there was an error, insize will be -1. + * If there was an error, in_size will be -1. * If we compressed to stdout, just return the size. * Otherwise stat the file and check it is the correct size. * We only blow away the file if we can stat the output and it * has the expected size. */ if (cflag != 0) - return (insize == -1 ? -1 : size); + return in_size == -1 ? -1 : size; #ifndef SMALL if (fstat(out, &osb) != 0) { @@ -1352,6 +1427,7 @@ file_uncompress(char *file, char *outfile, size_t outs unsigned char header1[4]; enum filetype method; int fd, ofd, zfd = -1; + size_t in_size; #ifndef SMALL ssize_t rv; time_t timestamp = 0; @@ -1365,6 +1441,16 @@ file_uncompress(char *file, char *outfile, size_t outs maybe_warn("can't open %s", file); goto lose; } + if (fstat(fd, &isb) != 0) { + close(fd); + maybe_warn("can't stat %s", file); + goto lose; + } + if (S_ISREG(isb.st_mode)) + in_size = isb.st_size; + else + in_size = 0; + infile_set(file, in_size); strlcpy(outfile, file, outsize); if (check_suffix(outfile, 1) == NULL && !(cflag || lflag)) { @@ -1385,6 +1471,7 @@ file_uncompress(char *file, char *outfile, size_t outs goto unexpected_EOF; goto lose; } + infile_newdata(rbytes); method = file_gettype(header1); #ifndef SMALL @@ -1407,6 +1494,7 @@ file_uncompress(char *file, char *outfile, size_t outs maybe_warn("can't read %s", file); goto lose; } + infile_newdata(rv); timestamp = ts[3] << 24 | ts[2] << 16 | ts[1] << 8 | ts[0]; if (header1[3] & ORIG_NAME) { @@ -1435,7 +1523,7 @@ file_uncompress(char *file, char *outfile, size_t outs else dp++; snprintf(outfile, outsize, "%.*s%.*s", - (int) (dp - file), + (int) (dp - file), file, (int) rbytes, nf); } } @@ -1444,8 +1532,6 @@ file_uncompress(char *file, char *outfile, size_t outs lseek(fd, 0, SEEK_SET); if (cflag == 0 || lflag) { - if (fstat(fd, &isb) != 0) - goto lose; #ifndef SMALL if (isb.st_nlink > 1 && lflag == 0 && fflag == 0) { maybe_warnx("%s has %ju other links -- skipping", @@ -1459,7 +1545,11 @@ file_uncompress(char *file, char *outfile, size_t outs #endif } - if (cflag == 0 && lflag == 0) { + if (cflag) + zfd = STDOUT_FILENO; + else if (lflag) + zfd = -1; + else { zfd = open(outfile, O_WRONLY|O_CREAT|O_EXCL, 0600); if (zfd == STDOUT_FILENO) { /* We won't close STDOUT_FILENO later... */ @@ -1470,11 +1560,8 @@ file_uncompress(char *file, char *outfile, size_t outs maybe_warn("can't open %s", outfile); goto lose; } -#ifndef SMALL remove_file = outfile; -#endif - } else - zfd = STDOUT_FILENO; + } switch (method) { #ifndef NO_BZIP2_SUPPORT @@ -1560,7 +1647,7 @@ file_uncompress(char *file, char *outfile, size_t outs #endif default: if (lflag) { - print_list(fd, isb.st_size, outfile, isb.st_mtime); + print_list(fd, in_size, outfile, isb.st_mtime); close(fd); return -1; /* XXX */ } @@ -1635,6 +1722,25 @@ file_uncompress(char *file, char *outfile, size_t outs } #ifndef SMALL +static void +check_siginfo(void) +{ + if (print_info == 0) + return; + if (infile) { + if (infile_total) { + int pcent = (int)((100.0 * infile_current) / infile_total); + + fprintf(stderr, "%s: done %llu/%llu bytes %d%%\n", + infile, (unsigned long long)infile_current, + (unsigned long long)infile_total, pcent); + } else + fprintf(stderr, "%s: done %llu bytes\n", + infile, (unsigned long long)infile_current); + } + print_info = 0; +} + static off_t cat_fd(unsigned char * prepend, size_t count, off_t *gsizep, int fd) { @@ -1643,7 +1749,7 @@ cat_fd(unsigned char * prepend, size_t count, off_t *g ssize_t w; in_tot = count; - w = write(STDOUT_FILENO, prepend, count); + w = write_retry(STDOUT_FILENO, prepend, count); if (w == -1 || (size_t)w != count) { maybe_warn("write to stdout"); return -1; @@ -1658,8 +1764,9 @@ cat_fd(unsigned char * prepend, size_t count, off_t *g maybe_warn("read from fd %d", fd); break; } + infile_newdata(rv); - if (write(STDOUT_FILENO, buf, rv) != rv) { + if (write_retry(STDOUT_FILENO, buf, rv) != rv) { maybe_warn("write to stdout"); break; } @@ -1675,7 +1782,9 @@ cat_fd(unsigned char * prepend, size_t count, off_t *g static void handle_stdin(void) { + struct stat isb; unsigned char header1[4]; + size_t in_size; off_t usize, gsize; enum filetype method; ssize_t bytes_read; @@ -1686,29 +1795,32 @@ handle_stdin(void) #ifndef SMALL if (fflag == 0 && lflag == 0 && isatty(STDIN_FILENO)) { maybe_warnx("standard input is a terminal -- ignoring"); - return; + goto out; } #endif - if (lflag) { - struct stat isb; + if (fstat(STDIN_FILENO, &isb) < 0) { + maybe_warn("fstat"); + goto out; + } + if (S_ISREG(isb.st_mode)) + in_size = isb.st_size; + else + in_size = 0; + infile_set("(stdin)", in_size); - /* XXX could read the whole file, etc. */ - if (fstat(STDIN_FILENO, &isb) < 0) { - maybe_warn("fstat"); - return; - } - print_list(STDIN_FILENO, isb.st_size, "stdout", isb.st_mtime); - return; + if (lflag) { + print_list(STDIN_FILENO, in_size, infile, isb.st_mtime); + goto out; } bytes_read = read_retry(STDIN_FILENO, header1, sizeof header1); if (bytes_read == -1) { maybe_warn("can't read stdin"); - return; + goto out; } else if (bytes_read != sizeof(header1)) { maybe_warnx("(stdin): unexpected end of file"); - return; + goto out; } method = file_gettype(header1); @@ -1717,13 +1829,13 @@ handle_stdin(void) #ifndef SMALL if (fflag == 0) { maybe_warnx("unknown compression format"); - return; + goto out; } usize = cat_fd(header1, sizeof header1, &gsize, STDIN_FILENO); break; #endif case FT_GZIP: - usize = gz_uncompress(STDIN_FILENO, STDOUT_FILENO, + usize = gz_uncompress(STDIN_FILENO, STDOUT_FILENO, (char *)header1, sizeof header1, &gsize, "(stdin)"); break; #ifndef NO_BZIP2_SUPPORT @@ -1736,7 +1848,7 @@ handle_stdin(void) case FT_Z: if ((in = zdopen(STDIN_FILENO)) == NULL) { maybe_warnx("zopen of stdin"); - return; + goto out; } usize = zuncompress(in, stdout, (char *)header1, @@ -1763,53 +1875,58 @@ handle_stdin(void) print_verbage(NULL, NULL, usize, gsize); if (vflag && tflag) print_test("(stdin)", usize != -1); -#endif +#else + (void)&usize; +#endif +out: + infile_clear(); } static void handle_stdout(void) { - off_t gsize, usize; + off_t gsize; +#ifndef SMALL + off_t usize; struct stat sb; time_t systime; uint32_t mtime; int ret; -#ifndef SMALL + infile_set("(stdout)", 0); + if (fflag == 0 && isatty(STDOUT_FILENO)) { maybe_warnx("standard output is a terminal -- ignoring"); return; } -#endif + /* If stdin is a file use its mtime, otherwise use current time */ ret = fstat(STDIN_FILENO, &sb); - -#ifndef SMALL if (ret < 0) { maybe_warn("Can't stat stdin"); return; } -#endif - if (S_ISREG(sb.st_mode)) + if (S_ISREG(sb.st_mode)) { + infile_set("(stdout)", sb.st_size); mtime = (uint32_t)sb.st_mtime; - else { + } else { systime = time(NULL); -#ifndef SMALL if (systime == -1) { maybe_warn("time"); return; - } -#endif + } mtime = (uint32_t)systime; } - usize = gz_compress(STDIN_FILENO, STDOUT_FILENO, &gsize, "", mtime); + usize = +#endif + gz_compress(STDIN_FILENO, STDOUT_FILENO, &gsize, "", mtime); #ifndef SMALL if (vflag && !tflag && usize != -1 && gsize != -1) print_verbage(NULL, NULL, usize, gsize); -#endif +#endif } /* do what is asked for, for the path name */ @@ -1876,7 +1993,7 @@ handle_file(char *file, struct stat *sbp) off_t usize, gsize; char outfile[PATH_MAX]; - infile = file; + infile_set(file, sbp->st_size); if (dflag) { usize = file_uncompress(file, outfile, sizeof(outfile)); #ifndef SMALL @@ -1892,8 +2009,8 @@ handle_file(char *file, struct stat *sbp) return; usize = sbp->st_size; } + infile_clear(); - #ifndef SMALL if (vflag && !tflag) print_verbage(file, (cflag) ? NULL : outfile, usize, gsize); @@ -1946,7 +2063,9 @@ print_ratio(off_t in, off_t out, FILE *where) int len; diff = in - out/2; - if (diff <= 0) + if (in == 0 && out == 0) + percent10 = 0; + else if (diff < 0) /* * Output is more than double size of input! print -99.9% * Quite possibly we've failed to get the original size. @@ -2165,6 +2284,28 @@ read_retry(int fd, void *buf, size_t sz) return ret; } else if (ret == 0) { break; /* EOF */ + } + cp += ret; + left -= ret; + } + + return sz - left; +} + +static ssize_t +write_retry(int fd, const void *buf, size_t sz) +{ + const char *cp = buf; + size_t left = MIN(sz, (size_t) SSIZE_MAX); + + while (left > 0) { + ssize_t ret; + + ret = write(fd, cp, left); + if (ret == -1) { + return ret; + } else if (ret == 0) { + abort(); /* Can't happen */ } cp += ret; left -= ret; Modified: head/usr.bin/gzip/unbzip2.c ============================================================================== --- head/usr.bin/gzip/unbzip2.c Tue Nov 21 07:35:29 2017 (r326051) +++ head/usr.bin/gzip/unbzip2.c Tue Nov 21 08:14:30 2017 (r326052) @@ -1,4 +1,4 @@ -/* $NetBSD: unbzip2.c,v 1.13 2009/12/05 03:23:37 mrg Exp $ */ +/* $NetBSD: unbzip2.c,v 1.14 2017/08/04 07:27:08 mrg Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -65,6 +65,7 @@ unbzip2(int in, int out, char *pre, size_t prelen, off *bytes_in = prelen; while (ret == BZ_OK) { + check_siginfo(); if (bzs.avail_in == 0 && !end_of_file) { ssize_t n; @@ -73,6 +74,7 @@ unbzip2(int in, int out, char *pre, size_t prelen, off maybe_err("read"); if (n == 0) end_of_file = 1; + infile_newdata(n); bzs.next_in = inbuf; bzs.avail_in = n; if (bytes_in) Modified: head/usr.bin/gzip/unpack.c ============================================================================== --- head/usr.bin/gzip/unpack.c Tue Nov 21 07:35:29 2017 (r326051) +++ head/usr.bin/gzip/unpack.c Tue Nov 21 08:14:30 2017 (r326052) @@ -1,3 +1,6 @@ +/* $FreeBSD$ */ +/* $NetBSD: unpack.c,v 1.3 2017/08/04 07:27:08 mrg Exp $ */ + /*- * Copyright (c) 2009 Xin LI * All rights reserved. @@ -152,6 +155,9 @@ unpack_parse_header(int in, int out, char *pre, size_t ssize_t bytesread; /* Bytes read from the file */ int i, j, thisbyte; + if (prelen > sizeof hdr) + maybe_err("prelen too long"); + /* Prepend the header buffer if we already read some data */ if (prelen != 0) memcpy(hdr, pre, prelen); @@ -160,6 +166,7 @@ unpack_parse_header(int in, int out, char *pre, size_t bytesread = read(in, hdr + prelen, PACK_HEADER_LENGTH - prelen); if (bytesread < 0) maybe_err("Error reading pack header"); + infile_newdata(bytesread); accepted_bytes(bytes_in, PACK_HEADER_LENGTH); @@ -206,6 +213,7 @@ unpack_parse_header(int in, int out, char *pre, size_t accepted_bytes(bytes_in, unpackd->treelevels); if (unpackd->symbol_size > 256) maybe_errx("Bad symbol table"); + infile_newdata(unpackd->treelevels); /* Allocate for the symbol table, point symbol_eob at the beginning */ unpackd->symbol_eob = unpackd->symbol = calloc(1, unpackd->symbol_size); @@ -229,6 +237,7 @@ unpack_parse_header(int in, int out, char *pre, size_t maybe_errx("Symbol table truncated"); *unpackd->symbol_eob++ = (char)thisbyte; } + infile_newdata(unpackd->symbolsin[i]); accepted_bytes(bytes_in, unpackd->symbolsin[i]); } @@ -266,6 +275,8 @@ unpack_decode(const unpack_descriptor_t *unpackd, off_ while ((thisbyte = fgetc(unpackd->fpIn)) != EOF) { accepted_bytes(bytes_in, 1); + infile_newdata(1); + check_siginfo(); /* * Split one bit from thisbyte, from highest to lowest, Modified: head/usr.bin/gzip/unxz.c ============================================================================== --- head/usr.bin/gzip/unxz.c Tue Nov 21 07:35:29 2017 (r326051) +++ head/usr.bin/gzip/unxz.c Tue Nov 21 08:14:30 2017 (r326052) @@ -1,4 +1,4 @@ -/* $NetBSD: unxz.c,v 1.6 2016/01/29 15:19:01 christos Exp $ */ +/* $NetBSD: unxz.c,v 1.7 2017/08/04 07:27:08 mrg Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. @@ -56,6 +56,7 @@ unxz(int i, int o, char *pre, size_t prelen, off_t *by strm.avail_in = read(i, ibuf + prelen, sizeof(ibuf) - prelen); if (strm.avail_in == (size_t)-1) maybe_err("read failed"); + infile_newdata(strm.avail_in); strm.avail_in += prelen; *bytes_in = strm.avail_in; @@ -72,6 +73,7 @@ unxz(int i, int o, char *pre, size_t prelen, off_t *by strm.avail_out = sizeof(obuf); for (;;) { + check_siginfo(); if (strm.avail_in == 0) { strm.next_in = ibuf; strm.avail_in = read(i, ibuf, sizeof(ibuf)); @@ -83,6 +85,7 @@ unxz(int i, int o, char *pre, size_t prelen, off_t *by action = LZMA_FINISH; break; default: + infile_newdata(strm.avail_in); *bytes_in += strm.avail_in; break; } From owner-svn-src-head@freebsd.org Tue Nov 21 09:39: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 33B0FDE8F22; Tue, 21 Nov 2017 09:39:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 9F4F966B83; Tue, 21 Nov 2017 09:39:52 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id BBA9A107C8D; Tue, 21 Nov 2017 20:39:43 +1100 (AEDT) Date: Tue, 21 Nov 2017 20:39:42 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326031 - head/sys/fs/msdosfs In-Reply-To: <201711202138.vAKLcOxL080933@repo.freebsd.org> Message-ID: <20171121172511.W1210@besplex.bde.org> References: <201711202138.vAKLcOxL080933@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=C6q32NwkAAAA:8 a=WYKF7o43fX-Tu_o1TVkA:9 a=CjuIK1q_8ugA:10 a=d0GpIgV8JInD5zQLk0HG:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 09:39:53 -0000 On Mon, 20 Nov 2017, Conrad Meyer wrote: > Log: > msdosfs(5): Reflect READONLY attribute in file mode > > Msdosfs allows setting READONLY by clearing the owner write bit of the file > mode. (While here, correct the misspelling of S_IWUSR as VWRITE. No > functional change.) > > In msdosfs_getattr, intuitively reflect that READONLY attribute to userspace > in the file mode. > > Reported by: Karl Denninger > Sponsored by: Dell EMC Isilon This undoes only a small part of READONLY changes in r254627 (which are small part of of r253627). I think r254627 got the READONLY semantics wrong, but they were almost consistent and well documented in the commit log. Now they are more seriously inconsistent. r254627 did the following for READONLY: - support it as the file flag UF_READONLY, including normal read/write support for it as a file flag - remove checking it in msdosfs_access(), so that it it is ignored under FreeBSD except as a file flag that is not ignored by all other systems - neglect to remove setting of it as a permission in msdosfs_setattr(). This is inconsistent. - ignore it in msdosfs_getattr(), so that its null effect on permissions can be seen by stat(). This is consistent. The current commit does: - undo ignoring it in msdosfs_getattr(). This gives consistent inconsistency for chmod() and stat(). The flag is still write-only except for reading it as a flag and now for reading effects that it doesn't really have on permissions. The new bugs are only in 1 direction. E.g., for a file with permissions -rwxr-xr-x, chmod 0 used to change only the READONLY attribute (set it) and keep the permssions unchanged (because the READONLY attribute is write-only and the other permissions are read-only and fake and changes to them are ignored). The file is still writable by the owner, as shown by the w bit. Now stat() reports the permissions as -r-xr-xr-x, but the file is still writable by the owner, inconsistently with the w bit. In the other direction, the w bit is usually set for the owner in the fake permissions, so remains set in the usual case where the READONLY attribute is not set. However, if the w bit is intentionally not set in the fake permissions, this make files readonly by default and you wouldn't want the READONLY bit not being set to make files writable since it is the usual case for the READONLY bit to not be set. Also the problems with having only 1 READONLY bit but 3 r bits are larger in this direction -- if we make !READONLY to set w bits, then we get either insecurity by setting S_IWGTP and/or S_IWOTH, or complicated rules to prevent this. I checked what an old version of Cygwin does. It does the same as FreeBSD before r254627 (emulate READONLY using permisson(s) bit). Old Cygwin doesn't support file flags at all, but that made no difference for READONLY attribute relative to old FreeBSD which didn't support READONLY as a file flag. > Modified: head/sys/fs/msdosfs/msdosfs_vnops.c > ============================================================================== > --- head/sys/fs/msdosfs/msdosfs_vnops.c Mon Nov 20 20:55:41 2017 (r326030) > +++ head/sys/fs/msdosfs/msdosfs_vnops.c Mon Nov 20 21:38:24 2017 (r326031) > @@ -287,6 +287,8 @@ msdosfs_getattr(struct vop_getattr_args *ap) > vap->va_fileid = fileid; > > mode = S_IRWXU|S_IRWXG|S_IRWXO; > + if (dep->de_Attributes & ATTR_READONLY) > + mode &= ~(S_IWUSR|S_IWGRP|S_IWOTH); > vap->va_mode = mode & > (ap->a_vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); > vap->va_uid = pmp->pm_uid; > ... Now the mode reported is not the one that is used. Full diff for 254627 on msdosfs_vnops.c with comments on related parts: X Index: msdosfs_vnops.c X =================================================================== X --- msdosfs_vnops.c (revision 254626) X +++ msdosfs_vnops.c (revision 254627) X @@ -172,8 +172,7 @@ X if (error) X goto bad; X X - ndirent.de_Attributes = (ap->a_vap->va_mode & VWRITE) ? X - ATTR_ARCHIVE : ATTR_ARCHIVE | ATTR_READONLY; X + ndirent.de_Attributes = ATTR_ARCHIVE; X ndirent.de_LowerCase = 0; X ndirent.de_StartCluster = 0; X ndirent.de_FileSize = 0; X @@ -256,8 +255,7 @@ X mode_t file_mode; X accmode_t accmode = ap->a_accmode; X X - file_mode = (S_IXUSR|S_IXGRP|S_IXOTH) | (S_IRUSR|S_IRGRP|S_IROTH) | X - ((dep->de_Attributes & ATTR_READONLY) ? 0 : (S_IWUSR|S_IWGRP|S_IWOTH)); X + file_mode = S_IRWXU|S_IRWXG|S_IRWXO; X file_mode &= (vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); X X /* This is the main change to make the ATTR_READONLY write-only as a permission (by ignoring it in access checks). This also fixes some style bugs (extra parentheses, missing spaces around binary operators, and verboseness from not using standard macros). X @@ -266,8 +264,8 @@ X */ X if (accmode & VWRITE) { X switch (vp->v_type) { X + case VREG: X case VDIR: X - case VREG: X if (vp->v_mount->mnt_flag & MNT_RDONLY) X return (EROFS); X break; X @@ -322,10 +320,7 @@ X else X vap->va_fileid = (long)fileid; X X - if ((dep->de_Attributes & ATTR_READONLY) == 0) X - mode = S_IRWXU|S_IRWXG|S_IRWXO; X - else X - mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; X + mode = S_IRWXU|S_IRWXG|S_IRWXO; X vap->va_mode = mode & X (ap->a_vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); X vap->va_uid = pmp->pm_uid; This completes makeing ATTR_READONLY write-only as a permission (by ignoring it when reporting permissions via stat() and friends (mostly for userland while ignoring it for access is mostly for the kernel). This also fixes smaller style bugs (missing spaces and verboseness). This is what the current comment undoes, except it has different style bugs (the if-else expression is arguably clearer, but too verbose. I prefer using the conditional operator, but that would be differently verbose. A conditional operator is used in the next statement and it is clearly a style bug to mix if/else logic with that. X @@ -345,8 +340,14 @@ X vap->va_birthtime.tv_nsec = 0; X } X vap->va_flags = 0; X - if ((dep->de_Attributes & ATTR_ARCHIVE) == 0) X - vap->va_flags |= SF_ARCHIVED; X + if (dep->de_Attributes & ATTR_ARCHIVE) X + vap->va_flags |= UF_ARCHIVE; X + if (dep->de_Attributes & ATTR_HIDDEN) X + vap->va_flags |= UF_HIDDEN; X + if (dep->de_Attributes & ATTR_READONLY) X + vap->va_flags |= UF_READONLY; X + if (dep->de_Attributes & ATTR_SYSTEM) X + vap->va_flags |= UF_SYSTEM; X vap->va_gen = 0; X vap->va_blocksize = pmp->pm_bpcluster; X vap->va_bytes = The other attributes are too different to emulate using permissions, so we don't try to, and for some reason we stopped trying to for ATTR_READONLY too. X @@ -395,6 +396,18 @@ X #endif X return (EINVAL); X } X + X + /* X + * We don't allow setting attributes on the root directory. X + * The special case for the root directory is because before X + * FAT32, the root directory didn't have an entry for itself X + * (and was otherwise special). With FAT32, the root X + * directory is not so special, but still doesn't have an X + * entry for itself. X + */ X + if (vp->v_vflag & VV_ROOT) X + return (EINVAL); X + X if (vap->va_flags != VNOVAL) { X if (vp->v_mount->mnt_flag & MNT_RDONLY) X return (EROFS); X @@ -408,24 +421,29 @@ X * attributes. We ignored the access time and the X * read and execute bits. We were strict for the other X * attributes. X - * X - * Here we are strict, stricter than ufs in not allowing X - * users to attempt to set SF_SETTABLE bits or anyone to X - * set unsupported bits. However, we ignore attempts to X - * set ATTR_ARCHIVE for directories `cp -pr' from a more X - * sensible filesystem attempts it a lot. X */ X - if (vap->va_flags & SF_SETTABLE) { X - error = priv_check_cred(cred, PRIV_VFS_SYSFLAGS, 0); X - if (error) X - return (error); X - } X - if (vap->va_flags & ~SF_ARCHIVED) X + if (vap->va_flags & ~(UF_ARCHIVE | UF_HIDDEN | UF_READONLY | X + UF_SYSTEM)) X return EOPNOTSUPP; X - if (vap->va_flags & SF_ARCHIVED) X + if (vap->va_flags & UF_ARCHIVE) X + dep->de_Attributes |= ATTR_ARCHIVE; X + else X dep->de_Attributes &= ~ATTR_ARCHIVE; X - else if (!(dep->de_Attributes & ATTR_DIRECTORY)) X - dep->de_Attributes |= ATTR_ARCHIVE; X + if (vap->va_flags & UF_HIDDEN) X + dep->de_Attributes |= ATTR_HIDDEN; X + else X + dep->de_Attributes &= ~ATTR_HIDDEN; X + /* We don't allow changing the readonly bit on directories. */ X + if (vp->v_type != VDIR) { X + if (vap->va_flags & UF_READONLY) X + dep->de_Attributes |= ATTR_READONLY; X + else X + dep->de_Attributes &= ~ATTR_READONLY; X + } X + if (vap->va_flags & UF_SYSTEM) X + dep->de_Attributes |= ATTR_SYSTEM; X + else X + dep->de_Attributes &= ~ATTR_SYSTEM; X dep->de_flag |= DE_MODIFIED; X } X X @@ -489,21 +507,24 @@ X error = VOP_ACCESS(vp, VWRITE, cred, td); X } else X error = VOP_ACCESS(vp, VADMIN, cred, td); X - if (vp->v_type != VDIR) { X - if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 && X - vap->va_atime.tv_sec != VNOVAL) { X - dep->de_flag &= ~DE_ACCESS; X - timespec2fattime(&vap->va_atime, 0, X - &dep->de_ADate, NULL, NULL); X - } X - if (vap->va_mtime.tv_sec != VNOVAL) { X - dep->de_flag &= ~DE_UPDATE; X - timespec2fattime(&vap->va_mtime, 0, X - &dep->de_MDate, &dep->de_MTime, NULL); X - } X + if ((pmp->pm_flags & MSDOSFSMNT_NOWIN95) == 0 && X + vap->va_atime.tv_sec != VNOVAL) { X + dep->de_flag &= ~DE_ACCESS; X + timespec2fattime(&vap->va_atime, 0, X + &dep->de_ADate, NULL, NULL); X + } X + if (vap->va_mtime.tv_sec != VNOVAL) { X + dep->de_flag &= ~DE_UPDATE; X + timespec2fattime(&vap->va_mtime, 0, X + &dep->de_MDate, &dep->de_MTime, NULL); X + } X + /* X + * We don't set the archive bit when modifying the time of X + * a directory to emulate the Windows/DOS behavior. X + */ X + if (vp->v_type != VDIR) X dep->de_Attributes |= ATTR_ARCHIVE; X - dep->de_flag |= DE_MODIFIED; X - } X + dep->de_flag |= DE_MODIFIED; X } X /* X * DOS files only have the ability to have their writability Just after here is where r254627 negects to remove toggling of ATTR_READONLY for permissions changes. The current commit touches this, but only fixes a style bug: > @@ -502,7 +504,7 @@ msdosfs_setattr(struct vop_setattr_args *ap) > } > if (vp->v_type != VDIR) { > /* We ignore the read and execute bits. */ > - if (vap->va_mode & VWRITE) > + if (vap->va_mode & S_IWUSR) Style fix. > dep->de_Attributes &= ~ATTR_READONLY; > else > dep->de_Attributes |= ATTR_READONLY; ATTR_READONLY was only accessible via file flags APIs except for this. It is write-only here too. Most relevant parts of the commit log for r254627: X msdosfs_denode.c, X msdosfs_vnops.c: Add support for getting and setting X UF_HIDDEN, UF_SYSTEM and UF_READONLY X in MSDOSFS. X X It supported SF_ARCHIVED, but this has been X changed to be UF_ARCHIVE, which has the same X semantics as the DOS archive attribute instead X of inverse semantics like SF_ARCHIVED. X X After discussion with Bruce Evans, change X several things in the msdosfs behavior: X X Use UF_READONLY to indicate whether a file X is writeable instead of file permissions, but X don't actually enforce it. ^^^^^^^^^^^^^^^^^^^^^^^^^ I forget if I asked for not enforcing it or for removing the old enforcement. X X Refuse to change attributes on the root X directory, because it is special in FAT X filesystems, but allow most other attribute X changes on directories. X X Don't set the archive attribute on a directory X when its modification time is updated. X Windows and DOS don't set the archive attribute X in that scenario, so we are now bug-for-bug X compatible. r254627 adds support for UF_READONLY to many other file systems. msdosfs should be compatible with the others if possible. zfs and ffs are most interesting. I don't know what zfs does, but ffs doesn't need UF_READONLY for permissions so it is write only except for reading it as a flag there, and msdosfs is compatible with that. The main point of this is that you can do cp -p back and forth between file systems that support flags without destroying _all_ of the flags or always getting warnings or errors for copying failures. At least compatible flags can be copied safely. Flags that are actually used are unlikely to be compatible and might be unsafe to copy since they give difference secutity holes on different file systems. Bruce From owner-svn-src-head@freebsd.org Tue Nov 21 10:30: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 62DF8DEA189; Tue, 21 Nov 2017 10:30:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 2C143683E4; Tue, 21 Nov 2017 10:30:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 69AA8D6A519; Tue, 21 Nov 2017 21:30:31 +1100 (AEDT) Date: Tue, 21 Nov 2017 21:30:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326031 - head/sys/fs/msdosfs In-Reply-To: <20171121172511.W1210@besplex.bde.org> Message-ID: <20171121205309.F1819@besplex.bde.org> References: <201711202138.vAKLcOxL080933@repo.freebsd.org> <20171121172511.W1210@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=vMI8c4nMkKJgvOVjvggA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 10:30:39 -0000 On Tue, 21 Nov 2017, Bruce Evans wrote: > On Mon, 20 Nov 2017, Conrad Meyer wrote: > >> Log: >> msdosfs(5): Reflect READONLY attribute in file mode > ... > This undoes only a small part of READONLY changes in r254627 (which are > small part of of r253627). I think r254627 got the READONLY semantics > wrong, but they were almost consistent and well documented in the commit > log. Now they are more seriously inconsistent. > ... > Most relevant parts of the commit log for r254627: > > X msdosfs_denode.c, > X msdosfs_vnops.c: Add support for getting and setting > X UF_HIDDEN, UF_SYSTEM and UF_READONLY > X in MSDOSFS. > X X It supported SF_ARCHIVED, but this has been > X changed to be UF_ARCHIVE, which has the same > X semantics as the DOS archive attribute instead > X of inverse semantics like SF_ARCHIVED. > X X After discussion with Bruce Evans, change > X several things in the msdosfs behavior: > X X Use UF_READONLY to indicate whether a file > X is writeable instead of file permissions, but > X don't actually enforce it. > ^^^^^^^^^^^^^^^^^^^^^^^^^ > > I forget if I asked for not enforcing it or for removing the old enforcement. PS: I now see a good reason to not change the READONLY attribute using permissions (doing so is the inconsistent part of r254627), but perhaps we should complete the undoing of the changes to ignore READONLY for permissions. Under MSDOS or Windows, you have to use attrib to change attributes. This corresponds to having to use chflags(1) under FreeBSD. Allowing chmod(1) to change flags together with permissons gives confusing non-orthogonal behaviour. Only old FreeBSD and old(?) Cygwin have to do that since they don't have UF_READONLY (or even chflags). Example of non-orthogonal behaviour: the fake default permissions are -r-xr-xr-x and attributes are R. You try to change this using chmod u+w. This doesn't change the permissions, but it changes the attributes to 0. Then on rebooting to msdosfs, the R attribute has been lost. It is safer to require using only chflags(1 or 2) to change attributes. Bruce From owner-svn-src-head@freebsd.org Tue Nov 21 12:16: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 B551CDED2B1; Tue, 21 Nov 2017 12:16:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 7D43A6C273; Tue, 21 Nov 2017 12:16:53 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 0ECDE1A702D; Tue, 21 Nov 2017 23:16:45 +1100 (AEDT) Date: Tue, 21 Nov 2017 23:16:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: Bruce Evans , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325988 - head/sys/libkern In-Reply-To: Message-ID: <20171121220626.U2067@besplex.bde.org> References: <201711190031.vAJ0VE9m016670@repo.freebsd.org> <20171119173822.J974@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=MrTklNR_LiXMM65pMwMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 12:16:54 -0000 On Mon, 20 Nov 2017, Ed Maste wrote: > Hi Bruce, notes on a few of the points you raised (I'll look at others later): > > On 19 November 2017 at 04:07, Bruce Evans wrote: >> >> The vendor version is in libc/string. It has been ANSIfied, but the >> libkern version has large churning to "optimize" it. It is the libkern >> version that should have been optimized, since bcmp is unimportant in >> the kernel and in most applications, but applications have a wider range >> so a few might benefit from optimizing it. > > I presume you meant "it is the _libc_ version that should have been > optimized", but could also read this as a distinction between > optimized and scare-quotes "optimized." Yes, optimize the libc version first and usually throw away the optimizations since they are negative or too MD or too hard to maintain. Also, clean up libc versions before changing libkern versions. >> bcmp is actually optimized >> in the kernel in support.[sS] for all arches except powerpc and riscv, >> so optimizing the kernel MI version of it is especially unimportant. >> In libc where MD optimizations are more important, they are also not >> done for arm, arm64 and sparc64. > > This could make a nice small project for someone to take on. A nice large project :-). I once tried it for bcopy and bzero, but gave up ~15 years ago when the MD variations became too complicated. The variations would be much larger now. Simple "rep movsb" is now almost best, except it takes too long to start up so even a naive C loop should beat it for sizes up to quite large values (nearly 1K). AVX might be best, but is less portable, and sometimes has overheating problems which are avoided by throttling it. The naive C loop might be fastest with a non-naive compiler that generates AVX for it, but how is the compiler going to know if its target hardware will throttle AVX when the program is run? ... >> - libc version copyright comment not marked for indent protection using >> "/*-" (this has been subverted to have another meaning which I forget). > > I don't believe there's another meaning. IIRC imp@ has pointed out > that it means precisely what you've mentioned above. "/*-" was originally just the normal style for indent protection. indent also supports "/**" for this. It is not easily to find copyrights without a unique markup, so IIRC the "/*-" form was reserved for copyrights, and other comments that used this were changed to use "/**". I prefer the "/*-" form and don't like it to be restricted to copyright comments. Actually, I seem to have remembered incorrectly. In kern/*.c, there are a few old '/*-' comments (there never were very many), and most '/**' comments are for doxygen. style(9) has fairly bad documentation of this. It only mentions the markup use of '/*-' for copyright comments. Bruce From owner-svn-src-head@freebsd.org Tue Nov 21 12: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 CBBC1DEDF5C; Tue, 21 Nov 2017 12:44:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id 938456D166; Tue, 21 Nov 2017 12:44:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 50C6FD4E556; Tue, 21 Nov 2017 23:44:23 +1100 (AEDT) Date: Tue, 21 Nov 2017 23:44:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326037 - head/share/mk In-Reply-To: <201711202241.vAKMfMpO008434@repo.freebsd.org> Message-ID: <20171121233000.M2067@besplex.bde.org> References: <201711202241.vAKMfMpO008434@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cK6QihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=8AV8jQmTcnAfOZtTT8cA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 12:44:31 -0000 On Mon, 20 Nov 2017, Warner Losh wrote: > Author: imp > Date: Mon Nov 20 22:41:22 2017 > New Revision: 326037 > URL: https://svnweb.freebsd.org/changeset/base/326037 > > Log: > Add -mno-avx2 for clang as well as -mno-avx. We don't want either of > them when asking for no SIMD. Is this needed. For SSE, -mno-sse implies -mno-sse[2,3,4,...] so an multiple set of no-sse* flags are not needed (I have only checked this for sse2). Multiple no-sse* flags are also not used. > Modified: head/share/mk/bsd.cpu.mk > ============================================================================== > --- head/share/mk/bsd.cpu.mk Mon Nov 20 22:27:33 2017 (r326036) > +++ head/share/mk/bsd.cpu.mk Mon Nov 20 22:41:22 2017 (r326037) > @@ -393,7 +393,7 @@ CFLAGS += ${_CPUCFLAGS} > # (-mfpmath= is not supported) > # > .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" > -CFLAGS_NO_SIMD.clang= -mno-avx > +CFLAGS_NO_SIMD.clang= -mno-avx -mno-avx2 > CFLAGS_NO_SIMD= -mno-mmx -mno-sse Nearby example of non-use for SSE. > .endif > CFLAGS_NO_SIMD += ${CFLAGS_NO_SIMD.${COMPILER_TYPE}} Testing shows that -mavx2 -mno-avx kills all AVX for clang in an example that only generates AVX instructions (-mavx2 enabls these as a subset). Bruce From owner-svn-src-head@freebsd.org Tue Nov 21 13: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 51D61DEE9E3; Tue, 21 Nov 2017 13:17:41 +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 1F3236E243; Tue, 21 Nov 2017 13:17:41 +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 vALDHef5073977; Tue, 21 Nov 2017 13:17:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALDHeMc073976; Tue, 21 Nov 2017 13:17:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711211317.vALDHeMc073976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Nov 2017 13:17:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326055 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 326055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 13:17:41 -0000 Author: markj Date: Tue Nov 21 13:17:40 2017 New Revision: 326055 URL: https://svnweb.freebsd.org/changeset/base/326055 Log: Allow for fictitious physical pages in vm_page_scan_contig(). Some drm2 drivers will set PG_FICTITIOUS in physical pages in order to satisfy the OBJT_MGTDEVICE object interface, so a scan may encounter fictitous pages. For now, allow for this possibility; such pages will be skipped later in the scan since they are wired. Reported by: avg Reviewed by: kib MFC after: 1 week Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Nov 21 10:19:33 2017 (r326054) +++ head/sys/vm/vm_page.c Tue Nov 21 13:17:40 2017 (r326055) @@ -2065,8 +2065,10 @@ vm_page_scan_contig(u_long npages, vm_page_t m_start, run_len = 0; m_mtx = NULL; for (m = m_start; m < m_end && run_len < npages; m += m_inc) { - KASSERT((m->flags & (PG_FICTITIOUS | PG_MARKER)) == 0, - ("page %p is PG_FICTITIOUS or PG_MARKER", m)); + KASSERT((m->flags & PG_MARKER) == 0, + ("page %p is PG_MARKER", m)); + KASSERT((m->flags & PG_FICTITIOUS) == 0 || m->wire_count == 1, + ("fictitious page %p has invalid wire count", m)); /* * If the current page would be the start of a run, check its From owner-svn-src-head@freebsd.org Tue Nov 21 13:19: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 C53A8DEEA7D; Tue, 21 Nov 2017 13:19:39 +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 9245D6E3AB; Tue, 21 Nov 2017 13:19:39 +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 vALDJch8074077; Tue, 21 Nov 2017 13:19:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALDJcNt074076; Tue, 21 Nov 2017 13:19:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201711211319.vALDJcNt074076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 21 Nov 2017 13:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326056 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 326056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 13:19:39 -0000 Author: andrew Date: Tue Nov 21 13:19:38 2017 New Revision: 326056 URL: https://svnweb.freebsd.org/changeset/base/326056 Log: When fpcurthread is not the current thread it may be non-NULL. In this case another thread has had the VFP unit enabled and will have its state in the VFP registers along with it stored in memory. As such we don't need to store the state, but do need to zero the fpcurthread pointer to stop the VFP driver from using the enable fast path. Reported by: emaste Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/vfp.c Modified: head/sys/arm64/arm64/vfp.c ============================================================================== --- head/sys/arm64/arm64/vfp.c Tue Nov 21 13:17:40 2017 (r326055) +++ head/sys/arm64/arm64/vfp.c Tue Nov 21 13:19:38 2017 (r326056) @@ -273,11 +273,8 @@ fpu_kern_enter(struct thread *td, struct fpu_kern_ctx critical_enter(); if (curthread == PCPU_GET(fpcurthread)) { vfp_save_state(curthread, pcb); - PCPU_SET(fpcurthread, NULL); - } else { - KASSERT(PCPU_GET(fpcurthread) == NULL, - ("invalid fpcurthread")); } + PCPU_SET(fpcurthread, NULL); vfp_enable(); pcb->pcb_fpflags |= PCB_FP_KERN | PCB_FP_NOSAVE | From owner-svn-src-head@freebsd.org Tue Nov 21 13:55: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 AC31ADEFA2D; Tue, 21 Nov 2017 13:55:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72E1A6F8B3; Tue, 21 Nov 2017 13:55:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vALDtAoe090631; Tue, 21 Nov 2017 13:55:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALDtA8c090630; Tue, 21 Nov 2017 13:55:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711211355.vALDtA8c090630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 21 Nov 2017 13:55:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326057 - head/usr.sbin/vidcontrol X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/vidcontrol X-SVN-Commit-Revision: 326057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 13:55:11 -0000 Author: emaste Date: Tue Nov 21 13:55:10 2017 New Revision: 326057 URL: https://svnweb.freebsd.org/changeset/base/326057 Log: vidcontrol: correct history size error message `vidcontrol -h 0` is acceptable, so be explicit that it's less than zero that is not allowed. Reported by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/vidcontrol/vidcontrol.c Modified: head/usr.sbin/vidcontrol/vidcontrol.c ============================================================================== --- head/usr.sbin/vidcontrol/vidcontrol.c Tue Nov 21 13:19:38 2017 (r326056) +++ head/usr.sbin/vidcontrol/vidcontrol.c Tue Nov 21 13:55:10 2017 (r326057) @@ -1359,7 +1359,7 @@ set_history(char *opt) if ((*opt == '\0') || size < 0) { revert(); - errx(1, "argument must be a positive number"); + errx(1, "argument must not be less than zero"); } if (ioctl(0, CONS_HISTORY, &size) == -1) { From owner-svn-src-head@freebsd.org Tue Nov 21 13:56: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 B08C9DEFAC3; Tue, 21 Nov 2017 13:56:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DBD96FA1C; Tue, 21 Nov 2017 13:56:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vALDuUwS090720; Tue, 21 Nov 2017 13:56:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALDuUEt090719; Tue, 21 Nov 2017 13:56:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711211356.vALDuUEt090719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 21 Nov 2017 13:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326058 - head/sys/dev/iser X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/iser X-SVN-Commit-Revision: 326058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 13:56:31 -0000 Author: hselasky Date: Tue Nov 21 13:56:30 2017 New Revision: 326058 URL: https://svnweb.freebsd.org/changeset/base/326058 Log: Make sure all initialized mutexes are destroyed in the iser module, else WITNESS will panic. Prefix all mutex names with "iser_" to prevent future WITNESS issues. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/iser/icl_iser.c Modified: head/sys/dev/iser/icl_iser.c ============================================================================== --- head/sys/dev/iser/icl_iser.c Tue Nov 21 13:55:10 2017 (r326057) +++ head/sys/dev/iser/icl_iser.c Tue Nov 21 13:56:30 2017 (r326058) @@ -257,9 +257,9 @@ iser_new_conn(const char *name, struct mtx *lock) cv_init(&iser_conn->up_cv, "iser_cv"); sx_init(&iser_conn->state_mutex, "iser_conn_state_mutex"); - mtx_init(&iser_conn->ib_conn.beacon.flush_lock, "flush_lock", NULL, MTX_DEF); + mtx_init(&iser_conn->ib_conn.beacon.flush_lock, "iser_flush_lock", NULL, MTX_DEF); cv_init(&iser_conn->ib_conn.beacon.flush_cv, "flush_cv"); - mtx_init(&iser_conn->ib_conn.lock, "lock", NULL, MTX_DEF); + mtx_init(&iser_conn->ib_conn.lock, "iser_lock", NULL, MTX_DEF); ic = &iser_conn->icl_conn; ic->ic_lock = lock; @@ -277,6 +277,7 @@ iser_conn_free(struct icl_conn *ic) struct iser_conn *iser_conn = icl_to_iser_conn(ic); iser_conn_release(ic); + mtx_destroy(&iser_conn->ib_conn.lock); cv_destroy(&iser_conn->ib_conn.beacon.flush_cv); mtx_destroy(&iser_conn->ib_conn.beacon.flush_lock); sx_destroy(&iser_conn->state_mutex); @@ -512,7 +513,7 @@ icl_iser_load(void) /* device init is called only after the first addr resolution */ sx_init(&ig.device_list_mutex, "global_device_lock"); INIT_LIST_HEAD(&ig.device_list); - mtx_init(&ig.connlist_mutex, "global_conn_lock", NULL, MTX_DEF); + mtx_init(&ig.connlist_mutex, "iser_global_conn_lock", NULL, MTX_DEF); INIT_LIST_HEAD(&ig.connlist); sx_init(&ig.close_conns_mutex, "global_close_conns_lock"); From owner-svn-src-head@freebsd.org Tue Nov 21 14:59:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A67D0DF0E2C; Tue, 21 Nov 2017 14:59:25 +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 80863717C5; Tue, 21 Nov 2017 14:59:25 +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 vALExOCd016114; Tue, 21 Nov 2017 14:59:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALExN0c016106; Tue, 21 Nov 2017 14:59:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711211459.vALExN0c016106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Nov 2017 14:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326060 - in head: share/man/man9 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 326060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 14:59:25 -0000 Author: markj Date: Tue Nov 21 14:59:23 2017 New Revision: 326060 URL: https://svnweb.freebsd.org/changeset/base/326060 Log: Clean up the SYSINIT_FLAGS definitions for rwlock(9) and rmlock(9). Avoid duplication in their macro definitions, and document them. No functional change intended. MFC after: 1 week Modified: head/share/man/man9/Makefile head/share/man/man9/rmlock.9 head/share/man/man9/rwlock.9 head/share/man/man9/sx.9 head/sys/kern/kern_rmlock.c head/sys/kern/kern_rwlock.c head/sys/sys/rmlock.h head/sys/sys/rwlock.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Nov 21 13:59:40 2017 (r326059) +++ head/share/man/man9/Makefile Tue Nov 21 14:59:23 2017 (r326060) @@ -1548,6 +1548,7 @@ MLINKS+=rmlock.9 rm_assert.9 \ rmlock.9 rm_runlock.9 \ rmlock.9 rm_sleep.9 \ rmlock.9 RM_SYSINIT.9 \ + rmlock.9 RM_SYSINIT_FLAGS.9 \ rmlock.9 rm_try_rlock.9 \ rmlock.9 rm_wlock.9 \ rmlock.9 rm_wowned.9 \ @@ -1580,6 +1581,7 @@ MLINKS+=rwlock.9 rw_assert.9 \ rwlock.9 rw_unlock.9 \ rwlock.9 rw_sleep.9 \ rwlock.9 RW_SYSINIT.9 \ + rwlock.9 RW_SYSINIT_FLAGS.9 \ rwlock.9 rw_try_rlock.9 \ rwlock.9 rw_try_upgrade.9 \ rwlock.9 rw_try_wlock.9 \ @@ -1788,6 +1790,7 @@ MLINKS+=sx.9 sx_assert.9 \ sx.9 sx_slock_sig.9 \ sx.9 sx_sunlock.9 \ sx.9 SX_SYSINIT.9 \ + sx.9 SX_SYSINIT_FLAGS.9 \ sx.9 sx_try_slock.9 \ sx.9 sx_try_upgrade.9 \ sx.9 sx_try_xlock.9 \ Modified: head/share/man/man9/rmlock.9 ============================================================================== --- head/share/man/man9/rmlock.9 Tue Nov 21 13:59:40 2017 (r326059) +++ head/share/man/man9/rmlock.9 Tue Nov 21 14:59:23 2017 (r326060) @@ -26,7 +26,7 @@ .\" $FreeBSD$ .\" .\" Based on rwlock.9 man page -.Dd December 13, 2014 +.Dd November 11, 2017 .Dt RMLOCK 9 .Os .Sh NAME @@ -42,7 +42,8 @@ .Nm rm_wowned , .Nm rm_sleep , .Nm rm_assert , -.Nm RM_SYSINIT +.Nm RM_SYSINIT , +.Nm RM_SYSINIT_FLAGS .Nd kernel reader/writer lock optimized for read-mostly access patterns .Sh SYNOPSIS .In sys/param.h @@ -74,7 +75,8 @@ .Ft void .Fn rm_assert "struct rmlock *rm" "int what" .In sys/kernel.h -.Fn RM_SYSINIT "name" "struct rmlock *rm" "const char *desc" "int opts" +.Fn RM_SYSINIT "name" "struct rmlock *rm" "const char *desc" +.Fn RM_SYSINIT_FLAGS "name" "struct rmlock *rm" "const char *desc" "int flags" .Sh DESCRIPTION Read-mostly locks allow shared access to protected data by multiple threads, or exclusive access by a single thread. Modified: head/share/man/man9/rwlock.9 ============================================================================== --- head/share/man/man9/rwlock.9 Tue Nov 21 13:59:40 2017 (r326059) +++ head/share/man/man9/rwlock.9 Tue Nov 21 14:59:23 2017 (r326060) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2016 +.Dd November 11, 2017 .Dt RWLOCK 9 .Os .Sh NAME @@ -45,7 +45,8 @@ .Nm rw_initialized , .Nm rw_wowned , .Nm rw_assert , -.Nm RW_SYSINIT +.Nm RW_SYSINIT , +.Nm RW_SYSINIT_FLAGS .Nd kernel reader/writer lock .Sh SYNOPSIS .In sys/param.h @@ -88,6 +89,7 @@ .Fn rw_assert "const struct rwlock *rw" "int what" .In sys/kernel.h .Fn RW_SYSINIT "name" "struct rwlock *rw" "const char *desc" +.Fn RW_SYSINIT_FLAGS "name" "struct rwlock *rw" "const char *desc" "int flags" .Sh DESCRIPTION Reader/writer locks allow shared access to protected data by multiple threads, or exclusive access by a single thread. Modified: head/share/man/man9/sx.9 ============================================================================== --- head/share/man/man9/sx.9 Tue Nov 21 13:59:40 2017 (r326059) +++ head/share/man/man9/sx.9 Tue Nov 21 14:59:23 2017 (r326060) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2016 +.Dd November 11, 2017 .Dt SX 9 .Os .Sh NAME @@ -49,7 +49,8 @@ .Nm sx_xholder , .Nm sx_xlocked , .Nm sx_assert , -.Nm SX_SYSINIT +.Nm SX_SYSINIT , +.Nm SX_SYSINIT_FLAGS .Nd kernel shared/exclusive lock .Sh SYNOPSIS .In sys/param.h @@ -95,7 +96,8 @@ .Ft void .Fn sx_assert "const struct sx *sx" "int what" .In sys/kernel.h -.Fn SX_SYSINIT "name" "struct sx *sx" "const char *description" +.Fn SX_SYSINIT "name" "struct sx *sx" "const char *desc" +.Fn SX_SYSINIT_FLAGS "name" "struct sx *sx" "const char *desc" "int flags" .Sh DESCRIPTION Shared/exclusive locks are used to protect data that are read far more often than they are written. @@ -295,6 +297,12 @@ but with an additional argument, .Fa name , that is used in generating unique variable names for the related structures associated with the lock and the sysinit routine. +The +.Fn SX_SYSINIT_FLAGS +macro can similarly be used to initialize a given +.Fa sx +lock using +.Fn sx_init_flags . .Pp A thread may not hold both a shared lock and an exclusive lock on the same lock simultaneously; Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Tue Nov 21 13:59:40 2017 (r326059) +++ head/sys/kern/kern_rmlock.c Tue Nov 21 14:59:23 2017 (r326060) @@ -338,17 +338,10 @@ rm_wowned(const struct rmlock *rm) void rm_sysinit(void *arg) { - struct rm_args *args = arg; + struct rm_args *args; - rm_init(args->ra_rm, args->ra_desc); -} - -void -rm_sysinit_flags(void *arg) -{ - struct rm_args_flags *args = arg; - - rm_init_flags(args->ra_rm, args->ra_desc, args->ra_opts); + args = arg; + rm_init_flags(args->ra_rm, args->ra_desc, args->ra_flags); } static int Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Tue Nov 21 13:59:40 2017 (r326059) +++ head/sys/kern/kern_rwlock.c Tue Nov 21 14:59:23 2017 (r326060) @@ -240,16 +240,9 @@ _rw_destroy(volatile uintptr_t *c) void rw_sysinit(void *arg) { - struct rw_args *args = arg; + struct rw_args *args; - rw_init((struct rwlock *)args->ra_rw, args->ra_desc); -} - -void -rw_sysinit_flags(void *arg) -{ - struct rw_args_flags *args = arg; - + args = arg; rw_init_flags((struct rwlock *)args->ra_rw, args->ra_desc, args->ra_flags); } Modified: head/sys/sys/rmlock.h ============================================================================== --- head/sys/sys/rmlock.h Tue Nov 21 13:59:40 2017 (r326059) +++ head/sys/sys/rmlock.h Tue Nov 21 14:59:23 2017 (r326060) @@ -103,35 +103,21 @@ void _rm_assert(const struct rmlock *rm, int what, con struct rm_args { struct rmlock *ra_rm; const char *ra_desc; + int ra_flags; }; -struct rm_args_flags { - struct rmlock *ra_rm; - const char *ra_desc; - int ra_opts; -}; - -#define RM_SYSINIT(name, rm, desc) \ +#define RM_SYSINIT_FLAGS(name, rm, desc, flags) \ static struct rm_args name##_args = { \ (rm), \ (desc), \ + (flags), \ }; \ SYSINIT(name##_rm_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ rm_sysinit, &name##_args); \ SYSUNINIT(name##_rm_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ rm_destroy, (rm)) - -#define RM_SYSINIT_FLAGS(name, rm, desc, opts) \ - static struct rm_args name##_args = { \ - (rm), \ - (desc), \ - (opts), \ - }; \ - SYSINIT(name##_rm_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ - rm_sysinit_flags, &name##_args); \ - SYSUNINIT(name##_rm_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ - rm_destroy, (rm)) +#define RM_SYSINIT(name, rm, desc) RM_SYSINIT_FLAGS(name, rm, desc, 0) #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) #define RA_LOCKED LA_LOCKED Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Tue Nov 21 13:59:40 2017 (r326059) +++ head/sys/sys/rwlock.h Tue Nov 21 14:59:23 2017 (r326060) @@ -220,35 +220,21 @@ void __rw_assert(const volatile uintptr_t *c, int what struct rw_args { void *ra_rw; const char *ra_desc; -}; - -struct rw_args_flags { - void *ra_rw; - const char *ra_desc; int ra_flags; }; -#define RW_SYSINIT(name, rw, desc) \ +#define RW_SYSINIT_FLAGS(name, rw, desc, flags) \ static struct rw_args name##_args = { \ (rw), \ (desc), \ + (flags), \ }; \ SYSINIT(name##_rw_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ rw_sysinit, &name##_args); \ SYSUNINIT(name##_rw_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ _rw_destroy, __DEVOLATILE(void *, &(rw)->rw_lock)) - -#define RW_SYSINIT_FLAGS(name, rw, desc, flags) \ - static struct rw_args_flags name##_args = { \ - (rw), \ - (desc), \ - (flags), \ - }; \ - SYSINIT(name##_rw_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ - rw_sysinit_flags, &name##_args); \ - SYSUNINIT(name##_rw_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ - _rw_destroy, __DEVOLATILE(void *, &(rw)->rw_lock)) +#define RW_SYSINIT(name, rw, desc) RW_SYSINIT_FLAGS(name, rw, desc, 0) /* * Options passed to rw_init_flags(). From owner-svn-src-head@freebsd.org Tue Nov 21 15:03: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 207F5DF103F; Tue, 21 Nov 2017 15:03:40 +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 E0FFF71C30; Tue, 21 Nov 2017 15:03:39 +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 vALF3dqx019940; Tue, 21 Nov 2017 15:03:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALF3dVu019939; Tue, 21 Nov 2017 15:03:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711211503.vALF3dVu019939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Nov 2017 15:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326061 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid X-SVN-Commit-Revision: 326061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 15:03:40 -0000 Author: markj Date: Tue Nov 21 15:03:38 2017 New Revision: 326061 URL: https://svnweb.freebsd.org/changeset/base/326061 Log: Don't assume that we can resolve "main" in the ksh executable. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d Tue Nov 21 14:59:23 2017 (r326060) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d Tue Nov 21 15:03:38 2017 (r326061) @@ -33,6 +33,6 @@ * */ -pid$1:a.out:main:beginning +pid$1:a.out::beginning { } From owner-svn-src-head@freebsd.org Tue Nov 21 15:38: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 00759DF1C75; Tue, 21 Nov 2017 15:38:55 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x234.google.com (mail-it0-x234.google.com [IPv6:2607:f8b0:4001:c0b::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BD06472E5C; Tue, 21 Nov 2017 15:38:54 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x234.google.com with SMTP id x13so2505002iti.4; Tue, 21 Nov 2017 07:38:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ccxZjlY0Q6O54mYASg7fcTmkzTdSVC/knmTexMuC3mA=; b=O2/msooyeDHu9bluc6aRZvfsg99NFv3lirLVezrdYEXHMcFbBA4FD6ogZu7QWO87C1 diBKXHE1TVjVSfSzn3d6gyLy80CKqYlW7SPaOpzH8XT1xZeWOLBPzjIVSYmCzE4YhZHP 5JilyAfvlZAFFf3qUIjnLb2832vndMr5BXTeUE/I7NGxYUiS5K/Vys3o5CHh4U2R8Tw2 0/5EEJvRbA9sSHoZyTk2cs+8xLLVHsdgneuZAxSjd1OikAHKuBJGl5iLgl4Ai/eYkAw5 m1pDG3wWgjLTc9hoDNZ4rTv/VZQ7yA7GAWyiySX96dI7O25ap8g4fawZRjpoJfNBXr27 tujA== 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=ccxZjlY0Q6O54mYASg7fcTmkzTdSVC/knmTexMuC3mA=; b=Bkzuw9V5oXga1iTqK0IHrXraZ7RUK2fDId5nb8HgSJhtZtGmAsUIk6I8xZGW5qrEpQ Qs/rEzrVGPEA3yeM7f0XVQdAPsMyQhDdSxB1vh6F4Gm8bfJSM6YBqjo4VFMnBDlNPNgA eQ4xGWCt71QMH98WY1JDdOh4y0hkGubj5RIJbx5kcR15A7kMHD2AgzVzKtHaPrPOVkLs li6lJeu0cKwnNwDXcnWa1Vrv6Rttci2nd63QlKT9Prfo6rd5nAPJB4si/juAQJr2mSBg MPRqynNHbJ8gNsrro2Lq+bsfwo/CsrWeCSXDJhA1ySKkT2pjBKReiKGAHQSgbpzhr1Jh BK7w== X-Gm-Message-State: AJaThX4gffhdABSV4vZl1UW5hIDbz/VG4BFZxAd/DWn8y/7CKQNugxqq rw7b4USP1KdT+Dc3jWlAE9jEiD5iDqLxD/IzLfYg5g== X-Google-Smtp-Source: AGs4zMaEbBPfSf4xHrexhmPFk3G4gI5gjza9lkNJKLizaNTWXifJEIStoatGxzRCJwpAWSIXqDs9AmDbhndLEJkZPbI= X-Received: by 10.36.93.72 with SMTP id w69mr2417881ita.103.1511278733976; Tue, 21 Nov 2017 07:38:53 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.14.208 with HTTP; Tue, 21 Nov 2017 07:38:33 -0800 (PST) In-Reply-To: <201703311804.v2VI4ZTF078937@repo.freebsd.org> References: <201703311804.v2VI4ZTF078937@repo.freebsd.org> From: Ed Maste Date: Tue, 21 Nov 2017 10:38:33 -0500 X-Google-Sender-Auth: 50MsRMJ7AD3ybi-6vhIID4PHais Message-ID: Subject: Re: svn commit: r316336 - head/sys/dev/vnic To: Zbigniew Bodek Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 15:38:55 -0000 On 31 March 2017 at 14:04, Zbigniew Bodek wrote: > Author: zbb > Date: Fri Mar 31 18:04:34 2017 > New Revision: 316336 > URL: https://svnweb.freebsd.org/changeset/base/316336 > > Log: > Rework BGX detection to support both new and old firmware Should this be merged to stable/11 as well? From owner-svn-src-head@freebsd.org Tue Nov 21 15:56: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 B32E9DF2959; Tue, 21 Nov 2017 15:56:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE2D73BD7; Tue, 21 Nov 2017 15:56:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x242.google.com with SMTP id x28so2545613ita.0; Tue, 21 Nov 2017 07:56:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ugMiJy0rwQeYef/1g/uJ3rdQ92J0z96RFttwNnvOXIo=; b=qwaKcSW8wRl4B0EK+n1rPpihqR9FJ6ZUIpUAoa1XgjFANwcsQy8FDfpez4UMP5WWuw y2J1YAHQWxc0I70Do5cpcnQThtw025MvU7M3/8EVsD90tqWv0euXMvj9d56yYeFJbnjN alV+cQ+hvtnN2nHnn+IhqXXVz5oCsHtZoGWtQehsZiLgmII3lLXwvrO2musMFU9rbYWk 6gNmtZKpTCKwIb0l7szOrNmMrVolWZqCpzYvgr9L5D7+MPJoHrwquYbCVAS7yG5MW0bh EzFlkvox7MzCzjq5LM9Y+Yp5Um8+5SFqg9jZ/NUPPomEhVtudmc+eLKtrEpWSVQSyj4R KJXA== 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=ugMiJy0rwQeYef/1g/uJ3rdQ92J0z96RFttwNnvOXIo=; b=OEuaZeSQdhhPCJVxZjfcCe4WQNqEVo/kDnfmU4n7B3KYmbobHI2U0G6wM40cYau8ve 12x24VoXgR4ORot5XP6Omgea8Cd2HCngX7YA9DXoIWKIvvm8qS3qThvVoiMJ/8M6bjQM +y+5QrpbgnkdShAQuUMr7oHk+tqWxmnznDZuKmhNbftWLDaQCgDrPf8ze5AXieP4hlAH P16ExLpb3eE6741Od/8bY2Fh+vH3u9NEEr+0g77YBLgnBynygQH4Njai4FmNAhZ0wLLm 79wVrZfWBnv2TkQC4seIs5G5kYfRi1CFO2cUK+5dwk1zc6PHI5YOe1EnKfI7sVcEPvb5 o7gg== X-Gm-Message-State: AJaThX5MMX75Wu+vFvDOKfRBgjyY9GZuaZ34z+HV/NfZClY2l+p8YyY9 suYVYj2L2Y+rPBVbxDb3d1ExusXAjU4eLxEEJZSZgA== X-Google-Smtp-Source: AGs4zMacDLtFqIqNSllB88SQbnO1fPr75MTYOcM66EYWDWKkVt3Q9IQ1QfNTjX+95p9hJOis96OvlZGQAlyMXjY5WkE= X-Received: by 10.36.225.136 with SMTP id n130mr2499540ith.20.1511279805744; Tue, 21 Nov 2017 07:56:45 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.14.208 with HTTP; Tue, 21 Nov 2017 07:56:25 -0800 (PST) In-Reply-To: <201701311612.v0VGCVsd038606@repo.freebsd.org> References: <201701311612.v0VGCVsd038606@repo.freebsd.org> From: Ed Maste Date: Tue, 21 Nov 2017 10:56:25 -0500 X-Google-Sender-Auth: CajWNeeKjabjPRWUIiKqKef6vP4 Message-ID: Subject: Re: svn commit: r313019 - in head/sys: dev/e1000 dev/vnic net To: "Stephen J. Kiernan" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 15:56:46 -0000 On 31 January 2017 at 11:12, Stephen J. Kiernan wrote: > Author: stevek > Date: Tue Jan 31 16:12:31 2017 > New Revision: 313019 > URL: https://svnweb.freebsd.org/changeset/base/313019 > > Log: > Add the folowing set accessor functions for recently-added members of ifnet > structure: Should we MFC the accessor functions to stable/11 (but not require that they be used), to ease driver MFCs? From owner-svn-src-head@freebsd.org Tue Nov 21 16:00: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 BAAD9DF2B19; Tue, 21 Nov 2017 16:00:19 +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 8750473E48; Tue, 21 Nov 2017 16:00:19 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vALG0Ika041642; Tue, 21 Nov 2017 16:00:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALG0Icu041641; Tue, 21 Nov 2017 16:00:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711211600.vALG0Icu041641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Nov 2017 16:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326063 - head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Commit-Revision: 326063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 16:00:19 -0000 Author: markj Date: Tue Nov 21 16:00:18 2017 New Revision: 326063 URL: https://svnweb.freebsd.org/changeset/base/326063 Log: Annotate usdt/tst.eliminate.ksh as EXFAIL. It appears to depend on some behaviour specific to the Sun link editor. MFC after: 1 week Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Tue Nov 21 15:34:25 2017 (r326062) +++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Tue Nov 21 16:00:18 2017 (r326063) @@ -174,6 +174,9 @@ exclude EXFAIL common/usdt/tst.badguess.ksh exclude EXFAIL common/usdt/tst.guess32.ksh exclude EXFAIL common/usdt/tst.guess64.ksh +# Depends on non-standard static linker behaviour. +exclude EXFAIL common/usdt/tst.eliminate.ksh + # Generated headers include , so _DTRACE_VERSION is always defined. exclude EXFAIL common/usdt/tst.nodtrace.ksh From owner-svn-src-head@freebsd.org Tue Nov 21 16:03: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 A5956DF2D29; Tue, 21 Nov 2017 16:03:22 +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 7F8E77423B; Tue, 21 Nov 2017 16:03:22 +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 vALG3L9X045716; Tue, 21 Nov 2017 16:03:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALG3LVu045713; Tue, 21 Nov 2017 16:03:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711211603.vALG3LVu045713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 21 Nov 2017 16:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326064 - in head/lib/libproc: . tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/lib/libproc: . tests X-SVN-Commit-Revision: 326064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 16:03:22 -0000 Author: markj Date: Tue Nov 21 16:03:21 2017 New Revision: 326064 URL: https://svnweb.freebsd.org/changeset/base/326064 Log: Refine symtab sorting in libproc. Add some rules to more closely match what illumos does when an address resolves to multiple symbols: - prefer non-local symbols - prefer symbols with fewer leading underscores and no leading '$' Add some regression tests to verify these rules. Modified: head/lib/libproc/proc_sym.c head/lib/libproc/tests/proc_test.c head/lib/libproc/tests/target_prog.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Tue Nov 21 16:00:18 2017 (r326063) +++ head/lib/libproc/proc_sym.c Tue Nov 21 16:03:21 2017 (r326064) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Mark Johnston + * Copyright (c) 2016-2017 Mark Johnston * Copyright (c) 2010 The FreeBSD Foundation * Copyright (c) 2008 John Birrell (jb@freebsd.org) * All rights reserved. @@ -100,27 +100,59 @@ fail: strlcpy(buf, symbol, len); } +struct symsort_thunk { + Elf *e; + struct symtab *symtab; +}; + static int -symvalcomp(void *thunk, const void *a1, const void *a2) +symvalcmp(void *_thunk, const void *a1, const void *a2) { - struct symtab *symtab; GElf_Sym sym1, sym2; + struct symsort_thunk *thunk; + const char *s1, *s2; u_int i1, i2; - int ret; + int bind1, bind2; i1 = *(const u_int *)a1; i2 = *(const u_int *)a2; - symtab = thunk; + thunk = _thunk; - (void)gelf_getsym(symtab->data, i1, &sym1); - (void)gelf_getsym(symtab->data, i2, &sym2); - if (sym1.st_value < sym2.st_value) - ret = -1; - else if (sym1.st_value == sym2.st_value) - ret = 0; - else - ret = 1; - return (ret); + (void)gelf_getsym(thunk->symtab->data, i1, &sym1); + (void)gelf_getsym(thunk->symtab->data, i2, &sym2); + + if (sym1.st_value != sym2.st_value) + return (sym1.st_value < sym2.st_value ? -1 : 1); + + /* Prefer non-local symbols. */ + bind1 = GELF_ST_BIND(sym1.st_info); + bind2 = GELF_ST_BIND(sym2.st_info); + if (bind1 != bind2) { + if (bind1 == STB_LOCAL && bind2 != STB_LOCAL) + return (-1); + if (bind1 != STB_LOCAL && bind2 == STB_LOCAL) + return (1); + } + + s1 = elf_strptr(thunk->e, thunk->symtab->stridx, sym1.st_name); + s2 = elf_strptr(thunk->e, thunk->symtab->stridx, sym2.st_name); + if (s1 != NULL && s2 != NULL) { + /* Prefer symbols without a leading '$'. */ + if (*s1 == '$') + return (-1); + if (*s2 == '$') + return (1); + + /* Prefer symbols with fewer leading underscores. */ + for (; *s1 == '_' && *s2 == '_'; s1++, s2++) + ; + if (*s1 == '_') + return (-1); + if (*s2 == '_') + return (1); + } + + return (0); } static int @@ -128,6 +160,7 @@ load_symtab(Elf *e, struct symtab *symtab, u_long sh_t { GElf_Ehdr ehdr; GElf_Shdr shdr; + struct symsort_thunk thunk; Elf_Scn *scn; u_int nsyms; @@ -155,9 +188,13 @@ load_symtab(Elf *e, struct symtab *symtab, u_long sh_t return (-1); for (u_int i = 0; i < nsyms; i++) symtab->index[i] = i; - qsort_r(symtab->index, nsyms, sizeof(u_int), symtab, symvalcomp); symtab->nsyms = nsyms; symtab->stridx = shdr.sh_link; + + thunk.e = e; + thunk.symtab = symtab; + qsort_r(symtab->index, nsyms, sizeof(u_int), &thunk, symvalcmp); + return (0); } @@ -416,34 +453,48 @@ proc_addr2map(struct proc_handle *p, uintptr_t addr) * symbol and its name. */ static int -lookup_symbol_by_addr(Elf *elf, struct symtab *symtab, uintptr_t addr, - const char **namep, GElf_Sym *sym) +lookup_symbol_by_addr(Elf *e, struct symtab *symtab, uintptr_t addr, + const char **namep, GElf_Sym *symp) { + GElf_Sym sym; Elf_Data *data; const char *s; - int min, max, mid; + u_int i, min, max, mid; + if (symtab->nsyms == 0) + return (ENOENT); + data = symtab->data; min = 0; max = symtab->nsyms - 1; while (min <= max) { mid = (max + min) / 2; - (void)gelf_getsym(data, symtab->index[mid], sym); - if (addr >= sym->st_value && - addr < sym->st_value + sym->st_size) { - s = elf_strptr(elf, symtab->stridx, sym->st_name); - if (s != NULL && namep != NULL) - *namep = s; - return (0); - } + (void)gelf_getsym(data, symtab->index[mid], &sym); + if (addr >= sym.st_value && addr < sym.st_value + sym.st_size) + break; - if (addr < sym->st_value) + if (addr < sym.st_value) max = mid - 1; else min = mid + 1; } - return (ENOENT); + if (min > max) + return (ENOENT); + + /* + * Advance until we find the matching symbol with largest index. + */ + for (i = mid; i < symtab->nsyms; i++) { + (void)gelf_getsym(data, symtab->index[i], &sym); + if (addr < sym.st_value || addr >= sym.st_value + sym.st_size) + break; + } + (void)gelf_getsym(data, symtab->index[i - 1], symp); + s = elf_strptr(e, symtab->stridx, symp->st_name); + if (s != NULL && namep != NULL) + *namep = s; + return (0); } int Modified: head/lib/libproc/tests/proc_test.c ============================================================================== --- head/lib/libproc/tests/proc_test.c Tue Nov 21 16:00:18 2017 (r326063) +++ head/lib/libproc/tests/proc_test.c Tue Nov 21 16:03:21 2017 (r326064) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2016 Mark Johnston + * Copyright (c) 2014-2017 Mark Johnston * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -370,6 +370,93 @@ ATF_TC_BODY(signal_forward, tc) proc_free(phdl); } +ATF_TC(symbol_sort_local); +ATF_TC_HEAD(symbol_sort_local, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Ensure that proc_addr2sym() returns the non-local alias when " + "the address resolves to multiple symbols."); +} +ATF_TC_BODY(symbol_sort_local, tc) +{ + char symname[32]; + GElf_Sym bar_sym; + struct proc_handle *phdl; + int error; + + phdl = start_prog(tc, true); + + error = proc_name2sym(phdl, target_prog_file, "bar", &bar_sym, NULL); + ATF_REQUIRE_MSG(error == 0, "failed to look up 'bar' in %s", + target_prog_file); + ATF_REQUIRE(GELF_ST_BIND(bar_sym.st_info) == STB_LOCAL); + + error = proc_addr2sym(phdl, bar_sym.st_value, symname, sizeof(symname), + &bar_sym); + ATF_REQUIRE_MSG(error == 0, "failed to resolve 'bar' by addr"); + + ATF_REQUIRE_MSG(strcmp(symname, "baz") == 0, + "unexpected symbol name '%s'", symname); + ATF_REQUIRE(GELF_ST_BIND(bar_sym.st_info) == STB_GLOBAL); +} + +ATF_TC(symbol_sort_prefix); +ATF_TC_HEAD(symbol_sort_prefix, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Ensure that proc_addr2sym() returns the alias whose name is not " + "prefixed with '$' if one exists."); +} +ATF_TC_BODY(symbol_sort_prefix, tc) +{ + char symname[32]; + GElf_Sym qux_sym; + struct proc_handle *phdl; + int error; + + phdl = start_prog(tc, true); + + error = proc_name2sym(phdl, target_prog_file, "$qux", &qux_sym, NULL); + ATF_REQUIRE_MSG(error == 0, "failed to look up '$qux' in %s", + target_prog_file); + + error = proc_addr2sym(phdl, qux_sym.st_value, symname, sizeof(symname), + &qux_sym); + ATF_REQUIRE_MSG(error == 0, "failed to resolve 'qux' by addr"); + + ATF_REQUIRE_MSG(strcmp(symname, "qux") == 0, + "unexpected symbol name '%s'", symname); +} + +ATF_TC(symbol_sort_underscore); +ATF_TC_HEAD(symbol_sort_underscore, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Ensure that proc_addr2sym() returns the alias with fewest leading " + "underscores in the name when the address resolves to multiple " + "symbols."); +} +ATF_TC_BODY(symbol_sort_underscore, tc) +{ + char symname[32]; + GElf_Sym foo_sym; + struct proc_handle *phdl; + int error; + + phdl = start_prog(tc, true); + + error = proc_name2sym(phdl, target_prog_file, "foo", &foo_sym, NULL); + ATF_REQUIRE_MSG(error == 0, "failed to look up 'foo' in %s", + target_prog_file); + + error = proc_addr2sym(phdl, foo_sym.st_value, symname, sizeof(symname), + &foo_sym); + ATF_REQUIRE_MSG(error == 0, "failed to resolve 'foo' by addr"); + + ATF_REQUIRE_MSG(strcmp(symname, "foo") == 0, + "unexpected symbol name '%s'", symname); +} + ATF_TP_ADD_TCS(tp) { @@ -379,6 +466,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, symbol_lookup); ATF_TP_ADD_TC(tp, symbol_lookup_fail); ATF_TP_ADD_TC(tp, signal_forward); + ATF_TP_ADD_TC(tp, symbol_sort_local); + ATF_TP_ADD_TC(tp, symbol_sort_prefix); + ATF_TP_ADD_TC(tp, symbol_sort_underscore); return (atf_no_error()); } Modified: head/lib/libproc/tests/target_prog.c ============================================================================== --- head/lib/libproc/tests/target_prog.c Tue Nov 21 16:00:18 2017 (r326063) +++ head/lib/libproc/tests/target_prog.c Tue Nov 21 16:03:21 2017 (r326064) @@ -42,9 +42,32 @@ usr1(int sig __unused) saw = 1; } +void foo(void); +void qux(void); + +void +foo(void) +{ +} +__weak_reference(foo, _foo); + +static void +bar(void) +{ +} +__strong_reference(bar, baz); + +void +qux(void) +{ +} +__strong_reference(qux, $qux); + int main(int argc, char **argv) { + + bar(); /* force the symbol to be emitted */ if (argc == 1) return (EXIT_SUCCESS); From owner-svn-src-head@freebsd.org Tue Nov 21 16:38: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 0E89CDF3A36; Tue, 21 Nov 2017 16:38:32 +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 CFE9875425; Tue, 21 Nov 2017 16:38:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vALGcUvs058510; Tue, 21 Nov 2017 16:38:30 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALGcUFt058509; Tue, 21 Nov 2017 16:38:30 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711211638.vALGcUFt058509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 21 Nov 2017 16:38:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326065 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 326065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 16:38:32 -0000 Author: asomers Date: Tue Nov 21 16:38:30 2017 New Revision: 326065 URL: https://svnweb.freebsd.org/changeset/base/326065 Log: Fix uninitialized variable from 326034 Reported by: Coverity CID: 1382887 MFC after: 20 days X-MFC-With: 326034 Sponsored by: Spectra Logic Corp Modified: head/sys/cam/cam.c Modified: head/sys/cam/cam.c ============================================================================== --- head/sys/cam/cam.c Tue Nov 21 16:03:21 2017 (r326064) +++ head/sys/cam/cam.c Tue Nov 21 16:38:30 2017 (r326065) @@ -235,7 +235,8 @@ cam_strmatch(const u_int8_t *str, const u_int8_t *patt return (1); } else if (*pattern == '[') { int negate_range, ok; - uint8_t pc, sc; + uint8_t pc = UCHAR_MAX; + uint8_t sc; ok = 0; sc = *str++; From owner-svn-src-head@freebsd.org Tue Nov 21 16:52: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 05CD7DF3ED6 for ; Tue, 21 Nov 2017 16:52:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::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 BC5CE75D06 for ; Tue, 21 Nov 2017 16:52:35 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id d123so4064380iog.7 for ; Tue, 21 Nov 2017 08:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=yVdmqaGtMRzq7cPp8MYRhbcFJd4tkD7xCPOBKmiHm3Q=; b=S6T+SxYaZMdH7hdzbUIQDhyOTvjtNAe9RVbY7UsftSDoAXkfP/Z3fc4K7bTie3vzLv pF49XQ6eF2EX9GERwUywfjLRDhmWeRgNesmKpg/Op+91FVamvvO6BrbwLdyMF+Nm4JfZ 35itL5EdGZHvwUSx56N8n15z+mVrSIMyf65oWHAxV52Wcj2GTx+BJWaucjn6OIRsbLAB 6EF7xJmQoFy00m1ndc9pneSRz7gvNHN40NkfvsMouBFGPgkxUZnSQJIE3QxvXt19D5Ph EuPeys9e4X54Q+ZY7CD6Y5ut/vrIDPnHQftMyji9WQxx31eG0EizQ3e/bB14e8RAaIEQ r/FA== 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=yVdmqaGtMRzq7cPp8MYRhbcFJd4tkD7xCPOBKmiHm3Q=; b=Tp8/YRhAx2hCri6r5w5Lh9BhPFWKD8KFEX3GUMdZzucw2WII4vsfuLc8vWBxLDE6E1 gyzuasRKzTeOWIxv99t7D7yv/J9urBUaMEyxw+A4LhzGS+6ZmqlWtyLT9nrcMBQyXQVG hNKKaKMY4YTJ+36eL47CcAuhDeuHA/XBQpIIFsK3pzCAy+VR2FU6ODNex5TwGIoftM4V zOzYAl3SSXgVGhmPalK3zHRwh22ZRbQsFoFcAwdzyitOWpZ9mRTw7seKq8G2F5bQkqTn cNupDMItWHmV4Y9ACOgUBouCtvb6kA9x+knSiEaFPXZbQd6/WHHelyo4sjkU1gNW9bZ2 vtAA== X-Gm-Message-State: AJaThX6Fj3FVYa0+UQMrnqGg7w4DWFqtM8N9wBc8aNo7nSwkpT69e5pu BsNVGNFnZkszfS1tsVo2NkPlgWTl0mxUk7ma4oxDbA== X-Google-Smtp-Source: AGs4zMapCIeGFzfkgwxQnyjnMjvIxUHlH6hlFS0NaYVZG1ybJcaos7g3B6MG9lBGWANcAZG6nMPtOQdhgk25NRKJX24= X-Received: by 10.107.81.24 with SMTP id f24mr18607867iob.63.1511283154887; Tue, 21 Nov 2017 08:52:34 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Tue, 21 Nov 2017 08:52:34 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:c91c:5e34:ef38:d5a] In-Reply-To: <20171121233000.M2067@besplex.bde.org> References: <201711202241.vAKMfMpO008434@repo.freebsd.org> <20171121233000.M2067@besplex.bde.org> From: Warner Losh Date: Tue, 21 Nov 2017 09:52:34 -0700 X-Google-Sender-Auth: 9LCF8nLw8dKZgCi4XAUSa21TJ98 Message-ID: Subject: Re: svn commit: r326037 - head/share/mk To: Bruce Evans Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 16:52:36 -0000 On Tue, Nov 21, 2017 at 5:44 AM, Bruce Evans wrote: > On Mon, 20 Nov 2017, Warner Losh wrote: > > Author: imp >> Date: Mon Nov 20 22:41:22 2017 >> New Revision: 326037 >> URL: https://svnweb.freebsd.org/changeset/base/326037 >> >> Log: >> Add -mno-avx2 for clang as well as -mno-avx. We don't want either of >> them when asking for no SIMD. >> > > Is this needed. For SSE, -mno-sse implies -mno-sse[2,3,4,...] so > an multiple set of no-sse* flags are not needed (I have only checked this > for sse2). Multiple no-sse* flags are also not used. I've had reports that the EFI boot loader uses these AVX2 instructions when you set CPUTYPE=haswell. I've not independently confirmed this, as this was a few years ago. But it was an easy bug to fix. Modified: head/share/mk/bsd.cpu.mk >> ============================================================ >> ================== >> --- head/share/mk/bsd.cpu.mk Mon Nov 20 22:27:33 2017 (r326036) >> +++ head/share/mk/bsd.cpu.mk Mon Nov 20 22:41:22 2017 (r326037) >> @@ -393,7 +393,7 @@ CFLAGS += ${_CPUCFLAGS} >> # (-mfpmath= is not supported) >> # >> .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" >> -CFLAGS_NO_SIMD.clang= -mno-avx >> +CFLAGS_NO_SIMD.clang= -mno-avx -mno-avx2 >> CFLAGS_NO_SIMD= -mno-mmx -mno-sse >> > > Nearby example of non-use for SSE. Yes. .endif >> CFLAGS_NO_SIMD += ${CFLAGS_NO_SIMD.${COMPILER_TYPE}} >> > > Testing shows that -mavx2 -mno-avx kills all AVX for clang in an example > that only generates AVX instructions (-mavx2 enabls these as a subset). I'll have to confirm. Skylake adds avx512 as well, so I'll have to check it there too... Warner From owner-svn-src-head@freebsd.org Tue Nov 21 17:23: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 CA08DDF4B2A; Tue, 21 Nov 2017 17:23:17 +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 A178876F46; Tue, 21 Nov 2017 17:23:17 +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 vALHNG53079666; Tue, 21 Nov 2017 17:23:16 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALHNGb6079662; Tue, 21 Nov 2017 17:23:16 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201711211723.vALHNGb6079662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 21 Nov 2017 17:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326066 - in head/sys: arm64/conf conf dev/efidev modules/efirt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/conf conf dev/efidev modules/efirt X-SVN-Commit-Revision: 326066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 17:23:17 -0000 Author: andrew Date: Tue Nov 21 17:23:16 2017 New Revision: 326066 URL: https://svnweb.freebsd.org/changeset/base/326066 Log: Add a driver for the EFI RTC. This uses the EFI Runtime Services to query the system time. As we seem to only read this time on boot, and this is the only source of time on many arm64 machines we need to enable this by default there. As this is not always the case with U-Boot firmware, or when we have been booted from a non-UEFI environment we only enable the device driver when the Runtime Services are present and reading the time doesn't result in an error. PR: 212185 Reviewed by: imp, kib Tested by: emaste Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12650 Added: head/sys/dev/efidev/efirtc.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files head/sys/modules/efirt/Makefile Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Nov 21 16:38:30 2017 (r326065) +++ head/sys/arm64/conf/GENERIC Tue Nov 21 17:23:16 2017 (r326066) @@ -226,6 +226,7 @@ device md # Memory "disks" device gif # IPv6 and IPv4 tunneling device firmware # firmware assist module device psci # Support for ARM PSCI +options EFIRT # EFI Runtime Services # EXT_RESOURCES pseudo devices options EXT_RESOURCES Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Nov 21 16:38:30 2017 (r326065) +++ head/sys/conf/files Tue Nov 21 17:23:16 2017 (r326066) @@ -1615,6 +1615,7 @@ dev/ed/if_ed_pccard.c optional ed pccard dev/ed/if_ed_pci.c optional ed pci dev/efidev/efidev.c optional efirt dev/efidev/efirt.c optional efirt +dev/efidev/efirtc.c optional efirt dev/e1000/if_em.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/em_txrx.c optional em \ Added: head/sys/dev/efidev/efirtc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/efidev/efirtc.c Tue Nov 21 17:23:16 2017 (r326066) @@ -0,0 +1,151 @@ +/*- + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include "clock_if.h" + +static void +efirtc_identify(driver_t *driver, device_t parent) +{ + struct efi_tm tm; + int error; + + /* + * Check if we can read the time. This will stop us attaching when + * there is no EFI Runtime support, or the gettime function is + * unimplemented, e.g. on some builds of U-Boot. + */ + error = efi_get_time(&tm); + if (error != 0) + return; + + if (device_find_child(parent, "efirtc", -1) != NULL) + return; + if (BUS_ADD_CHILD(parent, 0, "efirtc", -1) == NULL) + device_printf(parent, "add child failed\n"); +} + +static int +efirtc_probe(device_t dev) +{ + + device_quiet(dev); + return (0); +} + +static int +efirtc_attach(device_t dev) +{ + + clock_register(dev, 1000000); + return (0); +} + +static int +efirtc_detach(device_t dev) +{ + + clock_unregister(dev); + return (0); +} + +static int +efirtc_gettime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + struct efi_tm tm; + int error; + + error = efi_get_time(&tm); + if (error != 0) + return (error); + + ct.sec = tm.tm_sec; + ct.min = tm.tm_min; + ct.hour = tm.tm_hour; + ct.day = tm.tm_mday; + ct.mon = tm.tm_mon; + ct.year = tm.tm_year; + ct.nsec = tm.tm_nsec; + + return (clock_ct_to_ts(&ct, ts)); +} + +static int +efirtc_settime(device_t dev, struct timespec *ts) +{ + struct clocktime ct; + struct efi_tm tm; + + clock_ts_to_ct(ts, &ct); + + tm.tm_sec = ct.sec; + tm.tm_min = ct.min; + tm.tm_hour = ct.hour; + tm.tm_mday = ct.day; + tm.tm_mon = ct.mon; + tm.tm_year = ct.year; + tm.tm_nsec = ct.nsec; + + return (efi_set_time(&tm)); +} + +static device_method_t efirtc_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, efirtc_identify), + DEVMETHOD(device_probe, efirtc_probe), + DEVMETHOD(device_attach, efirtc_attach), + DEVMETHOD(device_detach, efirtc_detach), + + /* Clock interface */ + DEVMETHOD(clock_gettime, efirtc_gettime), + DEVMETHOD(clock_settime, efirtc_settime), + + DEVMETHOD_END +}; + +static devclass_t efirtc_devclass; +static driver_t efirtc_driver = { + "efirtc", + efirtc_methods, + 0 +}; + +DRIVER_MODULE(efirtc, nexus, efirtc_driver, efirtc_devclass, 0, 0); Modified: head/sys/modules/efirt/Makefile ============================================================================== --- head/sys/modules/efirt/Makefile Tue Nov 21 16:38:30 2017 (r326065) +++ head/sys/modules/efirt/Makefile Tue Nov 21 17:23:16 2017 (r326066) @@ -5,6 +5,7 @@ KMOD= efirt SRCS= efirt.c efirt_machdep.c efidev.c -SRCS+= device_if.h bus_if.h +SRCS+= efirtc.c +SRCS+= device_if.h bus_if.h clock_if.h .include From owner-svn-src-head@freebsd.org Tue Nov 21 17:39: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 2A099DF50DF for ; Tue, 21 Nov 2017 17:39:49 +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 08ED677875 for ; Tue, 21 Nov 2017 17:39:48 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: c25a59d2-cee2-11e7-b1c3-712f93d8ba90 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id c25a59d2-cee2-11e7-b1c3-712f93d8ba90; Tue, 21 Nov 2017 17:38:18 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vALHceAI001122; Tue, 21 Nov 2017 10:38:40 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1511285920.13854.6.camel@freebsd.org> Subject: Re: svn commit: r326066 - in head/sys: arm64/conf conf dev/efidev modules/efirt From: Ian Lepore To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 21 Nov 2017 10:38:40 -0700 In-Reply-To: <201711211723.vALHNGb6079662@repo.freebsd.org> References: <201711211723.vALHNGb6079662@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 17:39:49 -0000 On Tue, 2017-11-21 at 17:23 +0000, Andrew Turner wrote: > Author: andrew > Date: Tue Nov 21 17:23:16 2017 > New Revision: 326066 > URL: https://svnweb.freebsd.org/changeset/base/326066 > > Log: >   Add a driver for the EFI RTC. This uses the EFI Runtime Services to query >   the system time. >    >   As we seem to only read this time on boot, and this is the only source of >   time on many arm64 machines we need to enable this by default there. As >   this is not always the case with U-Boot firmware, or when we have been >   booted from a non-UEFI environment we only enable the device driver when >   the Runtime Services are present and reading the time doesn't result in an >   error. If the efi runtime returns an error for the case where time is invalid because the clock oscillator is stopped, this "don't attach on error" logic will result in the clock never working, because it is typically the act of writing a valid time to the device that starts the oscillator and clears the error condition. It might make sense to always attach the device, but only report an error in clock_settime() once. -- Ian From owner-svn-src-head@freebsd.org Tue Nov 21 18:01: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 15A34DF5606; Tue, 21 Nov 2017 18:01:45 +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 E15BD784DD; Tue, 21 Nov 2017 18:01:44 +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 vALI1hh7095026; Tue, 21 Nov 2017 18:01:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALI1hDq095025; Tue, 21 Nov 2017 18:01:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711211801.vALI1hDq095025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Nov 2017 18:01:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326067 - head/sys/cddl/compat/opensolaris/kern X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/compat/opensolaris/kern X-SVN-Commit-Revision: 326067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 18:01:45 -0000 Author: avg Date: Tue Nov 21 18:01:43 2017 New Revision: 326067 URL: https://svnweb.freebsd.org/changeset/base/326067 Log: make illumos uiocopy use vn_io_fault_uiomove uiocopy() is currently unused, its purpose is copy data from a uio without modifying the uio. It was in use before the vn_io_fault support was added to ZFS, at which point our code diverged from the illumos code a little bit. Because ZFS is the only (potential) user of the function we are free to modify it to better suit ZFS needs. The intention behind this change is to remove the differences introduced earlier in zfs_write(). While here, re-implement uioskip() using uiomove() with uio_segflg == UIO_NOCOPY. The story of uioskip is the same as with uiocopy. Reviewed by: mav MFC after: 1 week Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_uio.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_uio.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_uio.c Tue Nov 21 17:23:16 2017 (r326066) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_uio.c Tue Nov 21 18:01:43 2017 (r326067) @@ -42,6 +42,7 @@ #include #include +#include /* * same as uiomove() but doesn't modify uio structure. @@ -50,63 +51,42 @@ int uiocopy(void *p, size_t n, enum uio_rw rw, struct uio *uio, size_t *cbytes) { - struct iovec *iov; - ulong_t cnt; - int error, iovcnt; + struct iovec small_iovec[1]; + struct uio small_uio_clone; + struct uio *uio_clone; + int error; - iovcnt = uio->uio_iovcnt; - *cbytes = 0; - - for (iov = uio->uio_iov; n > 0 && iovcnt > 0; iov++, iovcnt--) { - cnt = MIN(iov->iov_len, n); - if (cnt == 0) - continue; - - switch (uio->uio_segflg) { - case UIO_USERSPACE: - if (rw == UIO_READ) - error = copyout(p, iov->iov_base, cnt); - else - error = copyin(iov->iov_base, p, cnt); - if (error) - return (error); - break; - case UIO_SYSSPACE: - if (uio->uio_rw == UIO_READ) - bcopy(p, iov->iov_base, cnt); - else - bcopy(iov->iov_base, p, cnt); - break; - } - - p = (caddr_t)p + cnt; - n -= cnt; - *cbytes += cnt; + ASSERT3U(uio->uio_rw, ==, rw); + if (uio->uio_iovcnt == 1) { + small_uio_clone = *uio; + small_iovec[0] = *uio->uio_iov; + small_uio_clone.uio_iov = small_iovec; + uio_clone = &small_uio_clone; + } else { + uio_clone = cloneuio(uio); } - return (0); + + error = vn_io_fault_uiomove(p, n, uio_clone); + *cbytes = uio->uio_resid - uio_clone->uio_resid; + if (uio_clone != &small_uio_clone) + free(uio_clone, M_IOV); + return (error); } /* * Drop the next n chars out of *uiop. */ void -uioskip(uio_t *uiop, size_t n) +uioskip(uio_t *uio, size_t n) { - if (n > uiop->uio_resid) + enum uio_seg segflg; + + /* For the full compatibility with illumos. */ + if (n > uio->uio_resid) return; - while (n != 0) { - register iovec_t *iovp = uiop->uio_iov; - register size_t niovb = MIN(iovp->iov_len, n); - if (niovb == 0) { - uiop->uio_iov++; - uiop->uio_iovcnt--; - continue; - } - iovp->iov_base += niovb; - uiop->uio_loffset += niovb; - iovp->iov_len -= niovb; - uiop->uio_resid -= niovb; - n -= niovb; - } + segflg = uio->uio_segflg; + uio->uio_segflg = UIO_NOCOPY; + uiomove(NULL, n, uio->uio_rw, uio); + uio->uio_segflg = segflg; } From owner-svn-src-head@freebsd.org Tue Nov 21 18:02: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 E9C4BDF566D; Tue, 21 Nov 2017 18:02:19 +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 9C1767879C; Tue, 21 Nov 2017 18:02:19 +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 vALI2IDR095969; Tue, 21 Nov 2017 18:02:18 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALI2IVt095318; Tue, 21 Nov 2017 18:02:18 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201711211802.vALI2IVt095318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 21 Nov 2017 18:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326068 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 326068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 18:02:20 -0000 Author: gjb Date: Tue Nov 21 18:02:18 2017 New Revision: 326068 URL: https://svnweb.freebsd.org/changeset/base/326068 Log: Remove /etc/resolv.conf from virtual machine images, which is copied from the build host. It is renamed to /etc/resolv.conf.bak on boot, so never used anyway. Noticed by: peter MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/ec2.conf head/release/tools/gce.conf head/release/tools/vagrant-virtualbox.conf head/release/tools/vagrant-vmware.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Tue Nov 21 18:01:43 2017 (r326067) +++ head/release/tools/ec2.conf Tue Nov 21 18:02:18 2017 (r326068) @@ -90,5 +90,7 @@ vm_extra_pre_umount() { # * firstboot_pkgs (install packages) touch ${DESTDIR}/firstboot + rm -f ${DESTDIR}/etc/resolv.conf + return 0 } Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Tue Nov 21 18:01:43 2017 (r326067) +++ head/release/tools/gce.conf Tue Nov 21 18:02:18 2017 (r326068) @@ -92,5 +92,7 @@ EOF touch ${DESTDIR}/firstboot + rm -f ${DESTDIR}/etc/resolv.conf + return 0 } Modified: head/release/tools/vagrant-virtualbox.conf ============================================================================== --- head/release/tools/vagrant-virtualbox.conf Tue Nov 21 18:01:43 2017 (r326067) +++ head/release/tools/vagrant-virtualbox.conf Tue Nov 21 18:02:18 2017 (r326068) @@ -15,4 +15,5 @@ vm_extra_pre_umount () { # Setup the Vagrant common items vagrant_common + rm -f ${DESTDIR}/etc/resolv.conf } Modified: head/release/tools/vagrant-vmware.conf ============================================================================== --- head/release/tools/vagrant-vmware.conf Tue Nov 21 18:01:43 2017 (r326067) +++ head/release/tools/vagrant-vmware.conf Tue Nov 21 18:02:18 2017 (r326068) @@ -19,4 +19,5 @@ vm_extra_pre_umount () { # Setup the Vagrant common items vagrant_common + rm -f ${DESTDIR}/etc/resolv.conf } From owner-svn-src-head@freebsd.org Tue Nov 21 18:03: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 45B1BDF5806; Tue, 21 Nov 2017 18:03: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 0FAD8789AE; Tue, 21 Nov 2017 18:03:48 +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 vALI3mhS097356; Tue, 21 Nov 2017 18:03:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALI3maE097354; Tue, 21 Nov 2017 18:03:48 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711211803.vALI3maE097354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 21 Nov 2017 18:03:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326069 - in head/stand/i386: gptzfsboot libi386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/i386: gptzfsboot libi386 X-SVN-Commit-Revision: 326069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 18:03:49 -0000 Author: imp Date: Tue Nov 21 18:03:47 2017 New Revision: 326069 URL: https://svnweb.freebsd.org/changeset/base/326069 Log: Fix gptzfsboot for cases with GELI. HAVE_GPT isn't currently a thing, but HAVE_GELI is. Replace the former with the latter and remove util.o from the build list (it's picked up from libsa/libsa32, and that's OK). Sponsored by: Netflix Modified: head/stand/i386/gptzfsboot/Makefile head/stand/i386/libi386/Makefile Modified: head/stand/i386/gptzfsboot/Makefile ============================================================================== --- head/stand/i386/gptzfsboot/Makefile Tue Nov 21 18:02:18 2017 (r326068) +++ head/stand/i386/gptzfsboot/Makefile Tue Nov 21 18:03:47 2017 (r326069) @@ -1,6 +1,6 @@ # $FreeBSD$ -HAVE_GPT= yes +HAVE_GELI= yes .include @@ -70,12 +70,12 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \ - drv.o gpt.o util.o ${OPENCRYPTO_XTS} + drv.o gpt.o ${OPENCRYPTO_XTS} gptzfsboot.bin: gptzfsboot.out ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} -gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ +gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \ ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32} Modified: head/stand/i386/libi386/Makefile ============================================================================== --- head/stand/i386/libi386/Makefile Tue Nov 21 18:02:18 2017 (r326068) +++ head/stand/i386/libi386/Makefile Tue Nov 21 18:03:47 2017 (r326069) @@ -1,6 +1,5 @@ # $FreeBSD$ -HAVE_GPT= yes HAVE_GELI= yes .include From owner-svn-src-head@freebsd.org Tue Nov 21 18: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 E8CB7DF64B6; Tue, 21 Nov 2017 18:28:15 +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 C2B8B7AB37; Tue, 21 Nov 2017 18:28:15 +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 vALISEDc009090; Tue, 21 Nov 2017 18:28:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALISExb009089; Tue, 21 Nov 2017 18:28:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711211828.vALISExb009089@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 21 Nov 2017 18:28:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326070 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 326070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 18:28:16 -0000 Author: avg Date: Tue Nov 21 18:28:14 2017 New Revision: 326070 URL: https://svnweb.freebsd.org/changeset/base/326070 Log: zfs_write: fix problem with writes appearing to succeed when over quota The problem happens when the writes have offsets and sizes aligned with a filesystem's recordsize (maximum block size). In this scenario dmu_tx_assign() would fail because of being over the quota, but the uio would already be modified in the code path where we copy data from the uio into a borrowed ARC buffer. That makes an appearance of a partial write, so zfs_write() would return success and the uio would be modified consistently with writing a single block. That bug can result in a data loss because the writes over the quota would appear to succeed while the actual data is being discarded. This commit fixes the bug by ensuring that the uio is not changed until after all error checks are done. To achieve that the code now uses uiocopy() + uioskip() as in the original illumos design. We can do that now that uiocopy() has been updated in r326067 to use vn_io_fault_uiomove(). Reported by: mav Analyzed by: mav Reviewed by: mav Pointyhat to: avg (myself) MFC after: 1 week X-MFC after: r326067 X-Erratum: wanted Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 21 18:03:47 2017 (r326069) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Nov 21 18:28:14 2017 (r326070) @@ -1037,31 +1037,18 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t * holding up the transaction if the data copy hangs * up on a pagefault (e.g., from an NFS server mapping). */ -#ifdef illumos size_t cbytes; -#endif abuf = dmu_request_arcbuf(sa_get_db(zp->z_sa_hdl), max_blksz); ASSERT(abuf != NULL); ASSERT(arc_buf_size(abuf) == max_blksz); -#ifdef illumos if (error = uiocopy(abuf->b_data, max_blksz, UIO_WRITE, uio, &cbytes)) { dmu_return_arcbuf(abuf); break; } ASSERT(cbytes == max_blksz); -#else - ssize_t resid = uio->uio_resid; - error = vn_io_fault_uiomove(abuf->b_data, max_blksz, uio); - if (error != 0) { - uio->uio_offset -= resid - uio->uio_resid; - uio->uio_resid = resid; - dmu_return_arcbuf(abuf); - break; - } -#endif } /* @@ -1139,10 +1126,8 @@ zfs_write(vnode_t *vp, uio_t *uio, int ioflag, cred_t dmu_assign_arcbuf(sa_get_db(zp->z_sa_hdl), woff, abuf, tx); } -#ifdef illumos ASSERT(tx_bytes <= uio->uio_resid); uioskip(uio, tx_bytes); -#endif } if (tx_bytes && vn_has_cached_data(vp)) { update_pages(vp, woff, tx_bytes, zfsvfs->z_os, From owner-svn-src-head@freebsd.org Tue Nov 21 19:23: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 B3486DF756A; Tue, 21 Nov 2017 19:23:13 +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 809CD7CA6C; Tue, 21 Nov 2017 19:23:13 +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 vALJNCLv035123; Tue, 21 Nov 2017 19:23:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALJNCls035122; Tue, 21 Nov 2017 19:23:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711211923.vALJNCls035122@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 21 Nov 2017 19:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326071 - head X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 326071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 19:23:13 -0000 Author: imp Date: Tue Nov 21 19:23:12 2017 New Revision: 326071 URL: https://svnweb.freebsd.org/changeset/base/326071 Log: Use TARGET_ARCH=riscv64 when TARGET=riscv The supported targets are riscv64 and riscv64sf. Use the former when building with a bare TARGET=riscv and it is the more common one. Sponsored by: Netflix Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Nov 21 18:28:14 2017 (r326070) +++ head/Makefile Tue Nov 21 19:23:12 2017 (r326071) @@ -270,7 +270,7 @@ MK_META_MODE= no # exceptions. .if !defined(TARGET_ARCH) && defined(TARGET) # T->TA mapping is usually TARGET with arm64 the odd man out -_TARGET_ARCH= ${TARGET:S/arm64/aarch64/} +_TARGET_ARCH= ${TARGET:S/arm64/aarch64/:S/riscv/riscv64/} .elif !defined(TARGET) && defined(TARGET_ARCH) && \ ${TARGET_ARCH} != ${MACHINE_ARCH} # TA->T mapping is accidentally CPUARCH with aarch64 the odd man out From owner-svn-src-head@freebsd.org Tue Nov 21 19:23: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 B588EDF7599; Tue, 21 Nov 2017 19:23:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F1797CAE3; Tue, 21 Nov 2017 19:23:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vALJNK1J035181; Tue, 21 Nov 2017 19:23:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALJNKJD035180; Tue, 21 Nov 2017 19:23:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711211923.vALJNKJD035180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 21 Nov 2017 19:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326072 - head/stand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 326072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 19:23:21 -0000 Author: imp Date: Tue Nov 21 19:23:20 2017 New Revision: 326072 URL: https://svnweb.freebsd.org/changeset/base/326072 Log: Unbreak riscv build in universe. riscv doesn't have -msoft-float. For the moment, just don't add anything. There's no /boot/loader or other bootstrap contained in the tree for riscv*. However, with real hardware coming next year, there are plans for one, so keep building at least a minimal libsa and ficl to prevent bitrot. Sponsored by: Netflix Modified: head/stand/Makefile.inc Modified: head/stand/Makefile.inc ============================================================================== --- head/stand/Makefile.inc Tue Nov 21 19:23:12 2017 (r326071) +++ head/stand/Makefile.inc Tue Nov 21 19:23:20 2017 (r326072) @@ -10,10 +10,12 @@ CFLAGS+=-I${SASRC} SSP_CFLAGS= # Add in the no float / no SIMD stuff and announce we're freestanding +# aarch64 and riscv don't have -msoft-float, but all others do. riscv +# currently has no /boot/loader, but may soon. CFLAGS+= -ffreestanding ${CFLAGS_NO_SIMD} .if ${MACHINE_CPUARCH} == "aarch64" CFLAGS+= -mgeneral-regs-only -.else +.elif ${MACHINE_CPUARCH} != "riscv" CFLAGS+= -msoft-float .endif From owner-svn-src-head@freebsd.org Tue Nov 21 19:55: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 60EDEDF7EA1; Tue, 21 Nov 2017 19:55:33 +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 3B3D87DA0F; Tue, 21 Nov 2017 19:55:33 +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 vALJtWPV047908; Tue, 21 Nov 2017 19:55:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALJtWhg047906; Tue, 21 Nov 2017 19:55:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711211955.vALJtWhg047906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 Nov 2017 19:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326073 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 326073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 19:55:33 -0000 Author: kib Date: Tue Nov 21 19:55:32 2017 New Revision: 326073 URL: https://svnweb.freebsd.org/changeset/base/326073 Log: systat: use and correctly display 64bit counters. Following struct vmtotal changes, make systat use and correctly display 64-bit counters. Switch to humanize_number(3) to overcome homegrown arithmetics limits in pretty printing large numbers. Use 1024 as a divisor for memory fields to make it consistent with other tools and users expectations. Submitted by: Pawel Biernacki Sponsored by: Mysterious Code Ltd. PR: 2137 Differential revision: https://reviews.freebsd.org/D13105 Modified: head/usr.bin/systat/Makefile head/usr.bin/systat/vmstat.c Modified: head/usr.bin/systat/Makefile ============================================================================== --- head/usr.bin/systat/Makefile Tue Nov 21 19:23:20 2017 (r326072) +++ head/usr.bin/systat/Makefile Tue Nov 21 19:55:32 2017 (r326073) @@ -16,6 +16,6 @@ CFLAGS+= -DINET6 WARNS?= 1 -LIBADD= ncursesw m devstat kvm +LIBADD= ncursesw m devstat kvm util .include Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Tue Nov 21 19:23:20 2017 (r326072) +++ head/usr.bin/systat/vmstat.c Tue Nov 21 19:55:32 2017 (r326073) @@ -57,6 +57,7 @@ static const char sccsid[] = "@(#)vmstat.c 8.2 (Berkel #include #include #include +#include #include #include #include @@ -131,6 +132,7 @@ struct statinfo cur, last, run; #define oldnchtotal s1.nchstats static enum state { BOOT, TIME, RUN } state = TIME; +enum divisor { IEC = 0, SI = HN_DIVISOR_1000 }; static void allocinfo(struct Info *); static void copyinfo(struct Info *, struct Info *); @@ -138,6 +140,8 @@ static float cputime(int); static void dinfo(int, int, struct statinfo *, struct statinfo *); static void getinfo(struct Info *); static void putint(int, int, int, int); +static void putuint64(uint64_t, int, int, int); +static void do_putuint64(uint64_t, int, int, int, int); static void putfloat(double, int, int, int, int, int); static void putlongdouble(long double, int, int, int, int, int); static int ucount(void); @@ -491,15 +495,15 @@ showkre(void) putfloat(100.0 * s.v_kmem_map_size / kmem_size, STATROW + 1, STATCOL + 22, 2, 0, 1); - putint(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); - putint(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); - putint(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); - putint(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); - putint(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); - putint(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); - putint(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); - putint(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); - putint(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); + putuint64(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); + putuint64(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); + putuint64(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); + putuint64(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); + putuint64(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); + putuint64(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); + putuint64(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); + putuint64(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); + putuint64(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); putint(total.t_rq - 1, PROCSROW + 2, PROCSCOL, 3); putint(total.t_pw, PROCSROW + 2, PROCSCOL + 4, 3); putint(total.t_dw, PROCSROW + 2, PROCSCOL + 8, 3); @@ -518,13 +522,13 @@ showkre(void) PUTRATE(v_pdwakeups, VMSTATROW + 9, VMSTATCOL, 8); PUTRATE(v_pdpages, VMSTATROW + 10, VMSTATCOL, 8); PUTRATE(v_intrans, VMSTATROW + 11, VMSTATCOL, 8); - putint(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); - putint(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); - putint(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); - putint(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); - putint(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); + putuint64(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); + putuint64(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); + putuint64(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); + putuint64(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); + putuint64(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); if (LINES - 1 > VMSTATROW + 17) - putint(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); + putuint64(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); PUTRATE(v_vnodein, PAGEROW + 2, PAGECOL + 6, 5); PUTRATE(v_vnodeout, PAGEROW + 2, PAGECOL + 12, 5); PUTRATE(v_swapin, PAGEROW + 2, PAGECOL + 19, 5); @@ -666,8 +670,23 @@ cputime(int indx) static void putint(int n, int l, int lc, int w) { + + do_putuint64(n, l, lc, w, SI); +} + +static void +putuint64(uint64_t n, int l, int lc, int w) +{ + + do_putuint64(n, l, lc, w, IEC); +} + +static void +do_putuint64(uint64_t n, int l, int lc, int w, int div) +{ int snr; char b[128]; + char buf[128]; move(l, lc); #ifdef DEBUG @@ -680,11 +699,12 @@ putint(int n, int l, int lc, int w) addch(' '); return; } - snr = snprintf(b, sizeof(b), "%*d", w, n); - if (snr != w) - snr = snprintf(b, sizeof(b), "%*dk", w - 1, n / 1000); - if (snr != w) - snr = snprintf(b, sizeof(b), "%*dM", w - 1, n / 1000000); + snr = snprintf(b, sizeof(b), "%*jd", w, (uintmax_t)n); + if (snr != w) { + humanize_number(buf, w, n, "", HN_AUTOSCALE, + HN_NOSPACE | HN_DECIMAL | div); + snr = snprintf(b, sizeof(b), "%*s", w, buf); + } if (snr != w) { while (w-- > 0) addch('*'); From owner-svn-src-head@freebsd.org Tue Nov 21 20: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 A2BFED931D9; Tue, 21 Nov 2017 20:06:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 3B57F7DFB3; Tue, 21 Nov 2017 20:06:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 929A84292A3; Wed, 22 Nov 2017 07:05:59 +1100 (AEDT) Date: Wed, 22 Nov 2017 07:05:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326031 - head/sys/fs/msdosfs In-Reply-To: <20171121205309.F1819@besplex.bde.org> Message-ID: <20171122060728.I944@besplex.bde.org> References: <201711202138.vAKLcOxL080933@repo.freebsd.org> <20171121172511.W1210@besplex.bde.org> <20171121205309.F1819@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=ykFP3Gf8lMSxWv5rOTIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 20:06:12 -0000 On Tue, 21 Nov 2017, Bruce Evans wrote: > On Tue, 21 Nov 2017, Bruce Evans wrote: > >> On Mon, 20 Nov 2017, Conrad Meyer wrote: >> >>> Log: >>> msdosfs(5): Reflect READONLY attribute in file mode >> ... >> This undoes only a small part of READONLY changes in r254627 (which are >> small part of of r253627). I think r254627 got the READONLY semantics >> wrong, but they were almost consistent and well documented in the commit >> log. Now they are more seriously inconsistent. >> ... > PS: I now see a good reason to not change the READONLY attribute using > permissions (doing so is the inconsistent part of r254627), but perhaps > we should complete the undoing of the changes to ignore READONLY for > permissions. > > Under MSDOS or Windows, you have to use attrib to change attributes. > This corresponds to having to use chflags(1) under FreeBSD. Allowing > chmod(1) to change flags together with permissons gives confusing > non-orthogonal behaviour. Only old FreeBSD and old(?) Cygwin have to > do that since they don't have UF_READONLY (or even chflags). > > Example of non-orthogonal behaviour: the fake default permissions are > -r-xr-xr-x and attributes are R. You try to change this using chmod > u+w. This doesn't change the permissions, but it changes the attributes > to 0. Then on rebooting to msdosfs, the R attribute has been lost. It > is safer to require using only chflags(1 or 2) to change attributes. I now see the correct way to fix this. UF_READONLY should be independent of the permissions and act like a partial immutable flag. Changes for this: - back out the curent commit - remove toggling of ATTR_READONLY for setattr of the mode (the neglected change in r254627) - add return (EACCES) in msdosfs_setattr() if (accmode & VMUMBLE) && (dep->de_Attributes & ATTR_READONLY). Clone 3 lines in ffs for this. ffs used to use VWRITE for VMUMBLE in ufs_vaccessx(), but now uses (VMODIFY_PERMS & ~VADMIN_PERMS) in ufs_vaccess(). I think VWRITE is still enough for msdosfs. msdosfs doesn't use V*PERMS anywhere else. ffs also uses VMODIFY_PERMS for the v_type checks. I think they are for ACLs, but msdosfs doesn't support ACLs. Also check that ATTR_READONLY only prevents writing in MSDOS. It could reasonably make more things immutable. In Windows 7, for readonly files, the DEL commands gives "Access is Denied", but rm in Cygwin gives the POSIX behaviour of prompting for removal. We have lots of experience with the permissions in the mode having little to do with the actual permissions. Write bits in them remain set when the file becomes unwritable when immutable flag(s) or certain other flags are set. ACLs also affect accessibilty but not the mode. They just can't change the mode since their effect depends on user ids. The effect of file flags might also depend on user ids. UF_IMMUTABLE happens to deny writability for all users, but it doesn't deny changing itself for root. Note that after the above changes, ATTR_READONLY denies write access even for root, while its old effect on the permissions only denied write access to non-root. This is probably what is wanted. Bruce From owner-svn-src-head@freebsd.org Tue Nov 21 20:23: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 2382AD9364A; Tue, 21 Nov 2017 20:23:19 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBE187E753; Tue, 21 Nov 2017 20:23:18 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.104.138]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eHF4X-0001Sr-Iu; Tue, 21 Nov 2017 21:23:09 +0100 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, "Alan Somers" Subject: Re: svn commit: r326036 - head/sys/cam/scsi References: <201711202227.vAKMRYvW001932@repo.freebsd.org> Date: Tue, 21 Nov 2017 21:14:22 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <201711202227.vAKMRYvW001932@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.2 X-Spam-Status: No, score=-0.2 required=5.0 tests=ALL_TRUSTED, BAYES_50 autolearn=disabled version=3.4.0 X-Scan-Signature: 388a8ff653e0601f0215f26536afca72 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 20:23:19 -0000 Out of curiosity, What is the use case which this improves? Does happen in daily usage or mostly in testing? Regards, Ronald. On Mon, 20 Nov 2017 23:27:34 +0100, Alan Somers wrote: > Author: asomers > Date: Mon Nov 20 22:27:33 2017 > New Revision: 326036 > URL: https://svnweb.freebsd.org/changeset/base/326036 > > Log: > da(4): Short-circuit unnecessary BIO_FLUSH commands > sys/cam/scsi/scsi_da.c > Complete BIO_FLUSH commands immediately if the da(4) device hasn't > been written to since the last flush. If we haven't written to the > device, there is no reason to send a flush. > Submitted by: gibbs > Reviewed by: imp > MFC after: 3 weeks > Sponsored by: Spectra Logic Corp > Differential Revision: https://reviews.freebsd.org/D13106 > > Modified: > head/sys/cam/scsi/scsi_da.c > > Modified: head/sys/cam/scsi/scsi_da.c > ============================================================================== > --- head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:18:24 2017 (r326035) > +++ head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:27:33 2017 (r326036) > @@ -3038,6 +3038,18 @@ more: > } > case BIO_FLUSH: > /* > + * If we don't support sync cache, or the disk > + * isn't dirty, FLUSH is a no-op. Use the > + * allocated * CCB for the next bio if one is > + * available. > + */ > + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) != 0 || > + (softc->flags & DA_FLAG_DIRTY) == 0) { > + biodone(bp); > + goto skipstate; > + } > + > + /* > * BIO_FLUSH doesn't currently communicate > * range data, so we synchronize the cache > * over the whole disk. We also force > @@ -3052,6 +3064,15 @@ more: > /*lb_count*/0, > SSD_FULL_SIZE, > da_default_timeout*1000); > + /* > + * Clear the dirty flag before sending the command. > + * Either this sync cache will be successful, or it > + * will fail after a retry. If it fails, it is > + * unlikely to be successful if retried later, so > + * we'll save ourselves time by just marking the > + * device clean. > + */ > + softc->flags &= ~DA_FLAG_DIRTY; > break; > case BIO_ZONE: { > int error, queue_ccb; > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Tue Nov 21 20:31: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 22732D93AE4; Tue, 21 Nov 2017 20:31: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 E13F07ECB3; Tue, 21 Nov 2017 20:31: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 vALKVsN0063537; Tue, 21 Nov 2017 20:31:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALKVsph063536; Tue, 21 Nov 2017 20:31:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711212031.vALKVsph063536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 21 Nov 2017 20:31:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326074 - head/etc/periodic/daily X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/etc/periodic/daily X-SVN-Commit-Revision: 326074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 20:31:56 -0000 Author: emaste Date: Tue Nov 21 20:31:54 2017 New Revision: 326074 URL: https://svnweb.freebsd.org/changeset/base/326074 Log: filter all passwords (not only changed) from periodic passwd backup The periodic 200.backup-passwd script outputs any differences it finds in master.passwd, relative to the previous backup. It intends to elide the encrypted password field, but previously did so only for changed lines (i.e., those beginning with - or + in the diff). Apply the sed expression also to unchanged lines to also elide their passwords. PR: 223461 Reported by: Andre Albsmeier MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/etc/periodic/daily/200.backup-passwd Modified: head/etc/periodic/daily/200.backup-passwd ============================================================================== --- head/etc/periodic/daily/200.backup-passwd Tue Nov 21 19:55:32 2017 (r326073) +++ head/etc/periodic/daily/200.backup-passwd Tue Nov 21 20:31:54 2017 (r326074) @@ -42,7 +42,7 @@ case "$daily_backup_passwd_enable" in [ $rc -lt 1 ] && rc=1 echo "$host passwd diffs:" diff -uI '^#' $bak/master.passwd.bak /etc/master.passwd |\ - sed 's/^\([-+][^-+:]*\):[^:]*:/\1:(password):/' + sed 's/^\([-+ ][^-+:]*\):[^:]*:/\1:(password):/' mv $bak/master.passwd.bak $bak/master.passwd.bak2 cp -p /etc/master.passwd $bak/master.passwd.bak || rc=3 fi From owner-svn-src-head@freebsd.org Tue Nov 21 20:46: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 67A44D9426E; Tue, 21 Nov 2017 20:46:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDB87F47C; Tue, 21 Nov 2017 20:46:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vALKkLH7068901; Tue, 21 Nov 2017 20:46:21 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALKkLXi068899; Tue, 21 Nov 2017 20:46:21 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201711212046.vALKkLXi068899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 21 Nov 2017 20:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326075 - head/sys/contrib/cloudabi X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/sys/contrib/cloudabi X-SVN-Commit-Revision: 326075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 20:46:22 -0000 Author: ed Date: Tue Nov 21 20:46:21 2017 New Revision: 326075 URL: https://svnweb.freebsd.org/changeset/base/326075 Log: Import the latest CloudABI definitions, v0.18. In addition to some small style fixes to the ARMv6 vDSO, this release includes a new vDSO that can be used for the execution of ARMv6/ARMv7 code on 64-bit platforms. Just like for i686 on x86-64, this new vDSO is responsible for padding arguments and return values to 64-bit values, so that the kernel can easily forward system calls to the native system calls. Obtained from: https://github.com/NuxiNL/cloudabi Added: head/sys/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S (contents, props changed) Modified: head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S Modified: head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S ============================================================================== --- head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S Tue Nov 21 20:31:54 2017 (r326074) +++ head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S Tue Nov 21 20:46:21 2017 (r326075) @@ -39,9 +39,9 @@ ENTRY(cloudabi_sys_clock_res_get) mov ip, #0 swi 0 ldrcc r2, [sp, #-4] - strcc r0, [r2, 0] - strcc r1, [r2, 4] - movcc r0, $0 + strcc r0, [r2, #0] + strcc r1, [r2, #4] + movcc r0, #0 bx lr END(cloudabi_sys_clock_res_get) @@ -49,9 +49,9 @@ ENTRY(cloudabi_sys_clock_time_get) mov ip, #1 swi 0 ldrcc r2, [sp, #0] - strcc r0, [r2, 0] - strcc r1, [r2, 4] - movcc r0, $0 + strcc r0, [r2, #0] + strcc r1, [r2, #4] + movcc r0, #0 bx lr END(cloudabi_sys_clock_time_get) @@ -73,7 +73,7 @@ ENTRY(cloudabi_sys_fd_create1) swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_fd_create1) @@ -86,7 +86,7 @@ ENTRY(cloudabi_sys_fd_create2) ldrcc r3, [sp, #-8] strcc r0, [r2] strcc r1, [r3] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_fd_create2) @@ -102,7 +102,7 @@ ENTRY(cloudabi_sys_fd_dup) swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_fd_dup) @@ -111,7 +111,7 @@ ENTRY(cloudabi_sys_fd_pread) swi 0 ldrcc r2, [sp, #8] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_fd_pread) @@ -120,7 +120,7 @@ ENTRY(cloudabi_sys_fd_pwrite) swi 0 ldrcc r2, [sp, #8] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_fd_pwrite) @@ -130,7 +130,7 @@ ENTRY(cloudabi_sys_fd_read) swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_fd_read) @@ -144,9 +144,9 @@ ENTRY(cloudabi_sys_fd_seek) mov ip, #12 swi 0 ldrcc r2, [sp, #4] - strcc r0, [r2, 0] - strcc r1, [r2, 4] - movcc r0, $0 + strcc r0, [r2, #0] + strcc r1, [r2, #4] + movcc r0, #0 bx lr END(cloudabi_sys_fd_seek) @@ -174,7 +174,7 @@ ENTRY(cloudabi_sys_fd_write) swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_fd_write) @@ -207,7 +207,7 @@ ENTRY(cloudabi_sys_file_open) swi 0 ldrcc r2, [sp, #8] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_file_open) @@ -216,7 +216,7 @@ ENTRY(cloudabi_sys_file_readdir) swi 0 ldrcc r2, [sp, #8] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_file_readdir) @@ -225,7 +225,7 @@ ENTRY(cloudabi_sys_file_readlink) swi 0 ldrcc r2, [sp, #4] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_file_readlink) @@ -288,7 +288,7 @@ ENTRY(cloudabi_sys_mem_map) swi 0 ldrcc r2, [sp, #16] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_mem_map) @@ -316,7 +316,7 @@ ENTRY(cloudabi_sys_poll) swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_poll) @@ -340,7 +340,7 @@ ENTRY(cloudabi_sys_proc_fork) ldrcc r3, [sp, #-8] strcc r0, [r2] strcc r1, [r3] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_proc_fork) @@ -380,7 +380,7 @@ ENTRY(cloudabi_sys_thread_create) swi 0 ldrcc r2, [sp, #-4] strcc r0, [r2] - movcc r0, $0 + movcc r0, #0 bx lr END(cloudabi_sys_thread_create) Added: head/sys/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S Tue Nov 21 20:46:21 2017 (r326075) @@ -0,0 +1,732 @@ +// Copyright (c) 2016 Nuxi (https://nuxi.nl/) and contributors. +// +// 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. +// +// This file is automatically generated. Do not edit. +// +// Source: https://github.com/NuxiNL/cloudabi + +#define ENTRY(name) \ + .text; \ + .p2align 2; \ + .global name; \ + .type name, %function; \ +name: + +#define END(name) .size name, . - name + +ENTRY(cloudabi_sys_clock_res_get) + str r0, [sp, #-16] + str r1, [sp, #-20] + mov r0, #0 + sub r2, sp, #16 + swi 0 + ldrcc r1, [sp, #-20] + ldrcc r2, [sp, #-16] + strcc r2, [r1, #0] + ldrcc r2, [sp, #-12] + strcc r2, [r1, #4] + bx lr +END(cloudabi_sys_clock_res_get) + +ENTRY(cloudabi_sys_clock_time_get) + str r0, [sp, #-16] + str r2, [sp, #-8] + str r3, [sp, #-4] + mov r0, #1 + sub r2, sp, #16 + swi 0 + ldrcc r1, [sp, #0] + ldrcc r2, [sp, #-16] + strcc r2, [r1, #0] + ldrcc r2, [sp, #-12] + strcc r2, [r1, #4] + bx lr +END(cloudabi_sys_clock_time_get) + +ENTRY(cloudabi_sys_condvar_signal) + str r0, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r1, [sp, #-16] + str r2, [sp, #-8] + mov r0, #2 + sub r2, sp, #24 + swi 0 + bx lr +END(cloudabi_sys_condvar_signal) + +ENTRY(cloudabi_sys_fd_close) + str r0, [sp, #-16] + mov r0, #3 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_fd_close) + +ENTRY(cloudabi_sys_fd_create1) + str r0, [sp, #-16] + str r1, [sp, #-20] + mov r0, #4 + sub r2, sp, #16 + swi 0 + ldrcc r1, [sp, #-20] + ldrcc r2, [sp, #-16] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_fd_create1) + +ENTRY(cloudabi_sys_fd_create2) + str r0, [sp, #-16] + str r1, [sp, #-20] + str r2, [sp, #-24] + mov r0, #5 + sub r2, sp, #16 + swi 0 + ldrcc r1, [sp, #-20] + ldrcc r2, [sp, #-16] + strcc r2, [r1, #0] + ldrcc r1, [sp, #-24] + ldrcc r2, [sp, #-8] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_fd_create2) + +ENTRY(cloudabi_sys_fd_datasync) + str r0, [sp, #-16] + mov r0, #6 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_fd_datasync) + +ENTRY(cloudabi_sys_fd_dup) + str r0, [sp, #-16] + str r1, [sp, #-20] + mov r0, #7 + sub r2, sp, #16 + swi 0 + ldrcc r1, [sp, #-20] + ldrcc r2, [sp, #-16] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_fd_dup) + +ENTRY(cloudabi_sys_fd_pread) + str r0, [sp, #-32] + str r1, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r2, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #0] + str r1, [sp, #-8] + ldr r1, [sp, #4] + str r1, [sp, #-4] + mov r0, #8 + sub r2, sp, #32 + swi 0 + ldrcc r1, [sp, #8] + ldrcc r2, [sp, #-32] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_fd_pread) + +ENTRY(cloudabi_sys_fd_pwrite) + str r0, [sp, #-32] + str r1, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r2, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #0] + str r1, [sp, #-8] + ldr r1, [sp, #4] + str r1, [sp, #-4] + mov r0, #9 + sub r2, sp, #32 + swi 0 + ldrcc r1, [sp, #8] + ldrcc r2, [sp, #-32] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_fd_pwrite) + +ENTRY(cloudabi_sys_fd_read) + str r0, [sp, #-24] + str r1, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r2, [sp, #-8] + str r0, [sp, #-4] + str r3, [sp, #-28] + mov r0, #10 + sub r2, sp, #24 + swi 0 + ldrcc r1, [sp, #-28] + ldrcc r2, [sp, #-24] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_fd_read) + +ENTRY(cloudabi_sys_fd_replace) + str r0, [sp, #-16] + str r1, [sp, #-8] + mov r0, #11 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_fd_replace) + +ENTRY(cloudabi_sys_fd_seek) + str r0, [sp, #-24] + str r2, [sp, #-16] + str r3, [sp, #-12] + ldr r1, [sp, #0] + str r1, [sp, #-8] + mov r0, #12 + sub r2, sp, #24 + swi 0 + ldrcc r1, [sp, #4] + ldrcc r2, [sp, #-24] + strcc r2, [r1, #0] + ldrcc r2, [sp, #-20] + strcc r2, [r1, #4] + bx lr +END(cloudabi_sys_fd_seek) + +ENTRY(cloudabi_sys_fd_stat_get) + str r0, [sp, #-16] + str r1, [sp, #-8] + mov r0, #0 + str r0, [sp, #-4] + mov r0, #13 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_fd_stat_get) + +ENTRY(cloudabi_sys_fd_stat_put) + str r0, [sp, #-24] + str r1, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r2, [sp, #-8] + mov r0, #14 + sub r2, sp, #24 + swi 0 + bx lr +END(cloudabi_sys_fd_stat_put) + +ENTRY(cloudabi_sys_fd_sync) + str r0, [sp, #-16] + mov r0, #15 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_fd_sync) + +ENTRY(cloudabi_sys_fd_write) + str r0, [sp, #-24] + str r1, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r2, [sp, #-8] + str r0, [sp, #-4] + str r3, [sp, #-28] + mov r0, #16 + sub r2, sp, #24 + swi 0 + ldrcc r1, [sp, #-28] + ldrcc r2, [sp, #-24] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_fd_write) + +ENTRY(cloudabi_sys_file_advise) + str r0, [sp, #-32] + str r2, [sp, #-24] + str r3, [sp, #-20] + ldr r1, [sp, #0] + str r1, [sp, #-16] + ldr r1, [sp, #4] + str r1, [sp, #-12] + ldr r1, [sp, #8] + str r1, [sp, #-8] + mov r0, #17 + sub r2, sp, #32 + swi 0 + bx lr +END(cloudabi_sys_file_advise) + +ENTRY(cloudabi_sys_file_allocate) + str r0, [sp, #-24] + str r2, [sp, #-16] + str r3, [sp, #-12] + ldr r1, [sp, #0] + str r1, [sp, #-8] + ldr r1, [sp, #4] + str r1, [sp, #-4] + mov r0, #18 + sub r2, sp, #24 + swi 0 + bx lr +END(cloudabi_sys_file_allocate) + +ENTRY(cloudabi_sys_file_create) + str r0, [sp, #-32] + str r1, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r2, [sp, #-16] + str r0, [sp, #-12] + str r3, [sp, #-8] + mov r0, #19 + sub r2, sp, #32 + swi 0 + bx lr +END(cloudabi_sys_file_create) + +ENTRY(cloudabi_sys_file_link) + str r0, [sp, #-48] + str r1, [sp, #-44] + str r2, [sp, #-40] + mov r0, #0 + str r0, [sp, #-36] + str r3, [sp, #-32] + str r0, [sp, #-28] + ldr r1, [sp, #0] + str r1, [sp, #-24] + ldr r1, [sp, #4] + str r1, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #8] + str r1, [sp, #-8] + str r0, [sp, #-4] + mov r0, #20 + sub r2, sp, #48 + swi 0 + bx lr +END(cloudabi_sys_file_link) + +ENTRY(cloudabi_sys_file_open) + str r0, [sp, #-40] + str r1, [sp, #-36] + str r2, [sp, #-32] + mov r0, #0 + str r0, [sp, #-28] + str r3, [sp, #-24] + str r0, [sp, #-20] + ldr r1, [sp, #0] + str r1, [sp, #-16] + ldr r1, [sp, #4] + str r1, [sp, #-8] + str r0, [sp, #-4] + mov r0, #21 + sub r2, sp, #40 + swi 0 + ldrcc r1, [sp, #8] + ldrcc r2, [sp, #-40] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_file_open) + +ENTRY(cloudabi_sys_file_readdir) + str r0, [sp, #-32] + str r1, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r2, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #0] + str r1, [sp, #-8] + ldr r1, [sp, #4] + str r1, [sp, #-4] + mov r0, #22 + sub r2, sp, #32 + swi 0 + ldrcc r1, [sp, #8] + ldrcc r2, [sp, #-32] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_file_readdir) + +ENTRY(cloudabi_sys_file_readlink) + str r0, [sp, #-40] + str r1, [sp, #-32] + mov r0, #0 + str r0, [sp, #-28] + str r2, [sp, #-24] + str r0, [sp, #-20] + str r3, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #0] + str r1, [sp, #-8] + str r0, [sp, #-4] + mov r0, #23 + sub r2, sp, #40 + swi 0 + ldrcc r1, [sp, #4] + ldrcc r2, [sp, #-40] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_file_readlink) + +ENTRY(cloudabi_sys_file_rename) + str r0, [sp, #-48] + str r1, [sp, #-40] + mov r0, #0 + str r0, [sp, #-36] + str r2, [sp, #-32] + str r0, [sp, #-28] + str r3, [sp, #-24] + ldr r1, [sp, #0] + str r1, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #4] + str r1, [sp, #-8] + str r0, [sp, #-4] + mov r0, #24 + sub r2, sp, #48 + swi 0 + bx lr +END(cloudabi_sys_file_rename) + +ENTRY(cloudabi_sys_file_stat_fget) + str r0, [sp, #-16] + str r1, [sp, #-8] + mov r0, #0 + str r0, [sp, #-4] + mov r0, #25 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_file_stat_fget) + +ENTRY(cloudabi_sys_file_stat_fput) + str r0, [sp, #-24] + str r1, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r2, [sp, #-8] + mov r0, #26 + sub r2, sp, #24 + swi 0 + bx lr +END(cloudabi_sys_file_stat_fput) + +ENTRY(cloudabi_sys_file_stat_get) + str r0, [sp, #-32] + str r1, [sp, #-28] + str r2, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r3, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #0] + str r1, [sp, #-8] + str r0, [sp, #-4] + mov r0, #27 + sub r2, sp, #32 + swi 0 + bx lr +END(cloudabi_sys_file_stat_get) + +ENTRY(cloudabi_sys_file_stat_put) + str r0, [sp, #-40] + str r1, [sp, #-36] + str r2, [sp, #-32] + mov r0, #0 + str r0, [sp, #-28] + str r3, [sp, #-24] + str r0, [sp, #-20] + ldr r1, [sp, #0] + str r1, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #4] + str r1, [sp, #-8] + mov r0, #28 + sub r2, sp, #40 + swi 0 + bx lr +END(cloudabi_sys_file_stat_put) + +ENTRY(cloudabi_sys_file_symlink) + str r0, [sp, #-40] + mov r0, #0 + str r0, [sp, #-36] + str r1, [sp, #-32] + str r0, [sp, #-28] + str r2, [sp, #-24] + str r3, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #0] + str r1, [sp, #-8] + str r0, [sp, #-4] + mov r0, #29 + sub r2, sp, #40 + swi 0 + bx lr +END(cloudabi_sys_file_symlink) + +ENTRY(cloudabi_sys_file_unlink) + str r0, [sp, #-32] + str r1, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r2, [sp, #-16] + str r0, [sp, #-12] + str r3, [sp, #-8] + mov r0, #30 + sub r2, sp, #32 + swi 0 + bx lr +END(cloudabi_sys_file_unlink) + +ENTRY(cloudabi_sys_lock_unlock) + str r0, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r1, [sp, #-8] + mov r0, #31 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_lock_unlock) + +ENTRY(cloudabi_sys_mem_advise) + str r0, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r1, [sp, #-16] + str r0, [sp, #-12] + str r2, [sp, #-8] + mov r0, #32 + sub r2, sp, #24 + swi 0 + bx lr +END(cloudabi_sys_mem_advise) + +ENTRY(cloudabi_sys_mem_map) + str r0, [sp, #-48] + mov r0, #0 + str r0, [sp, #-44] + str r1, [sp, #-40] + str r0, [sp, #-36] + str r2, [sp, #-32] + str r3, [sp, #-24] + ldr r1, [sp, #0] + str r1, [sp, #-16] + ldr r1, [sp, #8] + str r1, [sp, #-8] + ldr r1, [sp, #12] + str r1, [sp, #-4] + mov r0, #33 + sub r2, sp, #48 + swi 0 + ldrcc r1, [sp, #16] + ldrcc r2, [sp, #-48] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_mem_map) + +ENTRY(cloudabi_sys_mem_protect) + str r0, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r1, [sp, #-16] + str r0, [sp, #-12] + str r2, [sp, #-8] + mov r0, #34 + sub r2, sp, #24 + swi 0 + bx lr +END(cloudabi_sys_mem_protect) + +ENTRY(cloudabi_sys_mem_sync) + str r0, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r1, [sp, #-16] + str r0, [sp, #-12] + str r2, [sp, #-8] + mov r0, #35 + sub r2, sp, #24 + swi 0 + bx lr +END(cloudabi_sys_mem_sync) + +ENTRY(cloudabi_sys_mem_unmap) + str r0, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r1, [sp, #-8] + str r0, [sp, #-4] + mov r0, #36 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_mem_unmap) + +ENTRY(cloudabi_sys_poll) + str r0, [sp, #-24] + mov r0, #0 + str r0, [sp, #-20] + str r1, [sp, #-16] + str r0, [sp, #-12] + str r2, [sp, #-8] + str r0, [sp, #-4] + str r3, [sp, #-28] + mov r0, #37 + sub r2, sp, #24 + swi 0 + ldrcc r1, [sp, #-28] + ldrcc r2, [sp, #-24] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_poll) + +ENTRY(cloudabi_sys_proc_exec) + str r0, [sp, #-40] + str r1, [sp, #-32] + mov r0, #0 + str r0, [sp, #-28] + str r2, [sp, #-24] + str r0, [sp, #-20] + str r3, [sp, #-16] + str r0, [sp, #-12] + ldr r1, [sp, #0] + str r1, [sp, #-8] + str r0, [sp, #-4] + mov r0, #38 + sub r2, sp, #40 + swi 0 + bx lr +END(cloudabi_sys_proc_exec) + +ENTRY(cloudabi_sys_proc_exit) + str r0, [sp, #-16] + mov r0, #39 + sub r2, sp, #16 + swi 0 +END(cloudabi_sys_proc_exit) + +ENTRY(cloudabi_sys_proc_fork) + str r0, [sp, #-20] + str r1, [sp, #-24] + mov r0, #40 + sub r2, sp, #16 + swi 0 + ldrcc r1, [sp, #-20] + ldrcc r2, [sp, #-16] + strcc r2, [r1, #0] + ldrcc r1, [sp, #-24] + ldrcc r2, [sp, #-8] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_proc_fork) + +ENTRY(cloudabi_sys_proc_raise) + str r0, [sp, #-16] + mov r0, #41 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_proc_raise) + +ENTRY(cloudabi_sys_random_get) + str r0, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r1, [sp, #-8] + str r0, [sp, #-4] + mov r0, #42 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_random_get) + +ENTRY(cloudabi_sys_sock_recv) + str r0, [sp, #-24] + str r1, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r2, [sp, #-8] + str r0, [sp, #-4] + mov r0, #43 + sub r2, sp, #24 + swi 0 + bx lr +END(cloudabi_sys_sock_recv) + +ENTRY(cloudabi_sys_sock_send) + str r0, [sp, #-24] + str r1, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r2, [sp, #-8] + str r0, [sp, #-4] + mov r0, #44 + sub r2, sp, #24 + swi 0 + bx lr +END(cloudabi_sys_sock_send) + +ENTRY(cloudabi_sys_sock_shutdown) + str r0, [sp, #-16] + str r1, [sp, #-8] + mov r0, #45 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_sock_shutdown) + +ENTRY(cloudabi_sys_thread_create) + str r0, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r1, [sp, #-20] + mov r0, #46 + sub r2, sp, #16 + swi 0 + ldrcc r1, [sp, #-20] + ldrcc r2, [sp, #-16] + strcc r2, [r1, #0] + bx lr +END(cloudabi_sys_thread_create) + +ENTRY(cloudabi_sys_thread_exit) + str r0, [sp, #-16] + mov r0, #0 + str r0, [sp, #-12] + str r1, [sp, #-8] + mov r0, #47 + sub r2, sp, #16 + swi 0 +END(cloudabi_sys_thread_exit) + +ENTRY(cloudabi_sys_thread_yield) + mov r0, #48 + sub r2, sp, #16 + swi 0 + bx lr +END(cloudabi_sys_thread_yield) From owner-svn-src-head@freebsd.org Tue Nov 21 21:59: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 41F49DB925D; Tue, 21 Nov 2017 21:59:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id E44A481E83; Tue, 21 Nov 2017 21:59:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.103] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 0FFE04291F6; Wed, 22 Nov 2017 08:59:23 +1100 (AEDT) Date: Wed, 22 Nov 2017 08:59:21 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat In-Reply-To: <201711211955.vALJtWhg047906@repo.freebsd.org> Message-ID: <20171122071838.R1172@besplex.bde.org> References: <201711211955.vALJtWhg047906@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cK6QihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=b_FpOTPr5VSwczORgtkA:9 a=QD5b3kn-UabY2wpG:21 a=u3okRz4vJsz7I5Df:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Nov 2017 21:59:26 -0000 On Tue, 21 Nov 2017, Konstantin Belousov wrote: > Log: > systat: use and correctly display 64bit counters. > > Following struct vmtotal changes, make systat use and correctly > display 64-bit counters. Switch to humanize_number(3) to overcome > homegrown arithmetics limits in pretty printing large numbers. Use > 1024 as a divisor for memory fields to make it consistent with other > tools and users expectations. I don't like dehumanize_number(), and it can't handle most cases in systat -v since most cases use floating point. Using unsigned types gives sign extension bugs as usual. In old versions version, large unsigned numbers (only their lower 32 bits) were not unintentionally printed in signed format to get an early warning about overflow when they reach half-way to 32-bit overflow. This is no longer useful, but signed format is still used. There are related sign extension bugs for non-64-bit fields that allow the early warning to still work. > Modified: head/usr.bin/systat/vmstat.c > ============================================================================== > --- head/usr.bin/systat/vmstat.c Tue Nov 21 19:23:20 2017 (r326072) > +++ head/usr.bin/systat/vmstat.c Tue Nov 21 19:55:32 2017 (r326073) > @@ -138,6 +140,8 @@ static float cputime(int); > static void dinfo(int, int, struct statinfo *, struct statinfo *); > static void getinfo(struct Info *); > static void putint(int, int, int, int); > +static void putuint64(uint64_t, int, int, int); > +static void do_putuint64(uint64_t, int, int, int, int); Style bug (unsorting). > static void putfloat(double, int, int, int, int, int); > static void putlongdouble(long double, int, int, int, int, int); > static int ucount(void); > @@ -491,15 +495,15 @@ showkre(void) > putfloat(100.0 * s.v_kmem_map_size / kmem_size, > STATROW + 1, STATCOL + 22, 2, 0, 1); > > - putint(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); > - putint(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); > - putint(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); > - putint(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); > - putint(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); > - putint(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); > - putint(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); > - putint(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); > - putint(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); > + putuint64(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); > + putuint64(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); > + putuint64(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); > + putuint64(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); > + putuint64(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); > + putuint64(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); > + putuint64(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); > + putuint64(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); > + putuint64(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); I see that a very recent expansion from int32_t to uint64_t didn't work here. > putint(total.t_rq - 1, PROCSROW + 2, PROCSCOL, 3); > putint(total.t_pw, PROCSROW + 2, PROCSCOL + 4, 3); > putint(total.t_dw, PROCSROW + 2, PROCSCOL + 8, 3); This has larger sign extension bugs than before. All the fields here are still int16_t. putint() still takes int args, and so the int16_t's int converted to int. The used to be printed as int, but now they are converted to uint64_t. They shouldn't be negative, but if they are then the were printed as negative. Now the conversion to uint64_t has sign-extension bugs/overflows for negative values. Negative values still be printed as negative via further overflows, but if the values are passed to dehumanize_number(), they are printed as enormous unsigned values. Printing everything as 64 bits is a pessimization. It would probably work to convert everything to float and use only putfloat(). This gives about 8 digits of accuracy and even that is often too many. This was not done mainly because floating point was slower than integers. Now it might be faster than uint64_t. Flots could also be converted to integers except for printing the percentage and not much more. A special case for the percentage would be easy to write and is already partly there to avoid printing 100.0 which is too wide. This was not done mainly because 32-bit ints were too small. > @@ -518,13 +522,13 @@ showkre(void) > PUTRATE(v_pdwakeups, VMSTATROW + 9, VMSTATCOL, 8); > PUTRATE(v_pdpages, VMSTATROW + 10, VMSTATCOL, 8); > PUTRATE(v_intrans, VMSTATROW + 11, VMSTATCOL, 8); > - putint(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); > - putint(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); > - putint(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); > - putint(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); > - putint(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); > + putuint64(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); > + putuint64(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); > + putuint64(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); > + putuint64(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); > + putuint64(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); This is bogus. The fields still have type u_int. pgtokb() expands by a factor of 4 or 8, and putuint64() can handle the expansion, but pgtokb() still overflows before the value can be passed. Overflow occurs at 1K * 4G = 4T. I think that much memory costs about $100000 so no one here has it. > if (LINES - 1 > VMSTATROW + 17) > - putint(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); > + putuint64(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); s.bufspace has the bogus type long, so in 32-bit systems overflow occurs with only 2T of bufspace, and on 64-bit systems the expansion can overflow even uint64_t, but the world doesn't have that much memory (2T * 2**32). > PUTRATE(v_vnodein, PAGEROW + 2, PAGECOL + 6, 5); > PUTRATE(v_vnodeout, PAGEROW + 2, PAGECOL + 12, 5); > PUTRATE(v_swapin, PAGEROW + 2, PAGECOL + 19, 5); > @@ -666,8 +670,23 @@ cputime(int indx) > static void > putint(int n, int l, int lc, int w) > { > + > + do_putuint64(n, l, lc, w, SI); Sign extension busg for promoting int to uint64_t. > +} > + > +static void > +putuint64(uint64_t n, int l, int lc, int w) > +{ > + > + do_putuint64(n, l, lc, w, IEC); > +} The divisor is a bit too specialized (IEC is forced for all uint64_t) > + > +static void > +do_putuint64(uint64_t n, int l, int lc, int w, int div) > +{ > int snr; > char b[128]; > + char buf[128]; > > move(l, lc); > #ifdef DEBUG > @@ -680,11 +699,12 @@ putint(int n, int l, int lc, int w) > addch(' '); > return; > } > - snr = snprintf(b, sizeof(b), "%*d", w, n); > - if (snr != w) > - snr = snprintf(b, sizeof(b), "%*dk", w - 1, n / 1000); > - if (snr != w) > - snr = snprintf(b, sizeof(b), "%*dM", w - 1, n / 1000000); The signed format used to match the signed arg. The early warning hack mostly operated earlier -- u_int args sometimes overflowed to pass them here as ints. The overflow gave had implementation-defined behaviour earlier but the behaviour here is defined. > + snr = snprintf(b, sizeof(b), "%*jd", w, (uintmax_t)n); The signed format no longer matches the unsigned arg. It still gives the early warning hack via overflow earlier in most cases. The behaviour here is undefined iff (uintmax_t)n exceeds INTMAX_MAX. Conversion to uintmax_t breaks the hack on unsupported arches when uintmax_t is larger than uint64_t. Then if we start with signed -1, it becomes 0xffffffffffffffff as a uint64_t and expanding that loses the original sign bit in a non-recoverable way. > + if (snr != w) { > + humanize_number(buf, w, n, "", HN_AUTOSCALE, > + HN_NOSPACE | HN_DECIMAL | div); If this case is reached, then it loses the sign bit in another non-recoverable way (by not accidentally recovering it). > + snr = snprintf(b, sizeof(b), "%*s", w, buf); > + } > if (snr != w) { This case is almost (?) unreachable now. It only occurs if b < 3 or if dehumanize_number() doesn't have enough suffixes to reach UINT64_MAX. Otherwise, it can always print 0 or 1 followed by the largest suffix and a NUL. It seems to be 1 suffix short. The largest prefix is E (exa), and UINT64_MAX is 18.4E which should be printed as 18E, but that takes b >= 4. > while (w-- > 0) > addch('*'); This returns a field full of stars if the value doesn't fit. I like this for showing fields with preposterous values more clearly than something like 18E. Bruce From owner-svn-src-head@freebsd.org Tue Nov 21 23:15: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 2D0DEDBA911; Tue, 21 Nov 2017 23:15:22 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE09D3473; Tue, 21 Nov 2017 23:15:21 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vALNFKPB033030; Tue, 21 Nov 2017 23:15:20 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALNFK6G033023; Tue, 21 Nov 2017 23:15:20 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201711212315.vALNFK6G033023@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 21 Nov 2017 23:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326079 - in head/sys: dev/bhnd dev/bhnd/bcma dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/cores/pci dev/bhnd/cores/usb dev/bhnd/siba mips/broadcom mips/include mips/mips X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys: dev/bhnd dev/bhnd/bcma dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/cores/pci dev/bhnd/cores/usb dev/bhnd/siba mips/broadcom mips/include mips/mips X-SVN-Commit-Revision: 326079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 23:15:22 -0000 Author: landonf Date: Tue Nov 21 23:15:20 2017 New Revision: 326079 URL: https://svnweb.freebsd.org/changeset/base/326079 Log: bhnd(4): implement MIPS and PCI(e) interrupt support On BHND MIPS SoCs, this replaces the use of hard-coded MIPS IRQ#s in the common bhnd(4) core drivers; we now register an INTRNG child PIC that handles routing of backplane interrupt vectors via the MIPS core. On BHND PCI devices, backplane interrupt vectors are now routed to the PCI/PCIe host bridge core when bus_setup_intr() is called, where they are dispatched by the PCI core via a host interrupt (e.g. INTx/MSI). The bhndb(4) bridge driver tracks registered interrupt handlers for the bridged bhnd(4) devices and manages backplane interrupt routing, while delegating actual bus interrupt setup/teardown to the parent bus on behalf of the bridged cores. Approved by: adrian (mentor, implicit) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12518 Added: head/sys/mips/broadcom/bcm_mips.c (contents, props changed) head/sys/mips/broadcom/bcm_mipsvar.h (contents, props changed) Modified: head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bcma/bcma_subr.c head/sys/dev/bhnd/bcma/bcmavar.h head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_ids.h head/sys/dev/bhnd/bhnd_match.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhnd_bhndb.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb_if.m head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndb/bhndb_pcireg.h head/sys/dev/bhnd/bhndb/bhndb_pcivar.h head/sys/dev/bhnd/bhndb/bhndb_private.h head/sys/dev/bhnd/bhndb/bhndb_subr.c head/sys/dev/bhnd/bhndb/bhndbvar.h head/sys/dev/bhnd/bhndvar.h head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipc_private.h head/sys/dev/bhnd/cores/chipc/chipc_subr.c head/sys/dev/bhnd/cores/chipc/chipcvar.h head/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c head/sys/dev/bhnd/cores/usb/bhnd_usb.c head/sys/dev/bhnd/cores/usb/bhnd_usbvar.h head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_bhndb.c head/sys/dev/bhnd/siba/siba_erom.c head/sys/dev/bhnd/siba/siba_subr.c head/sys/dev/bhnd/siba/sibareg.h head/sys/dev/bhnd/siba/sibavar.h head/sys/mips/broadcom/bcm_bmips.c head/sys/mips/broadcom/bcm_machdep.c head/sys/mips/broadcom/bcm_machdep.h head/sys/mips/broadcom/bcm_mips74k.c head/sys/mips/broadcom/bcm_mips74kreg.h head/sys/mips/broadcom/bcma_nexus.c head/sys/mips/broadcom/bhnd_nexus.c head/sys/mips/broadcom/files.broadcom head/sys/mips/broadcom/siba_nexus.c head/sys/mips/include/intr.h head/sys/mips/mips/mips_pic.c Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Tue Nov 21 22:06:49 2017 (r326078) +++ head/sys/dev/bhnd/bcma/bcma.c Tue Nov 21 23:15:20 2017 (r326079) @@ -1,7 +1,11 @@ /*- - * Copyright (c) 2015 Landon Fuller + * Copyright (c) 2015-2016 Landon Fuller + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Landon Fuller + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -124,7 +128,7 @@ bcma_child_deleted(device_t dev, device_t child) /* Free bcma device info */ if ((dinfo = device_get_ivars(child)) != NULL) - bcma_free_dinfo(dev, dinfo); + bcma_free_dinfo(dev, child, dinfo); device_set_ivars(child, NULL); } @@ -613,66 +617,46 @@ bcma_get_region_addr(device_t dev, device_t child, bhn /** * Default bcma(4) bus driver implementation of BHND_BUS_GET_INTR_COUNT(). - * - * This implementation consults @p child's agent register block, - * returning the number of interrupt output lines routed to @p child. */ -int +u_int bcma_get_intr_count(device_t dev, device_t child) { - struct bcma_devinfo *dinfo; - uint32_t dmpcfg, oobw; + struct bcma_devinfo *dinfo; - dinfo = device_get_ivars(child); + /* delegate non-bus-attached devices to our parent */ + if (device_get_parent(child) != dev) + return (BHND_BUS_GET_INTR_COUNT(device_get_parent(dev), child)); - /* Agent block must be mapped */ - if (dinfo->res_agent == NULL) - return (0); - - /* Agent must support OOB */ - dmpcfg = bhnd_bus_read_4(dinfo->res_agent, BCMA_DMP_CONFIG); - if (!BCMA_DMP_GET_FLAG(dmpcfg, BCMA_DMP_CFG_OOB)) - return (0); - - /* Return OOB width as interrupt count */ - oobw = bhnd_bus_read_4(dinfo->res_agent, - BCMA_DMP_OOB_OUTWIDTH(BCMA_OOB_BANK_INTR)); - if (oobw > BCMA_OOB_NUM_SEL) { - device_printf(dev, "ignoring invalid OOBOUTWIDTH for core %u: " - "%#x\n", BCMA_DINFO_COREIDX(dinfo), oobw); - return (0); - } - - return (oobw); + dinfo = device_get_ivars(child); + return (dinfo->num_intrs); } /** - * Default bcma(4) bus driver implementation of BHND_BUS_GET_CORE_IVEC(). - * - * This implementation consults @p child's agent register block, - * returning the interrupt output line routed to @p child, at OOB selector - * @p intr. + * Default bcma(4) bus driver implementation of BHND_BUS_GET_INTR_IVEC(). */ int -bcma_get_core_ivec(device_t dev, device_t child, u_int intr, uint32_t *ivec) +bcma_get_intr_ivec(device_t dev, device_t child, u_int intr, u_int *ivec) { struct bcma_devinfo *dinfo; - uint32_t oobsel; + struct bcma_intr *desc; + /* delegate non-bus-attached devices to our parent */ + if (device_get_parent(child) != dev) { + return (BHND_BUS_GET_INTR_IVEC(device_get_parent(dev), child, + intr, ivec)); + } + dinfo = device_get_ivars(child); - /* Interrupt ID must be valid. */ - if (intr >= bcma_get_intr_count(dev, child)) - return (ENXIO); + STAILQ_FOREACH(desc, &dinfo->intrs, i_link) { + if (desc->i_sel == intr) { + *ivec = desc->i_busline; + return (0); + } + } - /* Fetch OOBSEL busline value */ - KASSERT(dinfo->res_agent != NULL, ("missing agent registers")); - oobsel = bhnd_bus_read_4(dinfo->res_agent, BCMA_DMP_OOBSELOUT( - BCMA_OOB_BANK_INTR, intr)); - *ivec = (oobsel >> BCMA_DMP_OOBSEL_SHIFT(intr)) & - BCMA_DMP_OOBSEL_BUSLINE_MASK; - - return (0); + /* Not found */ + return (ENXIO); } /** @@ -707,8 +691,6 @@ bcma_add_children(device_t bus) /* Add all cores. */ bcma_erom = (struct bcma_erom *)erom; while ((error = bcma_erom_next_corecfg(bcma_erom, &corecfg)) == 0) { - int nintr; - /* Add the child device */ child = BUS_ADD_CHILD(bus, 0, NULL, -1); if (child == NULL) { @@ -718,27 +700,12 @@ bcma_add_children(device_t bus) /* Initialize device ivars */ dinfo = device_get_ivars(child); - if ((error = bcma_init_dinfo(bus, dinfo, corecfg))) + if ((error = bcma_init_dinfo(bus, child, dinfo, corecfg))) goto cleanup; /* The dinfo instance now owns the corecfg value */ corecfg = NULL; - /* Allocate device's agent registers, if any */ - if ((error = bcma_dinfo_alloc_agent(bus, child, dinfo))) - goto cleanup; - - /* Assign interrupts */ - nintr = bhnd_get_intr_count(child); - for (int rid = 0; rid < nintr; rid++) { - error = BHND_BUS_ASSIGN_INTR(bus, child, rid); - if (error) { - device_printf(bus, "failed to assign interrupt " - "%d to core %u: %d\n", rid, - BCMA_DINFO_COREIDX(dinfo), error); - } - } - /* If pins are floating or the hardware is otherwise * unpopulated, the device shouldn't be used. */ if (bhnd_is_hw_disabled(child)) @@ -794,7 +761,7 @@ static device_method_t bcma_methods[] = { DEVMETHOD(bhnd_bus_decode_port_rid, bcma_decode_port_rid), DEVMETHOD(bhnd_bus_get_region_addr, bcma_get_region_addr), DEVMETHOD(bhnd_bus_get_intr_count, bcma_get_intr_count), - DEVMETHOD(bhnd_bus_get_core_ivec, bcma_get_core_ivec), + DEVMETHOD(bhnd_bus_get_intr_ivec, bcma_get_intr_ivec), DEVMETHOD_END }; Modified: head/sys/dev/bhnd/bcma/bcma_subr.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_subr.c Tue Nov 21 22:06:49 2017 (r326078) +++ head/sys/dev/bhnd/bcma/bcma_subr.c Tue Nov 21 23:15:20 2017 (r326079) @@ -1,7 +1,11 @@ /*- - * Copyright (c) 2015 Landon Fuller + * Copyright (c) 2015-2016 Landon Fuller + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Landon Fuller + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -154,7 +158,7 @@ bcma_corecfg_get_port_list(struct bcma_corecfg *cfg, b * @param ports The set of ports to be enumerated */ static void -bcma_dinfo_init_resource_info(device_t bus, struct bcma_devinfo *dinfo, +bcma_dinfo_init_port_resource_info(device_t bus, struct bcma_devinfo *dinfo, struct bcma_sport_list *ports) { struct bcma_map *map; @@ -193,7 +197,127 @@ bcma_dinfo_init_resource_info(device_t bus, struct bcm } + /** + * Allocate the per-core agent register block for a device info structure. + * + * If an agent0.0 region is not defined on @p dinfo, the device info + * agent resource is set to NULL and 0 is returned. + * + * @param bus The requesting bus device. + * @param child The bcma child device. + * @param dinfo The device info associated with @p child + * + * @retval 0 success + * @retval non-zero resource allocation failed. + */ +static int +bcma_dinfo_init_agent(device_t bus, device_t child, struct bcma_devinfo *dinfo) +{ + bhnd_addr_t addr; + bhnd_size_t size; + rman_res_t r_start, r_count, r_end; + int error; + + KASSERT(dinfo->res_agent == NULL, ("double allocation of agent")); + + /* Verify that the agent register block exists and is + * mappable */ + if (bhnd_get_port_rid(child, BHND_PORT_AGENT, 0, 0) == -1) + return (0); /* nothing to do */ + + /* Fetch the address of the agent register block */ + error = bhnd_get_region_addr(child, BHND_PORT_AGENT, 0, 0, + &addr, &size); + if (error) { + device_printf(bus, "failed fetching agent register block " + "address for core %u\n", BCMA_DINFO_COREIDX(dinfo)); + return (error); + } + + /* Allocate the resource */ + r_start = addr; + r_count = size; + r_end = r_start + r_count - 1; + + dinfo->rid_agent = BCMA_AGENT_RID(dinfo); + dinfo->res_agent = BHND_BUS_ALLOC_RESOURCE(bus, bus, SYS_RES_MEMORY, + &dinfo->rid_agent, r_start, r_end, r_count, RF_ACTIVE|RF_SHAREABLE); + if (dinfo->res_agent == NULL) { + device_printf(bus, "failed allocating agent register block for " + "core %u\n", BCMA_DINFO_COREIDX(dinfo)); + return (ENXIO); + } + + return (0); +} + +/** + * Populate the list of interrupts for a device info structure + * previously initialized via bcma_dinfo_alloc_agent(). + * + * If an agent0.0 region is not mapped on @p dinfo, the OOB interrupt bank is + * assumed to be unavailable and 0 is returned. + * + * @param bus The requesting bus device. + * @param dinfo The device info instance to be initialized. + */ +static int +bcma_dinfo_init_intrs(device_t bus, device_t child, + struct bcma_devinfo *dinfo) +{ + uint32_t dmpcfg, oobw; + + /* Agent block must be mapped */ + if (dinfo->res_agent == NULL) + return (0); + + /* Agent must support OOB */ + dmpcfg = bhnd_bus_read_4(dinfo->res_agent, BCMA_DMP_CONFIG); + if (!BCMA_DMP_GET_FLAG(dmpcfg, BCMA_DMP_CFG_OOB)) + return (0); + + /* Fetch width of the OOB interrupt bank */ + oobw = bhnd_bus_read_4(dinfo->res_agent, + BCMA_DMP_OOB_OUTWIDTH(BCMA_OOB_BANK_INTR)); + if (oobw > BCMA_OOB_NUM_SEL) { + device_printf(bus, "ignoring invalid OOBOUTWIDTH for core %u: " + "%#x\n", BCMA_DINFO_COREIDX(dinfo), oobw); + return (0); + } + + /* Fetch OOBSEL busline values and populate list of interrupt + * descriptors */ + for (uint32_t sel = 0; sel < oobw; sel++) { + struct bcma_intr *intr; + uint32_t selout; + uint8_t line; + + if (dinfo->num_intrs == UINT_MAX) + return (ENOMEM); + + selout = bhnd_bus_read_4(dinfo->res_agent, BCMA_DMP_OOBSELOUT( + BCMA_OOB_BANK_INTR, sel)); + + line = (selout >> BCMA_DMP_OOBSEL_SHIFT(sel)) & + BCMA_DMP_OOBSEL_BUSLINE_MASK; + + intr = bcma_alloc_intr(BCMA_OOB_BANK_INTR, sel, line); + if (intr == NULL) { + device_printf(bus, "failed allocating interrupt " + "descriptor %#x for core %u\n", sel, + BCMA_DINFO_COREIDX(dinfo)); + return (ENOMEM); + } + + STAILQ_INSERT_HEAD(&dinfo->intrs, intr, i_link); + dinfo->num_intrs++; + } + + return (0); +} + +/** * Allocate and return a new empty device info structure. * * @param bus The requesting bus device. @@ -213,6 +337,9 @@ bcma_alloc_dinfo(device_t bus) dinfo->res_agent = NULL; dinfo->rid_agent = -1; + STAILQ_INIT(&dinfo->intrs); + dinfo->num_intrs = 0; + resource_list_init(&dinfo->resources); return (dinfo); @@ -224,7 +351,8 @@ bcma_alloc_dinfo(device_t bus) * configuration. * * @param bus The requesting bus device. - * @param dinfo The device info instance. + * @param child The bcma child device. + * @param dinfo The device info associated with @p child * @param corecfg Device core configuration; ownership of this value * will be assumed by @p dinfo. * @@ -232,9 +360,12 @@ bcma_alloc_dinfo(device_t bus) * @retval non-zero initialization failed. */ int -bcma_init_dinfo(device_t bus, struct bcma_devinfo *dinfo, +bcma_init_dinfo(device_t bus, device_t child, struct bcma_devinfo *dinfo, struct bcma_corecfg *corecfg) { + struct bcma_intr *intr; + int error; + KASSERT(dinfo->corecfg == NULL, ("dinfo previously initialized")); /* Save core configuration value */ @@ -242,71 +373,52 @@ bcma_init_dinfo(device_t bus, struct bcma_devinfo *din /* The device ports must always be initialized first to ensure that * rid 0 maps to the first device port */ - bcma_dinfo_init_resource_info(bus, dinfo, &corecfg->dev_ports); + bcma_dinfo_init_port_resource_info(bus, dinfo, &corecfg->dev_ports); + bcma_dinfo_init_port_resource_info(bus, dinfo, &corecfg->bridge_ports); + bcma_dinfo_init_port_resource_info(bus, dinfo, &corecfg->wrapper_ports); - bcma_dinfo_init_resource_info(bus, dinfo, &corecfg->bridge_ports); - bcma_dinfo_init_resource_info(bus, dinfo, &corecfg->wrapper_ports); + /* Now that we've defined the port resources, we can map the device's + * agent registers (if any) */ + if ((error = bcma_dinfo_init_agent(bus, child, dinfo))) + goto failed; - return (0); -} + /* With agent registers mapped, we can populate the device's interrupt + * descriptors */ + if ((error = bcma_dinfo_init_intrs(bus, child, dinfo))) + goto failed; + /* Finally, map the interrupt descriptors */ + STAILQ_FOREACH(intr, &dinfo->intrs, i_link) { + /* Already mapped? */ + if (intr->i_mapped) + continue; -/** - * Allocate the per-core agent register block for a device info structure - * previous initialized via bcma_init_dinfo(). - * - * If an agent0.0 region is not defined on @p dinfo, the device info - * agent resource is set to NULL and 0 is returned. - * - * @param bus The requesting bus device. - * @param child The bcma child device. - * @param dinfo The device info associated with @p child - * - * @retval 0 success - * @retval non-zero resource allocation failed. - */ -int -bcma_dinfo_alloc_agent(device_t bus, device_t child, struct bcma_devinfo *dinfo) -{ - bhnd_addr_t addr; - bhnd_size_t size; - rman_res_t r_start, r_count, r_end; - int error; + /* Map the interrupt */ + error = BHND_BUS_MAP_INTR(bus, child, intr->i_sel, + &intr->i_irq); + if (error) { + device_printf(bus, "failed mapping interrupt line %u " + "for core %u: %d\n", intr->i_sel, + BCMA_DINFO_COREIDX(dinfo), error); + goto failed; + } - KASSERT(dinfo->res_agent == NULL, ("double allocation of agent")); + intr->i_mapped = true; - /* Verify that the agent register block exists and is - * mappable */ - if (bhnd_get_port_rid(child, BHND_PORT_AGENT, 0, 0) == -1) - return (0); /* nothing to do */ - - /* Fetch the address of the agent register block */ - error = bhnd_get_region_addr(child, BHND_PORT_AGENT, 0, 0, - &addr, &size); - if (error) { - device_printf(bus, "failed fetching agent register block " - "address for core %u\n", BCMA_DINFO_COREIDX(dinfo)); - return (error); + /* Add to resource list */ + intr->i_rid = resource_list_add_next(&dinfo->resources, + SYS_RES_IRQ, intr->i_irq, intr->i_irq, 1); } - /* Allocate the resource */ - r_start = addr; - r_count = size; - r_end = r_start + r_count - 1; + return (0); - dinfo->rid_agent = BCMA_AGENT_RID(dinfo); - dinfo->res_agent = BHND_BUS_ALLOC_RESOURCE(bus, bus, SYS_RES_MEMORY, - &dinfo->rid_agent, r_start, r_end, r_count, RF_ACTIVE); - if (dinfo->res_agent == NULL) { - device_printf(bus, "failed allocating agent register block for " - "core %u\n", BCMA_DINFO_COREIDX(dinfo)); - return (ENXIO); - } +failed: + /* Owned by the caller on failure */ + dinfo->corecfg = NULL; - return (0); + return (error); } - /** * Deallocate the given device info structure and any associated resources. * @@ -314,8 +426,10 @@ bcma_dinfo_alloc_agent(device_t bus, device_t child, s * @param dinfo Device info to be deallocated. */ void -bcma_free_dinfo(device_t bus, struct bcma_devinfo *dinfo) +bcma_free_dinfo(device_t bus, device_t child, struct bcma_devinfo *dinfo) { + struct bcma_intr *intr, *inext; + resource_list_free(&dinfo->resources); if (dinfo->corecfg != NULL) @@ -327,9 +441,69 @@ bcma_free_dinfo(device_t bus, struct bcma_devinfo *din dinfo->res_agent); } + /* Clean up interrupt descriptors */ + STAILQ_FOREACH_SAFE(intr, &dinfo->intrs, i_link, inext) { + STAILQ_REMOVE(&dinfo->intrs, intr, bcma_intr, i_link); + + /* Release our IRQ mapping */ + if (intr->i_mapped) { + BHND_BUS_UNMAP_INTR(bus, child, intr->i_irq); + intr->i_mapped = false; + } + + bcma_free_intr(intr); + } + free(dinfo, M_BHND); } + +/** + * Allocate and initialize a new interrupt descriptor. + * + * @param bank OOB bank. + * @param sel OOB selector. + * @param line OOB bus line. + */ +struct bcma_intr * +bcma_alloc_intr(uint8_t bank, uint8_t sel, uint8_t line) +{ + struct bcma_intr *intr; + + if (bank >= BCMA_OOB_NUM_BANKS) + return (NULL); + + if (sel >= BCMA_OOB_NUM_SEL) + return (NULL); + + if (line >= BCMA_OOB_NUM_BUSLINES) + return (NULL); + + intr = malloc(sizeof(*intr), M_BHND, M_NOWAIT); + if (intr == NULL) + return (NULL); + + intr->i_bank = bank; + intr->i_sel = sel; + intr->i_busline = line; + intr->i_mapped = false; + intr->i_irq = 0; + + return (intr); +} + +/** + * Deallocate all resources associated with the given interrupt descriptor. + * + * @param intr Interrupt descriptor to be deallocated. + */ +void +bcma_free_intr(struct bcma_intr *intr) +{ + KASSERT(!intr->i_mapped, ("interrupt %u still mapped", intr->i_sel)); + + free(intr, M_BHND); +} /** * Allocate and initialize new slave port descriptor. Modified: head/sys/dev/bhnd/bcma/bcmavar.h ============================================================================== --- head/sys/dev/bhnd/bcma/bcmavar.h Tue Nov 21 22:06:49 2017 (r326078) +++ head/sys/dev/bhnd/bcma/bcmavar.h Tue Nov 21 23:15:20 2017 (r326079) @@ -1,7 +1,11 @@ /*- - * Copyright (c) 2015 Landon Fuller + * Copyright (c) 2015-2016 Landon Fuller + * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Landon Fuller + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -67,6 +71,7 @@ typedef u_int bcma_rmid_t; struct bcma_devinfo; struct bcma_corecfg; +struct bcma_intr; struct bcma_map; struct bcma_mport; struct bcma_sport; @@ -74,8 +79,8 @@ struct bcma_sport; int bcma_probe(device_t dev); int bcma_attach(device_t dev); int bcma_detach(device_t dev); -int bcma_get_intr_count(device_t dev, device_t child); -int bcma_get_core_ivec(device_t dev, device_t child, +u_int bcma_get_intr_count(device_t dev, device_t child); +int bcma_get_intr_ivec(device_t dev, device_t child, u_int intr, uint32_t *ivec); int bcma_add_children(device_t bus); @@ -84,18 +89,20 @@ struct bcma_sport_list *bcma_corecfg_get_port_list(str bhnd_port_type type); struct bcma_devinfo *bcma_alloc_dinfo(device_t bus); -int bcma_init_dinfo(device_t bus, +int bcma_init_dinfo(device_t bus, device_t child, struct bcma_devinfo *dinfo, struct bcma_corecfg *corecfg); -int bcma_dinfo_alloc_agent(device_t bus, device_t child, +void bcma_free_dinfo(device_t bus, device_t child, struct bcma_devinfo *dinfo); -void bcma_free_dinfo(device_t bus, - struct bcma_devinfo *dinfo); struct bcma_corecfg *bcma_alloc_corecfg(u_int core_index, int core_unit, uint16_t vendor, uint16_t device, uint8_t hwrev); void bcma_free_corecfg(struct bcma_corecfg *corecfg); +struct bcma_intr *bcma_alloc_intr(uint8_t bank, uint8_t sel, + uint8_t line); +void bcma_free_intr(struct bcma_intr *intr); + struct bcma_sport *bcma_alloc_sport(bcma_pid_t port_num, bhnd_port_type port_type); void bcma_free_sport(struct bcma_sport *sport); @@ -121,6 +128,18 @@ struct bcma_map { STAILQ_ENTRY(bcma_map) m_link; }; +/** BCMA interrupt descriptor */ +struct bcma_intr { + uint8_t i_bank; /**< OOB bank (see BCMA_OOB_BANK[A-D]) */ + uint8_t i_sel; /**< OOB selector (0-7) */ + uint8_t i_busline; /**< OOB bus line assigned to this selector */ + bool i_mapped; /**< if an irq has been mapped for this selector */ + int i_rid; /**< bus resource id, or -1 */ + rman_res_t i_irq; /**< the mapped bus irq, if any */ + + STAILQ_ENTRY(bcma_intr) i_link; +}; + /** BCMA slave port descriptor */ struct bcma_sport { bcma_pid_t sp_num; /**< slave port number (core-unique) */ @@ -131,8 +150,9 @@ struct bcma_sport { STAILQ_ENTRY(bcma_sport) sp_link; }; -STAILQ_HEAD(bcma_mport_list, bcma_mport); -STAILQ_HEAD(bcma_sport_list, bcma_sport); +STAILQ_HEAD(bcma_mport_list, bcma_mport); +STAILQ_HEAD(bcma_intr_list, bcma_intr); +STAILQ_HEAD(bcma_sport_list, bcma_sport); /** BCMA IP core/block configuration */ struct bcma_corecfg { @@ -161,6 +181,9 @@ struct bcma_devinfo { struct bhnd_resource *res_agent; /**< Agent (wrapper) resource, or NULL. Not * all bcma(4) cores have or require an agent. */ int rid_agent; /**< Agent resource ID, or -1 */ + + u_int num_intrs; /**< number of interrupt descriptors. */ + struct bcma_intr_list intrs; /**< interrupt descriptors */ struct bhnd_core_pmu_info *pmu_info; /**< Bus-managed PMU state, or NULL */ }; Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Tue Nov 21 22:06:49 2017 (r326078) +++ head/sys/dev/bhnd/bhnd.c Tue Nov 21 23:15:20 2017 (r326079) @@ -814,6 +814,22 @@ bhnd_generic_resume_child(device_t dev, device_t child return bus_generic_resume_child(dev, child); } + +/** + * Default bhnd(4) bus driver implementation of BUS_SETUP_INTR(). + * + * This implementation of BUS_SETUP_INTR() will delegate interrupt setup + * to the parent of @p dev, if any. + */ +int +bhnd_generic_setup_intr(device_t dev, device_t child, struct resource *irq, + int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, + void **cookiep) +{ + return (bus_generic_setup_intr(dev, child, irq, flags, filter, intr, + arg, cookiep)); +} + /* * Delegate all indirect I/O to the parent device. When inherited by * non-bridged bus implementations, resources will never be marked as @@ -917,7 +933,7 @@ static device_method_t bhnd_methods[] = { DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_setup_intr, bhnd_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_config_intr, bus_generic_config_intr), DEVMETHOD(bus_bind_intr, bus_generic_bind_intr), Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue Nov 21 22:06:49 2017 (r326078) +++ head/sys/dev/bhnd/bhnd.h Tue Nov 21 23:15:20 2017 (r326079) @@ -250,10 +250,10 @@ struct bhnd_device_quirk { {{ BHND_MATCH_CORE_REV(_rev) }, (_flags) } #define BHND_CHIP_QUIRK(_chip, _rev, _flags) \ - {{ BHND_CHIP_IR(BCM ## _chip, _rev) }, (_flags) } + {{ BHND_MATCH_CHIP_IR(BCM ## _chip, _rev) }, (_flags) } #define BHND_PKG_QUIRK(_chip, _pkg, _flags) \ - {{ BHND_CHIP_IP(BCM ## _chip, BCM ## _chip ## _pkg) }, (_flags) } + {{ BHND_MATCH_CHIP_IP(BCM ## _chip, BCM ## _chip ## _pkg) }, (_flags) } #define BHND_BOARD_QUIRK(_board, _flags) \ {{ BHND_MATCH_BOARD_TYPE(_board) }, \ @@ -528,8 +528,8 @@ int bhnd_bus_generic_activate_resource (device_t d int bhnd_bus_generic_deactivate_resource (device_t dev, device_t child, int type, int rid, struct bhnd_resource *r); -bhnd_attach_type bhnd_bus_generic_get_attach_type(device_t dev, - device_t child); +uintptr_t bhnd_bus_generic_get_intr_domain(device_t dev, + device_t child, bool self); /** * Return the bhnd(4) bus driver's device enumeration parser class @@ -865,25 +865,22 @@ bhnd_read_board_info(device_t dev, struct bhnd_board_i } /** - * Return the number of interrupts to be assigned to @p child via - * BHND_BUS_ASSIGN_INTR(). + * Return the number of interrupt lines assigned to @p dev. * * @param dev A bhnd bus child device. */ -static inline int +static inline u_int bhnd_get_intr_count(device_t dev) { return (BHND_BUS_GET_INTR_COUNT(device_get_parent(dev), dev)); } /** - * Return the backplane interrupt vector corresponding to @p dev's given - * @p intr number. + * Get the backplane interrupt vector of the @p intr line attached to @p dev. * * @param dev A bhnd bus child device. - * @param intr The interrupt number being queried. This is equivalent to the - * bus resource ID for the interrupt. - * @param[out] ivec On success, the assigned hardware interrupt vector be + * @param intr The index of the interrupt line being queried. + * @param[out] ivec On success, the assigned hardware interrupt vector will be * written to this pointer. * * On bcma(4) devices, this returns the OOB bus line assigned to the @@ -893,14 +890,48 @@ bhnd_get_intr_count(device_t dev) * to the interrupt. * * @retval 0 success - * @retval ENXIO If @p intr exceeds the number of interrupts available - * to @p child. + * @retval ENXIO If @p intr exceeds the number of interrupt lines + * assigned to @p child. */ static inline int -bhnd_get_core_ivec(device_t dev, u_int intr, uint32_t *ivec) +bhnd_get_intr_ivec(device_t dev, u_int intr, u_int *ivec) { - return (BHND_BUS_GET_CORE_IVEC(device_get_parent(dev), dev, intr, + return (BHND_BUS_GET_INTR_IVEC(device_get_parent(dev), dev, intr, ivec)); +} + +/** + * Map the given @p intr to an IRQ number; until unmapped, this IRQ may be used + * to allocate a resource of type SYS_RES_IRQ. + * + * On success, the caller assumes ownership of the interrupt mapping, and + * is responsible for releasing the mapping via bhnd_unmap_intr(). + * + * @param dev The requesting device. + * @param intr The interrupt being mapped. + * @param[out] irq On success, the bus interrupt value mapped for @p intr. + * + * @retval 0 If an interrupt was assigned. + * @retval non-zero If mapping an interrupt otherwise fails, a regular + * unix error code will be returned. + */ +static inline int +bhnd_map_intr(device_t dev, u_int intr, rman_res_t *irq) +{ + return (BHND_BUS_MAP_INTR(device_get_parent(dev), dev, intr, irq)); +} + +/** + * Unmap an bus interrupt previously mapped via bhnd_map_intr(). + * + * @param dev The requesting device. + * @param intr The interrupt number being unmapped. This is equivalent to the + * bus resource ID for the interrupt. + */ +static inline void +bhnd_unmap_intr(device_t dev, rman_res_t irq) +{ + return (BHND_BUS_UNMAP_INTR(device_get_parent(dev), dev, irq)); } /** Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Tue Nov 21 22:06:49 2017 (r326078) +++ head/sys/dev/bhnd/bhnd_bus_if.m Tue Nov 21 23:15:20 2017 (r326079) @@ -141,25 +141,6 @@ CODE { panic("bhnd_bus_read_boardinfo unimplemented"); } - static int - bhnd_bus_null_get_intr_count(device_t dev, device_t child) - { - panic("bhnd_bus_get_intr_count unimplemented"); - } - - static int - bhnd_bus_null_assign_intr(device_t dev, device_t child, int rid) - { - panic("bhnd_bus_assign_intr unimplemented"); - } - - static int - bhnd_bus_null_get_core_ivec(device_t dev, device_t child, u_int intr, - uint32_t *ivec) - { - panic("bhnd_bus_get_core_ivec unimplemented"); - } - static void bhnd_bus_null_child_added(device_t dev, device_t child) { @@ -243,7 +224,40 @@ CODE { panic("bhnd_bus_get_probe_order unimplemented"); } + static uintptr_t + bhnd_bus_null_get_intr_domain(device_t dev, device_t child, bool self) + { + /* Unsupported */ + return (0); + } + + static u_int + bhnd_bus_null_get_intr_count(device_t dev, device_t child) + { + return (0); + } + static int + bhnd_bus_null_get_intr_ivec(device_t dev, device_t child, u_int intr, + u_int *ivec) + { + panic("bhnd_bus_get_intr_ivec unimplemented"); + } + + static int + bhnd_bus_null_map_intr(device_t dev, device_t child, u_int intr, + rman_res_t *irq) + { + panic("bhnd_bus_map_intr unimplemented"); + } + + static int + bhnd_bus_null_unmap_intr(device_t dev, device_t child, rman_res_t irq) + { + panic("bhnd_bus_unmap_intr unimplemented"); + } + + static int bhnd_bus_null_get_port_rid(device_t dev, device_t child, bhnd_port_type port_type, u_int port, u_int region) { @@ -488,77 +502,6 @@ METHOD int read_board_info { } DEFAULT bhnd_bus_null_read_board_info; /** - * Return the number of interrupts to be assigned to @p child via - * BHND_BUS_ASSIGN_INTR(). - * - * @param dev The bhnd bus parent of @p child. - * @param child The bhnd device for which a count should be returned. - * - * @retval 0 If no interrupts should be assigned. - * @retval non-zero The count of interrupt resource IDs to be - * assigned, starting at rid 0. - */ -METHOD int get_intr_count { - device_t dev; - device_t child; -} DEFAULT bhnd_bus_null_get_intr_count; - -/** - * Assign an interrupt to @p child via bus_set_resource(). - * - * The default bus implementation of this method should assign backplane - * interrupt values to @p child. - * - * Bridge-attached bus implementations may instead override standard - * interconnect IRQ assignment, providing IRQs inherited from the parent bus. - * - * TODO: Once we can depend on INTRNG, investigate replacing this with a - * bridge-level interrupt controller. - * - * @param dev The bhnd bus parent of @p child. - * @param child The bhnd device to which an interrupt should be assigned. - * @param rid The interrupt resource ID to be assigned. - * - * @retval 0 If an interrupt was assigned. - * @retval non-zero If assigning an interrupt otherwise fails, a regular - * unix error code will be returned. - */ -METHOD int assign_intr { - device_t dev; - device_t child; - int rid; -} DEFAULT bhnd_bus_null_assign_intr; - -/** - * Return the backplane interrupt vector corresponding to @p child's given - * @p intr number. - * - * @param dev The bhnd bus parent of @p child. - * @param child The bhnd device for which the assigned interrupt vector should - * be queried. - * @param intr The interrupt number being queried. This is equivalent to the - * bus resource ID for the interrupt. - * @param[out] ivec On success, the assigned hardware interrupt vector be - * written to this pointer. - * - * On bcma(4) devices, this returns the OOB bus line assigned to the - * interrupt. - * - * On siba(4) devices, this returns the target OCP slave flag number assigned - * to the interrupt. - * - * @retval 0 success - * @retval ENXIO If @p intr exceeds the number of interrupts available - * to @p child. - */ -METHOD int get_core_ivec { - device_t dev; - device_t child; - u_int intr; - uint32_t *ivec; -} DEFAULT bhnd_bus_null_get_core_ivec; - -/** * Notify a bhnd bus that a child was added. * * This method must be called by concrete bhnd(4) driver impementations @@ -996,6 +939,106 @@ METHOD int deactivate_resource { int rid; struct bhnd_resource *r; } DEFAULT bhnd_bus_generic_deactivate_resource; + +/** + * Return the interrupt domain. + * + * This globally unique value may be used as the interrupt controller 'xref' + * on targets that support INTRNG. + * + * @param dev The device whose child is being examined. + * @param child The child device. + * @parem self If true, return @p child's interrupt domain, rather than the + * domain in which @p child resides. + * + * On Non-OFW targets, this should either return: + * - The pointer address of a device that can uniquely identify @p child's + * interrupt domain (e.g., the bhnd bus' device_t address), or + * - 0 if unsupported by the bus. + * + * On OFW (including FDT) targets, this should return the @p child's iparent + * property's xref if @p self is false, the child's own node xref value if + * @p self is true, or 0 if no interrupt parent is found. + */ +METHOD uintptr_t get_intr_domain { + device_t dev; + device_t child; + bool self; +} DEFAULT bhnd_bus_null_get_intr_domain; + +/** + * Return the number of interrupt lines assigned to @p child. + * + * @param dev The bhnd device whose child is being examined. + * @param child The child device. + */ +METHOD u_int get_intr_count { + device_t dev; + device_t child; +} DEFAULT bhnd_bus_null_get_intr_count; + +/** + * Get the backplane interrupt vector of the @p intr line attached to @p child. + * + * @param dev The device whose child is being examined. + * @param child The child device. + * @param intr The index of the interrupt line being queried. + * @param[out] ivec On success, the assigned hardware interrupt vector will be + * written to this pointer. + * + * On bcma(4) devices, this returns the OOB bus line assigned to the + * interrupt. + * + * On siba(4) devices, this returns the target OCP slave flag number assigned + * to the interrupt. + * + * @retval 0 success + * @retval ENXIO If @p intr exceeds the number of interrupt lines + * assigned to @p child. + */ +METHOD int get_intr_ivec { + device_t dev; + device_t child; + u_int intr; + u_int *ivec; +} DEFAULT bhnd_bus_null_get_intr_ivec; + +/** + * Map the given @p intr to an IRQ number; until unmapped, this IRQ may be used + * to allocate a resource of type SYS_RES_IRQ. + * + * On success, the caller assumes ownership of the interrupt mapping, and *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Nov 21 23:25:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F2CEDBABF9; Tue, 21 Nov 2017 23:25:25 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C1FB9399A; Tue, 21 Nov 2017 23:25:24 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vALNPOPh037104; Tue, 21 Nov 2017 23:25:24 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vALNPMuR037090; Tue, 21 Nov 2017 23:25:22 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201711212325.vALNPMuR037090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 21 Nov 2017 23:25:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326080 - in head/sys: dev/bhnd dev/bhnd/bhndb dev/bhnd/cores/pci dev/bhnd/cores/pcie2 mips/broadcom X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys: dev/bhnd dev/bhnd/bhndb dev/bhnd/cores/pci dev/bhnd/cores/pcie2 mips/broadcom X-SVN-Commit-Revision: 326080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 21 Nov 2017 23:25:25 -0000 Author: landonf Date: Tue Nov 21 23:25:22 2017 New Revision: 326080 URL: https://svnweb.freebsd.org/changeset/base/326080 Log: bhnd(4): Add support for querying DMA address translation parameters BHND Wi-Fi chipsets and SoCs share a common DMA engine, operating within backplane address space. To support host DMA on Wi-Fi chipsets, the bridge core maps host address space onto the backplane; any host addresses must be translated to their corresponding backplane address. - Defines a new bhnd_get_dma_translation(9) API to support querying DMA address translation parameters from the bhnd(4) bus. - Extends bhndb(4) to provide DMA translation descriptors from a DMA address translation table defined in the host bridge-specific bhndb_hwcfg. - Defines bhndb(4) DMA address translation tables for all supported host bridge cores. - Extends mips/broadcom's bhnd_nexus driver to return an identity (no-op) DMA translation descriptor; no translation is required when addressing the SoC backplane. Approved by: adrian (mentor) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12582 Modified: head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhndb/bhndb.c head/sys/dev/bhnd/bhndb/bhndb.h head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c head/sys/dev/bhnd/bhndb/bhndb_subr.c head/sys/dev/bhnd/bhndb/bhndbvar.h head/sys/dev/bhnd/cores/pci/bhnd_pcireg.h head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_reg.h head/sys/mips/broadcom/bhnd_nexus.c Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/bhnd.h Tue Nov 21 23:25:22 2017 (r326080) @@ -220,6 +220,94 @@ struct bhnd_core_info { }; /** + * bhnd(4) DMA address widths. + */ +typedef enum { + BHND_DMA_ADDR_30BIT = 30, /**< 30-bit DMA */ + BHND_DMA_ADDR_32BIT = 32, /**< 32-bit DMA */ + BHND_DMA_ADDR_64BIT = 64, /**< 64-bit DMA */ +} bhnd_dma_addrwidth; + +/** + * Convert an address width (in bits) to its corresponding mask. + */ +#define BHND_DMA_ADDR_BITMASK(_width) \ + ((_width >= 64) ? ~0ULL : \ + (_width == 0) ? 0x0 : \ + ((1ULL << (_width)) - 1)) \ + +/** + * bhnd(4) DMA address translation descriptor. + */ +struct bhnd_dma_translation { + /** + * Host-to-device physical address translation. + * + * This may be added to the host physical address to produce a device + * DMA address. + */ + bhnd_addr_t base_addr; + + /** + * Device-addressable address mask. + * + * This defines the device's DMA address range, excluding any bits + * reserved for mapping the address to the base_addr. + */ + bhnd_addr_t addr_mask; + + /** + * Device-addressable extended address mask. + * + * If a per-core bhnd(4) DMA engine supports the 'addrext' control + * field, it can be used to provide address bits excluded by addr_mask. + * + * Support for DMA extended address changes – including coordination + * with the core providing DMA translation – is handled transparently by + * the DMA engine. For example, on PCI(e) Wi-Fi chipsets, the Wi-Fi + * core DMA engine will (in effect) update the PCI core's DMA + * sbtopcitranslation base address to map the full address prior to + * performing a DMA transaction. + */ + bhnd_addr_t addrext_mask; + + /** + * Translation flags (see bhnd_dma_translation_flags) + */ + uint32_t flags; +}; + +#define BHND_DMA_TRANSLATION_TABLE_END { 0, 0, 0, 0 } + +#define BHND_DMA_IS_TRANSLATION_TABLE_END(_dt) \ + ((_dt)->base_addr == 0 && (_dt)->addr_mask == 0 && \ + (_dt)->addrext_mask == 0 && (_dt)->flags == 0) + +/** + * bhnd(4) DMA address translation flags. + */ +enum bhnd_dma_translation_flags { + /** + * The translation remaps the device's physical address space. + * + * This is used in conjunction with BHND_DMA_TRANSLATION_BYTESWAPPED to + * define a DMA translation that provides byteswapped access to + * physical memory on big-endian MIPS SoCs. + */ + BHND_DMA_TRANSLATION_PHYSMAP = (1<<0), + + /** + * Provides a byte-swapped mapping; write requests will be byte-swapped + * before being written to memory, and read requests will be + * byte-swapped before being returned. + * + * This is primarily used to perform efficient byte swapping of DMA + * data on embedded MIPS SoCs executing in big-endian mode. + */ + BHND_DMA_TRANSLATION_BYTESWAPPED = (1<<1), +}; + +/** * A bhnd(4) bus resource. * * This provides an abstract interface to per-core resources that may require @@ -512,6 +600,10 @@ int bhnd_bus_generic_get_nvram_var(device_t dev, bhnd_nvram_type type); const struct bhnd_chipid *bhnd_bus_generic_get_chipid(device_t dev, device_t child); +int bhnd_bus_generic_get_dma_translation( + device_t dev, device_t child, u_int width, + uint32_t flags, bus_dma_tag_t *dmat, + struct bhnd_dma_translation *translation); int bhnd_bus_generic_read_board_info(device_t dev, device_t child, struct bhnd_board_info *info); @@ -840,6 +932,38 @@ bhnd_pwrctl_ungate_clock(device_t dev, bhnd_clock cloc static inline bhnd_attach_type bhnd_get_attach_type (device_t dev) { return (BHND_BUS_GET_ATTACH_TYPE(device_get_parent(dev), dev)); +} + +/** + * Find the best available DMA address translation capable of mapping a + * physical host address to a BHND DMA device address of @p width with + * @p flags. + * + * @param dev A bhnd bus child device. + * @param width The address width within which the translation window must + * reside (see BHND_DMA_ADDR_*). + * @param flags Required translation flags (see BHND_DMA_TRANSLATION_*). + * @param[out] dmat On success, will be populated with a DMA tag specifying the + * @p translation DMA address restrictions. This argment may be NULL if the DMA + * tag is not desired. + * the set of valid host DMA addresses reachable via @p translation. + * @param[out] translation On success, will be populated with a DMA address + * translation descriptor for @p child. This argment may be NULL if the + * descriptor is not desired. + * + * @retval 0 success + * @retval ENODEV If DMA is not supported. + * @retval ENOENT If no DMA translation matching @p width and @p flags is + * available. + * @retval non-zero If determining the DMA address translation for @p child + * otherwise fails, a regular unix error code will be returned. + */ +static inline int +bhnd_get_dma_translation(device_t dev, u_int width, uint32_t flags, + bus_dma_tag_t *dmat, struct bhnd_dma_translation *translation) +{ + return (BHND_BUS_GET_DMA_TRANSLATION(device_get_parent(dev), dev, width, + flags, dmat, translation)); } /** Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/bhnd_bus_if.m Tue Nov 21 23:25:22 2017 (r326080) @@ -46,6 +46,7 @@ HEADER { struct bhnd_board_info; struct bhnd_core_info; struct bhnd_chipid; + struct bhnd_dma_translation; struct bhnd_devinfo; struct bhnd_resource; } @@ -112,7 +113,7 @@ CODE { { panic("bhnd_bus_get_attach_type unimplemented"); } - + static bhnd_clksrc bhnd_bus_null_pwrctl_get_clksrc(device_t dev, device_t child, bhnd_clock clock) @@ -478,6 +479,41 @@ METHOD bhnd_attach_type get_attach_type { device_t dev; device_t child; } DEFAULT bhnd_bus_null_get_attach_type; + + +/** + * Find the best available DMA address translation capable of mapping a + * physical host address to a BHND DMA device address of @p width with + * @p flags. + * + * @param dev The parent of @p child. + * @param child The bhnd device requesting the DMA address translation. + * @param width The address width within which the translation window must + * reside (see BHND_DMA_ADDR_*). + * @param flags Required translation flags (see BHND_DMA_TRANSLATION_*). + * @param[out] dmat On success, will be populated with a DMA tag specifying the + * @p translation DMA address restrictions. This argment may be NULL if the DMA + * tag is not desired. + * the set of valid host DMA addresses reachable via @p translation. + * @param[out] translation On success, will be populated with a DMA address + * translation descriptor for @p child. This argment may be NULL if the + * descriptor is not desired. + * + * @retval 0 success + * @retval ENODEV If DMA is not supported. + * @retval ENOENT If no DMA translation matching @p width and @p flags is + * available. + * @retval non-zero If determining the DMA address translation for @p child + * otherwise fails, a regular unix error code will be returned. + */ +METHOD int get_dma_translation { + device_t dev; + device_t child; + u_int width; + uint32_t flags; + bus_dma_tag_t *dmat; + struct bhnd_dma_translation *translation; +} DEFAULT bhnd_bus_generic_get_dma_translation; /** * Attempt to read the BHND board identification from the parent bus. Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/bhnd_subr.c Tue Nov 21 23:25:22 2017 (r326080) @@ -2104,6 +2104,27 @@ bhnd_bus_generic_get_chipid(device_t dev, device_t chi panic("missing BHND_BUS_GET_CHIPID()"); } +/** + * Helper function for implementing BHND_BUS_GET_DMA_TRANSLATION(). + * + * If a parent device is available, this implementation delegates the + * request to the BHND_BUS_GET_DMA_TRANSLATION() method on the parent of @p dev. + * + * If no parent device is available, this implementation will panic. + */ +int +bhnd_bus_generic_get_dma_translation(device_t dev, device_t child, u_int width, + uint32_t flags, bus_dma_tag_t *dmat, + struct bhnd_dma_translation *translation) +{ + if (device_get_parent(dev) != NULL) { + return (BHND_BUS_GET_DMA_TRANSLATION(device_get_parent(dev), + child, width, flags, dmat, translation)); + } + + panic("missing BHND_BUS_GET_DMA_TRANSLATION()"); +} + /* nvram board_info population macros for bhnd_bus_generic_read_board_info() */ #define BHND_GV(_dest, _name) \ bhnd_nvram_getvar_uint(child, BHND_NVAR_ ## _name, &_dest, \ Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/bhndb/bhndb.c Tue Nov 21 23:25:22 2017 (r326080) @@ -2040,13 +2040,93 @@ bhndb_remap_intr(device_t dev, device_t child, u_int i } /** + * Default bhndb(4) implementation of BHND_BUS_GET_DMA_TRANSLATION(). + */ +static inline int +bhndb_get_dma_translation(device_t dev, device_t child, u_int width, + uint32_t flags, bus_dma_tag_t *dmat, + struct bhnd_dma_translation *translation) +{ + struct bhndb_softc *sc; + const struct bhndb_hwcfg *hwcfg; + const struct bhnd_dma_translation *match; + bus_dma_tag_t match_dmat; + bhnd_addr_t addr_mask, match_addr_mask; + + sc = device_get_softc(dev); + hwcfg = sc->bus_res->cfg; + + /* Is DMA supported? */ + if (sc->bus_res->res->dma_tags == NULL) + return (ENODEV); + + /* Find the best matching descriptor for the requested type */ + addr_mask = BHND_DMA_ADDR_BITMASK(width); + + match = NULL; + match_addr_mask = 0x0; + match_dmat = NULL; + + for (size_t i = 0; i < sc->bus_res->res->num_dma_tags; i++) { + const struct bhnd_dma_translation *dwin; + bhnd_addr_t masked; + + dwin = &hwcfg->dma_translations[i]; + + /* The base address must be device addressable */ + if ((dwin->base_addr & addr_mask) != dwin->base_addr) + continue; + + /* The flags must match */ + if ((dwin->flags & flags) != flags) + continue; + + /* The window must cover at least part of our addressable + * range */ + masked = (dwin->addr_mask | dwin->addrext_mask) & addr_mask; + if (masked == 0) + continue; + + /* Is this a better match? */ + if (match == NULL || masked > match_addr_mask) { + match = dwin; + match_addr_mask = masked; + match_dmat = sc->bus_res->res->dma_tags[i]; + } + } + + if (match == NULL || match_addr_mask == 0) + return (ENOENT); + + if (dmat != NULL) + *dmat = match_dmat; + + if (translation != NULL) + *translation = *match; + + return (0); +} + +/** * Default bhndb(4) implementation of BUS_GET_DMA_TAG(). */ static bus_dma_tag_t bhndb_get_dma_tag(device_t dev, device_t child) { - // TODO - return (NULL); + struct bhndb_softc *sc = device_get_softc(dev); + + /* + * A bridge may have multiple DMA translation descriptors, each with + * their own incompatible restrictions; drivers should in general call + * BHND_BUS_GET_DMA_TRANSLATION() to fetch both the best available DMA + * translation, and its corresponding DMA tag. + * + * Child drivers that do not use BHND_BUS_GET_DMA_TRANSLATION() are + * responsible for creating their own restricted DMA tag; since we + * cannot do this for them in BUS_GET_DMA_TAG(), we simply return the + * bridge parent's DMA tag directly; + */ + return (bus_get_dma_tag(sc->parent_dev)); } static device_method_t bhndb_methods[] = { @@ -2102,6 +2182,7 @@ static device_method_t bhndb_methods[] = { DEVMETHOD(bhnd_bus_get_nvram_var, bhnd_bus_generic_get_nvram_var), DEVMETHOD(bhnd_bus_map_intr, bhndb_bhnd_map_intr), DEVMETHOD(bhnd_bus_unmap_intr, bhndb_bhnd_unmap_intr), + DEVMETHOD(bhnd_bus_get_dma_translation, bhndb_get_dma_translation), DEVMETHOD(bhnd_bus_get_service_registry,bhndb_get_service_registry), DEVMETHOD(bhnd_bus_register_provider, bhnd_bus_generic_sr_register_provider), Modified: head/sys/dev/bhnd/bhndb/bhndb.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.h Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/bhndb/bhndb.h Tue Nov 21 23:25:22 2017 (r326080) @@ -107,12 +107,13 @@ struct bhndb_regwin { /** * Bridge hardware configuration. * - * Provides the bridge's register/address mappings, and the resources - * via which those mappings may be accessed. + * Provides the bridge's DMA address translation descriptions, register/address + * mappings, and the resources via which those mappings may be accessed. */ struct bhndb_hwcfg { - const struct resource_spec *resource_specs; - const struct bhndb_regwin *register_windows; + const struct resource_spec *resource_specs; /**< resources required by our register windows */ + const struct bhndb_regwin *register_windows; /**< register window table */ + const struct bhnd_dma_translation *dma_translations; /**< DMA address translation table, or NULL if DMA is not supported */ }; /** Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci.c Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/bhndb/bhndb_pci.c Tue Nov 21 23:25:22 2017 (r326080) @@ -509,7 +509,7 @@ bhndb_pci_read_core_table(device_t dev, struct bhnd_ch hint = BHNDB_BUS_GET_CHIPID(parent_dev, dev); /* Allocate our host resources */ - if ((error = bhndb_alloc_host_resources(parent_dev, cfg, &hr))) + if ((error = bhndb_alloc_host_resources(&hr, dev, parent_dev, cfg))) return (error); /* Initialize our erom I/O state */ Modified: head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/bhndb/bhndb_pci_hwdata.c Tue Nov 21 23:25:22 2017 (r326080) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #include "bhndbvar.h" #include "bhndb_pcireg.h" @@ -100,6 +103,9 @@ const struct bhndb_hwcfg bhndb_pci_siba_generic_hwcfg }, BHNDB_REGWIN_TABLE_END }, + + /* DMA unsupported under generic configuration */ + .dma_translations = NULL, }; @@ -147,6 +153,9 @@ const struct bhndb_hwcfg bhndb_pci_bcma_generic_hwcfg BHNDB_REGWIN_TABLE_END }, + + /* DMA unsupported under generic configuration */ + .dma_translations = NULL, }; /** @@ -319,6 +328,15 @@ static const struct bhndb_hwcfg bhndb_pci_hwcfg_v0 = { }, BHNDB_REGWIN_TABLE_END }, + + .dma_translations = (const struct bhnd_dma_translation[]) { + { + .base_addr = BHND_PCI_DMA32_TRANSLATION, + .addr_mask = ~BHND_PCI_DMA32_MASK, + .addrext_mask = BHND_PCI_DMA32_MASK + }, + BHND_DMA_TRANSLATION_TABLE_END + } }; /** @@ -385,6 +403,15 @@ static const struct bhndb_hwcfg bhndb_pci_hwcfg_v1_pci BHNDB_REGWIN_TABLE_END }, + + .dma_translations = (const struct bhnd_dma_translation[]) { + { + .base_addr = BHND_PCI_DMA32_TRANSLATION, + .addr_mask = ~BHND_PCI_DMA32_MASK, + .addrext_mask = BHND_PCI_DMA32_MASK + }, + BHND_DMA_TRANSLATION_TABLE_END + } }; /** @@ -451,6 +478,20 @@ static const struct bhndb_hwcfg bhndb_pci_hwcfg_v1_pci BHNDB_REGWIN_TABLE_END }, + + .dma_translations = (const struct bhnd_dma_translation[]) { + { + .base_addr = BHND_PCIE_DMA32_TRANSLATION, + .addr_mask = ~BHND_PCIE_DMA32_MASK, + .addrext_mask = BHND_PCIE_DMA32_MASK + }, + { + .base_addr = BHND_PCIE_DMA64_TRANSLATION, + .addr_mask = ~BHND_PCIE_DMA64_MASK, + .addrext_mask = 0 + }, + BHND_DMA_TRANSLATION_TABLE_END + } }; /** @@ -520,6 +561,20 @@ static const struct bhndb_hwcfg bhndb_pci_hwcfg_v2 = { BHNDB_REGWIN_TABLE_END }, + + .dma_translations = (const struct bhnd_dma_translation[]) { + { + .base_addr = BHND_PCIE_DMA32_TRANSLATION, + .addr_mask = ~BHND_PCIE_DMA32_MASK, + .addrext_mask = BHND_PCIE_DMA32_MASK + }, + { + .base_addr = BHND_PCIE_DMA64_TRANSLATION, + .addr_mask = ~BHND_PCIE_DMA64_MASK, + .addrext_mask = 0 + }, + BHND_DMA_TRANSLATION_TABLE_END + } }; /** @@ -589,4 +644,13 @@ static const struct bhndb_hwcfg bhndb_pci_hwcfg_v3 = { BHNDB_REGWIN_TABLE_END }, + + .dma_translations = (const struct bhnd_dma_translation[]) { + { + .base_addr = BHND_PCIE2_DMA64_TRANSLATION, + .addr_mask = ~BHND_PCIE2_DMA64_MASK, + .addrext_mask = 0 + }, + BHND_DMA_TRANSLATION_TABLE_END + } }; Modified: head/sys/dev/bhnd/bhndb/bhndb_subr.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_subr.c Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/bhndb/bhndb_subr.c Tue Nov 21 23:25:22 2017 (r326080) @@ -41,6 +41,10 @@ __FBSDID("$FreeBSD$"); #include "bhndb_private.h" #include "bhndbvar.h" +static int bhndb_dma_tag_create(device_t dev, bus_dma_tag_t parent_dmat, + const struct bhnd_dma_translation *translation, + bus_dma_tag_t *dmat); + /** * Attach a BHND bridge device to @p parent. * @@ -402,7 +406,7 @@ bhndb_alloc_resources(device_t dev, device_t parent_de } /* Allocate host resources */ - error = bhndb_alloc_host_resources(parent_dev, r->cfg, &r->res); + error = bhndb_alloc_host_resources(&r->res, dev, parent_dev, r->cfg); if (error) { device_printf(r->dev, "could not allocate host resources on %s: %d\n", @@ -494,6 +498,65 @@ failed: } /** + * Create a new DMA tag for the given @p translation. + * + * @param dev The bridge device. + * @param parent_dmat The parent DMA tag, or NULL if none. + * @param translation The DMA translation for which a DMA tag will + * be created. + * @param[out] dmat On success, the newly created DMA tag. + * + * @retval 0 success + * @retval non-zero if creating the new DMA tag otherwise fails, a regular + * unix error code will be returned. + */ +static int +bhndb_dma_tag_create(device_t dev, bus_dma_tag_t parent_dmat, + const struct bhnd_dma_translation *translation, bus_dma_tag_t *dmat) +{ + bus_dma_tag_t translation_tag; + bhnd_addr_t dt_mask; + bus_addr_t boundary; + bus_addr_t lowaddr, highaddr; + int error; + + highaddr = BUS_SPACE_MAXADDR; + boundary = 0; + + /* Determine full addressable mask */ + dt_mask = (translation->addr_mask | translation->addrext_mask); + KASSERT(dt_mask != 0, ("DMA addr_mask invalid: %#jx", + (uintmax_t)dt_mask)); + + /* (addr_mask|addrext_mask) is our maximum supported address */ + lowaddr = MIN(dt_mask, BUS_SPACE_MAXADDR); + + /* Do we need to to avoid crossing a DMA translation window boundary? */ + if (translation->addr_mask < BUS_SPACE_MAXADDR) { + /* round down to nearest power of two */ + boundary = translation->addr_mask & (~1ULL); + } + + /* Create our DMA tag */ + error = bus_dma_tag_create(parent_dmat, + 1, /* alignment */ + boundary, lowaddr, highaddr, + NULL, NULL, /* filter, filterarg */ + BUS_SPACE_MAXSIZE, 0, /* maxsize, nsegments */ + BUS_SPACE_MAXSIZE, 0, /* maxsegsize, flags */ + NULL, NULL, /* lockfunc, lockarg */ + &translation_tag); + if (error) { + device_printf(dev, "failed to create bridge DMA tag: %d\n", + error); + return (error); + } + + *dmat = translation_tag; + return (0); +} + +/** * Deallocate the given bridge resource structure and any associated resources. * * @param br Resource state to be deallocated. @@ -571,31 +634,80 @@ bhndb_free_resources(struct bhndb_resources *br) * On success, the caller assumes ownership of the allocated host resources, * which must be freed via bhndb_release_host_resources(). * - * @param dev The device to be used when allocating resources - * (e.g. via bus_alloc_resources()). + * @param[out] resources On success, the allocated host resources. + * @param dev The bridge device. + * @param parent_dev The parent device from which host resources + * should be allocated (e.g. via + * bus_alloc_resources()). * @param hwcfg The hardware configuration defining the host * resources to be allocated - * @param[out] resources On success, the allocated host resources. */ int -bhndb_alloc_host_resources(device_t dev, const struct bhndb_hwcfg *hwcfg, - struct bhndb_host_resources **resources) +bhndb_alloc_host_resources(struct bhndb_host_resources **resources, + device_t dev, device_t parent_dev, const struct bhndb_hwcfg *hwcfg) { - struct bhndb_host_resources *hr; - size_t nres; - int error; + struct bhndb_host_resources *hr; + const struct bhnd_dma_translation *dt; + bus_dma_tag_t parent_dmat; + size_t nres, ndt; + int error; + parent_dmat = bus_get_dma_tag(parent_dev); + hr = malloc(sizeof(*hr), M_BHND, M_WAITOK); - hr->owner = dev; + hr->owner = parent_dev; hr->cfg = hwcfg; hr->resource_specs = NULL; hr->resources = NULL; + hr->dma_tags = NULL; + hr->num_dma_tags = 0; /* Determine our bridge resource count from the hardware config. */ nres = 0; for (size_t i = 0; hwcfg->resource_specs[i].type != -1; i++) nres++; + /* Determine the total count and validate our DMA translation table. */ + ndt = 0; + for (dt = hwcfg->dma_translations; dt != NULL && + !BHND_DMA_IS_TRANSLATION_TABLE_END(dt); dt++) + { + /* Validate the defined translation */ + if ((dt->base_addr & dt->addr_mask) != 0) { + device_printf(dev, "invalid DMA translation; base " + "address %#jx overlaps address mask %#jx", + (uintmax_t)dt->base_addr, (uintmax_t)dt->addr_mask); + + error = EINVAL; + goto failed; + } + + if ((dt->addrext_mask & dt->addr_mask) != 0) { + device_printf(dev, "invalid DMA translation; addrext " + "mask %#jx overlaps address mask %#jx", + (uintmax_t)dt->addrext_mask, + (uintmax_t)dt->addr_mask); + + error = EINVAL; + goto failed; + } + + /* Increment our entry count */ + ndt++; + } + + /* Allocate our DMA tags */ + hr->dma_tags = malloc(sizeof(*hr->dma_tags) * ndt, M_BHND, + M_WAITOK|M_ZERO); + for (size_t i = 0; i < ndt; i++) { + error = bhndb_dma_tag_create(dev, parent_dmat, + &hwcfg->dma_translations[i], &hr->dma_tags[i]); + if (error) + goto failed; + + hr->num_dma_tags++; + } + /* Allocate space for a non-const copy of our resource_spec * table; this will be updated with the RIDs assigned by * bus_alloc_resources. */ @@ -617,7 +729,7 @@ bhndb_alloc_host_resources(device_t dev, const struct hr->resources); if (error) { device_printf(dev, "could not allocate bridge resources via " - "%s: %d\n", device_get_nameunit(dev), error); + "%s: %d\n", device_get_nameunit(parent_dev), error); goto failed; } @@ -631,6 +743,12 @@ failed: if (hr->resources != NULL) free(hr->resources, M_BHND); + for (size_t i = 0; i < hr->num_dma_tags; i++) + bus_dma_tag_destroy(hr->dma_tags[i]); + + if (hr->dma_tags != NULL) + free(hr->dma_tags, M_BHND); + free(hr, M_BHND); return (error); @@ -646,8 +764,12 @@ bhndb_release_host_resources(struct bhndb_host_resourc { bus_release_resources(hr->owner, hr->resource_specs, hr->resources); + for (size_t i = 0; i < hr->num_dma_tags; i++) + bus_dma_tag_destroy(hr->dma_tags[i]); + free(hr->resources, M_BHND); free(hr->resource_specs, M_BHND); + free(hr->dma_tags, M_BHND); free(hr, M_BHND); } Modified: head/sys/dev/bhnd/bhndb/bhndbvar.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndbvar.h Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/bhndb/bhndbvar.h Tue Nov 21 23:25:22 2017 (r326080) @@ -90,9 +90,11 @@ struct bhndb_intr_isrc *bhndb_alloc_intr_isrc(device_ void bhndb_free_intr_isrc( struct bhndb_intr_isrc *isrc); -int bhndb_alloc_host_resources(device_t dev, - const struct bhndb_hwcfg *hwcfg, - struct bhndb_host_resources **resources); +int bhndb_alloc_host_resources( + struct bhndb_host_resources **resources, + device_t dev, device_t parent_dev, + const struct bhndb_hwcfg *hwcfg); + void bhndb_release_host_resources( struct bhndb_host_resources *resources); struct resource *bhndb_host_resource_for_range( @@ -161,6 +163,9 @@ struct bhndb_host_resources { const struct bhndb_hwcfg *cfg; /**< bridge hardware configuration */ struct resource_spec *resource_specs; /**< resource specification table */ struct resource **resources; /**< allocated resource table */ + bus_dma_tag_t *dma_tags; /**< DMA tags for all hwcfg DMA translations, or NULL + if DMA is not supported */ + size_t num_dma_tags; /**< DMA tag count */ }; /** Modified: head/sys/dev/bhnd/cores/pci/bhnd_pcireg.h ============================================================================== --- head/sys/dev/bhnd/cores/pci/bhnd_pcireg.h Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/cores/pci/bhnd_pcireg.h Tue Nov 21 23:25:22 2017 (r326080) @@ -29,15 +29,15 @@ * PCI/PCIe-Gen1 DMA Constants */ -#define BHND_PCI_DMA32_TRANSLATION 0x40000000 /* Client Mode sb2pcitranslation2 (1 GB) */ -#define BHND_PCI_DMA32_SZ 0x40000000 /* Client Mode sb2pcitranslation2 size in bytes */ +#define BHND_PCI_DMA32_TRANSLATION 0x40000000 /**< PCI DMA32 address translation (sbtopci2) */ +#define BHND_PCI_DMA32_MASK BHND_PCI_SBTOPCI2_MASK /**< PCI DMA32 translation mask */ -#define BHND_PCIE_DMA32_TRANSLATION BHND_PCI_DMA32_TRANSLATION -#define BHND_PCIE_DMA32_SZ BHND_PCI_DMA32_SZ +#define BHND_PCIE_DMA32_TRANSLATION 0x80000000 /**< PCIe-Gen1 DMA32 address translation (sb2pcitranslation2) */ +#define BHND_PCIE_DMA32_MASK BHND_PCIE_SBTOPCI2_MASK /**< PCIe-Gen1 DMA32 translation mask */ -#define BHND_PCIE_DMA64_L32 0x00000000 /**< 64-bit client mode sb2pcitranslation2 (2 ZettaBytes, low 32 bits) */ -#define BHND_PCIE_DMA64_H32 0x80000000 /**< 64-bit client mode sb2pcitranslation2 (2 ZettaBytes, high 32 bits) */ - +#define BHND_PCIE_DMA64_TRANSLATION _BHND_PCIE_DMA64(TRANSLATION) /**< PCIe-Gen1 DMA64 address translation (sb2pcitranslation2) */ +#define BHND_PCIE_DMA64_MASK _BHND_PCIE_DMA64(MASK) /**< PCIe-Gen1 DMA64 translation mask */ +#define _BHND_PCIE_DMA64(_x) ((uint64_t)BHND_PCIE_DMA32_ ## _x << 32) /* * PCI Core Registers */ Modified: head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_reg.h ============================================================================== --- head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_reg.h Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_reg.h Tue Nov 21 23:25:22 2017 (r326080) @@ -24,6 +24,17 @@ #ifndef _BHND_CORES_PCIE2_BHND_PCIE2_REG_H_ #define _BHND_CORES_PCIE2_BHND_PCIE2_REG_H_ +/* + * PCIe-Gen2 DMA Constants + */ + +#define BHND_PCIE2_DMA64_TRANSLATION 0x8000000000000000 /**< PCIe-Gen2 DMA64 address translation */ +#define BHND_PCIE2_DMA64_MASK 0xc000000000000000 /**< PCIe-Gen2 DMA64 translation mask */ + +/* + * PCIe-Gen2 Core Registers + */ + #define BHND_PCIE2_CLK_CONTROL 0x000 #define BHND_PCIE2_RC_PM_CONTROL 0x004 Modified: head/sys/mips/broadcom/bhnd_nexus.c ============================================================================== --- head/sys/mips/broadcom/bhnd_nexus.c Tue Nov 21 23:15:20 2017 (r326079) +++ head/sys/mips/broadcom/bhnd_nexus.c Tue Nov 21 23:25:22 2017 (r326080) @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "bcm_machdep.h" #include "bcm_mipsvar.h" @@ -194,6 +196,44 @@ bhnd_nexus_unmap_intr(device_t dev, device_t child, rm intr_unmap_irq(irq); } +/** + * Default bhnd_nexus implementation of BHND_BUS_GET_DMA_TRANSLATION(). + */ +static int +bhnd_nexus_get_dma_translation(device_t dev, device_t child, + u_int width, uint32_t flags, bus_dma_tag_t *dmat, + struct bhnd_dma_translation *translation) +{ + struct bcm_platform *bp = bcm_get_platform(); + + /* We don't (currently) support any flags */ + if (flags != 0x0) + return (ENOENT); + + KASSERT(width > 0 && width <= BHND_DMA_ADDR_64BIT, + ("invalid width %u", width)); + + if (width > BHND_DMA_ADDR_32BIT) { + /* Backplane must support 64-bit addressing */ + if (!(bp->cc_caps & CHIPC_CAP_BKPLN64)) + return (ENOENT); + } + + /* No DMA address translation required */ + if (dmat != NULL) + *dmat = bus_get_dma_tag(dev); + + if (translation != NULL) { + *translation = (struct bhnd_dma_translation) { + .base_addr = 0x0, + .addr_mask = BHND_DMA_ADDR_BITMASK(width), + .addrext_mask = 0 + }; + } + + return (0); +} + static device_method_t bhnd_nexus_methods[] = { /* bhnd interface */ DEVMETHOD(bhnd_bus_get_service_registry,bhnd_nexus_get_service_registry), @@ -206,6 +246,7 @@ static device_method_t bhnd_nexus_methods[] = { DEVMETHOD(bhnd_bus_is_hw_disabled, bhnd_nexus_is_hw_disabled), DEVMETHOD(bhnd_bus_get_attach_type, bhnd_nexus_get_attach_type), DEVMETHOD(bhnd_bus_get_chipid, bhnd_nexus_get_chipid), + DEVMETHOD(bhnd_bus_get_dma_translation, bhnd_nexus_get_dma_translation), DEVMETHOD(bhnd_bus_get_intr_domain, bhnd_bus_generic_get_intr_domain), DEVMETHOD(bhnd_bus_map_intr, bhnd_nexus_map_intr), DEVMETHOD(bhnd_bus_unmap_intr, bhnd_nexus_unmap_intr), From owner-svn-src-head@freebsd.org Wed Nov 22 00:08: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 268C6DBBB0D; Wed, 22 Nov 2017 00:08:24 +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 09F5F63F0E; Wed, 22 Nov 2017 00:08:23 +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 vAM08HEu074043 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Nov 2017 16:08:17 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id vAM08GQl074042; Tue, 21 Nov 2017 16:08:16 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 21 Nov 2017 16:08:16 -0800 From: Gleb Smirnoff To: Marcin Wojtas , Michal Krawczyk Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325239 - head/sys/dev/ena Message-ID: <20171122000816.GH1063@FreeBSD.org> References: <201710311631.v9VGVNOs058255@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201710311631.v9VGVNOs058255@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 00:08:24 -0000 Hi Martin and Michal, On Tue, Oct 31, 2017 at 04:31:23PM +0000, Marcin Wojtas wrote: M> Author: mw M> Date: Tue Oct 31 16:31:23 2017 M> New Revision: 325239 M> URL: https://svnweb.freebsd.org/changeset/base/325239 M> M> Log: M> Rework counting of hardware statistics in ENA driver M> M> Do not read all statistics from the device, instead count them in the M> driver except from RX drops - they are received directly from the NIC M> in the AENQ descriptor. M> M> Submitted by: Michal Krawczyk M> Reviewed by: imp M> Obtained from: Semihalf M> Sponsored by: Amazon.com, Inc. M> Differential Revision: https://reviews.freebsd.org/D12852 Is it possible not to count them in software, as well as not fetch them from hardware periodically, but instead just fetch them on demand, when either if_get_counter() or a sysctl is called? That would be more efficient. -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Nov 22 01:50: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 675EFDC12E0; Wed, 22 Nov 2017 01:50:24 +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 310FA66955; Wed, 22 Nov 2017 01:50:24 +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 vAM1oNb6096347; Wed, 22 Nov 2017 01:50:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAM1oNcH096346; Wed, 22 Nov 2017 01:50:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711220150.vAM1oNcH096346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 22 Nov 2017 01:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326082 - head/usr.sbin/freebsd-update X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/freebsd-update X-SVN-Commit-Revision: 326082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 01:50:24 -0000 Author: emaste Date: Wed Nov 22 01:50:23 2017 New Revision: 326082 URL: https://svnweb.freebsd.org/changeset/base/326082 Log: freebsd-update: do not duplicate patchlist entries PR: 221079 Submitted by: Masachika ISHIZUKA Submitted by: ota@j.email.ne.jp Reviewed by: cperciva MFC after: 1 week 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 Wed Nov 22 00:37:14 2017 (r326081) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Nov 22 01:50:23 2017 (r326082) @@ -1052,7 +1052,7 @@ fetch_make_patchlist () { continue fi echo "${X}|${Y}" - done | uniq + done | sort -u } # Print user-friendly progress statistics From owner-svn-src-head@freebsd.org Wed Nov 22 01:54: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 EDD6FDC152C; Wed, 22 Nov 2017 01:54:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B260F66D22; Wed, 22 Nov 2017 01:54:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAM1rx6m000453; Wed, 22 Nov 2017 01:53:59 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAM1rxsO000452; Wed, 22 Nov 2017 01:53:59 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201711220153.vAM1rxsO000452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 22 Nov 2017 01:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326083 - head/sys/cddl/dev/profile X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/cddl/dev/profile X-SVN-Commit-Revision: 326083 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 01:54:01 -0000 Author: jhibbits Date: Wed Nov 22 01:53:59 2017 New Revision: 326083 URL: https://svnweb.freebsd.org/changeset/base/326083 Log: PowerPC has 12 artificial frames for the profiler It may need to be different between AIM and Book-E, this was tested only on Book-E (64- and 32-bit) MFC after: 3 weeks Modified: head/sys/cddl/dev/profile/profile.c Modified: head/sys/cddl/dev/profile/profile.c ============================================================================== --- head/sys/cddl/dev/profile/profile.c Wed Nov 22 01:50:23 2017 (r326082) +++ head/sys/cddl/dev/profile/profile.c Wed Nov 22 01:53:59 2017 (r326083) @@ -124,7 +124,7 @@ /* * This value is bogus just to make module compilable on powerpc */ -#define PROF_ARTIFICIAL_FRAMES 3 +#define PROF_ARTIFICIAL_FRAMES 12 #endif struct profile_probe_percpu; From owner-svn-src-head@freebsd.org Wed Nov 22 03:44: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 2206ADDDC3C; Wed, 22 Nov 2017 03:44:21 +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 E092B6A02C; Wed, 22 Nov 2017 03:44:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAM3iJDP047244; Wed, 22 Nov 2017 03:44:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAM3iJIa047243; Wed, 22 Nov 2017 03:44:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201711220344.vAM3iJIa047243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 22 Nov 2017 03:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326084 - 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: 326084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 03:44:21 -0000 Author: kevans Date: Wed Nov 22 03:44:19 2017 New Revision: 326084 URL: https://svnweb.freebsd.org/changeset/base/326084 Log: patch(1): don't assume a match if we run out of context to check Patches with very little context (-U0 and -U1) could get misapplied if the file to be patched changes and a hunk is no longer applicable. Matching with fuzz would be attempted and default to a match when we unexpectedly ran out of context. This also affected patches with higher levels of context but had limited actual context due to the hunk being located near the beginning/end of file. PR: 74127, 223545 (exp-run) Reviewed by: emaste, pfg Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12631 Modified: head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Wed Nov 22 01:53:59 2017 (r326083) +++ head/usr.bin/patch/patch.c Wed Nov 22 03:44:19 2017 (r326084) @@ -1026,6 +1026,9 @@ patch_match(LINENUM base, LINENUM offset, LINENUM fuzz const char *plineptr; unsigned short plinelen; + /* Patch does not match if we don't have any more context to use */ + if (pline > pat_lines) + return false; for (iline = base + offset + fuzz; pline <= pat_lines; pline++, iline++) { ilineptr = ifetch(iline, offset >= 0); if (ilineptr == NULL) From owner-svn-src-head@freebsd.org Wed Nov 22 05:27: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 70AD5DE114A; Wed, 22 Nov 2017 05:27:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B2D66CB32; Wed, 22 Nov 2017 05:27: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 vAM5RIZk088967; Wed, 22 Nov 2017 05:27:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAM5RIBS088966; Wed, 22 Nov 2017 05:27:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711220527.vAM5RIBS088966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 22 Nov 2017 05:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326085 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 326085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 05:27:19 -0000 Author: imp Date: Wed Nov 22 05:27:18 2017 New Revision: 326085 URL: https://svnweb.freebsd.org/changeset/base/326085 Log: Add a reference to getfsstat in statfs. Sponsored by: Netflix Modified: head/lib/libc/sys/statfs.2 Modified: head/lib/libc/sys/statfs.2 ============================================================================== --- head/lib/libc/sys/statfs.2 Wed Nov 22 03:44:19 2017 (r326084) +++ head/lib/libc/sys/statfs.2 Wed Nov 22 05:27:18 2017 (r326085) @@ -227,7 +227,8 @@ An error occurred while reading from or writing to the file system. .El .Sh SEE ALSO -.Xr fhstatfs 2 +.Xr fhstatfs 2 , +.Xr getfsstat 2 .Sh HISTORY The .Fn statfs From owner-svn-src-head@freebsd.org Wed Nov 22 05:49: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 A3FD7DE1706; Wed, 22 Nov 2017 05:49:22 +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 701CA6D41A; Wed, 22 Nov 2017 05:49:22 +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 vAM5nLW8097349; Wed, 22 Nov 2017 05:49:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAM5nLrt097346; Wed, 22 Nov 2017 05:49:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201711220549.vAM5nLrt097346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 22 Nov 2017 05:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326086 - 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: 326086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 05:49:22 -0000 Author: ae Date: Wed Nov 22 05:49:21 2017 New Revision: 326086 URL: https://svnweb.freebsd.org/changeset/base/326086 Log: Add ipfw_add_protected_rule() function that creates rule with 65535 number in the reserved set 31. Use this function to create default rule. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_private.h head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Wed Nov 22 05:27:18 2017 (r326085) +++ head/sys/netpfil/ipfw/ip_fw2.c Wed Nov 22 05:49:21 2017 (r326086) @@ -2842,11 +2842,6 @@ vnet_ipfw_init(const void *unused) ipfw_init_srv(chain); ipfw_init_counters(); - /* insert the default rule and create the initial map */ - chain->n_rules = 1; - chain->map = malloc(sizeof(struct ip_fw *), M_IPFW, M_WAITOK | M_ZERO); - rule = ipfw_alloc_rule(chain, sizeof(struct ip_fw)); - /* Set initial number of tables */ V_fw_tables_max = default_fw_tables; error = ipfw_init_tables(chain, first); @@ -2857,19 +2852,16 @@ vnet_ipfw_init(const void *unused) return (ENOSPC); } + IPFW_LOCK_INIT(chain); + /* fill and insert the default rule */ - rule->act_ofs = 0; - rule->rulenum = IPFW_DEFAULT_RULE; + rule = ipfw_alloc_rule(chain, sizeof(struct ip_fw)); rule->cmd_len = 1; - rule->set = RESVD_SET; rule->cmd[0].len = 1; rule->cmd[0].opcode = default_to_accept ? O_ACCEPT : O_DENY; - chain->default_rule = chain->map[0] = rule; - chain->id = rule->id = 1; - /* Pre-calculate rules length for legacy dump format */ - chain->static_len = sizeof(struct ip_fw_rule0); + chain->default_rule = rule; + ipfw_add_protected_rule(chain, rule, 0); - IPFW_LOCK_INIT(chain); ipfw_dyn_init(chain); ipfw_eaction_init(chain, first); #ifdef LINEAR_SKIPTO Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Wed Nov 22 05:27:18 2017 (r326085) +++ head/sys/netpfil/ipfw/ip_fw_private.h Wed Nov 22 05:49:21 2017 (r326086) @@ -625,6 +625,8 @@ void ipfw_destroy_skipto_cache(struct ip_fw_chain *cha int ipfw_find_rule(struct ip_fw_chain *chain, uint32_t key, uint32_t id); int ipfw_ctl3(struct sockopt *sopt); int ipfw_chk(struct ip_fw_args *args); +int ipfw_add_protected_rule(struct ip_fw_chain *chain, struct ip_fw *rule, + int locked); void ipfw_reap_add(struct ip_fw_chain *chain, struct ip_fw **head, struct ip_fw *rule); void ipfw_reap_rules(struct ip_fw *head); Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Nov 22 05:27:18 2017 (r326085) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Nov 22 05:49:21 2017 (r326086) @@ -790,6 +790,30 @@ commit_rules(struct ip_fw_chain *chain, struct rule_ch return (0); } +int +ipfw_add_protected_rule(struct ip_fw_chain *chain, struct ip_fw *rule, + int locked) +{ + struct ip_fw **map; + + map = get_map(chain, 1, locked); + if (map == NULL) + return (ENOMEM); + if (chain->n_rules > 0) + bcopy(chain->map, map, + chain->n_rules * sizeof(struct ip_fw *)); + map[chain->n_rules] = rule; + rule->rulenum = IPFW_DEFAULT_RULE; + rule->set = RESVD_SET; + rule->id = chain->id + 1; + /* We add rule in the end of chain, no need to update skipto cache */ + map = swap_map(chain, map, chain->n_rules + 1); + chain->static_len += RULEUSIZE0(rule); + IPFW_UH_WUNLOCK(chain); + free(map, M_IPFW); + return (0); +} + /* * Adds @rule to the list of rules to reap */ From owner-svn-src-head@freebsd.org Wed Nov 22 08:48: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 33C21DE522B; Wed, 22 Nov 2017 08:48:02 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DB85728C5; Wed, 22 Nov 2017 08:48:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAM8m1Tc074150; Wed, 22 Nov 2017 08:48:01 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAM8m1wk074149; Wed, 22 Nov 2017 08:48:01 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201711220848.vAM8m1wk074149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 22 Nov 2017 08:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326089 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 326089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 08:48:02 -0000 Author: tsoome Date: Wed Nov 22 08:48:00 2017 New Revision: 326089 URL: https://svnweb.freebsd.org/changeset/base/326089 Log: loader.efi: efipart does not recognize partitionless disks Rework the block device handle check to allow more robust device classification. This is mostly usability issue - it can be quite confusing for user when no disks are listed with lsdev. Add more comments about what and why is done. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D13026 Modified: head/stand/efi/libefi/efipart.c Modified: head/stand/efi/libefi/efipart.c ============================================================================== --- head/stand/efi/libefi/efipart.c Wed Nov 22 06:36:55 2017 (r326088) +++ head/stand/efi/libefi/efipart.c Wed Nov 22 08:48:00 2017 (r326089) @@ -196,6 +196,72 @@ efipart_floppy(EFI_DEVICE_PATH *node) } /* + * Determine if the provided device path is hdd. + * + * There really is no simple fool proof way to classify the devices. + * Since we do build three lists of devices - floppy, cd and hdd, we + * will try to see if the device is floppy or cd, and list anything else + * as hdd. + */ +static bool +efipart_hdd(EFI_DEVICE_PATH *dp) +{ + unsigned i, nin; + EFI_DEVICE_PATH *devpath, *node; + EFI_BLOCK_IO *blkio; + EFI_STATUS status; + + if (dp == NULL) + return (false); + + if ((node = efi_devpath_last_node(dp)) == NULL) + return (false); + + if (efipart_floppy(node) != NULL) + return (false); + + /* + * Test every EFI BLOCK IO handle to make sure dp is not device path + * for CD/DVD. + */ + nin = efipart_nhandles / sizeof (*efipart_handles); + for (i = 0; i < nin; i++) { + devpath = efi_lookup_devpath(efipart_handles[i]); + if (devpath == NULL) + return (false); + + /* Only continue testing when dp is prefix in devpath. */ + if (!efi_devpath_is_prefix(dp, devpath)) + continue; + + /* + * The device path has to have last node describing the + * device, or we can not test the type. + */ + if ((node = efi_devpath_last_node(devpath)) == NULL) + return (false); + + if (DevicePathType(node) == MEDIA_DEVICE_PATH && + DevicePathSubType(node) == MEDIA_CDROM_DP) { + return (false); + } + + /* Make sure we do have the media. */ + status = BS->HandleProtocol(efipart_handles[i], + &blkio_guid, (void **)&blkio); + if (EFI_ERROR(status)) + return (false); + + /* USB or SATA cd without the media. */ + if (blkio->Media->RemovableMedia && + !blkio->Media->MediaPresent) { + return (false); + } + } + return (true); +} + +/* * Add or update entries with new handle data. */ static int @@ -308,9 +374,13 @@ efipart_updatecd(void) if ((node = efi_devpath_last_node(devpath)) == NULL) continue; + if (efipart_floppy(node) != NULL) continue; + if (efipart_hdd(devpath)) + continue; + status = BS->HandleProtocol(efipart_handles[i], &blkio_guid, (void **)&blkio); if (EFI_ERROR(status)) @@ -380,13 +450,21 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE pdinfo_t *hd, *pd, *last; disk_devpath = efi_lookup_devpath(disk_handle); - part_devpath = efi_lookup_devpath(part_handle); - if (disk_devpath == NULL || part_devpath == NULL) { + if (disk_devpath == NULL) return (ENOENT); + + if (part_handle != NULL) { + part_devpath = efi_lookup_devpath(part_handle); + if (part_devpath == NULL) + return (ENOENT); + node = (HARDDRIVE_DEVICE_PATH *) + efi_devpath_last_node(part_devpath); + if (node == NULL) + return (ENOENT); /* This should not happen. */ + } else { + part_devpath = NULL; + node = NULL; } - node = (HARDDRIVE_DEVICE_PATH *)efi_devpath_last_node(part_devpath); - if (node == NULL) - return (ENOENT); /* This should not happen. */ pd = calloc(1, sizeof(pdinfo_t)); if (pd == NULL) { @@ -397,6 +475,9 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE STAILQ_FOREACH(hd, &hdinfo, pd_link) { if (efi_devpath_match(hd->pd_devpath, disk_devpath) == true) { + if (part_devpath == NULL) + return (0); + /* Add the partition. */ pd->pd_handle = part_handle; pd->pd_unit = node->PartitionNumber; @@ -419,6 +500,9 @@ efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE hd->pd_devpath = disk_devpath; STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link); + if (part_devpath == NULL) + return (0); + pd = calloc(1, sizeof(pdinfo_t)); if (pd == NULL) { printf("Failed to add partition, out of memory\n"); @@ -541,7 +625,8 @@ efipart_updatehd(void) if ((node = efi_devpath_last_node(devpath)) == NULL) continue; - if (efipart_floppy(node) != NULL) + + if (!efipart_hdd(devpath)) continue; status = BS->HandleProtocol(efipart_handles[i], @@ -550,6 +635,12 @@ efipart_updatehd(void) continue; if (DevicePathType(node) == MEDIA_DEVICE_PATH && + DevicePathSubType(node) == MEDIA_FILEPATH_DP) { + efipart_hdinfo_add_filepath(efipart_handles[i]); + continue; + } + + if (DevicePathType(node) == MEDIA_DEVICE_PATH && DevicePathSubType(node) == MEDIA_HARDDRIVE_DP) { devpathcpy = efi_devpath_trim(devpath); if (devpathcpy == NULL) @@ -568,18 +659,16 @@ efipart_updatehd(void) continue; if ((node = efi_devpath_last_node(devpathcpy)) == NULL) continue; + if (DevicePathType(node) == MEDIA_DEVICE_PATH && DevicePathSubType(node) == MEDIA_HARDDRIVE_DP) continue; + efipart_hdinfo_add(handle, efipart_handles[i]); continue; } - if (DevicePathType(node) == MEDIA_DEVICE_PATH && - DevicePathSubType(node) == MEDIA_FILEPATH_DP) { - efipart_hdinfo_add_filepath(efipart_handles[i]); - continue; - } + efipart_hdinfo_add(efipart_handles[i], NULL); } } From owner-svn-src-head@freebsd.org Wed Nov 22 10:04: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 C144FDE6AD7; Wed, 22 Nov 2017 10:04:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EB7775168; Wed, 22 Nov 2017 10:04:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMA49Yb007168; Wed, 22 Nov 2017 10:04:09 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMA49b5007167; Wed, 22 Nov 2017 10:04:09 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201711221004.vAMA49b5007167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 22 Nov 2017 10:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326090 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 326090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 10:04:10 -0000 Author: tsoome Date: Wed Nov 22 10:04:09 2017 New Revision: 326090 URL: https://svnweb.freebsd.org/changeset/base/326090 Log: net_parse_rootpath() has no parameters Add void for parameter list. Modified: head/stand/common/dev_net.c Modified: head/stand/common/dev_net.c ============================================================================== --- head/stand/common/dev_net.c Wed Nov 22 08:48:00 2017 (r326089) +++ head/stand/common/dev_net.c Wed Nov 22 10:04:09 2017 (r326090) @@ -382,7 +382,7 @@ net_print(int verbose) * It leaves just the pathname in the global rootpath. */ uint32_t -net_parse_rootpath() +net_parse_rootpath(void) { n_long addr = htonl(INADDR_NONE); size_t i; From owner-svn-src-head@freebsd.org Wed Nov 22 10:39:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CC0DDE7216; Wed, 22 Nov 2017 10:39:25 +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 9E3EE75D7E; Wed, 22 Nov 2017 10:39:24 +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 vAMAdHnj029999 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 22 Nov 2017 12:39:17 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vAMAdHnj029999 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vAMAdHQL029998; Wed, 22 Nov 2017 12:39:17 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 22 Nov 2017 12:39:17 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat Message-ID: <20171122103917.GS2272@kib.kiev.ua> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171122071838.R1172@besplex.bde.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 10:39:25 -0000 On Wed, Nov 22, 2017 at 08:59:21AM +1100, Bruce Evans wrote: > On Tue, 21 Nov 2017, Konstantin Belousov wrote: > > > Log: > > systat: use and correctly display 64bit counters. > > > > Following struct vmtotal changes, make systat use and correctly > > display 64-bit counters. Switch to humanize_number(3) to overcome > > homegrown arithmetics limits in pretty printing large numbers. Use > > 1024 as a divisor for memory fields to make it consistent with other > > tools and users expectations. > > I don't like dehumanize_number(), and it can't handle most cases in > systat -v since most cases use floating point. > > Using unsigned types gives sign extension bugs as usual. In old versions > version, large unsigned numbers (only their lower 32 bits) were not > unintentionally printed in signed format to get an early warning about > overflow when they reach half-way to 32-bit overflow. This is no longer > useful, but signed format is still used. There are related sign extension > bugs for non-64-bit fields that allow the early warning to still work. > > > Modified: head/usr.bin/systat/vmstat.c > > ============================================================================== > > --- head/usr.bin/systat/vmstat.c Tue Nov 21 19:23:20 2017 (r326072) > > +++ head/usr.bin/systat/vmstat.c Tue Nov 21 19:55:32 2017 (r326073) > > @@ -138,6 +140,8 @@ static float cputime(int); > > static void dinfo(int, int, struct statinfo *, struct statinfo *); > > static void getinfo(struct Info *); > > static void putint(int, int, int, int); > > +static void putuint64(uint64_t, int, int, int); > > +static void do_putuint64(uint64_t, int, int, int, int); > > Style bug (unsorting). > > > static void putfloat(double, int, int, int, int, int); > > static void putlongdouble(long double, int, int, int, int, int); > > static int ucount(void); > > @@ -491,15 +495,15 @@ showkre(void) > > putfloat(100.0 * s.v_kmem_map_size / kmem_size, > > STATROW + 1, STATCOL + 22, 2, 0, 1); > > > > - putint(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); > > - putint(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); > > - putint(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); > > - putint(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); > > - putint(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); > > - putint(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); > > - putint(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); > > - putint(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); > > - putint(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); > > + putuint64(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); > > + putuint64(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); > > + putuint64(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); > > + putuint64(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); > > + putuint64(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); > > + putuint64(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); > > + putuint64(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); > > + putuint64(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); > > + putuint64(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); > > I see that a very recent expansion from int32_t to uint64_t didn't work > here. Can you explain, please ? > > > putint(total.t_rq - 1, PROCSROW + 2, PROCSCOL, 3); > > putint(total.t_pw, PROCSROW + 2, PROCSCOL + 4, 3); > > putint(total.t_dw, PROCSROW + 2, PROCSCOL + 8, 3); > > This has larger sign extension bugs than before. All the fields here are > still int16_t. putint() still takes int args, and so the int16_t's int > converted to int. The used to be printed as int, but now they are converted > to uint64_t. They shouldn't be negative, but if they are then the were printed > as negative. Now the conversion to uint64_t has sign-extension bugs/overflows > for negative values. Negative values still be printed as negative via further > overflows, but if the values are passed to dehumanize_number(), they are > printed as enormous unsigned values. I do not see a point in expanding the process counters to uint16_t. I might do it if somebody has a realistic load with 30K processes in a system. Having 100K threads created simultaneously is quite affordable, so the change could be useful one day. > > Printing everything as 64 bits is a pessimization. It would probably work > to convert everything to float and use only putfloat(). This gives about > 8 digits of accuracy and even that is often too many. This was not done > mainly because floating point was slower than integers. Now it might > be faster than uint64_t. > > Flots could also be converted to integers except for printing the percentage > and not much more. A special case for the percentage would be easy to write > and is already partly there to avoid printing 100.0 which is too wide. This > was not done mainly because 32-bit ints were too small. > > > @@ -518,13 +522,13 @@ showkre(void) > > PUTRATE(v_pdwakeups, VMSTATROW + 9, VMSTATCOL, 8); > > PUTRATE(v_pdpages, VMSTATROW + 10, VMSTATCOL, 8); > > PUTRATE(v_intrans, VMSTATROW + 11, VMSTATCOL, 8); > > - putint(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); > > - putint(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); > > - putint(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); > > - putint(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); > > - putint(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); > > + putuint64(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); > > + putuint64(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); > > + putuint64(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); > > + putuint64(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); > > + putuint64(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); > > This is bogus. The fields still have type u_int. pgtokb() expands by a > factor of 4 or 8, and putuint64() can handle the expansion, but pgtokb() > still overflows before the value can be passed. These fields come from different structure (vmtotal vs. vmmeter), and surprisingly vmmeter is not part of the ABI. Expanding the type of v_free_count is easy. Having the changes in vmstat for vmmeter fields done together with vmtotal expansion is reasonable. We targeted all memory reporting. > > Overflow occurs at 1K * 4G = 4T. I think that much memory costs about > $100000 so no one here has it. I had the access to a machine with 2T of memory year ago. > > > if (LINES - 1 > VMSTATROW + 17) > > - putint(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); > > + putuint64(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); > > s.bufspace has the bogus type long, so in 32-bit systems overflow occurs > with only 2T of bufspace, and on 64-bit systems the expansion can overflow > even uint64_t, but the world doesn't have that much memory (2T * 2**32). So practically overflow cannot occur. I do not quite see the point of the comment. > > > PUTRATE(v_vnodein, PAGEROW + 2, PAGECOL + 6, 5); > > PUTRATE(v_vnodeout, PAGEROW + 2, PAGECOL + 12, 5); > > PUTRATE(v_swapin, PAGEROW + 2, PAGECOL + 19, 5); > > @@ -666,8 +670,23 @@ cputime(int indx) > > static void > > putint(int n, int l, int lc, int w) > > { > > + > > + do_putuint64(n, l, lc, w, SI); > > Sign extension busg for promoting int to uint64_t. > > > +} > > + > > +static void > > +putuint64(uint64_t n, int l, int lc, int w) > > +{ > > + > > + do_putuint64(n, l, lc, w, IEC); > > +} > > The divisor is a bit too specialized (IEC is forced for all uint64_t) > > > + > > +static void > > +do_putuint64(uint64_t n, int l, int lc, int w, int div) > > +{ > > int snr; > > char b[128]; > > + char buf[128]; > > > > move(l, lc); > > #ifdef DEBUG > > @@ -680,11 +699,12 @@ putint(int n, int l, int lc, int w) > > addch(' '); > > return; > > } > > - snr = snprintf(b, sizeof(b), "%*d", w, n); > > - if (snr != w) > > - snr = snprintf(b, sizeof(b), "%*dk", w - 1, n / 1000); > > - if (snr != w) > > - snr = snprintf(b, sizeof(b), "%*dM", w - 1, n / 1000000); > > The signed format used to match the signed arg. The early warning hack > mostly operated earlier -- u_int args sometimes overflowed to pass them > here as ints. The overflow gave had implementation-defined behaviour > earlier but the behaviour here is defined. > > > + snr = snprintf(b, sizeof(b), "%*jd", w, (uintmax_t)n); > > The signed format no longer matches the unsigned arg. It still gives the > early warning hack via overflow earlier in most cases. The behaviour here > is undefined iff (uintmax_t)n exceeds INTMAX_MAX. Thanks, see the patch at the end. > > Conversion to uintmax_t breaks the hack on unsupported arches when uintmax_t > is larger than uint64_t. Then if we start with signed -1, it becomes > 0xffffffffffffffff as a uint64_t and expanding that loses the original > sign bit in a non-recoverable way. > > > + if (snr != w) { > > + humanize_number(buf, w, n, "", HN_AUTOSCALE, > > + HN_NOSPACE | HN_DECIMAL | div); > > If this case is reached, then it loses the sign bit in another > non-recoverable way (by not accidentally recovering it). > > > + snr = snprintf(b, sizeof(b), "%*s", w, buf); > > + } > > if (snr != w) { > > This case is almost (?) unreachable now. It only occurs if b < 3 or > if dehumanize_number() doesn't have enough suffixes to reach > UINT64_MAX. Otherwise, it can always print 0 or 1 followed by the > largest suffix and a NUL. It seems to be 1 suffix short. The largest > prefix is E (exa), and UINT64_MAX is 18.4E which should be printed as > 18E, but that takes b >= 4. > > > while (w-- > 0) > > addch('*'); > > This returns a field full of stars if the value doesn't fit. I like > this for showing fields with preposterous values more clearly than > something like 18E. diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 736cacda061..149efb46760 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -138,10 +138,10 @@ static void allocinfo(struct Info *); static void copyinfo(struct Info *, struct Info *); static float cputime(int); static void dinfo(int, int, struct statinfo *, struct statinfo *); +static void do_putuint64(uint64_t, int, int, int, int); static void getinfo(struct Info *); static void putint(int, int, int, int); static void putuint64(uint64_t, int, int, int); -static void do_putuint64(uint64_t, int, int, int, int); static void putfloat(double, int, int, int, int, int); static void putlongdouble(long double, int, int, int, int, int); static int ucount(void); @@ -699,7 +699,7 @@ do_putuint64(uint64_t n, int l, int lc, int w, int div) addch(' '); return; } - snr = snprintf(b, sizeof(b), "%*jd", w, (uintmax_t)n); + snr = snprintf(b, sizeof(b), "%*ju", w, (uintmax_t)n); if (snr != w) { humanize_number(buf, w, n, "", HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL | div); From owner-svn-src-head@freebsd.org Wed Nov 22 14:11: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 0FEF9DEC89B; Wed, 22 Nov 2017 14:11:00 +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 CDF1E7BAB6; Wed, 22 Nov 2017 14:10:59 +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 vAMEAwUr007789; Wed, 22 Nov 2017 14:10:58 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMEAw7k007788; Wed, 22 Nov 2017 14:10:58 GMT (envelope-from br@FreeBSD.org) Message-Id: <201711221410.vAMEAw7k007788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 22 Nov 2017 14:10:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326092 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 326092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 14:11:00 -0000 Author: br Date: Wed Nov 22 14:10:58 2017 New Revision: 326092 URL: https://svnweb.freebsd.org/changeset/base/326092 Log: o Invalidate the correct page in pmap_protect(). With this bug fix we don't need to invalidate all the entries. o Remove a call to pmap_invalidate_all(). This was never called as the anyvalid variable is never set. Obtained from: arm64/pmap.c (r322797, r322800) Sponsored by: DARPA, AFRL Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Wed Nov 22 14:06:40 2017 (r326091) +++ head/sys/riscv/riscv/pmap.c Wed Nov 22 14:10:58 2017 (r326092) @@ -1804,7 +1804,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t pd_entry_t *l1, *l2; pt_entry_t l3_pte, *l3; struct spglist free; - int anyvalid; /* * Perform an unsynchronized read. This is, however, safe. @@ -1812,7 +1811,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t if (pmap->pm_stats.resident_count == 0) return; - anyvalid = 0; SLIST_INIT(&free); rw_rlock(&pvh_global_lock); @@ -1885,8 +1883,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t } if (lock != NULL) rw_wunlock(lock); - if (anyvalid) - pmap_invalidate_all(pmap); rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); @@ -2014,14 +2010,11 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t pmap_load_store(l3p, entry); PTE_SYNC(l3p); /* XXX: Use pmap_invalidate_range */ - pmap_invalidate_page(pmap, va); + pmap_invalidate_page(pmap, sva); } } } PMAP_UNLOCK(pmap); - - /* TODO: Only invalidate entries we are touching */ - pmap_invalidate_all(pmap); } /* From owner-svn-src-head@freebsd.org Wed Nov 22 14: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 6781EDECA89; Wed, 22 Nov 2017 14:13:41 +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 31A4C7BE32; Wed, 22 Nov 2017 14:13:41 +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 vAMEDePd011665; Wed, 22 Nov 2017 14:13:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMEDeRh011664; Wed, 22 Nov 2017 14:13:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711221413.vAMEDeRh011664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 Nov 2017 14:13:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326093 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 326093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 14:13:41 -0000 Author: markj Date: Wed Nov 22 14:13:40 2017 New Revision: 326093 URL: https://svnweb.freebsd.org/changeset/base/326093 Log: Use the right variable for the IP header parameter to tcp:::send. This addresses a regression from r311225. MFC after: 1 week Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Nov 22 14:10:58 2017 (r326092) +++ head/sys/netinet/tcp_subr.c Wed Nov 22 14:13:40 2017 (r326093) @@ -1238,16 +1238,20 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcph if (flags & TH_RST) TCP_PROBE5(accept__refused, NULL, NULL, m, tp, nth); - TCP_PROBE5(send, NULL, tp, m, tp, nth); #ifdef INET6 - if (isipv6) - (void) ip6_output(m, NULL, NULL, 0, NULL, NULL, inp); + if (isipv6) { + TCP_PROBE5(send, NULL, tp, ip6, tp, nth); + (void)ip6_output(m, NULL, NULL, 0, NULL, NULL, inp); + } #endif /* INET6 */ #if defined(INET) && defined(INET6) else #endif #ifdef INET - (void) ip_output(m, NULL, NULL, 0, NULL, inp); + { + TCP_PROBE5(send, NULL, tp, ip, tp, nth); + (void)ip_output(m, NULL, NULL, 0, NULL, inp); + } #endif } From owner-svn-src-head@freebsd.org Wed Nov 22 15:18: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 6A4F0DEDFDA; Wed, 22 Nov 2017 15:18:12 +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 396527DE1F; Wed, 22 Nov 2017 15:18:12 +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 vAMFIBgW037246; Wed, 22 Nov 2017 15:18:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMFIB4s037245; Wed, 22 Nov 2017 15:18:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711221518.vAMFIB4s037245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 22 Nov 2017 15:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326094 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 326094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 15:18:12 -0000 Author: emaste Date: Wed Nov 22 15:18:11 2017 New Revision: 326094 URL: https://svnweb.freebsd.org/changeset/base/326094 Log: Fix indentation in bsdinstall-created wpa_supplicant.conf r309934 cleaned up some cases in bsdinstall to use heredocs but broke the indentation of the generated output, because <<- heredocs strip leading tabs. PR: 221982 Reviewed by: allanjude, dteske MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D13190 Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig Modified: head/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/wlanconfig Wed Nov 22 14:13:40 2017 (r326093) +++ head/usr.sbin/bsdinstall/scripts/wlanconfig Wed Nov 22 15:18:11 2017 (r326094) @@ -280,14 +280,14 @@ if echo "$ENCRYPTION" | grep -q PSK; then 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF - network={ - ssid="$NETWORK" - scan_ssid=$SCANSSID - psk="$PASS" - priority=5 - } - EOF + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF - network={ - ssid="$NETWORK" - scan_ssid=$SCANSSID - key_mgmt=WPA-EAP$( - echo "$USERPASS" | awk ' - NR == 1 { printf "\n\t\tidentity=\"%s\"", $1 } - NR == 2 { printf "\n\t\tpassword=\"%s\"", $1 } - ' ) - priority=5 - } - EOF + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF - network={ - ssid="$NETWORK" - scan_ssid=$SCANSSID - key_mgmt=NONE - wep_key0="$WEPKEY" - wep_tx_keyidx=0 - priority=5 - } - EOF + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF - network={ - ssid="$NETWORK" - scan_ssid=$SCANSSID - key_mgmt=NONE - priority=5 - } - EOF + >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" < Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89F16DEE2DD; Wed, 22 Nov 2017 15:27:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 512D47E2D1; Wed, 22 Nov 2017 15:27:48 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMFRlOG041362; Wed, 22 Nov 2017 15:27:47 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMFRlTc041361; Wed, 22 Nov 2017 15:27:47 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201711221527.vAMFRlTc041361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 22 Nov 2017 15:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 326095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 15:27:48 -0000 Author: manu Date: Wed Nov 22 15:27:47 2017 New Revision: 326095 URL: https://svnweb.freebsd.org/changeset/base/326095 Log: bsdinstall: Add ntpdate option When you install a computer for the first time, the date in the CMOS sometimes not accurate and you need to ntpdate as ntpd will fail a the time difference is too big. Add an option in bsdinstall to enable ntpdate that will do that for us. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D13149 Modified: head/usr.sbin/bsdinstall/scripts/services Modified: head/usr.sbin/bsdinstall/scripts/services ============================================================================== --- head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:18:11 2017 (r326094) +++ head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:27:47 2017 (r326095) @@ -46,6 +46,8 @@ DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ local_unbound "Local caching validating resolver" ${local_unbound:-off} \ sshd "Secure shell daemon" ${sshd_enable:-off} \ moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ + ntpdate "Synchronize system and network time at bootime" \ + ${ntpdate_enable:-off} \ ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ powerd "Adjust CPU frequency dynamically if supported" \ ${powerd_enable:-off} \ From owner-svn-src-head@freebsd.org Wed Nov 22 15:54:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DC08DEEB08; Wed, 22 Nov 2017 15:54:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A3CE7EF82; Wed, 22 Nov 2017 15:54:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMFsqVO053794; Wed, 22 Nov 2017 15:54:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMFsqnG053793; Wed, 22 Nov 2017 15:54:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711221554.vAMFsqnG053793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 Nov 2017 15:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326096 - head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/usr.sbin/dtrace/tests/tools X-SVN-Commit-Revision: 326096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 15:54:53 -0000 Author: markj Date: Wed Nov 22 15:54:52 2017 New Revision: 326096 URL: https://svnweb.freebsd.org/changeset/base/326096 Log: Annotate pragma/err.invalidlibdep.ksh as EXFAIL. The test creates a D library with a "depends_on library" pragma referencing a non-existent library, and expects compilation to fail. However, as far as I can tell, libdtrace is supposed simply abort compilation of the library in this case, and continue. This behaviour is desirable when adding libraries which depend on optional KLDs, for example. MFC after: 1 week Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Wed Nov 22 15:27:47 2017 (r326095) +++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Wed Nov 22 15:54:52 2017 (r326096) @@ -139,6 +139,11 @@ exclude EXFAIL common/pid/tst.newprobes.ksh exclude EXFAIL common/pid/tst.provregex2.ksh exclude EXFAIL common/pid/tst.provregex4.ksh +# This test appears to be invalid. dtrace is supposed to press on if a +# depends_on pragma cannot be satisfied, per the comment above +# dt_load_libs_dir() in libdtrace. +exclude EXFAIL common/pragma/err.invalidlibdep.ksh + # This test checks for a leading tab on a line before #define. That is illegal # on Solaris, but the clang pre-processor on FreeBSD is happy with code like # that. From owner-svn-src-head@freebsd.org Wed Nov 22 16: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 A350FDEF01E; Wed, 22 Nov 2017 16:16:59 +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 26FED7F7D4; Wed, 22 Nov 2017 16:16:59 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x231.google.com with SMTP id w23so18839929lfd.11; Wed, 22 Nov 2017 08:16:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=v2iTT/JM6Ceeeo46LARWBY5dEHz5YGC/zbB8kpb49Xc=; b=g64ndA+WtWrWYMdMlWgUhRxF0bBXLcGx0RcI7kGYwzn7dYGRfjPTpoWh014Sgam2nH bhC2Yw0midMhZb+bxw+N35OB6PP11rOIS1mexOpGLmMfI/Ogly3t7BDx0XMyIVwkN9A8 qm/UpHBVrzCdzq1WZhoQOci6i0T3zd/ahhjdtrDCIXjx6S/8DSzneT+qBI9A4rloscqK tEXy3aKKo0OPF6DLYe4xw186InwHZcZKYcpOMooOWBNKhNYn0rV2H+H3mv2AuEkpKwp6 dpzmK6H5IMIFUcEbI/wcGu+CelxUBjIw350Vkb+pMs2egulcO/ti7cGvNPc2Czsnsytz CLrQ== 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=v2iTT/JM6Ceeeo46LARWBY5dEHz5YGC/zbB8kpb49Xc=; b=aEbXYSEa2UeZsR7DlBcYL/gWaQMUw4boYM1YcS8MDz509M7QiQDxV3jRFTSrA6tt/X odhBbAB8HkLJHEelKxL1pk3CU0UYcD45NyeShWHsDpElASAGcMdQ5AJ2k0NM19VJNAYH Otvy5HIsi3KYco7BIPKKqucAPb8dEBGbbKWgUQqRKMFdF6txkF1a/qWo0pZHD/754xv3 TN66WS4BYYptq5xgZiuyXond3Sj2uge3UK1T8zu8RMvxeZw1tLCDyXFrznb+9gzW7zH9 4c70daRgeuLxeY2NL7ztY+QY/COWSn/LBxCbJgDoa9fTCcVzctTZ5/nez6WlcSrkYZYO vVdQ== X-Gm-Message-State: AJaThX6zSOt1036jzP6QRA9Qx8vH7V/uwsJaNgEGVjwXd/v5UlNimsYx LhujNozeWLMtpIwFdcRAoZYBHVhG9NkOu9h2yMw= X-Google-Smtp-Source: AGs4zMaJbokRIspLxM5Cn3MQKC1jplXVghVyanwXb1t94Kcj6gYMq9OCt2UD44AW3VKRs6PXCD9QjAdSCV5y1oUtNl0= X-Received: by 10.46.20.4 with SMTP id u4mr4684447ljd.38.1511367416976; Wed, 22 Nov 2017 08:16:56 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.76.19 with HTTP; Wed, 22 Nov 2017 08:16:56 -0800 (PST) In-Reply-To: References: <201711202227.vAKMRYvW001932@repo.freebsd.org> From: Alan Somers Date: Wed, 22 Nov 2017 09:16:56 -0700 X-Google-Sender-Auth: agjreehG24IS8_VuLDVKoQTAeRg Message-ID: Subject: Re: svn commit: r326036 - head/sys/cam/scsi To: Ronald Klop Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Justin T. Gibbs" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 16:16:59 -0000 I believe the original motivation was to reduce FLUSH CACHE EXT activity with some old SSDs that handled that command very slowly. gibbs might know more. On Tue, Nov 21, 2017 at 1:14 PM, Ronald Klop wrote: > Out of curiosity, What is the use case which this improves? Does happen in > daily usage or mostly in testing? > > Regards, > Ronald. > > > > On Mon, 20 Nov 2017 23:27:34 +0100, Alan Somers wrote: > >> Author: asomers >> Date: Mon Nov 20 22:27:33 2017 >> New Revision: 326036 >> URL: https://svnweb.freebsd.org/changeset/base/326036 >> >> Log: >> da(4): Short-circuit unnecessary BIO_FLUSH commands >> sys/cam/scsi/scsi_da.c >> Complete BIO_FLUSH commands immediately if the da(4) device hasn't >> been written to since the last flush. If we haven't written to the >> device, there is no reason to send a flush. >> Submitted by: gibbs >> Reviewed by: imp >> MFC after: 3 weeks >> Sponsored by: Spectra Logic Corp >> Differential Revision: https://reviews.freebsd.org/D13106 >> >> Modified: >> head/sys/cam/scsi/scsi_da.c >> >> Modified: head/sys/cam/scsi/scsi_da.c >> >> ============================================================================== >> --- head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:18:24 2017 (r326035) >> +++ head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:27:33 2017 (r326036) >> @@ -3038,6 +3038,18 @@ more: >> } >> case BIO_FLUSH: >> /* >> + * If we don't support sync cache, or the disk >> + * isn't dirty, FLUSH is a no-op. Use the >> + * allocated * CCB for the next bio if one is >> + * available. >> + */ >> + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) != 0 || >> + (softc->flags & DA_FLAG_DIRTY) == 0) { >> + biodone(bp); >> + goto skipstate; >> + } >> + >> + /* >> * BIO_FLUSH doesn't currently communicate >> * range data, so we synchronize the cache >> * over the whole disk. We also force >> @@ -3052,6 +3064,15 @@ more: >> /*lb_count*/0, >> SSD_FULL_SIZE, >> da_default_timeout*1000); >> + /* >> + * Clear the dirty flag before sending the >> command. >> + * Either this sync cache will be successful, or >> it >> + * will fail after a retry. If it fails, it is >> + * unlikely to be successful if retried later, so >> + * we'll save ourselves time by just marking the >> + * device clean. >> + */ >> + softc->flags &= ~DA_FLAG_DIRTY; >> break; >> case BIO_ZONE: { >> int error, queue_ccb; >> _______________________________________________ >> svn-src-all@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-all >> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Wed Nov 22 16:19: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 8538FDEF161 for ; Wed, 22 Nov 2017 16:19:56 +0000 (UTC) (envelope-from mk@semihalf.com) Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::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 505B67F9D2 for ; Wed, 22 Nov 2017 16:19:56 +0000 (UTC) (envelope-from mk@semihalf.com) Received: by mail-qk0-x231.google.com with SMTP id c123so7053438qkf.7 for ; Wed, 22 Nov 2017 08:19:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Un3uXIqlMm7dF+jSqcZaceTC9U5HgMXJL4PQVoRdopU=; b=q3LWGu93/bAGOK8evBEfQv3VHxCZD1e95ejJmMXuf0QmiRkrkLLNePGynWycWHHPS7 GlG+fPkMz3bTqOVYw6KMeo1odGQkQRK2VbfwBC4WVQ1sD4mwNSKfKtcSYowDMgTDNz3H jL/eTkgI6+aV8hTFDQHTneXZ8qnEGjuZtG5O7R7HfYgcEoioJY95T4jnzA2+mqKNzGOg elrWxiQSPN1sM64P/8EUzS/SxFQ6Vciyglygt6sMX5v04mAcWbo6zsc3z9yV58xmg9gJ /fr6aG+y0OgNEeYB5NPYc8QN5FgS1bxuSeDOnQtir0B8/94lsPZ4lYWj7Ex5EhtylK6/ Kkog== 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=Un3uXIqlMm7dF+jSqcZaceTC9U5HgMXJL4PQVoRdopU=; b=md71GBtvdtUZxAv4iX9J7peDH87kd45Cx///RA5bmbO6O4EkiFsvHOhP1uKUAFIr3E FgOCqgkV4nkepM0xI8Wr3AOcxZ1WmF/YTrK3qdaA28e506Ol3M2YsOjOEdvNrIzQkZyG vDj4ElmPvmnW4lMCvBScX9HZ4K+HvAdVNC4MMHC8JfWxguS8W6S8qRjlCJyJlF+nJRl+ DhE+V9V7Cr1jQmJydcsjDScha6XKp21hMtN+780G9iHq9F9H6jpeqbSYE7QBtFI4YRt+ pMB4d58FCxSUTLnqm1ihsmJs4v+t5FhEJE7IAQVXAHMoToFbNkCQPl8vASt5wA87bIlq ki1A== X-Gm-Message-State: AJaThX586zFJK3j7mfDPqSm1piOgNZPEQIsQJI+qCBB6AbzDeyGLE2a3 2FjzvHaWKyJ0fxcob2EvBkf42SglEFNApWBjoDbAEw== X-Google-Smtp-Source: AGs4zMYgQHA9S0aDG6zhAGtlHYr7Pab2UzkA2nYhWyFkAz1RoNwE87VI6VFen+8bV4Qoz0x0x/aVeoRWFkB+OyTJhFI= X-Received: by 10.55.22.7 with SMTP id g7mr33429277qkh.82.1511367594959; Wed, 22 Nov 2017 08:19:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.144.203 with HTTP; Wed, 22 Nov 2017 08:19:54 -0800 (PST) In-Reply-To: <20171122000816.GH1063@FreeBSD.org> References: <201710311631.v9VGVNOs058255@repo.freebsd.org> <20171122000816.GH1063@FreeBSD.org> From: =?UTF-8?Q?Micha=C5=82_Krawczyk?= Date: Wed, 22 Nov 2017 17:19:54 +0100 Message-ID: Subject: Re: svn commit: r325239 - head/sys/dev/ena To: Gleb Smirnoff Cc: Marcin Wojtas , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 16:19:56 -0000 Hi Gleb, We are counting the statistics in the software because of the alignment with the newest ena-com API (HAL) which is delivered to us from NIC's vendor. Regarding fetching them periodically - there are 2 issues with that. First of all, there may be problem with the counter overflow. Secondly, reading statistics on demand requires sending admin message to the NIC and then the cv_timedwait function is called to wait for the response. However there are a lot of witness warnings when the cv_timedwait is called from the if_get_counter() context, because of the non sleepable lock which is hold there (I don't remember exactly which lock was causing this issue). Best regards, Michal 2017-11-22 1:08 GMT+01:00 Gleb Smirnoff : > Hi Martin and Michal, > > On Tue, Oct 31, 2017 at 04:31:23PM +0000, Marcin Wojtas wrote: > M> Author: mw > M> Date: Tue Oct 31 16:31:23 2017 > M> New Revision: 325239 > M> URL: https://svnweb.freebsd.org/changeset/base/325239 > M> > M> Log: > M> Rework counting of hardware statistics in ENA driver > M> > M> Do not read all statistics from the device, instead count them in the > M> driver except from RX drops - they are received directly from the NIC > M> in the AENQ descriptor. > M> > M> Submitted by: Michal Krawczyk > M> Reviewed by: imp > M> Obtained from: Semihalf > M> Sponsored by: Amazon.com, Inc. > M> Differential Revision: https://reviews.freebsd.org/D12852 > > Is it possible not to count them in software, as well as not fetch > them from hardware periodically, but instead just fetch them on > demand, when either if_get_counter() or a sysctl is called? > > That would be more efficient. > > -- > Gleb Smirnoff > From owner-svn-src-head@freebsd.org Wed Nov 22 16:38: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 A3459DEF9F1 for ; Wed, 22 Nov 2017 16:38:15 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87B90808B3 for ; Wed, 22 Nov 2017 16:38:15 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 8ca06fee-cfa3-11e7-97f4-9d8903e843e3 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.ore.mailhop.org (Halon) with ESMTPSA id 8ca06fee-cfa3-11e7-97f4-9d8903e843e3; Wed, 22 Nov 2017 16:38:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vAMGc8Xd000886; Wed, 22 Nov 2017 09:38:08 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1511368688.46031.1.camel@freebsd.org> Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts From: Ian Lepore To: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 22 Nov 2017 09:38:08 -0700 In-Reply-To: <201711221527.vAMFRlTc041361@repo.freebsd.org> References: <201711221527.vAMFRlTc041361@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 16:38:15 -0000 On Wed, 2017-11-22 at 15:27 +0000, Emmanuel Vadot wrote: > Author: manu > Date: Wed Nov 22 15:27:47 2017 > New Revision: 326095 > URL: https://svnweb.freebsd.org/changeset/base/326095 > > Log: >   bsdinstall: Add ntpdate option >    >   When you install a computer for the first time, the date in the CMOS sometimes >   not accurate and you need to ntpdate as ntpd will fail a the time difference >   is too big. >   Add an option in bsdinstall to enable ntpdate that will do that for us. >    >   Reviewed by: allanjude >   Differential Revision: https://reviews.freebsd.org/D13149 > > Modified: >   head/usr.sbin/bsdinstall/scripts/services > > Modified: head/usr.sbin/bsdinstall/scripts/services > ============================================================================== > --- head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:18:11 2017 (r326094) > +++ head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:27:47 2017 (r326095) > @@ -46,6 +46,8 @@ DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ >   local_unbound "Local caching validating resolver" ${local_unbound:-off} \ >   sshd "Secure shell daemon" ${sshd_enable:-off} \ >   moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ > + ntpdate "Synchronize system and network time at bootime" \ > + ${ntpdate_enable:-off} \ >   ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ >   powerd "Adjust CPU frequency dynamically if supported" \ >   ${powerd_enable:-off} \ > The right way to enable a time-step at boot is to set the rc conf variable ntpd_sync_on_start to YES.  ntpdate has been deprecated for *years*. -- Ian From owner-svn-src-head@freebsd.org Wed Nov 22 16:39:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6510DEFA84; Wed, 22 Nov 2017 16:39:25 +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 6FFDD80A19; Wed, 22 Nov 2017 16:39:25 +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 vAMGdO17070414; Wed, 22 Nov 2017 16:39:24 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMGdOrq070413; Wed, 22 Nov 2017 16:39:24 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201711221639.vAMGdOrq070413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 22 Nov 2017 16:39:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326097 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 326097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 16:39:25 -0000 Author: alc Date: Wed Nov 22 16:39:24 2017 New Revision: 326097 URL: https://svnweb.freebsd.org/changeset/base/326097 Log: When vm_map_find(find_space = VMFS_OPTIMAL_SPACE) fails to find space, a second scan of the address space with find_space = VMFS_ANY_SPACE is performed. Previously, vm_map_find() released and reacquired the map lock between the first and second scans. However, there is no compelling reason to do so. This revision modifies vm_map_find() to retain the map lock. Reviewed by: jhb, kib, markj MFC after: 1 week X-Differential Revision: https://reviews.freebsd.org/D13155 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Nov 22 15:54:52 2017 (r326096) +++ head/sys/vm/vm_map.c Wed Nov 22 16:39:24 2017 (r326097) @@ -1513,18 +1513,18 @@ vm_map_find(vm_map_t map, vm_object_t object, vm_ooffs } else alignment = 0; initial_addr = *addr; + vm_map_lock(map); again: start = initial_addr; - vm_map_lock(map); do { if (find_space != VMFS_NO_SPACE) { if (vm_map_findspace(map, start, length, addr) || (max_addr != 0 && *addr + length > max_addr)) { - vm_map_unlock(map); if (find_space == VMFS_OPTIMAL_SPACE) { find_space = VMFS_ANY_SPACE; goto again; } + vm_map_unlock(map); return (KERN_NO_SPACE); } switch (find_space) { From owner-svn-src-head@freebsd.org Wed Nov 22 16:45: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 1C614DEFC9E; Wed, 22 Nov 2017 16:45: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 DDC8080F46; Wed, 22 Nov 2017 16:45: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 vAMGjSYe074613; Wed, 22 Nov 2017 16:45:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMGjSPW074612; Wed, 22 Nov 2017 16:45:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711221645.vAMGjSPW074612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 22 Nov 2017 16:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326098 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 326098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 16:45:29 -0000 Author: kib Date: Wed Nov 22 16:45:27 2017 New Revision: 326098 URL: https://svnweb.freebsd.org/changeset/base/326098 Log: Return different error code for the guard page layout violation. On KERN_NO_SPACE error, as it is returned now, vm_map_find() continues the loop searching for the suitable range for the requested mapping with specific alignment. Since the vm_map_findspace() succesfully finds the same place, the loop never ends. The errors returned from vm_map_stack() completely repeat the behavior of vm_map_insert() now, as suggested by Alan. Reported by: Arto Pekkanen PR: 223732 Reviewed by: alc, markj Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D13186 Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Nov 22 16:39:24 2017 (r326097) +++ head/sys/vm/vm_map.c Wed Nov 22 16:45:27 2017 (r326098) @@ -3612,12 +3612,13 @@ vm_map_stack_locked(vm_map_t map, vm_offset_t addrbos, KASSERT(orient != (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP), ("bi-dir stack")); - sgp = (vm_size_t)stack_guard_page * PAGE_SIZE; if (addrbos < vm_map_min(map) || - addrbos > vm_map_max(map) || - addrbos + max_ssize < addrbos || - sgp >= max_ssize) - return (KERN_NO_SPACE); + addrbos + max_ssize > vm_map_max(map) || + addrbos + max_ssize <= addrbos) + return (KERN_INVALID_ADDRESS); + sgp = (vm_size_t)stack_guard_page * PAGE_SIZE; + if (sgp >= max_ssize) + return (KERN_INVALID_ARGUMENT); init_ssize = growsize; if (max_ssize < init_ssize + sgp) From owner-svn-src-head@freebsd.org Wed Nov 22 17:24: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 1E254DF08CB; Wed, 22 Nov 2017 17:24:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id B5D2A2639; Wed, 22 Nov 2017 17:24:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 6D8DAD4E12D; Thu, 23 Nov 2017 04:24:14 +1100 (AEDT) Date: Thu, 23 Nov 2017 04:24:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat In-Reply-To: <20171122103917.GS2272@kib.kiev.ua> Message-ID: <20171123021646.M1933@besplex.bde.org> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> <20171122103917.GS2272@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=kcmJ2rNy8ptLwktde7kA:9 a=QHhIYrB9zNK-slCL:21 a=tSUsDk6LL9iiXYT8:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 17:24:24 -0000 On Wed, 22 Nov 2017, Konstantin Belousov wrote: > On Wed, Nov 22, 2017 at 08:59:21AM +1100, Bruce Evans wrote: >> On Tue, 21 Nov 2017, Konstantin Belousov wrote: >> >>> Log: >>> systat: use and correctly display 64bit counters. >> ... >> Using unsigned types gives sign extension bugs as usual. In old versions >> ... >>> @@ -491,15 +495,15 @@ showkre(void) >>> putfloat(100.0 * s.v_kmem_map_size / kmem_size, >>> STATROW + 1, STATCOL + 22, 2, 0, 1); >>> >>> - putint(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); >>> - putint(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); >>> - putint(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); >>> - putint(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); >>> - putint(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); >>> - putint(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); >>> - putint(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); >>> - putint(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); >>> - putint(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); >>> + putuint64(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); >>> + putuint64(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); >>> + putuint64(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); >>> + putuint64(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); >>> + putuint64(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); >>> + putuint64(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); >>> + putuint64(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); >>> + putuint64(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); >>> + putuint64(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); >> >> I see that a very recent expansion from int32_t to uint64_t didn't work >> here. > Can you explain, please ? Just that systat -v didn't automatically benefit from the expansion (since it is not very well written, with hard-coded types. Hard-coded ints were at least simple. Now it has lots of hard-coded uint64_t's, partly to work around dehumanize_number() being broken as designed (this function doesn't support numbers, but only supports uint64_t. It would be a bit much for it to support surreal numbers, but it doesn't even support signed integers)). I checked all programs in /usr/src that use t_avm (t_vm is too hard to grep for). (There aren't many. Statistics utilities in ports probably have more variations and more bugs altogether.) None automatically benefited from the change, and all still have sign type errors: - systat/vmstat.c as above - vmstat/vmstat.c: This is much uglier, since it has flags to control the dehumanized printing and uses libxo so it us ugly even without all the lexical style bugs added with libxo. vmstat does most things worse: - with hflag (this gives the dehumanized printing), it tries to print memory sizes in bytes. Even humans would have problems reading the large decimal numbers resulting from sizes in bytes, but limited field widths usually result in dehumanization to K or M (rarely G or T). systat -v tries to print sizes in K (without the usually-redundant K suffix) more consistently, but this has problems when the values in K don't fit: vmstat does one thing better: if the size is too large to express in K, say just 4M, then vmstat will print 4M starting with the size in bytes, but vmstat starts with the size in K (4096) and will now print this as 4K, while the old version printed it as 4k. 4K of a size in K is almost as confusing as 4k of a size in K. This is one of the few places where the expansion worked automatically, because prthuman() already uses uint64_t (misspelled u_int64_t). The casts of sum.v_page_size to u_int64_t is now redundant as well as misspelled. It was needed even with int32_t fields because of the bad units -- 2G in bytes is quite small. This casts also gave sign extension/overflow. Now it has no effect. Such casts are safer, but uint64_t hard-coded in so many places the code might as well be simplified by hard-coding here too. - the !hflag case is broken by blind expansion to use more 4 more columns than are available even when all the fields fit (large numbers mess this up more). Also, the headers are broken with or without hflag (the first header line no longer lines up with the second header line. - without hflag, the code is similar to systat, but much more broken. It has the same fairly hard to reach overflows in pgtokb(). Now it has undefined behaviour in all cases in xo_emit(), since the arg type changed to uint64_t but the format is still %7d. Previously this only had undefined behaviour in overflowing cases (t_avm was int32_t, but v_page_size is u_int, so pgtokb() had type u_int; in overflow cases its value exceeds INT_MAX so the behaviour is undefined even though the overflow didn't give undefined behaviour. xo_emit() is not declared as __printflike(), so the undefined behaviour cannot be detected by the compiler. In systat, these bugs were reduced by forcing pgtokb() back to int by passing them to putnum(). The behaviour was implementation-defined (truncate). release/picobsd/tinyware/vm/vm.c: This is a tiny program, though not so tiny with 64-bit integers. It does a small part of what vmstat does, and has the same undefined behaviour from using %7d format to print pgtok() which now has type uint64_t. Since it doesn't have libxo, printf format checking might detect the error. But the Makefile doesn't set WARNS. sysctl/sysctl.c: sysctl(8) has bogus support for prettyprinting struct vmtotal (sysctl shouldn't have any prettyprinting, especially not for structs that have specialized programs to print them and much more). This uses intmax_t for all calculations and printing except for the int16_t fields, so it automatically benefited from the expansion. However since it uses a correct type (signed, and not restricted to 64 bits), it now has minor type errors -- it dowcasts the uint64_t to intmax_t wheen the latter is 64 bits. Its Makefile uses a fairly high WARNS, so if its type errors were fatal then printf format checking would have detected them (but not non-fatal errors involving downcasting). I still haven't checked if the old ABI still works. The compatibilty code looks OK. >>> putint(total.t_rq - 1, PROCSROW + 2, PROCSCOL, 3); >>> putint(total.t_pw, PROCSROW + 2, PROCSCOL + 4, 3); >>> putint(total.t_dw, PROCSROW + 2, PROCSCOL + 8, 3); >> >> This has larger sign extension bugs than before. All the fields here are >> still int16_t. putint() still takes int args, and so the int16_t's int >> converted to int. The used to be printed as int, but now they are converted >> to uint64_t. They shouldn't be negative, but if they are then the were printed >> as negative. Now the conversion to uint64_t has sign-extension bugs/overflows >> for negative values. Negative values still be printed as negative via further >> overflows, but if the values are passed to dehumanize_number(), they are >> printed as enormous unsigned values. > I do not see a point in expanding the process counters to uint16_t. I > might do it if somebody has a realistic load with 30K processes in a > system. Using unsigned types should be a last resort to get 1 more bit, but since space is not a problem (but the ABI is), if 32K is not enough for someone then they should be 32-bits signed not 16 bits unsigned. > Having 100K threads created simultaneously is quite affordable, so the > change could be useful one day. Another change of the ABI is not so good. > ... >>> @@ -518,13 +522,13 @@ showkre(void) >>> PUTRATE(v_pdwakeups, VMSTATROW + 9, VMSTATCOL, 8); >>> PUTRATE(v_pdpages, VMSTATROW + 10, VMSTATCOL, 8); >>> PUTRATE(v_intrans, VMSTATROW + 11, VMSTATCOL, 8); >>> - putint(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); >>> - putint(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); >>> - putint(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); >>> - putint(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); >>> - putint(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); >>> + putuint64(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); >>> + putuint64(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); >>> + putuint64(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); >>> + putuint64(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); >>> + putuint64(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); >> >> This is bogus. The fields still have type u_int. pgtokb() expands by a >> factor of 4 or 8, and putuint64() can handle the expansion, but pgtokb() >> still overflows before the value can be passed. > These fields come from different structure (vmtotal vs. vmmeter), and > surprisingly vmmeter is not part of the ABI. Expanding the type of > v_free_count is easy. Having the changes in vmstat for vmmeter fields > done together with vmtotal expansion is reasonable. We targeted all > memory reporting. BTW, I once thought that the VM_METER sysctl should actually return all vmmeter statistics (at actually returns only struct vmtotal and the API was unimproved by renaming it to VM_TOTAL). But then the ABI would have been harder to change. Portable code for the about should use intmax_t (or better double). > ... >>> if (LINES - 1 > VMSTATROW + 17) >>> - putint(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); >>> + putuint64(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); >> >> s.bufspace has the bogus type long, so in 32-bit systems overflow occurs >> with only 2T of bufspace, and on 64-bit systems the expansion can overflow >> even uint64_t, but the world doesn't have that much memory (2T * 2**32). > So practically overflow cannot occur. I do not quite see the point of the > comment. There is a silly mixture of types that gives more overflow cases to avoid. This long is basically intmax_t written before intmax_t existed. Both long and intmax_t automatically expand with the register size. Except, ABI problems inhibit expanding either. > ... >>> + snr = snprintf(b, sizeof(b), "%*jd", w, (uintmax_t)n); >> >> The signed format no longer matches the unsigned arg. It still gives the >> early warning hack via overflow earlier in most cases. The behaviour here >> is undefined iff (uintmax_t)n exceeds INTMAX_MAX. > Thanks, see the patch at the end. Too short to fix all that I want :-). Bruce From owner-svn-src-head@freebsd.org Wed Nov 22 17:45: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 4C411DF1116; Wed, 22 Nov 2017 17:45:01 +0000 (UTC) (envelope-from gibbs@scsiguy.com) Received: from aslan.scsiguy.com (www.scsiguy.com [70.89.174.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D27835B6; Wed, 22 Nov 2017 17:45:00 +0000 (UTC) (envelope-from gibbs@scsiguy.com) Received: from greggminer-mba.dhcp.thefacebook.com ([199.201.64.2]) (authenticated bits=0) by aslan.scsiguy.com (8.15.2/8.15.2) with ESMTPSA id vAMHin3h079638 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 22 Nov 2017 10:44:51 -0700 (MST) (envelope-from gibbs@scsiguy.com) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r326036 - head/sys/cam/scsi From: "Justin T. Gibbs" In-Reply-To: Date: Wed, 22 Nov 2017 10:44:44 -0700 Cc: Ronald Klop , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , "Justin T. Gibbs" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201711202227.vAKMRYvW001932@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 17:45:01 -0000 I'm sure it was to improve the performance of some SSD we were testing = at Spectra. -- Justin > On Nov 22, 2017, at 9:16 AM, Alan Somers wrote: >=20 > I believe the original motivation was to reduce FLUSH CACHE EXT > activity with some old SSDs that handled that command very slowly. > gibbs might know more. >=20 > On Tue, Nov 21, 2017 at 1:14 PM, Ronald Klop = wrote: >> Out of curiosity, What is the use case which this improves? Does = happen in >> daily usage or mostly in testing? >>=20 >> Regards, >> Ronald. >>=20 >>=20 >>=20 >> On Mon, 20 Nov 2017 23:27:34 +0100, Alan Somers = wrote: >>=20 >>> Author: asomers >>> Date: Mon Nov 20 22:27:33 2017 >>> New Revision: 326036 >>> URL: https://svnweb.freebsd.org/changeset/base/326036 >>>=20 >>> Log: >>> da(4): Short-circuit unnecessary BIO_FLUSH commands >>> sys/cam/scsi/scsi_da.c >>> Complete BIO_FLUSH commands immediately if the da(4) device = hasn't >>> been written to since the last flush. If we haven't written = to the >>> device, there is no reason to send a flush. >>> Submitted by: gibbs >>> Reviewed by: imp >>> MFC after: 3 weeks >>> Sponsored by: Spectra Logic Corp >>> Differential Revision: https://reviews.freebsd.org/D13106 >>>=20 >>> Modified: >>> head/sys/cam/scsi/scsi_da.c >>>=20 >>> Modified: head/sys/cam/scsi/scsi_da.c >>>=20 >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/cam/scsi/scsi_da.c Mon Nov 20 22:18:24 2017 = (r326035) >>> +++ head/sys/cam/scsi/scsi_da.c Mon Nov 20 22:27:33 2017 = (r326036) >>> @@ -3038,6 +3038,18 @@ more: >>> } >>> case BIO_FLUSH: >>> /* >>> + * If we don't support sync cache, or the = disk >>> + * isn't dirty, FLUSH is a no-op. Use the >>> + * allocated * CCB for the next bio if one = is >>> + * available. >>> + */ >>> + if ((softc->quirks & DA_Q_NO_SYNC_CACHE) !=3D = 0 || >>> + (softc->flags & DA_FLAG_DIRTY) =3D=3D 0) = { >>> + biodone(bp); >>> + goto skipstate; >>> + } >>> + >>> + /* >>> * BIO_FLUSH doesn't currently communicate >>> * range data, so we synchronize the cache >>> * over the whole disk. We also force >>> @@ -3052,6 +3064,15 @@ more: >>> /*lb_count*/0, >>> SSD_FULL_SIZE, >>> = da_default_timeout*1000); >>> + /* >>> + * Clear the dirty flag before sending the >>> command. >>> + * Either this sync cache will be = successful, or >>> it >>> + * will fail after a retry. If it fails, it = is >>> + * unlikely to be successful if retried = later, so >>> + * we'll save ourselves time by just marking = the >>> + * device clean. >>> + */ >>> + softc->flags &=3D ~DA_FLAG_DIRTY; >>> break; >>> case BIO_ZONE: { >>> int error, queue_ccb; >>> _______________________________________________ >>> svn-src-all@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/svn-src-all >>> To unsubscribe, send any mail to = "svn-src-all-unsubscribe@freebsd.org" >=20 From owner-svn-src-head@freebsd.org Wed Nov 22 18:06: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 A9C0FDF161A; Wed, 22 Nov 2017 18:06:42 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73B6D3FBD; Wed, 22 Nov 2017 18:06:42 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMI6fYv008378; Wed, 22 Nov 2017 18:06:41 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMI6fCx008377; Wed, 22 Nov 2017 18:06:41 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201711221806.vAMI6fCx008377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Wed, 22 Nov 2017 18:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326099 - head/usr.bin/iscsictl X-SVN-Group: head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: head/usr.bin/iscsictl X-SVN-Commit-Revision: 326099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 18:06:42 -0000 Author: zeising (doc,ports committer) Date: Wed Nov 22 18:06:41 2017 New Revision: 326099 URL: https://svnweb.freebsd.org/changeset/base/326099 Log: Fix language in a bunch of error messages. Reviewed by: emaste Approved by: emaste MFC after: 1 month Differential Revision: D13193 Modified: head/usr.bin/iscsictl/iscsictl.c Modified: head/usr.bin/iscsictl/iscsictl.c ============================================================================== --- head/usr.bin/iscsictl/iscsictl.c Wed Nov 22 16:45:27 2017 (r326098) +++ head/usr.bin/iscsictl/iscsictl.c Wed Nov 22 18:06:41 2017 (r326099) @@ -813,41 +813,41 @@ main(int argc, char **argv) if (Aflag != 0) { if (aflag != 0) { if (enable != ENABLE_UNSPECIFIED) - xo_errx(1, "-a and -e and mutually exclusive"); + xo_errx(1, "-a and -e are mutually exclusive"); if (portal != NULL) - xo_errx(1, "-a and -p and mutually exclusive"); + xo_errx(1, "-a and -p are mutually exclusive"); if (target != NULL) - xo_errx(1, "-a and -t and mutually exclusive"); + xo_errx(1, "-a and -t are mutually exclusive"); if (user != NULL) - xo_errx(1, "-a and -u and mutually exclusive"); + xo_errx(1, "-a and -u are mutually exclusive"); if (secret != NULL) - xo_errx(1, "-a and -s and mutually exclusive"); + xo_errx(1, "-a and -s are mutually exclusive"); if (nickname != NULL) - xo_errx(1, "-a and -n and mutually exclusive"); + xo_errx(1, "-a and -n are mutually exclusive"); if (discovery_host != NULL) - xo_errx(1, "-a and -d and mutually exclusive"); + xo_errx(1, "-a and -d are mutually exclusive"); if (rflag != 0) - xo_errx(1, "-a and -r and mutually exclusive"); + xo_errx(1, "-a and -r are mutually exclusive"); } else if (nickname != NULL) { if (enable != ENABLE_UNSPECIFIED) - xo_errx(1, "-n and -e and mutually exclusive"); + xo_errx(1, "-n and -e are mutually exclusive"); if (portal != NULL) - xo_errx(1, "-n and -p and mutually exclusive"); + xo_errx(1, "-n and -p are mutually exclusive"); if (target != NULL) - xo_errx(1, "-n and -t and mutually exclusive"); + xo_errx(1, "-n and -t are mutually exclusive"); if (user != NULL) - xo_errx(1, "-n and -u and mutually exclusive"); + xo_errx(1, "-n and -u are mutually exclusive"); if (secret != NULL) - xo_errx(1, "-n and -s and mutually exclusive"); + xo_errx(1, "-n and -s are mutually exclusive"); if (discovery_host != NULL) - xo_errx(1, "-n and -d and mutually exclusive"); + xo_errx(1, "-n and -d are mutually exclusive"); if (rflag != 0) - xo_errx(1, "-n and -r and mutually exclusive"); + xo_errx(1, "-n and -r are mutually exclusive"); } else if (discovery_host != NULL) { if (portal != NULL) - xo_errx(1, "-d and -p and mutually exclusive"); + xo_errx(1, "-d and -p are mutually exclusive"); if (target != NULL) - xo_errx(1, "-d and -t and mutually exclusive"); + xo_errx(1, "-d and -t are mutually exclusive"); } else { if (target == NULL && portal == NULL) xo_errx(1, "must specify -a, -n or -t/-p"); @@ -874,15 +874,15 @@ main(int argc, char **argv) if (nickname != NULL) { if (enable != ENABLE_UNSPECIFIED) - xo_errx(1, "-n and -e and mutually exclusive"); + xo_errx(1, "-n and -e are mutually exclusive"); if (portal != NULL) - xo_errx(1, "-n and -p and mutually exclusive"); + xo_errx(1, "-n and -p are mutually exclusive"); if (target != NULL) - xo_errx(1, "-n and -t and mutually exclusive"); + xo_errx(1, "-n and -t are mutually exclusive"); if (user != NULL) - xo_errx(1, "-n and -u and mutually exclusive"); + xo_errx(1, "-n and -u are mutually exclusive"); if (secret != NULL) - xo_errx(1, "-n and -s and mutually exclusive"); + xo_errx(1, "-n and -s are mutually exclusive"); } if (aflag != 0) @@ -899,16 +899,16 @@ main(int argc, char **argv) } else if (Rflag != 0) { if (aflag != 0) { if (portal != NULL) - xo_errx(1, "-a and -p and mutually exclusive"); + xo_errx(1, "-a and -p are mutually exclusive"); if (target != NULL) - xo_errx(1, "-a and -t and mutually exclusive"); + xo_errx(1, "-a and -t are mutually exclusive"); if (nickname != NULL) - xo_errx(1, "-a and -n and mutually exclusive"); + xo_errx(1, "-a and -n are mutually exclusive"); } else if (nickname != NULL) { if (portal != NULL) - xo_errx(1, "-n and -p and mutually exclusive"); + xo_errx(1, "-n and -p are mutually exclusive"); if (target != NULL) - xo_errx(1, "-n and -t and mutually exclusive"); + xo_errx(1, "-n and -t are mutually exclusive"); } else if (target == NULL && portal == NULL) { xo_errx(1, "must specify either -a, -n, -t, or -p"); } From owner-svn-src-head@freebsd.org Wed Nov 22 19:28: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 8D630DF371D; Wed, 22 Nov 2017 19:28:14 +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 4DA836617E; Wed, 22 Nov 2017 19:28:13 +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 vAMJSCT1087647 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 22 Nov 2017 11:28:12 -0800 (PST) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id vAMJSCHM087646; Wed, 22 Nov 2017 11:28:12 -0800 (PST) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 22 Nov 2017 11:28:12 -0800 From: Gleb Smirnoff To: =?utf-8?Q?Micha=C5=82?= Krawczyk Cc: Marcin Wojtas , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r325239 - head/sys/dev/ena Message-ID: <20171122192812.GI1063@FreeBSD.org> References: <201710311631.v9VGVNOs058255@repo.freebsd.org> <20171122000816.GH1063@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Nov 2017 19:28:14 -0000 MichaÅ‚, thanks for explanation. Looks like in this case software counters are indeed superior to hardware ones. On Wed, Nov 22, 2017 at 05:19:54PM +0100, MichaÅ‚ Krawczyk wrote: M> Hi Gleb, M> We are counting the statistics in the software because of the alignment M> with the newest ena-com API (HAL) which is delivered to us from NIC's M> vendor. M> M> Regarding fetching them periodically - there are 2 issues with that. First M> of all, there may be problem with the counter overflow. Secondly, reading M> statistics on demand requires sending admin message to the NIC and then the M> cv_timedwait function is called to wait for the response. However there are M> a lot of witness warnings when the cv_timedwait is called from the M> if_get_counter() context, because of the non sleepable lock which is hold M> there (I don't remember exactly which lock was causing this issue). M> M> Best regards, M> Michal M> M> 2017-11-22 1:08 GMT+01:00 Gleb Smirnoff : M> M> > Hi Martin and Michal, M> > M> > On Tue, Oct 31, 2017 at 04:31:23PM +0000, Marcin Wojtas wrote: M> > M> Author: mw M> > M> Date: Tue Oct 31 16:31:23 2017 M> > M> New Revision: 325239 M> > M> URL: https://svnweb.freebsd.org/changeset/base/325239 M> > M> M> > M> Log: M> > M> Rework counting of hardware statistics in ENA driver M> > M> M> > M> Do not read all statistics from the device, instead count them in the M> > M> driver except from RX drops - they are received directly from the NIC M> > M> in the AENQ descriptor. M> > M> M> > M> Submitted by: Michal Krawczyk M> > M> Reviewed by: imp M> > M> Obtained from: Semihalf M> > M> Sponsored by: Amazon.com, Inc. M> > M> Differential Revision: https://reviews.freebsd.org/D12852 M> > M> > Is it possible not to count them in software, as well as not fetch M> > them from hardware periodically, but instead just fetch them on M> > demand, when either if_get_counter() or a sysctl is called? M> > M> > That would be more efficient. M> > M> > -- M> > Gleb Smirnoff M> > -- Gleb Smirnoff From owner-svn-src-head@freebsd.org Wed Nov 22 19:57: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 72682DF409B; Wed, 22 Nov 2017 19:57:35 +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 4D1A867252; Wed, 22 Nov 2017 19:57:35 +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 vAMJvYjU061166; Wed, 22 Nov 2017 19:57:34 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMJvYOb061165; Wed, 22 Nov 2017 19:57:34 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711221957.vAMJvYOb061165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 22 Nov 2017 19:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326100 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 326100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 19:57:35 -0000 Author: asomers Date: Wed Nov 22 19:57:34 2017 New Revision: 326100 URL: https://svnweb.freebsd.org/changeset/base/326100 Log: Always null-terminate CAM periph_name and dev_name Reported by: Coverity CID: 1010039, 1010040, 1010041, 1010043 Reviewed by: ken, imp MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13194 Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Nov 22 18:06:41 2017 (r326099) +++ head/sys/cam/cam_xpt.c Wed Nov 22 19:57:34 2017 (r326100) @@ -686,8 +686,9 @@ xptdoioctl(struct cdev *dev, u_long cmd, caddr_t addr, /* * Fill in the getdevlist fields. */ - strcpy(ccb->cgdl.periph_name, - periph->periph_name); + strlcpy(ccb->cgdl.periph_name, + periph->periph_name, + sizeof(ccb->cgdl.periph_name)); ccb->cgdl.unit_number = periph->unit_number; if (SLIST_NEXT(periph, periph_links)) @@ -1756,8 +1757,9 @@ xptedtbusfunc(struct cam_eb *bus, void *arg) cdm->matches[j].result.bus_result.bus_id = bus->sim->bus_id; cdm->matches[j].result.bus_result.unit_number = bus->sim->unit_number; - strncpy(cdm->matches[j].result.bus_result.dev_name, - bus->sim->sim_name, DEV_IDLEN); + strlcpy(cdm->matches[j].result.bus_result.dev_name, + bus->sim->sim_name, + sizeof(cdm->matches[j].result.bus_result.dev_name)); } /* @@ -1976,6 +1978,7 @@ xptedtperiphfunc(struct cam_periph *periph, void *arg) */ if (retval & DM_RET_COPY) { int spaceleft, j; + size_t l; spaceleft = cdm->match_buf_len - (cdm->num_matches * sizeof(struct dev_match_result)); @@ -2019,8 +2022,9 @@ xptedtperiphfunc(struct cam_periph *periph, void *arg) periph->path->device->lun_id; cdm->matches[j].result.periph_result.unit_number = periph->unit_number; - strncpy(cdm->matches[j].result.periph_result.periph_name, - periph->periph_name, DEV_IDLEN); + l = sizeof(cdm->matches[j].result.periph_result.periph_name); + strlcpy(cdm->matches[j].result.periph_result.periph_name, + periph->periph_name, l); } return(1); @@ -2115,6 +2119,7 @@ xptplistperiphfunc(struct cam_periph *periph, void *ar */ if (retval & DM_RET_COPY) { int spaceleft, j; + size_t l; spaceleft = cdm->match_buf_len - (cdm->num_matches * sizeof(struct dev_match_result)); @@ -2191,8 +2196,9 @@ xptplistperiphfunc(struct cam_periph *periph, void *ar cdm->matches[j].result.periph_result.unit_number = periph->unit_number; - strncpy(cdm->matches[j].result.periph_result.periph_name, - periph->periph_name, DEV_IDLEN); + l = sizeof(cdm->matches[j].result.periph_result.periph_name); + strlcpy(cdm->matches[j].result.periph_result.periph_name, + periph->periph_name, l); } return(1); @@ -2905,9 +2911,9 @@ call_sim: (nperiph != NULL) && (i <= cgdl->index); nperiph = SLIST_NEXT(nperiph, periph_links), i++) { if (i == cgdl->index) { - strncpy(cgdl->periph_name, + strlcpy(cgdl->periph_name, nperiph->periph_name, - DEV_IDLEN); + sizeof(cgdl->periph_name)); cgdl->unit_number = nperiph->unit_number; found = 1; } From owner-svn-src-head@freebsd.org Wed Nov 22 19:58: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 789B2DF4160; Wed, 22 Nov 2017 19:58:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4585B6743D; Wed, 22 Nov 2017 19:58:30 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMJwT8V061364; Wed, 22 Nov 2017 19:58:29 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMJwTMA061363; Wed, 22 Nov 2017 19:58:29 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201711221958.vAMJwTMA061363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 22 Nov 2017 19:58:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326101 - head/lib/libcam/tests X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/lib/libcam/tests X-SVN-Commit-Revision: 326101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 19:58:30 -0000 Author: asomers Date: Wed Nov 22 19:58:29 2017 New Revision: 326101 URL: https://svnweb.freebsd.org/changeset/base/326101 Log: Add a test case for cam_get_device with sa(4) devices sa(4) has some unique behavior that is special-cased in cam_get_device. The existing tests don't provide coverage for this special case. Reviewed by: ken MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D13185 Modified: head/lib/libcam/tests/libcam_test.c Modified: head/lib/libcam/tests/libcam_test.c ============================================================================== --- head/lib/libcam/tests/libcam_test.c Wed Nov 22 19:57:34 2017 (r326100) +++ head/lib/libcam/tests/libcam_test.c Wed Nov 22 19:58:29 2017 (r326101) @@ -129,6 +129,33 @@ ATF_TC_BODY(cam_get_device_positive_test, tc) ATF_REQUIRE(parsed_unit == expected_unit); } +/* + * sa(4) uniquely creates nsa and esa device nodes for non-rewind operations + * and eject-on-close operations. cam_get_device must special case these nodes + * to always return the base device. + */ +ATF_TC_WITHOUT_HEAD(cam_get_device_sa_test); +ATF_TC_BODY(cam_get_device_sa_test, tc) +{ + char parsed_dev_name[DEV_IDLEN + 1]; + int parsed_unit; + + ATF_REQUIRE_MSG(cam_get_device("nsa99", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, "sa"); + ATF_REQUIRE(parsed_unit == 99); + + strcpy(parsed_dev_name, ""); + parsed_unit = -1; + + ATF_REQUIRE_MSG(cam_get_device("esa99", parsed_dev_name, + nitems(parsed_dev_name), &parsed_unit) == 0, + "cam_get_device failed"); + ATF_REQUIRE_STREQ(parsed_dev_name, "sa"); + ATF_REQUIRE(parsed_unit == 99); +} + ATF_TC(cam_open_device_negative_test_O_RDONLY); ATF_TC_HEAD(cam_open_device_negative_test_O_RDONLY, tc) { @@ -282,6 +309,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, cam_get_device_negative_test_nul_path); ATF_TP_ADD_TC(tp, cam_get_device_negative_test_root); ATF_TP_ADD_TC(tp, cam_get_device_positive_test); + ATF_TP_ADD_TC(tp, cam_get_device_sa_test); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_O_RDONLY); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_nonexistent); ATF_TP_ADD_TC(tp, cam_open_device_negative_test_unprivileged); From owner-svn-src-head@freebsd.org Wed Nov 22 20:27: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 1810BDF4BAF; Wed, 22 Nov 2017 20:27:48 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF02A686A6; Wed, 22 Nov 2017 20:27:47 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMKRk8o077845; Wed, 22 Nov 2017 20:27:46 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMKRkTc077837; Wed, 22 Nov 2017 20:27:46 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201711222027.vAMKRkTc077837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 22 Nov 2017 20:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326102 - in head/sys: conf dev/bhnd dev/bhnd/bcma dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/cores/chipc/pwrctl dev/bhnd/cores/pmu dev/bhnd/siba mips/broadcom modules/bhnd modules/bh... X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys: conf dev/bhnd dev/bhnd/bcma dev/bhnd/bhndb dev/bhnd/cores/chipc dev/bhnd/cores/chipc/pwrctl dev/bhnd/cores/pmu dev/bhnd/siba mips/broadcom modules/bhnd modules/bhnd/bhndb modules/bhnd/bhn... X-SVN-Commit-Revision: 326102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 20:27:48 -0000 Author: landonf Date: Wed Nov 22 20:27:46 2017 New Revision: 326102 URL: https://svnweb.freebsd.org/changeset/base/326102 Log: bhnd(4): extend the PMU APIs to support bwn(4) The bwn(4) driver requires a number of extensions to the bhnd(4) PMU interface to support external configuration of PLLs, LDOs, and other parameters that require chipset or PHY-specific workarounds. These changes add support for: - Writing raw voltage register values to PHY-specific LDO regulator registers (required by LP-PHY). - Enabling/disabling PHY-specific LDOs (required by LP-PHY) - Writing to arbitrary PMU chipctrl registers (required for common PHY PLL reset support). - Requesting chipset/PLL-specific spurious signal avoidance modes. - Querying clock frequency and latency. Additionally, rather than updating legacy PWRCTL support to conform to the new PMU interface: - PWRCTL API is now provided by a bhnd_pwrctl_if.m interface. - Since PWRCTL is only found in older SSB-based chipsets, translation from bhnd(4) bus APIs to corresponding PWRCTL operations is now handled entirely within the siba(4) driver. - The PWRCTL-specific host bridge clock gating APIs in bhnd_bus_if.m have been lifted out into a standalone bhnd_pwrctl_hostb_if.m interface. Approved by: adrian (mentor, implicit) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12664 Added: head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.h (contents, props changed) head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_hostb_if.m (contents, props changed) head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_if.m (contents, props changed) head/sys/dev/bhnd/cores/pmu/bhnd_pmu_types.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bcma/bcmavar.h head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_private.h head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhnd_types.h head/sys/dev/bhnd/bhndb/bhnd_bhndb.c head/sys/dev/bhnd/bhndb/bhndb_pci.c head/sys/dev/bhnd/bhndreg.h head/sys/dev/bhnd/bhndvar.h head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_private.h head/sys/dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c head/sys/dev/bhnd/cores/pmu/bhnd_pmu.c head/sys/dev/bhnd/cores/pmu/bhnd_pmu.h head/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c head/sys/dev/bhnd/cores/pmu/bhnd_pmu_if.m head/sys/dev/bhnd/cores/pmu/bhnd_pmu_private.h head/sys/dev/bhnd/cores/pmu/bhnd_pmu_subr.c head/sys/dev/bhnd/cores/pmu/bhnd_pmureg.h head/sys/dev/bhnd/cores/pmu/bhnd_pmuvar.h head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_bhndb.c head/sys/dev/bhnd/siba/siba_subr.c head/sys/dev/bhnd/siba/sibavar.h head/sys/mips/broadcom/siba_nexus.c head/sys/modules/bhnd/Makefile head/sys/modules/bhnd/bhndb/Makefile head/sys/modules/bhnd/bhndb_pci/Makefile head/sys/modules/bhnd/siba/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Nov 22 19:58:29 2017 (r326101) +++ head/sys/conf/files Wed Nov 22 20:27:46 2017 (r326102) @@ -1250,6 +1250,8 @@ dev/bhnd/cores/chipc/chipc_slicer.c optional bhnd cfi dev/bhnd/cores/chipc/chipc_spi.c optional bhnd spibus dev/bhnd/cores/chipc/chipc_subr.c optional bhnd dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl.c optional bhnd +dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_if.m optional bhnd +dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_hostb_if.m optional bhnd dev/bhnd/cores/chipc/pwrctl/bhnd_pwrctl_subr.c optional bhnd dev/bhnd/cores/pci/bhnd_pci.c optional bhnd pci dev/bhnd/cores/pci/bhnd_pci_hostb.c optional bhndb bhnd pci Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Wed Nov 22 19:58:29 2017 (r326101) +++ head/sys/dev/bhnd/bcma/bcma.c Wed Nov 22 20:27:46 2017 (r326102) @@ -193,7 +193,7 @@ bcma_write_ivar(device_t dev, device_t child, int inde case BHND_IVAR_CORE_UNIT: return (EINVAL); case BHND_IVAR_PMU_INFO: - dinfo->pmu_info = (struct bhnd_core_pmu_info *) value; + dinfo->pmu_info = (void *)value; return (0); default: return (ENOENT); @@ -349,17 +349,15 @@ bcma_reset_hw(device_t dev, device_t child, uint16_t i static int bcma_suspend_hw(device_t dev, device_t child) { - struct bcma_devinfo *dinfo; - struct bhnd_core_pmu_info *pm; - struct bhnd_resource *r; - uint32_t rst; - int error; + struct bcma_devinfo *dinfo; + struct bhnd_resource *r; + uint32_t rst; + int error; if (device_get_parent(child) != dev) return (EINVAL); dinfo = device_get_ivars(child); - pm = dinfo->pmu_info; /* Can't suspend the core without access to the agent registers */ if ((r = dinfo->res_agent) == NULL) @@ -381,12 +379,6 @@ bcma_suspend_hw(device_t dev, device_t child) /* Clear core flags */ if ((error = bhnd_write_ioctl(child, 0x0, UINT16_MAX))) return (error); - - /* Inform PMU that all outstanding request state should be discarded */ - if (pm != NULL) { - if ((error = BHND_PMU_CORE_RELEASE(pm->pm_pmu, pm))) - return (error); - } return (0); } Modified: head/sys/dev/bhnd/bcma/bcmavar.h ============================================================================== --- head/sys/dev/bhnd/bcma/bcmavar.h Wed Nov 22 19:58:29 2017 (r326101) +++ head/sys/dev/bhnd/bcma/bcmavar.h Wed Nov 22 20:27:46 2017 (r326102) @@ -175,17 +175,17 @@ struct bcma_corecfg { * BCMA per-device info */ struct bcma_devinfo { - struct resource_list resources; /**< Slave port memory regions. */ - struct bcma_corecfg *corecfg; /**< IP core/block config */ + struct resource_list resources; /**< Slave port memory regions. */ + struct bcma_corecfg *corecfg; /**< IP core/block config */ - struct bhnd_resource *res_agent; /**< Agent (wrapper) resource, or NULL. Not - * all bcma(4) cores have or require an agent. */ - int rid_agent; /**< Agent resource ID, or -1 */ + struct bhnd_resource *res_agent; /**< Agent (wrapper) resource, or NULL. Not + * all bcma(4) cores have or require an agent. */ + int rid_agent; /**< Agent resource ID, or -1 */ - u_int num_intrs; /**< number of interrupt descriptors. */ - struct bcma_intr_list intrs; /**< interrupt descriptors */ + u_int num_intrs; /**< number of interrupt descriptors. */ + struct bcma_intr_list intrs; /**< interrupt descriptors */ - struct bhnd_core_pmu_info *pmu_info; /**< Bus-managed PMU state, or NULL */ + void *pmu_info; /**< Bus-managed PMU state, or NULL */ }; Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Wed Nov 22 19:58:29 2017 (r326101) +++ head/sys/dev/bhnd/bhnd.c Wed Nov 22 20:27:46 2017 (r326102) @@ -62,15 +62,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include -#include #include "bhnd_chipc_if.h" #include "bhnd_nvram_if.h" #include "bhnd.h" +#include "bhndreg.h" #include "bhndvar.h" #include "bhnd_private.h" @@ -363,24 +361,28 @@ int bhnd_generic_alloc_pmu(device_t dev, device_t child) { struct bhnd_softc *sc; - struct bhnd_resource *br; - struct bhnd_core_pmu_info *pm; + struct bhnd_resource *r; + struct bhnd_core_clkctl *clkctl; struct resource_list *rl; struct resource_list_entry *rle; device_t pmu_dev; bhnd_addr_t r_addr; bhnd_size_t r_size; bus_size_t pmu_regs; + u_int max_latency; int error; GIANT_REQUIRED; /* for newbus */ - + + if (device_get_parent(child) != dev) + return (EINVAL); + sc = device_get_softc(dev); - pm = bhnd_get_pmu_info(child); + clkctl = bhnd_get_pmu_info(child); pmu_regs = BHND_CLK_CTL_ST; /* already allocated? */ - if (pm != NULL) { + if (clkctl != NULL) { panic("duplicate PMU allocation for %s", device_get_nameunit(child)); } @@ -440,36 +442,38 @@ bhnd_generic_alloc_pmu(device_t dev, device_t child) else pmu_regs -= r_addr - rman_get_start(rle->res); - /* Retain PMU reference on behalf of our caller */ + /* Retain a PMU reference for the clkctl instance state */ pmu_dev = bhnd_retain_provider(child, BHND_SERVICE_PMU); if (pmu_dev == NULL) { - device_printf(sc->dev, - "pmu unavailable; cannot allocate request state\n"); + device_printf(sc->dev, "PMU not found\n"); return (ENXIO); } - /* Allocate and initialize PMU info */ - br = malloc(sizeof(struct bhnd_resource), M_BHND, M_NOWAIT); - if (br == NULL) { + /* Fetch the maximum transition latency from our PMU */ + max_latency = bhnd_pmu_get_max_transition_latency(pmu_dev); + + /* Allocate a new bhnd_resource wrapping the standard resource we + * fetched from the resource list; we'll free this in + * bhnd_generic_release_pmu() */ + r = malloc(sizeof(struct bhnd_resource), M_BHND, M_NOWAIT); + if (r == NULL) { bhnd_release_provider(child, pmu_dev, BHND_SERVICE_PMU); return (ENOMEM); } - br->res = rle->res; - br->direct = ((rman_get_flags(rle->res) & RF_ACTIVE) != 0); + r->res = rle->res; + r->direct = ((rman_get_flags(rle->res) & RF_ACTIVE) != 0); - pm = malloc(sizeof(*pm), M_BHND, M_NOWAIT); - if (pm == NULL) { + /* Allocate the clkctl instance */ + clkctl = bhnd_alloc_core_clkctl(child, pmu_dev, r, pmu_regs, + max_latency); + if (clkctl == NULL) { + free(r, M_BHND); bhnd_release_provider(child, pmu_dev, BHND_SERVICE_PMU); - free(br, M_BHND); return (ENOMEM); } - pm->pm_dev = child; - pm->pm_res = br; - pm->pm_regs = pmu_regs; - pm->pm_pmu = pmu_dev; - bhnd_set_pmu_info(child, pm); + bhnd_set_pmu_info(child, clkctl); return (0); } @@ -479,48 +483,148 @@ bhnd_generic_alloc_pmu(device_t dev, device_t child) int bhnd_generic_release_pmu(device_t dev, device_t child) { - struct bhnd_softc *sc; - struct bhnd_core_pmu_info *pm; - int error; + struct bhnd_softc *sc; + struct bhnd_core_clkctl *clkctl; + struct bhnd_resource *r; + device_t pmu_dev; GIANT_REQUIRED; /* for newbus */ sc = device_get_softc(dev); - /* dispatch release request */ - pm = bhnd_get_pmu_info(child); - if (pm == NULL) + if (device_get_parent(child) != dev) + return (EINVAL); + + clkctl = bhnd_get_pmu_info(child); + if (clkctl == NULL) panic("pmu over-release for %s", device_get_nameunit(child)); - if ((error = BHND_PMU_CORE_RELEASE(pm->pm_pmu, pm))) - return (error); + /* Clear all FORCE, AREQ, and ERSRC flags, unless we're already in + * RESET. Suspending a core clears clkctl automatically (and attempting + * to access the PMU registers in a suspended core will trigger a + * system livelock). */ + if (!bhnd_is_hw_suspended(clkctl->cc_dev)) { + BHND_CLKCTL_LOCK(clkctl); - /* free PMU info */ + /* Clear all FORCE, AREQ, and ERSRC flags */ + BHND_CLKCTL_SET_4(clkctl, 0x0, BHND_CCS_FORCE_MASK | + BHND_CCS_AREQ_MASK | BHND_CCS_ERSRC_REQ_MASK); + + BHND_CLKCTL_UNLOCK(clkctl); + } + + /* Clear child's PMU info reference */ bhnd_set_pmu_info(child, NULL); - bhnd_release_provider(pm->pm_dev, pm->pm_pmu, BHND_SERVICE_PMU); - free(pm->pm_res, M_BHND); - free(pm, M_BHND); + /* Before freeing the clkctl instance, save a pointer to resources we + * need to clean up manually */ + r = clkctl->cc_res; + pmu_dev = clkctl->cc_pmu_dev; + /* Free the clkctl instance */ + bhnd_free_core_clkctl(clkctl); + + /* Free the child's bhnd resource wrapper */ + free(r, M_BHND); + + /* Release the child's PMU provider reference */ + bhnd_release_provider(child, pmu_dev, BHND_SERVICE_PMU); + return (0); } /** + * Default bhnd(4) bus driver implementation of BHND_BUS_GET_CLOCK_LATENCY(). + */ +int +bhnd_generic_get_clock_latency(device_t dev, device_t child, bhnd_clock clock, + u_int *latency) +{ + struct bhnd_core_clkctl *clkctl; + + if (device_get_parent(child) != dev) + return (EINVAL); + + if ((clkctl = bhnd_get_pmu_info(child)) == NULL) + panic("no active PMU allocation"); + + return (bhnd_pmu_get_clock_latency(clkctl->cc_pmu_dev, clock, latency)); +} + +/** + * Default bhnd(4) bus driver implementation of BHND_BUS_GET_CLOCK_FREQ(). + */ +int +bhnd_generic_get_clock_freq(device_t dev, device_t child, bhnd_clock clock, + u_int *freq) +{ + struct bhnd_core_clkctl *clkctl; + + if (device_get_parent(child) != dev) + return (EINVAL); + + if ((clkctl = bhnd_get_pmu_info(child)) == NULL) + panic("no active PMU allocation"); + + return (bhnd_pmu_get_clock_freq(clkctl->cc_pmu_dev, clock, freq)); +} + +/** * Default bhnd(4) bus driver implementation of BHND_BUS_REQUEST_CLOCK(). */ int bhnd_generic_request_clock(device_t dev, device_t child, bhnd_clock clock) { - struct bhnd_softc *sc; - struct bhnd_core_pmu_info *pm; + struct bhnd_softc *sc; + struct bhnd_core_clkctl *clkctl; + uint32_t avail; + uint32_t req; + int error; sc = device_get_softc(dev); - if ((pm = bhnd_get_pmu_info(child)) == NULL) - panic("no active PMU request state"); + if (device_get_parent(child) != dev) + return (EINVAL); - /* dispatch request to PMU */ - return (BHND_PMU_CORE_REQ_CLOCK(pm->pm_pmu, pm, clock)); + if ((clkctl = bhnd_get_pmu_info(child)) == NULL) + panic("no active PMU allocation"); + + BHND_ASSERT_CLKCTL_AVAIL(clkctl); + + avail = 0x0; + req = 0x0; + + switch (clock) { + case BHND_CLOCK_DYN: + break; + case BHND_CLOCK_ILP: + req |= BHND_CCS_FORCEILP; + break; + case BHND_CLOCK_ALP: + req |= BHND_CCS_FORCEALP; + avail |= BHND_CCS_ALPAVAIL; + break; + case BHND_CLOCK_HT: + req |= BHND_CCS_FORCEHT; + avail |= BHND_CCS_HTAVAIL; + break; + default: + device_printf(dev, "%s requested unknown clock: %#x\n", + device_get_nameunit(clkctl->cc_dev), clock); + return (ENODEV); + } + + BHND_CLKCTL_LOCK(clkctl); + + /* Issue request */ + BHND_CLKCTL_SET_4(clkctl, req, BHND_CCS_FORCE_MASK); + + /* Wait for clock availability */ + error = bhnd_core_clkctl_wait(clkctl, avail, avail); + + BHND_CLKCTL_UNLOCK(clkctl); + + return (error); } /** @@ -529,16 +633,64 @@ bhnd_generic_request_clock(device_t dev, device_t chil int bhnd_generic_enable_clocks(device_t dev, device_t child, uint32_t clocks) { - struct bhnd_softc *sc; - struct bhnd_core_pmu_info *pm; + struct bhnd_softc *sc; + struct bhnd_core_clkctl *clkctl; + uint32_t avail; + uint32_t req; + int error; sc = device_get_softc(dev); - if ((pm = bhnd_get_pmu_info(child)) == NULL) - panic("no active PMU request state"); + if (device_get_parent(child) != dev) + return (EINVAL); - /* dispatch request to PMU */ - return (BHND_PMU_CORE_EN_CLOCKS(pm->pm_pmu, pm, clocks)); + if ((clkctl = bhnd_get_pmu_info(child)) == NULL) + panic("no active PMU allocation"); + + BHND_ASSERT_CLKCTL_AVAIL(clkctl); + + sc = device_get_softc(dev); + + avail = 0x0; + req = 0x0; + + /* Build clock request flags */ + if (clocks & BHND_CLOCK_DYN) /* nothing to enable */ + clocks &= ~BHND_CLOCK_DYN; + + if (clocks & BHND_CLOCK_ILP) /* nothing to enable */ + clocks &= ~BHND_CLOCK_ILP; + + if (clocks & BHND_CLOCK_ALP) { + req |= BHND_CCS_ALPAREQ; + avail |= BHND_CCS_ALPAVAIL; + clocks &= ~BHND_CLOCK_ALP; + } + + if (clocks & BHND_CLOCK_HT) { + req |= BHND_CCS_HTAREQ; + avail |= BHND_CCS_HTAVAIL; + clocks &= ~BHND_CLOCK_HT; + } + + /* Check for unknown clock values */ + if (clocks != 0x0) { + device_printf(dev, "%s requested unknown clocks: %#x\n", + device_get_nameunit(clkctl->cc_dev), clocks); + return (ENODEV); + } + + BHND_CLKCTL_LOCK(clkctl); + + /* Issue request */ + BHND_CLKCTL_SET_4(clkctl, req, BHND_CCS_AREQ_MASK); + + /* Wait for clock availability */ + error = bhnd_core_clkctl_wait(clkctl, avail, avail); + + BHND_CLKCTL_UNLOCK(clkctl); + + return (error); } /** @@ -547,16 +699,41 @@ bhnd_generic_enable_clocks(device_t dev, device_t chil int bhnd_generic_request_ext_rsrc(device_t dev, device_t child, u_int rsrc) { - struct bhnd_softc *sc; - struct bhnd_core_pmu_info *pm; + struct bhnd_softc *sc; + struct bhnd_core_clkctl *clkctl; + uint32_t req; + uint32_t avail; + int error; sc = device_get_softc(dev); - if ((pm = bhnd_get_pmu_info(child)) == NULL) - panic("no active PMU request state"); + if (device_get_parent(child) != dev) + return (EINVAL); - /* dispatch request to PMU */ - return (BHND_PMU_CORE_REQ_EXT_RSRC(pm->pm_pmu, pm, rsrc)); + if ((clkctl = bhnd_get_pmu_info(child)) == NULL) + panic("no active PMU allocation"); + + BHND_ASSERT_CLKCTL_AVAIL(clkctl); + + sc = device_get_softc(dev); + + if (rsrc > BHND_CCS_ERSRC_MAX) + return (EINVAL); + + req = BHND_CCS_SET_BITS((1<pm_pmu, pm, rsrc)); -} + if ((clkctl = bhnd_get_pmu_info(child)) == NULL) + panic("no active PMU allocation"); + BHND_ASSERT_CLKCTL_AVAIL(clkctl); + + sc = device_get_softc(dev); + + if (rsrc > BHND_CCS_ERSRC_MAX) + return (EINVAL); + + mask = BHND_CCS_SET_BITS((1<cc_dev), \ + ("reading clkctl on suspended core will trigger system livelock")) + +#define BHND_CLKCTL_LOCK_INIT(_clkctl) mtx_init(&(_clkctl)->cc_mtx, \ + device_get_nameunit((_clkctl)->cc_dev), NULL, MTX_DEF) +#define BHND_CLKCTL_LOCK(_clkctl) mtx_lock(&(_clkctl)->cc_mtx) +#define BHND_CLKCTL_UNLOCK(_clkctl) mtx_unlock(&(_clkctl)->cc_mtx) +#define BHND_CLKCTL_LOCK_ASSERT(_clkctl, what) \ + mtx_assert(&(_clkctl)->cc_mtx, what) +#define BHND_CLKCTL_LOCK_DESTROY(_clkctl) mtx_destroy(&(_clkctl->cc_mtx)) + +#define BHND_CLKCTL_READ_4(_clkctl) \ + bhnd_bus_read_4((_clkctl)->cc_res, (_clkctl)->cc_res_offset) + +#define BHND_CLKCTL_WRITE_4(_clkctl, _val) \ + bhnd_bus_write_4((_clkctl)->cc_res, (_clkctl)->cc_res_offset, (_val)) + +#define BHND_CLKCTL_SET_4(_clkctl, _val, _mask) \ + BHND_CLKCTL_WRITE_4((_clkctl), \ + ((_val) & (_mask)) | (BHND_CLKCTL_READ_4(_clkctl) & ~(_mask))) + #endif /* _BHND_BHND_PRIVATE_H_ */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Nov 22 21:51: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 4943EDF693F; Wed, 22 Nov 2017 21:51:19 +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 F399E6B9B4; Wed, 22 Nov 2017 21:51:18 +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 vAMLpI4M018066; Wed, 22 Nov 2017 21:51:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMLpHFY018059; Wed, 22 Nov 2017 21:51:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711222151.vAMLpHFY018059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 22 Nov 2017 21:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326106 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 326106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 21:51:19 -0000 Author: mjg Date: Wed Nov 22 21:51:17 2017 New Revision: 326106 URL: https://svnweb.freebsd.org/changeset/base/326106 Log: locks: remove the file + line argument from internal primitives when not used The pair is of use only in debug or LOCKPROF kernels, but was passed (zeroed) for many locks even in production kernels. While here whack the tid argument from wlock hard and xlock hard. There is no kbi change of any sort - "external" primitives still accept the pair. Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/lock.h head/sys/sys/mutex.h head/sys/sys/rwlock.h head/sys/sys/sx.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Wed Nov 22 21:24:47 2017 (r326105) +++ head/sys/kern/kern_mutex.c Wed Nov 22 21:51:17 2017 (r326106) @@ -380,9 +380,8 @@ __mtx_unlock_spin_flags(volatile uintptr_t *c, int opt * is already owned, it will recursively acquire the lock. */ int -_mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file, int line) +_mtx_trylock_flags_int(struct mtx *m, int opts LOCK_FILE_LINE_ARG_DEF) { - struct mtx *m; struct thread *td; uintptr_t tid, v; #ifdef LOCK_PROFILING @@ -397,8 +396,6 @@ _mtx_trylock_flags_(volatile uintptr_t *c, int opts, c if (SCHEDULER_STOPPED_TD(td)) return (1); - m = mtxlock2mtx(c); - KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(td), ("mtx_trylock() by idle thread %p on sleep mutex %s @ %s:%d", curthread, m->lock_object.lo_name, file, line)); @@ -441,6 +438,15 @@ _mtx_trylock_flags_(volatile uintptr_t *c, int opts, c } return (rval); +} + +int +_mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file, int line) +{ + struct mtx *m; + + m = mtxlock2mtx(c); + return (_mtx_trylock_flags_int(m, opts LOCK_FILE_LINE_ARG)); } /* Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Nov 22 21:24:47 2017 (r326105) +++ head/sys/kern/kern_rwlock.c Wed Nov 22 21:51:17 2017 (r326106) @@ -273,7 +273,7 @@ _rw_wlock_cookie(volatile uintptr_t *c, const char *fi tid = (uintptr_t)curthread; v = RW_UNLOCKED; if (!_rw_write_lock_fetch(rw, &v, tid)) - _rw_wlock_hard(rw, v, tid, file, line); + _rw_wlock_hard(rw, v, file, line); else LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(rw__acquire, rw, 0, 0, file, line, LOCKSTAT_WRITER); @@ -369,8 +369,8 @@ _rw_wunlock_cookie(volatile uintptr_t *c, const char * RW_LOCK_READ || ((td)->td_rw_rlocks && (_rw) & RW_LOCK_READ)) static bool __always_inline -__rw_rlock_try(struct rwlock *rw, struct thread *td, uintptr_t *vp, - const char *file, int line) +__rw_rlock_try(struct rwlock *rw, struct thread *td, uintptr_t *vp + LOCK_FILE_LINE_ARG_DEF) { /* @@ -399,10 +399,9 @@ __rw_rlock_try(struct rwlock *rw, struct thread *td, u } static void __noinline -__rw_rlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v, - const char *file, int line) +__rw_rlock_hard(struct rwlock *rw, struct thread *td, uintptr_t v + LOCK_FILE_LINE_ARG_DEF) { - struct rwlock *rw; struct turnstile *ts; #ifdef ADAPTIVE_RWLOCKS volatile struct thread *owner; @@ -434,7 +433,6 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread * #elif defined(KDTRACE_HOOKS) lock_delay_arg_init(&lda, NULL); #endif - rw = rwlock2rw(c); #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); @@ -454,7 +452,7 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread * #endif for (;;) { - if (__rw_rlock_try(rw, td, &v, file, line)) + if (__rw_rlock_try(rw, td, &v LOCK_FILE_LINE_ARG)) break; #ifdef KDTRACE_HOOKS lda.spin_cnt++; @@ -612,14 +610,12 @@ __rw_rlock_hard(volatile uintptr_t *c, struct thread * } void -__rw_rlock(volatile uintptr_t *c, const char *file, int line) +__rw_rlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF) { - struct rwlock *rw; struct thread *td; uintptr_t v; td = curthread; - rw = rwlock2rw(c); KASSERT(kdb_active != 0 || SCHEDULER_STOPPED_TD(td) || !TD_IS_IDLETHREAD(td), @@ -634,14 +630,23 @@ __rw_rlock(volatile uintptr_t *c, const char *file, in v = RW_READ_VALUE(rw); if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(rw__acquire) || - !__rw_rlock_try(rw, td, &v, file, line))) - __rw_rlock_hard(c, td, v, file, line); + !__rw_rlock_try(rw, td, &v LOCK_FILE_LINE_ARG))) + __rw_rlock_hard(rw, td, v LOCK_FILE_LINE_ARG); LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line); WITNESS_LOCK(&rw->lock_object, 0, file, line); TD_LOCKS_INC(curthread); } +void +__rw_rlock(volatile uintptr_t *c, const char *file, int line) +{ + struct rwlock *rw; + + rw = rwlock2rw(c); + __rw_rlock_int(rw LOCK_FILE_LINE_ARG); +} + int __rw_try_rlock(volatile uintptr_t *c, const char *file, int line) { @@ -724,18 +729,15 @@ __rw_runlock_try(struct rwlock *rw, struct thread *td, } static void __noinline -__rw_runlock_hard(volatile uintptr_t *c, struct thread *td, uintptr_t v, - const char *file, int line) +__rw_runlock_hard(struct rwlock *rw, struct thread *td, uintptr_t v + LOCK_FILE_LINE_ARG_DEF) { - struct rwlock *rw; struct turnstile *ts; uintptr_t x, queue; if (SCHEDULER_STOPPED()) return; - rw = rwlock2rw(c); - for (;;) { if (__rw_runlock_try(rw, td, &v)) break; @@ -799,17 +801,14 @@ __rw_runlock_hard(volatile uintptr_t *c, struct thread } void -_rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line) +_rw_runlock_cookie_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF) { - struct rwlock *rw; struct thread *td; uintptr_t v; - rw = rwlock2rw(c); - KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_runlock() of destroyed rwlock @ %s:%d", file, line)); - __rw_assert(c, RA_RLOCKED, file, line); + __rw_assert(&rw->rw_lock, RA_RLOCKED, file, line); WITNESS_UNLOCK(&rw->lock_object, 0, file, line); LOCK_LOG_LOCK("RUNLOCK", &rw->lock_object, 0, 0, file, line); @@ -818,20 +817,29 @@ _rw_runlock_cookie(volatile uintptr_t *c, const char * if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(rw__release) || !__rw_runlock_try(rw, td, &v))) - __rw_runlock_hard(c, td, v, file, line); + __rw_runlock_hard(rw, td, v LOCK_FILE_LINE_ARG); TD_LOCKS_DEC(curthread); } +void +_rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line) +{ + struct rwlock *rw; + + rw = rwlock2rw(c); + _rw_runlock_cookie_int(rw LOCK_FILE_LINE_ARG); +} + /* * This function is called when we are unable to obtain a write lock on the * first try. This means that at least one other thread holds either a * read or write lock. */ void -__rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, - const char *file, int line) +__rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOCK_FILE_LINE_ARG_DEF) { + uintptr_t tid; struct rwlock *rw; struct turnstile *ts; #ifdef ADAPTIVE_RWLOCKS @@ -857,6 +865,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui int doing_lockprof; #endif + tid = (uintptr_t)curthread; if (SCHEDULER_STOPPED()) return; @@ -1069,8 +1078,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, ui * on this lock. */ void -__rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file, - int line) +__rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid LOCK_FILE_LINE_ARG_DEF) { struct rwlock *rw; struct turnstile *ts; @@ -1145,9 +1153,8 @@ __rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid * lock. Returns true if the upgrade succeeded and false otherwise. */ int -__rw_try_upgrade(volatile uintptr_t *c, const char *file, int line) +__rw_try_upgrade_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF) { - struct rwlock *rw; uintptr_t v, x, tid; struct turnstile *ts; int success; @@ -1155,11 +1162,9 @@ __rw_try_upgrade(volatile uintptr_t *c, const char *fi if (SCHEDULER_STOPPED()) return (1); - rw = rwlock2rw(c); - KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_try_upgrade() of destroyed rwlock @ %s:%d", file, line)); - __rw_assert(c, RA_RLOCKED, file, line); + __rw_assert(&rw->rw_lock, RA_RLOCKED, file, line); /* * Attempt to switch from one reader to a writer. If there @@ -1217,13 +1222,21 @@ __rw_try_upgrade(volatile uintptr_t *c, const char *fi return (success); } +int +__rw_try_upgrade(volatile uintptr_t *c, const char *file, int line) +{ + struct rwlock *rw; + + rw = rwlock2rw(c); + return (__rw_try_upgrade_int(rw LOCK_FILE_LINE_ARG)); +} + /* * Downgrade a write lock into a single read lock. */ void -__rw_downgrade(volatile uintptr_t *c, const char *file, int line) +__rw_downgrade_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF) { - struct rwlock *rw; struct turnstile *ts; uintptr_t tid, v; int rwait, wwait; @@ -1231,11 +1244,9 @@ __rw_downgrade(volatile uintptr_t *c, const char *file if (SCHEDULER_STOPPED()) return; - rw = rwlock2rw(c); - KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_downgrade() of destroyed rwlock @ %s:%d", file, line)); - __rw_assert(c, RA_WLOCKED | RA_NOTRECURSED, file, line); + __rw_assert(&rw->rw_lock, RA_WLOCKED | RA_NOTRECURSED, file, line); #ifndef INVARIANTS if (rw_recursed(rw)) panic("downgrade of a recursed lock"); @@ -1285,6 +1296,15 @@ out: curthread->td_rw_rlocks++; LOCK_LOG_LOCK("WDOWNGRADE", &rw->lock_object, 0, 0, file, line); LOCKSTAT_RECORD0(rw__downgrade, rw); +} + +void +__rw_downgrade(volatile uintptr_t *c, const char *file, int line) +{ + struct rwlock *rw; + + rw = rwlock2rw(c); + __rw_downgrade_int(rw LOCK_FILE_LINE_ARG); } #ifdef INVARIANT_SUPPORT Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Wed Nov 22 21:24:47 2017 (r326105) +++ head/sys/kern/kern_sx.c Wed Nov 22 21:51:17 2017 (r326106) @@ -259,7 +259,7 @@ sx_destroy(struct sx *sx) } int -sx_try_slock_(struct sx *sx, const char *file, int line) +sx_try_slock_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) { uintptr_t x; @@ -291,6 +291,13 @@ sx_try_slock_(struct sx *sx, const char *file, int lin } int +sx_try_slock_(struct sx *sx, const char *file, int line) +{ + + return (sx_try_slock_int(sx LOCK_FILE_LINE_ARG)); +} + +int _sx_xlock(struct sx *sx, int opts, const char *file, int line) { uintptr_t tid, x; @@ -307,7 +314,7 @@ _sx_xlock(struct sx *sx, int opts, const char *file, i tid = (uintptr_t)curthread; x = SX_LOCK_UNLOCKED; if (!atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, tid)) - error = _sx_xlock_hard(sx, x, tid, opts, file, line); + error = _sx_xlock_hard(sx, x, opts LOCK_FILE_LINE_ARG); else LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, 0, 0, file, line, LOCKSTAT_WRITER); @@ -322,7 +329,7 @@ _sx_xlock(struct sx *sx, int opts, const char *file, i } int -sx_try_xlock_(struct sx *sx, const char *file, int line) +sx_try_xlock_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) { struct thread *td; uintptr_t tid, x; @@ -370,6 +377,13 @@ sx_try_xlock_(struct sx *sx, const char *file, int lin return (rval); } +int +sx_try_xlock_(struct sx *sx, const char *file, int line) +{ + + return (sx_try_xlock_int(sx LOCK_FILE_LINE_ARG)); +} + void _sx_xunlock(struct sx *sx, const char *file, int line) { @@ -394,7 +408,7 @@ _sx_xunlock(struct sx *sx, const char *file, int line) * Return 1 if if the upgrade succeed, 0 otherwise. */ int -sx_try_upgrade_(struct sx *sx, const char *file, int line) +sx_try_upgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) { uintptr_t x; int success; @@ -423,11 +437,18 @@ sx_try_upgrade_(struct sx *sx, const char *file, int l return (success); } +int +sx_try_upgrade_(struct sx *sx, const char *file, int line) +{ + + return (sx_try_upgrade_int(sx LOCK_FILE_LINE_ARG)); +} + /* * Downgrade an unrecursed exclusive lock into a single shared lock. */ void -sx_downgrade_(struct sx *sx, const char *file, int line) +sx_downgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) { uintptr_t x; int wakeup_swapper; @@ -490,6 +511,13 @@ sx_downgrade_(struct sx *sx, const char *file, int lin kick_proc0(); } +void +sx_downgrade_(struct sx *sx, const char *file, int line) +{ + + sx_downgrade_int(sx LOCK_FILE_LINE_ARG); +} + /* * This function represents the so-called 'hard case' for sx_xlock * operation. All 'easy case' failures are redirected to this. Note @@ -497,10 +525,10 @@ sx_downgrade_(struct sx *sx, const char *file, int lin * accessible from at least sx.h. */ int -_sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t tid, int opts, - const char *file, int line) +_sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LOCK_FILE_LINE_ARG_DEF) { GIANT_DECLARE; + uintptr_t tid; #ifdef ADAPTIVE_SX volatile struct thread *owner; u_int i, n, spintries = 0; @@ -523,6 +551,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t t #endif int extra_work = 0; + tid = (uintptr_t)curthread; if (SCHEDULER_STOPPED()) return (0); @@ -770,7 +799,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t t * accessible from at least sx.h. */ void -_sx_xunlock_hard(struct sx *sx, uintptr_t tid, const char *file, int line) +_sx_xunlock_hard(struct sx *sx, uintptr_t tid LOCK_FILE_LINE_ARG_DEF) { uintptr_t x, setx; int queue, wakeup_swapper; @@ -835,7 +864,7 @@ _sx_xunlock_hard(struct sx *sx, uintptr_t tid, const c } static bool __always_inline -__sx_slock_try(struct sx *sx, uintptr_t *xp, const char *file, int line) +__sx_slock_try(struct sx *sx, uintptr_t *xp LOCK_FILE_LINE_ARG_DEF) { /* @@ -859,7 +888,7 @@ __sx_slock_try(struct sx *sx, uintptr_t *xp, const cha } static int __noinline -_sx_slock_hard(struct sx *sx, int opts, const char *file, int line, uintptr_t x) +_sx_slock_hard(struct sx *sx, int opts, uintptr_t x LOCK_FILE_LINE_ARG_DEF) { GIANT_DECLARE; #ifdef ADAPTIVE_SX @@ -914,7 +943,7 @@ _sx_slock_hard(struct sx *sx, int opts, const char *fi * shared locks once there is an exclusive waiter. */ for (;;) { - if (__sx_slock_try(sx, &x, file, line)) + if (__sx_slock_try(sx, &x LOCK_FILE_LINE_ARG)) break; #ifdef KDTRACE_HOOKS lda.spin_cnt++; @@ -1058,7 +1087,7 @@ _sx_slock_hard(struct sx *sx, int opts, const char *fi } int -_sx_slock(struct sx *sx, int opts, const char *file, int line) +_sx_slock_int(struct sx *sx, int opts LOCK_FILE_LINE_ARG_DEF) { uintptr_t x; int error; @@ -1074,8 +1103,8 @@ _sx_slock(struct sx *sx, int opts, const char *file, i error = 0; x = SX_READ_VALUE(sx); if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(sx__acquire) || - !__sx_slock_try(sx, &x, file, line))) - error = _sx_slock_hard(sx, opts, file, line, x); + !__sx_slock_try(sx, &x LOCK_FILE_LINE_ARG))) + error = _sx_slock_hard(sx, opts, x LOCK_FILE_LINE_ARG); if (error == 0) { LOCK_LOG_LOCK("SLOCK", &sx->lock_object, 0, 0, file, line); WITNESS_LOCK(&sx->lock_object, 0, file, line); @@ -1084,6 +1113,13 @@ _sx_slock(struct sx *sx, int opts, const char *file, i return (error); } +int +_sx_slock(struct sx *sx, int opts, const char *file, int line) +{ + + return (_sx_slock_int(sx, opts LOCK_FILE_LINE_ARG)); +} + static bool __always_inline _sx_sunlock_try(struct sx *sx, uintptr_t *xp) { @@ -1135,7 +1171,7 @@ _sx_sunlock_try(struct sx *sx, uintptr_t *xp) } static void __noinline -_sx_sunlock_hard(struct sx *sx, uintptr_t x, const char *file, int line) +_sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_LINE_ARG_DEF) { int wakeup_swapper; @@ -1182,7 +1218,7 @@ _sx_sunlock_hard(struct sx *sx, uintptr_t x, const cha } void -_sx_sunlock(struct sx *sx, const char *file, int line) +_sx_sunlock_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) { uintptr_t x; @@ -1195,9 +1231,16 @@ _sx_sunlock(struct sx *sx, const char *file, int line) x = SX_READ_VALUE(sx); if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(sx__release) || !_sx_sunlock_try(sx, &x))) - _sx_sunlock_hard(sx, x, file, line); + _sx_sunlock_hard(sx, x LOCK_FILE_LINE_ARG); TD_LOCKS_DEC(curthread); +} + +void +_sx_sunlock(struct sx *sx, const char *file, int line) +{ + + _sx_sunlock_int(sx LOCK_FILE_LINE_ARG); } #ifdef INVARIANT_SUPPORT Modified: head/sys/sys/lock.h ============================================================================== --- head/sys/sys/lock.h Wed Nov 22 21:24:47 2017 (r326105) +++ head/sys/sys/lock.h Wed Nov 22 21:51:17 2017 (r326106) @@ -137,9 +137,13 @@ struct lock_class { * operations. Otherwise, use default values to avoid the unneeded bloat. */ #if LOCK_DEBUG > 0 +#define LOCK_FILE_LINE_ARG_DEF , const char *file, int line +#define LOCK_FILE_LINE_ARG , file, line #define LOCK_FILE __FILE__ #define LOCK_LINE __LINE__ #else +#define LOCK_FILE_LINE_ARG_DEF +#define LOCK_FILE_LINE_ARG #define LOCK_FILE NULL #define LOCK_LINE 0 #endif Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Wed Nov 22 21:24:47 2017 (r326105) +++ head/sys/sys/mutex.h Wed Nov 22 21:51:17 2017 (r326106) @@ -91,6 +91,7 @@ void _mtx_init(volatile uintptr_t *c, const char *name int opts); void _mtx_destroy(volatile uintptr_t *c); void mtx_sysinit(void *arg); +int _mtx_trylock_flags_int(struct mtx *m, int opts LOCK_FILE_LINE_ARG_DEF); int _mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file, int line); void mutex_init(void); Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Wed Nov 22 21:24:47 2017 (r326105) +++ head/sys/sys/rwlock.h Wed Nov 22 21:51:17 2017 (r326106) @@ -105,7 +105,7 @@ \ if (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__acquire) || \ !_rw_write_lock_fetch((rw), &_v, _tid))) \ - _rw_wlock_hard((rw), _v, _tid, (file), (line)); \ + _rw_wlock_hard((rw), _v, (file), (line)); \ } while (0) /* Release a write lock. */ @@ -128,16 +128,22 @@ void rw_sysinit(void *arg); void rw_sysinit_flags(void *arg); int _rw_wowned(const volatile uintptr_t *c); void _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line); +int __rw_try_wlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); int __rw_try_wlock(volatile uintptr_t *c, const char *file, int line); void _rw_wunlock_cookie(volatile uintptr_t *c, const char *file, int line); +void __rw_rlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); void __rw_rlock(volatile uintptr_t *c, const char *file, int line); +int __rw_try_rlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); int __rw_try_rlock(volatile uintptr_t *c, const char *file, int line); +void _rw_runlock_cookie_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); void _rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line); -void __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v, uintptr_t tid, - const char *file, int line); -void __rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid, - const char *file, int line); +void __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v + LOCK_FILE_LINE_ARG_DEF); +void __rw_wunlock_hard(volatile uintptr_t *c, uintptr_t v + LOCK_FILE_LINE_ARG_DEF); +int __rw_try_upgrade_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); int __rw_try_upgrade(volatile uintptr_t *c, const char *file, int line); +void __rw_downgrade_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF); void __rw_downgrade(volatile uintptr_t *c, const char *file, int line); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void __rw_assert(const volatile uintptr_t *c, int what, const char *file, @@ -163,20 +169,38 @@ void __rw_assert(const volatile uintptr_t *c, int what __rw_try_wlock(&(rw)->rw_lock, f, l) #define _rw_wunlock(rw, f, l) \ _rw_wunlock_cookie(&(rw)->rw_lock, f, l) -#define _rw_rlock(rw, f, l) \ - __rw_rlock(&(rw)->rw_lock, f, l) #define _rw_try_rlock(rw, f, l) \ __rw_try_rlock(&(rw)->rw_lock, f, l) +#if LOCK_DEBUG > 0 +#define _rw_rlock(rw, f, l) \ + __rw_rlock(&(rw)->rw_lock, f, l) #define _rw_runlock(rw, f, l) \ _rw_runlock_cookie(&(rw)->rw_lock, f, l) -#define _rw_wlock_hard(rw, v, t, f, l) \ - __rw_wlock_hard(&(rw)->rw_lock, v, t, f, l) -#define _rw_wunlock_hard(rw, t, f, l) \ - __rw_wunlock_hard(&(rw)->rw_lock, t, f, l) +#else +#define _rw_rlock(rw, f, l) \ + __rw_rlock_int((struct rwlock *)rw) +#define _rw_runlock(rw, f, l) \ + _rw_runlock_cookie_int((struct rwlock *)rw) +#endif +#if LOCK_DEBUG > 0 +#define _rw_wlock_hard(rw, v, f, l) \ + __rw_wlock_hard(&(rw)->rw_lock, v, f, l) +#define _rw_wunlock_hard(rw, v, f, l) \ + __rw_wunlock_hard(&(rw)->rw_lock, v, f, l) #define _rw_try_upgrade(rw, f, l) \ __rw_try_upgrade(&(rw)->rw_lock, f, l) #define _rw_downgrade(rw, f, l) \ __rw_downgrade(&(rw)->rw_lock, f, l) +#else +#define _rw_wlock_hard(rw, v, f, l) \ + __rw_wlock_hard(&(rw)->rw_lock, v) +#define _rw_wunlock_hard(rw, v, f, l) \ + __rw_wunlock_hard(&(rw)->rw_lock, v) +#define _rw_try_upgrade(rw, f, l) \ + __rw_try_upgrade_int(rw) +#define _rw_downgrade(rw, f, l) \ + __rw_downgrade_int(rw) +#endif #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) #define _rw_assert(rw, w, f, l) \ __rw_assert(&(rw)->rw_lock, w, f, l) Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Wed Nov 22 21:24:47 2017 (r326105) +++ head/sys/sys/sx.h Wed Nov 22 21:51:17 2017 (r326106) @@ -101,18 +101,22 @@ void sx_sysinit(void *arg); #define sx_init(sx, desc) sx_init_flags((sx), (desc), 0) void sx_init_flags(struct sx *sx, const char *description, int opts); void sx_destroy(struct sx *sx); +int sx_try_slock_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF); int sx_try_slock_(struct sx *sx, const char *file, int line); +int sx_try_xlock_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF); int sx_try_xlock_(struct sx *sx, const char *file, int line); +int sx_try_upgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF); int sx_try_upgrade_(struct sx *sx, const char *file, int line); +void sx_downgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF); void sx_downgrade_(struct sx *sx, const char *file, int line); +int _sx_slock_int(struct sx *sx, int opts LOCK_FILE_LINE_ARG_DEF); int _sx_slock(struct sx *sx, int opts, const char *file, int line); int _sx_xlock(struct sx *sx, int opts, const char *file, int line); +void _sx_sunlock_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF); void _sx_sunlock(struct sx *sx, const char *file, int line); void _sx_xunlock(struct sx *sx, const char *file, int line); -int _sx_xlock_hard(struct sx *sx, uintptr_t v, uintptr_t tid, int opts, - const char *file, int line); -void _sx_xunlock_hard(struct sx *sx, uintptr_t tid, const char *file, int - line); +int _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LOCK_FILE_LINE_ARG_DEF); +void _sx_xunlock_hard(struct sx *sx, uintptr_t tid LOCK_FILE_LINE_ARG_DEF); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void _sx_assert(const struct sx *sx, int what, const char *file, int line); #endif @@ -157,7 +161,7 @@ __sx_xlock(struct sx *sx, struct thread *td, int opts, if (__predict_false(LOCKSTAT_PROFILE_ENABLED(sx__acquire) || !atomic_fcmpset_acq_ptr(&sx->sx_lock, &v, tid))) - error = _sx_xlock_hard(sx, v, tid, opts, file, line); + error = _sx_xlock_hard(sx, v, opts); return (error); } @@ -170,7 +174,7 @@ __sx_xunlock(struct sx *sx, struct thread *td, const c if (__predict_false(LOCKSTAT_PROFILE_ENABLED(sx__release) || !atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED))) - _sx_xunlock_hard(sx, tid, file, line); + _sx_xunlock_hard(sx, tid); } #endif @@ -195,6 +199,7 @@ __sx_xunlock(struct sx *sx, struct thread *td, const c #define sx_xunlock_(sx, file, line) \ __sx_xunlock((sx), curthread, (file), (line)) #endif /* LOCK_DEBUG > 0 || SX_NOINLINE */ +#if (LOCK_DEBUG > 0) #define sx_slock_(sx, file, line) \ (void)_sx_slock((sx), 0, (file), (line)) #define sx_slock_sig_(sx, file, line) \ @@ -205,6 +210,18 @@ __sx_xunlock(struct sx *sx, struct thread *td, const c #define sx_try_xlock(sx) sx_try_xlock_((sx), LOCK_FILE, LOCK_LINE) #define sx_try_upgrade(sx) sx_try_upgrade_((sx), LOCK_FILE, LOCK_LINE) #define sx_downgrade(sx) sx_downgrade_((sx), LOCK_FILE, LOCK_LINE) +#else +#define sx_slock_(sx, file, line) \ + (void)_sx_slock_int((sx), 0) +#define sx_slock_sig_(sx, file, line) \ + _sx_slock_int((sx), SX_INTERRUPTIBLE) +#define sx_sunlock_(sx, file, line) \ + _sx_sunlock_int((sx)) +#define sx_try_slock(sx) sx_try_slock_int((sx)) +#define sx_try_xlock(sx) sx_try_xlock_int((sx)) +#define sx_try_upgrade(sx) sx_try_upgrade_int((sx)) +#define sx_downgrade(sx) sx_downgrade_int((sx)) +#endif #ifdef INVARIANTS #define sx_assert_(sx, what, file, line) \ _sx_assert((sx), (what), (file), (line)) From owner-svn-src-head@freebsd.org Wed Nov 22 22:04: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 3A160DF6E0F; Wed, 22 Nov 2017 22:04:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1410D6C14C; Wed, 22 Nov 2017 22:04:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMM45sr023957; Wed, 22 Nov 2017 22:04:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMM44FW023951; Wed, 22 Nov 2017 22:04:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711222204.vAMM44FW023951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 22 Nov 2017 22:04:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326107 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 326107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 22:04:06 -0000 Author: mjg Date: Wed Nov 22 22:04:04 2017 New Revision: 326107 URL: https://svnweb.freebsd.org/changeset/base/326107 Log: locks: pass the found lock value to unlock slow path This avoids an explicit read later. While here whack the cheaply obtainable 'tid' argument. Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c head/sys/sys/mutex.h head/sys/sys/rwlock.h head/sys/sys/sx.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Wed Nov 22 21:51:17 2017 (r326106) +++ head/sys/kern/kern_mutex.c Wed Nov 22 22:04:04 2017 (r326107) @@ -277,7 +277,7 @@ __mtx_unlock_flags(volatile uintptr_t *c, int opts, co mtx_assert(m, MA_OWNED); #ifdef LOCK_PROFILING - __mtx_unlock_sleep(c, opts, file, line); + __mtx_unlock_sleep(c, (uintptr_t)curthread, opts, file, line); #else __mtx_unlock(m, curthread, opts, file, line); #endif @@ -1002,24 +1002,27 @@ thread_lock_set(struct thread *td, struct mtx *new) */ #if LOCK_DEBUG > 0 void -__mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line) +__mtx_unlock_sleep(volatile uintptr_t *c, uintptr_t v, int opts, + const char *file, int line) #else void -__mtx_unlock_sleep(volatile uintptr_t *c) +__mtx_unlock_sleep(volatile uintptr_t *c, uintptr_t v) #endif { struct mtx *m; struct turnstile *ts; - uintptr_t tid, v; + uintptr_t tid; if (SCHEDULER_STOPPED()) return; tid = (uintptr_t)curthread; m = mtxlock2mtx(c); - v = MTX_READ_VALUE(m); - if (v & MTX_RECURSED) { + if (__predict_false(v == tid)) + v = MTX_READ_VALUE(m); + + if (__predict_false(v & MTX_RECURSED)) { if (--(m->mtx_recurse) == 0) atomic_clear_ptr(&m->mtx_lock, MTX_RECURSED); if (LOCK_LOG_TEST(&m->lock_object, opts)) Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Nov 22 21:51:17 2017 (r326106) +++ head/sys/kern/kern_rwlock.c Wed Nov 22 22:04:04 2017 (r326107) @@ -1078,18 +1078,21 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC * on this lock. */ void -__rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid LOCK_FILE_LINE_ARG_DEF) +__rw_wunlock_hard(volatile uintptr_t *c, uintptr_t v LOCK_FILE_LINE_ARG_DEF) { struct rwlock *rw; struct turnstile *ts; - uintptr_t v, setv; + uintptr_t tid, setv; int queue; + tid = (uintptr_t)curthread; if (SCHEDULER_STOPPED()) return; rw = rwlock2rw(c); - v = RW_READ_VALUE(rw); + if (__predict_false(v == tid)) + v = RW_READ_VALUE(rw); + if (v & RW_LOCK_WRITER_RECURSED) { if (--(rw->rw_recurse) == 0) atomic_clear_ptr(&rw->rw_lock, RW_LOCK_WRITER_RECURSED); Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Wed Nov 22 21:51:17 2017 (r326106) +++ head/sys/kern/kern_sx.c Wed Nov 22 22:04:04 2017 (r326107) @@ -799,18 +799,22 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO * accessible from at least sx.h. */ void -_sx_xunlock_hard(struct sx *sx, uintptr_t tid LOCK_FILE_LINE_ARG_DEF) +_sx_xunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_LINE_ARG_DEF) { - uintptr_t x, setx; + uintptr_t tid, setx; int queue, wakeup_swapper; if (SCHEDULER_STOPPED()) return; - MPASS(!(sx->sx_lock & SX_LOCK_SHARED)); + tid = (uintptr_t)curthread; - x = SX_READ_VALUE(sx); - if (x & SX_LOCK_RECURSED) { + if (__predict_false(x == tid)) + x = SX_READ_VALUE(sx); + + MPASS(!(x & SX_LOCK_SHARED)); + + if (__predict_false(x & SX_LOCK_RECURSED)) { /* The lock is recursed, unrecurse one level. */ if ((--sx->sx_recurse) == 0) atomic_clear_ptr(&sx->sx_lock, SX_LOCK_RECURSED); @@ -824,8 +828,7 @@ _sx_xunlock_hard(struct sx *sx, uintptr_t tid LOCK_FIL atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED)) return; - MPASS(sx->sx_lock & (SX_LOCK_SHARED_WAITERS | - SX_LOCK_EXCLUSIVE_WAITERS)); + MPASS(x & (SX_LOCK_SHARED_WAITERS | SX_LOCK_EXCLUSIVE_WAITERS)); if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p contested", __func__, sx); Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Wed Nov 22 21:51:17 2017 (r326106) +++ head/sys/sys/mutex.h Wed Nov 22 22:04:04 2017 (r326107) @@ -98,11 +98,11 @@ void mutex_init(void); #if LOCK_DEBUG > 0 void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v, int opts, const char *file, int line); -void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, - int line); +void __mtx_unlock_sleep(volatile uintptr_t *c, uintptr_t v, int opts, + const char *file, int line); #else void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v); -void __mtx_unlock_sleep(volatile uintptr_t *c); +void __mtx_unlock_sleep(volatile uintptr_t *c, uintptr_t v); #endif #ifdef SMP @@ -164,13 +164,13 @@ void _thread_lock(struct thread *); #if LOCK_DEBUG > 0 #define _mtx_lock_sleep(m, v, o, f, l) \ __mtx_lock_sleep(&(m)->mtx_lock, v, o, f, l) -#define _mtx_unlock_sleep(m, o, f, l) \ - __mtx_unlock_sleep(&(m)->mtx_lock, o, f, l) +#define _mtx_unlock_sleep(m, v, o, f, l) \ + __mtx_unlock_sleep(&(m)->mtx_lock, v, o, f, l) #else #define _mtx_lock_sleep(m, v, o, f, l) \ __mtx_lock_sleep(&(m)->mtx_lock, v) -#define _mtx_unlock_sleep(m, o, f, l) \ - __mtx_unlock_sleep(&(m)->mtx_lock) +#define _mtx_unlock_sleep(m, v, o, f, l) \ + __mtx_unlock_sleep(&(m)->mtx_lock, v) #endif #ifdef SMP #if LOCK_DEBUG > 0 @@ -215,6 +215,9 @@ void _thread_lock(struct thread *); #define _mtx_release_lock_quick(mp) \ atomic_store_rel_ptr(&(mp)->mtx_lock, MTX_UNOWNED) +#define _mtx_release_lock_fetch(mp, vp) \ + atomic_fcmpset_rel_ptr(&(mp)->mtx_lock, (vp), MTX_UNOWNED) + /* * Full lock operations that are suitable to be inlined in non-debug * kernels. If the lock cannot be acquired or released trivially then @@ -292,11 +295,11 @@ void _thread_lock(struct thread *); /* Unlock a normal mutex. */ #define __mtx_unlock(mp, tid, opts, file, line) do { \ - uintptr_t _tid = (uintptr_t)(tid); \ + uintptr_t _v = (uintptr_t)(tid); \ \ if (__predict_false(LOCKSTAT_PROFILE_ENABLED(adaptive__release) ||\ - !_mtx_release_lock((mp), _tid))) \ - _mtx_unlock_sleep((mp), (opts), (file), (line)); \ + !_mtx_release_lock_fetch((mp), &_v))) \ + _mtx_unlock_sleep((mp), _v, (opts), (file), (line)); \ } while (0) /* Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Wed Nov 22 21:51:17 2017 (r326106) +++ head/sys/sys/rwlock.h Wed Nov 22 22:04:04 2017 (r326107) @@ -92,6 +92,9 @@ #define _rw_write_unlock(rw, tid) \ atomic_cmpset_rel_ptr(&(rw)->rw_lock, (tid), RW_UNLOCKED) +#define _rw_write_unlock_fetch(rw, tid) \ + atomic_fcmpset_rel_ptr(&(rw)->rw_lock, (tid), RW_UNLOCKED) + /* * Full lock operations that are suitable to be inlined in non-debug * kernels. If the lock cannot be acquired or released trivially then @@ -110,11 +113,11 @@ /* Release a write lock. */ #define __rw_wunlock(rw, tid, file, line) do { \ - uintptr_t _tid = (uintptr_t)(tid); \ + uintptr_t _v = (uintptr_t)(tid); \ \ if (__predict_false(LOCKSTAT_PROFILE_ENABLED(rw__release) || \ - !_rw_write_unlock((rw), _tid))) \ - _rw_wunlock_hard((rw), _tid, (file), (line)); \ + !_rw_write_unlock_fetch((rw), &_v))) \ + _rw_wunlock_hard((rw), _v, (file), (line)); \ } while (0) /* Modified: head/sys/sys/sx.h ============================================================================== --- head/sys/sys/sx.h Wed Nov 22 21:51:17 2017 (r326106) +++ head/sys/sys/sx.h Wed Nov 22 22:04:04 2017 (r326107) @@ -116,7 +116,7 @@ void _sx_sunlock_int(struct sx *sx LOCK_FILE_LINE_ARG_ void _sx_sunlock(struct sx *sx, const char *file, int line); void _sx_xunlock(struct sx *sx, const char *file, int line); int _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LOCK_FILE_LINE_ARG_DEF); -void _sx_xunlock_hard(struct sx *sx, uintptr_t tid LOCK_FILE_LINE_ARG_DEF); +void _sx_xunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_LINE_ARG_DEF); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) void _sx_assert(const struct sx *sx, int what, const char *file, int line); #endif @@ -170,11 +170,11 @@ __sx_xlock(struct sx *sx, struct thread *td, int opts, static __inline void __sx_xunlock(struct sx *sx, struct thread *td, const char *file, int line) { - uintptr_t tid = (uintptr_t)td; + uintptr_t x = (uintptr_t)td; if (__predict_false(LOCKSTAT_PROFILE_ENABLED(sx__release) || - !atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED))) - _sx_xunlock_hard(sx, tid); + !atomic_fcmpset_rel_ptr(&sx->sx_lock, &x, SX_LOCK_UNLOCKED))) + _sx_xunlock_hard(sx, x); } #endif From owner-svn-src-head@freebsd.org Wed Nov 22 22:04: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 54530DF6E67; Wed, 22 Nov 2017 22:04: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 215CD6C28A; Wed, 22 Nov 2017 22:04: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 vAMM4R2Y024013; Wed, 22 Nov 2017 22:04:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMM4R4W024012; Wed, 22 Nov 2017 22:04:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711222204.vAMM4R4W024012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 22 Nov 2017 22:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326108 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 326108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 22:04:28 -0000 Author: kib Date: Wed Nov 22 22:04:27 2017 New Revision: 326108 URL: https://svnweb.freebsd.org/changeset/base/326108 Log: Order declarations alphabetically. Match signess of the format and the value. Noted by: bde Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/systat/vmstat.c Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Wed Nov 22 22:04:04 2017 (r326107) +++ head/usr.bin/systat/vmstat.c Wed Nov 22 22:04:27 2017 (r326108) @@ -138,10 +138,10 @@ static void allocinfo(struct Info *); static void copyinfo(struct Info *, struct Info *); static float cputime(int); static void dinfo(int, int, struct statinfo *, struct statinfo *); +static void do_putuint64(uint64_t, int, int, int, int); static void getinfo(struct Info *); static void putint(int, int, int, int); static void putuint64(uint64_t, int, int, int); -static void do_putuint64(uint64_t, int, int, int, int); static void putfloat(double, int, int, int, int, int); static void putlongdouble(long double, int, int, int, int, int); static int ucount(void); @@ -699,7 +699,7 @@ do_putuint64(uint64_t n, int l, int lc, int w, int div addch(' '); return; } - snr = snprintf(b, sizeof(b), "%*jd", w, (uintmax_t)n); + snr = snprintf(b, sizeof(b), "%*ju", w, (uintmax_t)n); if (snr != w) { humanize_number(buf, w, n, "", HN_AUTOSCALE, HN_NOSPACE | HN_DECIMAL | div); From owner-svn-src-head@freebsd.org Wed Nov 22 22:05: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 5B3FADF6EE7; Wed, 22 Nov 2017 22:05:47 +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 023A86C3FF; Wed, 22 Nov 2017 22:05:46 +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 vAMM5ei6094387 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 23 Nov 2017 00:05:40 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vAMM5ei6094387 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vAMM5cAx094370; Thu, 23 Nov 2017 00:05:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 23 Nov 2017 00:05:38 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat Message-ID: <20171122220538.GT2272@kib.kiev.ua> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> <20171122103917.GS2272@kib.kiev.ua> <20171123021646.M1933@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171123021646.M1933@besplex.bde.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 22:05:47 -0000 On Thu, Nov 23, 2017 at 04:24:13AM +1100, Bruce Evans wrote: > sysctl/sysctl.c: > sysctl(8) has bogus support for prettyprinting struct vmtotal (sysctl > shouldn't have any prettyprinting, especially not for structs that have > specialized programs to print them and much more). This uses intmax_t > for all calculations and printing except for the int16_t fields, so it > automatically benefited from the expansion. However since it uses a > correct type (signed, and not restricted to 64 bits), it now has minor > type errors -- it dowcasts the uint64_t to intmax_t wheen the latter is > 64 bits. Its Makefile uses a fairly high WARNS, so if its type errors > were fatal then printf format checking would have detected them (but > not non-fatal errors involving downcasting). Below is the cast to uintmax_t and unsigned format for sysctl(8). diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index e1bf4e31914..92685a8171b 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -625,15 +625,15 @@ S_vmtotal(size_t l2, void *p) "%hd Sleep: %hd)\n", v->t_rq, v->t_dw, v->t_pw, v->t_sl); printf( - "Virtual Memory:\t\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_vm * pageKilo, (intmax_t)v->t_avm * pageKilo); - printf("Real Memory:\t\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_rm * pageKilo, (intmax_t)v->t_arm * pageKilo); - printf("Shared Virtual Memory:\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_vmshr * pageKilo, (intmax_t)v->t_avmshr * pageKilo); - printf("Shared Real Memory:\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_rmshr * pageKilo, (intmax_t)v->t_armshr * pageKilo); - printf("Free Memory:\t%jdK", (intmax_t)v->t_free * pageKilo); + "Virtual Memory:\t\t(Total: %juK Active: %juK)\n", + (uintmax_t)v->t_vm * pageKilo, (uintmax_t)v->t_avm * pageKilo); + printf("Real Memory:\t\t(Total: %juK Active: %juK)\n", + (uintmax_t)v->t_rm * pageKilo, (uintmax_t)v->t_arm * pageKilo); + printf("Shared Virtual Memory:\t(Total: %juK Active: %juK)\n", + (uintmax_t)v->t_vmshr * pageKilo, (uintmax_t)v->t_avmshr * pageKilo); + printf("Shared Real Memory:\t(Total: %juK Active: %juK)\n", + (uintmax_t)v->t_rmshr * pageKilo, (uintmax_t)v->t_armshr * pageKilo); + printf("Free Memory:\t%juK", (uintmax_t)v->t_free * pageKilo); return (0); } From owner-svn-src-head@freebsd.org Wed Nov 22 23:10: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 1EFD2DF7C15; Wed, 22 Nov 2017 23:10:22 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAA236DD3B; Wed, 22 Nov 2017 23:10:21 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMNALBR048927; Wed, 22 Nov 2017 23:10:21 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMNAKmb048921; Wed, 22 Nov 2017 23:10:20 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201711222310.vAMNAKmb048921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 22 Nov 2017 23:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326109 - in head/sys: conf dev/bhnd dev/bhnd/cores/chipc mips/conf modules/bhnd X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: in head/sys: conf dev/bhnd dev/bhnd/cores/chipc mips/conf modules/bhnd X-SVN-Commit-Revision: 326109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 23:10:22 -0000 Author: landonf Date: Wed Nov 22 23:10:20 2017 New Revision: 326109 URL: https://svnweb.freebsd.org/changeset/base/326109 Log: bhnd(4): Add a basic ChipCommon GPIO driver sufficient to support bwn(4) The driver is functional on both BHND Wi-Fi adapters and MIPS SoCs, but does not currently include support for features not required by bwn(4), including GPIO interrupt handling. Approved by: adrian (mentor, implicit) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12708 Added: head/sys/dev/bhnd/cores/chipc/chipc_gpio.c (contents, props changed) head/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/bhnd/bhnd_types.h head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipc_subr.c head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/mips/conf/BCM head/sys/mips/conf/SENTRY5 head/sys/modules/bhnd/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Nov 22 22:04:27 2017 (r326108) +++ head/sys/conf/files Wed Nov 22 23:10:20 2017 (r326109) @@ -1246,6 +1246,7 @@ dev/bhnd/cores/chipc/bhnd_sprom_chipc.c optional bhnd dev/bhnd/cores/chipc/bhnd_pmu_chipc.c optional bhnd dev/bhnd/cores/chipc/chipc.c optional bhnd dev/bhnd/cores/chipc/chipc_cfi.c optional bhnd cfi +dev/bhnd/cores/chipc/chipc_gpio.c optional bhnd gpio dev/bhnd/cores/chipc/chipc_slicer.c optional bhnd cfi | bhnd spibus dev/bhnd/cores/chipc/chipc_spi.c optional bhnd spibus dev/bhnd/cores/chipc/chipc_subr.c optional bhnd Modified: head/sys/dev/bhnd/bhnd_types.h ============================================================================== --- head/sys/dev/bhnd/bhnd_types.h Wed Nov 22 22:04:27 2017 (r326108) +++ head/sys/dev/bhnd/bhnd_types.h Wed Nov 22 23:10:20 2017 (r326109) @@ -75,6 +75,7 @@ typedef enum { BHND_SERVICE_PWRCTL, /**< legacy pwrctl service; implements the bhnd_pwrctl interface */ BHND_SERVICE_PMU, /**< pmu service; implements the bhnd_pmu interface */ BHND_SERVICE_NVRAM, /**< nvram service; implements the bhnd_nvram interface */ + BHND_SERVICE_GPIO, /**< gpio service; implements the standard gpio interface */ BHND_SERVICE_ANY = 1000, /**< match on any service type */ } bhnd_service_t; Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Wed Nov 22 22:04:27 2017 (r326108) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Wed Nov 22 23:10:20 2017 (r326109) @@ -306,6 +306,20 @@ chipc_add_children(struct chipc_softc *sc) } } + /* GPIO */ + child = BUS_ADD_CHILD(sc->dev, 0, "gpio", 0); + if (child == NULL) { + device_printf(sc->dev, "failed to add gpio\n"); + return (ENXIO); + } + + error = chipc_set_mem_resource(sc, child, 0, 0, RM_MAX_END, 0, 0); + if (error) { + device_printf(sc->dev, "failed to set gpio memory resource: " + "%d\n", error); + return (error); + } + /* All remaining devices are SoC-only */ if (bhnd_get_attach_type(sc->dev) != BHND_ATTACH_NATIVE) return (0); @@ -835,6 +849,25 @@ chipc_alloc_resource(device_t dev, device_t child, int if ((cr = chipc_find_region(sc, start, end)) == NULL) { /* Resource requests outside our shared port regions can be * delegated to our parent. */ + rv = bus_generic_rl_alloc_resource(dev, child, type, rid, + start, end, count, flags); + return (rv); + } + + /* + * As a special case, children that map the complete ChipCommon register + * block are delegated to our parent. + * + * The rman API does not support sharing resources that are not + * identical in size; since we allocate subregions to various children, + * any children that need to map the entire register block (e.g. because + * they require access to discontiguous register ranges) must make the + * allocation through our parent, where we hold a compatible + * RF_SHAREABLE allocation. + */ + if (cr == sc->core_region && cr->cr_addr == start && + cr->cr_end == end && cr->cr_count == count) + { rv = bus_generic_rl_alloc_resource(dev, child, type, rid, start, end, count, flags); return (rv); Added: head/sys/dev/bhnd/cores/chipc/chipc_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/cores/chipc/chipc_gpio.c Wed Nov 22 23:10:20 2017 (r326109) @@ -0,0 +1,846 @@ +/*- + * Copyright (c) 2017 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Landon Fuller under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * 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$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "gpio_if.h" + +#include "bhnd_nvram_map.h" + +#include "chipcreg.h" +#include "chipc_gpiovar.h" + +/* + * ChipCommon GPIO driver + */ + +static int chipc_gpio_check_flags( + struct chipc_gpio_softc *sc, + uint32_t pin_num, uint32_t flags, + chipc_gpio_pin_mode *mode); +static int chipc_gpio_pin_update( + struct chipc_gpio_softc *sc, + struct chipc_gpio_update *update, + uint32_t pin_num, uint32_t flags); +static int chipc_gpio_commit_update( + struct chipc_gpio_softc *sc, + struct chipc_gpio_update *update); +static chipc_gpio_pin_mode chipc_gpio_pin_get_mode( + struct chipc_gpio_softc *sc, + uint32_t pin_num); + + +/* Debugging flags */ +static u_long chipc_gpio_debug = 0; +TUNABLE_ULONG("hw.bhnd_chipc.gpio_debug", &chipc_gpio_debug); + +enum { + /** Allow userspace GPIO access on bridged network (e.g. wi-fi) + * adapters */ + CC_GPIO_DEBUG_ADAPTER_GPIOC = 1 << 0, +}; + +#define CC_GPIO_DEBUG(_type) (CC_GPIO_DEBUG_ ## _type & chipc_gpio_debug) + +static struct bhnd_device_quirk chipc_gpio_quirks[]; + +/* Supported parent core device identifiers */ +static const struct bhnd_device chipc_gpio_devices[] = { + BHND_DEVICE(BCM, CC, "Broadcom ChipCommon GPIO", chipc_gpio_quirks), + BHND_DEVICE_END +}; + +/* Device quirks table */ +static struct bhnd_device_quirk chipc_gpio_quirks[] = { + BHND_CORE_QUIRK (HWREV_LTE(10), CC_GPIO_QUIRK_NO_EVENTS), + BHND_CORE_QUIRK (HWREV_LTE(15), CC_GPIO_QUIRK_NO_DCTIMER), + BHND_CORE_QUIRK (HWREV_LTE(19), CC_GPIO_QUIRK_NO_PULLUPDOWN), + + BHND_DEVICE_QUIRK_END +}; + +static int +chipc_gpio_probe(device_t dev) +{ + const struct bhnd_device *id; + device_t chipc; + + /* Look for compatible chipc parent */ + chipc = device_get_parent(dev); + id = bhnd_device_lookup(chipc, chipc_gpio_devices, + sizeof(chipc_gpio_devices[0])); + if (id == NULL) + return (ENXIO); + + device_set_desc(dev, id->desc); + return (BUS_PROBE_NOWILDCARD); +} + +static int +chipc_gpio_attach(device_t dev) +{ + struct chipc_gpio_softc *sc; + device_t chipc; + int error; + + chipc = device_get_parent(dev); + + sc = device_get_softc(dev); + sc->dev = dev; + sc->quirks = bhnd_device_quirks(chipc, chipc_gpio_devices, + sizeof(chipc_gpio_devices[0])); + + /* If this is a bridged wi-fi adapter, we don't want to support + * userspace requests via gpioc(4) */ + if (bhnd_get_attach_type(chipc) == BHND_ATTACH_ADAPTER) { + if (!CC_GPIO_DEBUG(ADAPTER_GPIOC)) + sc->quirks |= CC_GPIO_QUIRK_NO_GPIOC; + } + + CC_GPIO_LOCK_INIT(sc); + + sc->mem_rid = 0; + sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, + RF_ACTIVE|RF_SHAREABLE); + if (sc->mem_res == NULL) { + device_printf(dev, "failed to allocate chipcommon registers\n"); + error = ENXIO; + goto failed; + } + + /* + * If hardware 'pulsate' support is available, set the timer duty-cycle + * to either the NVRAM 'leddc' value if available, or the default duty + * cycle. + */ + if (!CC_GPIO_QUIRK(sc, NO_DCTIMER)) { + uint32_t dctimerval; + + error = bhnd_nvram_getvar_uint32(chipc, BHND_NVAR_LEDDC, + &dctimerval); + if (error == ENOENT) { + /* Fall back on default duty cycle */ + dctimerval = CHIPC_GPIOTIMERVAL_DEFAULT; + } else if (error) { + device_printf(dev, "error reading %s from NVRAM: %d\n", + BHND_NVAR_LEDDC, error); + goto failed; + } + + CC_GPIO_WR4(sc, CHIPC_GPIOTIMERVAL, dctimerval); + } + + /* Attach gpioc/gpiobus */ + if (CC_GPIO_QUIRK(sc, NO_GPIOC)) { + sc->gpiobus = NULL; + } else { + if ((sc->gpiobus = gpiobus_attach_bus(dev)) == NULL) { + device_printf(dev, "failed to attach gpiobus\n"); + error = ENXIO; + goto failed; + } + } + + /* Register as the bus GPIO provider */ + if ((error = bhnd_register_provider(dev, BHND_SERVICE_GPIO))) { + device_printf(dev, "failed to register gpio with bus: %d\n", + error); + goto failed; + } + + return (0); + +failed: + device_delete_children(dev); + + if (sc->mem_res != NULL) { + bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, + sc->mem_res); + } + + CC_GPIO_LOCK_DESTROY(sc); + + return (error); +} + +static int +chipc_gpio_detach(device_t dev) +{ + struct chipc_gpio_softc *sc; + int error; + + sc = device_get_softc(dev); + + if ((error = bus_generic_detach(dev))) + return (error); + + if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY))) + return (error); + + bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res); + CC_GPIO_LOCK_DESTROY(sc); + + return (0); +} + +static device_t +chipc_gpio_get_bus(device_t dev) +{ + struct chipc_gpio_softc *sc = device_get_softc(dev); + + return (sc->gpiobus); +} + +static int +chipc_gpio_pin_max(device_t dev, int *maxpin) +{ + *maxpin = CC_GPIO_NPINS-1; + return (0); +} + +static int +chipc_gpio_pin_set(device_t dev, uint32_t pin_num, uint32_t pin_value) +{ + struct chipc_gpio_softc *sc; + bool pin_high; + int error; + + sc = device_get_softc(dev); + error = 0; + + if (!CC_GPIO_VALID_PIN(pin_num)) + return (EINVAL); + + switch (pin_value) { + case GPIO_PIN_HIGH: + pin_high = true; + break; + case GPIO_PIN_LOW: + pin_high = false; + break; + default: + return (EINVAL); + } + + CC_GPIO_LOCK(sc); + + switch (chipc_gpio_pin_get_mode(sc, pin_num)) { + case CC_GPIO_PIN_INPUT: + case CC_GPIO_PIN_TRISTATE: + error = ENODEV; + break; + + case CC_GPIO_PIN_OUTPUT: + CC_GPIO_WRFLAG(sc, pin_num, GPIOOUT, pin_high); + break; + } + + CC_GPIO_UNLOCK(sc); + + return (error); +} + +static int +chipc_gpio_pin_get(device_t dev, uint32_t pin_num, uint32_t *pin_value) +{ + struct chipc_gpio_softc *sc; + bool pin_high; + + if (!CC_GPIO_VALID_PIN(pin_num)) + return (EINVAL); + + sc = device_get_softc(dev); + pin_high = false; + + CC_GPIO_LOCK(sc); + + switch (chipc_gpio_pin_get_mode(sc, pin_num)) { + case CC_GPIO_PIN_INPUT: + pin_high = CC_GPIO_RDFLAG(sc, pin_num, GPIOIN); + break; + + case CC_GPIO_PIN_OUTPUT: + pin_high = CC_GPIO_RDFLAG(sc, pin_num, GPIOOUT); + break; + + case CC_GPIO_PIN_TRISTATE: + pin_high = false; + break; + } + + CC_GPIO_UNLOCK(sc); + + *pin_value = pin_high ? GPIO_PIN_HIGH : GPIO_PIN_LOW; + + return (0); +} + +static int +chipc_gpio_pin_toggle(device_t dev, uint32_t pin_num) +{ + struct chipc_gpio_softc *sc; + bool pin_high; + int error; + + if (!CC_GPIO_VALID_PIN(pin_num)) + return (EINVAL); + + sc = device_get_softc(dev); + error = 0; + + CC_GPIO_LOCK(sc); + + switch (chipc_gpio_pin_get_mode(sc, pin_num)) { + case CC_GPIO_PIN_INPUT: + case CC_GPIO_PIN_TRISTATE: + error = ENODEV; + break; + + case CC_GPIO_PIN_OUTPUT: + pin_high = CC_GPIO_RDFLAG(sc, pin_num, GPIOOUT); + CC_GPIO_WRFLAG(sc, pin_num, GPIOOUT, !pin_high); + break; + } + + CC_GPIO_UNLOCK(sc); + + return (error); +} + +static int +chipc_gpio_pin_getcaps(device_t dev, uint32_t pin_num, uint32_t *caps) +{ + struct chipc_gpio_softc *sc = device_get_softc(dev); + + if (!CC_GPIO_VALID_PIN(pin_num)) + return (EINVAL); + + *caps = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_TRISTATE); + + if (!CC_GPIO_QUIRK(sc, NO_PULLUPDOWN)) + *caps |= (GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN); + + if (!CC_GPIO_QUIRK(sc, NO_DCTIMER)) + *caps |= GPIO_PIN_PULSATE; + + return (0); +} + +static int +chipc_gpio_pin_getflags(device_t dev, uint32_t pin_num, uint32_t *flags) +{ + struct chipc_gpio_softc *sc = device_get_softc(dev); + + if (!CC_GPIO_VALID_PIN(pin_num)) + return (EINVAL); + + CC_GPIO_LOCK(sc); + + switch (chipc_gpio_pin_get_mode(sc, pin_num)) { + case CC_GPIO_PIN_INPUT: + *flags = GPIO_PIN_INPUT; + + if (!CC_GPIO_QUIRK(sc, NO_PULLUPDOWN)) { + if (CC_GPIO_RDFLAG(sc, pin_num, GPIOPU)) { + *flags |= GPIO_PIN_PULLUP; + } else if (CC_GPIO_RDFLAG(sc, pin_num, GPIOPD)) { + *flags |= GPIO_PIN_PULLDOWN; + } + } + break; + + case CC_GPIO_PIN_OUTPUT: + *flags = GPIO_PIN_OUTPUT; + + if (!CC_GPIO_QUIRK(sc, NO_DCTIMER)) { + if (CC_GPIO_RDFLAG(sc, pin_num, GPIOTIMEROUTMASK)) + *flags |= GPIO_PIN_PULSATE; + } + + break; + + case CC_GPIO_PIN_TRISTATE: + *flags = GPIO_PIN_TRISTATE|GPIO_PIN_OUTPUT; + break; + } + + CC_GPIO_UNLOCK(sc); + + return (0); +} + +static int +chipc_gpio_pin_getname(device_t dev, uint32_t pin_num, char *name) +{ + int ret; + + if (!CC_GPIO_VALID_PIN(pin_num)) + return (EINVAL); + + ret = snprintf(name, GPIOMAXNAME, "bhnd_gpio%02" PRIu32, pin_num); + + if (ret < 0) + return (ENXIO); + + if (ret >= GPIOMAXNAME) + return (ENOMEM); + + return (0); +} + +static int +chipc_gpio_pin_setflags(device_t dev, uint32_t pin_num, uint32_t flags) +{ + struct chipc_gpio_softc *sc; + struct chipc_gpio_update upd; + int error; + + sc = device_get_softc(dev); + + if (!CC_GPIO_VALID_PIN(pin_num)) + return (EINVAL); + + /* Produce an update descriptor */ + memset(&upd, 0, sizeof(upd)); + if ((error = chipc_gpio_pin_update(sc, &upd, pin_num, flags))) + return (error); + + /* Commit the update */ + CC_GPIO_LOCK(sc); + error = chipc_gpio_commit_update(sc, &upd); + CC_GPIO_UNLOCK(sc); + + return (error); +} + +static int +chipc_gpio_pin_access_32(device_t dev, uint32_t first_pin, uint32_t clear_pins, + uint32_t change_pins, uint32_t *orig_pins) +{ + struct chipc_gpio_softc *sc; + struct chipc_gpio_update upd; + uint32_t out, outen, ctrl; + uint32_t num_pins; + int error; + + sc = device_get_softc(dev); + + if (first_pin >= CC_GPIO_NPINS) + return (EINVAL); + + /* Determine the actual number of referenced pins */ + if (clear_pins == 0 && change_pins == 0) { + num_pins = CC_GPIO_NPINS - first_pin; + } else { + int num_clear_pins, num_change_pins; + + num_clear_pins = flsl((u_long)clear_pins); + num_change_pins = flsl((u_long)change_pins); + num_pins = MAX(num_clear_pins, num_change_pins); + } + + /* Validate the full pin range */ + if (!CC_GPIO_VALID_PINS(first_pin, num_pins)) + return (EINVAL); + + /* Produce an update descriptor for all pins, relative to the current + * pin state */ + CC_GPIO_LOCK(sc); + memset(&upd, 0, sizeof(upd)); + + out = CC_GPIO_RD4(sc, CHIPC_GPIOOUT); + outen = CC_GPIO_RD4(sc, CHIPC_GPIOOUTEN); + ctrl = CC_GPIO_RD4(sc, CHIPC_GPIOCTRL); + + for (uint32_t i = 0; i < num_pins; i++) { + uint32_t pin; + bool pin_high; + + pin = first_pin + i; + + /* The pin must be configured for output */ + if ((outen & (1 << pin)) == 0) { + CC_GPIO_UNLOCK(sc); + return (EINVAL); + } + + /* The pin must not tristated */ + if ((ctrl & (1 << pin)) != 0) { + CC_GPIO_UNLOCK(sc); + return (EINVAL); + } + + /* Fetch current state */ + if (out & (1 << pin)) { + pin_high = true; + } else { + pin_high = false; + } + + /* Apply clear/toggle request */ + if (clear_pins & (1 << pin)) + pin_high = false; + + if (change_pins & (1 << pin)) + pin_high = !pin_high; + + /* Add to our update descriptor */ + CC_GPIO_UPDATE(&upd, pin, out, pin_high); + } + + /* Commit the update */ + error = chipc_gpio_commit_update(sc, &upd); + CC_GPIO_UNLOCK(sc); + + return (error); +} + +static int +chipc_gpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t num_pins, + uint32_t *pin_flags) +{ + struct chipc_gpio_softc *sc; + struct chipc_gpio_update upd; + int error; + + sc = device_get_softc(dev); + + if (!CC_GPIO_VALID_PINS(first_pin, num_pins)) + return (EINVAL); + + /* Produce an update descriptor */ + memset(&upd, 0, sizeof(upd)); + for (uint32_t i = 0; i < num_pins; i++) { + uint32_t pin, flags; + + pin = first_pin + i; + flags = pin_flags[i]; + + /* As per the gpio_config_32 API documentation, any pins for + * which neither GPIO_PIN_OUTPUT or GPIO_PIN_INPUT are set + * should be ignored and left unmodified */ + if ((flags & (GPIO_PIN_OUTPUT|GPIO_PIN_INPUT)) == 0) + continue; + + if ((error = chipc_gpio_pin_update(sc, &upd, pin, flags))) + return (error); + } + + /* Commit the update */ + CC_GPIO_LOCK(sc); + error = chipc_gpio_commit_update(sc, &upd); + CC_GPIO_UNLOCK(sc); + + return (error); +} + + +/** + * Commit a single @p reg register update. + */ +static void +chipc_gpio_commit_reg(struct chipc_gpio_softc *sc, bus_size_t offset, + struct chipc_gpio_reg *reg) +{ + uint32_t value; + + CC_GPIO_LOCK_ASSERT(sc, MA_OWNED); + + if (reg->mask == 0) + return; + + value = bhnd_bus_read_4(sc->mem_res, offset); + value &= ~reg->mask; + value |= reg->value; + + bhnd_bus_write_4(sc->mem_res, offset, value); +} + +/** + * Commit the set of GPIO register updates described by @p update. + */ +static int +chipc_gpio_commit_update(struct chipc_gpio_softc *sc, + struct chipc_gpio_update *update) +{ + CC_GPIO_LOCK_ASSERT(sc, MA_OWNED); + + /* Commit pulldown/pullup before potentially disabling an output pin */ + chipc_gpio_commit_reg(sc, CHIPC_GPIOPD, &update->pulldown); + chipc_gpio_commit_reg(sc, CHIPC_GPIOPU, &update->pullup); + + /* Commit output settings before potentially enabling an output pin */ + chipc_gpio_commit_reg(sc, CHIPC_GPIOTIMEROUTMASK, + &update->timeroutmask); + chipc_gpio_commit_reg(sc, CHIPC_GPIOOUT, &update->out); + + /* Commit input/output/tristate modes */ + chipc_gpio_commit_reg(sc, CHIPC_GPIOOUTEN, &update->outen); + chipc_gpio_commit_reg(sc, CHIPC_GPIOCTRL, &update->ctrl); + + return (0); +} + +/** + * Apply the changes described by @p flags for @p pin_num to the given @p update + * descriptor. + */ +static int +chipc_gpio_pin_update(struct chipc_gpio_softc *sc, + struct chipc_gpio_update *update, uint32_t pin_num, uint32_t flags) +{ + chipc_gpio_pin_mode mode; + int error; + + if (!CC_GPIO_VALID_PIN(pin_num)) + return (EINVAL); + + /* Verify flag compatibility and determine the pin mode */ + if ((error = chipc_gpio_check_flags(sc, pin_num, flags, &mode))) + return (error); + + /* Apply the mode-specific changes */ + switch (mode) { + case CC_GPIO_PIN_INPUT: + CC_GPIO_UPDATE(update, pin_num, pullup, false); + CC_GPIO_UPDATE(update, pin_num, pulldown, false); + CC_GPIO_UPDATE(update, pin_num, out, false); + CC_GPIO_UPDATE(update, pin_num, outen, false); + CC_GPIO_UPDATE(update, pin_num, timeroutmask, false); + CC_GPIO_UPDATE(update, pin_num, ctrl, false); + + if (flags & GPIO_PIN_PULLUP) { + CC_GPIO_UPDATE(update, pin_num, pullup, true); + } else if (flags & GPIO_PIN_PULLDOWN) { + CC_GPIO_UPDATE(update, pin_num, pulldown, true); + } + + return (0); + + case CC_GPIO_PIN_OUTPUT: + CC_GPIO_UPDATE(update, pin_num, pullup, false); + CC_GPIO_UPDATE(update, pin_num, pulldown, false); + CC_GPIO_UPDATE(update, pin_num, outen, true); + CC_GPIO_UPDATE(update, pin_num, timeroutmask, false); + CC_GPIO_UPDATE(update, pin_num, ctrl, false); + + if (flags & GPIO_PIN_PRESET_HIGH) { + CC_GPIO_UPDATE(update, pin_num, out, true); + } else if (flags & GPIO_PIN_PRESET_LOW) { + CC_GPIO_UPDATE(update, pin_num, out, false); + } + + if (flags & GPIO_PIN_PULSATE) + CC_GPIO_UPDATE(update, pin_num, timeroutmask, true); + + return (0); + + case CC_GPIO_PIN_TRISTATE: + CC_GPIO_UPDATE(update, pin_num, pullup, false); + CC_GPIO_UPDATE(update, pin_num, pulldown, false); + CC_GPIO_UPDATE(update, pin_num, out, false); + CC_GPIO_UPDATE(update, pin_num, outen, false); + CC_GPIO_UPDATE(update, pin_num, timeroutmask, false); + CC_GPIO_UPDATE(update, pin_num, ctrl, true); + + if (flags & GPIO_PIN_OUTPUT) + CC_GPIO_UPDATE(update, pin_num, outen, true); + + return (0); + } + + device_printf(sc->dev, "unknown pin mode %d\n", mode); + return (EINVAL); +} + +/** + * Verify that @p flags are valid for use with @p pin_num, and on success, + * return the pin mode described by @p flags in @p mode. + * + * @param sc GPIO driver instance state. + * @param pin_num The pin number to configure. + * @param flags The pin flags to be validated. + * @param[out] mode On success, will be populated with the GPIO pin mode + * defined by @p flags. + * + * @retval 0 success + * @retval EINVAL if @p flags are invalid. + */ +static int +chipc_gpio_check_flags(struct chipc_gpio_softc *sc, uint32_t pin_num, + uint32_t flags, chipc_gpio_pin_mode *mode) +{ + uint32_t mode_flag, input_flag, output_flag; + + CC_GPIO_ASSERT_VALID_PIN(sc, pin_num); + + mode_flag = flags & (GPIO_PIN_OUTPUT | GPIO_PIN_INPUT | + GPIO_PIN_TRISTATE); + output_flag = flags & (GPIO_PIN_PRESET_HIGH | GPIO_PIN_PRESET_LOW + | GPIO_PIN_PULSATE); + input_flag = flags & (GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN); + + switch (mode_flag) { + case GPIO_PIN_OUTPUT: + /* No input flag(s) should be set */ + if (input_flag != 0) + return (EINVAL); + + /* Validate our output flag(s) */ + switch (output_flag) { + case GPIO_PIN_PRESET_HIGH: + case GPIO_PIN_PRESET_LOW: + case (GPIO_PIN_PRESET_HIGH|GPIO_PIN_PULSATE): + case (GPIO_PIN_PRESET_LOW|GPIO_PIN_PULSATE): + case 0: + /* Check for unhandled flags */ + if ((flags & ~(mode_flag | output_flag)) != 0) + return (EINVAL); + + *mode = CC_GPIO_PIN_OUTPUT; + return (0); + + default: + /* Incompatible output flags */ + return (EINVAL); + } + + case GPIO_PIN_INPUT: + /* No output flag(s) should be set */ + if (output_flag != 0) + return (EINVAL); + + /* Validate our input flag(s) */ + switch (input_flag) { + case GPIO_PIN_PULLUP: + case GPIO_PIN_PULLDOWN: + case 0: + /* Check for unhandled flags */ + if ((flags & ~(mode_flag | input_flag)) != 0) + return (EINVAL); + + *mode = CC_GPIO_PIN_INPUT; + return (0); + + default: + /* Incompatible input flags */ + return (EINVAL); + } + + break; + + case (GPIO_PIN_TRISTATE|GPIO_PIN_OUTPUT): + case GPIO_PIN_TRISTATE: + /* No input or output flag(s) should be set */ + if (input_flag != 0 || output_flag != 0) + return (EINVAL); + + /* Check for unhandled flags */ + if ((flags & ~mode_flag) != 0) + return (EINVAL); + + *mode = CC_GPIO_PIN_TRISTATE; + return (0); + + default: + /* Incompatible mode flags */ + return (EINVAL); + } +} + +/** + * Return the current pin mode for @p pin_num. + * + * @param sc GPIO driver instance state. + * @param pin_num The pin number to query. + */ +static chipc_gpio_pin_mode +chipc_gpio_pin_get_mode(struct chipc_gpio_softc *sc, uint32_t pin_num) +{ + CC_GPIO_LOCK_ASSERT(sc, MA_OWNED); + CC_GPIO_ASSERT_VALID_PIN(sc, pin_num); + + if (CC_GPIO_RDFLAG(sc, pin_num, GPIOCTRL)) { + return (CC_GPIO_PIN_TRISTATE); + } else if (CC_GPIO_RDFLAG(sc, pin_num, GPIOOUTEN)) { + return (CC_GPIO_PIN_OUTPUT); + } else { + return (CC_GPIO_PIN_INPUT); + } +} + +static device_method_t chipc_gpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, chipc_gpio_probe), + DEVMETHOD(device_attach, chipc_gpio_attach), + DEVMETHOD(device_detach, chipc_gpio_detach), + + /* GPIO interface */ + DEVMETHOD(gpio_get_bus, chipc_gpio_get_bus), + DEVMETHOD(gpio_pin_max, chipc_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, chipc_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, chipc_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, chipc_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, chipc_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, chipc_gpio_pin_get), + DEVMETHOD(gpio_pin_set, chipc_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, chipc_gpio_pin_toggle), + DEVMETHOD(gpio_pin_access_32, chipc_gpio_pin_access_32), + DEVMETHOD(gpio_pin_config_32, chipc_gpio_pin_config_32), + + DEVMETHOD_END +}; + +static devclass_t gpio_devclass; + +DEFINE_CLASS_0(gpio, chipc_gpio_driver, chipc_gpio_methods, sizeof(struct chipc_gpio_softc)); +EARLY_DRIVER_MODULE(chipc_gpio, bhnd_chipc, chipc_gpio_driver, + gpio_devclass, NULL, NULL, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + +MODULE_DEPEND(chipc_gpio, bhnd, 1, 1, 1); +MODULE_DEPEND(chipc_gpio, gpiobus, 1, 1, 1); +MODULE_VERSION(chipc_gpio, 1); Added: head/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h Wed Nov 22 23:10:20 2017 (r326109) @@ -0,0 +1,161 @@ +/*- + * Copyright (c) 2017 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Landon Fuller under sponsorship from + * the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * 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$ + */ + +#ifndef _BHND_CORES_CHIPC_CHIPC_GPIOVAR_H_ +#define _BHND_CORES_CHIPC_CHIPC_GPIOVAR_H_ + +#include +#include + +#include +#include + +#include + +/** + * ChipCommon GPIO device quirks. + */ +enum { + /** + * No GPIO event support. + * + * The CHIPC_GPIOEVENT, CHIPC_GPIOEVENT_INTM, and + * CHIPC_GPIOEVENT_INTPOLARITY registers are not available. + */ + CC_GPIO_QUIRK_NO_EVENTS = (1<<0), + + /** + * No GPIO duty-cycle timer support. + * + * The CHIPC_GPIOTIMERVAL and CHIPC_GPIOTIMEROUTMASK registers are not + * available. + */ + CC_GPIO_QUIRK_NO_DCTIMER = (1<<1), + + /** + * No GPIO pull-up/pull-down configuration support. + * + * The CHIPC_GPIOPU and CHIPC_GPIOPD registers are not available. + */ + CC_GPIO_QUIRK_NO_PULLUPDOWN = (1<<2), + + /** + * Do not attach a child gpioc(4) device. + * + * This is primarily intended for use on bridged Wi-Fi adapters, where + * userspace modification of GPIO pin configuration could introduce + * significant undesirable behavior. + */ + CC_GPIO_QUIRK_NO_GPIOC = (1<<3), +}; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Nov 22 23:52: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 7B110DF8D35; Wed, 22 Nov 2017 23:52:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 555227097D; Wed, 22 Nov 2017 23:52:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAMNq5mK071789; Wed, 22 Nov 2017 23:52:05 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAMNq5Bh071788; Wed, 22 Nov 2017 23:52:05 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711222352.vAMNq5Bh071788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 22 Nov 2017 23:52:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326110 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 22 Nov 2017 23:52:06 -0000 Author: mjg Date: Wed Nov 22 23:52:05 2017 New Revision: 326110 URL: https://svnweb.freebsd.org/changeset/base/326110 Log: rwlock: don't check for curthread's read lock count in the fast path Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Nov 22 23:10:20 2017 (r326109) +++ head/sys/kern/kern_rwlock.c Wed Nov 22 23:52:05 2017 (r326110) @@ -364,12 +364,20 @@ _rw_wunlock_cookie(volatile uintptr_t *c, const char * * is unlocked and has no writer waiters or spinners. Failing otherwise * prioritizes writers before readers. */ -#define RW_CAN_READ(td, _rw) \ - (((_rw) & (RW_LOCK_READ | RW_LOCK_WRITE_WAITERS | RW_LOCK_WRITE_SPINNER)) ==\ - RW_LOCK_READ || ((td)->td_rw_rlocks && (_rw) & RW_LOCK_READ)) +static bool __always_inline +__rw_can_read(struct thread *td, uintptr_t v, bool fp) +{ + if ((v & (RW_LOCK_READ | RW_LOCK_WRITE_WAITERS | RW_LOCK_WRITE_SPINNER)) + == RW_LOCK_READ) + return (true); + if (!fp && td->td_rw_rlocks && (v & RW_LOCK_READ)) + return (true); + return (false); +} + static bool __always_inline -__rw_rlock_try(struct rwlock *rw, struct thread *td, uintptr_t *vp +__rw_rlock_try(struct rwlock *rw, struct thread *td, uintptr_t *vp, bool fp LOCK_FILE_LINE_ARG_DEF) { @@ -383,7 +391,7 @@ __rw_rlock_try(struct rwlock *rw, struct thread *td, u * completely unlocked rwlock since such a lock is encoded * as a read lock with no waiters. */ - while (RW_CAN_READ(td, *vp)) { + while (__rw_can_read(td, *vp, fp)) { if (atomic_fcmpset_acq_ptr(&rw->rw_lock, vp, *vp + RW_ONE_READER)) { if (LOCK_LOG_TEST(&rw->lock_object, 0)) @@ -452,7 +460,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, #endif for (;;) { - if (__rw_rlock_try(rw, td, &v LOCK_FILE_LINE_ARG)) + if (__rw_rlock_try(rw, td, &v, false LOCK_FILE_LINE_ARG)) break; #ifdef KDTRACE_HOOKS lda.spin_cnt++; @@ -492,7 +500,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, n = RW_READERS(v); lock_delay_spin(n); v = RW_READ_VALUE(rw); - if ((v & RW_LOCK_READ) == 0 || RW_CAN_READ(td, v)) + if ((v & RW_LOCK_READ) == 0 || __rw_can_read(td, v, false)) break; } #ifdef KDTRACE_HOOKS @@ -518,7 +526,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, * recheck its state and restart the loop if needed. */ v = RW_READ_VALUE(rw); - if (RW_CAN_READ(td, v)) { + if (__rw_can_read(td, v, false)) { turnstile_cancel(ts); continue; } @@ -630,7 +638,7 @@ __rw_rlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DE v = RW_READ_VALUE(rw); if (__predict_false(LOCKSTAT_OOL_PROFILE_ENABLED(rw__acquire) || - !__rw_rlock_try(rw, td, &v LOCK_FILE_LINE_ARG))) + !__rw_rlock_try(rw, td, &v, true LOCK_FILE_LINE_ARG))) __rw_rlock_hard(rw, td, v LOCK_FILE_LINE_ARG); LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line); From owner-svn-src-head@freebsd.org Thu Nov 23 03:16: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 051A6DBBA53 for ; Thu, 23 Nov 2017 03:16:12 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-pf0-x236.google.com (mail-pf0-x236.google.com [IPv6:2607:f8b0:400e:c00::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 C46EE78805 for ; Thu, 23 Nov 2017 03:16:11 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-pf0-x236.google.com with SMTP id t69so12944850pfg.4 for ; Wed, 22 Nov 2017 19:16:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=pEBKhBaJuDrXBmQlcSrharvfp0C6gSA1I2JMHtJT/Ks=; b=oOxlcf6bN6mxMSNgrZbdTK1TCwqWv+wT5hyshrao5Yknj4LcwhOjwRR39WmhOsXfkE /7mDX3Dfyfl83+D/1LAXxrQ8F1UROBbibQhp0aRiY02iY3uaCyA/UGFK0mEYiEckGFMy RFFKln51BTdudXehT0txvNE3AivMd0FuN7u7qrtcpQG2wKRMvPD9aB/FFQpSP+xgCvjE fov7tdOoKEik6D4O1f3DaXBRJYn17mOebpJFX7luD6rutLF7OprcWV//fVFikv5QS/eF hVDSoMjdfrb4kSa68cLqdkqCGeoUPH1dYp+0CuS+SvILNrS4bvhXuxZ3P8qjwFRPPDIh F2Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pEBKhBaJuDrXBmQlcSrharvfp0C6gSA1I2JMHtJT/Ks=; b=czIyjMAFIQM5JH6/mq4CCgltdsgpI0LlcXNFQEfg5MogqCDsGBwF/XggVe9g6HZhpA cao5WsFKIWcF2JmYPDgsgSiD4wuvvhlXbSnx7RASjvvtTkKTgDIFswsBA+gz5IyHR607 7zv5KdwAsDJj66r9ZX6Eksd7+yFaEV+qidorikkMyl4PirFoFhTE6Pyr/NUNkjRj2ijt M7EEVF3vhzKsNhRxw3Y2JoTxSsJsJjByI55YjCddEI0aIqGB8g6kE7wUGmtMLjTez+DG 4dtLErK/thMQYHiRiueLhS8aQSBUa2SKnnnElaDLR2R5SM3FfqjtWvHZ2sBrdYCfTe5N GqoA== X-Gm-Message-State: AJaThX7MYH//MZuHEaWOLIXEixTg54Oee5mgIc9RL3fTGC+1yXrnPnY7 mG34ALc0DXKa0hYw4BLHdhpICOwAH0B+RQ== X-Google-Smtp-Source: AGs4zMaZaTO056UfWWTJAwqj8pJldCLPmfyDg2ZZxYDe3TwjfRBSzgxPfCxlW3D7T33Cd47sdTqu1A== X-Received: by 10.98.133.65 with SMTP id u62mr21117000pfd.22.1511406970935; Wed, 22 Nov 2017 19:16:10 -0800 (PST) Received: from mutt-hbsd (62-210-37-82.rev.poneytelecom.eu. [62.210.37.82]) by smtp.gmail.com with ESMTPSA id t4sm27915954pfd.110.2017.11.22.19.16.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Nov 2017 19:16:10 -0800 (PST) Date: Wed, 22 Nov 2017 22:15:48 -0500 From: Shawn Webb To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326110 - head/sys/kern Message-ID: <20171123031548.rd5vmsgghsmuvjs4@mutt-hbsd> References: <201711222352.vAMNq5Bh071788@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cgmojfw26kqwmzra" Content-Disposition: inline In-Reply-To: <201711222352.vAMNq5Bh071788@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171027 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 03:16:12 -0000 --cgmojfw26kqwmzra Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 22, 2017 at 11:52:05PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Wed Nov 22 23:52:05 2017 > New Revision: 326110 > URL: https://svnweb.freebsd.org/changeset/base/326110 >=20 > Log: > rwlock: don't check for curthread's read lock count in the fast path >=20 > Modified: > head/sys/kern/kern_rwlock.c >=20 > Modified: head/sys/kern/kern_rwlock.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/kern_rwlock.c Wed Nov 22 23:10:20 2017 (r326109) > +++ head/sys/kern/kern_rwlock.c Wed Nov 22 23:52:05 2017 (r326110) > @@ -364,12 +364,20 @@ _rw_wunlock_cookie(volatile uintptr_t *c, const cha= r * > * is unlocked and has no writer waiters or spinners. Failing otherwise > * prioritizes writers before readers. > */ > -#define RW_CAN_READ(td, _rw) \ > - (((_rw) & (RW_LOCK_READ | RW_LOCK_WRITE_WAITERS | RW_LOCK_WRITE_SPIN= NER)) =3D=3D\ > - RW_LOCK_READ || ((td)->td_rw_rlocks && (_rw) & RW_LOCK_READ)) > +static bool __always_inline > +__rw_can_read(struct thread *td, uintptr_t v, bool fp) > +{ > =20 > + if ((v & (RW_LOCK_READ | RW_LOCK_WRITE_WAITERS | RW_LOCK_WRITE_SPINNER)) > + =3D=3D RW_LOCK_READ) > + return (true); > + if (!fp && td->td_rw_rlocks && (v & RW_LOCK_READ)) > + return (true); > + return (false); > +} This bit of the patch breaks buildkernel. You left a consumer of RW_CAN_READ on line 554: MPASS(!RW_CAN_READ(td, v)); Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --cgmojfw26kqwmzra Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAloWPWIACgkQaoRlj1JF bu5Lfg/9Fv0BENwM2MgPc7RQnzn9wvjQzFVWrXq+oWHZJ4SQtutULA6epLvX3psG JXt9HeOkPP5GqKA92LUO06kb9NAenZe8EsrkjL/J09KLVjS7Xa8qSw+B56uBIXeW kv1+ufv3uCN9Q4mxVbNmbwLryuwKKuZxSvIFjo2a+Zmu5G5dObF3w9JALl8K74KU cNQXlzaMQ8tLxRhtwaiGTSi7yB/pXdwg0B6WfLvLz5YVrH1XDkq7Zvl793bl+a7G O+TOF00R8vTYYb0KQpGQn8knfrTpdQc/5nDAnm4XoMtpl1/uW+3utcNqMGYd9Hbk vwPC9e4EOUZw1sVFzjDs0zRxuZ+7zQ6Dlo319gnM41RqPPyLH6HcrErNL3Fq5WPk 8f3lAyVU7TjUxztvzDpP1CZmYgLOBzi9gdK8byLiuQCBe7WqhE7ThXwrWaQHpYrs /s8jvdb5wGur3WFi1vXWHboxfIRI/tnv6c6QFt7fMVFUDa2pPC4I6d9u6bmI7eKM jBw126iBuum05yp8HARfoSDWkd89iZ9Wb1Y/sXhNQ3mnHkHdVVunZI26620ikvF3 yfHjXmHkY5kChpiJmJ+bOfjPQ0TLr6CR/S0clFfqvQUVNGBGxJ3ZceA+uLkgS4k+ VQ+liQ8q+x1y+KuHcN04ol271wmbnua7Wd4BsZQ7uBP5mID2QX4= =W5Wx -----END PGP SIGNATURE----- --cgmojfw26kqwmzra-- From owner-svn-src-head@freebsd.org Thu Nov 23 03:17: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 BDB84DBBC0E for ; Thu, 23 Nov 2017 03:17:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-pl0-x22d.google.com (mail-pl0-x22d.google.com [IPv6:2607:f8b0:400e:c01::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 7FD94789CE for ; Thu, 23 Nov 2017 03:17:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-pl0-x22d.google.com with SMTP id u14so1906831plm.8 for ; Wed, 22 Nov 2017 19:17:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xKSupK6nA7YuuHyNbvbLc3fVot5E0GGpvjRVTXk23Yo=; b=WxShROIeBGURzLqbofnybLIGkn9MJjqYUjqBKn4a7954+ModPL8qaG/IAv7yl3z7vo GCXTQHN2CMmhmvLRDI0TPefFS5L974K5o1YaDSs1UD+/KXzUamABg+swy0cQlvaskuwO yaDhjjLUcI3jQ5V2W+JWEIM70A37Wha7vNos/y2MLpQ5XBAI3NK5EmsZAvxlAdFkOlBb rn5udd5+Fp7i9jHg7YG1a4/DErFvKwpKNs6QBjZFuuYoUFn+9T/5W5MD+SSAX9pcll+1 Tuu6Pnfe2ue4ZB7eR1rvspBea/MKWQOoxjLzY+ohiaMXtRfljMTB1Zhv+87Otyn/Hh37 Ip9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xKSupK6nA7YuuHyNbvbLc3fVot5E0GGpvjRVTXk23Yo=; b=dgnNRDrssEXi/VLJJL/Pa6fAtUu6o6jYOCn9s39jEaZ/YOSKxKS7TncTpge5LEm9zk lgopPgzTvbZ+YkoFfj53vo/WiiDif3nmhSEKOzeQycIfuvFA3zMsQmS/aHc/2SS5aUm9 cQekDcMfHNgdnFwyB22um4BSYfyzc+MhZuGQKcjDYLnrBhE+aIsJ0pGB9KftF4DTXoHM kIEdQ/wPbP/AiIPpRUP56Tx/itI4+Uy/Be0adv3HbiX1isEVWj9LS4c1xgu7hdrC92NC RCF0TqDx0vMM1fCkZ2yPH+D7Zv8t0lHJZ5dXFoCP16X/TkeirAjjHpznl6IklizPnVK2 T8sg== X-Gm-Message-State: AJaThX54tLYMEAtINCFvdrSqjw1SpngsO4Db1i57Hw4tIXPjVW3lJyAQ n/cV57n3o61QWXhyD3ntZXtrZw== X-Google-Smtp-Source: AGs4zMYaObV/U6D4Le0fdYlVhX3HTySEvzpC5dJSwr8ilTChUkIWJgH5u6yBLPHWUjGUcTWYgK4O6A== X-Received: by 10.84.237.9 with SMTP id s9mr23075524plk.417.1511407063895; Wed, 22 Nov 2017 19:17:43 -0800 (PST) Received: from mutt-hbsd (62-210-37-82.rev.poneytelecom.eu. [62.210.37.82]) by smtp.gmail.com with ESMTPSA id r18sm27156241pge.87.2017.11.22.19.17.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 22 Nov 2017 19:17:43 -0800 (PST) Date: Wed, 22 Nov 2017 22:17:20 -0500 From: Shawn Webb To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326107 - in head/sys: kern sys Message-ID: <20171123031720.4iyoyvfyhxsltexw@mutt-hbsd> References: <201711222204.vAMM44FW023951@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7nc7fposwnz2k7e7" Content-Disposition: inline In-Reply-To: <201711222204.vAMM44FW023951@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171027 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 03:17:44 -0000 --7nc7fposwnz2k7e7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 22, 2017 at 10:04:04PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Wed Nov 22 22:04:04 2017 > New Revision: 326107 > URL: https://svnweb.freebsd.org/changeset/base/326107 >=20 > Log: > locks: pass the found lock value to unlock slow path > =20 > This avoids an explicit read later. > =20 > While here whack the cheaply obtainable 'tid' argument. >=20 > Modified: > head/sys/kern/kern_mutex.c > head/sys/kern/kern_rwlock.c > head/sys/kern/kern_sx.c > head/sys/sys/mutex.h > head/sys/sys/rwlock.h > head/sys/sys/sx.h This breaks ZFS: https://gist.github.com/lattera/93faa9c47ccc985ebda039ab31641c2c Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --7nc7fposwnz2k7e7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAloWPb8ACgkQaoRlj1JF bu6J6xAAhjqzFF2CmV8RRbER7RU4kVeD0YwC71Loet/c7wwA2bX6eJWgBz3fT15Q qHdCWqo5lLwBg12ifF0eU05INH/9NpN9SPYPJ6e7ZUD4Z1anzMFggdmqak6Ku0nM TKS4bPwJGKSk9ndOhmf/NqnyfAikrA+mVsgGAVelzn6xBWC7gdNXWAS3p70/ddtP fpG1dFzXdWC3dfp4fghs2t8kzqFRQ0c5MZy1FobMv3Q8Qr4GA0yPBd8whHyaQvo/ euwo053hMZmPmKwXi6hAP215gv9573BByFWpa2+LLyhJhB16OwvFDpbffut0Ylws JCrkxxOGPVGhxVvxe9oXRYFHbPZgP3/T0IehTE+oEfHctJDBedhP2CWb+VD4cRrN GCEVFzGofyZaDl51sf2jwSqWesNcIukicfhuHjyB1VPEx50mCxYq1KgGAg1aaSRO zORmmK/AC1Q0sWA21WrAEikt5hVQCQQb1t5qr/QiOoCSuX5Om7UPmLfSefoiirbU RAZ4AbRrszCA8eEGGF+UVxHHO59dyBFemTMM4SBhJDTLBMMfG4XFkERVeW916Hld PQCJvQflhSMAJZwZUGMyZNu3O7z4GSh3XU8OCMd+mQ3lZJ+uPlG6/5XZVOGsqNaf Wd2gWUiqOXXrr5uCJBKqPaEB04KFKh85fqVOkGX4Fps4WlSS6y8= =+HQZ -----END PGP SIGNATURE----- --7nc7fposwnz2k7e7-- From owner-svn-src-head@freebsd.org Thu Nov 23 03:20: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 DBDD8DBBE0A; Thu, 23 Nov 2017 03:20:13 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A676F78BAC; Thu, 23 Nov 2017 03:20:13 +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 vAN3KCW9056886; Thu, 23 Nov 2017 03:20:12 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAN3KCfA056885; Thu, 23 Nov 2017 03:20:12 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711230320.vAN3KCfA056885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 23 Nov 2017 03:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326111 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 03:20:14 -0000 Author: mjg Date: Thu Nov 23 03:20:12 2017 New Revision: 326111 URL: https://svnweb.freebsd.org/changeset/base/326111 Log: rwlock: unbreak WITNESS builds after r326110 Reported by: Shawn Webb Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Wed Nov 22 23:52:05 2017 (r326110) +++ head/sys/kern/kern_rwlock.c Thu Nov 23 03:20:12 2017 (r326111) @@ -551,7 +551,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, /* * The lock is held in write mode or it already has waiters. */ - MPASS(!RW_CAN_READ(td, v)); + MPASS(!__rw_can_read(td, v, false)); /* * If the RW_LOCK_READ_WAITERS flag is already set, then From owner-svn-src-head@freebsd.org Thu Nov 23 03:40: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 6C70EDC0E7C; Thu, 23 Nov 2017 03:40:52 +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 38E1D79767; Thu, 23 Nov 2017 03:40:52 +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 vAN3epLn064989; Thu, 23 Nov 2017 03:40:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAN3ep39064988; Thu, 23 Nov 2017 03:40:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711230340.vAN3ep39064988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Thu, 23 Nov 2017 03:40:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326112 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 03:40:52 -0000 Author: mjg Date: Thu Nov 23 03:40:51 2017 New Revision: 326112 URL: https://svnweb.freebsd.org/changeset/base/326112 Log: sx: unbreak debug after r326107 An assertion was modified to use the found value, but it was not updated to handle a race where blocked threads appear after the entrance to the func. Move the assertion down to the area protected with sleepq lock where the lock is read anyway. This does not affect coverage of the assertion and is consistent with what rw locks are doing. Reported by: Shawn Webb Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Thu Nov 23 03:20:12 2017 (r326111) +++ head/sys/kern/kern_sx.c Thu Nov 23 03:40:51 2017 (r326112) @@ -828,12 +828,12 @@ _sx_xunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_ atomic_cmpset_rel_ptr(&sx->sx_lock, tid, SX_LOCK_UNLOCKED)) return; - MPASS(x & (SX_LOCK_SHARED_WAITERS | SX_LOCK_EXCLUSIVE_WAITERS)); if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p contested", __func__, sx); sleepq_lock(&sx->lock_object); x = SX_READ_VALUE(sx); + MPASS(x & (SX_LOCK_SHARED_WAITERS | SX_LOCK_EXCLUSIVE_WAITERS)); /* * The wake up algorithm here is quite simple and probably not From owner-svn-src-head@freebsd.org Thu Nov 23 03:41: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 D7478DC0EF7; Thu, 23 Nov 2017 03:41:39 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x234.google.com (mail-qt0-x234.google.com [IPv6:2607:f8b0:400d:c0d::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 8E8537994B; Thu, 23 Nov 2017 03:41:39 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x234.google.com with SMTP id w10so14442491qtb.10; Wed, 22 Nov 2017 19:41:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=048jiexJCgnSc6gjTqE9KfQk/odWOuXN3nw1FC2nfmQ=; b=HJXZurpYvnTtlGy5JrUfZJ6CFliPiXIG8z6rhPzjLxQGQjRQBWff+56plb1fSdafsS rZcCdO+VkjuL5diVOE5+MXboUYSYcAVcn6ZuiIRjNMHG+8rb4VZCz24XN4n1ENojxdmd 0L6uTnnnds/Gr/djPc0wUjggEH7b+H6VQMi/ZE5R2YWeSEgBOk5oR8wR/w52rKNOu7E3 +Nuw7LPeUvkR0ryQjdSVmMNkOObdUhpY4EGjzRv2HHnVzA2BOkkjfJHBgaqcAzl1kzA6 QWVtDtPrPCWcwvmfszgceXKeRTyuUiVbG4HYMnpq+zsVWVF9kKu3mP4fd4W7A0pswsUU zuGA== 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=048jiexJCgnSc6gjTqE9KfQk/odWOuXN3nw1FC2nfmQ=; b=acZ8sQUGNW+57DShMf2FEx714BXh+XJfabGH4WPLkhOCVdzg943uucjTFwx3CkycN2 I4qEC2GIWQnCaHx6DraQoNDzN15y4wcO++5Vn1gHRjJteafLtqQtC+x6WukiUUNvPHAH rR+e1S1kHPa3yckx/QxqlWzUVLj/YKfOKVJ2b9AL0+ijaleiDOYruiNhegJi7M11R4vT ZSMr+YiZwokxUNtfL4HuKEBIlU3wWESKxzm3FeC2PrkTZGXVjs48NQXBMhUOBK15dQVY 7DOp28Zi254kA/7FNlEU1gplpOFUmWLrVuetPQhVt/xydSWxx1DgCPVjPyPDheeyuATl bmcQ== X-Gm-Message-State: AJaThX6hOR5+rYCxYBudyQV1kHknYeghvbq+wRyERlEL4zLIuUa/mZEW v94CtAsQE3WRcO4wvR2YepQSHgk2DfBVIUyxo00xEQ== X-Google-Smtp-Source: AGs4zMayVyexiWc+pf/DuZNrke5YFmR1tDRaG162AJ1HzGY1iAkh9jNJ82WnP3++2ztFcdCszgsSbCzf60DVEX7ab64= X-Received: by 10.200.23.61 with SMTP id w58mr1609978qtj.341.1511408498610; Wed, 22 Nov 2017 19:41:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.54.106 with HTTP; Wed, 22 Nov 2017 19:41:38 -0800 (PST) In-Reply-To: <20171123031720.4iyoyvfyhxsltexw@mutt-hbsd> References: <201711222204.vAMM44FW023951@repo.freebsd.org> <20171123031720.4iyoyvfyhxsltexw@mutt-hbsd> From: Mateusz Guzik Date: Thu, 23 Nov 2017 04:41:38 +0100 Message-ID: Subject: Re: svn commit: r326107 - in head/sys: kern sys To: Shawn Webb 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.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 03:41:39 -0000 oops, fixed in r326107 On Thu, Nov 23, 2017 at 4:17 AM, Shawn Webb wrote: > On Wed, Nov 22, 2017 at 10:04:04PM +0000, Mateusz Guzik wrote: > > Author: mjg > > Date: Wed Nov 22 22:04:04 2017 > > New Revision: 326107 > > URL: https://svnweb.freebsd.org/changeset/base/326107 > > > > Log: > > locks: pass the found lock value to unlock slow path > > > > This avoids an explicit read later. > > > > While here whack the cheaply obtainable 'tid' argument. > > > > Modified: > > head/sys/kern/kern_mutex.c > > head/sys/kern/kern_rwlock.c > > head/sys/kern/kern_sx.c > > head/sys/sys/mutex.h > > head/sys/sys/rwlock.h > > head/sys/sys/sx.h > > This breaks ZFS: > https://gist.github.com/lattera/93faa9c47ccc985ebda039ab31641c2c > > Thanks, > > -- > Shawn Webb > Cofounder and Security Engineer > HardenedBSD > > GPG Key ID: 0x6A84658F52456EEE > GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE > -- Mateusz Guzik From owner-svn-src-head@freebsd.org Thu Nov 23 05:43: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 3DC82DDD667; Thu, 23 Nov 2017 05:43:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 151687CD54; Thu, 23 Nov 2017 05:43:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAN5hjV3018521; Thu, 23 Nov 2017 05:43:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAN5hjFJ018519; Thu, 23 Nov 2017 05:43:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201711230543.vAN5hjFJ018519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 23 Nov 2017 05:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326113 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 326113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 05:43:46 -0000 Author: kevans Date: Thu Nov 23 05:43:44 2017 New Revision: 326113 URL: https://svnweb.freebsd.org/changeset/base/326113 Log: aw_ccung: changes to accommodate upcoming a83t support Add a means to specify mask/value for the prediv condition instead of shift/width/value for clocks that have a more complex mux scenario. Specifically, ahb1 on the a83t has the prediv applied if mux is either b10 or b11. Reviewed by: manu Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12851 Modified: head/sys/arm/allwinner/clkng/aw_clk.h head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c Modified: head/sys/arm/allwinner/clkng/aw_clk.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk.h Thu Nov 23 03:40:51 2017 (r326112) +++ head/sys/arm/allwinner/clkng/aw_clk.h Thu Nov 23 05:43:44 2017 (r326113) @@ -48,6 +48,7 @@ Periph clocks: Clock Source/Divider N/Divider M Clock Source/Divider N/Divider M/2 +Clock Source*N/(Divider M+1)/(Divider P+1) */ @@ -389,6 +390,36 @@ aw_clk_factor_get_value(struct aw_clk_factor *factor, .prediv.flags = _prediv_flags, \ .prediv.cond_shift = _prediv_cond_shift, \ .prediv.cond_width = _prediv_cond_width, \ + .prediv.cond_value = _prediv_cond_value, \ + } + +#define PREDIV_CLK_WITH_MASK(_clkname, _id, _name, _pnames, \ + _offset, \ + _mux_shift, _mux_width, \ + _div_shift, _div_width, _div_value, _div_flags, \ + _prediv_shift, _prediv_width, _prediv_value, _prediv_flags, \ + _prediv_cond_mask, _prediv_cond_value) \ + static struct aw_clk_prediv_mux_def _clkname = { \ + .clkdef = { \ + .id = _id, \ + .name = _name, \ + .parent_names = _pnames, \ + .parent_cnt = nitems(_pnames), \ + }, \ + .offset = _offset, \ + .mux_shift = _mux_shift, \ + .mux_width = _mux_width, \ + .div.shift = _div_shift, \ + .div.width = _div_width, \ + .div.value = _div_value, \ + .div.flags = _div_flags, \ + .prediv.shift = _prediv_shift, \ + .prediv.width = _prediv_width, \ + .prediv.value = _prediv_value, \ + .prediv.flags = _prediv_flags, \ + .prediv.cond_shift = 0, \ + .prediv.cond_width = 0, \ + .prediv.cond_mask = _prediv_cond_mask, \ .prediv.cond_value = _prediv_cond_value, \ } Modified: head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c Thu Nov 23 03:40:51 2017 (r326112) +++ head/sys/arm/allwinner/clkng/aw_clk_prediv_mux.c Thu Nov 23 05:43:44 2017 (r326113) @@ -157,7 +157,10 @@ aw_clk_prediv_mux_register(struct clkdom *clkdom, stru sc->prediv.mask = ((1 << clkdef->prediv.width) - 1) << sc->prediv.shift; sc->prediv.value = clkdef->prediv.value; sc->prediv.cond_shift = clkdef->prediv.cond_shift; - sc->prediv.cond_mask = ((1 << clkdef->prediv.cond_width) - 1) << sc->prediv.shift; + if (clkdef->prediv.cond_width != 0) + sc->prediv.cond_mask = ((1 << clkdef->prediv.cond_width) - 1) << sc->prediv.shift; + else + sc->prediv.cond_mask = clkdef->prediv.cond_mask; sc->prediv.cond_value = clkdef->prediv.cond_value; sc->prediv.flags = clkdef->prediv.flags; From owner-svn-src-head@freebsd.org Thu Nov 23 05:54: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 5BF36DDDC17; Thu, 23 Nov 2017 05:54:06 +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 0CA397D366; Thu, 23 Nov 2017 05:54:05 +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 vAN5s5VE022911; Thu, 23 Nov 2017 05:54:05 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAN5s56r022908; Thu, 23 Nov 2017 05:54:05 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201711230554.vAN5s56r022908@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 23 Nov 2017 05:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326114 - in head/sys/arm/allwinner: a83t clkng X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/arm/allwinner: a83t clkng X-SVN-Commit-Revision: 326114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 05:54:06 -0000 Author: kevans Date: Thu Nov 23 05:54:04 2017 New Revision: 326114 URL: https://svnweb.freebsd.org/changeset/base/326114 Log: Allwinner a83t: add ccung bits Upstream DTS has switched to using CCU rather than /clocks nodes. Add a CCU driver for the a83t to bring us closer to upstream, but don't yet attach it to ccu node. Reviewed by: manu Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D12843 Added: head/sys/arm/allwinner/clkng/ccu_a83t.c (contents, props changed) head/sys/arm/allwinner/clkng/ccu_a83t.h (contents, props changed) Modified: head/sys/arm/allwinner/a83t/files.a83t Modified: head/sys/arm/allwinner/a83t/files.a83t ============================================================================== --- head/sys/arm/allwinner/a83t/files.a83t Thu Nov 23 05:43:44 2017 (r326113) +++ head/sys/arm/allwinner/a83t/files.a83t Thu Nov 23 05:54:04 2017 (r326114) @@ -1,4 +1,5 @@ # $FreeBSD$ +arm/allwinner/clkng/ccu_a83t.c standard arm/allwinner/a83t/a83t_padconf.c standard arm/allwinner/a83t/a83t_r_padconf.c standard Added: head/sys/arm/allwinner/clkng/ccu_a83t.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/ccu_a83t.c Thu Nov 23 05:54:04 2017 (r326114) @@ -0,0 +1,779 @@ +/*- + * Copyright (c) 2017 Kyle Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "ccu_a83t.h" + +/* Non-exported resets */ +/* +#define RST_BUS_SCR 53 +*/ + +/* Non-exported clocks */ + +#define CLK_PLL_C0CPUX 0 +#define CLK_PLL_C1CPUX 1 +#define CLK_PLL_AUDIO 2 +#define CLK_PLL_VIDEO0 3 +#define CLK_PLL_VE 4 +#define CLK_PLL_DDR 5 + +#define CLK_PLL_GPU 7 +#define CLK_PLL_HSIC 8 +#define CLK_PLL_VIDEO1 10 + +#define CLK_AXI0 13 +#define CLK_AXI1 14 +#define CLK_AHB1 15 +#define CLK_APB1 16 +#define CLK_APB2 17 +#define CLK_AHB2 18 + +#define CLK_CCI400 58 + +#define CLK_DRAM 82 + +#define CLK_MBUS 95 + +/* Non-exported fixed clocks */ +#define CLK_OSC_12M 150 + + +static struct aw_ccung_reset a83t_ccu_resets[] = { + CCU_RESET(RST_USB_PHY0, 0xcc, 0) + CCU_RESET(RST_USB_PHY1, 0xcc, 1) + CCU_RESET(RST_USB_HSIC, 0xcc, 2) + + CCU_RESET(RST_DRAM, 0xf4, 31) + CCU_RESET(RST_MBUS, 0xfc, 31) + + CCU_RESET(RST_BUS_MIPI_DSI, 0x2c0, 1) + CCU_RESET(RST_BUS_SS, 0x2c0, 5) + CCU_RESET(RST_BUS_DMA, 0x2c0, 6) + CCU_RESET(RST_BUS_MMC0, 0x2c0, 8) + CCU_RESET(RST_BUS_MMC1, 0x2c0, 9) + CCU_RESET(RST_BUS_MMC2, 0x2c0, 10) + CCU_RESET(RST_BUS_NAND, 0x2c0, 13) + CCU_RESET(RST_BUS_DRAM, 0x2c0, 14) + CCU_RESET(RST_BUS_EMAC, 0x2c0, 17) + CCU_RESET(RST_BUS_HSTIMER, 0x2c0, 19) + CCU_RESET(RST_BUS_SPI0, 0x2c0, 20) + CCU_RESET(RST_BUS_SPI1, 0x2c0, 21) + CCU_RESET(RST_BUS_OTG, 0x2c0, 24) + CCU_RESET(RST_BUS_EHCI0, 0x2c0, 26) + CCU_RESET(RST_BUS_EHCI1, 0x2c0, 27) + CCU_RESET(RST_BUS_OHCI0, 0x2c0, 29) + + CCU_RESET(RST_BUS_VE, 0x2c4, 0) + CCU_RESET(RST_BUS_TCON0, 0x2c4, 4) + CCU_RESET(RST_BUS_TCON1, 0x2c4, 5) + CCU_RESET(RST_BUS_CSI, 0x2c4, 8) + CCU_RESET(RST_BUS_HDMI0, 0x2c4, 10) + CCU_RESET(RST_BUS_HDMI1, 0x2c4, 11) + CCU_RESET(RST_BUS_DE, 0x2c4, 12) + CCU_RESET(RST_BUS_GPU, 0x2c4, 20) + CCU_RESET(RST_BUS_MSGBOX, 0x2c4, 21) + CCU_RESET(RST_BUS_SPINLOCK, 0x2c4, 22) + + CCU_RESET(RST_BUS_LVDS, 0x2c8, 0) + + CCU_RESET(RST_BUS_SPDIF, 0x2d0, 1) + CCU_RESET(RST_BUS_I2S0, 0x2d0, 12) + CCU_RESET(RST_BUS_I2S1, 0x2d0, 13) + CCU_RESET(RST_BUS_I2S2, 0x2d0, 14) + CCU_RESET(RST_BUS_TDM, 0x2d0, 15) + + CCU_RESET(RST_BUS_I2C0, 0x2d8, 0) + CCU_RESET(RST_BUS_I2C1, 0x2d8, 1) + CCU_RESET(RST_BUS_I2C2, 0x2d8, 2) + CCU_RESET(RST_BUS_UART0, 0x2d8, 16) + CCU_RESET(RST_BUS_UART1, 0x2d8, 17) + CCU_RESET(RST_BUS_UART2, 0x2d8, 18) + CCU_RESET(RST_BUS_UART3, 0x2d8, 19) + CCU_RESET(RST_BUS_UART4, 0x2d8, 20) +}; + +static struct aw_ccung_gate a83t_ccu_gates[] = { + CCU_GATE(CLK_BUS_MIPI_DSI, "bus-mipi-dsi", "ahb1", 0x60, 1) + CCU_GATE(CLK_BUS_SS, "bus-ss", "ahb1", 0x60, 5) + CCU_GATE(CLK_BUS_DMA, "bus-dma", "ahb1", 0x60, 6) + CCU_GATE(CLK_BUS_MMC0, "bus-mmc0", "ahb1", 0x60, 8) + CCU_GATE(CLK_BUS_MMC1, "bus-mmc1", "ahb1", 0x60, 9) + CCU_GATE(CLK_BUS_MMC2, "bus-mmc2", "ahb1", 0x60, 10) + CCU_GATE(CLK_BUS_NAND, "bus-nand", "ahb1", 0x60, 13) + CCU_GATE(CLK_BUS_DRAM, "bus-dram", "ahb1", 0x60, 14) + CCU_GATE(CLK_BUS_EMAC, "bus-emac", "ahb1", 0x60, 17) + CCU_GATE(CLK_BUS_HSTIMER, "bus-hstimer", "ahb1", 0x60, 19) + CCU_GATE(CLK_BUS_SPI0, "bus-spi0", "ahb1", 0x60, 20) + CCU_GATE(CLK_BUS_SPI1, "bus-spi1", "ahb1", 0x60, 21) + CCU_GATE(CLK_BUS_OTG, "bus-otg", "ahb1", 0x60, 24) + CCU_GATE(CLK_BUS_EHCI0, "bus-ehci0", "ahb2", 0x60, 26) + CCU_GATE(CLK_BUS_EHCI1, "bus-ehci1", "ahb2", 0x60, 27) + CCU_GATE(CLK_BUS_OHCI0, "bus-ohci0", "ahb2", 0x60, 29) + + CCU_GATE(CLK_BUS_VE, "bus-ve", "ahb1", 0x64, 0) + CCU_GATE(CLK_BUS_TCON0, "bus-tcon0", "ahb1", 0x64, 4) + CCU_GATE(CLK_BUS_TCON1, "bus-tcon1", "ahb1", 0x64, 5) + CCU_GATE(CLK_BUS_CSI, "bus-csi", "ahb1", 0x64, 8) + CCU_GATE(CLK_BUS_HDMI, "bus-hdmi", "ahb1", 0x64, 11) + CCU_GATE(CLK_BUS_DE, "bus-de", "ahb1", 0x64, 12) + CCU_GATE(CLK_BUS_GPU, "bus-gpu", "ahb1", 0x64, 20) + CCU_GATE(CLK_BUS_MSGBOX, "bus-msgbox", "ahb1", 0x64, 21) + CCU_GATE(CLK_BUS_SPINLOCK, "bus-spinlock", "ahb1", 0x64, 22) + + CCU_GATE(CLK_BUS_SPDIF, "bus-spdif", "apb1", 0x68, 1) + CCU_GATE(CLK_BUS_PIO, "bus-pio", "apb1", 0x68, 5) + CCU_GATE(CLK_BUS_I2S0, "bus-i2s0", "apb1", 0x68, 12) + CCU_GATE(CLK_BUS_I2S1, "bus-i2s1", "apb1", 0x68, 13) + CCU_GATE(CLK_BUS_I2S2, "bus-i2s2", "apb1", 0x68, 14) + CCU_GATE(CLK_BUS_TDM, "bus-tdm", "apb1", 0x68, 15) + + CCU_GATE(CLK_BUS_I2C0, "bus-i2c0", "apb2", 0x6c, 0) + CCU_GATE(CLK_BUS_I2C1, "bus-i2c1", "apb2", 0x6c, 1) + CCU_GATE(CLK_BUS_I2C2, "bus-i2c2", "apb2", 0x6c, 2) + CCU_GATE(CLK_BUS_UART0, "bus-uart0", "apb2", 0x6c, 16) + CCU_GATE(CLK_BUS_UART1, "bus-uart1", "apb2", 0x6c, 17) + CCU_GATE(CLK_BUS_UART2, "bus-uart2", "apb2", 0x6c, 18) + CCU_GATE(CLK_BUS_UART3, "bus-uart3", "apb2", 0x6c, 19) + CCU_GATE(CLK_BUS_UART4, "bus-uart4", "apb2", 0x6c, 20) + + CCU_GATE(CLK_USB_PHY0, "usb-phy0", "osc24M", 0xcc, 8) + CCU_GATE(CLK_USB_PHY1, "usb-phy1", "osc24M", 0xcc, 9) + CCU_GATE(CLK_USB_HSIC, "usb-hsic", "pll_hsic", 0xcc, 10) + CCU_GATE(CLK_USB_HSIC_12M, "usb-hsic-12M", "osc12M", 0xcc, 11) + CCU_GATE(CLK_USB_OHCI0, "usb-ohci0", "osc12M", 0xcc, 16) + + CCU_GATE(CLK_DRAM_VE, "dram-ve", "dram", 0x100, 0) + CCU_GATE(CLK_DRAM_CSI, "dram-csi", "dram", 0x100, 1) + + CCU_GATE(CLK_CSI_MISC, "csi-misc", "osc24M", 0x130, 16) + CCU_GATE(CLK_MIPI_CSI, "mipi-csi", "osc24M", 0x130, 31) + + CCU_GATE(CLK_AVS, "avs", "osc24M", 0x144, 31) + + CCU_GATE(CLK_HDMI_SLOW, "hdmi-ddc", "osc24M", 0x154, 31) +}; + +static const char *osc12m_parents[] = {"osc24M"}; +FIXED_CLK(osc12m_clk, + CLK_OSC_12M, /* id */ + "osc12M", osc12m_parents, /* name, parents */ + 0, /* freq */ + 1, /* mult */ + 2, /* div */ + 0); /* flags */ + +static const char *pll_c0cpux_parents[] = {"osc24M"}; +static const char *pll_c1cpux_parents[] = {"osc24M"}; +NM_CLK(pll_c0cpux_clk, + CLK_PLL_C0CPUX, /* id */ + "pll_c0cpux", pll_c0cpux_parents, /* name, parents */ + 0x00, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_SCALE_CHANGE); /* flags */ +NM_CLK(pll_c1cpux_clk, + CLK_PLL_C1CPUX, /* id */ + "pll_c1cpux", pll_c1cpux_parents, /* name, parents */ + 0x04, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* m factor (fake) */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_SCALE_CHANGE); /* flags */ + +static const char *pll_audio_parents[] = {"osc24M"}; +NKMP_CLK(pll_audio_clk, + CLK_PLL_AUDIO, /* id */ + "pll_audio", pll_audio_parents, /* name, parents */ + 0x08, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 16, 1, 0, 0, /* m factor */ + 18, 1, 0, 0, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *pll_video0_parents[] = {"osc24M"}; +NKMP_CLK(pll_video0_clk, + CLK_PLL_VIDEO0, /* id */ + "pll_video0", pll_video0_parents, /* name, parents */ + 0x10, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 16, 1, 0, 0, /* m factor */ + 0, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *pll_ve_parents[] = {"osc24M"}; +NKMP_CLK(pll_ve_clk, + CLK_PLL_VE, /* id */ + "pll_ve", pll_ve_parents, /* name, parents */ + 0x18, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 16, 1, 0, 0, /* m factor */ + 18, 1, 0, 0, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *pll_ddr_parents[] = {"osc24M"}; +NKMP_CLK(pll_ddr_clk, + CLK_PLL_DDR, /* id */ + "pll_ddr", pll_ddr_parents, /* name, parents */ + 0x20, /* offset */ + 8, 5, 0, 0, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 16, 1, 0, 0, /* m factor */ + 18, 1, 0, 0, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *pll_periph_parents[] = {"osc24M"}; +NKMP_CLK(pll_periph_clk, + CLK_PLL_PERIPH, /* id */ + "pll_periph", pll_periph_parents, /* name, parents */ + 0x28, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 16, 1, 1, 0, /* m factor */ + 18, 1, 1, 0, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *pll_gpu_parents[] = {"osc24M"}; +NKMP_CLK(pll_gpu_clk, + CLK_PLL_GPU, /* id */ + "pll_gpu", pll_gpu_parents, /* name, parents */ + 0x38, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 16, 1, 1, 0, /* m factor */ + 18, 1, 1, 0, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *pll_hsic_parents[] = {"osc24M"}; +NKMP_CLK(pll_hsic_clk, + CLK_PLL_HSIC, /* id */ + "pll_hsic", pll_hsic_parents, /* name, parents */ + 0x44, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 16, 1, 1, 0, /* m factor */ + 18, 1, 1, 0, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *pll_de_parents[] = {"osc24M"}; +NKMP_CLK(pll_de_clk, + CLK_PLL_DE, /* id */ + "pll_de", pll_de_parents, /* name, parents */ + 0x48, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 16, 1, 1, 0, /* m factor */ + 18, 1, 1, 0, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *pll_video1_parents[] = {"osc24M"}; +NKMP_CLK(pll_video1_clk, + CLK_PLL_VIDEO1, /* id */ + "pll_video1", pll_video1_parents, /* name, parents */ + 0x4c, /* offset */ + 8, 8, 0, AW_CLK_FACTOR_ZERO_BASED, /* n factor */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* k factor (fake) */ + 16, 1, 1, 0, /* m factor */ + 0, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* p factor */ + 31, /* gate */ + 0, 0, /* lock */ + AW_CLK_HAS_GATE); /* flags */ + +static const char *c0cpux_parents[] = {"osc24M", "pll_c0cpux"}; +MUX_CLK(c0cpux_clk, + CLK_C0CPUX, /* id */ + "c0cpux", c0cpux_parents, /* name, parents */ + 0x50, 12, 1); /* offset, shift, width */ + +static const char *c1cpux_parents[] = {"osc24M", "pll_c1cpux"}; +MUX_CLK(c1cpux_clk, + CLK_C1CPUX, /* id */ + "c1cpux", c1cpux_parents, /* name, parents */ + 0x50, 28, 1); /* offset, shift, width */ + +static const char *axi0_parents[] = {"c0cpux"}; +DIV_CLK(axi0_clk, + CLK_AXI0, /* id */ + "axi0", axi0_parents, /* name, parents */ + 0x50, /* offset */ + 0, 2, /* shift, width */ + 0, NULL); /* flags, div table */ + +static const char *axi1_parents[] = {"c1cpux"}; +DIV_CLK(axi1_clk, + CLK_AXI1, /* id */ + "axi1", axi1_parents, /* name, parents */ + 0x50, /* offset */ + 16, 2, /* shift, width */ + 0, NULL); /* flags, div table */ + +static const char *ahb1_parents[] = {"osc16M-d512", "osc24M", "pll_periph", "pll_periph"}; +PREDIV_CLK_WITH_MASK(ahb1_clk, + CLK_AHB1, /* id */ + "ahb1", ahb1_parents, /* name, parents */ + 0x54, /* offset */ + 12, 2, /* mux */ + 4, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* div */ + 6, 2, 0, AW_CLK_FACTOR_HAS_COND, /* prediv */ + (2 << 12), (2 << 12)); /* prediv condition */ + +static const char *apb1_parents[] = {"ahb1"}; +DIV_CLK(apb1_clk, + CLK_APB1, /* id */ + "apb1", apb1_parents, /* name, parents */ + 0x54, /* offset */ + 8, 2, /* shift, width */ + 0, NULL); /* flags, div table */ + +static const char *apb2_parents[] = {"osc16M-d512", "osc24M", "pll_periph", "pll_periph"}; +NM_CLK(apb2_clk, + CLK_APB2, /* id */ + "apb2", apb2_parents, /* name, parents */ + 0x58, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 5, 0, 0, /* m factor */ + 24, 2, /* mux */ + 0, /* gate */ + AW_CLK_HAS_MUX); + +static const char *ahb2_parents[] = {"ahb1", "pll_periph"}; +PREDIV_CLK(ahb2_clk, + CLK_AHB2, /* id */ + "ahb2", ahb2_parents, /* name, parents */ + 0x5c, + 0, 2, /* mux */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* div (fake) */ + 0, 0, 2, AW_CLK_FACTOR_HAS_COND | AW_CLK_FACTOR_FIXED, /* prediv */ + 0, 2, 1); /* prediv cond */ + +/* Actually has a divider, but we don't use it */ +static const char *cci400_parents[] = {"osc24M", "pll_periph", "pll_hsic"}; +MUX_CLK(cci400_clk, + CLK_CCI400, /* id */ + "cci400", cci400_parents, /* name, parents */ + 0x78, 24, 2); /* offset, shift, width */ + +static const char *mod_parents[] = {"osc24M", "pll_periph"}; + +NM_CLK(nand_clk, + CLK_NAND, /* id */ + "nand", mod_parents, /* name, parents */ + 0x80, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); + +NM_CLK(mmc0_clk, + CLK_MMC0, /* id */ + "mmc0", mod_parents, /* name, parents */ + 0x88, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX | + AW_CLK_REPARENT); +NM_CLK(mmc1_clk, + CLK_MMC1, /* id */ + "mmc1", mod_parents, /* name, parents */ + 0x8c, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX | + AW_CLK_REPARENT); +NM_CLK(mmc2_clk, + CLK_MMC2, /* id */ + "mmc2", mod_parents, /* name, parents */ + 0x90, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX | + AW_CLK_REPARENT); + +NM_CLK(ss_clk, + CLK_SS, /* id */ + "ss", mod_parents, /* name, parents */ + 0x9c, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); + +NM_CLK(spi0_clk, + CLK_SPI0, /* id */ + "spi0", mod_parents, /* name, parents */ + 0xa0, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); +NM_CLK(spi1_clk, + CLK_SPI1, /* id */ + "spi1", mod_parents, /* name, parents */ + 0xa4, /* offset */ + 16, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* n factor */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE | AW_CLK_HAS_MUX); + +static const char *daudio_parents[] = {"pll_audio"}; +NM_CLK(i2s0_clk, + CLK_I2S0, /* id */ + "i2s0", daudio_parents, /* name, parents */ + 0xb0, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE); +NM_CLK(i2s1_clk, + CLK_I2S1, /* id */ + "i2s1", daudio_parents, /* name, parents */ + 0xb4, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE); +NM_CLK(i2s2_clk, + CLK_I2S2, /* id */ + "i2s2", daudio_parents, /* name, parents */ + 0xb8, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE); + +static const char *tdm_parents[] = {"pll_audio"}; +NM_CLK(tdm_clk, + CLK_TDM, /* id */ + "tdm", tdm_parents, /* name, parents */ + 0xbc, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE); + +static const char *spdif_parents[] = {"pll_audio"}; +NM_CLK(spdif_clk, + CLK_SPDIF, /* id */ + "spdif", spdif_parents, /* name, parents */ + 0xc0, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE); + +static const char *dram_parents[] = {"pll_ddr"}; +NM_CLK(dram_clk, + CLK_DRAM, /* id */ + "dram", dram_parents, /* name, parents */ + 0xf4, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 0, 0, /* mux */ + 0, /* gate */ + 0); + +static const char *tcon0_parents[] = {"pll_video0"}; +MUX_CLK(tcon0_clk, + CLK_TCON0, /* id */ + "tcon0", tcon0_parents, /* name, parents */ + 0x118, 24, 2); /* offset, shift, width */ + +static const char *tcon1_parents[] = {"pll_video1"}; +NM_CLK(tcon1_clk, + CLK_TCON1, /* id */ + "tcon1", tcon1_parents, /* name, parents */ + 0x11c, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE); + +static const char *csi_mclk_parents[] = {"pll_de", "osc24M"}; +NM_CLK(csi_mclk_clk, + CLK_CSI_MCLK, /* id */ + "csi-mclk", csi_mclk_parents, /* name, parents */ + 0x134, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 8, 3, /* mux */ + 15, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); + +static const char *csi_sclk_parents[] = {"pll_periph", "pll_ve"}; +NM_CLK(csi_sclk_clk, + CLK_CSI_SCLK, /* id */ + "csi-sclk", csi_sclk_parents, /* name, parents */ + 0x134, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 16, 4, 0, 0, /* m factor */ + 24, 3, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); + +static const char *ve_parents[] = {"pll_ve"}; +NM_CLK(ve_clk, + CLK_VE, /* id */ + "ve", ve_parents, /* name, parents */ + 0x13c, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 16, 3, 0, 0, /* m factor */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE); + +static const char *hdmi_parents[] = {"pll_video1"}; +NM_CLK(hdmi_clk, + CLK_HDMI, /* id */ + "hdmi", hdmi_parents, /* name, parents */ + 0x150, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); + +static const char *mbus_parents[] = {"osc24M", "pll_periph", "pll_ddr"}; +NM_CLK(mbus_clk, + CLK_MBUS, /* id */ + "mbus", mbus_parents, /* name, parents */ + 0x15c, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 3, 0, 0, /* m factor */ + 24, 2, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); + +static const char *mipi_dsi0_parents[] = {"pll_video0"}; +NM_CLK(mipi_dsi0_clk, + CLK_MIPI_DSI0, /* id */ + "mipi-dsi0", mipi_dsi0_parents, /* name, parents */ + 0x168, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 24, 4, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); + +static const char *mipi_dsi1_parents[] = {"osc24M", "pll_video0"}; +NM_CLK(mipi_dsi1_clk, + CLK_MIPI_DSI1, /* id */ + "mipi-dsi1", mipi_dsi1_parents, /* name, parents */ + 0x16c, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 4, 0, 0, /* m factor */ + 24, 4, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); + +static const char *gpu_core_parents[] = {"pll_gpu"}; +NM_CLK(gpu_core_clk, + CLK_GPU_CORE, /* id */ + "gpu-core", gpu_core_parents, /* name, parents */ + 0x1a0, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 3, 0, 0, /* m factor */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE); + +static const char *gpu_memory_parents[] = {"pll_gpu", "pll_periph"}; +NM_CLK(gpu_memory_clk, + CLK_GPU_MEMORY, /* id */ + "gpu-memory", gpu_memory_parents, /* name, parents */ + 0x1a4, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 3, 0, 0, /* m factor */ + 24, 1, /* mux */ + 31, /* gate */ + AW_CLK_HAS_MUX | AW_CLK_HAS_GATE); + +static const char *gpu_hyd_parents[] = {"pll_gpu"}; +NM_CLK(gpu_hyd_clk, + CLK_GPU_HYD, /* id */ + "gpu-hyd", gpu_hyd_parents, /* name, parents */ + 0x1a0, /* offset */ + 0, 0, 1, AW_CLK_FACTOR_FIXED, /* n factor (fake) */ + 0, 3, 0, 0, /* m factor */ + 0, 0, /* mux */ + 31, /* gate */ + AW_CLK_HAS_GATE); + + +static struct aw_clk_nkmp_def *nkmp_clks[] = { + &pll_audio_clk, + &pll_video0_clk, + &pll_ve_clk, + &pll_ddr_clk, + &pll_periph_clk, + &pll_gpu_clk, + &pll_hsic_clk, + &pll_de_clk, + &pll_video1_clk, +}; + +static struct aw_clk_nm_def *nm_clks[] = { + &pll_c0cpux_clk, + &pll_c1cpux_clk, + &apb2_clk, + &nand_clk, + &mmc0_clk, + &mmc1_clk, + &mmc2_clk, + &ss_clk, + &spi0_clk, + &spi1_clk, + &i2s0_clk, + &i2s1_clk, + &i2s2_clk, + &tdm_clk, + &spdif_clk, + &dram_clk, + &tcon1_clk, + &csi_mclk_clk, + &csi_sclk_clk, + &ve_clk, + &hdmi_clk, + &mbus_clk, + &mipi_dsi0_clk, + &mipi_dsi1_clk, + &gpu_core_clk, + &gpu_memory_clk, + &gpu_hyd_clk, +}; + +static struct aw_clk_prediv_mux_def *prediv_mux_clks[] = { + &ahb1_clk, + &ahb2_clk, +}; + +static struct clk_mux_def *mux_clks[] = { + &c0cpux_clk, + &c1cpux_clk, + &cci400_clk, + &tcon0_clk, +}; + +static struct clk_div_def *div_clks[] = { + &axi0_clk, + &axi1_clk, + &apb1_clk, +}; + +static struct clk_fixed_def *fixed_factor_clks[] = { + &osc12m_clk, +}; + +static struct aw_clk_init init_clks[] = { + {"ahb1", "pll_periph", 0, false}, + {"ahb2", "ahb1", 0, false}, + {"dram", "pll_ddr", 0, false}, +}; + +void +ccu_a83t_register_clocks(struct aw_ccung_softc *sc) +{ + int i; + + sc->resets = a83t_ccu_resets; + sc->nresets = nitems(a83t_ccu_resets); + sc->gates = a83t_ccu_gates; + sc->ngates = nitems(a83t_ccu_gates); + sc->clk_init = init_clks; + sc->n_clk_init = nitems(init_clks); + + for (i = 0; i < nitems(nkmp_clks); i++) + aw_clk_nkmp_register(sc->clkdom, nkmp_clks[i]); + for (i = 0; i < nitems(nm_clks); i++) + aw_clk_nm_register(sc->clkdom, nm_clks[i]); + for (i = 0; i < nitems(prediv_mux_clks); i++) + aw_clk_prediv_mux_register(sc->clkdom, prediv_mux_clks[i]); + + for (i = 0; i < nitems(mux_clks); i++) + clknode_mux_register(sc->clkdom, mux_clks[i]); + for (i = 0; i < nitems(div_clks); i++) + clknode_div_register(sc->clkdom, div_clks[i]); + for (i = 0; i < nitems(fixed_factor_clks); i++) + clknode_fixed_register(sc->clkdom, fixed_factor_clks[i]); +} Added: head/sys/arm/allwinner/clkng/ccu_a83t.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/clkng/ccu_a83t.h Thu Nov 23 05:54:04 2017 (r326114) @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2017 Kyle Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __CCU_A83T_H__ +#define __CCU_A83T_H__ + +void ccu_a83t_register_clocks(struct aw_ccung_softc *sc); + +#endif /* __CCU_A83T_H__ */ From owner-svn-src-head@freebsd.org Thu Nov 23 05:55: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 9FD0BDDDD3A; Thu, 23 Nov 2017 05:55:54 +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 6A8747D4F1; Thu, 23 Nov 2017 05:55: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 vAN5trcT023030; Thu, 23 Nov 2017 05:55:53 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAN5trFf023029; Thu, 23 Nov 2017 05:55:53 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201711230555.vAN5trFf023029@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 23 Nov 2017 05:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326115 - 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: 326115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 05:55:54 -0000 Author: ae Date: Thu Nov 23 05:55:53 2017 New Revision: 326115 URL: https://svnweb.freebsd.org/changeset/base/326115 Log: Rework rule ranges matching. Use comparison rule id with UINT32_MAX to match all rules with the same rule number. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Nov 23 05:54:04 2017 (r326114) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Nov 23 05:55:53 2017 (r326115) @@ -1021,10 +1021,9 @@ delete_range(struct ip_fw_chain *chain, ipfw_range_tlv if ((rt->flags & IPFW_RCFLAG_RANGE) != 0) { start = ipfw_find_rule(chain, rt->start_rule, 0); - end = ipfw_find_rule(chain, rt->end_rule, 0); - if (rt->end_rule != IPFW_DEFAULT_RULE) - while (chain->map[end]->rulenum == rt->end_rule) - end++; + if (rt->end_rule >= IPFW_DEFAULT_RULE) + rt->end_rule = IPFW_DEFAULT_RULE - 1; + end = ipfw_find_rule(chain, rt->end_rule, UINT32_MAX); } /* Allocate new map of the same size */ @@ -2401,9 +2400,9 @@ dump_config(struct ip_fw_chain *chain, ip_fw3_opheader if ((rnum = hdr->start_rule) > IPFW_DEFAULT_RULE) rnum = IPFW_DEFAULT_RULE; da.b = ipfw_find_rule(chain, rnum, 0); - rnum = hdr->end_rule; - rnum = (rnum < IPFW_DEFAULT_RULE) ? rnum+1 : IPFW_DEFAULT_RULE; - da.e = ipfw_find_rule(chain, rnum, 0) + 1; + rnum = (hdr->end_rule < IPFW_DEFAULT_RULE) ? + hdr->end_rule + 1: IPFW_DEFAULT_RULE; + da.e = ipfw_find_rule(chain, rnum, UINT32_MAX) + 1; } if (hdr->flags & IPFW_CFG_GET_STATIC) { From owner-svn-src-head@freebsd.org Thu Nov 23 06:04: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 6BD04DDE232; Thu, 23 Nov 2017 06:04:58 +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 42DED7DA46; Thu, 23 Nov 2017 06:04:58 +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 vAN64vvY027512; Thu, 23 Nov 2017 06:04:57 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAN64vDB027510; Thu, 23 Nov 2017 06:04:57 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201711230604.vAN64vDB027510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 23 Nov 2017 06:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326116 - 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: 326116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 06:04:58 -0000 Author: ae Date: Thu Nov 23 06:04:57 2017 New Revision: 326116 URL: https://svnweb.freebsd.org/changeset/base/326116 Log: Move ipfw_send_pkt() from ip_fw_dynamic.c into ip_fw2.c. It is not specific for dynamic states function and called also from generic code. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Thu Nov 23 05:55:53 2017 (r326115) +++ head/sys/netpfil/ipfw/ip_fw2.c Thu Nov 23 06:04:57 2017 (r326116) @@ -468,6 +468,155 @@ verify_path(struct in_addr src, struct ifnet *ifp, u_i #endif /* __FreeBSD__ */ } +/* + * Generate a TCP packet, containing either a RST or a keepalive. + * When flags & TH_RST, we are sending a RST packet, because of a + * "reset" action matched the packet. + * Otherwise we are sending a keepalive, and flags & TH_ + * The 'replyto' mbuf is the mbuf being replied to, if any, and is required + * so that MAC can label the reply appropriately. + */ +struct mbuf * +ipfw_send_pkt(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t seq, + u_int32_t ack, int flags) +{ + struct mbuf *m = NULL; /* stupid compiler */ + struct ip *h = NULL; /* stupid compiler */ +#ifdef INET6 + struct ip6_hdr *h6 = NULL; +#endif + struct tcphdr *th = NULL; + int len, dir; + + MGETHDR(m, M_NOWAIT, MT_DATA); + if (m == NULL) + return (NULL); + + M_SETFIB(m, id->fib); +#ifdef MAC + if (replyto != NULL) + mac_netinet_firewall_reply(replyto, m); + else + mac_netinet_firewall_send(m); +#else + (void)replyto; /* don't warn about unused arg */ +#endif + + switch (id->addr_type) { + case 4: + len = sizeof(struct ip) + sizeof(struct tcphdr); + break; +#ifdef INET6 + case 6: + len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); + break; +#endif + default: + /* XXX: log me?!? */ + FREE_PKT(m); + return (NULL); + } + dir = ((flags & (TH_SYN | TH_RST)) == TH_SYN); + + m->m_data += max_linkhdr; + m->m_flags |= M_SKIP_FIREWALL; + m->m_pkthdr.len = m->m_len = len; + m->m_pkthdr.rcvif = NULL; + bzero(m->m_data, len); + + switch (id->addr_type) { + case 4: + h = mtod(m, struct ip *); + + /* prepare for checksum */ + h->ip_p = IPPROTO_TCP; + h->ip_len = htons(sizeof(struct tcphdr)); + if (dir) { + h->ip_src.s_addr = htonl(id->src_ip); + h->ip_dst.s_addr = htonl(id->dst_ip); + } else { + h->ip_src.s_addr = htonl(id->dst_ip); + h->ip_dst.s_addr = htonl(id->src_ip); + } + + th = (struct tcphdr *)(h + 1); + break; +#ifdef INET6 + case 6: + h6 = mtod(m, struct ip6_hdr *); + + /* prepare for checksum */ + h6->ip6_nxt = IPPROTO_TCP; + h6->ip6_plen = htons(sizeof(struct tcphdr)); + if (dir) { + h6->ip6_src = id->src_ip6; + h6->ip6_dst = id->dst_ip6; + } else { + h6->ip6_src = id->dst_ip6; + h6->ip6_dst = id->src_ip6; + } + + th = (struct tcphdr *)(h6 + 1); + break; +#endif + } + + if (dir) { + th->th_sport = htons(id->src_port); + th->th_dport = htons(id->dst_port); + } else { + th->th_sport = htons(id->dst_port); + th->th_dport = htons(id->src_port); + } + th->th_off = sizeof(struct tcphdr) >> 2; + + if (flags & TH_RST) { + if (flags & TH_ACK) { + th->th_seq = htonl(ack); + th->th_flags = TH_RST; + } else { + if (flags & TH_SYN) + seq++; + th->th_ack = htonl(seq); + th->th_flags = TH_RST | TH_ACK; + } + } else { + /* + * Keepalive - use caller provided sequence numbers + */ + th->th_seq = htonl(seq); + th->th_ack = htonl(ack); + th->th_flags = TH_ACK; + } + + switch (id->addr_type) { + case 4: + th->th_sum = in_cksum(m, len); + + /* finish the ip header */ + h->ip_v = 4; + h->ip_hl = sizeof(*h) >> 2; + h->ip_tos = IPTOS_LOWDELAY; + h->ip_off = htons(0); + h->ip_len = htons(len); + h->ip_ttl = V_ip_defttl; + h->ip_sum = 0; + break; +#ifdef INET6 + case 6: + th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(*h6), + sizeof(struct tcphdr)); + + /* finish the ip6 header */ + h6->ip6_vfc |= IPV6_VERSION; + h6->ip6_hlim = IPV6_DEFHLIM; + break; +#endif + } + + return (m); +} + #ifdef INET6 /* * ipv6 specific rules here... Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Nov 23 05:55:53 2017 (r326115) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Nov 23 06:04:57 2017 (r326116) @@ -1020,155 +1020,6 @@ ipfw_install_state(struct ip_fw_chain *chain, struct i } /* - * Generate a TCP packet, containing either a RST or a keepalive. - * When flags & TH_RST, we are sending a RST packet, because of a - * "reset" action matched the packet. - * Otherwise we are sending a keepalive, and flags & TH_ - * The 'replyto' mbuf is the mbuf being replied to, if any, and is required - * so that MAC can label the reply appropriately. - */ -struct mbuf * -ipfw_send_pkt(struct mbuf *replyto, struct ipfw_flow_id *id, u_int32_t seq, - u_int32_t ack, int flags) -{ - struct mbuf *m = NULL; /* stupid compiler */ - int len, dir; - struct ip *h = NULL; /* stupid compiler */ -#ifdef INET6 - struct ip6_hdr *h6 = NULL; -#endif - struct tcphdr *th = NULL; - - MGETHDR(m, M_NOWAIT, MT_DATA); - if (m == NULL) - return (NULL); - - M_SETFIB(m, id->fib); -#ifdef MAC - if (replyto != NULL) - mac_netinet_firewall_reply(replyto, m); - else - mac_netinet_firewall_send(m); -#else - (void)replyto; /* don't warn about unused arg */ -#endif - - switch (id->addr_type) { - case 4: - len = sizeof(struct ip) + sizeof(struct tcphdr); - break; -#ifdef INET6 - case 6: - len = sizeof(struct ip6_hdr) + sizeof(struct tcphdr); - break; -#endif - default: - /* XXX: log me?!? */ - FREE_PKT(m); - return (NULL); - } - dir = ((flags & (TH_SYN | TH_RST)) == TH_SYN); - - m->m_data += max_linkhdr; - m->m_flags |= M_SKIP_FIREWALL; - m->m_pkthdr.len = m->m_len = len; - m->m_pkthdr.rcvif = NULL; - bzero(m->m_data, len); - - switch (id->addr_type) { - case 4: - h = mtod(m, struct ip *); - - /* prepare for checksum */ - h->ip_p = IPPROTO_TCP; - h->ip_len = htons(sizeof(struct tcphdr)); - if (dir) { - h->ip_src.s_addr = htonl(id->src_ip); - h->ip_dst.s_addr = htonl(id->dst_ip); - } else { - h->ip_src.s_addr = htonl(id->dst_ip); - h->ip_dst.s_addr = htonl(id->src_ip); - } - - th = (struct tcphdr *)(h + 1); - break; -#ifdef INET6 - case 6: - h6 = mtod(m, struct ip6_hdr *); - - /* prepare for checksum */ - h6->ip6_nxt = IPPROTO_TCP; - h6->ip6_plen = htons(sizeof(struct tcphdr)); - if (dir) { - h6->ip6_src = id->src_ip6; - h6->ip6_dst = id->dst_ip6; - } else { - h6->ip6_src = id->dst_ip6; - h6->ip6_dst = id->src_ip6; - } - - th = (struct tcphdr *)(h6 + 1); - break; -#endif - } - - if (dir) { - th->th_sport = htons(id->src_port); - th->th_dport = htons(id->dst_port); - } else { - th->th_sport = htons(id->dst_port); - th->th_dport = htons(id->src_port); - } - th->th_off = sizeof(struct tcphdr) >> 2; - - if (flags & TH_RST) { - if (flags & TH_ACK) { - th->th_seq = htonl(ack); - th->th_flags = TH_RST; - } else { - if (flags & TH_SYN) - seq++; - th->th_ack = htonl(seq); - th->th_flags = TH_RST | TH_ACK; - } - } else { - /* - * Keepalive - use caller provided sequence numbers - */ - th->th_seq = htonl(seq); - th->th_ack = htonl(ack); - th->th_flags = TH_ACK; - } - - switch (id->addr_type) { - case 4: - th->th_sum = in_cksum(m, len); - - /* finish the ip header */ - h->ip_v = 4; - h->ip_hl = sizeof(*h) >> 2; - h->ip_tos = IPTOS_LOWDELAY; - h->ip_off = htons(0); - h->ip_len = htons(len); - h->ip_ttl = V_ip_defttl; - h->ip_sum = 0; - break; -#ifdef INET6 - case 6: - th->th_sum = in6_cksum(m, IPPROTO_TCP, sizeof(*h6), - sizeof(struct tcphdr)); - - /* finish the ip6 header */ - h6->ip6_vfc |= IPV6_VERSION; - h6->ip6_hlim = IPV6_DEFHLIM; - break; -#endif - } - - return (m); -} - -/* * Queue keepalive packets for given dynamic rule */ static struct mbuf ** From owner-svn-src-head@freebsd.org Thu Nov 23 07:05: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 42FADDE14FB; Thu, 23 Nov 2017 07:05:27 +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 0A68A7FA0B; Thu, 23 Nov 2017 07:05:26 +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 vAN75QSU051989; Thu, 23 Nov 2017 07:05:26 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAN75QoU051988; Thu, 23 Nov 2017 07:05:26 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201711230705.vAN75QoU051988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 23 Nov 2017 07:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326117 - 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: 326117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 07:05:27 -0000 Author: ae Date: Thu Nov 23 07:05:25 2017 New Revision: 326117 URL: https://svnweb.freebsd.org/changeset/base/326117 Log: Check that address family of state matches address family of packet. If it is not matched avoid comparing other state fields. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Nov 23 06:04:57 2017 (r326116) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Nov 23 07:05:25 2017 (r326117) @@ -609,6 +609,9 @@ lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int i if (q->dyn_type == O_LIMIT_PARENT) continue; + if (pkt->addr_type != q->id.addr_type) + continue; + if (pkt->proto != q->id.proto) continue; From owner-svn-src-head@freebsd.org Thu Nov 23 07:15: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 7EF5FDE1A73; Thu, 23 Nov 2017 07:15:40 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 369B77FF84; Thu, 23 Nov 2017 07:15:38 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 1b896e11; Thu, 23 Nov 2017 08:15:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; s=mail; bh=vff/I3 Yxb2pnKiYC5XroLM+RQeg=; b=W+/nN9al2S0dLyJSB/Rks7FRHUwCqm0BSROOSA 0odLogTxtA0Ab+dVfQqVdz5ego408Gtm1u1zUh6tKeqrKdGMeWN51V1YfIx5R0P2 /vmQ+9VOifOKheREHQELQpS53ImYFbtrHCRiRj2GoogfU9oQzxqxt/dGEuxOHPkU Kywls= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; q=dns; s=mail; b= HTVgtFqf6t4F4ouV/pp5qRKGd145nsByyR+NJ5U10g2U+/MkP4vZw6/LZ/aBteEO r8z9bk+TBINNq93bPCUXCF47iPRKyMq6s9/WtoWv4iaWm1t6z/n00hMbg3o7G6rj bXM/8K1t4W7pRul3BRXDBXktep+D+knW48+iEsC6ojM= Received: from webmail.megadrive.org (www1.blih.net [212.83.177.180]) by mail.blih.net (OpenSMTPD) with ESMTP id 4c22d928; Thu, 23 Nov 2017 08:15:30 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Thu, 23 Nov 2017 08:15:29 +0100 From: Emmanuel Vadot To: Ian Lepore Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts Organization: Bidouilliste In-Reply-To: <1511368688.46031.1.camel@freebsd.org> References: <201711221527.vAMFRlTc041361@repo.freebsd.org> <1511368688.46031.1.camel@freebsd.org> Message-ID: X-Sender: manu@bidouilliste.com User-Agent: Roundcube Webmail/1.1.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 07:15:40 -0000 On 2017-11-22 17:38, Ian Lepore wrote: > On Wed, 2017-11-22 at 15:27 +0000, Emmanuel Vadot wrote: >> Author: manu >> Date: Wed Nov 22 15:27:47 2017 >> New Revision: 326095 >> URL: https://svnweb.freebsd.org/changeset/base/326095 >> >> Log: >>   bsdinstall: Add ntpdate option >>    >>   When you install a computer for the first time, the date in the CMOS >> sometimes >>   not accurate and you need to ntpdate as ntpd will fail a the time >> difference >>   is too big. >>   Add an option in bsdinstall to enable ntpdate that will do that for >> us. >>    >>   Reviewed by: allanjude >>   Differential Revision: https://reviews.freebsd.org/D13149 >> >> Modified: >>   head/usr.sbin/bsdinstall/scripts/services >> >> Modified: head/usr.sbin/bsdinstall/scripts/services >> ============================================================================== >> --- head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:18:11 >> 2017 (r326094) >> +++ head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:27:47 >> 2017 (r326095) >> @@ -46,6 +46,8 @@ DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ >>   local_unbound "Local caching validating resolver" >> ${local_unbound:-off} \ >>   sshd "Secure shell daemon" ${sshd_enable:-off} \ >>   moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ >> + ntpdate "Synchronize system and network time at bootime" \ >> + ${ntpdate_enable:-off} \ >>   ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ >>   powerd "Adjust CPU frequency dynamically if supported" \ >>   ${powerd_enable:-off} \ >> > > The right way to enable a time-step at boot is to set the rc conf > variable ntpd_sync_on_start to YES.  ntpdate has been deprecated for > *years*. > > -- Ian Hi Ian, Thanks I didn't know about option -g (nor ntpd_sync_on_start), this bring a few questions : - Is there any reason to not always use -g for ntpd ? As a lambda user I just want my time to be set, no matter what. - Should we remove ntpdate in -current before 12 if it's deprecated ? I'll make the necessary changes according to your (or others) answers. Cheers, -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Nov 23 08:02: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 C3DF2DE34D9; Thu, 23 Nov 2017 08:02:03 +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 80F1C19E8; Thu, 23 Nov 2017 08:02:03 +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 vAN822UC076932; Thu, 23 Nov 2017 08:02:02 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAN822St076928; Thu, 23 Nov 2017 08:02:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201711230802.vAN822St076928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 23 Nov 2017 08:02:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326118 - 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: 326118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 08:02:03 -0000 Author: ae Date: Thu Nov 23 08:02:02 2017 New Revision: 326118 URL: https://svnweb.freebsd.org/changeset/base/326118 Log: Modify ipfw's dynamic states KPI. Hide the locking logic used in the dynamic states implementation from generic code. Rename ipfw_install_state() and ipfw_lookup_dyn_rule() function to have similar names: ipfw_dyn_install_state() and ipfw_dyn_lookup_state(). Move dynamic rule counters updating to the ipfw_dyn_lookup_state() function. Now this function return NULL when there is no state and pointer to the parent rule when state is found. Thus now there is no need to return pointer to dynamic rule, and no need to hold bucket lock for this state. Remove ipfw_dyn_unlock() function. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D11657 Modified: head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_dynamic.c head/sys/netpfil/ipfw/ip_fw_private.h Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Thu Nov 23 07:05:25 2017 (r326117) +++ head/sys/netpfil/ipfw/ip_fw2.c Thu Nov 23 08:02:02 2017 (r326118) @@ -1122,7 +1122,7 @@ ipfw_chk(struct ip_fw_args *args) */ int dyn_dir = MATCH_UNKNOWN; uint16_t dyn_name = 0; - ipfw_dyn_rule *q = NULL; + struct ip_fw *q = NULL; struct ip_fw_chain *chain = &V_layer3_chain; /* @@ -2307,7 +2307,7 @@ do { \ */ case O_LIMIT: case O_KEEP_STATE: - if (ipfw_install_state(chain, f, + if (ipfw_dyn_install_state(chain, f, (ipfw_insn_limit *)cmd, args, tablearg)) { /* error or limit violation */ retval = IP_FW_DENY; @@ -2347,28 +2347,25 @@ do { \ if ((dyn_dir == MATCH_UNKNOWN || (dyn_name != 0 && dyn_name != cmd->arg1)) && - (q = ipfw_lookup_dyn_rule(&args->f_id, - &dyn_dir, proto == IPPROTO_TCP ? - TCP(ulp): NULL, + (q = ipfw_dyn_lookup_state(&args->f_id, + ulp, pktlen, &dyn_dir, (dyn_name = cmd->arg1))) != NULL) { /* - * Found dynamic entry, update stats - * and jump to the 'action' part of - * the parent rule by setting - * f, cmd, l and clearing cmdlen. + * Found dynamic entry, jump to the + * 'action' part of the parent rule + * by setting f, cmd, l and clearing + * cmdlen. */ - IPFW_INC_DYN_COUNTER(q, pktlen); + f = q; /* XXX we would like to have f_pos * readily accessible in the dynamic * rule, instead of having to * lookup q->rule. */ - f = q->rule; f_pos = ipfw_find_rule(chain, - f->rulenum, f->id); + f->rulenum, f->id); cmd = ACTION_PTR(f); l = f->cmd_len - f->act_ofs; - ipfw_dyn_unlock(q); cmdlen = 0; match = 1; break; @@ -2580,8 +2577,7 @@ do { \ case O_FORWARD_IP: if (args->eh) /* not valid on layer2 pkts */ break; - if (q == NULL || q->rule != f || - dyn_dir == MATCH_FORWARD) { + if (q != f || dyn_dir == MATCH_FORWARD) { struct sockaddr_in *sa; sa = &(((ipfw_insn_sa *)cmd)->sa); @@ -2641,8 +2637,7 @@ do { \ case O_FORWARD_IP6: if (args->eh) /* not valid on layer2 pkts */ break; - if (q == NULL || q->rule != f || - dyn_dir == MATCH_FORWARD) { + if (q != f || dyn_dir == MATCH_FORWARD) { struct sockaddr_in6 *sin6; sin6 = &(((ipfw_insn_sa6 *)cmd)->sa); Modified: head/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Nov 23 07:05:25 2017 (r326117) +++ head/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Nov 23 08:02:02 2017 (r326118) @@ -251,7 +251,7 @@ SYSEND #ifdef INET6 static __inline int -hash_packet6(struct ipfw_flow_id *id) +hash_packet6(const struct ipfw_flow_id *id) { u_int32_t i; i = (id->dst_ip6.__u6_addr.__u6_addr32[2]) ^ @@ -268,7 +268,7 @@ hash_packet6(struct ipfw_flow_id *id) * and we want to find both in the same bucket. */ static __inline int -hash_packet(struct ipfw_flow_id *id, int buckets) +hash_packet(const struct ipfw_flow_id *id, int buckets) { u_int32_t i; @@ -476,8 +476,8 @@ static struct opcode_obj_rewrite dyn_opcodes[] = { * Print customizable flow id description via log(9) facility. */ static void -print_dyn_rule_flags(struct ipfw_flow_id *id, int dyn_type, int log_flags, - char *prefix, char *postfix) +print_dyn_rule_flags(const struct ipfw_flow_id *id, int dyn_type, + int log_flags, char *prefix, char *postfix) { struct in_addr da; #ifdef INET6 @@ -511,12 +511,14 @@ print_dyn_rule_flags(struct ipfw_flow_id *id, int dyn_ static void dyn_update_proto_state(ipfw_dyn_rule *q, const struct ipfw_flow_id *id, - const struct tcphdr *tcp, int dir) + const void *ulp, int dir) { + const struct tcphdr *tcp; uint32_t ack; u_char flags; if (id->proto == IPPROTO_TCP) { + tcp = (const struct tcphdr *)ulp; flags = id->_flags & (TH_FIN | TH_SYN | TH_RST); #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) @@ -592,8 +594,8 @@ dyn_update_proto_state(ipfw_dyn_rule *q, const struct * Lookup a dynamic rule, locked version. */ static ipfw_dyn_rule * -lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int i, int *match_direction, - struct tcphdr *tcp, uint16_t kidx) +lookup_dyn_rule_locked(const struct ipfw_flow_id *pkt, const void *ulp, + int i, int *match_direction, uint16_t kidx) { /* * Stateful ipfw extensions. @@ -660,41 +662,35 @@ lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int i } /* update state according to flags */ - dyn_update_proto_state(q, pkt, tcp, dir); + dyn_update_proto_state(q, pkt, ulp, dir); done: if (match_direction != NULL) *match_direction = dir; return (q); } -ipfw_dyn_rule * -ipfw_lookup_dyn_rule(struct ipfw_flow_id *pkt, int *match_direction, - struct tcphdr *tcp, uint16_t kidx) +struct ip_fw * +ipfw_dyn_lookup_state(const struct ipfw_flow_id *pkt, const void *ulp, + int pktlen, int *match_direction, uint16_t kidx) { + struct ip_fw *rule; ipfw_dyn_rule *q; int i; i = hash_packet(pkt, V_curr_dyn_buckets); IPFW_BUCK_LOCK(i); - q = lookup_dyn_rule_locked(pkt, i, match_direction, tcp, kidx); + q = lookup_dyn_rule_locked(pkt, ulp, i, match_direction, kidx); if (q == NULL) - IPFW_BUCK_UNLOCK(i); - /* NB: return table locked when q is not NULL */ - return q; + rule = NULL; + else { + rule = q->rule; + IPFW_INC_DYN_COUNTER(q, pktlen); + } + IPFW_BUCK_UNLOCK(i); + return (rule); } -/* - * Unlock bucket mtx - * @p - pointer to dynamic rule - */ -void -ipfw_dyn_unlock(ipfw_dyn_rule *q) -{ - - IPFW_BUCK_UNLOCK(q->bucket); -} - static int resize_dynamic_table(struct ip_fw_chain *chain, int nbuckets) { @@ -787,7 +783,7 @@ resize_dynamic_table(struct ip_fw_chain *chain, int nb * - "parent" rules for the above (O_LIMIT_PARENT). */ static ipfw_dyn_rule * -add_dyn_rule(struct ipfw_flow_id *id, int i, uint8_t dyn_type, +add_dyn_rule(const struct ipfw_flow_id *id, int i, uint8_t dyn_type, struct ip_fw *rule, uint16_t kidx) { ipfw_dyn_rule *r; @@ -837,8 +833,8 @@ add_dyn_rule(struct ipfw_flow_id *id, int i, uint8_t d * If the lookup fails, then install one. */ static ipfw_dyn_rule * -lookup_dyn_parent(struct ipfw_flow_id *pkt, int *pindex, struct ip_fw *rule, - uint16_t kidx) +lookup_dyn_parent(const struct ipfw_flow_id *pkt, int *pindex, + struct ip_fw *rule, uint16_t kidx) { ipfw_dyn_rule *q; int i, is_v6; @@ -882,7 +878,7 @@ lookup_dyn_parent(struct ipfw_flow_id *pkt, int *pinde * session limitations are enforced. */ int -ipfw_install_state(struct ip_fw_chain *chain, struct ip_fw *rule, +ipfw_dyn_install_state(struct ip_fw_chain *chain, struct ip_fw *rule, ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg) { ipfw_dyn_rule *q; @@ -895,7 +891,7 @@ ipfw_install_state(struct ip_fw_chain *chain, struct i IPFW_BUCK_LOCK(i); - q = lookup_dyn_rule_locked(&args->f_id, i, NULL, NULL, cmd->o.arg1); + q = lookup_dyn_rule_locked(&args->f_id, NULL, i, NULL, cmd->o.arg1); if (q != NULL) { /* should never occur */ DEB( if (last_log != time_uptime) { Modified: head/sys/netpfil/ipfw/ip_fw_private.h ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_private.h Thu Nov 23 07:05:25 2017 (r326117) +++ head/sys/netpfil/ipfw/ip_fw_private.h Thu Nov 23 08:02:02 2017 (r326118) @@ -183,15 +183,14 @@ struct ip_fw_chain; struct sockopt_data; int ipfw_is_dyn_rule(struct ip_fw *rule); void ipfw_expire_dyn_rules(struct ip_fw_chain *, ipfw_range_tlv *); -void ipfw_dyn_unlock(ipfw_dyn_rule *q); struct tcphdr; struct mbuf *ipfw_send_pkt(struct mbuf *, struct ipfw_flow_id *, u_int32_t, u_int32_t, int); -int ipfw_install_state(struct ip_fw_chain *chain, struct ip_fw *rule, +int ipfw_dyn_install_state(struct ip_fw_chain *chain, struct ip_fw *rule, ipfw_insn_limit *cmd, struct ip_fw_args *args, uint32_t tablearg); -ipfw_dyn_rule *ipfw_lookup_dyn_rule(struct ipfw_flow_id *pkt, - int *match_direction, struct tcphdr *tcp, uint16_t kidx); +struct ip_fw *ipfw_dyn_lookup_state(const struct ipfw_flow_id *pkt, + const void *ulp, int pktlen, int *match_direction, uint16_t kidx); void ipfw_remove_dyn_children(struct ip_fw *rule); void ipfw_get_dynamic(struct ip_fw_chain *chain, char **bp, const char *ep); int ipfw_dump_states(struct ip_fw_chain *chain, struct sockopt_data *sd); From owner-svn-src-head@freebsd.org Thu Nov 23 09:53: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 24B93DE63D6; Thu, 23 Nov 2017 09:53:30 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CEF396479F; Thu, 23 Nov 2017 09:53:27 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 38caca44; Thu, 23 Nov 2017 10:53:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=07/3bk8AZAZNmjHsc6zPm4JB3PI=; b=jh02H4ydgsrcMoPjVeyoqy8jOEy4 l5tg9si4jByByA8KJJD7UM2Mbn/Tv6GSTSHg26glnGHL70Z3vuSnltqFo+bkj/PG I5r2GkSmuFsNw0WQp83MwnvMtdZyFZ+7pf3QoyBLv0M/NBAgv6AN9hIl/Q0XDFYD a46ftp2dr5kZXLw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=kgJ80gRWbtie3P1FZGC6CPtiVwasTR6IsEP+VzVKWNiepkhDs6JKH6z5 cTc8pGban0j6WPSYKdyyeZ2xq/WQbluoGvwLIDKF8cXJuQBapOE2jHQZpGRyEkQI HZN7wAay6xaIB+TK1k2RWQt4wNIqVaAPJCazcNX1PCSt3K/0G0k= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id dbd3411f TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 23 Nov 2017 10:53:24 +0100 (CET) Date: Thu, 23 Nov 2017 10:53:24 +0100 From: Emmanuel Vadot To: Devin Teske Cc: Ian Lepore , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts Message-Id: <20171123105324.8726e4e5c0471f87ea9c4089@bidouilliste.com> In-Reply-To: <821D3401-1DA8-46B5-BF5C-AAC3BDA3D8F3@shxd.cx> References: <201711221527.vAMFRlTc041361@repo.freebsd.org> <1511368688.46031.1.camel@freebsd.org> <821D3401-1DA8-46B5-BF5C-AAC3BDA3D8F3@shxd.cx> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 09:53:30 -0000 Hi Devin, On Thu, 23 Nov 2017 01:33:39 -0800 Devin Teske wrote: > > > > On Nov 22, 2017, at 11:15 PM, Emmanuel Vadot wrote: > > > >> On 2017-11-22 17:38, Ian Lepore wrote: > >>> On Wed, 2017-11-22 at 15:27 +0000, Emmanuel Vadot wrote: > >>> Author: manu > >>> Date: Wed Nov 22 15:27:47 2017 > >>> New Revision: 326095 > >>> URL: https://svnweb.freebsd.org/changeset/base/326095 > >>> Log: > >>> bsdinstall: Add ntpdate option > >>> > >>> When you install a computer for the first time, the date in the CMOS sometimes > >>> not accurate and you need to ntpdate as ntpd will fail a the time difference > >>> is too big. > >>> Add an option in bsdinstall to enable ntpdate that will do that for us. > >>> > >>> Reviewed by: allanjude > >>> Differential Revision: https://reviews.freebsd.org/D13149 > >>> Modified: > >>> head/usr.sbin/bsdinstall/scripts/services > >>> Modified: head/usr.sbin/bsdinstall/scripts/services > >>> ============================================================================== > >>> --- head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:18:11 2017 (r326094) > >>> +++ head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:27:47 2017 (r326095) > >>> @@ -46,6 +46,8 @@ DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ > >>> local_unbound "Local caching validating resolver" ${local_unbound:-off} \ > >>> sshd "Secure shell daemon" ${sshd_enable:-off} \ > >>> moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ > >>> + ntpdate "Synchronize system and network time at bootime" \ > >>> + ${ntpdate_enable:-off} \ > >>> ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ > >>> powerd "Adjust CPU frequency dynamically if supported" \ > >>> ${powerd_enable:-off} \ > >> The right way to enable a time-step at boot is to set the rc conf > >> variable ntpd_sync_on_start to YES. ntpdate has been deprecated for > >> *years*. > >> -- Ian > > > > Hi Ian, > > > > Thanks I didn't know about option -g (nor ntpd_sync_on_start), this bring a few questions : > > > > - Is there any reason to not always use -g for ntpd ? As a lambda user I just want my time to be set, no matter what. > > - Should we remove ntpdate in -current before 12 if it's deprecated ? > > > > I'll make the necessary changes according to your (or others) answers. > > > > I would not remove ntpdate. > > Is there a way to make ntpd sync and then quit immediately? Just by reading the man I see the -q option which does exactly that. Setting both -q and -g should have the same behavior than ntpdate (not tested). > If not, sounds like ntpdate serves a purpose not filled by ntpd. > > Valid case is someone running a VM that gets paused for days, weeks, or even months at a time. On such a VM it may make more sense to let the clock be only sporadically managed in an adhoc manner. > > I personally like to use ntpdate on said VMs because I generally set a timeout on my ssh-agent in said VMs and by managing the clock manually allows me to better control keys loaded. > > Pretty sure other people may have other reasons for non-daemonized clock management. That's why I asked :) > -- > Devin -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Nov 23 10:08: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 20F20DE6752; Thu, 23 Nov 2017 10:08:17 +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 03E9364C92; Thu, 23 Nov 2017 10:08:17 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=60713 helo=[10.0.0.101]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1eHl8d-0002oG-NB; Thu, 23 Nov 2017 06:37:31 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts From: Devin Teske X-Mailer: iPhone Mail (13G36) In-Reply-To: Date: Thu, 23 Nov 2017 01:33:39 -0800 Cc: Ian Lepore , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <821D3401-1DA8-46B5-BF5C-AAC3BDA3D8F3@shxd.cx> References: <201711221527.vAMFRlTc041361@repo.freebsd.org> <1511368688.46031.1.camel@freebsd.org> To: Emmanuel Vadot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 10:08:17 -0000 > On Nov 22, 2017, at 11:15 PM, Emmanuel Vadot wrote= : >=20 >> On 2017-11-22 17:38, Ian Lepore wrote: >>> On Wed, 2017-11-22 at 15:27 +0000, Emmanuel Vadot wrote: >>> Author: manu >>> Date: Wed Nov 22 15:27:47 2017 >>> New Revision: 326095 >>> URL: https://svnweb.freebsd.org/changeset/base/326095 >>> Log: >>> bsdinstall: Add ntpdate option >>> =20 >>> When you install a computer for the first time, the date in the CMOS s= ometimes >>> not accurate and you need to ntpdate as ntpd will fail a the time diff= erence >>> is too big. >>> Add an option in bsdinstall to enable ntpdate that will do that for us= . >>> =20 >>> Reviewed by: allanjude >>> Differential Revision: https://reviews.freebsd.org/D13149 >>> Modified: >>> head/usr.sbin/bsdinstall/scripts/services >>> Modified: head/usr.sbin/bsdinstall/scripts/services >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:18:11 201= 7 (r326094) >>> +++ head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:27:47 201= 7 (r326095) >>> @@ -46,6 +46,8 @@ DAEMONS=3D$( dialog --backtitle "FreeBSD Installer" \ >>> local_unbound "Local caching validating resolver" ${local_unbound:-= off} \ >>> sshd "Secure shell daemon" ${sshd_enable:-off} \ >>> moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ >>> + ntpdate "Synchronize system and network time at bootime" \ >>> + ${ntpdate_enable:-off} \ >>> ntpd "Synchronize system and network time" ${ntpd_enable:-off} \= >>> powerd "Adjust CPU frequency dynamically if supported" \ >>> ${powerd_enable:-off} \ >> The right way to enable a time-step at boot is to set the rc conf >> variable ntpd_sync_on_start to YES. ntpdate has been deprecated for >> *years*. >> -- Ian >=20 > Hi Ian, >=20 > Thanks I didn't know about option -g (nor ntpd_sync_on_start), this bring a= few questions : >=20 > - Is there any reason to not always use -g for ntpd ? As a lambda user I j= ust want my time to be set, no matter what. > - Should we remove ntpdate in -current before 12 if it's deprecated ? >=20 > I'll make the necessary changes according to your (or others) answers. >=20 I would not remove ntpdate. Is there a way to make ntpd sync and then quit immediately? If not, sounds like ntpdate serves a purpose not filled by ntpd. Valid case is someone running a VM that gets paused for days, weeks, or even= months at a time. On such a VM it may make more sense to let the clock be o= nly sporadically managed in an adhoc manner. I personally like to use ntpdate on said VMs because I generally set a timeo= ut on my ssh-agent in said VMs and by managing the clock manually allows me t= o better control keys loaded. Pretty sure other people may have other reasons for non-daemonized clock man= agement. --=20 Devin= From owner-svn-src-head@freebsd.org Thu Nov 23 10:34: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 95304DE71D4; Thu, 23 Nov 2017 10:34:39 +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 6194865AFC; Thu, 23 Nov 2017 10:34:39 +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 vANAYcvP039974; Thu, 23 Nov 2017 10:34:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANAYcQS039973; Thu, 23 Nov 2017 10:34:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201711231034.vANAYcQS039973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 23 Nov 2017 10:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326121 - head/sys/dev/efidev X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/efidev X-SVN-Commit-Revision: 326121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 10:34:39 -0000 Author: andrew Date: Thu Nov 23 10:34:38 2017 New Revision: 326121 URL: https://svnweb.freebsd.org/changeset/base/326121 Log: Zero struct efi_tm before setting the needed values. We don't use the dst or timezone fields so ensure these are set. Reported by: emaste Sponsored by: DARPA, AFRL Modified: head/sys/dev/efidev/efirtc.c Modified: head/sys/dev/efidev/efirtc.c ============================================================================== --- head/sys/dev/efidev/efirtc.c Thu Nov 23 10:09:49 2017 (r326120) +++ head/sys/dev/efidev/efirtc.c Thu Nov 23 10:34:38 2017 (r326121) @@ -116,6 +116,7 @@ efirtc_settime(device_t dev, struct timespec *ts) clock_ts_to_ct(ts, &ct); + bzero(&tm, sizeof(tm)); tm.tm_sec = ct.sec; tm.tm_min = ct.min; tm.tm_hour = ct.hour; From owner-svn-src-head@freebsd.org Thu Nov 23 11: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 98AA4DE8324; Thu, 23 Nov 2017 11:25:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72E45670C3; Thu, 23 Nov 2017 11:25: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 vANBPB44060754; Thu, 23 Nov 2017 11:25:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANBPB6W060751; Thu, 23 Nov 2017 11:25:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711231125.vANBPB6W060751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Nov 2017 11:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326122 - in head: lib/libc/sys sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern sys/sys X-SVN-Commit-Revision: 326122 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 11:25:12 -0000 Author: kib Date: Thu Nov 23 11:25:11 2017 New Revision: 326122 URL: https://svnweb.freebsd.org/changeset/base/326122 Log: Kill all descendants of the reaper, even if they are descendants of a subordinate reaper. Also, mark reapers when listing pids. Reported by: Michael Zuo PR: 223745 Reviewed by: bapt Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13183 Modified: head/lib/libc/sys/procctl.2 head/sys/kern/kern_procctl.c head/sys/sys/procctl.h Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Thu Nov 23 10:34:38 2017 (r326121) +++ head/lib/libc/sys/procctl.2 Thu Nov 23 11:25:11 2017 (r326122) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2016 +.Dd November 21, 2017 .Dt PROCCTL 2 .Os .Sh NAME @@ -211,7 +211,7 @@ of the process. The .Fa pi_flags field returns the following flags, further describing the descendant: -.Bl -tag -width "Dv REAPER_PIDINFO_VALID" +.Bl -tag -width "Dv REAPER_PIDINFO_REAPER" .It Dv REAPER_PIDINFO_VALID Set to indicate that the .Vt procctl_reaper_pidinfo @@ -226,6 +226,9 @@ of the returned array. The .Fa pi_pid field identifies the direct child of the reaper. +.It Dv REAPER_PIDINFO_REAPER +The reported process is itself a reaper. +The descendants of the subordinate reaper are not reported. .El .It Dv PROC_REAP_KILL Request to deliver a signal to some subset of the descendants of the reaper. Modified: head/sys/kern/kern_procctl.c ============================================================================== --- head/sys/kern/kern_procctl.c Thu Nov 23 10:34:38 2017 (r326121) +++ head/sys/kern/kern_procctl.c Thu Nov 23 11:25:11 2017 (r326122) @@ -221,6 +221,8 @@ reap_getpids(struct thread *td, struct proc *p, struct pip->pi_flags = REAPER_PIDINFO_VALID; if (proc_realparent(p2) == reap) pip->pi_flags |= REAPER_PIDINFO_CHILD; + if ((p2->p_treeflag & P_TREE_REAPER) != 0) + pip->pi_flags |= REAPER_PIDINFO_REAPER; i++; } sx_sunlock(&proctree_lock); @@ -231,20 +233,60 @@ reap_getpids(struct thread *td, struct proc *p, struct return (error); } +static void +reap_kill_proc(struct thread *td, struct proc *p2, ksiginfo_t *ksi, + struct procctl_reaper_kill *rk, int *error) +{ + int error1; + + PROC_LOCK(p2); + error1 = p_cansignal(td, p2, rk->rk_sig); + if (error1 == 0) { + pksignal(p2, rk->rk_sig, ksi); + rk->rk_killed++; + *error = error1; + } else if (*error == ESRCH) { + rk->rk_fpid = p2->p_pid; + *error = error1; + } + PROC_UNLOCK(p2); +} + +struct reap_kill_tracker { + struct proc *parent; + TAILQ_ENTRY(reap_kill_tracker) link; +}; + +TAILQ_HEAD(reap_kill_tracker_head, reap_kill_tracker); + +static void +reap_kill_sched(struct reap_kill_tracker_head *tracker, struct proc *p2) +{ + struct reap_kill_tracker *t; + + t = malloc(sizeof(struct reap_kill_tracker), M_TEMP, M_WAITOK); + t->parent = p2; + TAILQ_INSERT_TAIL(tracker, t, link); +} + static int reap_kill(struct thread *td, struct proc *p, struct procctl_reaper_kill *rk) { struct proc *reap, *p2; ksiginfo_t ksi; - int error, error1; + struct reap_kill_tracker_head tracker; + struct reap_kill_tracker *t; + int error; sx_assert(&proctree_lock, SX_LOCKED); if (IN_CAPABILITY_MODE(td)) return (ECAPMODE); - if (rk->rk_sig <= 0 || rk->rk_sig > _SIG_MAXSIG) + if (rk->rk_sig <= 0 || rk->rk_sig > _SIG_MAXSIG || + (rk->rk_flags & ~(REAPER_KILL_CHILDREN | + REAPER_KILL_SUBTREE)) != 0 || (rk->rk_flags & + (REAPER_KILL_CHILDREN | REAPER_KILL_SUBTREE)) == + (REAPER_KILL_CHILDREN | REAPER_KILL_SUBTREE)) return (EINVAL); - if ((rk->rk_flags & ~(REAPER_KILL_CHILDREN | REAPER_KILL_SUBTREE)) != 0) - return (EINVAL); PROC_UNLOCK(p); reap = (p->p_treeflag & P_TREE_REAPER) == 0 ? p->p_reaper : p; ksiginfo_init(&ksi); @@ -255,26 +297,33 @@ reap_kill(struct thread *td, struct proc *p, struct pr error = ESRCH; rk->rk_killed = 0; rk->rk_fpid = -1; - for (p2 = (rk->rk_flags & REAPER_KILL_CHILDREN) != 0 ? - LIST_FIRST(&reap->p_children) : LIST_FIRST(&reap->p_reaplist); - p2 != NULL; - p2 = (rk->rk_flags & REAPER_KILL_CHILDREN) != 0 ? - LIST_NEXT(p2, p_sibling) : LIST_NEXT(p2, p_reapsibling)) { - if ((rk->rk_flags & REAPER_KILL_SUBTREE) != 0 && - p2->p_reapsubtree != rk->rk_subtree) - continue; - PROC_LOCK(p2); - error1 = p_cansignal(td, p2, rk->rk_sig); - if (error1 == 0) { - pksignal(p2, rk->rk_sig, &ksi); - rk->rk_killed++; - error = error1; - } else if (error == ESRCH) { - error = error1; - rk->rk_fpid = p2->p_pid; + if ((rk->rk_flags & REAPER_KILL_CHILDREN) != 0) { + for (p2 = LIST_FIRST(&reap->p_children); p2 != NULL; + p2 = LIST_NEXT(p2, p_sibling)) { + reap_kill_proc(td, p2, &ksi, rk, &error); + /* + * Do not end the loop on error, signal + * everything we can. + */ } - PROC_UNLOCK(p2); - /* Do not end the loop on error, signal everything we can. */ + } else { + TAILQ_INIT(&tracker); + reap_kill_sched(&tracker, reap); + while ((t = TAILQ_FIRST(&tracker)) != NULL) { + MPASS((t->parent->p_treeflag & P_TREE_REAPER) != 0); + TAILQ_REMOVE(&tracker, t, link); + for (p2 = LIST_FIRST(&t->parent->p_reaplist); p2 != NULL; + p2 = LIST_NEXT(p2, p_reapsibling)) { + if (t->parent == reap && + (rk->rk_flags & REAPER_KILL_SUBTREE) != 0 && + p2->p_reapsubtree != rk->rk_subtree) + continue; + if ((p2->p_treeflag & P_TREE_REAPER) != 0) + reap_kill_sched(&tracker, p2); + reap_kill_proc(td, p2, &ksi, rk, &error); + } + free(t, M_TEMP); + } } PROC_LOCK(p); return (error); Modified: head/sys/sys/procctl.h ============================================================================== --- head/sys/sys/procctl.h Thu Nov 23 10:34:38 2017 (r326121) +++ head/sys/sys/procctl.h Thu Nov 23 11:25:11 2017 (r326122) @@ -83,6 +83,7 @@ struct procctl_reaper_pidinfo { #define REAPER_PIDINFO_VALID 0x00000001 #define REAPER_PIDINFO_CHILD 0x00000002 +#define REAPER_PIDINFO_REAPER 0x00000004 struct procctl_reaper_pids { u_int rp_count; From owner-svn-src-head@freebsd.org Thu Nov 23 11:40: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 09A68DE8948; Thu, 23 Nov 2017 11:40:19 +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 C8A616778E; Thu, 23 Nov 2017 11:40:18 +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 vANBeHp0065190; Thu, 23 Nov 2017 11:40:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANBeG9b065176; Thu, 23 Nov 2017 11:40:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711231140.vANBeG9b065176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Nov 2017 11:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326123 - in head: include sys/amd64/include sys/i386/include sys/sys sys/x86/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: include sys/amd64/include sys/i386/include sys/sys sys/x86/include X-SVN-Commit-Revision: 326123 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 11:40:19 -0000 Author: kib Date: Thu Nov 23 11:40:16 2017 New Revision: 326123 URL: https://svnweb.freebsd.org/changeset/base/326123 Log: Remove lint support from system headers and MD x86 headers. Reviewed by: dim, jhb Discussed with: imp Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D13156 Modified: head/include/stdlib.h head/sys/amd64/include/asm.h head/sys/amd64/include/pcpu.h head/sys/amd64/include/profile.h head/sys/i386/include/asm.h head/sys/i386/include/pcpu.h head/sys/i386/include/profile.h head/sys/sys/cdefs.h head/sys/sys/linker_set.h head/sys/sys/param.h head/sys/x86/include/_types.h head/sys/x86/include/bus.h head/sys/x86/include/stdarg.h head/sys/x86/include/ucontext.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/include/stdlib.h Thu Nov 23 11:40:16 2017 (r326123) @@ -238,17 +238,13 @@ extern void (*malloc_message)(void *, const char *); /* * The alloca() function can't be implemented in C, and on some * platforms it can't be implemented at all as a callable function. - * The GNU C compiler provides a built-in alloca() which we can use; - * in all other cases, provide a prototype, mainly to pacify various - * incarnations of lint. On platforms where alloca() is not in libc, - * programs which use it will fail to link when compiled with non-GNU - * compilers. + * The GNU C compiler provides a built-in alloca() which we can use. + * On platforms where alloca() is not in libc, programs which use it + * will fail to link when compiled with non-GNU compilers. */ #if __GNUC__ >= 2 || defined(__INTEL_COMPILER) #undef alloca /* some GNU bits try to get cute and define this on their own */ #define alloca(sz) __builtin_alloca(sz) -#elif defined(lint) -void *alloca(size_t); #endif void abort2(const char *, int, void **) __dead2; Modified: head/sys/amd64/include/asm.h ============================================================================== --- head/sys/amd64/include/asm.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/amd64/include/asm.h Thu Nov 23 11:40:16 2017 (r326123) @@ -92,10 +92,10 @@ #define RCSID(x) .text; .asciz x #undef __FBSDID -#if !defined(lint) && !defined(STRIP_FBSDID) +#if !defined(STRIP_FBSDID) #define __FBSDID(s) .ident s #else #define __FBSDID(s) /* nothing */ -#endif /* not lint and not STRIP_FBSDID */ +#endif /* !STRIP_FBSDID */ #endif /* !_MACHINE_ASM_H_ */ Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/amd64/include/pcpu.h Thu Nov 23 11:40:16 2017 (r326123) @@ -74,19 +74,8 @@ #ifdef _KERNEL -#ifdef lint +#if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) -extern struct pcpu *pcpup; - -#define get_pcpu() (pcpup) -#define PCPU_GET(member) (pcpup->pc_ ## member) -#define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val)) -#define PCPU_INC(member) PCPU_ADD(member, 1) -#define PCPU_PTR(member) (&pcpup->pc_ ## member) -#define PCPU_SET(member, val) (pcpup->pc_ ## member = (val)) - -#elif defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) - /* * Evaluates to the byte offset of the per-cpu variable name. */ @@ -251,11 +240,11 @@ __curpcb(void) #define IS_BSP() (PCPU_GET(cpuid) == 0) -#else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ +#else /* !__GNUCLIKE_ASM || !__GNUCLIKE___TYPEOF */ #error "this file needs to be ported to your compiler" -#endif /* lint, etc. */ +#endif /* __GNUCLIKE_ASM && __GNUCLIKE___TYPEOF */ #endif /* _KERNEL */ Modified: head/sys/amd64/include/profile.h ============================================================================== --- head/sys/amd64/include/profile.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/amd64/include/profile.h Thu Nov 23 11:40:16 2017 (r326123) @@ -71,10 +71,6 @@ : "ax", "dx", "cx", "di", "si", "r8", "r9", "memory") #define MEXITCOUNT_OVERHEAD_GETLABEL(labelp) \ __asm __volatile("movq $1b,%0" : "=rm" (labelp)) -#elif defined(lint) -#define MCOUNT_OVERHEAD(label) -#define MEXITCOUNT_OVERHEAD() -#define MEXITCOUNT_OVERHEAD_GETLABEL() #else #error this file needs to be ported to your compiler #endif /* !__GNUCLIKE_ASM */ Modified: head/sys/i386/include/asm.h ============================================================================== --- head/sys/i386/include/asm.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/i386/include/asm.h Thu Nov 23 11:40:16 2017 (r326123) @@ -113,10 +113,10 @@ #define RCSID(x) .text; .asciz x #undef __FBSDID -#if !defined(lint) && !defined(STRIP_FBSDID) +#if !defined(STRIP_FBSDID) #define __FBSDID(s) .ident s #else #define __FBSDID(s) /* nothing */ -#endif /* not lint and not STRIP_FBSDID */ +#endif /* not STRIP_FBSDID */ #endif /* !_MACHINE_ASM_H_ */ Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/i386/include/pcpu.h Thu Nov 23 11:40:16 2017 (r326123) @@ -72,19 +72,8 @@ #ifdef _KERNEL -#ifdef lint +#if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) -extern struct pcpu *pcpup; - -#define get_pcpu() (pcpup) -#define PCPU_GET(member) (pcpup->pc_ ## member) -#define PCPU_ADD(member, val) (pcpup->pc_ ## member += (val)) -#define PCPU_INC(member) PCPU_ADD(member, 1) -#define PCPU_PTR(member) (&pcpup->pc_ ## member) -#define PCPU_SET(member, val) (pcpup->pc_ ## member = (val)) - -#elif defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) - /* * Evaluates to the byte offset of the per-cpu variable name. */ @@ -242,11 +231,11 @@ __curpcb(void) } #define curpcb (__curpcb()) -#else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ +#else /* defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ #error "this file needs to be ported to your compiler" -#endif /* lint, etc. */ +#endif /* __GNUCLIKE_ASM etc. */ #endif /* _KERNEL */ Modified: head/sys/i386/include/profile.h ============================================================================== --- head/sys/i386/include/profile.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/i386/include/profile.h Thu Nov 23 11:40:16 2017 (r326123) @@ -71,10 +71,6 @@ : "ax", "dx", "cx", "memory") #define MEXITCOUNT_OVERHEAD_GETLABEL(labelp) \ __asm __volatile("movl $1b,%0" : "=rm" (labelp)) -#elif defined(lint) -#define MCOUNT_OVERHEAD(label) -#define MEXITCOUNT_OVERHEAD() -#define MEXITCOUNT_OVERHEAD_GETLABEL() #else #error #endif /* !__GNUCLIKE_ASM */ Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/sys/cdefs.h Thu Nov 23 11:40:16 2017 (r326123) @@ -207,17 +207,6 @@ * for a given compiler, let the compile fail if it is told to use * a feature that we cannot live without. */ -#ifdef lint -#define __dead2 -#define __pure2 -#define __unused -#define __packed -#define __aligned(x) -#define __alloc_align(x) -#define __alloc_size(x) -#define __section(x) -#define __weak_symbol -#else #define __weak_symbol __attribute__((__weak__)) #if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) #define __dead2 @@ -249,7 +238,6 @@ #else #define __alloc_align(x) #endif -#endif /* lint */ #if !__GNUC_PREREQ__(2, 95) #define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) @@ -259,7 +247,7 @@ * Keywords added in C11. */ -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L || defined(lint) +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L #if !__has_extension(c_alignas) #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ @@ -425,7 +413,7 @@ * software that is unaware of C99 keywords. */ #if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint) +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 #define __restrict #else #define __restrict restrict @@ -819,7 +807,7 @@ */ #if __has_attribute(__argument_with_type_tag__) && \ - __has_attribute(__type_tag_for_datatype__) && !defined(lint) + __has_attribute(__type_tag_for_datatype__) #define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \ __attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx))) #define __datatype_type_tag(kind, type) \ Modified: head/sys/sys/linker_set.h ============================================================================== --- head/sys/sys/linker_set.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/sys/linker_set.h Thu Nov 23 11:40:16 2017 (r326123) @@ -61,10 +61,7 @@ __set_##set##_sym_##sym __section("set_" #set) \ __used = &(sym) #else /* !__GNUCLIKE___SECTION */ -#ifndef lint #error this file needs to be ported to your compiler -#endif /* lint */ -#define __MAKE_SET(set, sym) extern void const * const (__set_##set##_sym_##sym) #endif /* __GNUCLIKE___SECTION */ /* Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/sys/param.h Thu Nov 23 11:40:16 2017 (r326123) @@ -321,7 +321,6 @@ __END_DECLS #endif #endif -#ifndef lint #ifndef _BYTEORDER_FUNC_DEFINED #define _BYTEORDER_FUNC_DEFINED #define htonl(x) __htonl(x) @@ -329,7 +328,6 @@ __END_DECLS #define ntohl(x) __ntohl(x) #define ntohs(x) __ntohs(x) #endif /* !_BYTEORDER_FUNC_DEFINED */ -#endif /* lint */ #endif /* _KERNEL */ /* Modified: head/sys/x86/include/_types.h ============================================================================== --- head/sys/x86/include/_types.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/x86/include/_types.h Thu Nov 23 11:40:16 2017 (r326123) @@ -62,15 +62,9 @@ typedef unsigned int __uint32_t; typedef long __int64_t; typedef unsigned long __uint64_t; #else -#ifndef lint __extension__ -#endif -/* LONGLONG */ typedef long long __int64_t; -#ifndef lint __extension__ -#endif -/* LONGLONG */ typedef unsigned long long __uint64_t; #endif Modified: head/sys/x86/include/bus.h ============================================================================== --- head/sys/x86/include/bus.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/x86/include/bus.h Thu Nov 23 11:40:16 2017 (r326123) @@ -101,9 +101,7 @@ #include #ifndef __GNUCLIKE_ASM -# ifndef lint -# error "no assembler code for your compiler" -# endif +#error "no assembler code for your compiler" #endif /* Modified: head/sys/x86/include/stdarg.h ============================================================================== --- head/sys/x86/include/stdarg.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/x86/include/stdarg.h Thu Nov 23 11:40:16 2017 (r326123) @@ -60,18 +60,6 @@ typedef __va_list va_list; #define va_end(ap) \ __builtin_va_end(ap) -#elif defined(lint) -/* Provide a fake implementation for lint's benefit */ -#define __va_size(type) \ - (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) -#define va_start(ap, last) \ - ((ap) = (va_list)&(last) + __va_size(last)) -#define va_copy(dst, src) \ - ((dst) = (src)) -#define va_arg(ap, type) \ - (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) -#define va_end(ap) - #else #error this file needs to be ported to your compiler #endif Modified: head/sys/x86/include/ucontext.h ============================================================================== --- head/sys/x86/include/ucontext.h Thu Nov 23 11:25:11 2017 (r326122) +++ head/sys/x86/include/ucontext.h Thu Nov 23 11:40:16 2017 (r326123) @@ -162,9 +162,4 @@ typedef struct __mcontext { } mcontext_t; #endif /* __amd64__ */ -#ifdef __LINT__ -typedef struct __mcontext { -} mcontext_t; -#endif /* __LINT__ */ - #endif /* !_X86_UCONTEXT_H_ */ From owner-svn-src-head@freebsd.org Thu Nov 23 12:41: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 1D3B8DEBD04; Thu, 23 Nov 2017 12:41: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 D7ED069A8C; Thu, 23 Nov 2017 12:41:06 +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 vANCf56W091346; Thu, 23 Nov 2017 12:41:05 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANCf58n091345; Thu, 23 Nov 2017 12:41:05 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201711231241.vANCf58n091345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 23 Nov 2017 12:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326125 - head/usr.sbin/kgmon X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/usr.sbin/kgmon X-SVN-Commit-Revision: 326125 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 12:41:07 -0000 Author: trasz Date: Thu Nov 23 12:41:05 2017 New Revision: 326125 URL: https://svnweb.freebsd.org/changeset/base/326125 Log: Mark kgmon(8) obsolete, redirecting users to pmcstat(8). MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12574 Modified: head/usr.sbin/kgmon/kgmon.8 Modified: head/usr.sbin/kgmon/kgmon.8 ============================================================================== --- head/usr.sbin/kgmon/kgmon.8 Thu Nov 23 12:25:11 2017 (r326124) +++ head/usr.sbin/kgmon/kgmon.8 Thu Nov 23 12:41:05 2017 (r326125) @@ -28,7 +28,7 @@ .\" @(#)kgmon.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd November 23, 2017 .Dt KGMON 8 .Os .Sh NAME @@ -40,6 +40,13 @@ .Op Fl M Ar core .Op Fl N Ar system .Sh DESCRIPTION +.Bf -symbolic +This command is obsolete. +Users are advised to use +.Xr pmcstat 8 +instead. +.Ef +.Pp The .Nm utility is used when profiling the operating system. From owner-svn-src-head@freebsd.org Thu Nov 23 13:10: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 C8CC1DEC5D7; Thu, 23 Nov 2017 13:10:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5496A873; Thu, 23 Nov 2017 13:10:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 5A12D1A2695; Fri, 24 Nov 2017 00:10:10 +1100 (AEDT) Date: Fri, 24 Nov 2017 00:10:09 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat In-Reply-To: <20171122220538.GT2272@kib.kiev.ua> Message-ID: <20171123224032.A992@besplex.bde.org> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> <20171122103917.GS2272@kib.kiev.ua> <20171123021646.M1933@besplex.bde.org> <20171122220538.GT2272@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=bc8baKHB c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=DczsMeIL0fzAE1lkYZ0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 13:10:18 -0000 On Thu, 23 Nov 2017, Konstantin Belousov wrote: > On Thu, Nov 23, 2017 at 04:24:13AM +1100, Bruce Evans wrote: >> sysctl/sysctl.c: >> sysctl(8) has bogus support for prettyprinting struct vmtotal (sysctl >> shouldn't have any prettyprinting, especially not for structs that have >> specialized programs to print them and much more). This uses intmax_t >> for all calculations and printing except for the int16_t fields, so it >> automatically benefited from the expansion. However since it uses a >> correct type (signed, and not restricted to 64 bits), it now has minor >> type errors -- it dowcasts the uint64_t to intmax_t wheen the latter is >> 64 bits. Its Makefile uses a fairly high WARNS, so if its type errors >> were fatal then printf format checking would have detected them (but >> not non-fatal errors involving downcasting). > > Below is the cast to uintmax_t and unsigned format for sysctl(8). This adds style bugs by expanding lines from length 79 to 81. > diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c > index e1bf4e31914..92685a8171b 100644 > --- a/sbin/sysctl/sysctl.c > +++ b/sbin/sysctl/sysctl.c > @@ -625,15 +625,15 @@ S_vmtotal(size_t l2, void *p) > "%hd Sleep: %hd)\n", > v->t_rq, v->t_dw, v->t_pw, v->t_sl); > printf( > - "Virtual Memory:\t\t(Total: %jdK Active: %jdK)\n", > - (intmax_t)v->t_vm * pageKilo, (intmax_t)v->t_avm * pageKilo); > - printf("Real Memory:\t\t(Total: %jdK Active: %jdK)\n", > - (intmax_t)v->t_rm * pageKilo, (intmax_t)v->t_arm * pageKilo); > - printf("Shared Virtual Memory:\t(Total: %jdK Active: %jdK)\n", > - (intmax_t)v->t_vmshr * pageKilo, (intmax_t)v->t_avmshr * pageKilo); > - printf("Shared Real Memory:\t(Total: %jdK Active: %jdK)\n", > - (intmax_t)v->t_rmshr * pageKilo, (intmax_t)v->t_armshr * pageKilo); > - printf("Free Memory:\t%jdK", (intmax_t)v->t_free * pageKilo); > + "Virtual Memory:\t\t(Total: %juK Active: %juK)\n", > + (uintmax_t)v->t_vm * pageKilo, (uintmax_t)v->t_avm * pageKilo); > + printf("Real Memory:\t\t(Total: %juK Active: %juK)\n", > + (uintmax_t)v->t_rm * pageKilo, (uintmax_t)v->t_arm * pageKilo); > + printf("Shared Virtual Memory:\t(Total: %juK Active: %juK)\n", > + (uintmax_t)v->t_vmshr * pageKilo, (uintmax_t)v->t_avmshr * pageKilo); > + printf("Shared Real Memory:\t(Total: %juK Active: %juK)\n", > + (uintmax_t)v->t_rmshr * pageKilo, (uintmax_t)v->t_armshr * pageKilo); > + printf("Free Memory:\t%juK", (uintmax_t)v->t_free * pageKilo); > > return (0); > } All of the casts to uintmax_t can be avoided be avoided by changing the type of pageKilo from int to uintmax_t. Better, do the conversion in a function-like macro pgtokb() as is done in all (?) other utilities, but without so many overflow bugs as in most other utiities: #define pgtok(p) ((uintmax_t)(p) * pageKilo) (pageKilo is back to int). This is still sloppy: - pageKilo = getpagesize() / 1024 assumes that the page size is a multiple of 1024 and fails very badly when the page size is 512 - the multiplication can still overflow - when the size in K is too large to fit, the size in M or G will normally fit and converting directly to would avoid the overflow assuming that the page size is <= 1M. Using floating point (even float precision) avoids all overflow and rounding problems up to almost 128-bit sizes in bytes: #define pgtok(p) ((p) * pageKilo) /* any integer type * float */ ... float pageKilo; ... pageKilo = getpagesize() / 1024; p = INT128_MAX is slightly too large to convert to float. p = UINT64_MAX fits in float with reduced precision. No one cares about printing more that FLT_DIG = 6 digits for memory sizes, but use double instead of float if you want to fit INT128_MAX and print up to DBL_DIG = 15 digits. Then for printing, change all %jd and %ju to %.0f. In, systat, remove all new printing functions and use putfloat. The problem of printing large values is still there: putfloat might print 4TB bytes as 4398046511k K's or 4398047M K's (where k means 1000, K means 1024 but M means 1000000 and the K's suffix is implicit, but the new printing function is little better -- it prints 4294962966K K's or 4194304M K's instead. Bruce From owner-svn-src-head@freebsd.org Thu Nov 23 13:57: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 61E8DDED5F9; Thu, 23 Nov 2017 13:57:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BA3B6BF1A; Thu, 23 Nov 2017 13:57:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vANDvjoH024663; Thu, 23 Nov 2017 13:57:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANDvjFo024660; Thu, 23 Nov 2017 13:57:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711231357.vANDvjFo024660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 23 Nov 2017 13:57:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326127 - in head/sys/dev: iscsi iser X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev: iscsi iser X-SVN-Commit-Revision: 326127 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 13:57:46 -0000 Author: hselasky Date: Thu Nov 23 13:57:44 2017 New Revision: 326127 URL: https://svnweb.freebsd.org/changeset/base/326127 Log: Make sure the iSCSI I/O limits are set properly so that the ISCSIDSEND IOCTL can be used prior to the ISCSIDHANDOFF IOCTL which set the negotiated values. Else the login PDU will fail when passing the "-r" option to "iscsictl" which means iSCSI over RDMA instead of TCP/IP. Discussed with: np@ and trasz@ Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/iscsi/icl_soft.c head/sys/dev/iscsi/iscsi.c head/sys/dev/iser/icl_iser.c Modified: head/sys/dev/iscsi/icl_soft.c ============================================================================== --- head/sys/dev/iscsi/icl_soft.c Thu Nov 23 12:54:18 2017 (r326126) +++ head/sys/dev/iscsi/icl_soft.c Thu Nov 23 13:57:44 2017 (r326127) @@ -1449,6 +1449,9 @@ icl_soft_limits(struct icl_drv_limits *idl) { idl->idl_max_recv_data_segment_length = 128 * 1024; + idl->idl_max_send_data_segment_length = 128 * 1024; + idl->idl_max_burst_length = 262144; + idl->idl_first_burst_length = 65536; return (0); } Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Thu Nov 23 12:54:18 2017 (r326126) +++ head/sys/dev/iscsi/iscsi.c Thu Nov 23 13:57:44 2017 (r326127) @@ -1787,6 +1787,18 @@ iscsi_ioctl_session_add(struct iscsi_softc *sc, struct is = malloc(sizeof(*is), M_ISCSI, M_ZERO | M_WAITOK); memcpy(&is->is_conf, &isa->isa_conf, sizeof(is->is_conf)); + /* + * Set some default values, from RFC 3720, section 12. + * + * These values are updated by the handoff IOCTL, but are + * needed prior to the handoff to support sending the ISER + * login PDU. + */ + is->is_max_recv_data_segment_length = 8192; + is->is_max_send_data_segment_length = 8192; + is->is_max_burst_length = 262144; + is->is_first_burst_length = 65536; + sx_xlock(&sc->sc_lock); /* Modified: head/sys/dev/iser/icl_iser.c ============================================================================== --- head/sys/dev/iser/icl_iser.c Thu Nov 23 12:54:18 2017 (r326126) +++ head/sys/dev/iser/icl_iser.c Thu Nov 23 13:57:44 2017 (r326127) @@ -486,7 +486,11 @@ iser_conn_task_done(struct icl_conn *ic, void *prv) static int iser_limits(struct icl_drv_limits *idl) { + idl->idl_max_recv_data_segment_length = 128 * 1024; + idl->idl_max_send_data_segment_length = 128 * 1024; + idl->idl_max_burst_length = 262144; + idl->idl_first_burst_length = 65536; return (0); } From owner-svn-src-head@freebsd.org Thu Nov 23 14:07: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 BE4F2DEDAB9; Thu, 23 Nov 2017 14:07:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 886726C89F; Thu, 23 Nov 2017 14:07:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vANE7qAf029110; Thu, 23 Nov 2017 14:07:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANE7qMm029107; Thu, 23 Nov 2017 14:07:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711231407.vANE7qMm029107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Nov 2017 14:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326132 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 326132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 14:07:53 -0000 Author: markj Date: Thu Nov 23 14:07:52 2017 New Revision: 326132 URL: https://svnweb.freebsd.org/changeset/base/326132 Log: Allow kern.geom.mirror.debug to be negative. A negative value can be used to suppress all prints from the gmirror kernel code, which can be useful when attempting to trigger race conditions using stress tests. MFC after: 1 week Modified: head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Thu Nov 23 14:03:10 2017 (r326131) +++ head/sys/geom/mirror/g_mirror.c Thu Nov 23 14:07:52 2017 (r326132) @@ -54,8 +54,8 @@ static MALLOC_DEFINE(M_MIRROR, "mirror_data", "GEOM_MI SYSCTL_DECL(_kern_geom); static SYSCTL_NODE(_kern_geom, OID_AUTO, mirror, CTLFLAG_RW, 0, "GEOM_MIRROR stuff"); -u_int g_mirror_debug = 0; -SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, debug, CTLFLAG_RWTUN, &g_mirror_debug, 0, +int g_mirror_debug = 0; +SYSCTL_INT(_kern_geom_mirror, OID_AUTO, debug, CTLFLAG_RWTUN, &g_mirror_debug, 0, "Debug level"); static u_int g_mirror_timeout = 4; SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, timeout, CTLFLAG_RWTUN, &g_mirror_timeout, Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Thu Nov 23 14:03:10 2017 (r326131) +++ head/sys/geom/mirror/g_mirror.h Thu Nov 23 14:07:52 2017 (r326132) @@ -72,7 +72,7 @@ G_MIRROR_DEVICE_FLAG_NOFAILSYNC) #ifdef _KERNEL -extern u_int g_mirror_debug; +extern int g_mirror_debug; #define G_MIRROR_DEBUG(lvl, ...) do { \ if (g_mirror_debug >= (lvl)) { \ From owner-svn-src-head@freebsd.org Thu Nov 23 14:29: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 5218ADEE26D; Thu, 23 Nov 2017 14:29:09 +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 1BF406D604; Thu, 23 Nov 2017 14:29:09 +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 vANET83v038485; Thu, 23 Nov 2017 14:29:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANET8R2038484; Thu, 23 Nov 2017 14:29:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711231429.vANET8R2038484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Nov 2017 14:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326134 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Commit-Revision: 326134 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 14:29:09 -0000 Author: markj Date: Thu Nov 23 14:29:07 2017 New Revision: 326134 URL: https://svnweb.freebsd.org/changeset/base/326134 Log: Duplicate helpers after disabling inherited tracepoints during a fork. We may create probes in the nascent child process, so we first need to ensure that any inherited tracepoints are first removed. Otherwise the probe sites will not be in the state expected by fasttrap, and it won't be able to enable the probes. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Nov 23 14:28:14 2017 (r326133) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Thu Nov 23 14:29:07 2017 (r326134) @@ -601,8 +601,8 @@ fasttrap_fork(proc_t *p, proc_t *cp) pid_t ppid = p->p_pid; int i; -#ifdef illumos ASSERT(curproc == p); +#ifdef illumos ASSERT(p->p_proc_flag & P_PR_LOCK); #else PROC_LOCK_ASSERT(p, MA_OWNED); @@ -610,26 +610,15 @@ fasttrap_fork(proc_t *p, proc_t *cp) #ifdef illumos ASSERT(p->p_dtrace_count > 0); #else - if (p->p_dtrace_helpers) { - /* - * dtrace_helpers_duplicate() allocates memory. - */ - _PHOLD(cp); - PROC_UNLOCK(p); - PROC_UNLOCK(cp); - dtrace_helpers_duplicate(p, cp); - PROC_LOCK(cp); - PROC_LOCK(p); - _PRELE(cp); - } /* * This check is purposely here instead of in kern_fork.c because, * for legal resons, we cannot include the dtrace_cddl.h header * inside kern_fork.c and insert if-clause there. */ - if (p->p_dtrace_count == 0) + if (p->p_dtrace_count == 0 && p->p_dtrace_helpers == NULL) return; #endif + ASSERT(cp->p_dtrace_count == 0); /* @@ -658,6 +647,8 @@ fasttrap_fork(proc_t *p, proc_t *cp) _PHOLD(cp); PROC_UNLOCK(cp); PROC_UNLOCK(p); + if (p->p_dtrace_count == 0) + goto dup_helpers; #endif /* @@ -711,6 +702,9 @@ fasttrap_fork(proc_t *p, proc_t *cp) mutex_enter(&cp->p_lock); sprunlock(cp); #else +dup_helpers: + if (p->p_dtrace_helpers != NULL) + dtrace_helpers_duplicate(p, cp); PROC_LOCK(p); PROC_LOCK(cp); _PRELE(cp); From owner-svn-src-head@freebsd.org Thu Nov 23 14:30: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 0E9B1DEE32C; Thu, 23 Nov 2017 14:30:43 +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 CD0426D77F; Thu, 23 Nov 2017 14:30:42 +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 vANEUfxp038612; Thu, 23 Nov 2017 14:30:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANEUfxp038611; Thu, 23 Nov 2017 14:30:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711231430.vANEUfxp038611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Nov 2017 14:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326135 - head/contrib/binutils/bfd X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/binutils/bfd X-SVN-Commit-Revision: 326135 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 14:30:43 -0000 Author: emaste Date: Thu Nov 23 14:30:41 2017 New Revision: 326135 URL: https://svnweb.freebsd.org/changeset/base/326135 Log: bfd: fix segfault in the ihex parser on malformed ihex file From binutils commit 0102ea8cec5fc509bba6c91df61b7ce23a799d32, made available under GPLv2 by Nick Clifton. PR: 198824 MFC after: 1 week Security: CVE-2014-8503 Modified: head/contrib/binutils/bfd/ihex.c Modified: head/contrib/binutils/bfd/ihex.c ============================================================================== --- head/contrib/binutils/bfd/ihex.c Thu Nov 23 14:29:07 2017 (r326134) +++ head/contrib/binutils/bfd/ihex.c Thu Nov 23 14:30:41 2017 (r326135) @@ -320,7 +320,7 @@ ihex_scan (bfd *abfd) { if (! ISHEX (buf[i])) { - ihex_bad_byte (abfd, lineno, hdr[i], error); + ihex_bad_byte (abfd, lineno, buf[i], error); goto error_return; } } From owner-svn-src-head@freebsd.org Thu Nov 23 14:38: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 85D4ADEE5E0; Thu, 23 Nov 2017 14:38:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF436DC3E; Thu, 23 Nov 2017 14:38:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id A99671A26B0; Fri, 24 Nov 2017 01:38:04 +1100 (AEDT) Date: Fri, 24 Nov 2017 01:38:03 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Edward Tomasz Napierala cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326125 - head/usr.sbin/kgmon In-Reply-To: <201711231241.vANCf58n091345@repo.freebsd.org> Message-ID: <20171124002239.T1335@besplex.bde.org> References: <201711231241.vANCf58n091345@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=K3iUa49lGXHlmSPsME0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 14:38:06 -0000 On Thu, 23 Nov 2017, Edward Tomasz Napierala wrote: > Log: > Mark kgmon(8) obsolete, redirecting users to pmcstat(8). It isn't obsolete. pmcstat can't do at least full (non-statistical) call graphs and high-resolution profiling. gmon in the kernel is slow to use in the SMP case and dangerous to use in all cases, but usually works for call graphs. In the SMP case, it uses a giant spinlock which is slow and gives deadlock when a non-maskable trap like an NMI or debugger trap occurs while the lock is held by the same CPU. In the !SMP case, it uses interrupt disabling to lock. This races instead of deadlocking for non-maskable traps while it is held. Ordinary mutexes have the same problems, and only work if NMI and debugger trap handlers don't use any mutexes that might be held by the interrupted context. Broken cases mostly involve broken locking in printf() and console drivers. High-resolution profiling was broken by gcc-4.2.1 and is more broken for clang. Only the parts written in asm sort of work, and no parts ever worked right for SMP. All these bugs are except the slowness from giant locking are fixed for gcc-4.2.1 in some of my versions, using better giant locking with a timeout on it to avoid deadlocking. When deadlock is detected, profiling is skipped. My fixes for printf() and console drivers are similar except fot trying harder to not skip (switch to alternative methods). pmc also can't do better than nothing for cases involving NMIs even when they aren't near deadlock. Ordinary profiling can do better, and high resolution profiling can do better still. E.g., for profiling an NMI handler, pmc can't generate NMIs to even sample it statistically, but ordinary profiling can see it whenever the NMI doesn't occur while the profiling lock is held. Ordinary profiling then gives an exact call graph, but broken statistical sampling for times since generating hardclock interrupts in an NMI (and other contexts) is even more impossible than generating an NMI for pmc. High-resolution profiling gives almost exact times (or perfmon counts) even in NMI handlers except in the near-deadlock case. Bruce From owner-svn-src-head@freebsd.org Thu Nov 23 14:57: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 86311DEEE20; Thu, 23 Nov 2017 14:57:02 +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 69DD26E67B; Thu, 23 Nov 2017 14:57:01 +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 vANEurfH091277; Thu, 23 Nov 2017 06:56:53 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vANEuodh091276; Thu, 23 Nov 2017 06:56:50 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201711231456.vANEuodh091276@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts In-Reply-To: <20171123105324.8726e4e5c0471f87ea9c4089@bidouilliste.com> To: Emmanuel Vadot Date: Thu, 23 Nov 2017 06:56:50 -0800 (PST) CC: Devin Teske , Ian Lepore , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 14:57:02 -0000 > > Hi Devin, > > On Thu, 23 Nov 2017 01:33:39 -0800 > Devin Teske wrote: > > > > > > > > On Nov 22, 2017, at 11:15 PM, Emmanuel Vadot wrote: > > > > > >> On 2017-11-22 17:38, Ian Lepore wrote: > > >>> On Wed, 2017-11-22 at 15:27 +0000, Emmanuel Vadot wrote: > > >>> Author: manu > > >>> Date: Wed Nov 22 15:27:47 2017 > > >>> New Revision: 326095 > > >>> URL: https://svnweb.freebsd.org/changeset/base/326095 > > >>> Log: > > >>> bsdinstall: Add ntpdate option > > >>> > > >>> When you install a computer for the first time, the date in the CMOS sometimes > > >>> not accurate and you need to ntpdate as ntpd will fail a the time difference > > >>> is too big. > > >>> Add an option in bsdinstall to enable ntpdate that will do that for us. > > >>> > > >>> Reviewed by: allanjude > > >>> Differential Revision: https://reviews.freebsd.org/D13149 > > >>> Modified: > > >>> head/usr.sbin/bsdinstall/scripts/services > > >>> Modified: head/usr.sbin/bsdinstall/scripts/services > > >>> ============================================================================== > > >>> --- head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:18:11 2017 (r326094) > > >>> +++ head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:27:47 2017 (r326095) > > >>> @@ -46,6 +46,8 @@ DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ > > >>> local_unbound "Local caching validating resolver" ${local_unbound:-off} \ > > >>> sshd "Secure shell daemon" ${sshd_enable:-off} \ > > >>> moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ > > >>> + ntpdate "Synchronize system and network time at bootime" \ > > >>> + ${ntpdate_enable:-off} \ > > >>> ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ > > >>> powerd "Adjust CPU frequency dynamically if supported" \ > > >>> ${powerd_enable:-off} \ > > >> The right way to enable a time-step at boot is to set the rc conf > > >> variable ntpd_sync_on_start to YES. ntpdate has been deprecated for > > >> *years*. > > >> -- Ian > > > > > > Hi Ian, > > > > > > Thanks I didn't know about option -g (nor ntpd_sync_on_start), this bring a few questions : > > > > > > - Is there any reason to not always use -g for ntpd ? As a lambda user I just want my time to be set, no matter what. > > > - Should we remove ntpdate in -current before 12 if it's deprecated ? > > > > > > I'll make the necessary changes according to your (or others) answers. > > > > > > > I would not remove ntpdate. I concur, as ntpdate is trivial to use, ntpd -pg requires a proper /etc/ntp.conf, though that is trival too you well not get what you want if you do not have that. > > Is there a way to make ntpd sync and then quit immediately? > > Just by reading the man I see the -q option which does exactly that. > Setting both -q and -g should have the same behavior than ntpdate (not > tested). ntpd -pg is the preferred method per the ntp.org documentation: https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate > > > If not, sounds like ntpdate serves a purpose not filled by ntpd. > > > > Valid case is someone running a VM that gets paused for days, weeks, or even months at a time. On such a VM it may make more sense to let the clock be only sporadically managed in an adhoc manner. > > > > I personally like to use ntpdate on said VMs because I generally set a timeout on my ssh-agent in said VMs and by managing the clock manually allows me to better control keys loaded. > > > > Pretty sure other people may have other reasons for non-daemonized clock management. > > That's why I asked :) I think that the ntp distribution still contains ntpdate, so long as that is true we should continue to include it in FreeBSD. When/if they remove it from the official ntp distribution then this issue shall need a revist. > > -- > > Devin > > -- > Emmanuel Vadot -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Nov 23 15:04: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 BC562DEF2EB; Thu, 23 Nov 2017 15:04:18 +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 605636EB66; Thu, 23 Nov 2017 15:04:18 +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 vANF4Gsx091311; Thu, 23 Nov 2017 07:04:17 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vANF4GZZ091310; Thu, 23 Nov 2017 07:04:16 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201711231504.vANF4GZZ091310@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r326125 - head/usr.sbin/kgmon In-Reply-To: <201711231241.vANCf58n091345@repo.freebsd.org> To: Edward Tomasz Napierala Date: Thu, 23 Nov 2017 07:04:16 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 15:04:18 -0000 > Author: trasz > Date: Thu Nov 23 12:41:05 2017 > New Revision: 326125 > URL: https://svnweb.freebsd.org/changeset/base/326125 > > Log: > Mark kgmon(8) obsolete, redirecting users to pmcstat(8). If you are planning to remove kgmon you need to make it spit out a warning that it is being depricated in a future release, man page changes are insufficient warning of future removal. See commiters guide, 17.4 > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D12574 > > Modified: > head/usr.sbin/kgmon/kgmon.8 > > Modified: head/usr.sbin/kgmon/kgmon.8 > ============================================================================== > --- head/usr.sbin/kgmon/kgmon.8 Thu Nov 23 12:25:11 2017 (r326124) > +++ head/usr.sbin/kgmon/kgmon.8 Thu Nov 23 12:41:05 2017 (r326125) > @@ -28,7 +28,7 @@ > .\" @(#)kgmon.8 8.1 (Berkeley) 6/6/93 > .\" $FreeBSD$ > .\" > -.Dd June 6, 1993 > +.Dd November 23, 2017 > .Dt KGMON 8 > .Os > .Sh NAME > @@ -40,6 +40,13 @@ > .Op Fl M Ar core > .Op Fl N Ar system > .Sh DESCRIPTION > +.Bf -symbolic > +This command is obsolete. > +Users are advised to use > +.Xr pmcstat 8 > +instead. > +.Ef > +.Pp > The > .Nm > utility is used when profiling the operating system. > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Nov 23 15:08: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 30009DEF47C; Thu, 23 Nov 2017 15:08:23 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E2066EDE6; Thu, 23 Nov 2017 15:08:21 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id cd8d4f43; Thu, 23 Nov 2017 16:08:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=+qC6USOQ6Nokn9rOowpSkwLujk0=; b=F9umZSOdGAyPVF63c0MFe5UODVaa OSb8mEs0wAJmeDVjSlapfP+1VfgfDxv9HXvH+2IZejnOFW6/qlxWh2M6r18iR4kW CBpt5N6wa8rsm+tL7UwD3Aai5jfVTpX7sh++VRXtaVas0h4V0emRmWgy7G0gotbC L4M5WTEgqQKqTtE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=n1sWAzal38y5ipLlUXSemj8pSi1ltPnXP8CbfoYU+8dRgIKkWa65SA/J M6R+N6cjH0DspVfVQoSUWYdkm/hub0/cVXMJil9fNt8mpoOIjFbuO/HigLs1OTAs USALT8WMKyV9Aj+Z+BwqPytFt5jowGJ49SIVV4QGzJykVIGUjz4= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 6474374a TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 23 Nov 2017 16:08:18 +0100 (CET) Date: Thu, 23 Nov 2017 16:08:15 +0100 From: Emmanuel Vadot To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , Devin Teske , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts Message-Id: <20171123160815.2f467f760179901a0ba983f1@bidouilliste.com> In-Reply-To: <201711231456.vANEuodh091276@pdx.rh.CN85.dnsmgr.net> References: <20171123105324.8726e4e5c0471f87ea9c4089@bidouilliste.com> <201711231456.vANEuodh091276@pdx.rh.CN85.dnsmgr.net> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 15:08:23 -0000 On Thu, 23 Nov 2017 06:56:50 -0800 (PST) "Rodney W. Grimes" wrote: > > > > Hi Devin, > > > > On Thu, 23 Nov 2017 01:33:39 -0800 > > Devin Teske wrote: > > > > > > > > > > > > On Nov 22, 2017, at 11:15 PM, Emmanuel Vadot wrote: > > > > > > > >> On 2017-11-22 17:38, Ian Lepore wrote: > > > >>> On Wed, 2017-11-22 at 15:27 +0000, Emmanuel Vadot wrote: > > > >>> Author: manu > > > >>> Date: Wed Nov 22 15:27:47 2017 > > > >>> New Revision: 326095 > > > >>> URL: https://svnweb.freebsd.org/changeset/base/326095 > > > >>> Log: > > > >>> bsdinstall: Add ntpdate option > > > >>> > > > >>> When you install a computer for the first time, the date in the CMOS sometimes > > > >>> not accurate and you need to ntpdate as ntpd will fail a the time difference > > > >>> is too big. > > > >>> Add an option in bsdinstall to enable ntpdate that will do that for us. > > > >>> > > > >>> Reviewed by: allanjude > > > >>> Differential Revision: https://reviews.freebsd.org/D13149 > > > >>> Modified: > > > >>> head/usr.sbin/bsdinstall/scripts/services > > > >>> Modified: head/usr.sbin/bsdinstall/scripts/services > > > >>> ============================================================================== > > > >>> --- head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:18:11 2017 (r326094) > > > >>> +++ head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:27:47 2017 (r326095) > > > >>> @@ -46,6 +46,8 @@ DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ > > > >>> local_unbound "Local caching validating resolver" ${local_unbound:-off} \ > > > >>> sshd "Secure shell daemon" ${sshd_enable:-off} \ > > > >>> moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ > > > >>> + ntpdate "Synchronize system and network time at bootime" \ > > > >>> + ${ntpdate_enable:-off} \ > > > >>> ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ > > > >>> powerd "Adjust CPU frequency dynamically if supported" \ > > > >>> ${powerd_enable:-off} \ > > > >> The right way to enable a time-step at boot is to set the rc conf > > > >> variable ntpd_sync_on_start to YES. ntpdate has been deprecated for > > > >> *years*. > > > >> -- Ian > > > > > > > > Hi Ian, > > > > > > > > Thanks I didn't know about option -g (nor ntpd_sync_on_start), this bring a few questions : > > > > > > > > - Is there any reason to not always use -g for ntpd ? As a lambda user I just want my time to be set, no matter what. > > > > - Should we remove ntpdate in -current before 12 if it's deprecated ? > > > > > > > > I'll make the necessary changes according to your (or others) answers. > > > > > > > > > > I would not remove ntpdate. > > I concur, as ntpdate is trivial to use, ntpd -pg requires a proper /etc/ntp.conf, > though that is trival too you well not get what you want if you do not have > that. From the website you linked after they say to use : ntpd -gqc /dev/null server1.name.net server2.name.org server3.name.com for use without ntp.conf. Also we do provide an ntp.conf so ... > > > Is there a way to make ntpd sync and then quit immediately? > > > > Just by reading the man I see the -q option which does exactly that. > > Setting both -q and -g should have the same behavior than ntpdate (not > > tested). > > ntpd -pg is the preferred method per the ntp.org documentation: > https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate -gq like I said but it's good to have an official reference. > > > > > If not, sounds like ntpdate serves a purpose not filled by ntpd. > > > > > > Valid case is someone running a VM that gets paused for days, weeks, or even months at a time. On such a VM it may make more sense to let the clock be only sporadically managed in an adhoc manner. > > > > > > I personally like to use ntpdate on said VMs because I generally set a timeout on my ssh-agent in said VMs and by managing the clock manually allows me to better control keys loaded. > > > > > > Pretty sure other people may have other reasons for non-daemonized clock management. > > > > That's why I asked :) > > I think that the ntp distribution still contains ntpdate, so long as that is true > we should continue to include it in FreeBSD. When/if they remove it from the > official ntp distribution then this issue shall need a revist. I haven't checked. We can also add a shell script that does what I quoted above. > > > -- > > > Devin > > > > -- > > Emmanuel Vadot > > -- > Rod Grimes rgrimes@freebsd.org -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Nov 23 15:17: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 B5CC0DEF9A0; Thu, 23 Nov 2017 15:17:51 +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 9578B6F36D; Thu, 23 Nov 2017 15:17:51 +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 vANFHnA9091357; Thu, 23 Nov 2017 07:17:49 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vANFHnwR091356; Thu, 23 Nov 2017 07:17:49 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201711231517.vANFHnwR091356@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts In-Reply-To: <20171123160815.2f467f760179901a0ba983f1@bidouilliste.com> To: Emmanuel Vadot Date: Thu, 23 Nov 2017 07:17:49 -0800 (PST) CC: rgrimes@freebsd.org, Devin Teske , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 15:17:51 -0000 > On Thu, 23 Nov 2017 06:56:50 -0800 (PST) > "Rodney W. Grimes" wrote: > > > > > > > Hi Devin, > > > > > > On Thu, 23 Nov 2017 01:33:39 -0800 > > > Devin Teske wrote: > > > > > > > > > > > > > > > > On Nov 22, 2017, at 11:15 PM, Emmanuel Vadot wrote: > > > > > > > > > >> On 2017-11-22 17:38, Ian Lepore wrote: > > > > >>> On Wed, 2017-11-22 at 15:27 +0000, Emmanuel Vadot wrote: > > > > >>> Author: manu > > > > >>> Date: Wed Nov 22 15:27:47 2017 > > > > >>> New Revision: 326095 > > > > >>> URL: https://svnweb.freebsd.org/changeset/base/326095 > > > > >>> Log: > > > > >>> bsdinstall: Add ntpdate option > > > > >>> > > > > >>> When you install a computer for the first time, the date in the CMOS sometimes > > > > >>> not accurate and you need to ntpdate as ntpd will fail a the time difference > > > > >>> is too big. > > > > >>> Add an option in bsdinstall to enable ntpdate that will do that for us. > > > > >>> > > > > >>> Reviewed by: allanjude > > > > >>> Differential Revision: https://reviews.freebsd.org/D13149 > > > > >>> Modified: > > > > >>> head/usr.sbin/bsdinstall/scripts/services > > > > >>> Modified: head/usr.sbin/bsdinstall/scripts/services > > > > >>> ============================================================================== > > > > >>> --- head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:18:11 2017 (r326094) > > > > >>> +++ head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:27:47 2017 (r326095) > > > > >>> @@ -46,6 +46,8 @@ DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ > > > > >>> local_unbound "Local caching validating resolver" ${local_unbound:-off} \ > > > > >>> sshd "Secure shell daemon" ${sshd_enable:-off} \ > > > > >>> moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ > > > > >>> + ntpdate "Synchronize system and network time at bootime" \ > > > > >>> + ${ntpdate_enable:-off} \ > > > > >>> ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ > > > > >>> powerd "Adjust CPU frequency dynamically if supported" \ > > > > >>> ${powerd_enable:-off} \ > > > > >> The right way to enable a time-step at boot is to set the rc conf > > > > >> variable ntpd_sync_on_start to YES. ntpdate has been deprecated for > > > > >> *years*. > > > > >> -- Ian > > > > > > > > > > Hi Ian, > > > > > > > > > > Thanks I didn't know about option -g (nor ntpd_sync_on_start), this bring a few questions : > > > > > > > > > > - Is there any reason to not always use -g for ntpd ? As a lambda user I just want my time to be set, no matter what. > > > > > - Should we remove ntpdate in -current before 12 if it's deprecated ? > > > > > > > > > > I'll make the necessary changes according to your (or others) answers. > > > > > > > > > > > > > I would not remove ntpdate. > > > > I concur, as ntpdate is trivial to use, ntpd -pg requires a proper /etc/ntp.conf, > > though that is trival too you well not get what you want if you do not have > > that. > > From the website you linked after they say to use : > ntpd -gqc /dev/null server1.name.net server2.name.org server3.name.com > for use without ntp.conf. I do not think you want to do that, as if you read just a bit further you see: Possible hitch: ntpd will step the time adjustment if it is more than 128ms (default). This means that a 128ms adjustment will take 256 seconds to apply. We want an option to step any initial offset, I suspect. So even the ntp folks seem to have issues with replacing ntpdate.... > Also we do provide an ntp.conf so ... We do, a template, all commented out, and does not work for machines behind strong firewalls that wont allow ntp out to the net but have internal ntp servers that are used for such things. Well maybe not all commented out, I think it defaults to some public pools. I believe it would be missing iburst for use with ntp -pg > > > > > Is there a way to make ntpd sync and then quit immediately? > > > > > > Just by reading the man I see the -q option which does exactly that. > > > Setting both -q and -g should have the same behavior than ntpdate (not > > > tested). > > > > ntpd -pg is the preferred method per the ntp.org documentation: > > https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate > > -gq like I said but it's good to have an official reference. > > > > > > > > If not, sounds like ntpdate serves a purpose not filled by ntpd. > > > > > > > > Valid case is someone running a VM that gets paused for days, weeks, or even months at a time. On such a VM it may make more sense to let the clock be only sporadically managed in an adhoc manner. > > > > > > > > I personally like to use ntpdate on said VMs because I generally set a timeout on my ssh-agent in said VMs and by managing the clock manually allows me to better control keys loaded. > > > > > > > > Pretty sure other people may have other reasons for non-daemonized clock management. > > > > > > That's why I asked :) > > > > I think that the ntp distribution still contains ntpdate, so long as that is true > > we should continue to include it in FreeBSD. When/if they remove it from the > > official ntp distribution then this issue shall need a revist. > > I haven't checked. > We can also add a shell script that does what I quoted above. We could, but that gets us the bug of time wont be stepped if correct within 128mS and causing a long slow 4 minute slew event. > > > > Devin > > > Emmanuel Vadot > > Rod Grimes rgrimes@freebsd.org > Emmanuel Vadot -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Nov 23 15:18: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 3A38FDEFA49; Thu, 23 Nov 2017 15:18:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDBE76F4DE; Thu, 23 Nov 2017 15:18:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vANFIogr035101 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 23 Nov 2017 17:18:50 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vANFIogr035101 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vANFIo8e035100; Thu, 23 Nov 2017 17:18:50 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 23 Nov 2017 17:18:50 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat Message-ID: <20171123151849.GU2272@kib.kiev.ua> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> <20171122103917.GS2272@kib.kiev.ua> <20171123021646.M1933@besplex.bde.org> <20171122220538.GT2272@kib.kiev.ua> <20171123224032.A992@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171123224032.A992@besplex.bde.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 15:18:57 -0000 On Fri, Nov 24, 2017 at 12:10:09AM +1100, Bruce Evans wrote: > On Thu, 23 Nov 2017, Konstantin Belousov wrote: > > > On Thu, Nov 23, 2017 at 04:24:13AM +1100, Bruce Evans wrote: > >> sysctl/sysctl.c: > >> sysctl(8) has bogus support for prettyprinting struct vmtotal (sysctl > >> shouldn't have any prettyprinting, especially not for structs that have > >> specialized programs to print them and much more). This uses intmax_t > >> for all calculations and printing except for the int16_t fields, so it > >> automatically benefited from the expansion. However since it uses a > >> correct type (signed, and not restricted to 64 bits), it now has minor > >> type errors -- it dowcasts the uint64_t to intmax_t wheen the latter is > >> 64 bits. Its Makefile uses a fairly high WARNS, so if its type errors > >> were fatal then printf format checking would have detected them (but > >> not non-fatal errors involving downcasting). > > > > Below is the cast to uintmax_t and unsigned format for sysctl(8). > > This adds style bugs by expanding lines from length 79 to 81. > > > diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c > > index e1bf4e31914..92685a8171b 100644 > > --- a/sbin/sysctl/sysctl.c > > +++ b/sbin/sysctl/sysctl.c > > @@ -625,15 +625,15 @@ S_vmtotal(size_t l2, void *p) > > "%hd Sleep: %hd)\n", > > v->t_rq, v->t_dw, v->t_pw, v->t_sl); > > printf( > > - "Virtual Memory:\t\t(Total: %jdK Active: %jdK)\n", > > - (intmax_t)v->t_vm * pageKilo, (intmax_t)v->t_avm * pageKilo); > > - printf("Real Memory:\t\t(Total: %jdK Active: %jdK)\n", > > - (intmax_t)v->t_rm * pageKilo, (intmax_t)v->t_arm * pageKilo); > > - printf("Shared Virtual Memory:\t(Total: %jdK Active: %jdK)\n", > > - (intmax_t)v->t_vmshr * pageKilo, (intmax_t)v->t_avmshr * pageKilo); > > - printf("Shared Real Memory:\t(Total: %jdK Active: %jdK)\n", > > - (intmax_t)v->t_rmshr * pageKilo, (intmax_t)v->t_armshr * pageKilo); > > - printf("Free Memory:\t%jdK", (intmax_t)v->t_free * pageKilo); > > + "Virtual Memory:\t\t(Total: %juK Active: %juK)\n", > > + (uintmax_t)v->t_vm * pageKilo, (uintmax_t)v->t_avm * pageKilo); > > + printf("Real Memory:\t\t(Total: %juK Active: %juK)\n", > > + (uintmax_t)v->t_rm * pageKilo, (uintmax_t)v->t_arm * pageKilo); > > + printf("Shared Virtual Memory:\t(Total: %juK Active: %juK)\n", > > + (uintmax_t)v->t_vmshr * pageKilo, (uintmax_t)v->t_avmshr * pageKilo); > > + printf("Shared Real Memory:\t(Total: %juK Active: %juK)\n", > > + (uintmax_t)v->t_rmshr * pageKilo, (uintmax_t)v->t_armshr * pageKilo); > > + printf("Free Memory:\t%juK", (uintmax_t)v->t_free * pageKilo); > > > > return (0); > > } > > All of the casts to uintmax_t can be avoided be avoided by changing the type > of pageKilo from int to uintmax_t. > > Better, do the conversion in a function-like macro pgtokb() as is done in > all (?) other utilities, but without so many overflow bugs as in most other > utiities: > > #define pgtok(p) ((uintmax_t)(p) * pageKilo) Amusingly there is already MD macro in machine/param.h with the same name and same intent, but as you formulate it, sloppy implementation. It uses unsigned long cast on almost all 64bit arches, except powerpc. For 32bit arches, the cast is not done, unfortunately. > > (pageKilo is back to int). This is still sloppy: > - pageKilo = getpagesize() / 1024 assumes that the page size is a multiple > of 1024 and fails very badly when the page size is 512 > - the multiplication can still overflow > - when the size in K is too large to fit, the size in M or G will normally > fit and converting directly to would avoid the overflow assuming that > the page size is <= 1M. > > Using floating point (even float precision) avoids all overflow and rounding > problems up to almost 128-bit sizes in bytes: No, I do not want to use floating point calculation there. diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index e1bf4e31914..36851f302a0 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -608,14 +608,18 @@ S_timeval(size_t l2, void *p) static int S_vmtotal(size_t l2, void *p) { - struct vmtotal *v = (struct vmtotal *)p; - int pageKilo = getpagesize() / 1024; + struct vmtotal *v; + int pageKilo; if (l2 != sizeof(*v)) { warnx("S_vmtotal %zu != %zu", l2, sizeof(*v)); return (1); } + v = p; + pageKilo = getpagesize() / 1024; + +#define pg2k(a) ((uintmax_t)(a) * pageKilo) printf( "\nSystem wide totals computed every five seconds:" " (values in kilobytes)\n"); @@ -624,16 +628,16 @@ S_vmtotal(size_t l2, void *p) "Processes:\t\t(RUNQ: %hd Disk Wait: %hd Page Wait: " "%hd Sleep: %hd)\n", v->t_rq, v->t_dw, v->t_pw, v->t_sl); - printf( - "Virtual Memory:\t\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_vm * pageKilo, (intmax_t)v->t_avm * pageKilo); - printf("Real Memory:\t\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_rm * pageKilo, (intmax_t)v->t_arm * pageKilo); - printf("Shared Virtual Memory:\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_vmshr * pageKilo, (intmax_t)v->t_avmshr * pageKilo); - printf("Shared Real Memory:\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_rmshr * pageKilo, (intmax_t)v->t_armshr * pageKilo); - printf("Free Memory:\t%jdK", (intmax_t)v->t_free * pageKilo); + printf("Virtual Memory:\t\t(Total: %juK Active: %juK)\n", + pg2k(v->t_vm), pg2k(v->t_avm)); + printf("Real Memory:\t\t(Total: %juK Active: %juK)\n", + pg2k(v->t_rm), pg2k(v->t_arm)); + printf("Shared Virtual Memory:\t(Total: %juK Active: %juK)\n", + pg2k(v->t_vmshr), pg2k(v->t_avmshr)); + printf("Shared Real Memory:\t(Total: %juK Active: %juK)\n", + pg2k(v->t_rmshr), pg2k(v->t_armshr)); + printf("Free Memory:\t%juK", pg2k(v->t_free)); +#undef pg2k return (0); } From owner-svn-src-head@freebsd.org Thu Nov 23 15:26: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 2DD63DEFDE5; Thu, 23 Nov 2017 15:26:35 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2243C6F9B2; Thu, 23 Nov 2017 15:26:33 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 1cfe533f; Thu, 23 Nov 2017 16:26:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=ugtfaBy5JKLgO7tLrmc5iRlvZ9g=; b=qZDBHwhURdJ5jfA2N1PYdvTFNss2 i8An/7pUtCxMjIdp0NtfvpSDoIn4D+0yzQORaVxRDzJ69eWUV5rqVWUzgz9LxxCt 7nTDewiVGptFLwzCeHsUcXPFia8Cz4oHD+a2ABjLNYoEovYb7lSc9Ae5d7kVdZAR MdSQftlDNizWQKk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=Mm0E30Z6lQU0Gfmgz082fgxhwAmFANFRXqzOUj1rTij5akbxNfF5LIpr kbQyxT3CYVwtzxabM8xfaEUE7IcGUmQyO7kTPOe9XmG5yaG/ot2KQ9gt5tt/wDIb TVPzpHl5m/GkVvyUH3Pm2n25ph+VutMJlYydyEahLDM6UuGfxIo= Received: from arcadia (evadot.gandi.net [217.70.181.36]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 8a4a47b9 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 23 Nov 2017 16:26:31 +0100 (CET) Date: Thu, 23 Nov 2017 16:26:30 +0100 From: Emmanuel Vadot To: rgrimes@freebsd.org Cc: "Rodney W. Grimes" , Devin Teske , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts Message-Id: <20171123162630.527cc0b29f81c4e571883dad@bidouilliste.com> In-Reply-To: <201711231517.vANFHnwR091356@pdx.rh.CN85.dnsmgr.net> References: <20171123160815.2f467f760179901a0ba983f1@bidouilliste.com> <201711231517.vANFHnwR091356@pdx.rh.CN85.dnsmgr.net> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 15:26:35 -0000 On Thu, 23 Nov 2017 07:17:49 -0800 (PST) "Rodney W. Grimes" wrote: > > On Thu, 23 Nov 2017 06:56:50 -0800 (PST) > > "Rodney W. Grimes" wrote: > > > > > > > > > > Hi Devin, > > > > > > > > On Thu, 23 Nov 2017 01:33:39 -0800 > > > > Devin Teske wrote: > > > > > > > > > > > > > > > > > > > > On Nov 22, 2017, at 11:15 PM, Emmanuel Vadot wrote: > > > > > > > > > > > >> On 2017-11-22 17:38, Ian Lepore wrote: > > > > > >>> On Wed, 2017-11-22 at 15:27 +0000, Emmanuel Vadot wrote: > > > > > >>> Author: manu > > > > > >>> Date: Wed Nov 22 15:27:47 2017 > > > > > >>> New Revision: 326095 > > > > > >>> URL: https://svnweb.freebsd.org/changeset/base/326095 > > > > > >>> Log: > > > > > >>> bsdinstall: Add ntpdate option > > > > > >>> > > > > > >>> When you install a computer for the first time, the date in the CMOS sometimes > > > > > >>> not accurate and you need to ntpdate as ntpd will fail a the time difference > > > > > >>> is too big. > > > > > >>> Add an option in bsdinstall to enable ntpdate that will do that for us. > > > > > >>> > > > > > >>> Reviewed by: allanjude > > > > > >>> Differential Revision: https://reviews.freebsd.org/D13149 > > > > > >>> Modified: > > > > > >>> head/usr.sbin/bsdinstall/scripts/services > > > > > >>> Modified: head/usr.sbin/bsdinstall/scripts/services > > > > > >>> ============================================================================== > > > > > >>> --- head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:18:11 2017 (r326094) > > > > > >>> +++ head/usr.sbin/bsdinstall/scripts/services Wed Nov 22 15:27:47 2017 (r326095) > > > > > >>> @@ -46,6 +46,8 @@ DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ > > > > > >>> local_unbound "Local caching validating resolver" ${local_unbound:-off} \ > > > > > >>> sshd "Secure shell daemon" ${sshd_enable:-off} \ > > > > > >>> moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ > > > > > >>> + ntpdate "Synchronize system and network time at bootime" \ > > > > > >>> + ${ntpdate_enable:-off} \ > > > > > >>> ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ > > > > > >>> powerd "Adjust CPU frequency dynamically if supported" \ > > > > > >>> ${powerd_enable:-off} \ > > > > > >> The right way to enable a time-step at boot is to set the rc conf > > > > > >> variable ntpd_sync_on_start to YES. ntpdate has been deprecated for > > > > > >> *years*. > > > > > >> -- Ian > > > > > > > > > > > > Hi Ian, > > > > > > > > > > > > Thanks I didn't know about option -g (nor ntpd_sync_on_start), this bring a few questions : > > > > > > > > > > > > - Is there any reason to not always use -g for ntpd ? As a lambda user I just want my time to be set, no matter what. > > > > > > - Should we remove ntpdate in -current before 12 if it's deprecated ? > > > > > > > > > > > > I'll make the necessary changes according to your (or others) answers. > > > > > > > > > > > > > > > > I would not remove ntpdate. > > > > > > I concur, as ntpdate is trivial to use, ntpd -pg requires a proper /etc/ntp.conf, > > > though that is trival too you well not get what you want if you do not have > > > that. > > > > From the website you linked after they say to use : > > ntpd -gqc /dev/null server1.name.net server2.name.org server3.name.com > > for use without ntp.conf. > > I do not think you want to do that, as if you read just a bit further you see: > > Possible hitch: ntpd will step the time adjustment if it is more > than 128ms (default). This means that a 128ms adjustment will take > 256 seconds to apply. We want an option to step any initial offset, > I suspect. > > So even the ntp folks seem to have issues with replacing ntpdate.... There is -G for that. > > Also we do provide an ntp.conf so ... > > We do, a template, all commented out, and does not work for > machines behind strong firewalls that wont allow ntp out > to the net but have internal ntp servers that are used for > such things. > > Well maybe not all commented out, I think it defaults to > some public pools. I believe it would be missing iburst > for use with ntp -pg Nope, see : https://svnweb.freebsd.org/base/head/etc/ntp.conf?revision=311103&view=markup#l32 > > > > > > > Is there a way to make ntpd sync and then quit immediately? > > > > > > > > Just by reading the man I see the -q option which does exactly that. > > > > Setting both -q and -g should have the same behavior than ntpdate (not > > > > tested). > > > > > > ntpd -pg is the preferred method per the ntp.org documentation: > > > https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate > > > > -gq like I said but it's good to have an official reference. > > > > > > > > > > > If not, sounds like ntpdate serves a purpose not filled by ntpd. > > > > > > > > > > Valid case is someone running a VM that gets paused for days, weeks, or even months at a time. On such a VM it may make more sense to let the clock be only sporadically managed in an adhoc manner. > > > > > > > > > > I personally like to use ntpdate on said VMs because I generally set a timeout on my ssh-agent in said VMs and by managing the clock manually allows me to better control keys loaded. > > > > > > > > > > Pretty sure other people may have other reasons for non-daemonized clock management. > > > > > > > > That's why I asked :) > > > > > > I think that the ntp distribution still contains ntpdate, so long as that is true > > > we should continue to include it in FreeBSD. When/if they remove it from the > > > official ntp distribution then this issue shall need a revist. > > > > I haven't checked. > > We can also add a shell script that does what I quoted above. > > We could, but that gets us the bug of time wont be stepped if > correct within 128mS and causing a long slow 4 minute slew event. > > > > > > Devin > > > > Emmanuel Vadot > > > Rod Grimes rgrimes@freebsd.org > > Emmanuel Vadot > -- > Rod Grimes rgrimes@freebsd.org -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Thu Nov 23 16:04: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 899A1DF0AB2; Thu, 23 Nov 2017 16:04:53 +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 4DE9070D22; Thu, 23 Nov 2017 16:04:53 +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 vANG4qaB080139; Thu, 23 Nov 2017 16:04:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANG4qbQ080138; Thu, 23 Nov 2017 16:04:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711231604.vANG4qbQ080138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Nov 2017 16:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326136 - head/contrib/binutils/bfd X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/binutils/bfd X-SVN-Commit-Revision: 326136 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 16:04:53 -0000 Author: emaste Date: Thu Nov 23 16:04:52 2017 New Revision: 326136 URL: https://svnweb.freebsd.org/changeset/base/326136 Log: bfd: avoid crash on corrupt binaries From binutils commits 5a4b0ccc20ba30caef53b01bee2c0aaa5b855339 and 7e1e19887abd24aeb15066b141cdff5541e0ec8e, made available under GPLv2 by Nick Clifton. PR: 198824 MFC after: 1 week Security: CVE-2014-8501 Security: CVE-2014-8502 Modified: head/contrib/binutils/bfd/peXXigen.c Modified: head/contrib/binutils/bfd/peXXigen.c ============================================================================== --- head/contrib/binutils/bfd/peXXigen.c Thu Nov 23 14:30:41 2017 (r326135) +++ head/contrib/binutils/bfd/peXXigen.c Thu Nov 23 16:04:52 2017 (r326136) @@ -448,6 +448,17 @@ _bfd_XXi_swap_aouthdr_in (bfd * abfd, { int idx; + /* PR 17512: Corrupt PE binaries can cause seg-faults. */ + if (a->NumberOfRvaAndSizes > 16) + { + (*_bfd_error_handler) + (_("%B: aout header specifies an invalid number of data-directory entries: %d"), + abfd, a->NumberOfRvaAndSizes); + /* Paranoia: If the number is corrupt, then assume that the + actual entries themselves might be corrupt as well. */ + a->NumberOfRvaAndSizes = 0; + } + for (idx = 0; idx < 16; idx++) { /* If data directory is empty, rva also should be 0. */ @@ -1426,6 +1437,15 @@ pe_print_edata (bfd * abfd, void * vfile) section->name); return TRUE; } + } + + /* PR 17512: Handle corrupt PE binaries. */ + if (datasize < 36) + { + fprintf (file, + _("\nThere is an export table in %s, but it is too small (%d)\n"), + section->name, (int) datasize); + return TRUE; } fprintf (file, _("\nThere is an export table in %s at 0x%lx\n"), From owner-svn-src-head@freebsd.org Thu Nov 23 16:12: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 A3F16DF0E2C for ; Thu, 23 Nov 2017 16:12:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85AD3711D1 for ; Thu, 23 Nov 2017 16:12:01 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 0e3dfbaf-d069-11e7-97f4-9d8903e843e3 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.ore.mailhop.org (Halon) with ESMTPSA id 0e3dfbaf-d069-11e7-97f4-9d8903e843e3; Thu, 23 Nov 2017 16:12:09 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vANGBt3Q003323; Thu, 23 Nov 2017 09:11:55 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1511453515.46031.19.camel@freebsd.org> Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts From: Ian Lepore To: rgrimes@freebsd.org, Emmanuel Vadot Cc: Devin Teske , Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 23 Nov 2017 09:11:55 -0700 In-Reply-To: <201711231456.vANEuodh091276@pdx.rh.CN85.dnsmgr.net> References: <201711231456.vANEuodh091276@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 16:12:01 -0000 On Thu, 2017-11-23 at 06:56 -0800, Rodney W. Grimes wrote: > > > > > >  Hi Devin, > > > > On Thu, 23 Nov 2017 01:33:39 -0800 > > Devin Teske wrote: > > > > > > > > > > > > > > > > > > > On Nov 22, 2017, at 11:15 PM, Emmanuel Vadot wrote: > > > > > > > > > > > > > > On 2017-11-22 17:38, Ian Lepore wrote: > > > > > > > > > > > > On Wed, 2017-11-22 at 15:27 +0000, Emmanuel Vadot wrote: > > > > > > Author: manu > > > > > > Date: Wed Nov 22 15:27:47 2017 > > > > > > New Revision: 326095 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/326095 > > > > > > Log: > > > > > >   bsdinstall: Add ntpdate option > > > > > >    > > > > > >   When you install a computer for the first time, the date in the CMOS sometimes > > > > > >   not accurate and you need to ntpdate as ntpd will fail a the time difference > > > > > >   is too big. > > > > > >   Add an option in bsdinstall to enable ntpdate that will do that for us. > > > > > >    > > > > > >   Reviewed by:    allanjude > > > > > >   Differential Revision:    https://reviews.freebsd.org/D13149 > > > > > > Modified: > > > > > >   head/usr.sbin/bsdinstall/scripts/services > > > > > > Modified: head/usr.sbin/bsdinstall/scripts/services > > > > > > ============================================================================== > > > > > > --- head/usr.sbin/bsdinstall/scripts/services    Wed Nov 22 15:18:11 2017    (r326094) > > > > > > +++ head/usr.sbin/bsdinstall/scripts/services    Wed Nov 22 15:27:47 2017    (r326095) > > > > > > @@ -46,6 +46,8 @@ DAEMONS=$( dialog --backtitle "FreeBSD Installer" \ > > > > > >      local_unbound "Local caching validating resolver" ${local_unbound:-off} \ > > > > > >      sshd    "Secure shell daemon" ${sshd_enable:-off} \ > > > > > >      moused    "PS/2 mouse pointer on console" ${moused_enable:-off} \ > > > > > > +    ntpdate    "Synchronize system and network time at bootime" \ > > > > > > +        ${ntpdate_enable:-off} \ > > > > > >      ntpd    "Synchronize system and network time" ${ntpd_enable:-off} \ > > > > > >      powerd    "Adjust CPU frequency dynamically if supported" \ > > > > > >          ${powerd_enable:-off} \ > > > > > The right way to enable a time-step at boot is to set the rc conf > > > > > variable ntpd_sync_on_start to YES.  ntpdate has been deprecated for > > > > > *years*. > > > > > -- Ian > > > > Hi Ian, > > > > > > > > Thanks I didn't know about option -g (nor ntpd_sync_on_start), this bring a few questions : > > > > > > > > - Is there any reason to not always use -g for ntpd ? As a lambda user I just want my time to be set, no matter what. > > > > - Should we remove ntpdate in -current before 12 if it's deprecated ? > > > > > > > > I'll make the necessary changes according to your (or others) answers. > > > > > > > I would not remove ntpdate. > I concur, as ntpdate is trivial to use, ntpd -pg requires a proper /etc/ntp.conf, > though that is trival too you well not get what you want if you do not have > that. > > > > > > > > > Is there a way to make ntpd sync and then quit immediately? > >  Just by reading the man I see the -q option which does exactly that. > >  Setting both -q and -g should have the same behavior than ntpdate (not > > tested). > ntpd -pg is the preferred method per the ntp.org documentation: > https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate > > > > > > > > > > > If not, sounds like ntpdate serves a purpose not filled by ntpd. > > > > > > Valid case is someone running a VM that gets paused for days, weeks, or even months at a time. On such a VM it may make more sense to let the clock be only sporadically managed in an adhoc manner. > > > > > > I personally like to use ntpdate on said VMs because I generally set a timeout on my ssh-agent in said VMs and by managing the clock manually allows me to better control keys loaded. > > > > > > Pretty sure other people may have other reasons for non-daemonized clock management. > >  That's why I asked :) > I think that the ntp distribution still contains ntpdate, so long as that is true > we should continue to include it in FreeBSD.  When/if they remove it from the > official ntp distribution then this issue shall need a revist. > I tend to agree with this... it's the ntpd project that deprecated ntpdate years ago, but as long as it's included in their distributions, we should include it in ours.  But I also think we shouldn't add new uses of it when there are alternatives available. -- Ian From owner-svn-src-head@freebsd.org Thu Nov 23 16:13: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 A3D4CDF0F2A; Thu, 23 Nov 2017 16:13:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (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 73D25713B3; Thu, 23 Nov 2017 16:13:51 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f178.google.com with SMTP id v21so27127979ioi.4; Thu, 23 Nov 2017 08:13:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Q9OaoTy80EpwPnB32xA39Z/oIz8kY+QxpP6vFWFlgNk=; b=LkFQao/6hFn28aDKVA2brw1J8hFu1ji0zQ1CgZpk79mYwYYb5B3gJ1HIz5mEYDlAYw BRJLcw7+JR5Tiqmp/ELM+NkE20odt6gXfNXqmeD5SVU9FZAojbJJ2yTliK0cJh9E+5r7 T0bZ30M4p0wQDfQCcGnBFNo2wj3XQFtLGfVM5F8R9GYaG4EOg835sOOXlqC+1SiVLmWY K+sukbXxCR16+/aMBsUtBsWGpLXFfK9qTFWnaYAdCM/QebcnsPHl9MrHKuCfComTxdIs yahpQWfmxxoFi4mhUS9VKrtTSru+tPuCLVpXARYyXhzw9VLhV4n00RKc+b+Kc/JJ/1lG W1Dw== X-Gm-Message-State: AJaThX6r2H6tuFoZvLHFwXXXssRCta038zifyZqdI7rcAytdu4++wgcg 4vbF4OhAUbHKBk3AT3HeLMZuNfXc X-Google-Smtp-Source: AGs4zMbltfwP+p0Lk/qQtQYOE2fiKHET8+LMxUvOn5IBnjecQfAnX/jZjK0/+nIeUlCpI8IhfoNYzQ== X-Received: by 10.107.141.77 with SMTP id p74mr29549508iod.40.1511453625086; Thu, 23 Nov 2017 08:13:45 -0800 (PST) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id e68sm6528418ite.0.2017.11.23.08.13.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 08:13:44 -0800 (PST) Received: by mail-it0-f49.google.com with SMTP id n134so10774941itg.3; Thu, 23 Nov 2017 08:13:44 -0800 (PST) X-Received: by 10.36.69.4 with SMTP id y4mr3721950ita.75.1511453624680; Thu, 23 Nov 2017 08:13:44 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.165.150 with HTTP; Thu, 23 Nov 2017 08:13:44 -0800 (PST) In-Reply-To: <201711231517.vANFHnwR091356@pdx.rh.CN85.dnsmgr.net> References: <20171123160815.2f467f760179901a0ba983f1@bidouilliste.com> <201711231517.vANFHnwR091356@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Thu, 23 Nov 2017 08:13:44 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts To: "Rodney W. Grimes" Cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 16:13:52 -0000 On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes wrote: >> Also we do provide an ntp.conf so ... > > We do, a template, all commented out, and does not work for > machines behind strong firewalls that wont allow ntp out > to the net but have internal ntp servers that are used for > such things. > > Well maybe not all commented out, I think it defaults to > some public pools. I believe it would be missing iburst > for use with ntp -pg Does ntpdate work out of the box in such environments? If so, how? Conrad From owner-svn-src-head@freebsd.org Thu Nov 23 17:29: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 D2DB2DF2321; Thu, 23 Nov 2017 17:29:38 +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 A920473824; Thu, 23 Nov 2017 17:29:38 +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 vANHTVHj092084; Thu, 23 Nov 2017 09:29:31 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vANHTVmo092083; Thu, 23 Nov 2017 09:29:31 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts In-Reply-To: To: cem@freebsd.org Date: Thu, 23 Nov 2017 09:29:31 -0800 (PST) CC: "Rodney W. Grimes" , Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2017 17:29:38 -0000 [ Charset UTF-8 unsupported, converting... ] > On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes > wrote: > >> Also we do provide an ntp.conf so ... > > > > We do, a template, all commented out, and does not work for > > machines behind strong firewalls that wont allow ntp out > > to the net but have internal ntp servers that are used for > > such things. > > > > Well maybe not all commented out, I think it defaults to > > some public pools. I believe it would be missing iburst > > for use with ntp -pg > > Does ntpdate work out of the box in such environments? If so, how? ntpdate time.nist.gov ntpdate does not need a configureration file, just a command line argument. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Nov 23 17:40: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 A1558DF2570; Thu, 23 Nov 2017 17:40:41 +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 792BA73D24; Thu, 23 Nov 2017 17:40:41 +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 vANHee3V018826; Thu, 23 Nov 2017 17:40:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANHeeiV018823; Thu, 23 Nov 2017 17:40:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201711231740.vANHeeiV018823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 23 Nov 2017 17:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326137 - in head/sys: arm/arm arm64/arm64 arm64/include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 arm64/include X-SVN-Commit-Revision: 326137 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 17:40:41 -0000 Author: andrew Date: Thu Nov 23 17:40:40 2017 New Revision: 326137 URL: https://svnweb.freebsd.org/changeset/base/326137 Log: Ensure we check the program state set in the trap frame on arm and arm64. This value may be set by userspace so we need to check it before using it. If this is not done correctly on exception return the kernel may continue in kernel mode with all registers set to a userspace controlled value. Fix this by moving the check into set_mcontext, and also add the missing sanitisation from the arm64 set_regs. Discussed with: security-officer@ MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/machdep.c head/sys/arm64/arm64/machdep.c head/sys/arm64/include/armreg.h Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Nov 23 16:04:52 2017 (r326136) +++ head/sys/arm/arm/machdep.c Thu Nov 23 17:40:40 2017 (r326137) @@ -518,7 +518,17 @@ set_mcontext(struct thread *td, mcontext_t *mcp) mcontext_vfp_t mc_vfp, *vfp; struct trapframe *tf = td->td_frame; const __greg_t *gr = mcp->__gregs; + int spsr; + /* + * Make sure the processor mode has not been tampered with and + * interrupts have not been disabled. + */ + spsr = gr[_REG_CPSR]; + if ((spsr & PSR_MODE) != PSR_USR32_MODE || + (spsr & (PSR_I | PSR_F)) != 0) + return (EINVAL); + #ifdef WITNESS if (mcp->mc_vfp_size != 0 && mcp->mc_vfp_size != sizeof(mc_vfp)) { printf("%s: %s: Malformed mc_vfp_size: %d (0x%08X)\n", @@ -677,22 +687,16 @@ sys_sigreturn(td, uap) } */ *uap; { ucontext_t uc; - int spsr; + int error; if (uap == NULL) return (EFAULT); if (copyin(uap->sigcntxp, &uc, sizeof(uc))) return (EFAULT); - /* - * Make sure the processor mode has not been tampered with and - * interrupts have not been disabled. - */ - spsr = uc.uc_mcontext.__gregs[_REG_CPSR]; - if ((spsr & PSR_MODE) != PSR_USR32_MODE || - (spsr & (PSR_I | PSR_F)) != 0) - return (EINVAL); /* Restore register context. */ - set_mcontext(td, &uc.uc_mcontext); + error = set_mcontext(td, &uc.uc_mcontext); + if (error != 0) + return (error); /* Restore signal mask. */ kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Thu Nov 23 16:04:52 2017 (r326136) +++ head/sys/arm64/arm64/machdep.c Thu Nov 23 17:40:40 2017 (r326137) @@ -211,7 +211,8 @@ set_regs(struct thread *td, struct reg *regs) frame->tf_sp = regs->sp; frame->tf_lr = regs->lr; frame->tf_elr = regs->elr; - frame->tf_spsr = regs->spsr; + frame->tf_spsr &= ~PSR_FLAGS; + frame->tf_spsr |= regs->spsr & PSR_FLAGS; memcpy(frame->tf_x, regs->x, sizeof(frame->tf_x)); @@ -354,7 +355,13 @@ int set_mcontext(struct thread *td, mcontext_t *mcp) { struct trapframe *tf = td->td_frame; + uint32_t spsr; + spsr = mcp->mc_gpregs.gp_spsr; + if ((spsr & PSR_M_MASK) != PSR_M_EL0t || + (spsr & (PSR_F | PSR_I | PSR_A | PSR_D)) != 0) + return (EINVAL); + memcpy(tf->tf_x, mcp->mc_gpregs.gp_x, sizeof(tf->tf_x)); tf->tf_sp = mcp->mc_gpregs.gp_sp; @@ -530,19 +537,16 @@ int sys_sigreturn(struct thread *td, struct sigreturn_args *uap) { ucontext_t uc; - uint32_t spsr; + int error; if (uap == NULL) return (EFAULT); if (copyin(uap->sigcntxp, &uc, sizeof(uc))) return (EFAULT); - spsr = uc.uc_mcontext.mc_gpregs.gp_spsr; - if ((spsr & PSR_M_MASK) != PSR_M_EL0t || - (spsr & (PSR_F | PSR_I | PSR_A | PSR_D)) != 0) - return (EINVAL); - - set_mcontext(td, &uc.uc_mcontext); + error = set_mcontext(td, &uc.uc_mcontext); + if (error != 0) + return (error); set_fpcontext(td, &uc.uc_mcontext); /* Restore signal mask. */ Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Thu Nov 23 16:04:52 2017 (r326136) +++ head/sys/arm64/include/armreg.h Thu Nov 23 17:40:40 2017 (r326137) @@ -572,6 +572,7 @@ #define PSR_C 0x20000000 #define PSR_Z 0x40000000 #define PSR_N 0x80000000 +#define PSR_FLAGS 0xf0000000 /* TCR_EL1 - Translation Control Register */ #define TCR_ASID_16 (1 << 36) From owner-svn-src-head@freebsd.org Thu Nov 23 19:06: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 510BFDF3787; Thu, 23 Nov 2017 19:06:46 +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 1023B75C57; Thu, 23 Nov 2017 19:06:45 +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 vANJ6j79056607; Thu, 23 Nov 2017 19:06:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANJ6j81056606; Thu, 23 Nov 2017 19:06:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711231906.vANJ6j81056606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Nov 2017 19:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326138 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 326138 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 19:06:46 -0000 Author: kib Date: Thu Nov 23 19:06:44 2017 New Revision: 326138 URL: https://svnweb.freebsd.org/changeset/base/326138 Log: Use C standard spelling uint64_t for u_int64_t. Submitted by: Pawel Biernacki Sponsored by: Mysterious Code Ltd. X-Differential revision: https://reviews.freebsd.org/D13199 Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Thu Nov 23 17:40:40 2017 (r326137) +++ head/usr.bin/vmstat/vmstat.c Thu Nov 23 19:06:44 2017 (r326138) @@ -665,7 +665,7 @@ getcpuinfo(u_long *maskp, int *maxidp) static void -prthuman(const char *name, u_int64_t val, int size) +prthuman(const char *name, uint64_t val, int size) { char buf[10]; int flags; @@ -822,10 +822,10 @@ dovmstat(unsigned int interval, int reps) if (hflag) { xo_emit(""); prthuman("available-memory", - total.t_avm * (u_int64_t)sum.v_page_size, 5); + total.t_avm * (uint64_t)sum.v_page_size, 5); xo_emit(" "); prthuman("free-memory", - total.t_free * (u_int64_t)sum.v_page_size, 5); + total.t_free * (uint64_t)sum.v_page_size, 5); xo_emit(" "); } else { xo_emit(" "); From owner-svn-src-head@freebsd.org Thu Nov 23 19:10: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 AF7D0DF3C1F; Thu, 23 Nov 2017 19:10:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 975507709C; Thu, 23 Nov 2017 19:10:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vANJA943060003; Thu, 23 Nov 2017 19:10:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANJA9gl060002; Thu, 23 Nov 2017 19:10:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201711231910.vANJA9gl060002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Nov 2017 19:10:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326139 - head/usr.bin/vmstat X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/vmstat X-SVN-Commit-Revision: 326139 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 19:10:14 -0000 Author: kib Date: Thu Nov 23 19:10:09 2017 New Revision: 326139 URL: https://svnweb.freebsd.org/changeset/base/326139 Log: vmstat: use 64-bit counters from struct vmtotal. Consistently print counters using unsigned intmax type. Submitted by: Pawel Biernacki Sponsored by: Mysterious Code Ltd. Differential revision: https://reviews.freebsd.org/D13199 Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Thu Nov 23 19:06:44 2017 (r326138) +++ head/usr.bin/vmstat/vmstat.c Thu Nov 23 19:10:09 2017 (r326139) @@ -817,7 +817,7 @@ dovmstat(unsigned int interval, int reps) total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); xo_close_container("processes"); xo_open_container("memory"); -#define vmstat_pgtok(a) ((a) * (sum.v_page_size >> 10)) +#define vmstat_pgtok(a) ((uintmax_t)(a) * (sum.v_page_size >> 10)) #define rate(x) (((x) * rate_adj + halfuptime) / uptime) /* round */ if (hflag) { xo_emit(""); @@ -829,10 +829,10 @@ dovmstat(unsigned int interval, int reps) xo_emit(" "); } else { xo_emit(" "); - xo_emit("{:available-memory/%7d}", + xo_emit("{:available-memory/%7ju}", vmstat_pgtok(total.t_avm)); xo_emit(" "); - xo_emit("{:free-memory/%7d}", + xo_emit("{:free-memory/%7ju}", vmstat_pgtok(total.t_free)); xo_emit(" "); } @@ -1555,9 +1555,9 @@ display_object(struct kinfo_vmobject *kvo) const char *str; xo_open_instance("object"); - xo_emit("{:resident/%5jd} ", (uintmax_t)kvo->kvo_resident); - xo_emit("{:active/%5jd} ", (uintmax_t)kvo->kvo_active); - xo_emit("{:inactive/%5jd} ", (uintmax_t)kvo->kvo_inactive); + xo_emit("{:resident/%5ju} ", (uintmax_t)kvo->kvo_resident); + xo_emit("{:active/%5ju} ", (uintmax_t)kvo->kvo_active); + xo_emit("{:inactive/%5ju} ", (uintmax_t)kvo->kvo_inactive); xo_emit("{:refcount/%3d} ", kvo->kvo_ref_count); xo_emit("{:shadowcount/%3d} ", kvo->kvo_shadow_count); switch (kvo->kvo_memattr) { From owner-svn-src-head@freebsd.org Thu Nov 23 21:33: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 D34F8DF630C; Thu, 23 Nov 2017 21:33:54 +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 C4D187B96B; Thu, 23 Nov 2017 21:33:54 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=63059 helo=[10.0.0.101]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1eHwNV-000Bb9-Gc; Thu, 23 Nov 2017 18:37:37 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts From: Devin Teske X-Mailer: iPhone Mail (13G36) In-Reply-To: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> Date: Thu, 23 Nov 2017 13:33:50 -0800 Cc: cem@freebsd.org, Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 21:33:54 -0000 > On Nov 23, 2017, at 9:29 AM, Rodney W. Grimes wrote: >=20 > [ Charset UTF-8 unsupported, converting... ] >> On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes >> wrote: >>>> Also we do provide an ntp.conf so ... >>>=20 >>> We do, a template, all commented out, and does not work for >>> machines behind strong firewalls that wont allow ntp out >>> to the net but have internal ntp servers that are used for >>> such things. >>>=20 >>> Well maybe not all commented out, I think it defaults to >>> some public pools. I believe it would be missing iburst >>> for use with ntp -pg >>=20 >> Does ntpdate work out of the box in such environments? If so, how? >=20 > ntpdate time.nist.gov >=20 > ntpdate does not need a configureration file, just a command > line argument. >=20 >=20 At the banks we used to rely on both (in this order) ntpdate running and the= n ntpd running. Running ntpdate before ntpd meant that on a [re]boot, ntpdate would jump the= box to the appropriate time, regardless of how far behind the clock was (th= ink "dead cmos battery" on a system left powered-off for a long time). Meanwhile, running ntpd *without* the sync-on-start feature meant we could b= ounce the ntpd service as necessary and it would always adhere to the limit w= e set on it -- one hour to prevent syncing on systems which had been manuall= y adjusted by greater than an hour for some one-off instances. --=20 Devin From owner-svn-src-head@freebsd.org Thu Nov 23 22:10: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 0089CDF6B59; Thu, 23 Nov 2017 22:10:14 +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 BCF257C8AC; Thu, 23 Nov 2017 22:10:13 +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 vANMACHL036171; Thu, 23 Nov 2017 22:10:12 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vANMACJW036170; Thu, 23 Nov 2017 22:10:12 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711232210.vANMACJW036170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Nov 2017 22:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326140 - head/share/examples/bhyve X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/examples/bhyve X-SVN-Commit-Revision: 326140 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 23 Nov 2017 22:10:14 -0000 Author: avg Date: Thu Nov 23 22:10:12 2017 New Revision: 326140 URL: https://svnweb.freebsd.org/changeset/base/326140 Log: vmrun.sh: add -A option for AHCI emulation of disk devices AHCI emulation is useful for testing scenarios closer to the real hardware. For example, it allows to exercise the CAM subsystem. There could be other uses as well. MFC after: 2 weeks Modified: head/share/examples/bhyve/vmrun.sh Modified: head/share/examples/bhyve/vmrun.sh ============================================================================== --- head/share/examples/bhyve/vmrun.sh Thu Nov 23 19:10:09 2017 (r326139) +++ head/share/examples/bhyve/vmrun.sh Thu Nov 23 22:10:12 2017 (r326140) @@ -46,7 +46,7 @@ errmsg() { usage() { local msg=$1 - echo "Usage: vmrun.sh [-aEhiTv] [-c ] [-C ] [-d ]" + echo "Usage: vmrun.sh [-aAEhiTv] [-c ] [-C ] [-d ]" echo " [-e ] [-f ] [-F ]" echo " [-g ] [-H ]" echo " [-I ] [-l ]" @@ -55,6 +55,7 @@ usage() { echo "" echo " -h: display this help message" echo " -a: force memory mapped local APIC access" + echo " -A: use AHCI disk emulation instead of virtio" echo " -c: number of virtual cpus (default is ${DEFAULT_CPUS})" echo " -C: console device (default is ${DEFAULT_CONSOLE})" echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" @@ -99,6 +100,7 @@ console=${DEFAULT_CONSOLE} cpus=${DEFAULT_CPUS} tap_total=0 disk_total=0 +disk_emulation="virtio-blk" gdbport=0 loader_opt="" bhyverun_opt="-H -A -P" @@ -113,11 +115,14 @@ vncport=5900 fbsize="w=1024,h=768" tablet="" -while getopts ac:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c ; do +while getopts aAc:C:d:e:Ef:F:g:hH:iI:l:m:p:P:t:Tuvw c ; do case $c in a) bhyverun_opt="${bhyverun_opt} -a" ;; + A) + disk_emulation="ahci-hd" + ;; c) cpus=${OPTARG} ;; @@ -316,7 +321,7 @@ while [ 1 ]; do eval "disk=\$disk_dev${i}" eval "opts=\$disk_opts${i}" make_and_check_diskdev "${disk}" - devargs="$devargs -s $nextslot:0,virtio-blk,${disk}${opts} " + devargs="$devargs -s $nextslot:0,$disk_emulation,${disk}${opts} " nextslot=$(($nextslot + 1)) i=$(($i + 1)) done From owner-svn-src-head@freebsd.org Fri Nov 24 02:39: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 2BE85DFB119; Fri, 24 Nov 2017 02:39:40 +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 EA8DA2FC1; Fri, 24 Nov 2017 02:39:39 +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 vAO2dclg049357; Fri, 24 Nov 2017 02:39:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAO2dcE2049356; Fri, 24 Nov 2017 02:39:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201711240239.vAO2dcE2049356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 24 Nov 2017 02:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326141 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 326141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 02:39:40 -0000 Author: kevans Date: Fri Nov 24 02:39:38 2017 New Revision: 326141 URL: https://svnweb.freebsd.org/changeset/base/326141 Log: Add ccu compat string for Allwinner a83t A ccu driver was added for the a83t in r326114. Add compat string to aw_ccung and register the clocks for the a83t upon attach. Reviewed by: manu Approved by: emaste (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D13205 Modified: head/sys/arm/allwinner/clkng/aw_ccung.c Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Thu Nov 23 22:10:12 2017 (r326140) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Fri Nov 24 02:39:38 2017 (r326141) @@ -76,6 +76,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#if defined(SOC_ALLWINNER_A83T) +#include +#endif + #include "clkdev_if.h" #include "hwreset_if.h" @@ -102,6 +106,10 @@ static struct resource_spec aw_ccung_spec[] = { #define A13_CCU 6 #endif +#if defined(SOC_ALLWINNER_A83T) +#define A83T_CCU 7 +#endif + static struct ofw_compat_data compat_data[] = { #if defined(SOC_ALLWINNER_A31) { "allwinner,sun5i-a13-ccu", A13_CCU}, @@ -117,6 +125,9 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun50i-a64-ccu", A64_CCU }, { "allwinner,sun50i-a64-r-ccu", A64_R_CCU }, #endif +#if defined(SOC_ALLWINNER_A83T) + { "allwinner,sun8i-a83t-ccu", A83T_CCU }, +#endif {NULL, 0 } }; @@ -357,6 +368,11 @@ aw_ccung_attach(device_t dev) break; case A64_R_CCU: ccu_sun8i_r_register_clocks(sc); + break; +#endif +#if defined(SOC_ALLWINNER_A83T) + case A83T_CCU: + ccu_a83t_register_clocks(sc); break; #endif } From owner-svn-src-head@freebsd.org Fri Nov 24 05:00: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 661B8DB9AB5; Fri, 24 Nov 2017 05:00: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 32D5465A9A; Fri, 24 Nov 2017 05:00: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 vAO50PVK008782; Fri, 24 Nov 2017 05:00:25 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAO50PJj008781; Fri, 24 Nov 2017 05:00:25 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711240500.vAO50PJj008781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 24 Nov 2017 05:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326143 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 326143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 05:00:26 -0000 Author: imp Date: Fri Nov 24 05:00:25 2017 New Revision: 326143 URL: https://svnweb.freebsd.org/changeset/base/326143 Log: Fix theoretical integer overflow issues. If the product here is greater than 2^31-1, then the result will be huge. This is unlikely, as we don't support that many sections, but out of an abundace of caution cast to size_t so the multiplication won't overflow mysteriously when size_t is larger than 32-bits. The resulting code may be a smidge larger, but this isn't super-space critical code. CID: 1194216, 1194217, 1194222, 1194223, 1265018, 1265019,1265020, 1265021 Sponsored by: Netflix Modified: head/stand/common/load_elf.c Modified: head/stand/common/load_elf.c ============================================================================== --- head/stand/common/load_elf.c Fri Nov 24 04:42:21 2017 (r326142) +++ head/stand/common/load_elf.c Fri Nov 24 05:00:25 2017 (r326143) @@ -456,7 +456,7 @@ __elfN(loadimage)(struct preloaded_file *fp, elf_file_ * think the rule is going to have to be that you must strip a * file to remove symbols before gzipping it. */ - chunk = ehdr->e_shnum * ehdr->e_shentsize; + chunk = (size_t)ehdr->e_shnum * (size_t)ehdr->e_shentsize; if (chunk == 0 || ehdr->e_shoff == 0) goto nosyms; shdr = alloc_pread(ef->fd, ehdr->e_shoff, chunk); @@ -747,7 +747,7 @@ __elfN(load_modmetadata)(struct preloaded_file *fp, u_ goto out; } - size = ef.ehdr->e_shnum * ef.ehdr->e_shentsize; + size = (size_t)ef.ehdr->e_shnum * (size_t)ef.ehdr->e_shentsize; shdr = alloc_pread(ef.fd, ef.ehdr->e_shoff, size); if (shdr == NULL) { err = ENOMEM; From owner-svn-src-head@freebsd.org Fri Nov 24 05:01:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A562DB9B18; Fri, 24 Nov 2017 05:01: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 36DF165C34; Fri, 24 Nov 2017 05:01: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 vAO510Xk009619; Fri, 24 Nov 2017 05:01:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAO510ON009618; Fri, 24 Nov 2017 05:01:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201711240501.vAO510ON009618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 24 Nov 2017 05:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326144 - head/stand/userboot/test X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/userboot/test X-SVN-Commit-Revision: 326144 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 05:01:01 -0000 Author: imp Date: Fri Nov 24 05:01:00 2017 New Revision: 326144 URL: https://svnweb.freebsd.org/changeset/base/326144 Log: Mark the func pointer as __dead2. It looks up loader_main, which either aborts or exits, but never returns. Tag it as a non-returning function rather than supply a bogus return(0) at the end of main. CID: 1382885 Sponsored by: Netflix Modified: head/stand/userboot/test/test.c Modified: head/stand/userboot/test/test.c ============================================================================== --- head/stand/userboot/test/test.c Fri Nov 24 05:00:25 2017 (r326143) +++ head/stand/userboot/test/test.c Fri Nov 24 05:01:00 2017 (r326144) @@ -422,7 +422,7 @@ int main(int argc, char** argv) { void *h; - void (*func)(struct loader_callbacks *, void *, int, int); + void (*func)(struct loader_callbacks *, void *, int, int) __dead2; int opt; char *disk_image = NULL; const char *userboot_obj = "/boot/userboot.so"; From owner-svn-src-head@freebsd.org Fri Nov 24 07:35: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 7AAE4DBBD17; Fri, 24 Nov 2017 07:35:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18F2768FB2; Fri, 24 Nov 2017 07:35:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAO7ZAjS075456; Fri, 24 Nov 2017 07:35:10 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAO7Z9JL075443; Fri, 24 Nov 2017 07:35:09 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201711240735.vAO7Z9JL075443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 24 Nov 2017 07:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326145 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux32 arm/cloudabi32 arm64/arm64 arm64/cloudabi64 compat/linux i386/i386 kern powerpc/powerpc riscv/riscv sparc64/sparc64 X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 amd64/linux32 arm/cloudabi32 arm64/arm64 arm64/cloudabi64 compat/linux i386/i386 kern powerpc/powerpc riscv/riscv sparc64/sparc64 X-SVN-Commit-Revision: 326145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 07:35:11 -0000 Author: ed Date: Fri Nov 24 07:35:08 2017 New Revision: 326145 URL: https://svnweb.freebsd.org/changeset/base/326145 Log: Don't let cpu_set_syscall_retval() clobber exec_setregs(). Upon successful completion, the execve() system call invokes exec_setregs() to initialize the registers of the initial thread of the newly executed process. What is weird is that when execve() returns, it still goes through the normal system call return path, clobbering the registers with the system call's return value (td->td_retval). Though this doesn't seem to be problematic for x86 most of the times (as the value of eax/rax doesn't matter upon startup), this can be pretty frustrating for architectures where function argument and return registers overlap (e.g., ARM). On these systems, exec_setregs() also needs to initialize td_retval. Even worse are architectures where cpu_set_syscall_retval() sets registers to values not derived from td_retval. On these architectures, there is no way cpu_set_syscall_retval() can set registers to the way it wants them to be upon the start of execution. To get rid of this madness, let sys_execve() return EJUSTRETURN. This will cause cpu_set_syscall_retval() to leave registers intact. This makes process execution easier to understand. It also eliminates the difference between execution of the initial process and successive ones. The initial call to sys_execve() is not performed through a system call context. Reviewed by: kib, jhibbits Differential Revision: https://reviews.freebsd.org/D13180 Modified: head/sys/amd64/amd64/machdep.c head/sys/amd64/ia32/ia32_signal.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/arm/cloudabi32/cloudabi32_sysvec.c head/sys/arm64/arm64/machdep.c head/sys/arm64/cloudabi64/cloudabi64_sysvec.c head/sys/compat/linux/linux_emul.c head/sys/i386/i386/machdep.c head/sys/kern/init_main.c head/sys/kern/kern_exec.c head/sys/powerpc/powerpc/exec_machdep.c head/sys/riscv/riscv/machdep.c head/sys/sparc64/sparc64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/amd64/amd64/machdep.c Fri Nov 24 07:35:08 2017 (r326145) @@ -604,7 +604,6 @@ exec_setregs(struct thread *td, struct image_params *i regs->tf_fs = _ufssel; regs->tf_gs = _ugssel; regs->tf_flags = TF_HASSEGS; - td->td_retval[1] = 0; /* * Reset the hardware debug registers if they were in use. Modified: head/sys/amd64/ia32/ia32_signal.c ============================================================================== --- head/sys/amd64/ia32/ia32_signal.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/amd64/ia32/ia32_signal.c Fri Nov 24 07:35:08 2017 (r326145) @@ -967,5 +967,4 @@ ia32_setregs(struct thread *td, struct image_params *i /* Return via doreti so that we can change to a different %cs */ set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET); - td->td_retval[1] = 0; } Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/amd64/linux32/linux32_sysvec.c Fri Nov 24 07:35:08 2017 (r326145) @@ -832,7 +832,6 @@ exec_linux_setregs(struct thread *td, struct image_par /* Do full restore on return so that we can change to a different %cs */ set_pcb_flags(pcb, PCB_32BIT | PCB_FULL_IRET); - td->td_retval[1] = 0; } /* Modified: head/sys/arm/cloudabi32/cloudabi32_sysvec.c ============================================================================== --- head/sys/arm/cloudabi32/cloudabi32_sysvec.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/arm/cloudabi32/cloudabi32_sysvec.c Fri Nov 24 07:35:08 2017 (r326145) @@ -61,7 +61,7 @@ cloudabi32_proc_setregs(struct thread *td, struct imag * tpidrurw to the TCB. */ regs = td->td_frame; - regs->tf_r0 = td->td_retval[0] = + regs->tf_r0 = stack + roundup(sizeof(cloudabi32_tcb_t), sizeof(register_t)); (void)cpu_set_user_tls(td, (void *)stack); } Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/arm64/arm64/machdep.c Fri Nov 24 07:35:08 2017 (r326145) @@ -311,12 +311,7 @@ exec_setregs(struct thread *td, struct image_params *i memset(tf, 0, sizeof(struct trapframe)); - /* - * We need to set x0 for init as it doesn't call - * cpu_set_syscall_retval to copy the value. We also - * need to set td_retval for the cases where we do. - */ - tf->tf_x[0] = td->td_retval[0] = stack; + tf->tf_x[0] = stack; tf->tf_sp = STACKALIGN(stack); tf->tf_lr = imgp->entry_addr; tf->tf_elr = imgp->entry_addr; Modified: head/sys/arm64/cloudabi64/cloudabi64_sysvec.c ============================================================================== --- head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/arm64/cloudabi64/cloudabi64_sysvec.c Fri Nov 24 07:35:08 2017 (r326145) @@ -61,7 +61,7 @@ cloudabi64_proc_setregs(struct thread *td, struct imag * tpidr_el0 to the TCB. */ regs = td->td_frame; - regs->tf_x[0] = td->td_retval[0] = + regs->tf_x[0] = stack + roundup(sizeof(cloudabi64_tcb_t), sizeof(register_t)); (void)cpu_set_user_tls(td, (void *)stack); } Modified: head/sys/compat/linux/linux_emul.c ============================================================================== --- head/sys/compat/linux/linux_emul.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/compat/linux/linux_emul.c Fri Nov 24 07:35:08 2017 (r326145) @@ -186,7 +186,7 @@ linux_common_execve(struct thread *td, struct image_ar error = kern_execve(td, eargs, NULL); post_execve(td, error, oldvmspace); - if (error != 0) + if (error != EJUSTRETURN) return (error); /* @@ -213,7 +213,7 @@ linux_common_execve(struct thread *td, struct image_ar free(em, M_TEMP); free(pem, M_LINUX); } - return (0); + return (EJUSTRETURN); } void Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/i386/i386/machdep.c Fri Nov 24 07:35:08 2017 (r326145) @@ -1126,6 +1126,7 @@ exec_setregs(struct thread *td, struct image_params *i set_fsbase(td, 0); set_gsbase(td, 0); + /* Make sure edx is 0x0 on entry. Linux binaries depend on it. */ bzero((char *)regs, sizeof(struct trapframe)); regs->tf_eip = imgp->entry_addr; regs->tf_esp = stack; @@ -1168,13 +1169,6 @@ exec_setregs(struct thread *td, struct image_params *i * clean FP state if it uses the FPU again. */ fpstate_drop(td); - - /* - * XXX - Linux emulator - * Make sure sure edx is 0x0 on entry. Linux binaries depend - * on it. - */ - td->td_retval[1] = 0; } void Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/kern/init_main.c Fri Nov 24 07:35:08 2017 (r326145) @@ -797,7 +797,7 @@ start_init(void *dummy) * Otherwise, return via fork_trampoline() all the way * to user mode as init! */ - if ((error = sys_execve(td, &args)) == 0) { + if ((error = sys_execve(td, &args)) == EJUSTRETURN) { mtx_unlock(&Giant); return; } Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/kern/kern_exec.c Fri Nov 24 07:35:08 2017 (r326145) @@ -318,7 +318,7 @@ post_execve(struct thread *td, int error, struct vmspa * If success, we upgrade to SINGLE_EXIT state to * force other threads to suicide. */ - if (error == 0) + if (error == EJUSTRETURN) thread_single(p, SINGLE_EXIT); else thread_single_end(p, SINGLE_BOUNDARY); @@ -962,7 +962,13 @@ exec_fail: ktrprocctor(p); #endif - return (error); + /* + * We don't want cpu_set_syscall_retval() to overwrite any of + * the register values put in place by exec_setregs(). + * Implementations of cpu_set_syscall_retval() will leave + * registers unmodified when returning EJUSTRETURN. + */ + return (error == 0 ? EJUSTRETURN : error); } int Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/powerpc/powerpc/exec_machdep.c Fri Nov 24 07:35:08 2017 (r326145) @@ -520,22 +520,11 @@ exec_setregs(struct thread *td, struct image_params *i * - ps_strings is a NetBSD extention, and will be * ignored by executables which are strictly * compliant with the SVR4 ABI. - * - * XXX We have to set both regs and retval here due to different - * XXX calling convention in trap.c and init_main.c. */ /* Collect argc from the user stack */ argc = fuword((void *)stack); - /* - * XXX PG: these get overwritten in the syscall return code. - * execve() should return EJUSTRETURN, like it does on NetBSD. - * Emulate by setting the syscall return value cells. The - * registers still have to be set for init's fork trampoline. - */ - td->td_retval[0] = argc; - td->td_retval[1] = stack + sizeof(register_t); tf->fixreg[3] = argc; tf->fixreg[4] = stack + sizeof(register_t); tf->fixreg[5] = stack + (2 + argc)*sizeof(register_t); @@ -572,8 +561,6 @@ ppc32_setregs(struct thread *td, struct image_params * argc = fuword32((void *)stack); - td->td_retval[0] = argc; - td->td_retval[1] = stack + sizeof(uint32_t); tf->fixreg[3] = argc; tf->fixreg[4] = stack + sizeof(uint32_t); tf->fixreg[5] = stack + (2 + argc)*sizeof(uint32_t); Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/riscv/riscv/machdep.c Fri Nov 24 07:35:08 2017 (r326145) @@ -279,12 +279,7 @@ exec_setregs(struct thread *td, struct image_params *i memset(tf, 0, sizeof(struct trapframe)); - /* - * We need to set a0 for init as it doesn't call - * cpu_set_syscall_retval to copy the value. We also - * need to set td_retval for the cases where we do. - */ - tf->tf_a[0] = td->td_retval[0] = stack; + tf->tf_a[0] = stack; tf->tf_sp = STACKALIGN(stack); tf->tf_ra = imgp->entry_addr; tf->tf_sepc = imgp->entry_addr; Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Fri Nov 24 05:01:00 2017 (r326144) +++ head/sys/sparc64/sparc64/machdep.c Fri Nov 24 07:35:08 2017 (r326145) @@ -1009,9 +1009,6 @@ exec_setregs(struct thread *td, struct image_params *i * header, it turns out that just always using TSO performs best. */ tf->tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_MM_TSO; - - td->td_retval[0] = tf->tf_out[0]; - td->td_retval[1] = tf->tf_out[1]; } int From owner-svn-src-head@freebsd.org Fri Nov 24 07:45: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 E62AEDBD3B4; Fri, 24 Nov 2017 07:45: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 6D7C0695B9; Fri, 24 Nov 2017 07:45: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 D3A8D3C60F9; Fri, 24 Nov 2017 18:45:28 +1100 (AEDT) Date: Fri, 24 Nov 2017 18:45:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326139 - head/usr.bin/vmstat In-Reply-To: <201711231910.vANJA9gl060002@repo.freebsd.org> Message-ID: <20171124170952.Y980@besplex.bde.org> References: <201711231910.vANJA9gl060002@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=ve-Pef5DYMJq4Nw43_sA:9 a=KtRL4uPeHvNv6vRM:21 a=DE4My3xT9DWS8wlG:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 07:45:37 -0000 On Thu, 23 Nov 2017, Konstantin Belousov wrote: > Log: > vmstat: use 64-bit counters from struct vmtotal. > > Consistently print counters using unsigned intmax type. Not very consistently. After fixing 0.01% of libxo (just add __printflike() to xo_emit(), the following errors are detected: X vmstat.c:817:23: error: format specifies type 'long' but the argument has type 'int' [-Werror,-Wformat] X total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); X ^~~~~~~~~~~~~~~~~~~~~~~ X vmstat.c:817:48: error: format specifies type 'long' but the argument has type 'int16_t' (aka 'short') [-Werror,-Wformat] X total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw); X ^~~~~~~~~~ Broken in r291090 (the first libxo commit to this file). All the arg types here are still int since all the fields in 'total' still have type int16_t. X vmstat.c:865:7: error: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Werror,-Wformat] X (unsigned long)rate(sum.v_swtch - osum.v_swtch)); X ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Broken in r291090. Everything in the same printf is broken, but the other bugs are newer and older: - in 4.4BSD-Lite2, the the format was %lu for all 3 values to be printed, but the type was MD. It was apparently long. The struct fields were all u_int IIRC, but the rate() expression involves time_t. time_t was _BSD_TIME_T_, which was apparently long on all arches. - FreeBSD fixed time_t to be int on at least i386. The type error was still non-fatal on 32-bit arches with 32-bit time_t. - I fixed this in r37453. The fix wasn't so good. It retained the %lu format and added casts to u_long to match the format. But the casts are unportable and became wrong when v_swtch etc. were expanded. - r123407 broke the style by changing all u_* to unsigned *. - the casts became wrong, but fairly harmlessly so, on 32-bit arches when v_swtch, etc. was changed to counter_u64_t in r317061 when v_swtch was expanded to counter_u64_t. The problem is limit because the values are rays of differences. Even %u format is probably enough for this. X vmstat.c:1035:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_swtch); X ^~~~~~~~~~~ X vmstat.c:1037:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_intr); X ^~~~~~~~~~ X vmstat.c:1039:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_soft); X ^~~~~~~~~~ X vmstat.c:1040:38: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X xo_emit("{:traps/%9u} {N:traps}\n", sum.v_trap); X ~~~ ^~~~~~~~~~ X %9lu X vmstat.c:1042:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_syscall); X ^~~~~~~~~~~~~ X vmstat.c:1044:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_kthreads); X ^~~~~~~~~~~~~~ X vmstat.c:1045:46: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X xo_emit("{:forks/%9u} {N: fork() calls}\n", sum.v_forks); X ~~~ ^~~~~~~~~~~ X %9lu X vmstat.c:1047:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_vforks); X ^~~~~~~~~~~~ X vmstat.c:1049:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_rforks); X ^~~~~~~~~~~~ X vmstat.c:1051:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_swapin); X ^~~~~~~~~~~~ X vmstat.c:1053:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_swappgsin); X ^~~~~~~~~~~~~~~ X vmstat.c:1055:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_swapout); X ^~~~~~~~~~~~~ X vmstat.c:1057:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_swappgsout); X ^~~~~~~~~~~~~~~~ X vmstat.c:1059:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_vnodein); X ^~~~~~~~~~~~~ X vmstat.c:1061:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_vnodepgsin); X ^~~~~~~~~~~~~~~~ X vmstat.c:1063:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_vnodeout); X ^~~~~~~~~~~~~~ X vmstat.c:1065:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_vnodepgsout); X ^~~~~~~~~~~~~~~~~ X vmstat.c:1067:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_pdwakeups); X ^~~~~~~~~~~~~~~ X vmstat.c:1069:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_pdpages); X ^~~~~~~~~~~~~ X vmstat.c:1071:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_pdshortfalls); X ^~~~~~~~~~~~~~~~~~ X vmstat.c:1073:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_reactivated); X ^~~~~~~~~~~~~~~~~ X vmstat.c:1075:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_cow_faults); X ^~~~~~~~~~~~~~~~ X vmstat.c:1077:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_cow_optim); X ^~~~~~~~~~~~~~~ X vmstat.c:1079:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_zfod); X ^~~~~~~~~~ X vmstat.c:1081:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_ozfod); X ^~~~~~~~~~~ X vmstat.c:1083:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_intrans); X ^~~~~~~~~~~~~ X vmstat.c:1085:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_vm_faults); X ^~~~~~~~~~~~~~~ X vmstat.c:1087:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_io_faults); X ^~~~~~~~~~~~~~~ X vmstat.c:1089:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_kthreadpages); X ^~~~~~~~~~~~~~~~~~ X vmstat.c:1091:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_forkpages); X ^~~~~~~~~~~~~~~ X vmstat.c:1093:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_vforkpages); X ^~~~~~~~~~~~~~~~ X vmstat.c:1095:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_rforkpages); X ^~~~~~~~~~~~~~~~ X vmstat.c:1097:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_tfree); X ^~~~~~~~~~~ X vmstat.c:1099:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_dfree); X ^~~~~~~~~~~ X vmstat.c:1101:3: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_pfree); X ^~~~~~~~~~~ Breakage of printing of the raw v_foo fields has a shorter history. I think they always had type u_int and were honestly printed with %u before counter_u64_t. But libxo prepared to break them by not using __printflike(), and counter_u64_t broke them by not updating the format. clang reports that uint64_t is aka u_long, but this is only for 64-bit arches. X vmstat.c:1127:39: error: flag ' ' results in undefined behavior with 'p' conversion specifier [-Werror,-Wformat] X "({:positive-cache-hits/%ld}% pos + " X ~^~ X vmstat.c:1131:6: error: format specifies type 'void *' but the argument has type 'long' [-Werror,-Wformat] X PCT(lnchstats.ncs_neghits, nchtotal), X ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Maybe xo_emit() is not actually printf() compatible. For printf(), the percent sign must be printed using %%, but xo_emit() seems to print unquoted % correct. This one is "% ". The format checker seems to have a bug too. It treats "% p" as %p, which gives a cascade of errors. Broken code like this probably just wants literal %. X vmstat.c:1024:23: note: expanded from macro 'PCT' X #define PCT(top, bot) pct((long)(top), (long)(bot)) X ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ X vmstat.c:1128:39: error: invalid conversion specifier '{' [-Werror,-Wformat-invalid-specifier] X "{:negative-cache-hits/%ld}% {N:neg}) " X ~~^ X vmstat.c:1129:40: error: more '%' conversions than data arguments [-Werror,-Wformat] X "system {:cache-hit-percent/%ld}% per-directory\n", X ~~^ X vmstat.c:1133:51: error: invalid conversion specifier ',' [-Werror,-Wformat-invalid-specifier] X xo_emit("{P:/%9s} {L:deletions} {:deletions/%ld}%, " X ~^ This one is "%,". This ends the error cascade for the xo_emit() on line 1126 (it has 3 quoting errors for %). X vmstat.c:1134:43: error: invalid conversion specifier ',' [-Werror,-Wformat-invalid-specifier] X "{L:falsehits} {:false-hits/%ld}%, " X ~^ X vmstat.c:1135:39: error: invalid conversion specifier '\x0a' [-Werror,-Wformat-invalid-specifier] X "{L:toolong} {:too-long/%ld}%\n", "", X ~^ Similarly. 3 more quoting errors for the xo_emit() on line 1133. X vmstat.c:1149:6: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_forks, sum.v_forkpages, X ^~~~~~~~~~~ X vmstat.c:1149:19: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_forks, sum.v_forkpages, X ^~~~~~~~~~~~~~~ X vmstat.c:1154:6: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_vforks, sum.v_vforkpages, X ^~~~~~~~~~~~ X vmstat.c:1154:20: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_vforks, sum.v_vforkpages, X ^~~~~~~~~~~~~~~~ X vmstat.c:1159:6: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_rforks, sum.v_rforkpages, X ^~~~~~~~~~~~ X vmstat.c:1159:20: error: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X sum.v_rforks, sum.v_rforkpages, X ^~~~~~~~~~~~~~~~ Back to misprinting counter_u64_t's. X vmstat.c:1473:30: error: format specifies type 'char *' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X memstat_get_name(mtp), memstat_get_count(mtp), X ^~~~~~~~~~~~~~~~~~~~~~ X vmstat.c:1474:47: error: format specifies type 'unsigned long' but the argument has type 'char *' [-Werror,-Wformat] A very large error. The count is misprinted using %s format... X (memstat_get_bytes(mtp) + 1023) / 1024, "-", X ^~~ X vmstat.c:1475:7: error: format specifies type 'char *' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] X memstat_get_numallocs(mtp)); X ^~~~~~~~~~~~~~~~~~~~~~~~~~ X vmstat.c:1472:20: error: more '%' conversions than data arguments [-Werror,-Wformat] X "{:requests/%8" PRIu64 "} ", X ~~~~^ X /usr/include/x86/_inttypes.h:100:25: note: expanded from macro 'PRIu64' X #define PRIu64 __PRI64"u" /* uint64_t */ X ^ There are 6 format specifiers but only 5 args. Apparently the second specifier (%s) is missing a string arg or shouldn't be there. After removing this, no errors are detected for this xo_emit(). The __PRI64 mistake is used in a few places including this. It helps make the format almost unreadable. X vmstat.c:1673:20: error: more '%' conversions than data arguments [-Werror,-Wformat] X xo_emit("{T:RES/%5s} {T:ACT/%5s} {T:INACT/%5s} {T:REF/%3s} {T:SHD/%3s} " X ~~^ Here it seems clear that xo_emit() is not actually printf() compatible. It passes no args to this call. This prints nothing for vmstat -o. I don't want libxo and don't know how to use it. The documented syntax "vmstat --libxo followed by normal args" is a syntax error. X 56 errors generated. vmstat.c now has no printf()s except for 2 snprintf()s, so has essentially no printf() format checking. A few things are printed in dehumanized format by prthuman() = dehumanize_number() + xo_attr() with %ju format. These get upcast enough to work, and the format of the xo_attr() for this is easily checked manually. xo_attr() is also not declared as __printflike(). Bruce From owner-svn-src-head@freebsd.org Fri Nov 24 09:15: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 8389ADC1BBA; Fri, 24 Nov 2017 09:15:09 +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 32BF86C2C5; Fri, 24 Nov 2017 09:15:08 +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 B4BBF3C5900; Fri, 24 Nov 2017 20:15:06 +1100 (AEDT) Date: Fri, 24 Nov 2017 20:15:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat In-Reply-To: <20171123151849.GU2272@kib.kiev.ua> Message-ID: <20171124184535.E980@besplex.bde.org> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> <20171122103917.GS2272@kib.kiev.ua> <20171123021646.M1933@besplex.bde.org> <20171122220538.GT2272@kib.kiev.ua> <20171123224032.A992@besplex.bde.org> <20171123151849.GU2272@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=TKKoXLfbl_5D-oQeqmUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 09:15:09 -0000 On Thu, 23 Nov 2017, Konstantin Belousov wrote: > On Fri, Nov 24, 2017 at 12:10:09AM +1100, Bruce Evans wrote: >> On Thu, 23 Nov 2017, Konstantin Belousov wrote: >* ... >>> Below is the cast to uintmax_t and unsigned format for sysctl(8). >> >> This adds style bugs by expanding lines from length 79 to 81. >> >>> diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c >>> index e1bf4e31914..92685a8171b 100644 >>> --- a/sbin/sysctl/sysctl.c >>> +++ b/sbin/sysctl/sysctl.c >* ... >> All of the casts to uintmax_t can be avoided be avoided by changing the type >> of pageKilo from int to uintmax_t. >> >> Better, do the conversion in a function-like macro pgtokb() as is done in >> all (?) other utilities, but without so many overflow bugs as in most other >> utiities: >> >> #define pgtok(p) ((uintmax_t)(p) * pageKilo) > Amusingly there is already MD macro in machine/param.h with the same name > and same intent, but as you formulate it, sloppy implementation. It uses > unsigned long cast on almost all 64bit arches, except powerpc. For 32bit > arches, the cast is not done, unfortunately. I already pointed out the system pgtok(). It was almost correct to cast to u_int on all arches because the implementation can know the size of all its page counters. That was int or u_int, and the expansion factor is small. In practice, 32-bit systems never have enough memory to overflow in K (that happens at 4TB), and 64-bit systems that overflow in K are close to overflowing the page counters (that happens at 16TB with 4K-pages). The pgtok() is just unusable because the page size can vary. Perhaps it is a design error to allow the page size to vary or be anything except 512 in APIs, just like for disk sector sizes. Most disk APIs uses units of bytes or 512-blocks. The physical size may be different. Applications need to know the physical memory page size even less than they need to know the physical sector size. >> (pageKilo is back to int). This is still sloppy: >> - pageKilo = getpagesize() / 1024 assumes that the page size is a multiple >> of 1024 and fails very badly when the page size is 512 >> - the multiplication can still overflow >> - when the size in K is too large to fit, the size in M or G will normally >> fit and converting directly to would avoid the overflow assuming that >> the page size is <= 1M. >> >> Using floating point (even float precision) avoids all overflow and rounding >> problems up to almost 128-bit sizes in bytes: > No, I do not want to use floating point calculation there. Why not? I don't want to use it here, but that is because I don't want the whole S_vmtotal() function here. I want to use it in most places that print large values. Using it in systat is most natural since floating point is already used a lot there. OTOH, I don't like libdevstat using it, sepecially long double. It doesn't simplify much except representation of rates in libdevstat. The high precision of long double is especially not needed for device statistics, and the precision cannot be depended on to be more than double since many arches only have fake long double. Using it for libdevstat just pessimizes for arches that have non-fake long double. > diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c > index e1bf4e31914..36851f302a0 100644 > --- a/sbin/sysctl/sysctl.c > +++ b/sbin/sysctl/sysctl.c > @@ -608,14 +608,18 @@ S_timeval(size_t l2, void *p) > static int > S_vmtotal(size_t l2, void *p) > { > - struct vmtotal *v = (struct vmtotal *)p; > - int pageKilo = getpagesize() / 1024; > + struct vmtotal *v; > + int pageKilo; > > if (l2 != sizeof(*v)) { > warnx("S_vmtotal %zu != %zu", l2, sizeof(*v)); > return (1); > } > > + v = p; > + pageKilo = getpagesize() / 1024; OK. > + > +#define pg2k(a) ((uintmax_t)(a) * pageKilo) "2" is a bad abbreviation for "to". It isn't even shorter, and requires cetain language skils to understand, and is especially unsuitable for conversion functions since the digit 2 might mean a conversion factor. > + printf("Free Memory:\t%juK", pg2k(v->t_free)); > +#undef pg2k No need to undef it. It is in the application namespace. Here are my old fixes for this function (to clean it up before removing it): X Index: sysctl.c X =================================================================== X RCS file: /home/ncvs/src/sbin/sysctl/sysctl.c,v X retrieving revision 1.86 X diff -u -2 -r1.86 sysctl.c X --- sysctl.c 11 Jun 2007 13:02:15 -0000 1.86 X +++ sysctl.c 25 Sep 2017 07:04:54 -0000 X @@ -379,5 +381,5 @@ X { X struct vmtotal *v = (struct vmtotal *)p; X - int pageKilo = getpagesize() / 1024; X + int pageKilo; X X if (l2 != sizeof(*v)) { I fixed 1 of the initializatons in declarations. The other one is not so bad (except for its redundant cast). This is a common style for void * args and would be needed with const void * args. X @@ -385,24 +387,19 @@ X return (1); X } X - X - printf( X - "\nSystem wide totals computed every five seconds:" X - " (values in kilobytes)\n"); X + pageKilo = getpagesize() / 1024; X + printf("\nSystem wide totals computed every five seconds:\n"); Fix style bugs in outout (verboseness). Fix style bugs in source code (obfuscation of the string by splitting it, and unnecessary splitting after 'printf('. There is an unfixed problem with the newline at the start. For sysctl -n, it is just wrong. It is to start the header on a new line for sysctl without -n. This breaks grepability of sysctl -a output, but the multi- line output breaks that anyway. X printf("===============================================\n"); X printf( X - "Processes:\t\t(RUNQ: %hd Disk Wait: %hd Page Wait: " X - "%hd Sleep: %hd)\n", X - v->t_rq, v->t_dw, v->t_pw, v->t_sl); X - printf( X - "Virtual Memory:\t\t(Total: %dK, Active %dK)\n", X +"Processes:\t\t(RUNQ %d, Disk Wait %d, Page Wait %d, Sleep %d, Swap %d)\n", X + v->t_rq, v->t_dw, v->t_pw, v->t_sl, v->t_sw); X + printf("Virtual Memory:\t\t(Total %luK, Active %dK)\n", X v->t_vm * pageKilo, v->t_avm * pageKilo); Outdent the string to unobfuscate it. Don't us fancy %hd format. I think the fields still have type int16_t, so using %hd has no effect now, but would break expansion to int. AFAIK, the only use for %hd is to convert int args that aren't actually representable as shorts back to shorts before printing them. Use commas after 'keyword: value' pairs and don't use semicolons after keywords here and everywhere. X - printf("Real Memory:\t\t(Total: %dK Active %dK)\n", X + printf("Real Memory:\t\t(Total %dK, Active %dK)\n", X v->t_rm * pageKilo, v->t_arm * pageKilo); X - printf("Shared Virtual Memory:\t(Total: %dK Active: %dK)\n", X + printf("Shared Virtual Memory:\t(Total %dK, Active %dK)\n", X v->t_vmshr * pageKilo, v->t_avmshr * pageKilo); X - printf("Shared Real Memory:\t(Total: %dK Active: %dK)\n", X + printf("Shared Real Memory:\t(Total %dK, Active %dK)\n", X v->t_rmshr * pageKilo, v->t_armshr * pageKilo); This is for an old version, so it still prints plain ints. X - printf("Free Memory Pages:\t%dK\n", v->t_free * pageKilo); X - X + printf("Free Memory:\t\t%dK", v->t_free * pageKilo); Fix units (remove Pages). Already done in -current. Remove another extra blank line. X return (0); X } Grepping for 'Pages' shows it in further bloat for memory size printing (efi and/or smap for amd64 and/or i386 only). 1 place for efi seems to print a page count, while most places print lengths or offsets in bytes, and for that it is essential to use hex format which is done for smap (0x%16jx format). I think efi should support larger sizes, but it only uses %012lx %12p %08lx formats (here %12p is because md_virt has the non-vm type void *; this has various problems -- IIRC it gives an 0x prefix which the other fields don't have, and the width 12 is ignored in userland. The other widths are too small. The other field types uint64_t (even for md_pages). The field widths of 12 and 8 are too small for uint64_t, and the lx only work for uint64_t because this code is only used by amd64. I don't use efi, and normally see smap sizes only after booting with -v. This is one of the things broken by late initialization of consoles in -current (lots of printfs are done before consoles or the msgbuf are initialized). Bruce From owner-svn-src-head@freebsd.org Fri Nov 24 09:21: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 A4BD8DC1F64 for ; Fri, 24 Nov 2017 09:21:39 +0000 (UTC) (envelope-from wma@semihalf.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 4454D6C6A4 for ; Fri, 24 Nov 2017 09:21:39 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-qt0-x229.google.com with SMTP id d15so30640632qte.4 for ; Fri, 24 Nov 2017 01:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=plTXRLx9wFU3C9gNKwvNULArkc9AvIrN4vL4S10l/mM=; b=1b3addDsA+fuRoF8w98mnTGqBTb7vJTsXfOb6thi/J+99DJSAwDRQcG99/GbTzq+Ld 2p0sPD3Rn2xasIM6eaLhcQCSquaavXBFHXWTYh9kXHmxAn2AuU4gKZkrf0d5MegxHQrs 6LeN3RTikcBuuvdk45JJGhq3MzEB3BflzRkj7zrR0CgqGuHAY5Erqh7hmhAVtJwIqraI VkbChJELCgThz05qAwuRFM+B83TYcSQ/ABT405d7tjfN6vB9BpLeuxTJPBNRjvVfcfas YZVbqPo92yLKyxlTEWueflYFdi4QieaLSIKGg2kfqhAbIRdWIE8woxwaUm/7dL85AvpR NgPQ== 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=plTXRLx9wFU3C9gNKwvNULArkc9AvIrN4vL4S10l/mM=; b=tjXEBOk52QOOJ1oY7nfwbR+ZlPH4CyKBgdnKItSWjOEHSpuzEArf9zlzrRgrjBymnV gRFUeOsPof8l8SlqisH97abM3QZyHSYvIl1ZfOt11ecCwFbbEbTmzEmW7UeWN+bBd/Nc eR5kGCbqwZCJ0Hy16oZoar6oymN3LYVA2rZ0/BweSBdA/asFegMHeuFy/Ts98niqvBrM 17QXTljN6b9UitUohSk2BA5B0sTQw6uuN8aO5HUYymRdcRgSh87/TaPtCUGpMjMxnWWn 2dC7F+PuxFKaaGbh9SGe/Kh1Khh1cEC1DdYjOQRc0R4pU2ilpzbc9Tisykk1/ZjkpUJZ Xz+g== X-Gm-Message-State: AJaThX6EXGCLlDswpj8ImmFcGFng0MHzRiXqv4cN0JR6UyzgIi94pH5X BK5//JLZrXl8HT2cFZIWWoE6K2YrTkFhJfypjR8BIQ== X-Google-Smtp-Source: AGs4zMYau7I0ndbjBhPlsJwju4KKL7OlD5HB8cF5OQssfhstjX8w5d+muiean/YPxda/5qdJJ6rVTael8w0dw1jfo/M= X-Received: by 10.200.55.231 with SMTP id e36mr44023899qtc.274.1511515298015; Fri, 24 Nov 2017 01:21:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.57.73 with HTTP; Fri, 24 Nov 2017 01:21:17 -0800 (PST) In-Reply-To: <201711222310.vAMNAKmb048921@repo.freebsd.org> References: <201711222310.vAMNAKmb048921@repo.freebsd.org> From: Wojciech Macek Date: Fri, 24 Nov 2017 10:21:17 +0100 Message-ID: Subject: Re: svn commit: r326109 - in head/sys: conf dev/bhnd dev/bhnd/cores/chipc mips/conf modules/bhnd To: "Landon J. Fuller" , adrian@freebsd.org Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 09:21:39 -0000 Hi, The patch breaks the build for ppc64. Could you please add missing ofw_bus_if.h to the Makefile? cc -isystem /home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/include -L/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/lib -B/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/lib --sysroot=/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp -B/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/usr/bin -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -DHAVE_KERNEL_OPTION_HEADERS -include /home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/sys/GENERIC64/opt_global.h -I. -I/home/wma/ppc64-freebsd/sys -fno-common -g -mlongcall -fno-omit-frame-pointer -I/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/sys/GENERIC64 -MD -MF.depend.chipc_gpio.o -MTchipc_gpio.o -mno-altivec -ffreestanding -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-uninitialized -finline-limit=15000 -fms-extensions --param inline-unit-growth=100 --param large-function-growth=1000 -msoft-float -mcall-aixdesc -std=iso9899:1999 -c /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c -o chipc_gpio.o In file included from /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:40, from /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48: /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:40:24: error: ofw_bus_if.h: No such file or directory cc1: warnings being treated as errors In file included from /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:40, from /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48: /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:71: warning: 'struct ofw_bus_devinfo' declared inside parameter list /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:71: warning: its scope is only this definition or declaration, which is probably not what you want /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:72: warning: 'struct ofw_bus_devinfo' declared inside parameter list /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:74: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_compat' /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:75: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_model' /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:76: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_name' /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:77: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_node' /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:78: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_type' In file included from /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48: /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:115: error: field 'opd_obdinfo' has incomplete type *** [chipc_gpio.o] Error code 1 make[4]: stopped in /home/wma/ppc64-freebsd/sys/modules/bhnd --- all_subdir_cardbus --- --- cardbus.o --- ctfconvert -L VERSION -g cardbus.o A failure has been detected in another branch of the parallel make Regards, Wojtek 2017-11-23 0:10 GMT+01:00 Landon J. Fuller : > Author: landonf > Date: Wed Nov 22 23:10:20 2017 > New Revision: 326109 > URL: https://svnweb.freebsd.org/changeset/base/326109 > > Log: > bhnd(4): Add a basic ChipCommon GPIO driver sufficient to support bwn(4) > > The driver is functional on both BHND Wi-Fi adapters and MIPS SoCs, but > does not currently include support for features not required by bwn(4), > including GPIO interrupt handling. > > Approved by: adrian (mentor, implicit) > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D12708 > > Added: > head/sys/dev/bhnd/cores/chipc/chipc_gpio.c (contents, props changed) > head/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h (contents, props > changed) > Modified: > head/sys/conf/files > head/sys/dev/bhnd/bhnd_types.h > head/sys/dev/bhnd/cores/chipc/chipc.c > head/sys/dev/bhnd/cores/chipc/chipc_subr.c > head/sys/dev/bhnd/cores/chipc/chipcreg.h > head/sys/mips/conf/BCM > head/sys/mips/conf/SENTRY5 > head/sys/modules/bhnd/Makefile > > Modified: head/sys/conf/files > ============================================================ > ================== > --- head/sys/conf/files Wed Nov 22 22:04:27 2017 (r326108) > +++ head/sys/conf/files Wed Nov 22 23:10:20 2017 (r326109) > @@ -1246,6 +1246,7 @@ dev/bhnd/cores/chipc/bhnd_sprom_chipc.c optional > bhnd > dev/bhnd/cores/chipc/bhnd_pmu_chipc.c optional bhnd > dev/bhnd/cores/chipc/chipc.c optional bhnd > dev/bhnd/cores/chipc/chipc_cfi.c optional bhnd cfi > +dev/bhnd/cores/chipc/chipc_gpio.c optional bhnd gpio > dev/bhnd/cores/chipc/chipc_slicer.c optional bhnd cfi | bhnd spibus > dev/bhnd/cores/chipc/chipc_spi.c optional bhnd spibus > dev/bhnd/cores/chipc/chipc_subr.c optional bhnd > > Modified: head/sys/dev/bhnd/bhnd_types.h > ============================================================ > ================== > --- head/sys/dev/bhnd/bhnd_types.h Wed Nov 22 22:04:27 2017 > (r326108) > +++ head/sys/dev/bhnd/bhnd_types.h Wed Nov 22 23:10:20 2017 > (r326109) > @@ -75,6 +75,7 @@ typedef enum { > BHND_SERVICE_PWRCTL, /**< legacy pwrctl service; > implements the bhnd_pwrctl interface */ > BHND_SERVICE_PMU, /**< pmu service; implements the > bhnd_pmu interface */ > BHND_SERVICE_NVRAM, /**< nvram service; implements the > bhnd_nvram interface */ > + BHND_SERVICE_GPIO, /**< gpio service; implements the > standard gpio interface */ > > BHND_SERVICE_ANY = 1000, /**< match on any service type */ > } bhnd_service_t; > > Modified: head/sys/dev/bhnd/cores/chipc/chipc.c > ============================================================ > ================== > --- head/sys/dev/bhnd/cores/chipc/chipc.c Wed Nov 22 22:04:27 2017 > (r326108) > +++ head/sys/dev/bhnd/cores/chipc/chipc.c Wed Nov 22 23:10:20 2017 > (r326109) > @@ -306,6 +306,20 @@ chipc_add_children(struct chipc_softc *sc) > } > } > > + /* GPIO */ > + child = BUS_ADD_CHILD(sc->dev, 0, "gpio", 0); > + if (child == NULL) { > + device_printf(sc->dev, "failed to add gpio\n"); > + return (ENXIO); > + } > + > + error = chipc_set_mem_resource(sc, child, 0, 0, RM_MAX_END, 0, 0); > + if (error) { > + device_printf(sc->dev, "failed to set gpio memory > resource: " > + "%d\n", error); > + return (error); > + } > + > /* All remaining devices are SoC-only */ > if (bhnd_get_attach_type(sc->dev) != BHND_ATTACH_NATIVE) > return (0); > @@ -835,6 +849,25 @@ chipc_alloc_resource(device_t dev, device_t child, int > if ((cr = chipc_find_region(sc, start, end)) == NULL) { > /* Resource requests outside our shared port regions can be > * delegated to our parent. */ > + rv = bus_generic_rl_alloc_resource(dev, child, type, rid, > + start, end, count, flags); > + return (rv); > + } > + > + /* > + * As a special case, children that map the complete ChipCommon > register > + * block are delegated to our parent. > + * > + * The rman API does not support sharing resources that are not > + * identical in size; since we allocate subregions to various > children, > + * any children that need to map the entire register block (e.g. > because > + * they require access to discontiguous register ranges) must make > the > + * allocation through our parent, where we hold a compatible > + * RF_SHAREABLE allocation. > + */ > + if (cr == sc->core_region && cr->cr_addr == start && > + cr->cr_end == end && cr->cr_count == count) > + { > rv = bus_generic_rl_alloc_resource(dev, child, type, rid, > start, end, count, flags); > return (rv); > > Added: head/sys/dev/bhnd/cores/chipc/chipc_gpio.c > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/bhnd/cores/chipc/chipc_gpio.c Wed Nov 22 23:10:20 2017 > (r326109) > @@ -0,0 +1,846 @@ > +/*- > + * Copyright (c) 2017 The FreeBSD Foundation > + * All rights reserved. > + * > + * This software was developed by Landon Fuller under sponsorship from > + * the FreeBSD Foundation. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * 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$ > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include "gpio_if.h" > + > +#include "bhnd_nvram_map.h" > + > +#include "chipcreg.h" > +#include "chipc_gpiovar.h" > + > +/* > + * ChipCommon GPIO driver > + */ > + > +static int chipc_gpio_check_flags( > + struct chipc_gpio_softc *sc, > + uint32_t pin_num, uint32_t flags, > + chipc_gpio_pin_mode *mode); > +static int chipc_gpio_pin_update( > + struct chipc_gpio_softc *sc, > + struct chipc_gpio_update *update, > + uint32_t pin_num, uint32_t flags); > +static int chipc_gpio_commit_update( > + struct chipc_gpio_softc *sc, > + struct chipc_gpio_update *update); > +static chipc_gpio_pin_mode chipc_gpio_pin_get_mode( > + struct chipc_gpio_softc *sc, > + uint32_t pin_num); > + > + > +/* Debugging flags */ > +static u_long chipc_gpio_debug = 0; > +TUNABLE_ULONG("hw.bhnd_chipc.gpio_debug", &chipc_gpio_debug); > + > +enum { > + /** Allow userspace GPIO access on bridged network (e.g. wi-fi) > + * adapters */ > + CC_GPIO_DEBUG_ADAPTER_GPIOC = 1 << 0, > +}; > + > +#define CC_GPIO_DEBUG(_type) (CC_GPIO_DEBUG_ ## _type & > chipc_gpio_debug) > + > +static struct bhnd_device_quirk chipc_gpio_quirks[]; > + > +/* Supported parent core device identifiers */ > +static const struct bhnd_device chipc_gpio_devices[] = { > + BHND_DEVICE(BCM, CC, "Broadcom ChipCommon GPIO", > chipc_gpio_quirks), > + BHND_DEVICE_END > +}; > + > +/* Device quirks table */ > +static struct bhnd_device_quirk chipc_gpio_quirks[] = { > + BHND_CORE_QUIRK (HWREV_LTE(10), CC_GPIO_QUIRK_NO_EVENTS), > + BHND_CORE_QUIRK (HWREV_LTE(15), CC_GPIO_QUIRK_NO_DCTIMER), > + BHND_CORE_QUIRK (HWREV_LTE(19), CC_GPIO_QUIRK_NO_PULLUPDOWN), > + > + BHND_DEVICE_QUIRK_END > +}; > + > +static int > +chipc_gpio_probe(device_t dev) > +{ > + const struct bhnd_device *id; > + device_t chipc; > + > + /* Look for compatible chipc parent */ > + chipc = device_get_parent(dev); > + id = bhnd_device_lookup(chipc, chipc_gpio_devices, > + sizeof(chipc_gpio_devices[0])); > + if (id == NULL) > + return (ENXIO); > + > + device_set_desc(dev, id->desc); > + return (BUS_PROBE_NOWILDCARD); > +} > + > +static int > +chipc_gpio_attach(device_t dev) > +{ > + struct chipc_gpio_softc *sc; > + device_t chipc; > + int error; > + > + chipc = device_get_parent(dev); > + > + sc = device_get_softc(dev); > + sc->dev = dev; > + sc->quirks = bhnd_device_quirks(chipc, chipc_gpio_devices, > + sizeof(chipc_gpio_devices[0])); > + > + /* If this is a bridged wi-fi adapter, we don't want to support > + * userspace requests via gpioc(4) */ > + if (bhnd_get_attach_type(chipc) == BHND_ATTACH_ADAPTER) { > + if (!CC_GPIO_DEBUG(ADAPTER_GPIOC)) > + sc->quirks |= CC_GPIO_QUIRK_NO_GPIOC; > + } > + > + CC_GPIO_LOCK_INIT(sc); > + > + sc->mem_rid = 0; > + sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, > &sc->mem_rid, > + RF_ACTIVE|RF_SHAREABLE); > + if (sc->mem_res == NULL) { > + device_printf(dev, "failed to allocate chipcommon > registers\n"); > + error = ENXIO; > + goto failed; > + } > + > + /* > + * If hardware 'pulsate' support is available, set the timer > duty-cycle > + * to either the NVRAM 'leddc' value if available, or the default > duty > + * cycle. > + */ > + if (!CC_GPIO_QUIRK(sc, NO_DCTIMER)) { > + uint32_t dctimerval; > + > + error = bhnd_nvram_getvar_uint32(chipc, BHND_NVAR_LEDDC, > + &dctimerval); > + if (error == ENOENT) { > + /* Fall back on default duty cycle */ > + dctimerval = CHIPC_GPIOTIMERVAL_DEFAULT; > + } else if (error) { > + device_printf(dev, "error reading %s from NVRAM: > %d\n", > + BHND_NVAR_LEDDC, error); > + goto failed; > + } > + > + CC_GPIO_WR4(sc, CHIPC_GPIOTIMERVAL, dctimerval); > + } > + > + /* Attach gpioc/gpiobus */ > + if (CC_GPIO_QUIRK(sc, NO_GPIOC)) { > + sc->gpiobus = NULL; > + } else { > + if ((sc->gpiobus = gpiobus_attach_bus(dev)) == NULL) { > + device_printf(dev, "failed to attach gpiobus\n"); > + error = ENXIO; > + goto failed; > + } > + } > + > + /* Register as the bus GPIO provider */ > + if ((error = bhnd_register_provider(dev, BHND_SERVICE_GPIO))) { > + device_printf(dev, "failed to register gpio with bus: > %d\n", > + error); > + goto failed; > + } > + > + return (0); > + > +failed: > + device_delete_children(dev); > + > + if (sc->mem_res != NULL) { > + bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, > + sc->mem_res); > + } > + > + CC_GPIO_LOCK_DESTROY(sc); > + > + return (error); > +} > + > +static int > +chipc_gpio_detach(device_t dev) > +{ > + struct chipc_gpio_softc *sc; > + int error; > + > + sc = device_get_softc(dev); > + > + if ((error = bus_generic_detach(dev))) > + return (error); > + > + if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY))) > + return (error); > + > + bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, > sc->mem_res); > + CC_GPIO_LOCK_DESTROY(sc); > + > + return (0); > +} > + > +static device_t > +chipc_gpio_get_bus(device_t dev) > +{ > + struct chipc_gpio_softc *sc = device_get_softc(dev); > + > + return (sc->gpiobus); > +} > + > +static int > +chipc_gpio_pin_max(device_t dev, int *maxpin) > +{ > + *maxpin = CC_GPIO_NPINS-1; > + return (0); > +} > + > +static int > +chipc_gpio_pin_set(device_t dev, uint32_t pin_num, uint32_t pin_value) > +{ > + struct chipc_gpio_softc *sc; > + bool pin_high; > + int error; > + > + sc = device_get_softc(dev); > + error = 0; > + > + if (!CC_GPIO_VALID_PIN(pin_num)) > + return (EINVAL); > + > + switch (pin_value) { > + case GPIO_PIN_HIGH: > + pin_high = true; > + break; > + case GPIO_PIN_LOW: > + pin_high = false; > + break; > + default: > + return (EINVAL); > + } > + > + CC_GPIO_LOCK(sc); > + > + switch (chipc_gpio_pin_get_mode(sc, pin_num)) { > + case CC_GPIO_PIN_INPUT: > + case CC_GPIO_PIN_TRISTATE: > + error = ENODEV; > + break; > + > + case CC_GPIO_PIN_OUTPUT: > + CC_GPIO_WRFLAG(sc, pin_num, GPIOOUT, pin_high); > + break; > + } > + > + CC_GPIO_UNLOCK(sc); > + > + return (error); > +} > + > +static int > +chipc_gpio_pin_get(device_t dev, uint32_t pin_num, uint32_t *pin_value) > +{ > + struct chipc_gpio_softc *sc; > + bool pin_high; > + > + if (!CC_GPIO_VALID_PIN(pin_num)) > + return (EINVAL); > + > + sc = device_get_softc(dev); > + pin_high = false; > + > + CC_GPIO_LOCK(sc); > + > + switch (chipc_gpio_pin_get_mode(sc, pin_num)) { > + case CC_GPIO_PIN_INPUT: > + pin_high = CC_GPIO_RDFLAG(sc, pin_num, GPIOIN); > + break; > + > + case CC_GPIO_PIN_OUTPUT: > + pin_high = CC_GPIO_RDFLAG(sc, pin_num, GPIOOUT); > + break; > + > + case CC_GPIO_PIN_TRISTATE: > + pin_high = false; > + break; > + } > + > + CC_GPIO_UNLOCK(sc); > + > + *pin_value = pin_high ? GPIO_PIN_HIGH : GPIO_PIN_LOW; > + > + return (0); > +} > + > +static int > +chipc_gpio_pin_toggle(device_t dev, uint32_t pin_num) > +{ > + struct chipc_gpio_softc *sc; > + bool pin_high; > + int error; > + > + if (!CC_GPIO_VALID_PIN(pin_num)) > + return (EINVAL); > + > + sc = device_get_softc(dev); > + error = 0; > + > + CC_GPIO_LOCK(sc); > + > + switch (chipc_gpio_pin_get_mode(sc, pin_num)) { > + case CC_GPIO_PIN_INPUT: > + case CC_GPIO_PIN_TRISTATE: > + error = ENODEV; > + break; > + > + case CC_GPIO_PIN_OUTPUT: > + pin_high = CC_GPIO_RDFLAG(sc, pin_num, GPIOOUT); > + CC_GPIO_WRFLAG(sc, pin_num, GPIOOUT, !pin_high); > + break; > + } > + > + CC_GPIO_UNLOCK(sc); > + > + return (error); > +} > + > +static int > +chipc_gpio_pin_getcaps(device_t dev, uint32_t pin_num, uint32_t *caps) > +{ > + struct chipc_gpio_softc *sc = device_get_softc(dev); > + > + if (!CC_GPIO_VALID_PIN(pin_num)) > + return (EINVAL); > + > + *caps = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_PIN_TRISTATE); > + > + if (!CC_GPIO_QUIRK(sc, NO_PULLUPDOWN)) > + *caps |= (GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN); > + > + if (!CC_GPIO_QUIRK(sc, NO_DCTIMER)) > + *caps |= GPIO_PIN_PULSATE; > + > + return (0); > +} > + > +static int > +chipc_gpio_pin_getflags(device_t dev, uint32_t pin_num, uint32_t *flags) > +{ > + struct chipc_gpio_softc *sc = device_get_softc(dev); > + > + if (!CC_GPIO_VALID_PIN(pin_num)) > + return (EINVAL); > + > + CC_GPIO_LOCK(sc); > + > + switch (chipc_gpio_pin_get_mode(sc, pin_num)) { > + case CC_GPIO_PIN_INPUT: > + *flags = GPIO_PIN_INPUT; > + > + if (!CC_GPIO_QUIRK(sc, NO_PULLUPDOWN)) { > + if (CC_GPIO_RDFLAG(sc, pin_num, GPIOPU)) { > + *flags |= GPIO_PIN_PULLUP; > + } else if (CC_GPIO_RDFLAG(sc, pin_num, GPIOPD)) { > + *flags |= GPIO_PIN_PULLDOWN; > + } > + } > + break; > + > + case CC_GPIO_PIN_OUTPUT: > + *flags = GPIO_PIN_OUTPUT; > + > + if (!CC_GPIO_QUIRK(sc, NO_DCTIMER)) { > + if (CC_GPIO_RDFLAG(sc, pin_num, GPIOTIMEROUTMASK)) > + *flags |= GPIO_PIN_PULSATE; > + } > + > + break; > + > + case CC_GPIO_PIN_TRISTATE: > + *flags = GPIO_PIN_TRISTATE|GPIO_PIN_OUTPUT; > + break; > + } > + > + CC_GPIO_UNLOCK(sc); > + > + return (0); > +} > + > +static int > +chipc_gpio_pin_getname(device_t dev, uint32_t pin_num, char *name) > +{ > + int ret; > + > + if (!CC_GPIO_VALID_PIN(pin_num)) > + return (EINVAL); > + > + ret = snprintf(name, GPIOMAXNAME, "bhnd_gpio%02" PRIu32, pin_num); > + > + if (ret < 0) > + return (ENXIO); > + > + if (ret >= GPIOMAXNAME) > + return (ENOMEM); > + > + return (0); > +} > + > +static int > +chipc_gpio_pin_setflags(device_t dev, uint32_t pin_num, uint32_t flags) > +{ > + struct chipc_gpio_softc *sc; > + struct chipc_gpio_update upd; > + int error; > + > + sc = device_get_softc(dev); > + > + if (!CC_GPIO_VALID_PIN(pin_num)) > + return (EINVAL); > + > + /* Produce an update descriptor */ > + memset(&upd, 0, sizeof(upd)); > + if ((error = chipc_gpio_pin_update(sc, &upd, pin_num, flags))) > + return (error); > + > + /* Commit the update */ > + CC_GPIO_LOCK(sc); > + error = chipc_gpio_commit_update(sc, &upd); > + CC_GPIO_UNLOCK(sc); > + > + return (error); > +} > + > +static int > +chipc_gpio_pin_access_32(device_t dev, uint32_t first_pin, uint32_t > clear_pins, > + uint32_t change_pins, uint32_t *orig_pins) > +{ > + struct chipc_gpio_softc *sc; > + struct chipc_gpio_update upd; > + uint32_t out, outen, ctrl; > + uint32_t num_pins; > + int error; > + > + sc = device_get_softc(dev); > + > + if (first_pin >= CC_GPIO_NPINS) > + return (EINVAL); > + > + /* Determine the actual number of referenced pins */ > + if (clear_pins == 0 && change_pins == 0) { > + num_pins = CC_GPIO_NPINS - first_pin; > + } else { > + int num_clear_pins, num_change_pins; > + > + num_clear_pins = flsl((u_long)clear_pins); > + num_change_pins = flsl((u_long)change_pins); > + num_pins = MAX(num_clear_pins, num_change_pins); > + } > + > + /* Validate the full pin range */ > + if (!CC_GPIO_VALID_PINS(first_pin, num_pins)) > + return (EINVAL); > + > + /* Produce an update descriptor for all pins, relative to the > current > + * pin state */ > + CC_GPIO_LOCK(sc); > + memset(&upd, 0, sizeof(upd)); > + > + out = CC_GPIO_RD4(sc, CHIPC_GPIOOUT); > + outen = CC_GPIO_RD4(sc, CHIPC_GPIOOUTEN); > + ctrl = CC_GPIO_RD4(sc, CHIPC_GPIOCTRL); > + > + for (uint32_t i = 0; i < num_pins; i++) { > + uint32_t pin; > + bool pin_high; > + > + pin = first_pin + i; > + > + /* The pin must be configured for output */ > + if ((outen & (1 << pin)) == 0) { > + CC_GPIO_UNLOCK(sc); > + return (EINVAL); > + } > + > + /* The pin must not tristated */ > + if ((ctrl & (1 << pin)) != 0) { > + CC_GPIO_UNLOCK(sc); > + return (EINVAL); > + } > + > + /* Fetch current state */ > + if (out & (1 << pin)) { > + pin_high = true; > + } else { > + pin_high = false; > + } > + > + /* Apply clear/toggle request */ > + if (clear_pins & (1 << pin)) > + pin_high = false; > + > + if (change_pins & (1 << pin)) > + pin_high = !pin_high; > + > + /* Add to our update descriptor */ > + CC_GPIO_UPDATE(&upd, pin, out, pin_high); > + } > + > + /* Commit the update */ > + error = chipc_gpio_commit_update(sc, &upd); > + CC_GPIO_UNLOCK(sc); > + > + return (error); > +} > + > +static int > +chipc_gpio_pin_config_32(device_t dev, uint32_t first_pin, uint32_t > num_pins, > + uint32_t *pin_flags) > +{ > + struct chipc_gpio_softc *sc; > + struct chipc_gpio_update upd; > + int error; > + > + sc = device_get_softc(dev); > + > + if (!CC_GPIO_VALID_PINS(first_pin, num_pins)) > + return (EINVAL); > + > + /* Produce an update descriptor */ > + memset(&upd, 0, sizeof(upd)); > + for (uint32_t i = 0; i < num_pins; i++) { > + uint32_t pin, flags; > + > + pin = first_pin + i; > + flags = pin_flags[i]; > + > + /* As per the gpio_config_32 API documentation, any pins > for > + * which neither GPIO_PIN_OUTPUT or GPIO_PIN_INPUT are set > + * should be ignored and left unmodified */ > + if ((flags & (GPIO_PIN_OUTPUT|GPIO_PIN_INPUT)) == 0) > + continue; > + > + if ((error = chipc_gpio_pin_update(sc, &upd, pin, flags))) > + return (error); > + } > + > + /* Commit the update */ > + CC_GPIO_LOCK(sc); > + error = chipc_gpio_commit_update(sc, &upd); > + CC_GPIO_UNLOCK(sc); > + > + return (error); > +} > + > + > +/** > + * Commit a single @p reg register update. > + */ > +static void > +chipc_gpio_commit_reg(struct chipc_gpio_softc *sc, bus_size_t offset, > + struct chipc_gpio_reg *reg) > +{ > + uint32_t value; > + > + CC_GPIO_LOCK_ASSERT(sc, MA_OWNED); > + > + if (reg->mask == 0) > + return; > + > + value = bhnd_bus_read_4(sc->mem_res, offset); > + value &= ~reg->mask; > + value |= reg->value; > + > + bhnd_bus_write_4(sc->mem_res, offset, value); > +} > + > +/** > + * Commit the set of GPIO register updates described by @p update. > + */ > +static int > +chipc_gpio_commit_update(struct chipc_gpio_softc *sc, > + struct chipc_gpio_update *update) > +{ > + CC_GPIO_LOCK_ASSERT(sc, MA_OWNED); > + > + /* Commit pulldown/pullup before potentially disabling an output > pin */ > + chipc_gpio_commit_reg(sc, CHIPC_GPIOPD, &update->pulldown); > + chipc_gpio_commit_reg(sc, CHIPC_GPIOPU, &update->pullup); > + > + /* Commit output settings before potentially enabling an output > pin */ > + chipc_gpio_commit_reg(sc, CHIPC_GPIOTIMEROUTMASK, > + &update->timeroutmask); > + chipc_gpio_commit_reg(sc, CHIPC_GPIOOUT, &update->out); > + > + /* Commit input/output/tristate modes */ > + chipc_gpio_commit_reg(sc, CHIPC_GPIOOUTEN, &update->outen); > + chipc_gpio_commit_reg(sc, CHIPC_GPIOCTRL, &update->ctrl); > + > + return (0); > +} > + > +/** > + * Apply the changes described by @p flags for @p pin_num to the given @p > update > + * descriptor. > + */ > +static int > +chipc_gpio_pin_update(struct chipc_gpio_softc *sc, > + struct chipc_gpio_update *update, uint32_t pin_num, uint32_t flags) > +{ > + chipc_gpio_pin_mode mode; > + int error; > + > + if (!CC_GPIO_VALID_PIN(pin_num)) > + return (EINVAL); > + > + /* Verify flag compatibility and determine the pin mode */ > + if ((error = chipc_gpio_check_flags(sc, pin_num, flags, &mode))) > + return (error); > + > + /* Apply the mode-specific changes */ > + switch (mode) { > + case CC_GPIO_PIN_INPUT: > + CC_GPIO_UPDATE(update, pin_num, pullup, false); > + CC_GPIO_UPDATE(update, pin_num, pulldown, false); > + CC_GPIO_UPDATE(update, pin_num, out, false); > + CC_GPIO_UPDATE(update, pin_num, outen, false); > + CC_GPIO_UPDATE(update, pin_num, timeroutmask, false); > + CC_GPIO_UPDATE(update, pin_num, ctrl, false); > + > + if (flags & GPIO_PIN_PULLUP) { > + CC_GPIO_UPDATE(update, pin_num, pullup, true); > + } else if (flags & GPIO_PIN_PULLDOWN) { > + CC_GPIO_UPDATE(update, pin_num, pulldown, true); > + } > + > + return (0); > + > + case CC_GPIO_PIN_OUTPUT: > + CC_GPIO_UPDATE(update, pin_num, pullup, false); > + CC_GPIO_UPDATE(update, pin_num, pulldown, false); > + CC_GPIO_UPDATE(update, pin_num, outen, true); > + CC_GPIO_UPDATE(update, pin_num, timeroutmask, false); > + CC_GPIO_UPDATE(update, pin_num, ctrl, false); > + > + if (flags & GPIO_PIN_PRESET_HIGH) { > + CC_GPIO_UPDATE(update, pin_num, out, true); > + } else if (flags & GPIO_PIN_PRESET_LOW) { > + CC_GPIO_UPDATE(update, pin_num, out, false); > + } > + > + if (flags & GPIO_PIN_PULSATE) > + CC_GPIO_UPDATE(update, pin_num, timeroutmask, > true); > + > + return (0); > + > + case CC_GPIO_PIN_TRISTATE: > + CC_GPIO_UPDATE(update, pin_num, pullup, false); > + CC_GPIO_UPDATE(update, pin_num, pulldown, false); > + CC_GPIO_UPDATE(update, pin_num, out, false); > + CC_GPIO_UPDATE(update, pin_num, outen, false); > + CC_GPIO_UPDATE(update, pin_num, timeroutmask, false); > + CC_GPIO_UPDATE(update, pin_num, ctrl, true); > + > + if (flags & GPIO_PIN_OUTPUT) > + CC_GPIO_UPDATE(update, pin_num, outen, true); > + > + return (0); > + } > + > + device_printf(sc->dev, "unknown pin mode %d\n", mode); > + return (EINVAL); > +} > + > +/** > + * Verify that @p flags are valid for use with @p pin_num, and on success, > + * return the pin mode described by @p flags in @p mode. > + * > + * @param sc GPIO driver instance state. > + * @param pin_num The pin number to configure. > + * @param flags The pin flags to be validated. > + * @param[out] mode On success, will be populated with the GPIO pin > mode > + * defined by @p flags. > + * > + * @retval 0 success > + * @retval EINVAL if @p flags are invalid. > + */ > +static int > +chipc_gpio_check_flags(struct chipc_gpio_softc *sc, uint32_t pin_num, > + uint32_t flags, chipc_gpio_pin_mode *mode) > +{ > + uint32_t mode_flag, input_flag, output_flag; > + > + CC_GPIO_ASSERT_VALID_PIN(sc, pin_num); > + > + mode_flag = flags & (GPIO_PIN_OUTPUT | GPIO_PIN_INPUT | > + GPIO_PIN_TRISTATE); > + output_flag = flags & (GPIO_PIN_PRESET_HIGH | GPIO_PIN_PRESET_LOW > + | GPIO_PIN_PULSATE); > + input_flag = flags & (GPIO_PIN_PULLUP | GPIO_PIN_PULLDOWN); > + > + switch (mode_flag) { > + case GPIO_PIN_OUTPUT: > + /* No input flag(s) should be set */ > + if (input_flag != 0) > + return (EINVAL); > + > + /* Validate our output flag(s) */ > + switch (output_flag) { > + case GPIO_PIN_PRESET_HIGH: > + case GPIO_PIN_PRESET_LOW: > + case (GPIO_PIN_PRESET_HIGH|GPIO_PIN_PULSATE): > + case (GPIO_PIN_PRESET_LOW|GPIO_PIN_PULSATE): > + case 0: > + /* Check for unhandled flags */ > + if ((flags & ~(mode_flag | output_flag)) != 0) > + return (EINVAL); > + > + *mode = CC_GPIO_PIN_OUTPUT; > + return (0); > + > + default: > + /* Incompatible output flags */ > + return (EINVAL); > + } > + > + case GPIO_PIN_INPUT: > + /* No output flag(s) should be set */ > + if (output_flag != 0) > + return (EINVAL); > + > + /* Validate our input flag(s) */ > + switch (input_flag) { > + case GPIO_PIN_PULLUP: > + case GPIO_PIN_PULLDOWN: > + case 0: > + /* Check for unhandled flags */ > + if ((flags & ~(mode_flag | input_flag)) != 0) > + return (EINVAL); > + > + *mode = CC_GPIO_PIN_INPUT; > + return (0); > + > + default: > + /* Incompatible input flags */ > + return (EINVAL); > + } > + > + break; > + > + case (GPIO_PIN_TRISTATE|GPIO_PIN_OUTPUT): > + case GPIO_PIN_TRISTATE: > + /* No input or output flag(s) should be set */ > + if (input_flag != 0 || output_flag != 0) > + return (EINVAL); > + > + /* Check for unhandled flags */ > + if ((flags & ~mode_flag) != 0) > + return (EINVAL); > + > + *mode = CC_GPIO_PIN_TRISTATE; > + return (0); > + > + default: > + /* Incompatible mode flags */ > + return (EINVAL); > + } > +} > + > +/** > + * Return the current pin mode for @p pin_num. > + * > + * @param sc GPIO driver instance state. > + * @param pin_num The pin number to query. > + */ > +static chipc_gpio_pin_mode > +chipc_gpio_pin_get_mode(struct chipc_gpio_softc *sc, uint32_t pin_num) > +{ > + CC_GPIO_LOCK_ASSERT(sc, MA_OWNED); > + CC_GPIO_ASSERT_VALID_PIN(sc, pin_num); > + > + if (CC_GPIO_RDFLAG(sc, pin_num, GPIOCTRL)) { > + return (CC_GPIO_PIN_TRISTATE); > + } else if (CC_GPIO_RDFLAG(sc, pin_num, GPIOOUTEN)) { > + return (CC_GPIO_PIN_OUTPUT); > + } else { > + return (CC_GPIO_PIN_INPUT); > + } > +} > + > +static device_method_t chipc_gpio_methods[] = { > + /* Device interface */ > + DEVMETHOD(device_probe, chipc_gpio_probe), > + DEVMETHOD(device_attach, chipc_gpio_attach), > + DEVMETHOD(device_detach, chipc_gpio_detach), > + > + /* GPIO interface */ > + DEVMETHOD(gpio_get_bus, chipc_gpio_get_bus), > + DEVMETHOD(gpio_pin_max, chipc_gpio_pin_max), > + DEVMETHOD(gpio_pin_getname, chipc_gpio_pin_getname), > + DEVMETHOD(gpio_pin_getflags, chipc_gpio_pin_getflags), > + DEVMETHOD(gpio_pin_getcaps, chipc_gpio_pin_getcaps), > + DEVMETHOD(gpio_pin_setflags, chipc_gpio_pin_setflags), > + DEVMETHOD(gpio_pin_get, chipc_gpio_pin_get), > + DEVMETHOD(gpio_pin_set, chipc_gpio_pin_set), > + DEVMETHOD(gpio_pin_toggle, chipc_gpio_pin_toggle), > + DEVMETHOD(gpio_pin_access_32, chipc_gpio_pin_access_32), > + DEVMETHOD(gpio_pin_config_32, chipc_gpio_pin_config_32), > + > + DEVMETHOD_END > +}; > + > +static devclass_t gpio_devclass; > + > +DEFINE_CLASS_0(gpio, chipc_gpio_driver, chipc_gpio_methods, sizeof(struct > chipc_gpio_softc)); > +EARLY_DRIVER_MODULE(chipc_gpio, bhnd_chipc, chipc_gpio_driver, > + gpio_devclass, NULL, NULL, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); > + > +MODULE_DEPEND(chipc_gpio, bhnd, 1, 1, 1); > +MODULE_DEPEND(chipc_gpio, gpiobus, 1, 1, 1); > +MODULE_VERSION(chipc_gpio, 1); > > Added: head/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h > ============================================================ > ================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h Wed Nov 22 > 23:10:20 2017 (r326109) > @@ -0,0 +1,161 @@ > +/*- > + * Copyright (c) 2017 The FreeBSD Foundation > + * All rights reserved. > + * > + * This software was developed by Landon Fuller under sponsorship from > + * the FreeBSD Foundation. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * 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$ > + */ > + > +#ifndef _BHND_CORES_CHIPC_CHIPC_GPIOVAR_H_ > +#define _BHND_CORES_CHIPC_CHIPC_GPIOVAR_H_ > + > +#include > +#include > + > +#include > +#include > + > +#include > + > +/** > + * ChipCommon GPIO device quirks. > + */ > +enum { > + /** > + * No GPIO event support. > + * > + * The CHIPC_GPIOEVENT, CHIPC_GPIOEVENT_INTM, and > + * CHIPC_GPIOEVENT_INTPOLARITY registers are not available. > + */ > + CC_GPIO_QUIRK_NO_EVENTS = (1<<0), > + > + /** > + * No GPIO duty-cycle timer support. > + * > + * The CHIPC_GPIOTIMERVAL and CHIPC_GPIOTIMEROUTMASK registers are > not > + * available. > + */ > + CC_GPIO_QUIRK_NO_DCTIMER = (1<<1), > + > + /** > + * No GPIO pull-up/pull-down configuration support. > + * > + * The CHIPC_GPIOPU and CHIPC_GPIOPD registers are not available. > + */ > + CC_GPIO_QUIRK_NO_PULLUPDOWN = (1<<2), > + > + /** > + * Do not attach a child gpioc(4) device. > + * > + * This is primarily intended for use on bridged Wi-Fi adapters, > where > + * userspace modification of GPIO pin configuration could introduce > + * significant undesirable behavior. > + */ > + CC_GPIO_QUIRK_NO_GPIOC = (1<<3), > +}; > + > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > From owner-svn-src-head@freebsd.org Fri Nov 24 10:45: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 A029FDDF6B2; Fri, 24 Nov 2017 10:45:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A8E26EBF4; Fri, 24 Nov 2017 10:45:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAOAjX51056082; Fri, 24 Nov 2017 10:45:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOAjXoI056081; Fri, 24 Nov 2017 10:45:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711241045.vAOAjXoI056081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 Nov 2017 10:45:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326150 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Commit-Revision: 326150 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 10:45:34 -0000 Author: avg Date: Fri Nov 24 10:45:33 2017 New Revision: 326150 URL: https://svnweb.freebsd.org/changeset/base/326150 Log: zdb: use a heap allocation instead of a huge array on stack SPA_MAXBLOCKSIZE is 16 MB and having such a large object on the stack is not nice in general and it could cause some confusing failures in the single-user mode where the default stack size of 8 MB is used. I expect that the upstream would make the same change. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Nov 24 09:55:20 2017 (r326149) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Nov 24 10:45:33 2017 (r326150) @@ -3724,7 +3724,7 @@ zdb_embedded_block(char *thing) { blkptr_t bp = { 0 }; unsigned long long *words = (void *)&bp; - char buf[SPA_MAXBLOCKSIZE]; + char *buf; int err; err = sscanf(thing, "%llx:%llx:%llx:%llx:%llx:%llx:%llx:%llx:" @@ -3738,12 +3738,15 @@ zdb_embedded_block(char *thing) exit(1); } ASSERT3U(BPE_GET_LSIZE(&bp), <=, SPA_MAXBLOCKSIZE); + buf = malloc(SPA_MAXBLOCKSIZE); err = decode_embedded_bp(&bp, buf, BPE_GET_LSIZE(&bp)); if (err != 0) { (void) printf("decode failed: %u\n", err); + free(buf); exit(1); } zdb_dump_block_raw(buf, BPE_GET_LSIZE(&bp), 0); + free(buf); } static boolean_t From owner-svn-src-head@freebsd.org Fri Nov 24 10:57:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FFFADDF99F; Fri, 24 Nov 2017 10:57:31 +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 DD80E6F498; Fri, 24 Nov 2017 10:57:30 +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 vAOAvKDX004525 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 24 Nov 2017 12:57:20 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vAOAvKDX004525 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vAOAvKAB004524; Fri, 24 Nov 2017 12:57:20 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 24 Nov 2017 12:57:20 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat Message-ID: <20171124105720.GW2272@kib.kiev.ua> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> <20171122103917.GS2272@kib.kiev.ua> <20171123021646.M1933@besplex.bde.org> <20171122220538.GT2272@kib.kiev.ua> <20171123224032.A992@besplex.bde.org> <20171123151849.GU2272@kib.kiev.ua> <20171124184535.E980@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171124184535.E980@besplex.bde.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 10:57:31 -0000 On Fri, Nov 24, 2017 at 08:15:06PM +1100, Bruce Evans wrote: > On Thu, 23 Nov 2017, Konstantin Belousov wrote: > > > On Fri, Nov 24, 2017 at 12:10:09AM +1100, Bruce Evans wrote: > >> On Thu, 23 Nov 2017, Konstantin Belousov wrote: > >* ... > >>> Below is the cast to uintmax_t and unsigned format for sysctl(8). > >> > >> This adds style bugs by expanding lines from length 79 to 81. > >> > >>> diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c > >>> index e1bf4e31914..92685a8171b 100644 > >>> --- a/sbin/sysctl/sysctl.c > >>> +++ b/sbin/sysctl/sysctl.c > >* ... > >> All of the casts to uintmax_t can be avoided be avoided by changing the type > >> of pageKilo from int to uintmax_t. > >> > >> Better, do the conversion in a function-like macro pgtokb() as is done in > >> all (?) other utilities, but without so many overflow bugs as in most other > >> utiities: > >> > >> #define pgtok(p) ((uintmax_t)(p) * pageKilo) > > Amusingly there is already MD macro in machine/param.h with the same name > > and same intent, but as you formulate it, sloppy implementation. It uses > > unsigned long cast on almost all 64bit arches, except powerpc. For 32bit > > arches, the cast is not done, unfortunately. > > I already pointed out the system pgtok(). > > It was almost correct to cast to u_int on all arches because the > implementation can know the size of all its page counters. That was int > or u_int, and the expansion factor is small. In practice, 32-bit systems > never have enough memory to overflow in K (that happens at 4TB), and > 64-bit systems that overflow in K are close to overflowing the page > counters (that happens at 16TB with 4K-pages). > > The pgtok() is just unusable because the page size can vary. No, it is unusable only due to the implementation not ensuring the consistent output type. > > Perhaps it is a design error to allow the page size to vary or be > anything except 512 in APIs, just like for disk sector sizes. Most > disk APIs uses units of bytes or 512-blocks. The physical size may > be different. Applications need to know the physical memory page size > even less than they need to know the physical sector size. Not everybody share the warm memories about VAX. I think there were no single significant architecture with hardware support for virtual memory, after the VAX, which used less than 4K sized pages. > > Here are my old fixes for this function (to clean it up before removing it): I picked some of this, mainly I do not want to change the output format. I am sure that there are scripts around which parse it. diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index e1bf4e31914..de7fd67f258 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -608,33 +608,33 @@ S_timeval(size_t l2, void *p) static int S_vmtotal(size_t l2, void *p) { - struct vmtotal *v = (struct vmtotal *)p; - int pageKilo = getpagesize() / 1024; + struct vmtotal *v; + int pageKilo; if (l2 != sizeof(*v)) { warnx("S_vmtotal %zu != %zu", l2, sizeof(*v)); return (1); } - printf( - "\nSystem wide totals computed every five seconds:" + v = p; + pageKilo = getpagesize() / 1024; + +#define pg2k(a) ((uintmax_t)(a) * pageKilo) + printf("\nSystem wide totals computed every five seconds:" " (values in kilobytes)\n"); printf("===============================================\n"); - printf( - "Processes:\t\t(RUNQ: %hd Disk Wait: %hd Page Wait: " - "%hd Sleep: %hd)\n", + printf("Processes:\t\t(RUNQ: %d Disk Wait: %d Page Wait: " + "%d Sleep: %d)\n", v->t_rq, v->t_dw, v->t_pw, v->t_sl); - printf( - "Virtual Memory:\t\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_vm * pageKilo, (intmax_t)v->t_avm * pageKilo); - printf("Real Memory:\t\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_rm * pageKilo, (intmax_t)v->t_arm * pageKilo); - printf("Shared Virtual Memory:\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_vmshr * pageKilo, (intmax_t)v->t_avmshr * pageKilo); - printf("Shared Real Memory:\t(Total: %jdK Active: %jdK)\n", - (intmax_t)v->t_rmshr * pageKilo, (intmax_t)v->t_armshr * pageKilo); - printf("Free Memory:\t%jdK", (intmax_t)v->t_free * pageKilo); - + printf("Virtual Memory:\t\t(Total: %juK Active: %juK)\n", + pg2k(v->t_vm), pg2k(v->t_avm)); + printf("Real Memory:\t\t(Total: %juK Active: %juK)\n", + pg2k(v->t_rm), pg2k(v->t_arm)); + printf("Shared Virtual Memory:\t(Total: %juK Active: %juK)\n", + pg2k(v->t_vmshr), pg2k(v->t_avmshr)); + printf("Shared Real Memory:\t(Total: %juK Active: %juK)\n", + pg2k(v->t_rmshr), pg2k(v->t_armshr)); + printf("Free Memory:\t%juK", pg2k(v->t_free)); return (0); } @@ -695,8 +695,9 @@ S_efi_map(size_t l2, void *p) type = types[map->md_type]; else type = ""; - printf("\n%23s %012lx %12p %08lx ", type, map->md_phys, - map->md_virt, map->md_pages); + printf("\n%23s %012jx %12p %08jx ", type, + (uintmax_t)map->md_phys, map->md_virt, + (uintmax_t)map->md_pages); if (map->md_attr & EFI_MD_ATTR_UC) printf("UC "); if (map->md_attr & EFI_MD_ATTR_WC) From owner-svn-src-head@freebsd.org Fri Nov 24 11:10: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 A6385DDFE57; Fri, 24 Nov 2017 11:10:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70F426FBB1; Fri, 24 Nov 2017 11:10:37 +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 vAOBAa0F064598; Fri, 24 Nov 2017 11:10:36 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOBAaqf064597; Fri, 24 Nov 2017 11:10:36 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711241110.vAOBAaqf064597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 Nov 2017 11:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326151 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 326151 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 11:10:37 -0000 Author: avg Date: Fri Nov 24 11:10:36 2017 New Revision: 326151 URL: https://svnweb.freebsd.org/changeset/base/326151 Log: vmm/amd: improve iteration over IVHD (type 10h) entries in IVRS table Many 8-byte entries have zero at byte 4, so the second 4-byte part is skipped as a 4-byte padding entry. But not all 8-byte entries have that property and they get misinterpreted. A real example: 48 00 00 00 ff 01 00 01 This an 8-byte ACPI_IVRS_TYPE_SPECIAL entry for IOAPIC with ID 255 (bogus). It is reported as: ivhd0: Unknown dev entry:0xff Fortunately, it was completely harmless. Also, bail out early if we encounter an entry of a variable length type. We do not have proper handling for those yet. Reviewed by: anish Modified: head/sys/amd64/vmm/amd/ivrs_drv.c Modified: head/sys/amd64/vmm/amd/ivrs_drv.c ============================================================================== --- head/sys/amd64/vmm/amd/ivrs_drv.c Fri Nov 24 10:45:33 2017 (r326150) +++ head/sys/amd64/vmm/amd/ivrs_drv.c Fri Nov 24 11:10:36 2017 (r326151) @@ -186,7 +186,8 @@ ivhd_dev_add_entry(struct amdvi_softc *softc, uint32_t static int ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi_softc *softc) { - ACPI_IVRS_DE_HEADER *de, *end; + ACPI_IVRS_DE_HEADER *de; + uint8_t *p, *end; int range_start_id = 0, range_end_id = 0; uint32_t *extended; uint8_t all_data = 0, range_data = 0; @@ -195,12 +196,15 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi softc->start_dev_rid = ~0; softc->end_dev_rid = 0; - de = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd + - sizeof(ACPI_IVRS_HARDWARE)); - end = (ACPI_IVRS_DE_HEADER *) ((uint8_t *)ivhd + - ivhd->Header.Length); + /* + * XXX The following actually depends on Header.Type and + * is only true for 0x10. + */ + p = (uint8_t *)ivhd + sizeof(ACPI_IVRS_HARDWARE); + end = (uint8_t *)ivhd + ivhd->Header.Length; - while (de < (ACPI_IVRS_DE_HEADER *) end) { + while (p < end) { + de = (ACPI_IVRS_DE_HEADER *)p; softc->start_dev_rid = MIN(softc->start_dev_rid, de->Id); softc->end_dev_rid = MAX(softc->end_dev_rid, de->Id); switch (de->Type) { @@ -263,7 +267,15 @@ ivhd_dev_parse(ACPI_IVRS_HARDWARE * ivhd, struct amdvi "WARN Too many device entries.\n"); return (EINVAL); } - de++; + if (de->Type < 0x40) + p += sizeof(ACPI_IVRS_DEVICE4); + else if (de->Type < 0x80) + p += sizeof(ACPI_IVRS_DEVICE8A); + else { + printf("Variable size IVHD type 0x%x not supported\n", + de->Type); + break; + } } KASSERT((softc->end_dev_rid >= softc->start_dev_rid), From owner-svn-src-head@freebsd.org Fri Nov 24 11:20: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 C2ED1DE12A4; Fri, 24 Nov 2017 11:20: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 8C16370060; Fri, 24 Nov 2017 11:20:11 +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 vAOBKAg1068837; Fri, 24 Nov 2017 11:20:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOBKAOS068836; Fri, 24 Nov 2017 11:20:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711241120.vAOBKAOS068836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 Nov 2017 11:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326152 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 326152 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 11:20:11 -0000 Author: avg Date: Fri Nov 24 11:20:10 2017 New Revision: 326152 URL: https://svnweb.freebsd.org/changeset/base/326152 Log: amd-vi: fix and extend definition of Command and Event Status Register (0x2020) The defined bits are the lower bits, not the higher ones. Also, the specification has been extended to define bits 0:18 and they all could potentially be interesting to us, so extend the width of the field accordingly. Reviewed by: anish Modified: head/sys/amd64/vmm/amd/amdvi_priv.h Modified: head/sys/amd64/vmm/amd/amdvi_priv.h ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_priv.h Fri Nov 24 11:10:36 2017 (r326151) +++ head/sys/amd64/vmm/amd/amdvi_priv.h Fri Nov 24 11:20:10 2017 (r326152) @@ -230,8 +230,8 @@ struct amdvi_ctrl { uint64_t :45; uint32_t evt_tail:19; uint64_t :45; - uint64_t :56; - uint8_t status:8; + uint8_t status:19; + uint64_t :45; uint64_t pad2; uint8_t :4; uint16_t ppr_head:15; From owner-svn-src-head@freebsd.org Fri Nov 24 11:25:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E939DE1521; Fri, 24 Nov 2017 11:25:08 +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 ECFCD70457; Fri, 24 Nov 2017 11:25:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAOBP72h073006; Fri, 24 Nov 2017 11:25:07 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOBP7QT073005; Fri, 24 Nov 2017 11:25:07 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711241125.vAOBP7QT073005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 Nov 2017 11:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326153 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 326153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 11:25:08 -0000 Author: avg Date: Fri Nov 24 11:25:06 2017 New Revision: 326153 URL: https://svnweb.freebsd.org/changeset/base/326153 Log: amd-vi: fix up r326152, the new width requires a wider type This is my brain-o from extending the width at the last moment. Modified: head/sys/amd64/vmm/amd/amdvi_priv.h Modified: head/sys/amd64/vmm/amd/amdvi_priv.h ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_priv.h Fri Nov 24 11:20:10 2017 (r326152) +++ head/sys/amd64/vmm/amd/amdvi_priv.h Fri Nov 24 11:25:06 2017 (r326153) @@ -230,7 +230,7 @@ struct amdvi_ctrl { uint64_t :45; uint32_t evt_tail:19; uint64_t :45; - uint8_t status:19; + uint32_t status:19; uint64_t :45; uint64_t pad2; uint8_t :4; From owner-svn-src-head@freebsd.org Fri Nov 24 11:25: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 EE42ADE1570; Fri, 24 Nov 2017 11:25:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 9BB557058F; Fri, 24 Nov 2017 11:25:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 4798C1A2950; Fri, 24 Nov 2017 22:25:20 +1100 (AEDT) Date: Fri, 24 Nov 2017 22:25:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Devin Teske cc: rgrimes@freebsd.org, cem@freebsd.org, Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts In-Reply-To: Message-ID: <20171124201621.K980@besplex.bde.org> References: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cK6QihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=iKhvJSA4AAAA:8 a=Lpu6KP7YsmZzQ4qs308A:9 a=4k1axM4VWg1rTiNl:21 a=orbeyFRGbSfW1TGh:21 a=CjuIK1q_8ugA:10 a=odh9cflL3HIXMm4fY7Wr:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 11:25:25 -0000 On Thu, 23 Nov 2017, Devin Teske wrote: >> On Nov 23, 2017, at 9:29 AM, Rodney W. Grimes wrote: >> >> [ Charset UTF-8 unsupported, converting... ] >>> On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes >>> wrote: >>>>> Also we do provide an ntp.conf so ... >>>> >>>> We do, a template, all commented out, and does not work for >>>> machines behind strong firewalls that wont allow ntp out >>>> to the net but have internal ntp servers that are used for >>>> such things. >>>> >>>> Well maybe not all commented out, I think it defaults to >>>> some public pools. I believe it would be missing iburst >>>> for use with ntp -pg >>> >>> Does ntpdate work out of the box in such environments? If so, how? >> >> ntpdate time.nist.gov >> >> ntpdate does not need a configureration file, just a command >> line argument. >> >> > > At the banks we used to rely on both (in this order) ntpdate running and then ntpd running. I still rely on this (but I use an old version of ntpd where the removal of ntpdate is not so advanced). I think the ntpd developers wanted to remove ntpdate long ago, and thought that they did not so long ago, but apparently it they didn't because it is too important for this use. At best, ntpd would have an option that makes it behave exactly the same as ntpdate, so removing it would just be a spelling error. ntpdate's man page claims this, but is wrong AFAIK. It says that the functionality of ntpdate is now available in ntpd(8) using -q. However ntpdate -q is far from having equivalent functionality. According to both testing of the old version and its current man page, it does the same slow syncing as normal ntpd startup, and just exits after this and doesn't daemonize while doing this. With the old version, this step takes 35-40 seconds starting with the time already synced to withing a few microseconds (by a previous invocation of ntpd), while ntpdate syncs (perhaps not so well) with a server half the world away in about 1 second. > Running ntpdate before ntpd meant that on a [re]boot, ntpdate would jump the box to the appropriate time, regardless of how far behind the clock was (think "dead cmos battery" on a system left powered-off for a long time). Think "any hardware without an atomic local clock". With an atomic clock, the initial sync might take as little as 35-40 seconds because the local clock is more accurate than the remote clock, but ntpd doesn't know that so it takes about the same time as starting with a pre-synched clock. The same problem happens after suspend/resume. With PC cmos clocks, the time granularity is 1 second. It is possible to have an accuracy of better than 1 second by reading and writing the clock on seconds boundaries, but clock drift is usually seconds per day so no one bothers to do this (except some of my versions read the clock on seconds boundaries; writing is harder). The result is that after an immediate reboot, the PC clock always appears to be off by up to 2 seconds from a 1 second error in reading it and a 1 second error in writing it (average only half as much). For reboots after a few hours, add drift of a few seconds. The same happens for suspend/resume, even after finally fixing the i386 case in acpi. Old pmtimer code tried harder to restore a correct time on resume, but only tried to account for drift _before_ suspend. acpi on i386 was missing the restore until a year or 2 ago. The restore was only done for amd64 using an amd64 ifdef to break it for other arches. This was fixed by removing the ifdef. FreeBSD-10 still has the ifdef. Anyway, the situation is not much better with the restore after resume than without it. The only good way to restore the time after suspend is to run ntpdate in the resume script, just like it should be run at boot time. ntpd -q of course doesn't work, since it would take too long to resync, or might give up if the difference is too large. I've never seen a resume script that restores the clock (the example one in /etc does nothing useful except for 15-20 year old pccard hardware). Suspsend/resume doesn't work on most of my systems so I didn't write such a script. I just removed the -x flag that I was using to prevent ntpd stepping the time. All steps were supposed to be done by ntpdate at boot time or later by the sysadmin, but that doesn't work after suspend/resume since the only good way to fix up even the small 1-2 second error is to step the clock. -x was too broken to use for fixing up large differences. IIRC, it didn't understand its own corrections and treated these as further drift, so differences of even 128 seconds blew out to the abort point of 900 seconds. After fixing this, small differences just take too long to fix via slews, and differences of 900 seconds still cause aborts (since that is too large to slew and -x prevents stepping). But suspend/resume for just 900+ seconds without the restore in the kernel always causes such differences. Reboot behaves better, even without ntpdate, since it always sets the time from the RTC so the error is usually only a few seconds. Without -x or any intelligence in the kernel or resume script, in the usual case where ntpd was running before suspend, it keeps runnning after resume and eventually syncs the time by stepping it, at least for small differences. Perhaps large differences are handled better because they are obviously wrong. The steps occur some time after resume so they do more damage, just like similar steps after reboot without ntpdate. ntpd -q in /etc/rc.d would probably avoid the steps later, at a cost of increasing the boot time to 35+ seconds if not days. > Meanwhile, running ntpd *without* the sync-on-start feature meant we could bounce the ntpd service as necessary and it would always adhere to the limit we set on it -- one hour to prevent syncing on systems which had been manually adjusted by greater than an hour for some one-off instances. I thought that everyone used ntpdate, but /etc/defaults/rc.conf has had ntpdate_enable="NO" since at least FreeBSD-5. There is no trace of ntpd -q in the boot scripts, so apparently almost everyone gets a slow sync followed by a step (or slower sync with no step) instead of the slow boot that would be given by ntpd -q. I also use ntpdate to help manually sync ntpd much faster than it can do itself (but in more than 35 seconds). The method is to stop ntpd and observe the drift using ntpdate -q. Before obvserving the drift, set the drift in the driftfile to 0 and start and stop ntpd again to kill the current drift adjustements. Then set the drift in the drift file for the current temperature to within 1 ppm. Then start and stop ntpd to apply the new drift adjusments. Then set the time using ntpdate -b. Then run ntpd normally. I just tested the normal misbehaviour for booting when ntpdate is not configured: - without -q for ntpd, the boot time was fast but the initial offset (after rebooting with an offset of a few microseconds) was 769 milliseconds. ntpd reduced this by stepping by -769 ms after 38 seconds. - with -q for ntpd, ntpd hung for 39 seconds before applying a step of -359 ms and then exiting. At least old versions of rc.d don't really support -q, so this leaves no ntpd running and even starting it manually using its script won't work since the script uses -q from the defaults again. So it seems that a delay of only 35-40 seconds is normal. ntpd doesn't really sync, but steps the clock to get close. The delay doesn't depend much on the driftfile. My driftfile says 1+ ppm. Changing this to 0 or 40 or removing the driftfile makes little difference for the non-boot test of restarting ntpd with -q. Even ntpd -q that "synced" in 1 second wouldn't be equivalent to ntpdate, since it doesn't have ntpdate's options. There are many of these, but I only use -b and -q. ntpd has debugging options like -q, but these are more complicated and perhaps not available during startup. Bruce From owner-svn-src-head@freebsd.org Fri Nov 24 11:25: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 7683FDE1624; Fri, 24 Nov 2017 11:25:54 +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 408C6706F3; Fri, 24 Nov 2017 11:25:54 +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 vAOBPrna073078; Fri, 24 Nov 2017 11:25:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOBPrdw073077; Fri, 24 Nov 2017 11:25:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201711241125.vAOBPrdw073077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 24 Nov 2017 11:25:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326154 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 326154 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 11:25:54 -0000 Author: tuexen Date: Fri Nov 24 11:25:53 2017 New Revision: 326154 URL: https://svnweb.freebsd.org/changeset/base/326154 Log: Add SPDX line. Modified: head/sys/netinet/sctp_ss_functions.c Modified: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- head/sys/netinet/sctp_ss_functions.c Fri Nov 24 11:25:06 2017 (r326153) +++ head/sys/netinet/sctp_ss_functions.c Fri Nov 24 11:25:53 2017 (r326154) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved. * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved. * Copyright (c) 2010-2012, by Robin Seggelmann. All rights reserved. From owner-svn-src-head@freebsd.org Fri Nov 24 11:34:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 213F1DE1966; Fri, 24 Nov 2017 11:34:48 +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 E053F70B7E; Fri, 24 Nov 2017 11:34:47 +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 vAOBYlkv077079; Fri, 24 Nov 2017 11:34:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOBYloV077078; Fri, 24 Nov 2017 11:34:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711241134.vAOBYloV077078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 Nov 2017 11:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326155 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 326155 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 11:34:48 -0000 Author: avg Date: Fri Nov 24 11:34:46 2017 New Revision: 326155 URL: https://svnweb.freebsd.org/changeset/base/326155 Log: amd-vi: print some additional details for INVALID_DEVICE_REQUEST event Namely, the type of the hardware event and whether the transaction was a translation request. Reviewed by: anish Modified: head/sys/amd64/vmm/amd/amdvi_hw.c Modified: head/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_hw.c Fri Nov 24 11:25:53 2017 (r326154) +++ head/sys/amd64/vmm/amd/amdvi_hw.c Fri Nov 24 11:34:46 2017 (r326155) @@ -705,8 +705,9 @@ amdvi_decode_evt(struct amdvi_event *evt) break; case AMDVI_EVENT_INVALID_DTE_REQ: - printf("\t[INV_DTE devid:0x%x addr:0x%lx", - evt->devid, evt->addr); + printf("\t[INV_DTE devid:0x%x addr:0x%lx type:0x%x tr:%d]\n", + evt->devid, evt->addr, evt->flag >> 9, + (evt->flag >> 8) & 1); break; case AMDVI_EVENT_INVALID_PPR_REQ: From owner-svn-src-head@freebsd.org Fri Nov 24 11:35: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 4B1C7DE1A16; Fri, 24 Nov 2017 11:35:45 +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 14DAE70CDF; Fri, 24 Nov 2017 11:35:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAOBZi3L077162; Fri, 24 Nov 2017 11:35:44 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOBZi84077161; Fri, 24 Nov 2017 11:35:44 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711241135.vAOBZi84077161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 Nov 2017 11:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326156 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 326156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 11:35:45 -0000 Author: avg Date: Fri Nov 24 11:35:43 2017 New Revision: 326156 URL: https://svnweb.freebsd.org/changeset/base/326156 Log: amd-vi: small improvements to event printing Ensure that an opening bracket always has a matching closing one. Ensure that there is always a new-line at the end of a report line. Also, add a space before the printed event flag. Reviewed by: anish Modified: head/sys/amd64/vmm/amd/amdvi_hw.c Modified: head/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_hw.c Fri Nov 24 11:34:46 2017 (r326155) +++ head/sys/amd64/vmm/amd/amdvi_hw.c Fri Nov 24 11:35:43 2017 (r326156) @@ -582,7 +582,7 @@ amdvi_decode_evt_flag(uint16_t flag) { flag &= AMDVI_EVENT_FLAG_MASK; - printf("0x%b]\n", flag, + printf(" 0x%b]\n", flag, "\020" "\001GN" "\002NX" @@ -692,7 +692,7 @@ amdvi_decode_evt(struct amdvi_event *evt) case AMDVI_EVENT_ILLEGAL_CMD: /* FALL THROUGH */ case AMDVI_EVENT_CMD_HW_ERROR: - printf("\t[%s EVT]", (evt->opcode == AMDVI_EVENT_ILLEGAL_CMD) ? + printf("\t[%s EVT]\n", (evt->opcode == AMDVI_EVENT_ILLEGAL_CMD) ? "ILLEGAL CMD" : "CMD HW ERR"); cmd = (struct amdvi_cmd *)PHYS_TO_DMAP(evt->addr); printf("\tCMD opcode= 0x%x 0x%x 0x%x 0x%lx\n", @@ -700,7 +700,7 @@ amdvi_decode_evt(struct amdvi_event *evt) break; case AMDVI_EVENT_IOTLB_TIMEOUT: - printf("\t[IOTLB_INV_TIMEOUT devid:0x%x addr:0x%lx", + printf("\t[IOTLB_INV_TIMEOUT devid:0x%x addr:0x%lx]\n", evt->devid, evt->addr); break; @@ -716,7 +716,7 @@ amdvi_decode_evt(struct amdvi_event *evt) break; default: - printf("Unsupported AMD-Vi event:%d", evt->opcode); + printf("Unsupported AMD-Vi event:%d\n", evt->opcode); } } From owner-svn-src-head@freebsd.org Fri Nov 24 11:36: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 8A5ACDE1AAF; Fri, 24 Nov 2017 11:36:36 +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 5485F70E2E; Fri, 24 Nov 2017 11:36:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAOBaZgg077234; Fri, 24 Nov 2017 11:36:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOBaZnW077233; Fri, 24 Nov 2017 11:36:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711241136.vAOBaZnW077233@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 Nov 2017 11:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326157 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 326157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 11:36:36 -0000 Author: avg Date: Fri Nov 24 11:36:35 2017 New Revision: 326157 URL: https://svnweb.freebsd.org/changeset/base/326157 Log: amd-vi: use correct type for pci_rid, start_dev_rid, end_dev_rid sysctls Previously, the values could look confusing because of unrelated bits from adjacent memory. Reviewed by: anish Modified: head/sys/amd64/vmm/amd/amdvi_hw.c Modified: head/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- head/sys/amd64/vmm/amd/amdvi_hw.c Fri Nov 24 11:35:43 2017 (r326156) +++ head/sys/amd64/vmm/amd/amdvi_hw.c Fri Nov 24 11:36:35 2017 (r326157) @@ -989,15 +989,12 @@ amdvi_add_sysctl(struct amdvi_softc *softc) &softc->event_intr_cnt, "Event interrupt count"); SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "command_count", CTLFLAG_RD, &softc->total_cmd, "Command submitted count"); - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "pci_rid", CTLFLAG_RD, - (int *)&softc->pci_rid, 0, - "IOMMU RID"); - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "start_dev_rid", CTLFLAG_RD, - (int *)&softc->start_dev_rid, 0, - "Start of device under this IOMMU"); - SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD, - (int *)&softc->end_dev_rid, 0, - "End of device under this IOMMU"); + SYSCTL_ADD_U16(ctx, child, OID_AUTO, "pci_rid", CTLFLAG_RD, + &softc->pci_rid, 0, "IOMMU RID"); + SYSCTL_ADD_U16(ctx, child, OID_AUTO, "start_dev_rid", CTLFLAG_RD, + &softc->start_dev_rid, 0, "Start of device under this IOMMU"); + SYSCTL_ADD_U16(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD, + &softc->end_dev_rid, 0, "End of device under this IOMMU"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "command_head", CTLTYPE_UINT | CTLFLAG_RD, softc, 0, amdvi_handle_sysctl, "IU", "Command head"); From owner-svn-src-head@freebsd.org Fri Nov 24 11:37: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 64A8BDE1B38; Fri, 24 Nov 2017 11:37: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 2D7B170F88; Fri, 24 Nov 2017 11:37: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 vAOBbf47077311; Fri, 24 Nov 2017 11:37:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOBbfwl077310; Fri, 24 Nov 2017 11:37:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711241137.vAOBbfwl077310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 24 Nov 2017 11:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326158 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 326158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 11:37:42 -0000 Author: avg Date: Fri Nov 24 11:37:41 2017 New Revision: 326158 URL: https://svnweb.freebsd.org/changeset/base/326158 Log: amd-vi: a small whitespace cleanup Reviewed by: anish Modified: head/sys/amd64/vmm/amd/ivrs_drv.c Modified: head/sys/amd64/vmm/amd/ivrs_drv.c ============================================================================== --- head/sys/amd64/vmm/amd/ivrs_drv.c Fri Nov 24 11:36:35 2017 (r326157) +++ head/sys/amd64/vmm/amd/ivrs_drv.c Fri Nov 24 11:37:41 2017 (r326158) @@ -88,7 +88,7 @@ ivrs_hdr_iterate_tbl(ivhd_iter_t iter, void *arg) if (!iter(ivrs_hdr, arg)) return; break; - + case ACPI_IVRS_TYPE_MEMORY1: case ACPI_IVRS_TYPE_MEMORY2: case ACPI_IVRS_TYPE_MEMORY3: @@ -96,7 +96,7 @@ ivrs_hdr_iterate_tbl(ivhd_iter_t iter, void *arg) return; break; - + default: printf("AMD-Vi:Not IVHD/IVMD type(%d)", ivrs_hdr->Type); From owner-svn-src-head@freebsd.org Fri Nov 24 12:10:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD21ADE2CE5; Fri, 24 Nov 2017 12:10:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 878F4720FE; Fri, 24 Nov 2017 12:10:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAOCAggv092284; Fri, 24 Nov 2017 12:10:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOCAg0w092283; Fri, 24 Nov 2017 12:10:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711241210.vAOCAg0w092283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 24 Nov 2017 12:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326161 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 326161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 12:10:43 -0000 Author: hselasky Date: Fri Nov 24 12:10:42 2017 New Revision: 326161 URL: https://svnweb.freebsd.org/changeset/base/326161 Log: Implement atomic_fetchadd_64() for i386. This function is needed by the atomic64 header file in the LinuxKPI for i386. Reviewed by: kib MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/i386/include/atomic.h Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Fri Nov 24 12:08:50 2017 (r326160) +++ head/sys/i386/include/atomic.h Fri Nov 24 12:10:42 2017 (r326161) @@ -129,6 +129,7 @@ int atomic_cmpset_64(volatile uint64_t *, uint64_t, u uint64_t atomic_load_acq_64(volatile uint64_t *); void atomic_store_rel_64(volatile uint64_t *, uint64_t); uint64_t atomic_swap_64(volatile uint64_t *, uint64_t); +uint64_t atomic_fetchadd_64(volatile uint64_t *, uint64_t); #else /* !KLD_MODULE && __GNUCLIKE_ASM */ @@ -563,6 +564,17 @@ atomic_swap_64(volatile uint64_t *p, uint64_t v) return (atomic_swap_64_i386(p, v)); else return (atomic_swap_64_i586(p, v)); +} + +static __inline uint64_t +atomic_fetchadd_64(volatile uint64_t *p, uint64_t v) +{ + + for (;;) { + uint64_t t = *p; + if (atomic_cmpset_64(p, t, t + v)) + return (t); + } } #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Fri Nov 24 12:18: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 4E01DDE2F75; Fri, 24 Nov 2017 12:18:50 +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 0B9FF725F4; Fri, 24 Nov 2017 12:18:49 +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 vAOCInGe094139; Fri, 24 Nov 2017 12:18:49 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOCInF1094138; Fri, 24 Nov 2017 12:18:49 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201711241218.vAOCInF1094138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 24 Nov 2017 12:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326163 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 326163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 12:18:50 -0000 Author: tuexen Date: Fri Nov 24 12:18:48 2017 New Revision: 326163 URL: https://svnweb.freebsd.org/changeset/base/326163 Log: Unbreak compilation when using SCTP_DETAILED_STR_STATS option. MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Nov 24 12:13:27 2017 (r326162) +++ head/sys/netinet/sctputil.c Fri Nov 24 12:18:48 2017 (r326163) @@ -4677,14 +4677,14 @@ sctp_release_pr_sctp_chunk(struct sctp_tcb *stcb, stru stcb->asoc.abandoned_sent[PR_SCTP_POLICY(tp1->flags)]++; stcb->asoc.strmout[sid].abandoned_sent[0]++; #if defined(SCTP_DETAILED_STR_STATS) - stcb->asoc.strmout[stream].abandoned_sent[PR_SCTP_POLICY(tp1->flags)]++; + stcb->asoc.strmout[sid].abandoned_sent[PR_SCTP_POLICY(tp1->flags)]++; #endif } else { stcb->asoc.abandoned_unsent[0]++; stcb->asoc.abandoned_unsent[PR_SCTP_POLICY(tp1->flags)]++; stcb->asoc.strmout[sid].abandoned_unsent[0]++; #if defined(SCTP_DETAILED_STR_STATS) - stcb->asoc.strmout[stream].abandoned_unsent[PR_SCTP_POLICY(tp1->flags)]++; + stcb->asoc.strmout[sid].abandoned_unsent[PR_SCTP_POLICY(tp1->flags)]++; #endif } do { From owner-svn-src-head@freebsd.org Fri Nov 24 13:25: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 DE70CDE5662; Fri, 24 Nov 2017 13:25:02 +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 4E3FB743B2; Fri, 24 Nov 2017 13:25:02 +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 vAODOr4Y037971 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 24 Nov 2017 15:24:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vAODOr4Y037971 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vAODOrM2037970; Fri, 24 Nov 2017 15:24:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 24 Nov 2017 15:24:53 +0200 From: Konstantin Belousov To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat Message-ID: <20171124132453.GY2272@kib.kiev.ua> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> <20171122103917.GS2272@kib.kiev.ua> <20171123021646.M1933@besplex.bde.org> <20171122220538.GT2272@kib.kiev.ua> <20171123224032.A992@besplex.bde.org> <20171123151849.GU2272@kib.kiev.ua> <20171124184535.E980@besplex.bde.org> <20171124105720.GW2272@kib.kiev.ua> <20171124225011.V1289@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171124225011.V1289@besplex.bde.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 13:25:03 -0000 On Sat, Nov 25, 2017 at 12:14:10AM +1100, Bruce Evans wrote: > On Fri, 24 Nov 2017, Konstantin Belousov wrote: > > > On Fri, Nov 24, 2017 at 08:15:06PM +1100, Bruce Evans wrote: > >> On Thu, 23 Nov 2017, Konstantin Belousov wrote: > >* ... > >>>> #define pgtok(p) ((uintmax_t)(p) * pageKilo) > >>> Amusingly there is already MD macro in machine/param.h with the same name > >>> and same intent, but as you formulate it, sloppy implementation. It uses > >>> unsigned long cast on almost all 64bit arches, except powerpc. For 32bit > >>> arches, the cast is not done, unfortunately. > >> > >> I already pointed out the system pgtok(). > >> > >> It was almost correct to cast to u_int on all arches because the > >> implementation can know the size of all its page counters. That was int > >> or u_int, and the expansion factor is small. In practice, 32-bit systems > >> never have enough memory to overflow in K (that happens at 4TB), and > >> 64-bit systems that overflow in K are close to overflowing the page > >> counters (that happens at 16TB with 4K-pages). > >> > >> The pgtok() is just unusable because the page size can vary. > > No, it is unusable only due to the implementation not ensuring the consistent > > output type. > > Hmm, I couldn't find any arch with even a compile-time variable PAGE_SIZE. > It is currently just unportable in theory to use hard-coded PAGE_SIZE or > macros that use it. sparc64 uses 8K, Itanium had compile-time variable page size supported by hardware. From owner-svn-src-head@freebsd.org Fri Nov 24 13:45: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 BC103DE6697; Fri, 24 Nov 2017 13:45:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 50C077553B; Fri, 24 Nov 2017 13:45:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id A1E961047001; Sat, 25 Nov 2017 00:14:11 +1100 (AEDT) Date: Sat, 25 Nov 2017 00:14:10 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat In-Reply-To: <20171124105720.GW2272@kib.kiev.ua> Message-ID: <20171124225011.V1289@besplex.bde.org> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> <20171122103917.GS2272@kib.kiev.ua> <20171123021646.M1933@besplex.bde.org> <20171122220538.GT2272@kib.kiev.ua> <20171123224032.A992@besplex.bde.org> <20171123151849.GU2272@kib.kiev.ua> <20171124184535.E980@besplex.bde.org> <20171124105720.GW2272@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cK6QihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=X59yt0bSgEgXPnUS1KUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 13:45:48 -0000 On Fri, 24 Nov 2017, Konstantin Belousov wrote: > On Fri, Nov 24, 2017 at 08:15:06PM +1100, Bruce Evans wrote: >> On Thu, 23 Nov 2017, Konstantin Belousov wrote: >* ... >>>> #define pgtok(p) ((uintmax_t)(p) * pageKilo) >>> Amusingly there is already MD macro in machine/param.h with the same name >>> and same intent, but as you formulate it, sloppy implementation. It uses >>> unsigned long cast on almost all 64bit arches, except powerpc. For 32bit >>> arches, the cast is not done, unfortunately. >> >> I already pointed out the system pgtok(). >> >> It was almost correct to cast to u_int on all arches because the >> implementation can know the size of all its page counters. That was int >> or u_int, and the expansion factor is small. In practice, 32-bit systems >> never have enough memory to overflow in K (that happens at 4TB), and >> 64-bit systems that overflow in K are close to overflowing the page >> counters (that happens at 16TB with 4K-pages). >> >> The pgtok() is just unusable because the page size can vary. > No, it is unusable only due to the implementation not ensuring the consistent > output type. Hmm, I couldn't find any arch with even a compile-time variable PAGE_SIZE. It is currently just unportable in theory to use hard-coded PAGE_SIZE or macros that use it. This might be another leftover from vax days. getpagesize(2) says: X The page size is a system page size and may not be the same as the under- X lying hardware page size. X ... X The getpagesize() function appeared in 4.2BSD. In vax days or even Mach days, PAGE_SIZE might have been the underlying page size and different from the system page size, so getpagesize() was needed to provided the latter. This is sort of backwards. The system page should be some small size like 512 that divides the hardware page size for all arches. Dyson's rewrite might have reversed this. Anyway, it removed most of the distinctions between hardware and virtual page sizes. It still has "clicks" via the btoc() and other macros, but clicks are conflated with pages of size PAGE_SIZE. i386 has i386_btop() which I think is for physical pages, amd64 has amd646_btop() but never uses it. It would be better to not pretend to support "clicks". POSIX has limits {PAGESIZE} and {PAGE_SIZE} (the latter for XSI). These are only runtime-invariant like {OPEN_MAX} was before it supported setrlimit(), so are hard to use. BSD utilities like the vmstat have the same problem with getpagesize() unless its API is changed to guaratee that it returns PAGE_SIZE and that uis not ifdefed. The output type isn't a problem. Consistently uintmax_t would be easier to use, but would be a pessimization for arches that don't need large sizes. >> Perhaps it is a design error to allow the page size to vary or be >> anything except 512 in APIs, just like for disk sector sizes. Most >> disk APIs uses units of bytes or 512-blocks. The physical size may >> be different. Applications need to know the physical memory page size >> even less than they need to know the physical sector size. > Not everybody share the warm memories about VAX. I think there were no > single significant architecture with hardware support for virtual memory, > after the VAX, which used less than 4K sized pages. 512 still gives good units. 1024 would be even better. >> Here are my old fixes for this function (to clean it up before removing it): > > I picked some of this, mainly I do not want to change the output format. > I am sure that there are scripts around which parse it. It is hard to parse. Another bug here is that the vmmeter 'v' values are very easy to parse by reading them 1 at a time using sysctl -n, but there are no individual sysctls for the vmtotal 't' values. Sysctl could usefully expand the struct as fake integer sysctls (1 per line), but instead prints it ornately. I just noticed another bug: sysctl -x is documented to give a raw hex dump, but for vm.vmtotal it still gives the ornate output. All sysctls with special formatting and all strings generated by the kernel seem to have this bug. Bruce From owner-svn-src-head@freebsd.org Fri Nov 24 13:50: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 6C247DE6D6D; Fri, 24 Nov 2017 13:50:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25C56759C9; Fri, 24 Nov 2017 13:50:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAODotE2031828; Fri, 24 Nov 2017 13:50:55 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAODosSD031816; Fri, 24 Nov 2017 13:50:54 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201711241350.vAODosSD031816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 24 Nov 2017 13:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326165 - in head/sys: arm64/arm64 arm64/include conf sys X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include conf sys X-SVN-Commit-Revision: 326165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 13:50:56 -0000 Author: ed Date: Fri Nov 24 13:50:53 2017 New Revision: 326165 URL: https://svnweb.freebsd.org/changeset/base/326165 Log: Add rudimentary support for building FreeBSD/arm64 with COMPAT_FREEBSD32. Right now I'm using two Raspberry Pi's (2 and 3) to test CloudABI support for armv6, armv7 and aarch64. It would be nice if I could restrict this to just a single instance when testing smaller changes. This is why I'd like to get COMPAT_CLOUDABI32 to work on arm64. As COMPAT_CLOUDABI32 depends on COMPAT_FREEBSD32, at least for the ELF loading, this change adds all of the bits necessary to at least build a kernel with COMPAT_FREEBSD32. All of the machine dependent system calls are still stubbed out, for the reason that implementations for these are only useful if actual support for running FreeBSD binaries is added. This is outside the scope of this work. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D13144 Added: head/sys/arm64/arm64/elf32_machdep.c (contents, props changed) head/sys/arm64/arm64/freebsd32_machdep.c (contents, props changed) Modified: head/sys/arm64/arm64/machdep.c head/sys/arm64/include/elf.h head/sys/arm64/include/param.h head/sys/arm64/include/proc.h head/sys/arm64/include/reg.h head/sys/arm64/include/vdso.h head/sys/conf/files.arm64 head/sys/conf/options.arm64 head/sys/sys/sysctl.h Added: head/sys/arm64/arm64/elf32_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/elf32_machdep.c Fri Nov 24 13:50:53 2017 (r326165) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2017 Nuxi, https://nuxi.nl/ + * + * 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 +#define __ELF_WORD_SIZE 32 +#include + +void +elf32_dump_thread(struct thread *td __unused, void *dst __unused, + size_t *off __unused) +{ + +} Added: head/sys/arm64/arm64/freebsd32_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/freebsd32_machdep.c Fri Nov 24 13:50:53 2017 (r326165) @@ -0,0 +1,70 @@ +/*- + * Copyright (c) 2017 Nuxi, https://nuxi.nl/ + * + * 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 + +/* + * Stubs for machine dependent 32-bits system calls. + */ + +int +freebsd32_getcontext(struct thread *td, struct freebsd32_getcontext_args *uap) +{ + + return (ENOSYS); +} + +int +freebsd32_setcontext(struct thread *td, struct freebsd32_setcontext_args *uap) +{ + + return (ENOSYS); +} + +int +freebsd32_sigreturn(struct thread *td, struct freebsd32_sigreturn_args *uap) +{ + + return (ENOSYS); +} + +int +freebsd32_swapcontext(struct thread *td, struct freebsd32_swapcontext_args *uap) +{ + + return (ENOSYS); +} + +int +freebsd32_sysarch(struct thread *td, struct freebsd32_sysarch_args *uap) +{ + + return (ENOSYS); +} Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Fri Nov 24 12:27:48 2017 (r326164) +++ head/sys/arm64/arm64/machdep.c Fri Nov 24 13:50:53 2017 (r326165) @@ -26,6 +26,7 @@ */ #include "opt_acpi.h" +#include "opt_compat.h" #include "opt_platform.h" #include "opt_ddb.h" @@ -277,6 +278,56 @@ set_dbregs(struct thread *td, struct dbreg *regs) printf("ARM64TODO: set_dbregs"); return (EDOOFUS); } + +#ifdef COMPAT_FREEBSD32 +int +fill_regs32(struct thread *td, struct reg32 *regs) +{ + + printf("ARM64TODO: fill_regs32"); + return (EDOOFUS); +} + +int +set_regs32(struct thread *td, struct reg32 *regs) +{ + + printf("ARM64TODO: set_regs32"); + return (EDOOFUS); +} + +int +fill_fpregs32(struct thread *td, struct fpreg32 *regs) +{ + + printf("ARM64TODO: fill_fpregs32"); + return (EDOOFUS); +} + +int +set_fpregs32(struct thread *td, struct fpreg32 *regs) +{ + + printf("ARM64TODO: set_fpregs32"); + return (EDOOFUS); +} + +int +fill_dbregs32(struct thread *td, struct dbreg32 *regs) +{ + + printf("ARM64TODO: fill_dbregs32"); + return (EDOOFUS); +} + +int +set_dbregs32(struct thread *td, struct dbreg32 *regs) +{ + + printf("ARM64TODO: set_dbregs32"); + return (EDOOFUS); +} +#endif int ptrace_set_pc(struct thread *td, u_long addr) Modified: head/sys/arm64/include/elf.h ============================================================================== --- head/sys/arm64/include/elf.h Fri Nov 24 12:27:48 2017 (r326164) +++ head/sys/arm64/include/elf.h Fri Nov 24 13:50:53 2017 (r326165) @@ -36,7 +36,10 @@ #include /* Definitions common to all 32 bit architectures. */ #include /* Definitions common to all 64 bit architectures. */ +#ifndef __ELF_WORD_SIZE #define __ELF_WORD_SIZE 64 /* Used by */ +#endif + #include /* @@ -97,10 +100,17 @@ __ElfType(Auxinfo); #define AT_COUNT 27 /* Count of defined aux entry types. */ /* Define "machine" characteristics */ +#if __ELF_WORD_SIZE == 64 #define ELF_TARG_CLASS ELFCLASS64 #define ELF_TARG_DATA ELFDATA2LSB #define ELF_TARG_MACH EM_AARCH64 #define ELF_TARG_VER 1 +#else +#define ELF_TARG_CLASS ELFCLASS32 +#define ELF_TARG_DATA ELFDATA2LSB +#define ELF_TARG_MACH EM_ARM +#define ELF_TARG_VER 1 +#endif #define ET_DYN_LOAD_ADDR 0x100000 Modified: head/sys/arm64/include/param.h ============================================================================== --- head/sys/arm64/include/param.h Fri Nov 24 12:27:48 2017 (r326164) +++ head/sys/arm64/include/param.h Fri Nov 24 13:50:53 2017 (r326165) @@ -50,6 +50,9 @@ #ifndef MACHINE_ARCH #define MACHINE_ARCH "aarch64" #endif +#ifndef MACHINE_ARCH32 +#define MACHINE_ARCH32 "armv7" +#endif #if defined(SMP) || defined(KLD_MODULE) #ifndef MAXCPU Modified: head/sys/arm64/include/proc.h ============================================================================== --- head/sys/arm64/include/proc.h Fri Nov 24 12:27:48 2017 (r326164) +++ head/sys/arm64/include/proc.h Fri Nov 24 13:50:53 2017 (r326165) @@ -44,6 +44,7 @@ struct mdproc { }; #define KINFO_PROC_SIZE 1088 +#define KINFO_PROC32_SIZE 816 #define MAXARGS 8 struct syscall_args { Modified: head/sys/arm64/include/reg.h ============================================================================== --- head/sys/arm64/include/reg.h Fri Nov 24 12:27:48 2017 (r326164) +++ head/sys/arm64/include/reg.h Fri Nov 24 13:50:53 2017 (r326165) @@ -41,16 +41,30 @@ struct reg { uint32_t spsr; }; +struct reg32 { + int dummy; +}; + struct fpreg { __uint128_t fp_q[32]; uint32_t fp_sr; uint32_t fp_cr; }; +struct fpreg32 { + int dummy; +}; + struct dbreg { int dummy; }; +struct dbreg32 { + int dummy; +}; + +#define __HAVE_REG32 + #ifdef _KERNEL /* * XXX these interfaces are MI, so they should be declared in a MI place. @@ -61,6 +75,14 @@ int fill_fpregs(struct thread *, struct fpreg *); int set_fpregs(struct thread *, struct fpreg *); int fill_dbregs(struct thread *, struct dbreg *); int set_dbregs(struct thread *, struct dbreg *); +#ifdef COMPAT_FREEBSD32 +int fill_regs32(struct thread *, struct reg32 *); +int set_regs32(struct thread *, struct reg32 *); +int fill_fpregs32(struct thread *, struct fpreg32 *); +int set_fpregs32(struct thread *, struct fpreg32 *); +int fill_dbregs32(struct thread *, struct dbreg32 *); +int set_dbregs32(struct thread *, struct dbreg32 *); +#endif #endif #endif /* !_MACHINE_REG_H_ */ Modified: head/sys/arm64/include/vdso.h ============================================================================== --- head/sys/arm64/include/vdso.h Fri Nov 24 12:27:48 2017 (r326164) +++ head/sys/arm64/include/vdso.h Fri Nov 24 13:50:53 2017 (r326165) @@ -34,4 +34,6 @@ #define VDSO_TH_ALGO_ARM_GENTIM VDSO_TH_ALGO_1 +#define VDSO_TIMEHANDS_MD32 VDSO_TIMEHANDS_MD + #endif /* !_MACHINE_VDSO_H_ */ Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Fri Nov 24 12:27:48 2017 (r326164) +++ head/sys/conf/files.arm64 Fri Nov 24 13:50:53 2017 (r326165) @@ -96,8 +96,10 @@ 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/elf32_machdep.c optional compat_freebsd32 arm64/arm64/elf_machdep.c standard arm64/arm64/exception.S standard +arm64/arm64/freebsd32_machdep.c optional compat_freebsd32 arm64/arm64/gicv3_its.c optional intrng fdt arm64/arm64/gic_v3.c standard arm64/arm64/gic_v3_fdt.c optional fdt Modified: head/sys/conf/options.arm64 ============================================================================== --- head/sys/conf/options.arm64 Fri Nov 24 12:27:48 2017 (r326164) +++ head/sys/conf/options.arm64 Fri Nov 24 13:50:53 2017 (r326165) @@ -7,6 +7,9 @@ SOCDEV_VA opt_global.h THUNDERX_PASS_1_1_ERRATA opt_global.h VFP opt_global.h +# Binary compatibility +COMPAT_FREEBSD32 opt_compat.h + # EFI Runtime services support EFIRT opt_efirt.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Fri Nov 24 12:27:48 2017 (r326164) +++ head/sys/sys/sysctl.h Fri Nov 24 13:50:53 2017 (r326165) @@ -147,7 +147,7 @@ struct ctlname { #define REQ_WIRED 2 /* definitions for sysctl_req 'flags' member */ -#if defined(__amd64__) || defined(__powerpc64__) ||\ +#if defined(__aarch64__) || defined(__amd64__) || defined(__powerpc64__) ||\ (defined(__mips__) && defined(__mips_n64)) #define SCTL_MASK32 1 /* 32 bit emulation */ #endif From owner-svn-src-head@freebsd.org Fri Nov 24 13: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 7A3F9DE6F61; Fri, 24 Nov 2017 13:52:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 473CB75BE1; Fri, 24 Nov 2017 13:52:00 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAODpxgj035517; Fri, 24 Nov 2017 13:51:59 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAODpxgc035516; Fri, 24 Nov 2017 13:51:59 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201711241351.vAODpxgc035516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 24 Nov 2017 13:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326166 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 326166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 13:52:00 -0000 Author: ed Date: Fri Nov 24 13:51:59 2017 New Revision: 326166 URL: https://svnweb.freebsd.org/changeset/base/326166 Log: Set CP15BEN in SCTLR to make memory barriers work in 32-bit mode. Binaries generated by Clang for ARMv6 may contain these instructions: MCR p15, 0, , c7, c10, 5 These instructions are deprecated as of ARMv7, which is why modern processors have a way of toggling support for them. On FreeBSD/arm64 we currently disable support for these instructions, meaning that if 32-bit executables with these instructions are run, they would crash with SIGILL. This is likely not what we want. Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D13145 Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Fri Nov 24 13:50:53 2017 (r326165) +++ head/sys/arm64/arm64/locore.S Fri Nov 24 13:51:59 2017 (r326166) @@ -628,11 +628,12 @@ sctlr_set: /* Bits to set */ .quad (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_UCI | SCTLR_SPAN | \ SCTLR_nTWE | SCTLR_nTWI | SCTLR_UCT | SCTLR_DZE | \ - SCTLR_I | SCTLR_SED | SCTLR_SA0 | SCTLR_SA | SCTLR_C | SCTLR_M) + SCTLR_I | SCTLR_SED | SCTLR_SA0 | SCTLR_SA | SCTLR_C | \ + SCTLR_M | SCTLR_CP15BEN) sctlr_clear: /* Bits to clear */ .quad (SCTLR_EE | SCTLR_EOE | SCTLR_IESB | SCTLR_WXN | SCTLR_UMA | \ - SCTLR_ITD | SCTLR_THEE | SCTLR_CP15BEN | SCTLR_A) + SCTLR_ITD | SCTLR_THEE | SCTLR_A) .globl abort abort: From owner-svn-src-head@freebsd.org Fri Nov 24 14:02: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 34A96DE72F6; Fri, 24 Nov 2017 14:02:34 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01B8476294; Fri, 24 Nov 2017 14:02:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAOE2XjT039813; Fri, 24 Nov 2017 14:02:33 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOE2XkX039812; Fri, 24 Nov 2017 14:02:33 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201711241402.vAOE2XkX039812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 24 Nov 2017 14:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326167 - head/sys/modules/cloudabi32 X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/sys/modules/cloudabi32 X-SVN-Commit-Revision: 326167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 14:02:34 -0000 Author: ed Date: Fri Nov 24 14:02:32 2017 New Revision: 326167 URL: https://svnweb.freebsd.org/changeset/base/326167 Log: Pick the right vDSO file/linker flags when building cloudabi32.ko on ARM64. The recently imported cloudabi_vdso_armv6_on_64bit.S should be the vDSO for 32-bit processes when being run on FreeBSD/arm64. This vDSO ensures that all system call arguments are padded to 64 bits, so that they can be used by the kernel to call into most of the native implementations directly. Modified: head/sys/modules/cloudabi32/Makefile Modified: head/sys/modules/cloudabi32/Makefile ============================================================================== --- head/sys/modules/cloudabi32/Makefile Fri Nov 24 13:51:59 2017 (r326166) +++ head/sys/modules/cloudabi32/Makefile Fri Nov 24 14:02:32 2017 (r326167) @@ -14,7 +14,11 @@ SRCS= cloudabi32_fd.c cloudabi32_module.c cloudabi32_p OBJS= cloudabi32_vdso_blob.o CLEANFILES=cloudabi32_vdso.o -.if ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "aarch64" +VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_armv6_on_64bit.S +OUTPUT_TARGET=elf64-littleaarch64 +BINARY_ARCHITECTURE=aarch64 +.elif ${MACHINE_CPUARCH} == "amd64" VDSO_SRCS=${SYSDIR}/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S OUTPUT_TARGET=elf64-x86-64-freebsd BINARY_ARCHITECTURE=i386 From owner-svn-src-head@freebsd.org Fri Nov 24 14:23: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 C785FDE78F9; Fri, 24 Nov 2017 14:23:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 8DBDA76C66; Fri, 24 Nov 2017 14:23:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id C0555D640DD; Sat, 25 Nov 2017 01:23:23 +1100 (AEDT) Date: Sat, 25 Nov 2017 01:23:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326073 - head/usr.bin/systat In-Reply-To: <20171124132453.GY2272@kib.kiev.ua> Message-ID: <20171125010218.U1794@besplex.bde.org> References: <201711211955.vALJtWhg047906@repo.freebsd.org> <20171122071838.R1172@besplex.bde.org> <20171122103917.GS2272@kib.kiev.ua> <20171123021646.M1933@besplex.bde.org> <20171122220538.GT2272@kib.kiev.ua> <20171123224032.A992@besplex.bde.org> <20171123151849.GU2272@kib.kiev.ua> <20171124184535.E980@besplex.bde.org> <20171124105720.GW2272@kib.kiev.ua> <20171124225011.V1289@besplex.bde.org> <20171124132453.GY2272@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cK6QihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=h7illfbrFq0Lnr7M8XIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 14:23:31 -0000 On Fri, 24 Nov 2017, Konstantin Belousov wrote: > On Sat, Nov 25, 2017 at 12:14:10AM +1100, Bruce Evans wrote: >* ... >> Hmm, I couldn't find any arch with even a compile-time variable PAGE_SIZE. >> It is currently just unportable in theory to use hard-coded PAGE_SIZE or >> macros that use it. > sparc64 uses 8K, Itanium had compile-time variable page size supported by > hardware. I checked ia64, but couldn't find it before. Now I found it. The ifdef is on LOG2_PAGE_SIZE (default 13 for 8K-pages). This gives a compile-time constant for PAGE_SIZE. ogetpagesize() and the sysctl HW_PAGESIZE return this constant. So it may vary with the kernel in userland, and userland would be broken if it used PAGE_SIZE from the host include files. LOG2_PAGE_SIZE was a supported global option, but this doesn't work in modules. No options work in modules, but this one is more fundamental than most. So it was probably necessary to compile all modules after editing the default in the source file. opt_global.h is even more unusable in userland, but editing the source file works for userland too. Bruce From owner-svn-src-head@freebsd.org Fri Nov 24 14:50: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 00332DE8215; Fri, 24 Nov 2017 14:50:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85FB07770A; Fri, 24 Nov 2017 14:50: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 vAOEoTl3056752; Fri, 24 Nov 2017 14:50:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOEoSFW056744; Fri, 24 Nov 2017 14:50:28 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201711241450.vAOEoSFW056744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 24 Nov 2017 14:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/dev/efidev sys/dev/iser s... X-SVN-Commit-Revision: 326169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 14:50:31 -0000 Author: hselasky Date: Fri Nov 24 14:50:28 2017 New Revision: 326169 URL: https://svnweb.freebsd.org/changeset/base/326169 Log: RoCE/infiniband upgrade to Linux v4.9 for kernel and userspace. This commit merges projects/bsd_rdma_4_9 to head. List of kernel sources used: ============================ 1) kernel sources were cloned from git://github.com/torvalds/linux.git Top commit 69973b830859bc6529a7a0468ba0d80ee5117826 - tag: v4.9, linux-4.9 2) krping was cloned from https://github.com/larrystevenwise/krping Top commit 292a2f1abf0348285e678a82264740d52e4dcfe4 List of userspace sources used: =============================== 1) rdma-core was cloned from https://github.com/linux-rdma/rdma-core.git Top commit d65138ef93af30b3ea249f3a84aa6a24ba7f8a75 2) OpenSM was cloned from git://git.openfabrics.org/~halr/opensm.git Top commit 85f841cf209f791c89a075048a907020e924528d 3) libibmad was cloned from git://git.openfabrics.org/~iraweiny/libibmad.git Tag 1.3.13 with some additional patches from Mellanox. 4) infiniband-diags was cloned from git://git.openfabrics.org/~iraweiny/infiniband-diags.git Tag 1.6.7 with some additional patches from Mellanox. NOTES: ====== 1) The mthca driver has been removed in kernel and in userspace. 2) All GPLv2 only sources have been removed and where applicable rewritten from scratch under a BSD license. 3) List of fully supported drivers in userspace and kernel: a) iw_cxgbe (Chelsio) b) mlx4ib (Mellanox) c) mlx5ib (Mellanox) 4) WITH_OFED=YES is still required by make in order to build OFED userspace and kernel code. 5) Full support has been added for routable RoCE, RoCE v2. Sponsored by: Mellanox Technologies Added: head/sys/dev/mlx5/mlx5_ib/mlx5_ib_gsi.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/dev/mlx5/mlx5_ib/mlx5_ib_gsi.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_virt.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/dev/mlx5/mlx5_ib/mlx5_ib_virt.c head/sys/ofed/drivers/infiniband/core/ib_addr.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_addr.c head/sys/ofed/drivers/infiniband/core/ib_agent.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_agent.c head/sys/ofed/drivers/infiniband/core/ib_cache.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cache.c head/sys/ofed/drivers/infiniband/core/ib_cm.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cm.c head/sys/ofed/drivers/infiniband/core/ib_cma.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cma.c head/sys/ofed/drivers/infiniband/core/ib_cq.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cq.c head/sys/ofed/drivers/infiniband/core/ib_device.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_device.c head/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c head/sys/ofed/drivers/infiniband/core/ib_iwcm.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwcm.c head/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c head/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c head/sys/ofed/drivers/infiniband/core/ib_mad.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_mad.c head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c head/sys/ofed/drivers/infiniband/core/ib_multicast.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_multicast.c head/sys/ofed/drivers/infiniband/core/ib_packer.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_packer.c head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c head/sys/ofed/drivers/infiniband/core/ib_sa_query.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_sa_query.c head/sys/ofed/drivers/infiniband/core/ib_smi.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_smi.c head/sys/ofed/drivers/infiniband/core/ib_sysfs.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_sysfs.c head/sys/ofed/drivers/infiniband/core/ib_ucm.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucm.c head/sys/ofed/drivers/infiniband/core/ib_ucma.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucma.c head/sys/ofed/drivers/infiniband/core/ib_ud_header.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ud_header.c head/sys/ofed/drivers/infiniband/core/ib_umem.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_umem.c head/sys/ofed/drivers/infiniband/core/ib_umem_odp.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_umem_odp.c head/sys/ofed/drivers/infiniband/core/ib_umem_rbtree.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_umem_rbtree.c head/sys/ofed/drivers/infiniband/core/ib_user_mad.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_user_mad.c head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c head/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c head/sys/ofed/drivers/infiniband/core/ib_uverbs_marshall.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_marshall.c head/sys/ofed/drivers/infiniband/core/ib_verbs.c - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_verbs.c head/sys/ofed/drivers/infiniband/core/iwpm_util.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/iwpm_util.h head/sys/ofed/drivers/infiniband/core/opa_smi.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/opa_smi.h head/sys/ofed/include/rdma/ib.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/ib.h head/sys/ofed/include/rdma/ib_hdrs.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/ib_hdrs.h head/sys/ofed/include/rdma/ib_umem_odp.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/ib_umem_odp.h head/sys/ofed/include/rdma/iw_portmap.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/iw_portmap.h head/sys/ofed/include/rdma/opa_port_info.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/opa_port_info.h head/sys/ofed/include/rdma/opa_smi.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/opa_smi.h head/sys/ofed/include/rdma/rdma_vt.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/rdma_vt.h head/sys/ofed/include/rdma/rdmavt_cq.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/rdmavt_cq.h head/sys/ofed/include/rdma/rdmavt_mr.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/rdmavt_mr.h head/sys/ofed/include/rdma/rdmavt_qp.h - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/include/rdma/rdmavt_qp.h head/sys/ofed/include/uapi/ - copied from r326168, projects/bsd_rdma_4_9/sys/ofed/include/uapi/ Replaced: head/contrib/ofed/ - copied from r326168, projects/bsd_rdma_4_9/contrib/ofed/ Deleted: head/sys/dev/mlx4/mlx4_ib/mlx4_exp.h head/sys/dev/mlx4/mlx4_ib/mlx4_ib_exp.c head/sys/dev/mlx4/mlx4_ib/user.h head/sys/dev/mlx5/mlx5_ib/mlx5_ib_roce.c head/sys/dev/mlx5/mlx5_ib/user.h head/sys/modules/mthca/ head/sys/ofed/drivers/infiniband/Kconfig head/sys/ofed/drivers/infiniband/Makefile head/sys/ofed/drivers/infiniband/core/addr.c head/sys/ofed/drivers/infiniband/core/agent.c head/sys/ofed/drivers/infiniband/core/cache.c head/sys/ofed/drivers/infiniband/core/cm.c head/sys/ofed/drivers/infiniband/core/cma.c head/sys/ofed/drivers/infiniband/core/device.c head/sys/ofed/drivers/infiniband/core/fmr_pool.c head/sys/ofed/drivers/infiniband/core/iwcm.c head/sys/ofed/drivers/infiniband/core/mad.c head/sys/ofed/drivers/infiniband/core/mad_rmpp.c head/sys/ofed/drivers/infiniband/core/multicast.c head/sys/ofed/drivers/infiniband/core/packer.c head/sys/ofed/drivers/infiniband/core/peer_mem.c head/sys/ofed/drivers/infiniband/core/sa_query.c head/sys/ofed/drivers/infiniband/core/smi.c head/sys/ofed/drivers/infiniband/core/sysfs.c head/sys/ofed/drivers/infiniband/core/ucm.c head/sys/ofed/drivers/infiniband/core/ucma.c head/sys/ofed/drivers/infiniband/core/ud_header.c head/sys/ofed/drivers/infiniband/core/umem.c head/sys/ofed/drivers/infiniband/core/user_mad.c head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c head/sys/ofed/drivers/infiniband/core/uverbs_main.c head/sys/ofed/drivers/infiniband/core/uverbs_marshall.c head/sys/ofed/drivers/infiniband/core/verbs.c head/sys/ofed/drivers/infiniband/debug/Makefile head/sys/ofed/drivers/infiniband/debug/memtrack.c head/sys/ofed/drivers/infiniband/debug/memtrack.h head/sys/ofed/drivers/infiniband/debug/mtrack.h head/sys/ofed/drivers/infiniband/hw/ head/sys/ofed/drivers/infiniband/ulp/ipoib/Kconfig head/sys/ofed/drivers/infiniband/util/Kconfig head/sys/ofed/include/rdma/ib_peer_mem.h head/sys/ofed/include/rdma/ib_user_cm.h head/sys/ofed/include/rdma/ib_user_mad.h head/sys/ofed/include/rdma/ib_user_sa.h head/sys/ofed/include/rdma/ib_user_verbs.h head/sys/ofed/include/rdma/ib_user_verbs_exp.h head/sys/ofed/include/rdma/ib_verbs_exp.h head/sys/ofed/include/rdma/peer_mem.h head/sys/ofed/include/rdma/rdma_user_cm.h head/sys/ofed/include/rdma/sdp_socket.h Modified: head/Makefile.inc1 head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/conf/kern.pre.mk head/sys/contrib/rdma/krping/krping.c head/sys/contrib/rdma/krping/krping.h head/sys/contrib/rdma/krping/krping_dev.c head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/iw_cxgbe/cm.c head/sys/dev/cxgbe/iw_cxgbe/cq.c head/sys/dev/cxgbe/iw_cxgbe/device.c head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h head/sys/dev/cxgbe/iw_cxgbe/mem.c head/sys/dev/cxgbe/iw_cxgbe/provider.c head/sys/dev/cxgbe/iw_cxgbe/qp.c head/sys/dev/cxgbe/iw_cxgbe/t4.h head/sys/dev/cxgbe/iw_cxgbe/user.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/iser/icl_iser.c head/sys/dev/iser/icl_iser.h head/sys/dev/iser/iser_memory.c head/sys/dev/iser/iser_verbs.c head/sys/dev/mlx4/device.h head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h head/sys/dev/mlx4/mlx4_ib/mlx4_ib_ah.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_alias_GUID.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_cm.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_cq.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mcg.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mr.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_srq.c head/sys/dev/mlx4/mlx4_ib/mlx4_ib_sysfs.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h head/sys/dev/mlx5/mlx5_ib/mlx5_ib_ah.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mad.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mr.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c head/sys/dev/mlx5/mlx5_ib/mlx5_ib_srq.c head/sys/dev/mlx5/qp.h head/sys/i386/conf/NOTES head/sys/modules/Makefile head/sys/modules/cxgbe/iw_cxgbe/Makefile head/sys/modules/ibcore/Makefile head/sys/modules/ipoib/Makefile head/sys/modules/iser/Makefile head/sys/modules/mlx4/Makefile head/sys/modules/mlx4ib/Makefile head/sys/modules/mlx5ib/Makefile head/sys/modules/rdma/krping/Makefile head/sys/ofed/drivers/infiniband/core/agent.h head/sys/ofed/drivers/infiniband/core/cm_msgs.h head/sys/ofed/drivers/infiniband/core/core_priv.h head/sys/ofed/drivers/infiniband/core/iwcm.h head/sys/ofed/drivers/infiniband/core/mad_priv.h head/sys/ofed/drivers/infiniband/core/smi.h head/sys/ofed/drivers/infiniband/core/uverbs.h head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_proc.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c head/sys/ofed/include/rdma/ib_addr.h head/sys/ofed/include/rdma/ib_cache.h head/sys/ofed/include/rdma/ib_cm.h head/sys/ofed/include/rdma/ib_mad.h head/sys/ofed/include/rdma/ib_pack.h head/sys/ofed/include/rdma/ib_pma.h head/sys/ofed/include/rdma/ib_sa.h head/sys/ofed/include/rdma/ib_smi.h head/sys/ofed/include/rdma/ib_umem.h head/sys/ofed/include/rdma/ib_verbs.h head/sys/ofed/include/rdma/iw_cm.h head/sys/ofed/include/rdma/rdma_cm.h head/targets/pseudo/userland/lib/Makefile.depend Directory Properties: head/ (props changed) head/MAINTAINERS (props changed) head/cddl/ (props changed) head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/contrib/atf/ (props changed) head/contrib/binutils/ (props changed) head/contrib/blacklist/ (props changed) head/contrib/bmake/ (props changed) head/contrib/byacc/ (props changed) head/contrib/compiler-rt/ (props changed) head/contrib/dma/ (props changed) head/contrib/elftoolchain/ (props changed) head/contrib/elftoolchain/ar/ (props changed) head/contrib/elftoolchain/elfdump/ (props changed) head/contrib/file/ (props changed) head/contrib/gcc/ (props changed) head/contrib/ipfilter/ (props changed) head/contrib/less/ (props changed) head/contrib/libarchive/ (props changed) head/contrib/libc++/ (props changed) head/contrib/libc-vis/ (props changed) head/contrib/libpcap/ (props changed) head/contrib/libstdc++/ (props changed) head/contrib/libxo/ (props changed) head/contrib/llvm/ (props changed) head/contrib/llvm/projects/libunwind/ (props changed) head/contrib/llvm/tools/clang/ (props changed) head/contrib/llvm/tools/lld/ (props changed) head/contrib/llvm/tools/lldb/ (props changed) head/contrib/mdocml/ (props changed) head/contrib/netbsd-tests/ (props changed) head/contrib/one-true-awk/ (props changed) head/contrib/openbsm/ (props changed) head/contrib/openpam/ (props changed) head/contrib/pjdfstest/ (props changed) head/contrib/sqlite3/ (props changed) head/contrib/subversion/ (props changed) head/contrib/tcpdump/ (props changed) head/contrib/top/ (props changed) head/contrib/tzdata/ (props changed) head/contrib/unbound/ (props changed) head/contrib/wpa/ (props changed) head/contrib/xz/ (props changed) head/contrib/zlib/ (props changed) head/crypto/heimdal/ (props changed) head/crypto/openssh/ (props changed) head/crypto/openssl/ (props changed) head/gnu/lib/ (props changed) head/gnu/usr.bin/binutils/ (props changed) head/gnu/usr.bin/cc/cc_tools/ (props changed) head/gnu/usr.bin/gdb/ (props changed) head/lib/libc/locale/ascii.c (props changed) head/lib/libedit/ (props changed) head/sys/amd64/amd64/efirt_machdep.c (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) head/sys/contrib/dev/acpica/ (props changed) head/sys/contrib/ena-com/ (props changed) head/sys/contrib/ipfilter/ (props changed) head/sys/contrib/octeon-sdk/ (props changed) head/sys/contrib/zstd/ (props changed) head/sys/dev/efidev/efirt.c (props changed) head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/include/ (props changed) head/usr.sbin/bhyve/bhyvegc.c (props changed) head/usr.sbin/bhyve/pci_fbuf.c (props changed) head/usr.sbin/bhyve/pci_xhci.c (props changed) head/usr.sbin/bhyve/rfb.c (props changed) head/usr.sbin/bhyve/rfb.h (props changed) head/usr.sbin/bhyve/vga.c (props changed) Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Nov 24 14:29:32 2017 (r326168) +++ head/Makefile.inc1 Fri Nov 24 14:50:28 2017 (r326169) @@ -2410,16 +2410,24 @@ _lib_libradius= lib/libradius .endif .if ${MK_OFED} != "no" -_ofed_lib= contrib/ofed/usr.lib -_prebuild_libs+= contrib/ofed/usr.lib/libosmcomp -_prebuild_libs+= contrib/ofed/usr.lib/libopensm -_prebuild_libs+= contrib/ofed/usr.lib/libibcommon -_prebuild_libs+= contrib/ofed/usr.lib/libibverbs -_prebuild_libs+= contrib/ofed/usr.lib/libibumad +# +# The OFED libraries are built in four steps +# as reflected below, due to interdependencies. +# +# NOTE: Depending on contrib/ofed/include is only needed for +# the lib32 compat build. +# +_ofed_lib= \ +contrib/ofed/include \ +contrib/ofed/usr.lib/0 \ +contrib/ofed/usr.lib/1 \ +contrib/ofed/usr.lib/2 \ +contrib/ofed/usr.lib/3 -contrib/ofed/usr.lib/libopensm__L: lib/libthr__L -contrib/ofed/usr.lib/libosmcomp__L: lib/libthr__L -contrib/ofed/usr.lib/libibumad__L: contrib/ofed/usr.lib/libibcommon__L +contrib/ofed/usr.lib/0__L: contrib/ofed/include__L lib/libthr__L +contrib/ofed/usr.lib/1__L: contrib/ofed/usr.lib/0__L +contrib/ofed/usr.lib/2__L: contrib/ofed/usr.lib/1__L +contrib/ofed/usr.lib/3__L: contrib/ofed/usr.lib/2__L .endif .if ${MK_CASPER} != "no" Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Fri Nov 24 14:29:32 2017 (r326168) +++ head/share/mk/bsd.libnames.mk Fri Nov 24 14:50:28 2017 (r326169) @@ -82,9 +82,8 @@ LIBHEIMNTLM?= ${LIBDESTDIR}${LIBDIR_BASE}/libheimntlm. LIBHEIMSQLITE?= ${LIBDESTDIR}${LIBDIR_BASE}/libheimsqlite.a LIBHX509?= ${LIBDESTDIR}${LIBDIR_BASE}/libhx509.a LIBIBCM?= ${LIBDESTDIR}${LIBDIR_BASE}/libibcm.a -LIBIBCOMMON?= ${LIBDESTDIR}${LIBDIR_BASE}/libibcommon.a LIBIBMAD?= ${LIBDESTDIR}${LIBDIR_BASE}/libibmad.a -LIBIBSDP?= ${LIBDESTDIR}${LIBDIR_BASE}/libibsdp.a +LIBIBNETDISC?= ${LIBDESTDIR}${LIBDIR_BASE}/libibnetdisc.a LIBIBUMAD?= ${LIBDESTDIR}${LIBDIR_BASE}/libibumad.a LIBIBVERBS?= ${LIBDESTDIR}${LIBDIR_BASE}/libibverbs.a LIBIFCONFIG?= ${LIBDESTDIR}${LIBDIR_BASE}/libifconfig.a @@ -108,9 +107,9 @@ LIBMEMSTAT?= ${LIBDESTDIR}${LIBDIR_BASE}/libmemstat.a LIBMENU?= ${LIBDESTDIR}${LIBDIR_BASE}/libmenu.a LIBMILTER?= ${LIBDESTDIR}${LIBDIR_BASE}/libmilter.a LIBMLX4?= ${LIBDESTDIR}${LIBDIR_BASE}/libmlx4.a +LIBMLX5?= ${LIBDESTDIR}${LIBDIR_BASE}/libmlx5.a LIBMP?= ${LIBDESTDIR}${LIBDIR_BASE}/libmp.a LIBMT?= ${LIBDESTDIR}${LIBDIR_BASE}/libmt.a -LIBMTHCA?= ${LIBDESTDIR}${LIBDIR_BASE}/libmthca.a LIBNANDFS?= ${LIBDESTDIR}${LIBDIR_BASE}/libnandfs.a LIBNCURSES?= ${LIBDESTDIR}${LIBDIR_BASE}/libncurses.a LIBNCURSESW?= ${LIBDESTDIR}${LIBDIR_BASE}/libncursesw.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Fri Nov 24 14:29:32 2017 (r326168) +++ head/share/mk/src.libnames.mk Fri Nov 24 14:50:28 2017 (r326169) @@ -194,18 +194,16 @@ _LIBRARIES+= \ _LIBRARIES+= \ cxgb4 \ ibcm \ - ibcommon \ ibmad \ - ibsdp \ + ibnetdisc \ ibumad \ ibverbs \ mlx4 \ - mthca \ - opensm \ - osmcomp \ - osmvendor \ + mlx5 \ rdmacm \ - + osmcomp \ + opensm \ + osmvendor .endif # Each library's LIBADD needs to be duplicated here for static linkage of @@ -332,17 +330,21 @@ _DP_zfs= md pthread umem util uutil m nvpair avl bsdxm zfs_core _DP_zfs_core= nvpair _DP_zpool= md pthread z nvpair avl umem + +# OFED support .if ${MK_OFED} != "no" _DP_cxgb4= ibverbs pthread _DP_ibcm= ibverbs -_DP_ibmad= ibcommon ibumad -_DP_ibumad= ibcommon +_DP_ibmad= ibumad +_DP_ibnetdisc= osmcomp ibmad ibumad +_DP_ibumad= +_DP_ibverbs= _DP_mlx4= ibverbs pthread -_DP_mthca= ibverbs pthread -_DP_opensm= pthread -_DP_osmcomp= pthread -_DP_osmvendor= ibumad opensm osmcomp pthread +_DP_mlx5= ibverbs pthread _DP_rdmacm= ibverbs +_DP_osmcomp= pthread +_DP_opensm= pthread +_DP_osmvendor= ibumad pthread .endif # Define special cases @@ -483,19 +485,21 @@ LIBUUTILDIR= ${OBJTOP}/cddl/lib/libuutil LIBZFSDIR= ${OBJTOP}/cddl/lib/libzfs LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core LIBZPOOLDIR= ${OBJTOP}/cddl/lib/libzpool -LIBCXGB4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libcxgb4 -LIBIBCMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcm -LIBIBCOMMONDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcommon -LIBIBMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibmad -LIBIBUMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibumad -LIBIBVERBSDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibverbs -LIBMLX4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libmlx4 -LIBMTHCADIR= ${OBJTOP}/contrib/ofed/usr.lib/libmthca -LIBOPENSMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libopensm -LIBOSMCOMPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmcomp -LIBOSMVENDORDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmvendor -LIBRDMACMDIR= ${OBJTOP}/contrib/ofed/usr.lib/librdmacm -LIBIBSDPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libsdp + +# OFED support +LIBCXGB4DIR= ${OBJTOP}/contrib/ofed/libcxgb4 +LIBIBCMDIR= ${OBJTOP}/contrib/ofed/libibcm +LIBIBMADDIR= ${OBJTOP}/contrib/ofed/libibmad +LIBIBNETDISCDIR=${OBJTOP}/contrib/ofed/libibnetdisc +LIBIBUMADDIR= ${OBJTOP}/contrib/ofed/libibumad +LIBIBVERBSDIR= ${OBJTOP}/contrib/ofed/libibverbs +LIBMLX4DIR= ${OBJTOP}/contrib/ofed/libmlx4 +LIBMLX5DIR= ${OBJTOP}/contrib/ofed/libmlx5 +LIBRDMACMDIR= ${OBJTOP}/contrib/ofed/librdmacm +LIBOSMCOMPDIR= ${OBJTOP}/contrib/ofed/opensm/complib +LIBOPENSMDIR= ${OBJTOP}/contrib/ofed/opensm/libopensm +LIBOSMVENDORDIR=${OBJTOP}/contrib/ofed/opensm/libvendor + LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog LIBGCOVDIR= ${OBJTOP}/gnu/lib/libgcov LIBGOMPDIR= ${OBJTOP}/gnu/lib/libgomp Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Nov 24 14:29:32 2017 (r326168) +++ head/sys/amd64/conf/NOTES Fri Nov 24 14:50:28 2017 (r326169) @@ -317,7 +317,6 @@ options DRM_DEBUG # Include debug printfs (slow) # ixlv: Intel XL710 40Gbe VF PCIE Ethernet # mlx4ib: Mellanox ConnectX HCA InfiniBand # mlx4en: Mellanox ConnectX HCA Ethernet -# mthca: Mellanox HCA InfiniBand # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) # sfxge: Solarflare SFC9000 family 10Gb Ethernet adapters # vmx: VMware VMXNET3 Ethernet (BSD open source) @@ -338,7 +337,6 @@ device ixlv # Intel XL710 40Gbe VF PCIE Ethernet device mlx4 # Shared code module between IB and Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand device mlx4en # Mellanox ConnectX HCA Ethernet -device mthca # Mellanox HCA InfiniBand device nfe # nVidia nForce MCP on-board Ethernet device sfxge # Solarflare SFC9000 10Gb Ethernet device vmx # VMware VMXNET3 Ethernet Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Nov 24 14:29:32 2017 (r326168) +++ head/sys/conf/files Fri Nov 24 14:50:28 2017 (r326169) @@ -4453,58 +4453,62 @@ compat/linuxkpi/common/src/linux_work.c optional comp compile-with "${LINUXKPI_C}" # OpenFabrics Enterprise Distribution (Infiniband) -ofed/drivers/infiniband/core/addr.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/agent.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/cache.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -# XXX Mad.c must be ordered before cm.c for sysinit sets to occur in -# the correct order. -ofed/drivers/infiniband/core/mad.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/cm.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/ -Wno-unused-function" -ofed/drivers/infiniband/core/cma.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/device.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/fmr_pool.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/iwcm.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/mad_rmpp.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/multicast.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/packer.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/peer_mem.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/sa_query.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/smi.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/sysfs.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/ucm.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/ucma.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/ud_header.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/umem.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/user_mad.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/uverbs_cmd.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/uverbs_main.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/uverbs_marshall.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" -ofed/drivers/infiniband/core/verbs.c optional ofed \ - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" +ofed/drivers/infiniband/core/ib_addr.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_agent.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_cache.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_cm.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_cma.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_cq.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_device.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_fmr_pool.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_iwcm.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_iwpm_msg.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_iwpm_util.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_mad.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_mad_rmpp.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_multicast.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_packer.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_sa_query.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_smi.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_sysfs.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_ucm.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_ucma.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_ud_header.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_umem.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_user_mad.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_uverbs_cmd.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_uverbs_main.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_uverbs_marshall.c optional ofed \ + compile-with "${OFED_C}" +ofed/drivers/infiniband/core/ib_verbs.c optional ofed \ + compile-with "${OFED_C}" ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c optional ipoib \ compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" @@ -4550,8 +4554,6 @@ dev/mlx4/mlx4_ib/mlx4_ib_mad.c optional mlx4ib pci o compile-with "${OFED_C}" dev/mlx4/mlx4_ib/mlx4_ib_main.c optional mlx4ib pci ofed \ compile-with "${OFED_C}" -dev/mlx4/mlx4_ib/mlx4_ib_exp.c optional mlx4ib pci ofed \ - compile-with "${OFED_C}" dev/mlx4/mlx4_ib/mlx4_ib_mr.c optional mlx4ib pci ofed \ compile-with "${OFED_C}" dev/mlx4/mlx4_ib/mlx4_ib_qp.c optional mlx4ib pci ofed \ @@ -4623,6 +4625,8 @@ dev/mlx5/mlx5_ib/mlx5_ib_cq.c optional mlx5ib pci of compile-with "${OFED_C}" dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c optional mlx5ib pci ofed \ compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_gsi.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" dev/mlx5/mlx5_ib/mlx5_ib_mad.c optional mlx5ib pci ofed \ compile-with "${OFED_C}" dev/mlx5/mlx5_ib/mlx5_ib_main.c optional mlx5ib pci ofed \ @@ -4633,10 +4637,10 @@ dev/mlx5/mlx5_ib/mlx5_ib_mr.c optional mlx5ib pci of compile-with "${OFED_C}" dev/mlx5/mlx5_ib/mlx5_ib_qp.c optional mlx5ib pci ofed \ compile-with "${OFED_C}" -dev/mlx5/mlx5_ib/mlx5_ib_roce.c optional mlx5ib pci ofed \ - compile-with "${OFED_C}" dev/mlx5/mlx5_ib/mlx5_ib_srq.c optional mlx5ib pci ofed \ compile-with "${OFED_C}" +dev/mlx5/mlx5_ib/mlx5_ib_virt.c optional mlx5ib pci ofed \ + compile-with "${OFED_C}" dev/mlx5/mlx5_core/mlx5_alloc.c optional mlx5 pci \ compile-with "${OFED_C}" @@ -4694,43 +4698,6 @@ dev/mlx5/mlx5_en/mlx5_en_flow_table.c optional mlx5en dev/mlx5/mlx5_en/mlx5_en_rx.c optional mlx5en pci inet inet6 \ compile-with "${OFED_C}" dev/mlx5/mlx5_en/mlx5_en_txrx.c optional mlx5en pci inet inet6 \ - compile-with "${OFED_C}" - -ofed/drivers/infiniband/hw/mthca/mthca_allocator.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_av.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_catas.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_cmd.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_cq.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_eq.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_mad.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_main.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_mcg.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_memfree.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_mr.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_pd.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_profile.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_provider.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_qp.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_reset.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_srq.c optional mthca \ - compile-with "${OFED_C}" -ofed/drivers/infiniband/hw/mthca/mthca_uar.c optional mthca \ compile-with "${OFED_C}" # crypto support Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Fri Nov 24 14:29:32 2017 (r326168) +++ head/sys/conf/kern.pre.mk Fri Nov 24 14:50:28 2017 (r326169) @@ -178,9 +178,10 @@ LINUXKPI_C= ${NORMAL_C} ${LINUXKPI_INCLUDES} # Infiniband C flags. Correct include paths and omit errors that linux # does not honor. -OFEDINCLUDES= -I$S/ofed/include ${LINUXKPI_INCLUDES} +OFEDINCLUDES= -I$S/ofed/include -I$S/ofed/include/uapi ${LINUXKPI_INCLUDES} OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -OFEDCFLAGS= ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} +OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_MEM \ + ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Fri Nov 24 14:29:32 2017 (r326168) +++ head/sys/contrib/rdma/krping/krping.c Fri Nov 24 14:50:28 2017 (r326169) @@ -54,13 +54,14 @@ __FBSDID("$FreeBSD$"); #include "krping.h" #include "getopt.h" +#define PFX "krping: " + extern int krping_debug; -#define DEBUG_LOG(cb, x...) if (krping_debug) log(LOG_INFO, x) -#define PRINTF(cb, x...) log(LOG_INFO, x) +#define DEBUG_LOG(...) do { if (krping_debug) log(LOG_INFO, __VA_ARGS__); } while (0) #define BIND_INFO 1 MODULE_AUTHOR("Steve Wise"); -MODULE_DESCRIPTION("RDMA ping client/server"); +MODULE_DESCRIPTION("RDMA ping server"); MODULE_LICENSE("Dual BSD/GPL"); MODULE_VERSION(krping, 1); MODULE_DEPEND(krping, linuxkpi, 1, 1, 1); @@ -77,9 +78,7 @@ typedef uint64_t cycles_t; enum mem_type { DMA = 1, - FASTREG = 2, - MW = 3, - MR = 4 + REG = 2, }; static const struct krping_option krping_opts[] = { @@ -92,7 +91,6 @@ static const struct krping_option krping_opts[] = { {"validate", OPT_NOPARAM, 'V'}, {"server", OPT_NOPARAM, 's'}, {"client", OPT_NOPARAM, 'c'}, - {"mem_mode", OPT_STRING, 'm'}, {"server_inv", OPT_NOPARAM, 'I'}, {"wlat", OPT_NOPARAM, 'l'}, {"rlat", OPT_NOPARAM, 'L'}, @@ -102,14 +100,14 @@ static const struct krping_option krping_opts[] = { {"poll", OPT_NOPARAM, 'P'}, {"local_dma_lkey", OPT_NOPARAM, 'Z'}, {"read_inv", OPT_NOPARAM, 'R'}, - {"fr", OPT_INT, 'f'}, + {"fr", OPT_NOPARAM, 'f'}, {NULL, 0, 0} }; #define htonll(x) cpu_to_be64((x)) #define ntohll(x) cpu_to_be64((x)) -static struct mutex krping_mutex; +static DEFINE_MUTEX(krping_mutex); /* * List of running krping threads. @@ -117,6 +115,13 @@ static struct mutex krping_mutex; static LIST_HEAD(krping_cbs); /* + * Invoke like this, one on each side, using the server's address on + * the RDMA device (iw%d): + * + * /bin/echo server,port=9999,addr=192.168.69.142,validate > /proc/krping + * /bin/echo client,port=9999,addr=192.168.69.142,validate > /proc/krping + * /bin/echo client,port=9999,addr6=2001:db8:0:f101::1,validate > /proc/krping + * * krping "ping/pong" loop: * client sends source rkey/addr/len * server receives source rkey/add/len @@ -165,42 +170,35 @@ struct krping_rdma_info { * Control block struct. */ struct krping_cb { - void *cookie; int server; /* 0 iff client */ struct ib_cq *cq; struct ib_pd *pd; struct ib_qp *qp; - enum mem_type mem; struct ib_mr *dma_mr; struct ib_fast_reg_page_list *page_list; int page_list_len; - struct ib_send_wr fastreg_wr; + struct ib_reg_wr reg_mr_wr; struct ib_send_wr invalidate_wr; - struct ib_mr *fastreg_mr; + struct ib_mr *reg_mr; int server_invalidate; int read_inv; u8 key; - struct ib_mw *mw; - struct ib_mw_bind bind_attr; - struct ib_recv_wr rq_wr; /* recv work request record */ struct ib_sge recv_sgl; /* recv single SGE */ - struct krping_rdma_info recv_buf;/* malloc'd buffer */ + struct krping_rdma_info recv_buf __aligned(16); /* malloc'd buffer */ u64 recv_dma_addr; DECLARE_PCI_UNMAP_ADDR(recv_mapping) - struct ib_mr *recv_mr; struct ib_send_wr sq_wr; /* send work requrest record */ struct ib_sge send_sgl; - struct krping_rdma_info send_buf;/* single send buf */ + struct krping_rdma_info send_buf __aligned(16); /* single send buf */ u64 send_dma_addr; DECLARE_PCI_UNMAP_ADDR(send_mapping) - struct ib_mr *send_mr; - struct ib_send_wr rdma_sq_wr; /* rdma work request record */ + struct ib_rdma_wr rdma_sq_wr; /* rdma work request record */ struct ib_sge rdma_sgl; /* rdma single SGE */ char *rdma_buf; /* used as rdma sink */ u64 rdma_dma_addr; @@ -221,12 +219,9 @@ struct krping_cb { struct krping_stats stats; uint16_t port; /* dst port in NBO */ - union { - struct in_addr v4; - struct in6_addr v6; - } addr; /* dst addr in NBO */ - int addr_type; /* AF_INET or AF_INET6 */ + u8 addr[16] __aligned(8); /* dst addr in NBO */ char *addr_str; /* dst addr string */ + uint8_t addr_type; /* ADDR_FAMILY - IPv4/V6 */ int verbose; /* verbose logging */ int count; /* ping count */ int size; /* ping data size */ @@ -238,8 +233,7 @@ struct krping_cb { int poll; /* poll or block for rlat test */ int txdepth; /* SQ depth */ int local_dma_lkey; /* use 0 for lkey */ - int frtest; /* fastreg test */ - int testnum; + int frtest; /* reg test */ /* CM stuff */ struct rdma_cm_id *cm_id; /* connection on client side,*/ @@ -254,39 +248,34 @@ static int krping_cma_event_handler(struct rdma_cm_id int ret; struct krping_cb *cb = cma_id->context; - DEBUG_LOG(cb, "cma_event type %d cma_id %p (%s)\n", event->event, - cma_id, (cma_id == cb->cm_id) ? "parent" : "child"); + DEBUG_LOG("cma_event type %d cma_id %p (%s)\n", event->event, cma_id, + (cma_id == cb->cm_id) ? "parent" : "child"); switch (event->event) { case RDMA_CM_EVENT_ADDR_RESOLVED: cb->state = ADDR_RESOLVED; ret = rdma_resolve_route(cma_id, 2000); if (ret) { - PRINTF(cb, "rdma_resolve_route error %d\n", ret); + printk(KERN_ERR PFX "rdma_resolve_route error %d\n", + ret); wake_up_interruptible(&cb->sem); } break; case RDMA_CM_EVENT_ROUTE_RESOLVED: cb->state = ROUTE_RESOLVED; - cb->child_cm_id = cma_id; wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_CONNECT_REQUEST: - if (cb->state == IDLE) { - cb->state = CONNECT_REQUEST; - cb->child_cm_id = cma_id; - } else { - PRINTF(cb, "Received connection request in wrong state" - " (%d)\n", cb->state); - } - DEBUG_LOG(cb, "child cma %p\n", cb->child_cm_id); + cb->state = CONNECT_REQUEST; + cb->child_cm_id = cma_id; + DEBUG_LOG("child cma %p\n", cb->child_cm_id); wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_ESTABLISHED: - DEBUG_LOG(cb, "ESTABLISHED\n"); + DEBUG_LOG("ESTABLISHED\n"); if (!cb->server) { cb->state = CONNECTED; } @@ -298,24 +287,24 @@ static int krping_cma_event_handler(struct rdma_cm_id case RDMA_CM_EVENT_CONNECT_ERROR: case RDMA_CM_EVENT_UNREACHABLE: case RDMA_CM_EVENT_REJECTED: - PRINTF(cb, "cma event %d, error %d\n", event->event, + printk(KERN_ERR PFX "cma event %d, error %d\n", event->event, event->status); cb->state = ERROR; wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_DISCONNECTED: - PRINTF(cb, "DISCONNECT EVENT...\n"); + printk(KERN_ERR PFX "DISCONNECT EVENT...\n"); cb->state = ERROR; wake_up_interruptible(&cb->sem); break; case RDMA_CM_EVENT_DEVICE_REMOVAL: - PRINTF(cb, "cma detected device removal!!!!\n"); + printk(KERN_ERR PFX "cma detected device removal!!!!\n"); break; default: - PRINTF(cb, "oof bad type!\n"); + printk(KERN_ERR PFX "oof bad type!\n"); wake_up_interruptible(&cb->sem); break; } @@ -325,7 +314,7 @@ static int krping_cma_event_handler(struct rdma_cm_id static int server_recv(struct krping_cb *cb, struct ib_wc *wc) { if (wc->byte_len != sizeof(cb->recv_buf)) { - PRINTF(cb, "Received bogus data, size %d\n", + printk(KERN_ERR PFX "Received bogus data, size %d\n", wc->byte_len); return -1; } @@ -333,7 +322,7 @@ static int server_recv(struct krping_cb *cb, struct ib cb->remote_rkey = ntohl(cb->recv_buf.rkey); cb->remote_addr = ntohll(cb->recv_buf.buf); cb->remote_len = ntohl(cb->recv_buf.size); - DEBUG_LOG(cb, "Received rkey %x addr %llx len %d from peer\n", + DEBUG_LOG("Received rkey %x addr %llx len %d from peer\n", cb->remote_rkey, (unsigned long long)cb->remote_addr, cb->remote_len); @@ -348,7 +337,7 @@ static int server_recv(struct krping_cb *cb, struct ib static int client_recv(struct krping_cb *cb, struct ib_wc *wc) { if (wc->byte_len != sizeof(cb->recv_buf)) { - PRINTF(cb, "Received bogus data, size %d\n", + printk(KERN_ERR PFX "Received bogus data, size %d\n", wc->byte_len); return -1; } @@ -370,18 +359,22 @@ static void krping_cq_event_handler(struct ib_cq *cq, BUG_ON(cb->cq != cq); if (cb->state == ERROR) { - PRINTF(cb, "cq completion in ERROR state\n"); + printk(KERN_ERR PFX "cq completion in ERROR state\n"); return; } - if (!cb->wlat && !cb->rlat && !cb->bw && !cb->frtest) + if (cb->frtest) { + printk(KERN_ERR PFX "cq completion event in frtest!\n"); + return; + } + if (!cb->wlat && !cb->rlat && !cb->bw) ib_req_notify_cq(cb->cq, IB_CQ_NEXT_COMP); while ((ret = ib_poll_cq(cb->cq, 1, &wc)) == 1) { if (wc.status) { if (wc.status == IB_WC_WR_FLUSH_ERR) { - DEBUG_LOG(cb, "cq flushed\n"); + DEBUG_LOG("cq flushed\n"); continue; } else { - PRINTF(cb, "cq completion failed with " + printk(KERN_ERR PFX "cq completion failed with " "wr_id %jx status %d opcode %d vender_err %x\n", (uintmax_t)wc.wr_id, wc.status, wc.opcode, wc.vendor_err); goto error; @@ -390,44 +383,44 @@ static void krping_cq_event_handler(struct ib_cq *cq, switch (wc.opcode) { case IB_WC_SEND: - DEBUG_LOG(cb, "send completion\n"); + DEBUG_LOG("send completion\n"); cb->stats.send_bytes += cb->send_sgl.length; cb->stats.send_msgs++; break; case IB_WC_RDMA_WRITE: - DEBUG_LOG(cb, "rdma write completion\n"); - cb->stats.write_bytes += cb->rdma_sq_wr.sg_list->length; + DEBUG_LOG("rdma write completion\n"); + cb->stats.write_bytes += cb->rdma_sq_wr.wr.sg_list->length; cb->stats.write_msgs++; cb->state = RDMA_WRITE_COMPLETE; wake_up_interruptible(&cb->sem); break; case IB_WC_RDMA_READ: - DEBUG_LOG(cb, "rdma read completion\n"); - cb->stats.read_bytes += cb->rdma_sq_wr.sg_list->length; + DEBUG_LOG("rdma read completion\n"); + cb->stats.read_bytes += cb->rdma_sq_wr.wr.sg_list->length; cb->stats.read_msgs++; cb->state = RDMA_READ_COMPLETE; wake_up_interruptible(&cb->sem); break; case IB_WC_RECV: - DEBUG_LOG(cb, "recv completion\n"); + DEBUG_LOG("recv completion\n"); cb->stats.recv_bytes += sizeof(cb->recv_buf); cb->stats.recv_msgs++; - if (cb->wlat || cb->rlat || cb->bw || cb->frtest) + if (cb->wlat || cb->rlat || cb->bw) ret = server_recv(cb, &wc); else ret = cb->server ? server_recv(cb, &wc) : client_recv(cb, &wc); if (ret) { - PRINTF(cb, "recv wc error: %d\n", ret); + printk(KERN_ERR PFX "recv wc error: %d\n", ret); goto error; } ret = ib_post_recv(cb->qp, &cb->rq_wr, &bad_wr); if (ret) { - PRINTF(cb, "post recv error: %d\n", + printk(KERN_ERR PFX "post recv error: %d\n", ret); goto error; } @@ -435,14 +428,14 @@ static void krping_cq_event_handler(struct ib_cq *cq, break; default: - PRINTF(cb, + printk(KERN_ERR PFX "%s:%d Unexpected opcode %d, Shutting down\n", __func__, __LINE__, wc.opcode); goto error; } } if (ret) { - PRINTF(cb, "poll error %d\n", ret); + printk(KERN_ERR PFX "poll error %d\n", ret); goto error; } return; @@ -456,7 +449,7 @@ static int krping_accept(struct krping_cb *cb) struct rdma_conn_param conn_param; int ret; - DEBUG_LOG(cb, "accepting client connection request\n"); + DEBUG_LOG("accepting client connection request\n"); memset(&conn_param, 0, sizeof conn_param); conn_param.responder_resources = 1; @@ -464,14 +457,14 @@ static int krping_accept(struct krping_cb *cb) ret = rdma_accept(cb->child_cm_id, &conn_param); if (ret) { - PRINTF(cb, "rdma_accept error: %d\n", ret); + printk(KERN_ERR PFX "rdma_accept error: %d\n", ret); return ret; } - if (!cb->wlat && !cb->rlat && !cb->bw && !cb->frtest) { + if (!cb->wlat && !cb->rlat && !cb->bw) { wait_event_interruptible(cb->sem, cb->state >= CONNECTED); if (cb->state == ERROR) { - PRINTF(cb, "wait for CONNECTED state %d\n", + printk(KERN_ERR PFX "wait for CONNECTED state %d\n", cb->state); return -1; } @@ -483,278 +476,120 @@ static void krping_setup_wr(struct krping_cb *cb) { cb->recv_sgl.addr = cb->recv_dma_addr; cb->recv_sgl.length = sizeof cb->recv_buf; - if (cb->local_dma_lkey) - cb->recv_sgl.lkey = cb->qp->device->local_dma_lkey; - else if (cb->mem == DMA) - cb->recv_sgl.lkey = cb->dma_mr->lkey; - else - cb->recv_sgl.lkey = cb->recv_mr->lkey; + cb->recv_sgl.lkey = cb->pd->local_dma_lkey; cb->rq_wr.sg_list = &cb->recv_sgl; cb->rq_wr.num_sge = 1; cb->send_sgl.addr = cb->send_dma_addr; cb->send_sgl.length = sizeof cb->send_buf; - if (cb->local_dma_lkey) - cb->send_sgl.lkey = cb->qp->device->local_dma_lkey; - else if (cb->mem == DMA) - cb->send_sgl.lkey = cb->dma_mr->lkey; - else - cb->send_sgl.lkey = cb->send_mr->lkey; + cb->send_sgl.lkey = cb->pd->local_dma_lkey; cb->sq_wr.opcode = IB_WR_SEND; cb->sq_wr.send_flags = IB_SEND_SIGNALED; cb->sq_wr.sg_list = &cb->send_sgl; cb->sq_wr.num_sge = 1; - if (cb->server || cb->wlat || cb->rlat || cb->bw || cb->frtest) { + if (cb->server || cb->wlat || cb->rlat || cb->bw) { cb->rdma_sgl.addr = cb->rdma_dma_addr; - if (cb->mem == MR) - cb->rdma_sgl.lkey = cb->rdma_mr->lkey; - cb->rdma_sq_wr.send_flags = IB_SEND_SIGNALED; - cb->rdma_sq_wr.sg_list = &cb->rdma_sgl; - cb->rdma_sq_wr.num_sge = 1; + cb->rdma_sq_wr.wr.send_flags = IB_SEND_SIGNALED; + cb->rdma_sq_wr.wr.sg_list = &cb->rdma_sgl; + cb->rdma_sq_wr.wr.num_sge = 1; } - switch(cb->mem) { - case FASTREG: + /* + * A chain of 2 WRs, INVALDATE_MR + REG_MR. + * both unsignaled. The client uses them to reregister + * the rdma buffers with a new key each iteration. + */ + cb->reg_mr_wr.wr.opcode = IB_WR_REG_MR; + cb->reg_mr_wr.mr = cb->reg_mr; - /* - * A chain of 2 WRs, INVALDATE_MR + FAST_REG_MR. - * both unsignaled. The client uses them to reregister - * the rdma buffers with a new key each iteration. - */ - cb->fastreg_wr.opcode = IB_WR_FAST_REG_MR; - cb->fastreg_wr.wr.fast_reg.page_shift = PAGE_SHIFT; - cb->fastreg_wr.wr.fast_reg.length = cb->size; - cb->fastreg_wr.wr.fast_reg.page_list = cb->page_list; - cb->fastreg_wr.wr.fast_reg.page_list_len = cb->page_list_len; - - cb->invalidate_wr.next = &cb->fastreg_wr; - cb->invalidate_wr.opcode = IB_WR_LOCAL_INV; - break; - case MW: - cb->bind_attr.wr_id = 0xabbaabba; - cb->bind_attr.send_flags = 0; /* unsignaled */ -#ifdef BIND_INFO - cb->bind_attr.bind_info.length = cb->size; -#else - cb->bind_attr.length = cb->size; -#endif - break; - default: - break; - } + cb->invalidate_wr.next = &cb->reg_mr_wr.wr; + cb->invalidate_wr.opcode = IB_WR_LOCAL_INV; } static int krping_setup_buffers(struct krping_cb *cb) { int ret; - struct ib_phys_buf buf; - u64 iovbase; - DEBUG_LOG(cb, "krping_setup_buffers called on cb %p\n", cb); + DEBUG_LOG(PFX "krping_setup_buffers called on cb %p\n", cb); - cb->recv_dma_addr = ib_dma_map_single(cb->pd->device, + cb->recv_dma_addr = ib_dma_map_single(cb->pd->device, &cb->recv_buf, sizeof(cb->recv_buf), DMA_BIDIRECTIONAL); pci_unmap_addr_set(cb, recv_mapping, cb->recv_dma_addr); - cb->send_dma_addr = ib_dma_map_single(cb->pd->device, + cb->send_dma_addr = ib_dma_map_single(cb->pd->device, &cb->send_buf, sizeof(cb->send_buf), DMA_BIDIRECTIONAL); pci_unmap_addr_set(cb, send_mapping, cb->send_dma_addr); - if (cb->mem == DMA) { - cb->dma_mr = ib_get_dma_mr(cb->pd, IB_ACCESS_LOCAL_WRITE| - IB_ACCESS_REMOTE_READ| - IB_ACCESS_REMOTE_WRITE); - if (IS_ERR(cb->dma_mr)) { - DEBUG_LOG(cb, "reg_dmamr failed\n"); - ret = PTR_ERR(cb->dma_mr); - goto bail; - } - } else { - if (!cb->local_dma_lkey) { - buf.addr = cb->recv_dma_addr; - buf.size = sizeof cb->recv_buf; - DEBUG_LOG(cb, "recv buf dma_addr %jx size %d\n", - (uintmax_t)buf.addr, (int)buf.size); - iovbase = cb->recv_dma_addr; - cb->recv_mr = ib_reg_phys_mr(cb->pd, &buf, 1, - IB_ACCESS_LOCAL_WRITE, - &iovbase); - - if (IS_ERR(cb->recv_mr)) { - DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); - ret = PTR_ERR(cb->recv_mr); - goto bail; - } - - buf.addr = cb->send_dma_addr; - buf.size = sizeof cb->send_buf; - DEBUG_LOG(cb, "send buf dma_addr %jx size %d\n", - (uintmax_t)buf.addr, (int)buf.size); - iovbase = cb->send_dma_addr; - cb->send_mr = ib_reg_phys_mr(cb->pd, &buf, 1, - 0, &iovbase); - - if (IS_ERR(cb->send_mr)) { - DEBUG_LOG(cb, "send_buf reg_mr failed\n"); - ret = PTR_ERR(cb->send_mr); - goto bail; - } - } - } - - cb->rdma_buf = kmalloc(cb->size, GFP_KERNEL); + cb->rdma_buf = ib_dma_alloc_coherent(cb->pd->device, cb->size, + &cb->rdma_dma_addr, + GFP_KERNEL); if (!cb->rdma_buf) { - DEBUG_LOG(cb, "rdma_buf malloc failed\n"); + DEBUG_LOG(PFX "rdma_buf allocation failed\n"); ret = -ENOMEM; goto bail; } - - cb->rdma_dma_addr = ib_dma_map_single(cb->pd->device, - cb->rdma_buf, cb->size, - DMA_BIDIRECTIONAL); pci_unmap_addr_set(cb, rdma_mapping, cb->rdma_dma_addr); - if (cb->mem != DMA) { - switch (cb->mem) { - case FASTREG: - cb->page_list_len = (((cb->size - 1) & PAGE_MASK) + - PAGE_SIZE) >> PAGE_SHIFT; - cb->page_list = ib_alloc_fast_reg_page_list( - cb->pd->device, - cb->page_list_len); - if (IS_ERR(cb->page_list)) { - DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); - ret = PTR_ERR(cb->page_list); - goto bail; - } - cb->fastreg_mr = ib_alloc_fast_reg_mr(cb->pd, - cb->page_list->max_page_list_len); - if (IS_ERR(cb->fastreg_mr)) { - DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); - ret = PTR_ERR(cb->fastreg_mr); - goto bail; - } - DEBUG_LOG(cb, "fastreg rkey 0x%x page_list %p" - " page_list_len %u\n", cb->fastreg_mr->rkey, - cb->page_list, cb->page_list_len); - break; - case MW: - cb->mw = ib_alloc_mw(cb->pd,IB_MW_TYPE_1); - if (IS_ERR(cb->mw)) { - DEBUG_LOG(cb, "recv_buf alloc_mw failed\n"); - ret = PTR_ERR(cb->mw); - goto bail; - } - DEBUG_LOG(cb, "mw rkey 0x%x\n", cb->mw->rkey); - /*FALLTHROUGH*/ - case MR: - buf.addr = cb->rdma_dma_addr; - buf.size = cb->size; - iovbase = cb->rdma_dma_addr; - cb->rdma_mr = ib_reg_phys_mr(cb->pd, &buf, 1, - IB_ACCESS_LOCAL_WRITE| - IB_ACCESS_REMOTE_READ| - IB_ACCESS_REMOTE_WRITE, - &iovbase); - if (IS_ERR(cb->rdma_mr)) { - DEBUG_LOG(cb, "rdma_buf reg_mr failed\n"); - ret = PTR_ERR(cb->rdma_mr); - goto bail; - } - DEBUG_LOG(cb, "rdma buf dma_addr %jx size %d mr rkey 0x%x\n", - (uintmax_t)buf.addr, (int)buf.size, cb->rdma_mr->rkey); - break; - default: - ret = -EINVAL; - goto bail; - break; - } + cb->page_list_len = (((cb->size - 1) & PAGE_MASK) + PAGE_SIZE) + >> PAGE_SHIFT; + cb->reg_mr = ib_alloc_mr(cb->pd, IB_MR_TYPE_MEM_REG, + cb->page_list_len); + if (IS_ERR(cb->reg_mr)) { + ret = PTR_ERR(cb->reg_mr); + DEBUG_LOG(PFX "recv_buf reg_mr failed %d\n", ret); + goto bail; } + DEBUG_LOG(PFX "reg rkey 0x%x page_list_len %u\n", + cb->reg_mr->rkey, cb->page_list_len); - if (!cb->server || cb->wlat || cb->rlat || cb->bw || cb->frtest) { + if (!cb->server || cb->wlat || cb->rlat || cb->bw) { - cb->start_buf = kmalloc(cb->size, GFP_KERNEL); + cb->start_buf = ib_dma_alloc_coherent(cb->pd->device, cb->size, + &cb->start_dma_addr, + GFP_KERNEL); if (!cb->start_buf) { - DEBUG_LOG(cb, "start_buf malloc failed\n"); + DEBUG_LOG(PFX "start_buf malloc failed\n"); ret = -ENOMEM; goto bail; } - - cb->start_dma_addr = ib_dma_map_single(cb->pd->device, - cb->start_buf, cb->size, - DMA_BIDIRECTIONAL); pci_unmap_addr_set(cb, start_mapping, cb->start_dma_addr); - - if (cb->mem == MR || cb->mem == MW) { - unsigned flags = IB_ACCESS_REMOTE_READ; - - if (cb->wlat || cb->rlat || cb->bw || cb->frtest) { - flags |= IB_ACCESS_LOCAL_WRITE | - IB_ACCESS_REMOTE_WRITE; - } - - buf.addr = cb->start_dma_addr; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Nov 24 15:00: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 8CF6CDE870C; Fri, 24 Nov 2017 15:00:51 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 420D57804F; Fri, 24 Nov 2017 15:00:51 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x243.google.com with SMTP id r39so31670880qtr.13; Fri, 24 Nov 2017 07:00:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=BA78SflmkDH5ZT2cw8Dr+zAHcceQJ24fMtP+j4yAiGs=; b=YTWyHenIVuWjc8sOpHMgRZgvuLNVYx0fgfBBD7O0CtBGdHvAr8gP3eKFRp7HEc/aSD a30+F4HEiP4/VdC/HKuumVy1wTmGzqvC9vMDADqNvQSEUkgksesA5h044Nntc8FKvqmk JQeqoSb2QCaQaOfn8t1ADaqt3J2BfjM8blamjAOayEz948NoIJqrmPNWO1RE3/aLSAtD p6iQKmX83qt148MrJECd4uACSSd4EPrboUmqXrOrDAYORBY4q1lSZRkbwVVXMiC3QxyE NCBzBnsAO+8ofSY47Qe3ZYkGTI85gViayqDhaPgh2Ege8jWtdthLp+7LdBZCA1iueYDr LqMg== 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=BA78SflmkDH5ZT2cw8Dr+zAHcceQJ24fMtP+j4yAiGs=; b=B2oxO75NXaaLZpi2fd0/RPYtN+sNovNijh5O8hq92FpBjiuZq4P7bbTcrsl1WMtEtE Fi/xNwo2uQYcEyDYFDx1I/PwVpjkrbRhzPKCIcq0v02wTlXkRvQAmiVxP3SByR4+cSZp uD7EG3LIhPn9/yTKEAsc5Wx7dVXmwLwcdJU1EECNqJUTd5aWfVMtxDYjDZOkRVf6reBt R9JZzkl25nIMYyYH6zQGuzcspWbx/K1rBTQXBDq6dEchgxcF+l//p1PcsbL3X21TtLBg Lv6Z8ycQw4MwhcDMQzAW2P1QkXgGc7DDIxaMYPgKhqou13yeAxBNXosRZpylN2yhcBU0 hReQ== X-Gm-Message-State: AJaThX7v+uoG+xLvNr3uFy+mxItTIQnwL0CuVIFw68a+CHUf8M+WbxYv tabN/NYXkECIoNI+RHuTBc+RyA== X-Google-Smtp-Source: AGs4zMZlSaiZm8QF1acmuuO4d4yDgLi6laZ4kQJK9B+Lxrga42xVznIzycmmBr8QFBE5ypI3i2XFNg== X-Received: by 10.200.50.165 with SMTP id z34mr47004694qta.137.1511535649783; Fri, 24 Nov 2017 07:00:49 -0800 (PST) Received: from raichu (toroon0560w-lp140-01-69-159-38-22.dsl.bell.ca. [69.159.38.22]) by smtp.gmail.com with ESMTPSA id c10sm14313219qtj.29.2017.11.24.07.00.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 07:00:48 -0800 (PST) Sender: Mark Johnston Date: Fri, 24 Nov 2017 10:00:44 -0500 From: Mark Johnston To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... Message-ID: <20171124150044.GA94025@raichu> References: <201711241450.vAOEoSFW056744@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201711241450.vAOEoSFW056744@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 15:00:51 -0000 On Fri, Nov 24, 2017 at 02:50:28PM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Nov 24 14:50:28 2017 > New Revision: 326169 > URL: https://svnweb.freebsd.org/changeset/base/326169 > > Log: > RoCE/infiniband upgrade to Linux v4.9 for kernel and userspace. Nice! > > This commit merges projects/bsd_rdma_4_9 to head. > > List of kernel sources used: > ============================ > > 1) kernel sources were cloned from git://github.com/torvalds/linux.git > Top commit 69973b830859bc6529a7a0468ba0d80ee5117826 - tag: v4.9, linux-4.9 > > 2) krping was cloned from https://github.com/larrystevenwise/krping > Top commit 292a2f1abf0348285e678a82264740d52e4dcfe4 > > List of userspace sources used: > =============================== > > 1) rdma-core was cloned from https://github.com/linux-rdma/rdma-core.git > Top commit d65138ef93af30b3ea249f3a84aa6a24ba7f8a75 > > 2) OpenSM was cloned from git://git.openfabrics.org/~halr/opensm.git > Top commit 85f841cf209f791c89a075048a907020e924528d > > 3) libibmad was cloned from git://git.openfabrics.org/~iraweiny/libibmad.git > Tag 1.3.13 with some additional patches from Mellanox. > > 4) infiniband-diags was cloned from git://git.openfabrics.org/~iraweiny/infiniband-diags.git > Tag 1.6.7 with some additional patches from Mellanox. > > NOTES: > ====== > > 1) The mthca driver has been removed in kernel and in userspace. Are there non-trivial interoperability issues between mthca and the updated OFED stack? If so, could you describe them? If not, I would strongly prefer to retain the mthca driver, as Isilon still has plenty of hardware making use of it. > 2) All GPLv2 only sources have been removed and where applicable > rewritten from scratch under a BSD license. > 3) List of fully supported drivers in userspace and kernel: > a) iw_cxgbe (Chelsio) > b) mlx4ib (Mellanox) > c) mlx5ib (Mellanox) > 4) WITH_OFED=YES is still required by make in order to build > OFED userspace and kernel code. > 5) Full support has been added for routable RoCE, RoCE v2. > > Sponsored by: Mellanox Technologies From owner-svn-src-head@freebsd.org Fri Nov 24 15:30: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 2C918DE8E1D for ; Fri, 24 Nov 2017 15:30:20 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-wr0-x234.google.com (mail-wr0-x234.google.com [IPv6:2a00:1450:400c:c0c::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 B5E7078B67 for ; Fri, 24 Nov 2017 15:30:19 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-wr0-x234.google.com with SMTP id 55so4399351wrx.0 for ; Fri, 24 Nov 2017 07:30:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nB9upHdxvkRFzgyFNANIz1Liy/AtD5zmVn6rh6uS8k0=; b=rVu00YkyV00dptcMK6CRiwXVqio5nT7mOZgTjgFZLFGD3agQFFRzVAqwY67ubL924L HXVYzXqKM31az+UeGEaimagtbBsx7sC0ZIkor6ijnYvG+uFFuClxKm13xAnKvWAQJzeL paPXtBupovXxJpM6Ko5ZrVYZCIJT8LTVo0yRkFcKPWZHxSzR/TWljsAkfhc2qowr85Tt lSnkZvq+8HkVOEKuzur+1BimKIbNwy6QYU1RzGgUOTm9rTQbUg1DFDTXhB2pNz9Xm3Zl L6zT8Nd5dNg0Ni5dXZvyfSv6dV0t2ksSjDohwXdXAPtcBWHBmzzEV+LMM35xk7xISvxP +gJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nB9upHdxvkRFzgyFNANIz1Liy/AtD5zmVn6rh6uS8k0=; b=Wv8ICSmWzSgjH6dfYWg+4Cfg82ReG28lXUx3brgL/h052ZKvjz6iUwei8gnOhHDNnQ qZ8IPGWVWIemNeAyzK5vpTlPZu1Jamk0Dl7ZsopzrDAfL0+7xTTF7IX0u0CyjQ36y4mG OMaGzj8sO/85mg6/Q1OPxaYcL6W0BOBBFfXjRzBWvml6oAMIvI8trLwlz1Tcdf/5SWQX lHJRq05F2DL+od0SDWZ/xaL+Rt9QsarKEhmHG/E1ez1YmRddxuASmXlwBa18XzewkUou GdnYUz0xKPyJ+4zC330CioITUEnRLrZ/y/L0FmBiXv0XofHh5KygkWh8KvidKNuP7k8O 0bzg== X-Gm-Message-State: AJaThX5EX7JA6ws0/AfpRY95Ypoz4mznZKPXQ5I9iaMrHWJbvw8WClnw iehHKS+6K3a0mkfkLE2CQbUlKw== X-Google-Smtp-Source: AGs4zMZvp+Vooq441/qZmbM6O7ChS4MNg43RLzRTaCE4z+SmF5nwqGtWvfhwnFLhMb3FiUuZhzoWWw== X-Received: by 10.223.166.103 with SMTP id k94mr25126951wrc.22.1511537417387; Fri, 24 Nov 2017 07:30:17 -0800 (PST) Received: from mutt-hbsd (exit1.ipredator.se. [197.231.221.211]) by smtp.gmail.com with ESMTPSA id n143sm19919418wmd.31.2017.11.24.07.30.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 24 Nov 2017 07:30:15 -0800 (PST) Date: Fri, 24 Nov 2017 10:29:54 -0500 From: Shawn Webb To: Wojciech Macek Cc: "Landon J. Fuller" , adrian@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r326109 - in head/sys: conf dev/bhnd dev/bhnd/cores/chipc mips/conf modules/bhnd Message-ID: <20171124152954.2bsg6olctqc6fiqw@mutt-hbsd> References: <201711222310.vAMNAKmb048921@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qlowlqqkn4etpkdr" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT FreeBSD 12.0-CURRENT X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20171027 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 15:30:20 -0000 --qlowlqqkn4etpkdr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 24, 2017 at 10:21:17AM +0100, Wojciech Macek wrote: > Hi, >=20 > The patch breaks the build for ppc64. Could you please add missing > ofw_bus_if.h to the Makefile? >=20 > cc -isystem > /home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tmp/= usr/include > -L/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tm= p/usr/lib > -B/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tm= p/usr/lib > --sysroot=3D/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.po= werpc64/tmp > -B/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/tm= p/usr/bin > -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc > -DHAVE_KERNEL_OPTION_HEADERS -include > /home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/sys/= GENERIC64/opt_global.h > -I. -I/home/wma/ppc64-freebsd/sys -fno-common -g -mlongcall > -fno-omit-frame-pointer > -I/home/wma/ppc64-freebsd/obj/home/wma/ppc64-freebsd/powerpc.powerpc64/sy= s/GENERIC64 > -MD -MF.depend.chipc_gpio.o -MTchipc_gpio.o -mno-altivec -ffreestanding > -fwrapv -fstack-protector -gdwarf-2 -Wall -Wredundant-decls > -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith > -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions > -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas > -Wno-uninitialized -finline-limit=3D15000 -fms-extensions --param > inline-unit-growth=3D100 --param large-function-growth=3D1000 -msoft-float > -mcall-aixdesc -std=3Diso9899:1999 -c > /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c -o > chipc_gpio.o > In file included from /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:4= 0, > from > /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48: > /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:40:24: error: > ofw_bus_if.h: No such file or directory > cc1: warnings being treated as errors > In file included from /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:4= 0, > from > /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48: > /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:71: warning: 'struct > ofw_bus_devinfo' declared inside parameter list > /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:71: warning: its scope > is only this definition or declaration, which is probably not what you wa= nt > /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:72: warning: 'struct > ofw_bus_devinfo' declared inside parameter list > /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:74: error: expected '= =3D', > ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_compat' > /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:75: error: expected '= =3D', > ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_model' > /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:76: error: expected '= =3D', > ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_name' > /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:77: error: expected '= =3D', > ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_node' > /home/wma/ppc64-freebsd/sys/dev/ofw/ofw_bus_subr.h:78: error: expected '= =3D', > ',', ';', 'asm' or '__attribute__' before 'ofw_bus_gen_get_type' > In file included from > /home/wma/ppc64-freebsd/sys/dev/bhnd/cores/chipc/chipc_gpio.c:48: > /home/wma/ppc64-freebsd/sys/dev/gpio/gpiobusvar.h:115: error: field > 'opd_obdinfo' has incomplete type > *** [chipc_gpio.o] Error code 1 >=20 > make[4]: stopped in /home/wma/ppc64-freebsd/sys/modules/bhnd > --- all_subdir_cardbus --- > --- cardbus.o --- > ctfconvert -L VERSION -g cardbus.o > A failure has been detected in another branch of the parallel make We've noticed this in our nightly build system as well. We've implemented a fix here: https://github.com/HardenedBSD/hardenedBSD/commit/76b37deb3a5f2c3aa014efadd= 4e78d748148b884 Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --qlowlqqkn4etpkdr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAloYOu8ACgkQaoRlj1JF bu7IURAArT0XndGE4pociQNs3wi2GJc9AvLv/nWuG28W5jlvUe80XcuI6EWFX639 wqGgTSj4Uyy25paNz0un11KbO/fAqsUgP5ToC8rdsEk7gn1jPGm7hqkRW8TVSMvy 6b3+qIfmibBZdohkWQeSH5XzEdp8VLQIC/26fp1zQ2Wq2xdVRemJCxAnMGLyg3UU Z62y7iUeIKhHloa2/NlPQkaii9xD8ROw1IJ1TPxvIUC7pTroiiH0Gcz8+2q7ZYPB Jj+JIj0a1GmpVheUyZ+rdpBOVHAz0ICPSV8qAXMvJncEK6y3mt//fSkRl3hfMb3c 11spQDY+uXA9Bh66aNgEF6GcgjZ6pSTtvUixPzOtJSChjOGSpqjGaoRPaI/WtpTb Gxxf4ZQ21KLuAOjs6SD778cpBrXRtPlp1l//D65U9sChTQbB2KbjZNI1vbbszQCT tnJZqdZB97JjpjfF0biU3aPol/7vbZwdMsOLbqUSwGGZy5mrUsDfm64RKTgkGlP5 NKQ5V5f3MOpApfyQXTaZWPS5GraDf0SqeT4kNLJaAshVDrfRUhvKL+PccGKwl7XM V4sL+rnKdY2sDQCLJZeri/m7Jv4UqqtC3lzll3urrBdNT2TZ5fYrZTef8KdP+MSv Kal6uCbMbAFJsR+5uszjnIBNQRUGP+Ws5cHmu+Aim0HZJFO3jgI= =+oyc -----END PGP SIGNATURE----- --qlowlqqkn4etpkdr-- From owner-svn-src-head@freebsd.org Fri Nov 24 15:48: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 A8D6CDEA36F; Fri, 24 Nov 2017 15:48:19 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CA8A794E0; Fri, 24 Nov 2017 15:48:19 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAOFmIX2081887; Fri, 24 Nov 2017 15:48:18 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOFmIgU081885; Fri, 24 Nov 2017 15:48:18 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711241548.vAOFmIgU081885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 24 Nov 2017 15:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326171 - in head/sys: arm/xscale/ixp425 contrib/dev/npe X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys: arm/xscale/ixp425 contrib/dev/npe X-SVN-Commit-Revision: 326171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 15:48:19 -0000 Author: nwhitehorn Date: Fri Nov 24 15:48:17 2017 New Revision: 326171 URL: https://svnweb.freebsd.org/changeset/base/326171 Log: Switch the default firmware for npe(4) from the QOS_VLAN one to the plain-vanilla ETH microcode. The QOS_VLAN firmware added support in microcode for handling IEEE 802.1q tags, but the npe(4) driver did not actually support the relevant signalling. As a result, it was impossible to use VLANs with npe(4). Switching to the more basic microcode (same license) removes the on-NIC promisisng and makes vlan(4) work on both NPE interfaces. Ref: https://lists.freebsd.org/pipermail/freebsd-arm/2012-August/003826.html Modified: head/sys/arm/xscale/ixp425/ixp425_npevar.h head/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu Modified: head/sys/arm/xscale/ixp425/ixp425_npevar.h ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_npevar.h Fri Nov 24 14:52:27 2017 (r326170) +++ head/sys/arm/xscale/ixp425/ixp425_npevar.h Fri Nov 24 15:48:17 2017 (r326171) @@ -102,8 +102,8 @@ #define NPE_MAX (NPE_C+1) #define IXP425_NPE_A_IMAGEID 0x10820200 -#define IXP425_NPE_B_IMAGEID 0x01020201 -#define IXP425_NPE_C_IMAGEID 0x02050201 +#define IXP425_NPE_B_IMAGEID 0x01000201 +#define IXP425_NPE_C_IMAGEID 0x02000201 struct ixpnpe_softc; struct ixpnpe_softc *ixpnpe_attach(device_t, int npeid); Modified: head/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu ============================================================================== --- head/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu Fri Nov 24 14:52:27 2017 (r326170) +++ head/sys/contrib/dev/npe/IxNpeMicrocode.dat.uu Fri Nov 24 15:48:17 2017 (r326171) @@ -1,170 +1,127 @@ begin 644 IxNpeMicrocode.dat -M_NWP#1""`@````])``````````\````!```'1`````$```[-`````0``#MT` -M```!```.]0````$```]"`````0``#T4````/````````!S,0`'X0$`#\\!`` -M=*`03KX!!:C\@```^=```';P$`!T`!`"O@$0`H@0$`*"`A`"__X`6(```%B" -M```ZQ?L0``0`$``$$A``18P0`$2'$`*\`A`"__D0`L7T$`+%\Q`"Q?(&,O_Q -M"6R*(`^0P!`/J$`0$`*^`!!$``L!U,```$V'"``MAP0`-8<$`!F'!``AAP0` -M48<$`%V'!!!$?G`!V,``$`&+$1`!DQ$0`9L1!02*4`4H$(`%.!*0!404H`5` -M%K`%;!C`!6@:T!``?A(0`OWU$$@`"PP`P``$`,0`"0R"$`DH2$`0`KX!"01W -M0!`#/@$)C((0":A(0!`"O@$)A'=0$`,^`1!$=/`!Y.``$`*^`1`!O=$0`;G1 -M$`$WT1`!/]$0`'02$`+]^Q``-9`0`KX!$$1^@`>$_``01KX!`?#@`!`!@]$0 -M`8O1$`&:P1!%D](`"/PA$`!^$A`"^?H02.H``@#@```(<8`0`>O/$$P`"P6H -M_(```'X``!!V`!`#?Z$0`H+$$6*"0`$=D`0`,H'$`,V -M!A!$``L`!'8>"37N"!``V@<0 -M`K@&$`&:"A!%R@L``'=@`#':#!"7/A8)*&B`"0VN``DER@@0`9`,$`#D``DD -MHQ`)!)$1$`'0#!``T4`0`=`.$`&*$Q`#/U801``+``!W8!"7/@$%%(0@$`&: -M!Q`!DB$0`8H@$``$L!""OT<%%(0@$`'*"!`!DB$0`8H@$(%4!!`!5@T0`4@% -M$`!(`!`!T`40`9IB$`&281`!V@\0`9I@$`'2#A`!K&80`=H-$$24D!`@[`<0 -M`K9A$$1J``#`[`<0`&L>$`$H#1`!:@<0`&E&$`*X01`!I`@0`,2`$`/`X!`! -MJB$0`:(@$`"55Q``FQT0`K94$`#$3Q``Q!H0`:HA$`&B(!``E5<0`)L=$`*V -M31``Q$\0`,0:$`&J(1`!HB`0`)57$`";'1`"MD80`,1/$`#$&A`!JB$0`:(@ -M$`"55Q``FQT0`K8_$`#$3Q``Q!H0`:HA$`&B(!``E5<0`)L=$`*V.!``Q$\0 -M`,0:$`&J(1`!HB`0`)57$`";'1`"MC$0`,1/$`#$&A`!JB$0`:(@$`"55Q`` -MFQT0`K8J$`#$3Q``Q!H0`:HA$`&B(!``E5<0`)L=$`*V(Q``Q$\0`,0:$`&J -M(1`!HB`0`)57$`";'1`"MAP01``+`!QI\!`!:`00`%-`$`%2!A`!$@T0```+ -M$`!3(Q`!4@P0`.P`$`'L!Q``4``0`5`)$`*^W1``4``0`5`)$`!N)A`"N`,0 -M`6P$$`+_\A`!$@80```+$`!2A!`!4@80`O_M$`&L:!`"_Y\0`%-`$`%2!A`` -M;D80`OGP$`&;8Q!$12`0(-@'$$:XQ?_\U<`0`9MA$`!$`!`!$``0`&Z&$`*V -M!1``4!80`K@#$`!%(!``U$$0`40,$`':'Q`!$@801``+``!2C!`!4@801$0` -M$!S9-Q!&MK`0)-EW$$:VK@#`V`<01KJH``A28!!$$'``!%'S$``2@A``4``0 -M`=`)$`':'Q`!1!L0`%'P$``1@0$`&2#A`!F@\0`)"P$`"4T!`!TAH01=P6`XCD`!``4``0`!-@$`#0 -M.A``I)$0`:K@$`&:X1``D7`0`>@1$`!K(!``E-`0`=(9$`%X($`!W0!`!!@D01$0```!'@0D' -M/D(``-6!$`'4!Q`!XAH0`>@6$`&2!1````L0`-`4$$72%@-@Y``0`%``$``3 -M8!``T#H0`*21$`&2X!`!J.(0`=(7$$7H$`.(Y``0`%``$``38!``T#H0`*21 -M$`&JX!`!FN$0`)%P$`'H$1``E-`0`5P$$`'2&1`!D@X0`9H/$`"0L!``E-`0 -M`=(<$`'<&A``:S`016H'``1W,!`#``$011`)``!IX`DH*($3":X("26V&`DE -MMAP));X`"26^!`DEO@@));X,"26^$!`!F!H0`-P`"22:T!``4`<0`K8%$`!1 -MZA``4`D0`#"`"23:``D][@@0`'=`$`$&"1!$1````$>!"0<^`1`!(`P01:@) -M`]SEH!``A5$0`<0."2@K4`D-K@@0`$V&$):X$PDX("0<^)@DP, -M$`%H!Q`!H@L)*&A`$`!F!!,)IB`))*,0"01W0!`#?B8#]-'`$`&B@!`!*`80 -M`.(1$`'B@!``Z@`0`8H+$`'J"Q`![`P0`6@'$`+^(1``1400`KY&$):@RP40 -MC"`0`$0`$`!!A!`!B&$0`08(!C7'1`8TDB`&-)H@$`'341`!D!\0`=M1$`!1 -M^A``$*80`KBJ$$6@`@-`T(`0`\#`$`&J@1`!HH`0`)M7$`"5/1`"MB(0`-!/ -M$$30&@-`T`(0`:J!$`&B@!``FU<0`)4]$`*V&A``T$\01-`:`T#0`A`!JH$0 -M`:*`$`";5Q``E3T0`K82$`#03Q!$T!H#0-`"$`&J@1`!HH`0`)M7$`"5/1`" -MM@H0`-!/$$30&@-`T`(0`:J!$`&B@!``FU<0`)4]$`*V`A``8AP0`9`?$`&: -M71``(H40`&(6$`*X?A`!E%P03``+`##8!QA`W`T``-0-$`+WO!``4A80`KA[ -M!C2:(!`!HAT0`*K0$$0;/!`@V`<0`\#`$`*V=A`!H!D0`>M1$`'@8A``U``0 -M`'#`!C7'1!`"OC`0`K9N$`!%)!`!FAP0`-1`$`'<8A`!VU$0`>M1$`!PL`8U -MQT00`KXF$`+Y[Q`"N&,0`&?Z$``E7A``U#@0`'#0!C7'1!`!JE,0`KX,$`+Y -MYA`"^>T0`KA9$`!%)!``9_H0`"5>$`#4`!`!VU$0`'#`!C7'1!`!JE00`=QB -M$$6@``'\W?80`K@#$`"@]!`!X&(02*#P`@#0``'\W8,0`-WJ$`"0\1`!)H`0 -M`&)S$`!B0A``)QH0`&:&$`*V0A`!9&`01=0>`0#H!Q!&N`,``$1$$`*^#1#8 -MZ=<0`K@+$`!$A!`"O@D0EJ!"!1",(!``08P0`8AA$`!Q$`8UQT00`$82$`*V -M-!`"E@,0`41G!5-_]A`!J`,&#)(@!A"((!``T?H01(B5`/S)\P8NN!`0`*B7 -M$`*Z*A!$110"&-7&$`*X#!`!K!X0`%0S$``$I!"51&<0`)%Q!5%281``0880 -M`WE6$`%08!`#?U00`-44$`!!AA`"N`401``+``!%-!"4``L%441G$`#5ZA`` -MU$80FK8S!B*^,A``27`0`KX$$`!)@!``4?H0`$F>$`!$-!`"OA40`$E`$`*^ -M$Q``25`0`KX1$`!)8!`"O@\0`$D@$`*^#1``23`0`KX'$`!),!`"OB,0`$D0 -M$`!$-!`"O@80`$D0$$0`"P``1300E``+!5%$9Q!$``L`'$?P!C1&$@8T<.`& -M-``+$`*^`1`"E@(0`WW[!@R2(!`"O`(&(KX*$`!@,!``(",&+&`W$`*V!A!$ -M``L"&-7&$`*X"1"4190%441G$`#5ZA"8%$0%$(P@$```"P51U&`0`W\4$$0` -M"P``1300E``+!5%$9Q``U180`O?U!B+_]`44D"`0```+$$F@@`/PT,``A.5P -M!4RE$Q!&M@<``.53$$CE%Q_\Y2\#\.1!$`$@X!`"O@4`'&$#$`-W\A``8>H0 -M`&"!$``3`1``4`D0`:J`$```"Q``ZA$0`>J`$`-_Z1``=B``MP0!$`&2P1`! -MFL`0`>3#$)"E$`5`4$`0`2RE$("@L``^N`(`$``+$(!?XQ!%V@$``'?0$`,> -M`1!$=A`%J/P0$`,"`1.-I@0)J%T@$)!W4`F'/@$)M>8`";2*(`FTJB`)M)(@ -M!1"0(`FTFB`0`82!$`#,!Q`"MC@0`,@'$`*V-A``6A80`KFX$$5:#``H0`&`'$`*V`Q``,0`)M``+ -M";7^!`FU_@@)M?X,$`&@$Q`!I!00`:@5$`&L%A`"O@80`&'J$``Q``FT``L) -MM*(@";2J(!"0A-$0`-(`$$1D-Q54X*T01KA$`!SIAQ``9@T01K8M$!SM-Q!& -MMC\0).UW$$:V/1````L01KXG$`#,0A`!(`P)M)(@";7F*`FUQR0)M<4Q$`'I,1`![3$%$)`@":RJ(!`` -MX@`0`28,$`',@!!(JQ$``.O!`!C,X!!$C-$`!,A""8WJ'Q""N*T0`KZ9";6: -M'0FTT@`)M<0^$`$@#!`!Z#\0`&`'$`*V&Q``8"80`K82$`!@(A``8>H0 -M`&`'$`*V`Q``,0`)M``+$`"$T0FU_@0)M?X(";7^#!`!K!(0`:`3$`&D%!!% -M["$55.RG$`&H%Q`"_]80`&'J$`!@$A``8`<0`K8#$``Q``FT``L)M*H@";2B -M(`FTA-$01>PA%53LIPFTJB`0`O_)'_S,@1``C-$0`)QW$`*ZC!`!Z3$0`-(6 -M$`*X)@40D"`)K*H@$`#B`!`!)@P0`H?$(*X.1`"OB4``,WB$`'-,1``C-$0`,SA$`"<=Q`"NG80`-(6$`*X#@40 -MD"`)K*H@$`#B`!`!)@P0`()C>H?$(*X -M)!`"OA`0`,0A$`'C,1`!Z3$%$)`@":RJ(!``X@`0`28,$`',@!!(JQ$`!.HA -M`!C,X!!$C-$`!,BB"8WJ'Q""N!03C:8`":A$`'L'0FL0`#$@";7'Q`"T#W$0 -M`KH*$)!/0A``3!$0`K8&$`!,1Q`"N`40`'`P!5!,``5`8!`%4$P2$(")H5$`+_[Q`!JA80@``+`+3J$1`!ZA80 -M`O_J!BLX`0"H=R`0DSX!!124(!``4$`0`8"@$`&$H1``D!<&&)`>$`!W$`5, -M<1`&)8`#G:@!`!A",0`%X:$`!>XQ!%7H4#S-0`$``6\1`` -MI!`0`K8)$``,]Q`"N@<0`:"@$```"Q`!I,,0`=##$`'D@Q`"O@00``SP$`'` -M@Q``@)`0`1KE$`#@`!!$H3<`'%ON$``>TA``7_H0`##P$`'1OQ``Q!<01``+ -M``1V(!`#?=8`%'8P$`-_^P8(JB`01``+`\SA0!``D7`0`W?\$`#L%A`"M@40 -M`9K)!C``"Q``VA$0`=K)$$6:P@`@-$`'J!Q!&_^80`>H%$`!,`!`!#@$0`,@`$`#,2A`` -MS"H01O??$`(^R1!&_]T0`>H%$`"=,!!,R```',TP`!S1,`/@U4`0`!Q`"^>X02!Q`"^=\01O^I$``, -MT!``#,(0`$Q*$`!W4!``#F`0`$TG$`!/+A``DI40`#!P$`'341``#'(0`WGY -M$$;_G`/PR,`01>H%``3-0!`"/H,02``+``3,P`/,R4`0`CY_$`$@!!``3M`0 -M`&!7$$;YD`/PR,`0`-(`$``PQ!$`%J1!`!:$40 -M1O\W`_C(H%`T#(`!!&/B40`:(!$`#<`!!('R``4-@0`_C) -M0!``F/(0`=E0$$;_'@/@R8`0`>I`$$;_&Q````L01O\9`]C(H!`!9D`01O\6 -M$`'D`1!$``L`!'0!$$0`"P`$ -M=S`0@SX!"0VF%``HY4`0`*1W"2@F?@D$C3(0`'=`"3WF%!`#/@$).*8`$`#, -M%Q``,3`)-<=$`#&D`1`"_?`0`\#@$$;_`1!&_P001O\'$$;_#Q!&_T\01O]: -M$$;_8A!&_VD01O]V$$;_>Q!&_Y@01O^E$$;_K!!&_[`01O^R$$;_PA!&_\00 -M1O]W$$;_>A!&_W<01O[:$$;_P1````L0```+````````!X<````````````` +M_NWP#0$``@$```NL``````````L````!```%7@````$```MB`````0``"Z(` +M```!```+I0````\````````%41``?A`0`/SP$`!TH!!.O@$%J/R```#YT``$ +M=G`0`'0`$`*^`1"$``L0`H@/$`+!_A`"Q?T0`H8#$`*"`A`"__H`6(``$(@` +M"Q`"P?<0A$&'$`*V`A`"__00```+`"@`"P`2__$);(H@#Y#`$`^H0!`0`KX` +M$$0`"P'4P```38<(`"V'!``UAP0`&8<$`"&'!`!1AP0`78<$$$1^<`'8P``0 +M`8L1$`&3$1`!FQ$%!(I0!2@0@`4X$I`%1!2@!4`6L`5L&,`%:!K0$`!^$A`" +M_?402``+#`#```0`Q``)#((0"2A(0!`"O@$)!'=`$`,^`0F,@A`)J$A`$`*^ +M`0F$=U`0`SX!$$1T\`'DX``0`KX!$`&]T1`!N=$0`3?1$`$_T1``=!(0`OW[ +M$``UD!`"O@$01'Z`!X3\`!!&O@$!\.``$`&#T1`!B]$0`9K!$$63T@`(_"$0 +M`'X2$`+Y^A!(Z@`"`.````AQ@!`!Z\\03``+!:C\@```?@``$'8`$`-_H1`! +MRAT0`KX#`##J`!`!Z@D018H'``!V8!``R@<0`S8&$$0`"P``=H`0`P`!$`!W +M0``JO@D01``+``!V@!`#``$)*&A`$PF^$!``=T`)!SX!"32*(`DH:,`)#(I0 +M"0<^`1`!F@D0`:(%"37F'`DUYA8)->X`$`#:!Q`"N`80`9H($$7*"0``=]`` +M,=H*$)<^%@DH:(`)#:88"27*!A`!D`@0`.0`"22C$`D$D1$0`=`($`#10!`! +MT`H0`8H=$`,^E!!$``L``'?0$)<^`044A"`0`9H%$`&2(1`!BB`0``2P$(*^ +MA044A"`0`@0`&X6$`+WYA``;B00`6XG$`!2`!`!4@(0`9H%$`$$"1``V4$0`)S7$`+[ +M01!%V`H``':`$`,``0DH:4`3":X`$)1Q$`DEAV0)!'=`"3WN``5//@$0@$46 +M`#+W91``:#`0`"@C$`!H-Q`"MDT0`$6&$`*X1Q!%*`,`&$3S$``%1!`!D`,0 +M`40#$$11XP,,Q$`0`%'J$``&@1``1`D`))(@$`&8(A`!D`@0`!;``""2D!`` +M``L0```+$`%:!!`!R`D01JXM``#0!Q`"N`T0`<@("2AI(!,)IA@));X8"26F +M$`DEK@@)):8`"26F!`DEK@P)):X0"26N%`D'/A40`(B2$`'("`DH:(`3":88 +M"26^&`DEIA`)!SX!$$6:"0``::`)*"E`"0S:80D<["`)):80"26N"`DEI@`) +M):8$"26N#`DEKA`)):X4"0<^`1``Z@`0`>P($`%H`Q`!H@D)*&A`$`!F%!,) +MIB`))*,0"01W0!`#?O$#&-'`$`&B@!`!*`(0`.(1$`'B@!`"O@40`2@"$``` +M"Q``:880`OFW$`#J`!`!B@D0`>H)$`'L"!`!:`,0`O[G$`!%1!`"OE40EJ+D +M!1",(!``1``0`$&$$`&(81`!!@@&-<=$!C22(`8TFB`0`=-1$`&0'Q`!VU$0 +M`%'Z$``0IA`"N,,01:`"`L#0@!`#P,`0`:J!$`&B@!``FU<0`)4]$`*V(A`` +MT$\01-`:`L#0`A`!JH$0`:*`$`";5Q``E3T0`K8:$`#03Q!$T!H"P-`"$`&J +M@1`!HH`0`)M7$`"5/1`"MA(0`-!/$$30&@+`T`(0`:J!$`&B@!``FU<0`)4] +M$`*V"A``T$\01-`:`L#0`A`!JH$0`:*`$`";5Q``E3T0`K8"$`!B'!`!D!\0 +M`9I=$``BA1``8A80`KB7$`&J'A`!E%P0`&@6$`*X#1``6!80`K8)$`#B"!`` +ME3<0`)L=$`*V!Q``+K,0`"UW$`*XGQ`"O@,0`!=7$`*XG!!,``L`,-@'&$#< +M#0``U`T0`O>M$`!2%A`"N(40`:`!$`#0@!`#P,`0`:*!$`&J@!``E1<0`)M= +M$`*V/!``T$\0`-`:$`&B@1`!JH`0`)47$`";71`"MC40`-!/$`#0&A`!HH$0 +M`:J`$`"5%Q``FUT0`K8N$`#03Q``T!H0`:*!$`&J@!``E1<0`)M=$`*V)Q`` +MT$\0`-`:$`&B@1`!JH`0`)47$`";71`"MB`0`-!/$`#0&A`!HH$0`:J`$`"5 +M%Q``FUT0`K89$`#03Q``T!H0`:*!$`&J@!``E1<0`)M=$`*V$A``T$\0`-`: +M$`&B@1`!JH`0`)47$`";71`"M@L0`-!/$`#0&A`!HH$0`:J`$`"5%Q``FUT0 +M`K8$$`!D"!`!9&80`KX$$`%D9A``91<0`K9%$`!PT`8UQT00`:I3$`!E$!!% +M9&`!`.@'$$:X`P``1$00`KX-$-CIUQ`"N`L0`$2$$`*^"1"6HD`%$(P@$`!! +MC!`!B&$0`'$0!C7'1!``1A(0`K8R$`*.`Q`!1&<%4W_V$`&H`P8,DB`&$(@@ +M$`#1^A!$B)4`_,GS!BZX#A``J)<0`KHH$$1%%`(8U<80`K@*$`!4,Q``!*00 +ME41G!5%281``0880`WD]$`%08!`#?SL0`-44$`!!AA`"N`401``+``!%-!"4 +M``L%441G$`#5ZA``U$80FK8S!B*^,A``27`0`KX$$`!)@!``4?H0`$F>$`!$ +M-!`"OA40`$E`$`*^$Q``25`0`KX1$`!)8!`"O@\0`$D@$`*^#1``23`0`KX' +M$`!),!`"OB,0`$D0$`!$-!`"O@80`$D0$$0`"P``1300E``+!5%$9Q!$``L` +M'$?P!C1&$@8T<.`&-``+$`*^`1`"C@(0`WW[!@R2(!`"O`(&(KX*$`!@,!`` +M(",&+&`W$`*V!A!$``L"&-7&$`*X"1"4190%441G$`#5ZA"8%$0%$(P@$``` +M"P51U&`0`W[[$$0`"P``1300E``+!5%$9Q``U180`O?U!B+_]!!(``L`'$?P +M``!V,`8T1A(&-'#@!C0`"Q`"O@$0`HX"$`-]^Q!$``L`!';0$`,^`1"4``L% +M$(P@$$@`"P``=C```$4P!5%$9Q"(``L`,``+$`*\`@8@``L0`W[=!120(!`` +M``L02:"``Q30P`"$Y7`%3*43$$:V!P``Y5,02.47'_SE+P,4Y$$0`2#@$`*^ +M!0`<80,0`W?R$`!AZA``8($0`!,!$`!0"1`!JH`0```+$`#J$1`!ZH`0`W_I +M$`!VH`"W!`$0`9+!$`&:P!`!Y,,0D*40!4!00!`!+*40@*"P`#ZX`@`0``L0 +M@%_C$$7:`0`$=L`0`R`!$$1VD`6H_!`0`P(!$XVF!`FH72`0D'=0"8<^`0FU +MY@`)M(H@";2J(`FTDB`%$)`@";2:(!`!A($0`>H?$`#,!Q`"MA`0`,@'$`*V +M#A`!G!L)C*M0$`"<=Q`"NGH0`)QP$`!=A!`!W(`0`(AW$`"(?A``C%(0`R`$`#-P!`"OA03 +MC:8`":A$`'L'0F +M$`!W$`5,<1`&)8&A``7N,015Z%`OC4`!``%O$0`*00$`*V"1`` +M#/<0`KH'$`&@H!````L0`:3#$`'0PQ`!Y(,0`KX$$``,\!`!P(,0`("0$`$: +MY1``X``01*$W`!Q;[A``'M(0`%_Z$``P\!`!T;\0`,07$$0`"P``=D`0`WW6 +M`!1VL!`#?_L&"*H@$$0`"P+XX4`0`)%P$`-W_!``[!80`K8%$`&:R08P``L0 +M`-H1$`':R1!%FL(`'-&#$`#1AQ`"N`,0`-H1$`':PA!%FL8`(.P&$`*V`Q`` +MVA$0`=K&$`#L)A!&N`X`#.V&$`-WYQ`!FL`0`.UV$`*V!A`!FL$0```+$`#: +M$1`!VL$0`W_?$`#:$1`!VL`0`W_<$`&:PP8P[$80`K8$$`#:$1`!VL,0`W_6 +M$$6:Q``,[880`K8$$`#:$1`!VL00`W_0$$6:Q0`@[`80`WG-$`#:$1`!VL40 +M`W_*$$0`"P``R7`0`SX!$`$44!`!%E@0`%0L$`!6+!`!5%`0`598$`$40!`! +M%D@0`%0L$`!6+!`!5$`0159(`P#1L!`!D9`0`,DA$`"05Q`#??``,W_L``!W +M(!`#/@$/A:8$$`,^`0^%I@@01``+``!W$!`#/@$/B>8$$`,^`1`!H@$/B*H@ +M$$1@&@+LT0`0`!,!$`!0"1`!D9`0`>H"$$?`@!`!D@00```+$`'2`A!&_^H0 +M`>0,$`'H#1`!Z@<01O_F$`'J!1``3``0`0X!$`#(`!``S$H0`,PJ$$;WWQ`" +M/J$02'XP``1V0`,`U;`0`H%$`"=,!!,R```0,V``!S1 +MP`,$U8`0`!Q`"^>X02 +M!Q`"^=\01O^D$``,T!``#,(0`$Q*$`!W4!``#F`0`$TG$`!/+A``DI40`#!P +M$`'341``#'(0`WGY$$;_EP,4R,`01>H%``3-0!`"/E802``+``3,P`+XR4`0 +M`CY2$`$@!!``3M`0`&!7$$;YBP,4R,`0`-(`$``PM0$$;_0!$$0`"P``=H`0@SX!"0VF%``HY4`0`*1W"2@F?@D$C3(0`'=`"3WF +M%!`#/@$).*8`$`#,%Q``,3`)-<=$`#&D`1`"_?`0`\#@$$;_*1!&_RP01O\O +M$$;_/!!&_WP01O^'$$;_CQ!&_P\01O\.$$;_#1!&_PP01O^O$$;_"A!&_[40 +M1O^W$$;_!Q!&_P801O\%$$;_DA!&_P,01O^-$$;_P1!&_X<0`'3@$$:^`0`0 +M=C`0`'3P$$:^`0`0=\`0`#60$`*^`1"`=I`0`P(!$$0`"P,@T8`3C::`":A8 +M0`FDVA`)A'=0$`,^`0"T``L01``+``!W(!`#/@$0A``+`#@`"Q!$``L#(-'` +M#X6'A!`#/@$/A8>`$$0`"P`(=N`0`SX!$`!TX!!*O@$`4/D0``AW0!``=/`0 +M2KX!`'#X8``(=L`0`#60$$:^`0+\T<`0`9J`$(@`"P`HVA$0A=J``#@`"Q!$ +M``L`"';@$`-_SQ````L0```+````````!@(````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` @@ -247,14 +204,21 @@ M````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````!````````!B? +M&X0``````````!B?&X3_____```````````````````````?`7H`$0`````` +M```_`7,`,P`````````O`7``(@`$```````````````````````````````` +M`````````````````````````````````````"U"`V<<`2U$`80#``%!`L(* +M`"U#`&T&`"U``Z,$`"U(``"``"U'!1U.`2U%!!X2``````"``#6"`]!\`#6& +M`J@>!@````"```````"````/``"``#6&!`=D`P`/`````0``$``7P```&`P1 +M`````````!$``````!@L````````&.P````````8^````````!BL```````` M```````````````````````````````````````````````````````````` -M1````````!>?&H0``````````!>?&H3_____```````````````````````? -M`>(`$0`````````_`=L`,P`````````O`=@`(@`$```````````````````` -M`````````````````````````````````````````````````"U"!6P5`2U$ -M`DHP``%!`U@"`"U#`&TD`"U`!9`B`"U(``"````/``"``"U%!@LO``````"` -M`#6"!;U\`#6&`SX7!@````"```````"````/``"``#6&!?1,`P`/`````0`` -M%``>8```'KP5`````````!4``````!\$````````']`````````?W``````` -M`!^,```````````````````````````````````````````````````````` +M````````````````````````````````````````````$`@````````0$``` +M`````!`8````````$"`````````0*````````!`P````````$#@````````0 +M0````````!!(````````$%`````````06````````!!@````````$&@````` +M```0<````````!!X````````$(`````````0B````````!"0````````$)@` +M```````0H````````!"H````````$+`````````0N````````!#````````` +M$,@````````0T````````!#8````````$.`````````0Z````````!#P```` +M````$/@````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` @@ -278,13 +242,6 @@ M````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` -M`````````````````````````````````````````!0(````````%!`````` -M```4&````````!0@````````%"@````````4,````````!0X````````%$`` -M```````42````````!10````````%%@````````48````````!1H```````` -M%'`````````4>````````!2`````````%(@````````4D````````!28```` -M````%*`````````4J````````!2P````````%+@````````4P````````!3( -M````````%-`````````4V````````!3@````````%.@````````4\``````` -M`!3X```````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` @@ -295,8 +252,142 @@ M````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` +M````````````````````````````$0```!%````1@```$<```!(````20``` +M$H```!+````3````$T```!.````3P```%``````````40````````!2````` +M````%,`````````5`````````!5`````````%8`````````5P``````$+P0S +M!#<$102&!(8$FP0X`$`#:!Q`"N`80`9H($$7*"0``=]``,=H*$)<^ +M%@DH:(`)#:88"27*!A`!D`@0`.0`"22C$`D$D1$0`=`($`#10!`!T`H0`8H= +M$`,^E!!$``L``'?0$)<^`044A"`0`9H%$`&2(1`!BB`0``2P$(*^A044A"`0 +M`@0`&X6 +M$`+WYA``;B00`6XG$`!2`!`!4@(0`9H%$`$$"1``V4$0`)S7$`+[01!%V`H` +M`':`$`,``0DH:4`3":X`$)1Q$`DEAV0)!'=`"3WN``5//@$0@$46`#+W91`` +M:#`0`"@C$`!H-Q`"MDT0`$6&$`*X1Q!%*`,`&$3S$``%1!`!D`,0`40#$$11 +MXP,,Q$`0`%'J$``&@1``1`D`))(@$`&8(A`!D`@0`!;``""2D!````L0```+ +M$`%:!!`!R`D01JXM``#0!Q`"N`T0`<@("2AI(!,)IA@));X8"26F$`DEK@@) +M):8`"26F!`DEK@P)):X0"26N%`D'/A40`(B2$`'("`DH:(`3":88"26^&`DE +MIA`)!SX!$$6:"0``::`)*"E`"0S:80D<["`)):80"26N"`DEI@`)):8$"26N +M#`DEKA`)):X4"0<^`1``Z@`0`>P($`%H`Q`!H@D)*&A`$`!F)!,)IB`))*,0 +M"01W0!`#?O$#&-'`$`&B@!`!*`(0`.(1$`'B@!`"O@40`2@"$```"Q``:880 +M`OFW$`#J`!`!B@D0`>H)$`'L"!`!:`,0`O[G$`!%1!`"OE40EJ+D!1",(!`` +M1``0`$&$$`&(81`!!@@&-<=$!C22(`8TFB`0`=-1$`&0'Q`!VU$0`%'Z$``0 +MIA`"N,,01:`"`L#0@!`#P,`0`:J!$`&B@!``FU<0`)4]$`*V(A``T$\01-`: +M`L#0`A`!JH$0`:*`$`";5Q``E3T0`K8:$`#03Q!$T!H"P-`"$`&J@1`!HH`0 +M`)M7$`"5/1`"MA(0`-!/$$30&@+`T`(0`:J!$`&B@!``FU<0`)4]$`*V"A`` +MT$\01-`:`L#0`A`!JH$0`:*`$`";5Q``E3T0`K8"$`!B'!`!D!\0`9I=$``B +MA1``8A80`KB7$`&J'A`!E%P0`&@6$`*X#1``6!80`K8)$`#B"!``E3<0`)L= +M$`*V!Q``+K,0`"UW$`*XGQ`"O@,0`!=7$`*XG!!,``L`,-@'&$#<#0``U`T0 +M`O>M$`!2%A`"N(40`:`!$`#0@!`#P,`0`:*!$`&J@!``E1<0`)M=$`*V/!`` +MT$\0`-`:$`&B@1`!JH`0`)47$`";71`"MC40`-!/$`#0&A`!HH$0`:J`$`"5 +M%Q``FUT0`K8N$`#03Q``T!H0`:*!$`&J@!``E1<0`)M=$`*V)Q``T$\0`-`: +M$`&B@1`!JH`0`)47$`";71`"MB`0`-!/$`#0&A`!HH$0`:J`$`"5%Q``FUT0 +M`K89$`#03Q``T!H0`:*!$`&J@!``E1<0`)M=$`*V$A``T$\0`-`:$`&B@1`! +MJH`0`)47$`";71`"M@L0`-!/$`#0&A`!HH$0`:J`$`"5%Q``FUT0`K8$$`!D +M"!`!9&80`KX$$`%D9A``92<0`K9%$`!PT`8UQT00`:I3$`!E(!!%9&`!`.@' +M$$:X`P``1$00`KX-$-CIUQ`"N`L0`$2$$`*^"1"6HD`%$(P@$`!!C!`!B&$0 +M`'$0!C7'1!``1A(0`K8R$`*.`Q`!1&<%4W_V$`&H`P8,DB`&$(@@$`#1^A!$ +MB)4`_,GS!BZX#A``J)<0`KHH$$1%%`(8U<80`K@*$`!4,Q``!*00E41G!5%2 +M81``0880`WD]$`%08!`#?SL0`-44$`!!AA`"N`401``+``!%-!"4``L%441G +M$`#5ZA``U$80FK8S!B*^,A``27`0`KX$$`!)@!``4?H0`$F>$`!$-!`"OA40 +M`$E`$`*^$Q``25`0`KX1$`!)8!`"O@\0`$D@$`*^#1``23`0`KX'$`!),!`" +MOB,0`$D0$`!$-!`"O@80`$D0$$0`"P``1300E``+!5%$9Q!$``L`'$?P!C1& +M$@8T<.`&-``+$`*^`1`"C@(0`WW[!@R2(!`"O`(&(KX*$`!@,!``(",&+&`W +M$`*V!A!$``L"&-7&$`*X"1"4190%441G$`#5ZA"8%$0%$(P@$```"P51U&`0 +M`W[[$$0`"P``1300E``+!5%$9Q``U180`O?U!B+_]!!(``L`'$?P``!V,`8T +M1A(&-'#@!C0`"Q`"O@$0`HX"$`-]^Q!$``L`!';0$`,^`1"4``L%$(P@$$@` +M"P``=C```$4P!5%$9Q"(``L`,``+$`*\`@8@``L0`W[=!120(!````L02:"` +M`Q30P`"$Y7`%3*43$$:V!P``Y5,02.47'_SE+P,4Y$$0`2#@$`*^!0`<80,0 +M`W?R$`!AZA``8($0`!,!$`!0"1`!JH`0```+$`#J$1`!ZH`0`W_I$`!VH`"W +M!`$0`9+!$`&:P!`!Y,,0D*40!4!00!`!+*40@*"P`#ZX`@`0``L0@%_C$$7: +M`0`$=L`0`R`!$$1VD`6H_!`0`P(!$XVF!`FH72`0D'=0"8<^`0FUY@`)M(H@ +M";2J(`FTDB`%$)`@";2:(!`!A($0`>H?$`#,!Q`"MA`0`,@'$`*V#A`!G!L) +MC*M0$`"<=Q`"NGH0`)QP$`!=A!`!W(`0`(AW$`"(?A``C%(0`R`$`#-P!`"OA03C:8`":A< +MP`F$=U`0`SX!$`&8'`FUY@`)M(@@";7^'!``R`<`MO?W$`"(UQ``B-X0`)A2 +M$$78'``$=L`0`R`!$`!VD!`#`@$3C;X<$$6J'P`@R`<0`KH.$``M$`'L'0F$`!W$`5, +M<1`&)8&A``7N,015Z%`OC4`!``%O$0`*00$`*V"1``#/<0`KH' +M$`&@H!````L0`:3#$`'0PQ`!Y(,0`KX$$``,\!`!P(,0`("0$`$:Y1``X``0 +M1*$W`!Q;[A``'M(0`%_Z$``P\!`!T;\0`,07$$0`"P``=D`0`WW6`!1VL!`# +M?_L&"*H@$$0`"P+XX4`0`)%P$`-W_!``[!80`K8%$`&:R08P``L0`-H1$`': +MR1!%FL(`'-&#$`#1AQ`"N`,0`-H1$`':PA!%FL8`(.P&$`*V`Q``VA$0`=K& +M$`#L)A!&N`X`#.V&$`-WYQ`!FL`0`.UV$`*V!A`!FL$0```+$`#:$1`!VL$0 +M`W_?$`#:$1`!VL`0`W_<$`&:PP8P[$80`K8$$`#:$1`!VL,0`W_6$$6:Q``, +M[880`K8$$`#:$1`!VL00`W_0$$6:Q0`@[`80`WG-$`#:$1`!VL40`W_*$$0` +M"P``R7`0`SX!$`$44!`!%E@0`%0L$`!6+!`!5%`0`598$`$40!`!%D@0`%0L +M$`!6+!`!5$`0159(`P#1L!`!D9`0`,DA$`"05Q`#??``,W_L``!W(!`#/@$/ +MA:8$$`,^`0^%I@@01``+``!W$!`#/@$/B>8$$`,^`1`!H@$/B*H@$$1@&@+L +MT0`0`!,!$`!0"1`!D9`0`>H"$$?`@!`!D@00```+$`'2`A!&_^H0`>0,$`'H +M#1`!Z@<01O_F$`'J!1``3``0`0X!$`#(`!``S$H0`,PJ$$;WWQ`"/J$02'XP +M``1V0`,`U;`0`H%$`"=,!!,R```0,V``!S1P`,$U8`0 +M`!Q`"^>X02!Q`"^=\0 +M1O^D$``,T!``#,(0`$Q*$`!W4!``#F`0`$TG$`!/+A``DI40`#!P$`'341`` +M#'(0`WGY$$;_EP,4R,`01>H%``3-0!`"/E802``+``3,P`+XR4`0`CY2$`$@ +M!!``3M`0`&!7$$;YBP,4R,`0`-(`$``PM0$$;_0! +M$$0`"P``=H`0@SX!"0VF%``HY4`0`*1W"2@F?@D$C3(0`'=`"3WF%!`#/@$) +M.*8`$`#,%Q``,3`)-<=$`#&D`1`"_?`0`\#@$$;_*1!&_RP01O\O$$;_/!!& +M_WP01O^'$$;_CQ!&_P\01O\.$$;_#1!&_PP01O^O$$;_"A!&_[401O^W$$;_ +M!Q!&_P801O\%$$;_DA!&_P,01O^-$$;_P1!&_X<0`'3@$$:^`0`0=C`0`'3P +M$$:^`0`0=\`0`#60$`*^`1"`=I`0`P(!$$0`"P,@T8`3C::`":A80`FDVA`) +MA'=0$`,^`0"T``L01``+``!W(!`#/@$0A``+`#@`"Q!$``L#(-'`#X6'A!`# +M/@$/A8>`$$0`"P`(=N`0`SX!$`!TX!!*O@$`4/D0``AW0!``=/`02KX!`'#X +M8``(=L`0`#60$$:^`0+\T<`0`9J`$(@`"P`HVA$0A=J``#@`"Q!$``L`"';@ +M$`-_SQ````L0```+````````!@(````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` @@ -332,187 +423,6 @@ M````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` -M```````````````````````````````````````5````%4```!6````5P``` -M%@```!9````6@```%L```!<````70```%X```!?````8`````````!A````` -M````&(`````````8P````````!D`````````&4`````````9@````````!G` -M``````8X8````````````````@@(````'^P````$`@@(````'_0````(`$2(S -M(C-$5?[M\`T!`@(!```/20`````````/`````0``!T0````!```.S0````$` -M``[=`````0``#O4````!```/0@````$```]%````#P````````3@`!`"O@$0`;W1 -M$`&YT1`!-]$0`3_1$`!T$A`"_?L0`#60$`*^`1!$?H`'A/P`$$:^`0'PX``0 -M`8/1$`&+T1`!FL$019/2``C\(1``?A(0`OGZ$$CJ``(`X```"'&`$`'KSQ!, -M``L%J/R```!^```0=@`0`W^A$`'*$Q`"O@,`,.H`$`'J"Q!%B@D``'9@$`#* -M!Q`#-@801``+``!V@!`#``$0`'=``"J^"1!$``L``':`$`,``0DH:$`3";8( -M$`!W0`D'/@$)-(H@"2AHP`D,BE`)!SX!$`&:"Q`!H@<)->X$"37F'@DU[@@0 -M`-H'$`*X!A`!F@H01(7$`'H$!`!D@X0`9H/$`"0L!``E-`0`=(:$$7<%@.(Y``0`%``$``3 -M8!``T#H0`*21$`&JX!`!FN$0`)%P$`'H$1``:R`0`)30$`'2&1`!7`0016H' -M``!V@!`#``$011`)``!I@`DH*($3":X("26F%`DEMAP));X`"26^!`DEO@@) -M);X,$`!0!Q`"M@40`%'Z$`!0"1``,(`))-H`"3WN"!``=T`0`08)$$1$```` -M1X$)!SY"``#5@1`!U`<0`>(:$`'H%A`!D@40```+$`#0%!!%TA8#8.0`$`!0 -M`!``$V`0`-`Z$`"DD1`!DN`0`:CB$`'2%Q!%Z!`#B.0`$`!0`!``$V`0`-`Z -M$`"DD1`!JN`0`9KA$`"1`)*"B!$PFN"`DE -MMA@));8<"26^``DEO@0));X("26^#`DEOA`0`9@:$`#<``DDFM`0`%`'$`*V -M!1``4>H0`%`)$``P@`DDV@`)/>X($`!W0!`!!@D01$0```!'@0D'/@$0`2`, -M$$6H"0/,#Z,1`$`!1ZA``!H$0`$0)`"22(!`!F"(0`9`, -M$``6P``@DI`0`90'$`%:"!`!*`D0`(BQ$``+01``2`D0`<@-$$:N+0``T`<0 -M`K@-$`'(#`DH:2`3":X`"26V$`DEIA@)):X0"26F!`DEI@@)):X4"26N&`DE -MKAP)!SX5$`"(DA`!R`P)*&B`$PFN``DEMA`)):88"0<^`1!%F@L``&F@"2@I -M0`D,VF$)'.P@"26F&`DEKA`)):8$"26F"`DEKA0)):X8"26N'`D'/@$0`.H` -M$`'L#!`!:`<0`:(+"2AH0!``9A03":8@"22C$`D$=T`0`WXF`_31P!`!HH`0 -M`2@&$`#B$1`!XH`0`.H`$`&*"Q`!Z@L0`>P,$`%H!Q`"_B$0`$5$$`*^1A"6 -MHLL%$(P@$`!$`!``0800`8AA$`$&"`8UQT0&-)(@!C2:(!`!TU$0`9`?$`'; -M41``4?H0`!"F$`*XJA!%H`(#0-"`$`/`P!`!JH$0`:*`$`";5Q``E3T0`K8B -M$`#03Q!$T!H#0-`"$`&J@1`!HH`0`)M7$`"5/1`"MAH0`-!/$$30&@-`T`(0 -M`:J!$`&B@!``FU<0`)4]$`*V$A``T$\01-`:`T#0`A`!JH$0`:*`$`";5Q`` -ME3T0`K8*$`#03Q!$T!H#0-`"$`&J@1`!HH`0`)M7$`"5/1`"M@(0`&(<$`&0 -M'Q`!FET0`"*%$`!B%A`"N'X0`91<$$P`"P`PV`<80-P-``#4#1`"][P0`%(6 -M$`*X>P8TFB`0`:(=$`"JT!!$&SP0(-@'$`/`P!`"MG80`:`9$`'K41`!X&(0 -M`-0`$`!PP`8UQT00`KXP$`*V;A``1200`9H<$`#40!`!W&(0`=M1$`'K41`` -M<+`&-<=$$`*^)A`"^>\0`KAC$`!G^A``)5X0`-0X$`!PT`8UQT00`:I3$`*^ -M#!`"^>80`OGM$`*X61``1200`&?Z$``E7A``U``0`=M1$`!PP`8UQT00`:I4 -M$`'<8A!%H``!_-WV$`*X`Q``H/00`>!B$$B@\`(`T``!_-V#$`#=ZA``D/$0 -M`2:`$`!B$`!4,Q``!*00E41G$`"1<0514F$0 -M`$&&$`-Y5A`!4&`0`W]4$`#5%!``0880`K@%$$0`"P``1300E``+!5%$9Q`` -MU>H0`-1&$)JV,P8BOC(0`$EP$`*^!!``28`0`%'Z$`!)GA``1#00`KX5$`!) -M0!`"OA,0`$E0$`*^$1``26`0`KX/$`!)(!`"O@T0`$DP$`*^!Q``23`0`KXC -M$`!)$!``1#00`KX&$`!)$!!$``L``$4T$)0`"P511&<01``+`!Q'\`8T1A(& -M-'#@!C0`"Q`"O@$0`HX"$`-]^P8,DB`0`KP"!B*^"A``8#`0`"`C!BQ@-Q`" -MM@801``+`AC5QA`"N`D0E$64!5%$9Q``U>H0F!1$!1",(!````L%4=1@$`-_ -M%!!$``L``$4T$)0`"P511&<0`-46$`+W]08B__0%%)`@$```"Q!)H(`#\-#` -M`(3E<`5,I1,01K8'``#E4Q!(Y1P=$$2,T00`U`80`K@#$`',@!`#/AX0 -M`,Q"$`',@!`#/BP0`-@`$`+_[A"```L`MK^G$`$<#!````L0`%PF$`*V`A`` -M7"$01``+``1<00FH'.`)C.J!"835%A!&M@0$`-0&$`,XZQ`#/K<$`-0&$`,X -M51`#/B@)C*M0$`",41`!S(`0`,W`$`*_6A`!FAT)M<8H";7' -M)`FUQR@0`=0]$`!@!Q`"MA00`&`F$`*V#Q``8"(0`&'J$`!@!Q`"M@,0`#$` -M";0`"PFU_@0)M?X(";7^#!`!H!,0`:04$`&H%1`!K!80`KX&$`!AZA``,0`) -MM``+";2B(`FTJB`0D(31$`#2`!!$9#<55."M$$:X1``H0`&`'$`*V`Q``,0`)M``+ -M";7^!`FU_@@)M?X,";7^$!`!H!,0`:04$`&H%1`!K!@0`9H=$`*^"1``8>H0 -M`#$`";0`"PFTHB`)M*H@";22(!`!FAT0`*RP$)"$T1``TA`0`O_/'_S,X1`` -MC-$0`)QW$`*[)A`![3$0`-(6$`*X)P40D"`)K*H@$`#B`!`!)@P0`H?$(*XTQ`"OK\``,V"$`'-,1``C-$0`,SA -M$`"<=Q`"NQ`0`-(6$`*X#@40D"`)K*H@$`#B`!`!)@P0`H?$(*XOA`"OJH0`>$Q$`'E,1`!Z3$0`>TQ!1"0(`FL -MJB`0`.(`$`$F#!`!S(`02*L1``#KP0`8S.`01(S1``3(0@F-ZA\0@KBM$`*^ -MF0FUFAT)M-(`";7')`FUQR@)M*(@";2J(!"1X#T0`>0^$`$@#!`!Z#\0`&`' -M$`*V&1``8"80`K80$`!@(A``8>H0`&`'$`*V`Q``,0`)M``+$`"$T0FU_@0) -MM?X($`&L$A!%H!,55.RG$`&D%!`!J!40`KX,$`!AZA``8!(0`&`'$`*V`Q`` -M,0`)M``+";2J(!!$A-$55.RG";2B(`FTJB`0`&`]$$:X2P``]$`'D/A`!(`P0`>@_$`!@!Q`"MAL0`&`F$`*V$A``8"(0 -M`&'J$`!@!Q`"M@,0`#$`";0`"Q``A-$)M?X$";7^"`FU_@P0`:P2$`&@$Q`! -MI!001>PA%53LIQ`!J!<0`O_6$`!AZA``8!(0`&`'$`*V`Q``,0`)M``+";2J -M(`FTHB`)M(31$$7L(154[*<)M*H@$`+_R1_\S($0`(S1$`"<=Q`"NHP0`>DQ -M$`#2%A`"N"8%$)`@":RJ(!``X@`0`28,$`',@!!(JQ$``.OA`!C,X!!$C-$` -M!,AB"8WJ'Q""N#D0`KXE``#-XA`!S3$0`(S1$`#,X1``G'<0`KIV$`#2%A`" -MN`X%$)`@":RJ(!``X@`0`28,$`',@!!(JQ$``.MA`!C,X!!$C-$``,GB"8WJ -M'Q""N"00`KX0$`#$(1`!XS$0`>DQ!1"0(`FLJB`0`.(`$`$F#!`!S(`02*L1 -M``3J(0`8S.`01(S1``3(H@F-ZA\0@K@4$XVF``FH7,`)A'=0$`,^`1`!F!P) -MM>8`";2((`FU_AP0`,@'`+;W]Q``B-<0`(C>$`"84A!%V!P`!';`$`,@`1`` -M=I`0`P(!$XV^'!``[4`0`*Q7":@N7A`![!T)G(0P"81W4!`#/@\0`"9X$`!G -MZA``9A$0`#$P";7'Q!``)3<0`KH2$$@E,@!@Q`(`8.`"$`*^#!`#?B<0@``+ -M`+:^(PF]_AP)N*0`$`&L'1``H#`0`.`\$$2%<0,`Q`<0`OWK$``Q(`FUQ\0` -MM`]Q$`*Z"A"03T(0`$P1$`*V!A``3$<0`K@%$`!P,`503``%0&`0!5!,$A"` -MB7(01OG0$`&8'!``=I`0`)C3$`-YOA!,``L``'90`"3-\0`<3?D0D#!@!5`` -M"Q`#*@001``+``!V4!`#*@$0`':0$(,"`1.-I@@0`:H!":A<0`FDZA001``+ -M`"C\$`F$=U`0`O_/$`&J%1"```L`M.H1$`'J%1`"_^\0`:H6$(``"P"TZA$0 -M`>H6$`+_Z@8K.`$`J'8@$),^`044E"`0`%!`$`&`H!`!A*$0`)`7!AB0'A`` -M=Q`%3'$0!B6')`5X0`S@!`*AV -M(!"3?_001%!``J#$`!``D!<&&)`>$`+_]P5,P4`01``+``1VT!"7/@$%$)0@ -M$`!'$`511J<01<"@``!WP!"3?_<01``+``!V@!`#``$3":90"2A80!``=T`) -M!SX!"32:(!``D#``,-H'$`*V'@`YVH`0`80C$`!>&A``7N,015Z%`\S4`!`` -M%O$0`*00$`*V"1``#/<0`KH'$`&@H!````L0`:3#$`'0PQ`!Y(,0`KX$$``, -M\!`!P(,0`("0$`$:Y1``X``01*$W`!Q;[A``'M(0`%_Z$``P\!`!T;\0`,07 -M$$0`"P``=D`0`WW6`!1VL!`#?_L&"*H@$$0`"P/,X4`0`)%P$`-W_!``[!80 -M`K8%$`&:R08P``L0`-H1$`':R1!%FL(`'-&#$`#1AQ`"N`,0`-H1$`':PA!% -MFL8`(.P&$`*V`Q``VA$0`=K&$`#L)A!&N`X`#.V&$`-WYQ`!FL`0`.UV$`*V -M!A`!FL$0```+$`#:$1`!VL$0`W_?$`#:$1`!VL`0`W_<$`&:PP8P[$80`K8$ -M$`#:$1`!VL,0`W_6$$6:Q``,[880`K8$$`#:$1`!VL00`W_0$$6:Q0`@[`80 -M`WG-$`#:$1`!VL40`W_*$$0`"P``R7`0`SX!$`$44!`!%E@0`%0L$`!6+!`! -M5%`0`598$`$40!`!%D@0`%0L$`!6+!`!5$`0159(`]C0L!`!D9`0`,DA$`"0 -M5Q`#??``,W_L``!W(!`#/@$/A:8$$`,^`0^%I@@01``+``!W$!`#/@$/B>8$ -M$`,^`1`!H@$/B*H@$$1@&@.\T0`0`!,!$`!0"1`!D9`0`>H"$$?`@!`!D@00 -M```+$`'2`A!&_^H0`>0,$`'H#1`!Z@<01O_F$`'J!1``3``0`0X!$`#(`!`` -MS$H0`,PJ$$;WWQ`"/LD01O_=$`'J!1``G3`03,@``!S-,``!Q!&]](`',S@$`#8`!``&N`0`(S2$`#8$!`!V@,01``+ -M``!V@!"```L0`SX!$PFF%`DH9T`)!'=`$`,^`1`!F@,)/>84$`!Q$`DUQT00 -M`%X2$`!8$1`!V@,`,!C7$`*V"!``7@<0`OGN$$G,&P``S`(#X-5`$`'-L!`" -MO@P0`U0`_C)8!`!Z5$0`650$$;_?P/@R$`0`%<0$``7 -M,Q``5\H0159``\C(`!``5O`0`!Q`$$;_9P-@R``0 -M`KX:`XC(`!`"OA@`K-3`$$4>``!@T<`0`%@0$``?-Q!&]UT0`68`$$AF%P`0 -M4#X`L-1N!B!83@8,=.`&,KX!$$0V@`!(^*`0`'3P$`*^`1``-I`0`+BP$``^ -MP!``=(`01O]-`@#(`!`!Z@40`!<@$`!4`!``U"H0`(BQ$``/,!``3``0`$X' -M$`*X`A``3!`0`,PJ$$8^/Q!&_S\#Z,A`$`!D`!``Y#H0`(DQ$`'L01`!:D00 -M`6A%$$;_-P/XR'`0`&87$`!F_A`!9U`01O\R`_C(\!`!9U`01O\O`_C(X!!) -M9U`#^,E``%#8$!!%V5``(,P`$$7J!0-`R``01CXE$`&B`1``W``02!\@`%#8 -M$`/XR4`0`)CR$`'94!!&_QX#X,F`$`'J0!!&_QL0```+$$;_&0/8R*`0`69` -M$$;_%A`!Y`$01``+``!V@!"#/@$)#:84`"CE0!``I'<)*"9^$`"-,A``9C$0 -M`&?J$``Q,`DEAT0)!'=`$`,^`0D]YA0`,,P7$`&D`1`"_>\0`\#@$`'D`1!$ -M``L``':`$(,^`0D-IA0`*.5`$`"D=PDH)GX)!(TR$`!W0`D]YA00`SX!"3BF -M`!``S!<0`#$P"37'1``QI`$0`OWP$`/`X!!&_P$01O\$$$;_!Q!&_P\01O]/ -M$$;_6A!&_V(01O]I$$;_=A!&_WL01O^8$$;_I1!&_ZP01O^P$$;_LA!&_\(0 -M1O_$$$;_=Q!&_WH01O]W$$;^VA!&_\$0```+$```"P````````>'```````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` @@ -560,7 +470,20 @@ M````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` +M````````````````````````````````````````!````````!F?'(0````` +M`````!F?'(3_____```````````````````````?`7H`$0`````````_`7,` +M,P`````````O`7``(@`$```````````````````````````````````````` +M`````````````````````````````"U"`V<<`2U$`80#``%!`L(*`"U#`&T& +M`"U``Z,$`"U(``"``"U'!1U.`2U%!!X2``````"``#6"`]!\`#6&`J@>!@`` +M``"```````"````/``"``#6&!`=D`P`/`````0``$``7P```&`P1```````` +M`!$``````!@L````````&.P````````8^````````!BL```````````````` M```````````````````````````````````````````````````````````` +M````````````````````````````````````$`@````````0$````````!`8 +M````````$"`````````0*````````!`P````````$#@````````00``````` +M`!!(````````$%`````````06````````!!@````````$&@````````0<``` +M`````!!X````````$(`````````0B````````!"0````````$)@````````0 +MH````````!"H````````$+`````````0N````````!#`````````$,@````` +M```0T````````!#8````````$.`````````0Z````````!#P````````$/@` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` @@ -595,442 +518,18 @@ M````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` M```````````````````````````````````````````````````````````` +M````````````````````$0```!%````1@```$<```!(````20```$H```!+` +M```3````$T```!.````3P```%``````````40````````!2`````````%,`` +M```````5`````````!5`````````%8`````````5P``````$+P0S!#<$102& +M!(8$FP0````7P```&``````````8 -M0````````!B`````````&,`````````9`````````!E`````````&8`````` -M```9P``````&'`8@!B0&+09N!FX&@P:+!ID&GP:]!LL&TP;8!ML&[`;O!J,& -MIP:E!@D&\0``!X@````.```````````````````````````````````````` -M```"L`*G`K$```*5`I4"G0```K("J`*R``````>8````%@`````````````` -M``````!@``&````````````````````````````````````````````````` -M```````````````````````````````````%[@````````>O````2P`````` -M````8``!\``8``!@``&P```````````````````````````````````````` -M````````````````JJH#``````````$`````````````````````\P`````` -M``````````@```````````````````````````````````````````!@```` -M`````&``````````8`````````!@`````````&``````````8`````````!@ -M`````````&``````````"`@$``P(!``````````````````````````````` -M````````````````````````````````````````@0````*P$``!```````" -M```````"@07N&````````````````0("`0``!_L````!`0("`0``!_T````" -M`!$B,R(S1%7^[?`-`@4"`0``#KX`````````%P````$```>>`````0``#",` -M```!```,+P````$```XH`````0``#D0````!```.@P````$```Z&`````0`` -M#HH````!```.F@````$```ZU````#P````````>%$`!^$!``_/`0`'2@$$Z^ -M`06H_(```/G0``1V3@`!`"O@$0`;W1$`&YT1`!-]$0 -M`3_1$`!T$A`"_?L0`#60$`*^`1!$?H`'A/P`$$:^`0'PX``0`8/1$`&+T1`! -MFL$019/2``C\(1``?A(0`OGZ$$CJ``(`X```"'&`$`'KSQ!,``L%J/R```!^ -M,```=V`0`SX$$$6$'@``=V`0`P0!`$B4(!`!JS$0`$&$$`!H&A``08\02!%0 -M'`#4#!P`Z`,`3)54$$6C,06X_(`0`$=,$$7$'@6H_(`0B(37$`*X`@`0``L0 -MC`2`$`/`X`1YKLP$::[0!`6FP`0)IL($;:?$!"&GQ`1]I\0$7:?$!%GF$`1) -MYA0$>:?$!&FGQ!`"OF`0`:K`"C6NS`HUKM`*-:[4"C6NV`H(+6`0`6X>$``Q -M<`I-I\0*$>80"A'F%`H1YA@*$>8<$`!M1A`"ME$0`/V!$$:_HQ`!JL`0`(D0 -M$`#)01``2"P#!*E0$`%N'A``,7`#,:?$$`*^1A`"/@<0BO_"$`*"!1``0800 -M1$&'!;C\CA`"O!$01J8+$`'2'!`!VAT0`>0<$$0'L``$=^`0`SX!$`&2'!`! -MFAT0`:0<$$0V,`6X_(``7.MP$`!Q$`,UAT0#%$@L$`#4@0`\5TP0B$PL`#S] -M@A"/P.`0`J8'$`'D'!!$![``!'?@$`,^`1`!I!P0`#8P`%SK<`"T<1`#-8=$ -M`Q1(+!`#P.`0200>`XC-```$=^`0`J8"$`,^`1`"AA00`#`@`R''9!``,"`# -M,8=$$$A$5P.(S0`0`#`@`S6'9`,T:8`0`'"0`S3J`!!&O`40`.@@`S2K4`,T -MZ@`#%SX$`%3L``,TJU`#%SX!`%SJ$!``2\,0`#`@`R''1!``_8$0`G_1$(K_ -M?!``C7`01$&'``1W\!`"N@80`D/0$`*^!`0U_G@0`D>U!%'^?!``1((0`KH$ -M!$V'9`0EAV0$/W_Y$`)%K!"*_VP0`(UP$`&2!!!%F@4`!'?P$`*^!@0TDB`$ -M4)H@$`'3<1`"1Z<0`=MQ$`!$@A`"N@80`:)@$`&J801,HI4$)*K5!#]_]1`" -M19D0`=($$`':!1"*_U<0`(UP$`)#KA!$1((`!'?P$`*Z(1`"AB(0`$1\$``. -M(1``S($0`H!$`'B`!`#/@$$4)H@!#22(!``1((0`KH( -M!"6K;P1-HV\$/)M5$`"3%1`!VF,0`=)B$`-_]A`!J@40`:($$`";51``DQ40 -M`=IA$`'28!`!J@$0`:(`$`'J!1`!X@00`8P=$`)%H%$`'3 -M<1`"?V(0`=MQ$`!$@A`"^^T0`O_-$`"-$`I!-A\*#SX!"D4$'A``1H`0``8B -M$``P,`I(``L0`#`@"DG'9!`"_Y00`(UP$$1!AP`$=Q`0`KH+$`)#9A`"O@D* -M$<=D$`!,+`H1QV00`$PL"A''9!``3"P*$<=D$`)'11``11(0`KH%"D!P,`HU -MAV0*-9]T"@]_\Q`"13P0BO[\$`"-MQ$`'B!A`!Z@<0`D<'$`!%$A`"N@P0`:)@$`&J80HTHI4*-*K5 -M$`&2!A`!F@<0`:)B"D&J8PHTHI4*-*K5"@]_YA`!T@00`=H%$`)$\A"*_K(0 -M`(UP$`'`'1`"0P@018`=``1W$!`"OA4*$)(@"A":(!`!H@`0`:H!$`"3%1`` -MFU40`=-Q$`!,+!`!VW$0`$PL"A"2(`H0FB`0`:("$`&J`Q``DQ40`)M5$`'3 -M<1``3"P0`=MQ$`)&V1``11(*0KH+"C628`HUFF$*-:)B"C6J8PH-TQ$0`=L1 -M$`'C$1`!ZQ$0`,$L$`-_X1!$A!```,'\$`'$'1`"1,D0BOZ'$`$HH!!$0<0% -MJ/R`$`!H&A``08\0`'\@"D"%$`HUAR0*-8?,0`SX!"A'F``H1Y@0*$>8("A'F#!``_8$0`$%'$`!!3!!& -MO"(0`82B$$4^H06H_(`0`'[Q$`&*!Q`"OA$*$)(@"A":(!`!HB`0`:HA$`"3 -M%1``FU40`=,Q$`';,0H0DB`*$)H@$`&B(!`!JB$0`),5$`";51`!TS$0`=LQ -M$`!_$@I"N@8*-:80"C6F%`HUIA@*-,H1"@]_ZA!%R@<%N/R`$`!!AA!&^;$` -M`'=@$(C4@0`\5TP`$)37$`,V`1!%HJ$`!'<0$`"%$!`#P.`01(40!:C\@!`` -MS``*0

(@$$5DE@`,Z6`0B#$P"37G -M)!``9=H02&7Z`!#H/@`82)<%4>@#!1"`(!`"MD`0`$D6$`*V#`DTHB`0`80" -M$(EBEQ!%XB``$.E`!5'H`Q`!2``%$(`@$``Q,`DUYR0)/>Z4$(`,0``QHI@0 -M`:J9$$7DF``$=J`0B$V3`#B8$!``2(80`K8@$`!)%A`"N`,0`*-0$`'BF!`` -MJ1(0`>B2$$7DF`"`['`012*6`D#E`!``8]H02&/Z`8#L_@)$Y`X0`6R:$`!B -M*A!$)Q$!_.'P$``K"<$`*^!A``J3`0`.E!$`'HDA``31,0`4R8`$BH(!``=H`0 -M`.F&$(,X"A!&OA,%4&`@!1"L(!!%8```*.A`$('H`P`P?B``.)EP$`*^\!,) -MMIP)*&;`"01W0!"//@$%$*0@%#6@D0DT?@`)->;@`#``"Q!%X.(`!':@$(A( -M1@40@"`0`S85$`!F`!`!9IH0`SX!$$6$`@`XY:`%4>0#$`%(``40@"`0@':` -M$`,^`1,)OH@)*&=`"01W0!`#/@$0`'#`"37')``P?B``.)@0$$1^(``$=J`0 -M`&G`$`&L`A`!:)L0`>R:$(,^`1``=H`0`SX#$`"@$A`!X)`3";:8"2AFP!`` -M=T`)!SX!$`&BF`DU]I@)-((@"32J(!``H!<0`OWU$`"!$A``@3<0C($^!1"$ -M(!``I!(0`*T1$`#H"1`!ZH<0`.```$B((!`!XI@0`,F&$(*X!!"-ZB`%4<`B -M$(``"Q,)IIP0`8R:$`#)0!``B!<)*`H>$`"`4A`!P)D)'(QP"01W0`D]YIP0 -M`SX!$`&BAA`!!)L0@(!P$`#`/!``#E$01$P)`D#,!PDXA@`0`KH)$``(*!`` -M2>H0`$@1$``P0`DUQP002`9"`$#,`@!`P`(0`*07$`!^'A``,#`)-<<$$``_ -M\Q`"M@D02*07`@#@@`)`P(`0`KP%$$6KWP(`X`<0`>L?$`+]_1"!S)H`,`11 -M$`%$FQ"*/!40`8"9$$6DD0`$=J`0`(`3$(,X#A``I3,0`:*&$`+YK!`!C)H0 -MB&%&$`,V-Q``3\P0BC@($`!@1A`#.'H0`&$6$`*V;!`#/E00`':`$`-_OQ`` -M14(0`42;$(GBFQ`!+)D0`8",$`&*F040I"`0`,E'$(:Z!!!$R4(`$.'0$`*^ -M&Q`!H(L0`0*:`$B$(!`!J.(0`,46$`*X!0`HJ%$0`>CA$`$LF!`!H(H0`.E` -M$`"H4A``J'<0`*A^$`")4!``*A\0`6KA$`",4A``B%40`,P7$`*\!A!$;20` -M`$%&$`*X`A``;"00`,@($(G@XP51;.`%$*@@$(G*F1`!HIL`.)E0$`/`X!`` -MHQ401`)X$`#L`!`!;7$0`'`P$`%O<1``S#P0`$/,$`!#ZA``,!`0`>-Q$`!" -M)Q`"N@\0`.H`$`&LF!`!`)<0`.M!$`#J.A``0?H0`KH%$`%J>A`!;'D0`6YX -M$`"K51`!ZG\0`G^Z$`,^"A`"?[@%$(@@$`"C%1`!C$(0`'$0$`'C<1``X!(0 -M`>"2$`+_ZA!%BH8`&.A0!1"`(!`!()D%4>@#$`!)0Q``84P01"!$``1@)!`! -M8``0`80"!1"`(!"`=H`0`SX!$PFNE!!$=T```&=`"2@G,`D'/@$0`'!0"37' -M)``P?B``.)@0$(RM=040@"`0`:*+!5'L`A!%X@``!'<@$`,^`1!$``L`!':@ -M$`,^`1"`=H`0`WZ7!1"`(!!$3"``1.GP$`'H`P513``%$(`@$`!^(``XF!`0 -M`O_L$`(^=A``VT`0`:*/$`&L@1!%X@@`$-0W$`*X`Q`!;AT0`CYN$%FL@0`X -MU:<`0.PN`!#53@`,U6<0`O?Z`!#51Q`"N`80`6@<$`'L'Q``:!80`K@K$`(^ -M81``W4`0`&@F$`*V!!!$480`*-1'$`*V+Q``F-,0CC9C$`!VD!"#/@$`J)3P -M$`"$":A6*A``7``)A'=0$`,^`0"VO@L0`*`0$`&;D1`!J]$0`&80$`";5Q`" -MN`00`&02$`+Y^A``9@`0`!TP$$0`"P`$=S`0`SX!$(!VD!`#/@$3C:X($`&B -M"0FH5D`0`";D":2C$`F$=U`0@SX!`+;_BQ"(G3`%3'9P!12,(!"(=Q0`%(PW -M$(LV`1`!DF$0`2A@$`"D\!`#P.`01)DP``!WL!`#&@$%%*`@$`"DT!`!JL`% -M39C"$`'J"1`#P.`0`H)$$6*!P``=F`0`,H'$`,V!A!$ -M``L``':`$`,``1``=T``*KX)$$0`"P``=H`0`P`!"2AH0!,)OA`0`'=`"0<^ -M`0DTBB`)*&C`"0R*4`D'/@$0`9H)$`&B!0DUYAP)->86"37N`!``V@<0`K@& -M$`&:"!!%R@D``'?0`#':"A"7/A8)*&B`"0VF&`DER@80`9`($`#D``DDHQ`) -M!)$1$`'0"!``T4`0`=`*$`&*'1`#/C\01``+``!WT!"7/@$%%(0@$`&:!1`! -MDB$0`8H@$``$L!""OC`%%(0@$`'*!A`!DB$0`8H@$(%4`!`!5@D0`4@!$`!( -M`!`!T`,0`9)@$`&:81`!T@L0`9)B$`':#!`!K&801=(-$"#L!Q`"MAD01&H` -M`,#L!Q``:QX0`2@)$`%J`Q!$``L`'&GP$`%H`!`!$@D0```+$`!3(Q`!4@@0 -M`KX/$`!0`!`!4`40`&XF$`*X`Q`!;``0`O_V$`$2`A````L0`%*$$`%2`A`" -M__$0`:QH$`+_YQ`"O@$0`9H%$`$$"1``V4$0`)S7$`+[EA!%V`H``':`$`,` -M`0DH:4`3":X`$)1Q$`DEAV0)!'=`"3WN``5//@$0@$46`#+WNA``:#`0`"@C -M$`!H-Q`"MD8012@#`!A$\Q``!400`9`#$`%$`Q!$4>,#9,1`$`!1ZA``!H$0 -M`$0)`"22(!`!F"(0`9`($``6P``@DI`0```+$```"Q`!6@00`<@)$$:N+0`` -MT`<0`K@-$`'("`DH:2`3":88"26^&`DEIA`)):X("26F``DEI@0)):X,"26N -M$`DEKA0)!SX5$`"(DA`!R`@)*&B`$PFF&`DEOA@)):80"0<^`1!%F@D``&F@ -M"2@I0`D,VF$)'.P@"26F$`DEK@@)):8`"26F!`DEK@P)):X0"26N%`D'/@$0 -M`.H`$`'L"!`!:`,0`:()"2AH0!``9B03":8@"22C$`D$=T`0`W](`W#1P!`! -MHH`0`2@"$`#B$1`!XH`0`.H`$`&*"1`!Z@D0`>P($`%H`Q`"_T,0EJ)F!1", -M(!``1``0`$&$$`&(81`!!@8&-)H@!C22(!`!VU$0`=-1!C7'1!``E)`0`:H> -M$`&0'Q``:!80`K@-$`!8%A`"M@D0`.(($`"5-Q``FQT0`K8'$``NLQ``+7<0 -M`KA2$`*^`Q``%U<0`KA/$`!PT`8UQT00`:I3$`!E(!!%9&`!`.@'$$:X`P`` -M1$00`KX-$-CIUQ`"N`L0`$2$$`*^"1"6HD`%$(P@$`!!C!`!B&$0`'$0!C7' -M1!``1A(0`K8R$`*.`Q`!1&<%4W_V$`&H`@8,DB`&$(@@$`#1^A!$B)4`_,GS -M!BZX#A``J)<0`KHH$$1%%`(8U<80`K@*$`!4,Q``!*00E41G!5%281``0880 -M`WF[$`%08!`#?[D0`-44$`!!AA`"N`401``+``!%-!"4``L%441G$`#5ZA`` -MU$80FK8S!B*^,A``27`0`KX$$`!)@!``4?H0`$F>$`!$-!`"OA40`$E`$`*^ -M$Q``25`0`KX1$`!)8!`"O@\0`$D@$`*^#1``23`0`KX'$`!),!`"OB,0`$D0 -M$`!$-!`"O@80`$D0$$0`"P``1300E``+!5%$9Q!$``L`'$?P!C1&$@8T<.`& -M-``+$`*^`1`"C@(0`WW[!@R2(!`"O`(&(KX*$`!@,!``(",&+&`W$`*V!A!$ -M``L"&-7&$`*X"1"4190%441G$`#5ZA"8%$0%$(P@$```"P51U&`0`W]Y$$0` -M"P``1300E``+!5%$9Q``U180`O?U!B+_]`44D"`0```+$$F@@`-LT,``A.5P -M!4RE$Q!&M@<``.53$$CE%Q_\Y2\#;.1!$`$@X!`"O@4`'&$#$`-W\A``8>H0 -M`&"!$``3`1``4`D0`:J`$```"Q``ZA$0`>J`$`-_Z1``=J``MP0!$`&2P1`! -MFL`0`>3#$)"E$`5`4$`0`2RE$("@L``^N`(`$``+$(!?XQ!%V@$`!';`$`,@ -M`1!$=I`%J/P0$`,"`1.-I@0)J%T@$)!W4`F'/@$)M>8`";2*(`FTJB`)M)(@ -M!1"0(`FTFB`0`82!$`#,!Q`"M@X0`,@'$`*V#!`!G!L)C*M0$`"<=Q`"NF$0 -M`$`'L'0FL0`#$@";7'Q`"T#W$0`KH*$)!/0A``3!$0`K8&$`!,1Q`"N`40`'`P!5!, -M``5`8!`%4$P2$(")H9$`+_[P8K -M.`$`J'8@$),^`044E"`0`%!`$`&`H!`!A*$0`)`7!AB0'A``=Q`%3'$0!B6' -M)`5X0`S@!`*AV(!"3?_001%!` -M`IC$`!``D!<&&)`>$`+_]P5,P4`01``+``1VT!"7/@$%$)0@$`!'$`511J<0 -M1<"@``!WP!"3?_<01``+``!V@!`#``$3":90"2A80!``=T`)!SX!"32:(!`` -MD#``,-H'$`*V'@`YVH`0`80C$`!>&A``7N,015Z%`U#4`!``%O$0`*00$`*V -M"1``#/<0`KH'$`&@H!````L0`:3#$`'0PQ`!Y(,0`KX$$``,\!`!P(,0`("0 -M$`$:Y1``X``01*$W`!Q;[A``'M(0`%_Z$``P\!`!T;\0`,07$$0`"P``=D`0 -M`WW6`!1VL!`#?_L&"*H@$$0`"P-0X4`0`)%P$`-W_!``[!80`K8%$`&:R08P -M``L0`-H1$`':R1!%FL(`'-&#$`#1AQ`"N`,0`-H1$`':PA!%FL8`(.P&$`*V -M`Q``VA$0`=K&$`#L)A!&N`X`#.V&$`-WYQ`!FL`0`.UV$`*V!A`!FL$0```+ -M$`#:$1`!VL$0`W_?$`#:$1`!VL`0`W_<$`&:PP8P[$80`K8$$`#:$1`!VL,0 -M`W_6$$6:Q``,[880`K8$$`#:$1`!VL00`W_0$$6:Q0`@[`80`WG-$`#:$1`! -MVL40`W_*$$0`"P``R7`0`SX!$`$44!`!%E@0`%0L$`!6+!`!5%`0`598$`$4 -M0!`!%D@0`%0L$`!6+!`!5$`0159(`UC1L!`!D9`0`,DA$`"05Q`#??``,W_L -M``!W(!`#/@$/A:8$$`,^`0^%I@@01``+``!W$!`#/@$/B>8$$`,^`1`!H@$/ -MB*H@$$1@&@-$T0`0`!,!$`!0"1`!D9`0`>H"$$?`@!`!D@00```+$`'2`A!& -M_^H0`>0,$`'H#1`!Z@<01O_F`VS(P!!%Z@4`!,U`$`(^/A!(``L`!,S``U#) -M0!`"/CH0`2`$$`!.T!``8%<01OG:`VS(P!``T@`0`#!P$`'341!$3K`#4,E` -M$``PE1$`%E4!!&_\D# -M=,A`$`'K4!!&_\8`R-30$$4>``!@T<`0`%@0$``?-Q!&]\`0`68`$$AF%P`0 -M4#X`S-1^!B!83@8,=.`&,KX!$$0V@`"@^;`0`'3P$`*^`1``-I`0`+BP$``^ -MP!``=(`01O^P`V3(0!``9``0`.0Z$`"),1`![$$0`6I$$`%H11!&_Z@#6,F@ -M$`%F0!!&_Z40`>0!$$0`"P``=H`0@SX!"0VF%``HY4`0`*1W"2@F?A``C3(0 -M`&8Q$`!GZA``,3`))8=$"01W0!`#/@$)/>84`##,%Q`!I`$0`OWO$`/`X!`! -MY`$01``+``!V@!"#/@$)#:84`"CE0!``I'<)*"9^"02-,A``=T`)/>84$`,^ -M`0DXI@`0`,P7$``Q,`DUQT0`,:0!$`+]\!`#P.`01O^0$$;_DQ!&_WL01O]Z -M$$;_E!!&_Y\01O^G$$;_=A!&_W401O]T$$;_ Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90E06DEAB6A for ; Fri, 24 Nov 2017 15:55:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic305-17.consmr.mail.bf2.yahoo.com (sonic305-17.consmr.mail.bf2.yahoo.com [74.6.133.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5907D79D22 for ; Fri, 24 Nov 2017 15:55:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1511538822; bh=PG7xttVuYP/vHsPP9bvwn7t5WhaLohG36qktTcz3Yuk=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=VIShbz/CXXKdhHCTWbf/9pnZ2+ZlxltTyMrXBauGu+4wMVh9RCjy53jhtMXyLr1v55SIHHNx/pIihRLrgtu08u0S3Zv4hiVzplpvKrnfYTKDzfFtURkK9g/XQg96POyamMxD8zWlAILjFGzzYjPSHjAPDFpckUjJmI6ry/KCwtIoRUcXIckchxh49pNh4NZw9+LOzvrUyUYg4ERpgGNmXUG0aChvtM6HiY0KqkDb4kG3vdvmoOWjNM5kz1ubvbUCQkRDlKXcKFf10Xh4hCNjrx9nIvPsxqnhX0YGN0BZ1u951gOwej8N4I/LQQd1r32YMntfpkvwBGxCcOSPJThTgw== X-YMail-OSG: 6S9ikm8VM1kS5W7wKp0dyjyS9QG3vqBNXMj52Ve2hLc6JKzfwejJgBs4hf_RtOs X6H14k5CDrJfrpuUNFooFgRkkAV0KsqKb8ehhxaYvTANoWdDUBpnQ2Q3eOWPsnD1r03wHi7PI7Je 3uqX2YqEzQmoNn1GB5FnY54XYerOHPQ7P521IUQ2mzk49tEFfU80z0l_yVQs_h5FIyIHTj1FxXC2 46AhGjv_apmQmtCBuHuJHWDpqjrtj5.RwwK65qMG1sA6VglmZNsdzrgsw54Vn9yVkLayfMb7JEro SJtOf9vkGmk0.g8ggMCS35xiQHLj1cFYPkerIwQzVGxwk6470qoKzCcq9iZEN7Sb9eU66enxvklx 30J05Xfxk_xejx7SNCL_hJMU.mKf7nNxtIDC_SHr5AbeNauWql..HSFxm2b8TFfnJqiFgU.2SwXh Zhyh5Vd8ZYq.uLBlJWJsmaw0hj.zWIQFOXViyzpPyA9FV_fe0MMQPEONWQBIfDe33xjdP0fXg Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.bf2.yahoo.com with HTTP; Fri, 24 Nov 2017 15:53:42 +0000 Received: from smtp106.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.3]) ([98.139.231.40]) by smtp415.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID -1593588204; Fri, 24 Nov 2017 15:43:27 +0000 (UTC) Subject: Re: svn commit: r326154 - head/sys/netinet To: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711241125.vAOBPrdw073077@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <4b647431-fc5c-590c-9d96-0d02ed03bda8@FreeBSD.org> Date: Fri, 24 Nov 2017 10:43:29 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <201711241125.vAOBPrdw073077@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 15:55:39 -0000 Thanks, I have a bunch of those to do still. On 24/11/2017 06:25, Michael Tuexen wrote: > Author: tuexen > Date: Fri Nov 24 11:25:53 2017 > New Revision: 326154 > URL: https://svnweb.freebsd.org/changeset/base/326154 > > Log: > Add SPDX line. > > Modified: > head/sys/netinet/sctp_ss_functions.c > > Modified: head/sys/netinet/sctp_ss_functions.c > ============================================================================== > --- head/sys/netinet/sctp_ss_functions.c Fri Nov 24 11:25:06 2017 (r326153) > +++ head/sys/netinet/sctp_ss_functions.c Fri Nov 24 11:25:53 2017 (r326154) > @@ -1,4 +1,6 @@ > /*- > + * SPDX-License-Identifier: BSD-2-Clause Although not wrong, I think it should have been: * SPDX-License-Identifier: BSD-2-Clause-FreeBSD There is a bunch of BSD variants here: https://spdx.org/licenses/ Cheers, Pedro. > + * > * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved. > * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved. > * Copyright (c) 2010-2012, by Robin Seggelmann. All rights reserved. > From owner-svn-src-head@freebsd.org Fri Nov 24 15:56: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 CADCDDEABDB for ; Fri, 24 Nov 2017 15:56:48 +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 AAB6379D6F for ; Fri, 24 Nov 2017 15:56:48 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 000f7915-d130-11e7-b1c3-712f93d8ba90 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 000f7915-d130-11e7-b1c3-712f93d8ba90; Fri, 24 Nov 2017 15:56:15 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vAOFuebJ001241; Fri, 24 Nov 2017 08:56:40 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1511539000.94268.17.camel@freebsd.org> Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts From: Ian Lepore To: Bruce Evans , Devin Teske Cc: rgrimes@freebsd.org, cem@freebsd.org, Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 24 Nov 2017 08:56:40 -0700 In-Reply-To: <20171124201621.K980@besplex.bde.org> References: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> <20171124201621.K980@besplex.bde.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 15:56:48 -0000 On Fri, 2017-11-24 at 22:25 +1100, Bruce Evans wrote: > On Thu, 23 Nov 2017, Devin Teske wrote: > [...] > > ntpdate's man page claims this, but is wrong AFAIK.  It says that the > functionality of ntpdate is now available in ntpd(8) using -q.  However > ntpdate -q is far from having equivalent functionality.  According to both > testing of the old version and its current man page, it does the same slow > syncing as normal ntpd startup, and just exits after this and doesn't > daemonize while doing this.  With the old version, this step takes 35-40 > seconds starting with the time already synced to withing a few microseconds > (by a previous invocation of ntpd), while ntpdate syncs (perhaps not so > well) with a server half the world away in about 1 second. > Ahh, the good ol' days, when ntpdate was fast by default.  Not anymore... unicorn# time ntpdate ntp.hippie.lan 24 Nov 15:21:31 ntpdate[734]: adjust time server [...] offset -0.000123 sec 0.013u 0.006s 0:06.13 0.1%      192+420k 0+0io 0pf+0w If you want the fast old sub-second behavior these days, you have to add -p1.  Or, better yet, use sntp -r . I'm not sure where you're coming up with numbers like "35 seconds" for ntpd to initially step the clock.  The version we're currently distributing in base takes the same 6-7 seconds as ntpdate (assuming you've used 'iburst' in ntp.conf).  That's true in the normal startup case, or when doing ntpd -qG to mimic ntpdate. If there is an ntpd.drift file, ntpd is essentially sync'd as soon as it steps.  If there is not, it does a clock step, then does 300 seconds of frequency training during which the clock can drift pretty far off- time.  It used to be possible to shorten the frequency training interval with the 'tinker stepout' command, but the ntpd folks decoupled that (always inapproriately overloaded) behavior between stepout interval and training interval.  There is no longer any way to control the training interval at all, which IMO is a serious regression in ntpd (albeit noticed primarily by those of us who DO have an atomic clock and get a microsecond-accurate measurement of frequency drift in just 2 seconds). -- Ian From owner-svn-src-head@freebsd.org Fri Nov 24 16:46: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 18CFCDEB911; Fri, 24 Nov 2017 16:46:30 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E326C7B310; Fri, 24 Nov 2017 16:46:29 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from Ticonderoga.HML3.ScaleEngine.net (senat1-01.HML3.ScaleEngine.net [209.51.186.5]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 9713B13B8D; Fri, 24 Nov 2017 16:46:27 +0000 (UTC) Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts To: rgrimes@freebsd.org, cem@freebsd.org Cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> From: Allan Jude Message-ID: <38787424-ff48-df5e-0831-922d14f1603c@freebsd.org> Date: Fri, 24 Nov 2017 11:46:26 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 16:46:30 -0000 On 11/23/2017 12:29, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes >> wrote: >>>> Also we do provide an ntp.conf so ... >>> >>> We do, a template, all commented out, and does not work for >>> machines behind strong firewalls that wont allow ntp out >>> to the net but have internal ntp servers that are used for >>> such things. >>> >>> Well maybe not all commented out, I think it defaults to >>> some public pools. I believe it would be missing iburst >>> for use with ntp -pg >> >> Does ntpdate work out of the box in such environments? If so, how? > > ntpdate time.nist.gov > > ntpdate does not need a configureration file, just a command > line argument. > > The point of this thread was which option the installer should use to implement 'set the correct time on first boot'. We are not talking about removing ntpdate in this thread. -- Allan Jude From owner-svn-src-head@freebsd.org Fri Nov 24 16: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 9FA98DEBE9B; Fri, 24 Nov 2017 16:54:26 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0337BAF5; Fri, 24 Nov 2017 16:54:26 +0000 (UTC) (envelope-from jwb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAOGsPii011221; Fri, 24 Nov 2017 16:54:25 GMT (envelope-from jwb@FreeBSD.org) Received: (from jwb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOGsPge011220; Fri, 24 Nov 2017 16:54:25 GMT (envelope-from jwb@FreeBSD.org) Message-Id: <201711241654.vAOGsPge011220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jwb set sender to jwb@FreeBSD.org using -f From: "Jason W. Bacon" Date: Fri, 24 Nov 2017 16:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326172 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: jwb X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 326172 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 16:54:26 -0000 Author: jwb (ports committer) Date: Fri Nov 24 16:54:25 2017 New Revision: 326172 URL: https://svnweb.freebsd.org/changeset/base/326172 Log: Add new ports committer jwb Approved by: jrm Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Fri Nov 24 15:48:17 2017 (r326171) +++ head/share/misc/committers-ports.dot Fri Nov 24 16:54:25 2017 (r326172) @@ -445,6 +445,8 @@ jadawin -> wen joerg -> netchild +jrm -> jwb + junovitch -> tz knu -> daichi From owner-svn-src-head@freebsd.org Fri Nov 24 17:12: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 73438DEC526; Fri, 24 Nov 2017 17:12:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE5A7C3C1; Fri, 24 Nov 2017 17:12:12 +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 921ED2602ED; Fri, 24 Nov 2017 18:12:09 +0100 (CET) Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711241450.vAOEoSFW056744@repo.freebsd.org> <20171124150044.GA94025@raichu> From: Hans Petter Selasky Message-ID: Date: Fri, 24 Nov 2017 18:09:25 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171124150044.GA94025@raichu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 17:12:12 -0000 On 11/24/17 16:00, Mark Johnston wrote: > Are there non-trivial interoperability issues between mthca and the > updated OFED stack? If so, could you describe them? If not, I would > strongly prefer to retain the mthca driver, as Isilon still has plenty > of hardware making use of it. Hi, There are no technical reasons except Mellanox hasn't focused on the mthca driver in this upgrade. With little effort you should be able to pull libmthca and the mthca driver from the mentioned sources and make it work. --HPS From owner-svn-src-head@freebsd.org Fri Nov 24 17:12: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 46A2FDEC521; Fri, 24 Nov 2017 17:12:11 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DF027C3BA; Fri, 24 Nov 2017 17:12:10 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D5BE926014D; Fri, 24 Nov 2017 18:12:01 +0100 (CET) Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711241450.vAOEoSFW056744@repo.freebsd.org> <20171124150044.GA94025@raichu> From: Hans Petter Selasky Message-ID: Date: Fri, 24 Nov 2017 18:09:16 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171124150044.GA94025@raichu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 17:12:11 -0000 On 11/24/17 16:00, Mark Johnston wrote: > Are there non-trivial interoperability issues between mthca and the > updated OFED stack? If so, could you describe them? If not, I would > strongly prefer to retain the mthca driver, as Isilon still has plenty > of hardware making use of it. Hi, There are no technical reasons except Mellanox hasn't focused on the mthca driver in this upgrade. With little effort you should be able to pull libmthca and the mthca driver from the mentioned sources and make it work. --HPS From owner-svn-src-head@freebsd.org Fri Nov 24 17:22:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0CDADEC935; Fri, 24 Nov 2017 17:22:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62C437CB39; Fri, 24 Nov 2017 17:22:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x242.google.com with SMTP id b5so14113392itc.3; Fri, 24 Nov 2017 09:22:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0RU2lkG+Tls9t9HNdlsowSONTCqg1vLqfVaSgT7LoVA=; b=SLmaHUYtC4cNHWGVpU+YYOP0YujSGQm7HKCGKYz4Htk+nOsyP0kiXyze5cyW0kFy9x E/ynKb6gUEQDbifjZ049WyFnyv28iFIjGM1hR+JOuyD6c8veD/Y6+pQN9TMgcRrcW544 fKYsDJ/ErgQF0pRYZuLaY3bmHJRjwEaZtBxaZka29h6NhP3vpj6nAKfhVCu4kHCX+WW4 DNcouQSExEJ6Yd+RlCabqP1Z9D+yMP7DsvYVbycIFKYH/vnkNTm6u8A3F2jPe2sz29sq 983QOV50TgdW74PtETBPxd36t6FD7UuW6Tt0fimUW6/TXEgvDYLuYgPIQRxtsXrw1CLl QP0w== 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=0RU2lkG+Tls9t9HNdlsowSONTCqg1vLqfVaSgT7LoVA=; b=HfC1NdfTQ05a9zVW+Jxm5l0TuCXuVA9YxmlDtbI4QlkQXCKOccafoo10nrHdbJbY+A 7rGZlWdcqgjMvQKVw7F0Qo48Nir8MlXxJwp8oqvZ1M9RXmb2+16Tlf+D8AxbGmIvu5/s EGDHIpsMXK1joS5WPobq6Cf9LUm6NzwVeSpM5fMPDdQV9HCokGt/jQ4ioqRXdV+nh/Cu A7j+rteKD2kWUAZzXWFgZMvtI0M9hAptF07xt+O9vh78AU3c5cEW7pt+tBRTtyjeB6zf TM7m3q8ND/I0kCMwoIN3L5iRJUncC5JFb0kVN5eDRQDr9/H6h60AA38iaxPy1ISgJiSg w6tw== X-Gm-Message-State: AJaThX4n6N5rrndYVOTZtM0vGN+qO6c5zWBxkrt+49x9QrnuMl8f6n/F OME/Yp1mu1zLpMkzQIbRztGJOg== X-Google-Smtp-Source: AGs4zMZ+n9UglXqBcmKM9oc857nryMtGd0DdDxh1Sq2+ZFhkB5ws/bbOT2p7iSxoYe5WUkw4/zSD2g== X-Received: by 10.36.145.1 with SMTP id i1mr16719539ite.122.1511544164700; Fri, 24 Nov 2017 09:22:44 -0800 (PST) Received: from raichu (toroon0560w-lp140-01-69-159-38-22.dsl.bell.ca. [69.159.38.22]) by smtp.gmail.com with ESMTPSA id z188sm4524842itb.28.2017.11.24.09.22.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 09:22:43 -0800 (PST) Sender: Mark Johnston Date: Fri, 24 Nov 2017 12:22:39 -0500 From: Mark Johnston To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... Message-ID: <20171124172239.GA1098@raichu> References: <201711241450.vAOEoSFW056744@repo.freebsd.org> <20171124150044.GA94025@raichu> 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.25 Precedence: list List-Id: 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, 24 Nov 2017 17:22:45 -0000 On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote: > On 11/24/17 16:00, Mark Johnston wrote: > > Are there non-trivial interoperability issues between mthca and the > > updated OFED stack? If so, could you describe them? If not, I would > > strongly prefer to retain the mthca driver, as Isilon still has plenty > > of hardware making use of it. > > Hi, > > There are no technical reasons except Mellanox hasn't focused on the > mthca driver in this upgrade. With little effort you should be able to > pull libmthca and the mthca driver from the mentioned sources and make > it work. In that case, could we please bring it back in to svn? It seems silly to remove a driver just because it's not being actively maintained: that isn't the bar for keeping drivers in FreeBSD, and I note that mthca is still present in Linux. If there is some work needed to get the kernel and userland components to compile again, I'm happy to do it; I just don't want to have to maintain an out-of-tree HCA driver when there's no good reason it can't stay in svn. From owner-svn-src-head@freebsd.org Fri Nov 24 17:32: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 49264DECB8D; Fri, 24 Nov 2017 17:32:14 +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 0E0737CF89; Fri, 24 Nov 2017 17:32:13 +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 7D44D26014D; Fri, 24 Nov 2017 18:32:09 +0100 (CET) Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711241450.vAOEoSFW056744@repo.freebsd.org> <20171124150044.GA94025@raichu> <20171124172239.GA1098@raichu> From: Hans Petter Selasky Message-ID: <5404fdf3-59f0-7bb0-772e-a9003671b0ef@selasky.org> Date: Fri, 24 Nov 2017 18:29:25 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171124172239.GA1098@raichu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 17:32:14 -0000 On 11/24/17 18:22, Mark Johnston wrote: > On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote: >> On 11/24/17 16:00, Mark Johnston wrote: >>> Are there non-trivial interoperability issues between mthca and the >>> updated OFED stack? If so, could you describe them? If not, I would >>> strongly prefer to retain the mthca driver, as Isilon still has plenty >>> of hardware making use of it. >> >> Hi, >> >> There are no technical reasons except Mellanox hasn't focused on the >> mthca driver in this upgrade. With little effort you should be able to >> pull libmthca and the mthca driver from the mentioned sources and make >> it work. > > In that case, could we please bring it back in to svn? It seems silly to > remove a driver just because it's not being actively maintained: that > isn't the bar for keeping drivers in FreeBSD, and I note that mthca is > still present in Linux. If there is some work needed to get the kernel > and userland components to compile again, I'm happy to do it; I just > don't want to have to maintain an out-of-tree HCA driver when there's no > good reason it can't stay in svn. > Sure, but we probably want to put it into sys/dev/mthca instead of sys/ofed/xxx . Are you saying you want to pull it in yourself and make it compile? --HPS From owner-svn-src-head@freebsd.org Fri Nov 24 17:35: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 AFF1CDECD4C; Fri, 24 Nov 2017 17:35:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::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 7A3387D31D; Fri, 24 Nov 2017 17:35:17 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pg0-x241.google.com with SMTP id z184so15707729pgd.13; Fri, 24 Nov 2017 09:35:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=O17l1H1ftU9gd6A1d+CIhzSOmlslEU4f3IFSpWcxckk=; b=cwpW0Cgmgp7yUCh7V90NYlzD4jXJ6K3tdcKm8pTxBgw7IBuf+YMVupvqb5q5ls6vy4 zeY2LXL2MeKlfUQDyk7tdtpDBsut2qP3pG1laIppL9niYKviOud++7/Ae9AZUgmu/aTo 3g99prWhyS5akrgWUivGm5Lrq8BD/ZUsWhr/kbMwPyvHzqoXQvUzWT90EJtoiCD6AqmD i+wCsr6Hb2ZAumSuroPhHVQ2rrkRBbS9gMbeFU1uNS7tzG8YH3PqlWfCZi1QkRkRvP3a d3NzYvGIKGbLF8Y00VLreeJBaIW49T1urN+ii8v/lMaEXb6OitFbcLFio7jo1fG3Eebb TmKw== 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=O17l1H1ftU9gd6A1d+CIhzSOmlslEU4f3IFSpWcxckk=; b=MEQPM4vgVVMDiG/3HffBagmtUseF0UVyqknAveQ8CiiHk/xcmuonakOZgeaNOlb5TN vabIJgUSzgTxkKJpvEnaf5Gq9UD5raT7Hoa3qULCSb8qr8ExSDCnmIZPrRLcdwuhr+YR eBLVmbl64zISWO2IQifFY4IiZDTMiFwABTTdMEKfDUSkFE3IVTAiK1gO0Ibrm61UktCQ enDgKiBH/bGz7V9PI0pQXFl8BGmwFvKfyzyTBBsfrw4gcUG4F+x6KnE9Lisxy2+ki7io k3F8NL2khXm/lK0B71F+IqmbibbOEKfzmr1H/3h8+wkkk0PoBtbt0czL/+77SEkCrJMP H/mw== X-Gm-Message-State: AJaThX4ok8bCfJiqbNs8KVCZcf/FPPkWm4UlrSe27o6gZezOtE4c/j2a +yVvN8IpjGpqXkGZe7w3qc0= X-Google-Smtp-Source: AGs4zMa9K2QqyRbA3lFbR5ESbp5rzFlmrZdDsp/zzlO4ifbB4Hpna+pdVqRTMEj73XAVVNhh6pLY7A== X-Received: by 10.101.101.154 with SMTP id u26mr21987324pgv.416.1511544916861; Fri, 24 Nov 2017 09:35:16 -0800 (PST) Received: from raichu (toroon0560w-lp140-01-69-159-38-22.dsl.bell.ca. [69.159.38.22]) by smtp.gmail.com with ESMTPSA id b10sm36353700pfj.20.2017.11.24.09.35.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 09:35:15 -0800 (PST) Sender: Mark Johnston Date: Fri, 24 Nov 2017 12:35:12 -0500 From: Mark Johnston To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... Message-ID: <20171124173512.GB1098@raichu> References: <201711241450.vAOEoSFW056744@repo.freebsd.org> <20171124150044.GA94025@raichu> <20171124172239.GA1098@raichu> <5404fdf3-59f0-7bb0-772e-a9003671b0ef@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5404fdf3-59f0-7bb0-772e-a9003671b0ef@selasky.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 17:35:17 -0000 On Fri, Nov 24, 2017 at 06:29:25PM +0100, Hans Petter Selasky wrote: > On 11/24/17 18:22, Mark Johnston wrote: > > On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote: > >> On 11/24/17 16:00, Mark Johnston wrote: > >>> Are there non-trivial interoperability issues between mthca and the > >>> updated OFED stack? If so, could you describe them? If not, I would > >>> strongly prefer to retain the mthca driver, as Isilon still has plenty > >>> of hardware making use of it. > >> > >> Hi, > >> > >> There are no technical reasons except Mellanox hasn't focused on the > >> mthca driver in this upgrade. With little effort you should be able to > >> pull libmthca and the mthca driver from the mentioned sources and make > >> it work. > > > > In that case, could we please bring it back in to svn? It seems silly to > > remove a driver just because it's not being actively maintained: that > > isn't the bar for keeping drivers in FreeBSD, and I note that mthca is > > still present in Linux. If there is some work needed to get the kernel > > and userland components to compile again, I'm happy to do it; I just > > don't want to have to maintain an out-of-tree HCA driver when there's no > > good reason it can't stay in svn. > > > > Sure, but we probably want to put it into sys/dev/mthca instead of > sys/ofed/xxx . Ok. > Are you saying you want to pull it in yourself and make > it compile? I don't really *want* to, but I will if you don't. :) From owner-svn-src-head@freebsd.org Fri Nov 24 17:36: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 630A7DECDE5; Fri, 24 Nov 2017 17:36:48 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AEB77D471; Fri, 24 Nov 2017 17:36:48 +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 7CC6D26014D; Fri, 24 Nov 2017 18:36:46 +0100 (CET) Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711241450.vAOEoSFW056744@repo.freebsd.org> <20171124150044.GA94025@raichu> <20171124172239.GA1098@raichu> <5404fdf3-59f0-7bb0-772e-a9003671b0ef@selasky.org> <20171124173512.GB1098@raichu> From: Hans Petter Selasky Message-ID: <4695efa6-c8d5-e860-3c9b-939ac4b91abc@selasky.org> Date: Fri, 24 Nov 2017 18:34:02 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171124173512.GB1098@raichu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 17:36:48 -0000 On 11/24/17 18:35, Mark Johnston wrote: > On Fri, Nov 24, 2017 at 06:29:25PM +0100, Hans Petter Selasky wrote: >> On 11/24/17 18:22, Mark Johnston wrote: >>> On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote: >>>> On 11/24/17 16:00, Mark Johnston wrote: >>>>> Are there non-trivial interoperability issues between mthca and the >>>>> updated OFED stack? If so, could you describe them? If not, I would >>>>> strongly prefer to retain the mthca driver, as Isilon still has plenty >>>>> of hardware making use of it. >>>> >>>> Hi, >>>> >>>> There are no technical reasons except Mellanox hasn't focused on the >>>> mthca driver in this upgrade. With little effort you should be able to >>>> pull libmthca and the mthca driver from the mentioned sources and make >>>> it work. >>> >>> In that case, could we please bring it back in to svn? It seems silly to >>> remove a driver just because it's not being actively maintained: that >>> isn't the bar for keeping drivers in FreeBSD, and I note that mthca is >>> still present in Linux. If there is some work needed to get the kernel >>> and userland components to compile again, I'm happy to do it; I just >>> don't want to have to maintain an out-of-tree HCA driver when there's no >>> good reason it can't stay in svn. >>> >> >> Sure, but we probably want to put it into sys/dev/mthca instead of >> sys/ofed/xxx . > > Ok. > >> Are you saying you want to pull it in yourself and make >> it compile? > > I don't really *want* to, but I will if you don't. :) > Let me discuss this at Mellanox first. I'll get back to you on Monday on this topic. --HPS From owner-svn-src-head@freebsd.org Fri Nov 24 17: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 C6DEBDED378; Fri, 24 Nov 2017 17:57:01 +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 90F247DE04; Fri, 24 Nov 2017 17:57:01 +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 vAOHv0pp036895; Fri, 24 Nov 2017 17:57:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOHv0np036894; Fri, 24 Nov 2017 17:57:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711241757.vAOHv0np036894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 Nov 2017 17:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326173 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 326173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 17:57:01 -0000 Author: markj Date: Fri Nov 24 17:57:00 2017 New Revision: 326173 URL: https://svnweb.freebsd.org/changeset/base/326173 Log: Fix typos. MFC after: 3 days Modified: head/share/man/man4/dtrace_lockstat.4 Modified: head/share/man/man4/dtrace_lockstat.4 ============================================================================== --- head/share/man/man4/dtrace_lockstat.4 Fri Nov 24 16:54:25 2017 (r326172) +++ head/share/man/man4/dtrace_lockstat.4 Fri Nov 24 17:57:00 2017 (r326173) @@ -198,7 +198,7 @@ probe fires when a thread successfully upgrades a held read lock to a write lock. The .Fn lockstat:::rw-downgrade -probe first when a thread downgrades a held +probe fires when a thread downgrades a held .Xr rwlock 9 write lock to a read lock. The only argument is a pointer to the structure which describes @@ -226,7 +226,7 @@ waiting to acquire a .Xr sx 9 . The .Fn lockstat:::sx-spin -probe first when a thread spins while waiting to acquire a +probe fires when a thread spins while waiting to acquire a .Xr sx 9 . Both probes take the same set of arguments. The first argument is a pointer to the lock structure that describes From owner-svn-src-head@freebsd.org Fri Nov 24 18:00: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 76F28DED426; Fri, 24 Nov 2017 18:00:53 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 996A67E016; Fri, 24 Nov 2017 18:00:51 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([78.55.195.68]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lymoh-1fFUtj0vfb-0167FM; Fri, 24 Nov 2017 18:55:36 +0100 Date: Fri, 24 Nov 2017 18:55:28 +0100 From: "O. Hartmann" To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... Message-ID: <20171124185528.3a0ebfdc@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201711241450.vAOEoSFW056744@repo.freebsd.org> References: <201711241450.vAOEoSFW056744@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/J+F5gfad7PlOhNr7t/S0dku"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:irxIlFEBPdI09J54YtBQaP5SQhbP8jSjmXel0WOosREZYdHp9Lt OEDmSd2PKBjEhhW09L/K1tswNY0XWVru0+9zUumciQwVkmEirDNPcWV663H5rIwsjU6ghxg H8g4msIhPCFTDm513hoQ8ZV8PQcr2jc0MtRs/oxAfkwE6W7CUbC35Al38YWMYKwCWM85VOw IlCHQcQD8v+9b0bfzYP7w== X-UI-Out-Filterresults: notjunk:1;V01:K0:Kfb8vJ/0tQw=:pNHtng1LMaZF243ucvx0Tf h0oCNuW5LYAPT42ucmE79pM87Dzz9XThmH+zrWGHUWHj8MHK5OYE7EVj2OhpZEsbcW2WWiwQP NU9YMRlZWw2jaQ5sbhzk4xmN2ZzT44UANxLQbKVlElucUOlIIQU3uuyW8/CIGblHXs6LO2VQS BmsYTk5bpYkPfXyfrlTd1FHcGdHtWnwAi6LqmskJ8lDOaCtKE3KYXDlJ20LlLnraltIiJgvsV pUtHPuRcOd8yv+JiZtrmjyywMsrQ1IladpEjpF2xj1XXerusdNFtPUCewX+d1FX7iKde0liTm GZfQGswnhyH7Qs7iIotfKzld3bddBCxSOemyPCdZi6GBrmeQMA4rWvPdKdylL3O8cEksyOVPa 0GtjQJHmqbOhXXABv+7B4/SEcuRt9puUNeL5+gUsLPKGjEh+AiCD/mQmgf5B9BvMmkVujMqL1 34/6mNa8SsnXSj65eYIPnzyH8xYSYaP6L3qx0nU/EDcI6QWQKWF1/KaxnnwxQRn6b+22WUciK 9qBfMssEe14ee0Yn/qsxxZu+hbieNgc8gJjwI92cpwI13eW9ZIDCGcK5w/UT9iytFBc/qmrvG sZb0kHPEiigNcx2tQgVdHWo1cU7utbGkwyxPx14ee/xMEXlHkRMGtFmxIASs/UvaPFsWcAXx4 TpFK5SJzdJv3MjGsTq4k943kGZKEPpL09iZalc1VkjdycUc14LyJzpMUHflIOTqKc8fZiHxBv FDjyOyKW6KdRdEdgLpX0pQffzbbGPRAbbzlhYvyvBnvzIlFb8x9SxTY8ekWUtAe+mK67+Ss1e Rw+s1EnQlEasK1HTPAHVbePTWVvwQ== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 18:00:53 -0000 --Sig_/J+F5gfad7PlOhNr7t/S0dku Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Fri, 24 Nov 2017 14:50:28 +0000 (UTC) Hans Petter Selasky schrieb: > Author: hselasky > Date: Fri Nov 24 14:50:28 2017 > New Revision: 326169 > URL: https://svnweb.freebsd.org/changeset/base/326169 >=20 > Log: > RoCE/infiniband upgrade to Linux v4.9 for kernel and userspace. > =20 > This commit merges projects/bsd_rdma_4_9 to head. > =20 > List of kernel sources used: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > =20 > 1) kernel sources were cloned from git://github.com/torvalds/linux.git > Top commit 69973b830859bc6529a7a0468ba0d80ee5117826 - tag: v4.9, linux-= 4.9 > =20 > 2) krping was cloned from https://github.com/larrystevenwise/krping > Top commit 292a2f1abf0348285e678a82264740d52e4dcfe4 > =20 > List of userspace sources used: > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D > =20 > 1) rdma-core was cloned from https://github.com/linux-rdma/rdma-core.git > Top commit d65138ef93af30b3ea249f3a84aa6a24ba7f8a75 > =20 > 2) OpenSM was cloned from git://git.openfabrics.org/~halr/opensm.git > Top commit 85f841cf209f791c89a075048a907020e924528d > =20 > 3) libibmad was cloned from git://git.openfabrics.org/~iraweiny/libibma= d.git > Tag 1.3.13 with some additional patches from Mellanox. > =20 > 4) infiniband-diags was cloned from > git://git.openfabrics.org/~iraweiny/infiniband-diags.git Tag 1.6.7 with s= ome additional > patches from Mellanox.=20 > NOTES: > =3D=3D=3D=3D=3D=3D > =20 > 1) The mthca driver has been removed in kernel and in userspace. > 2) All GPLv2 only sources have been removed and where applicable > rewritten from scratch under a BSD license. > 3) List of fully supported drivers in userspace and kernel: > a) iw_cxgbe (Chelsio) > b) mlx4ib (Mellanox) > c) mlx5ib (Mellanox) > 4) WITH_OFED=3DYES is still required by make in order to build > OFED userspace and kernel code. > 5) Full support has been added for routable RoCE, RoCE v2. > =20 > Sponsored by: Mellanox Technologies >=20 > Added: > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_gsi.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/dev/mlx5/mlx5_ib/mlx5_ib_gsi.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_virt.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/dev/mlx5/mlx5_ib/mlx5_ib_virt.c > head/sys/ofed/drivers/infiniband/core/ib_addr.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_addr.c > head/sys/ofed/drivers/infiniband/core/ib_agent.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_agent.c > head/sys/ofed/drivers/infiniband/core/ib_cache.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cache.c > head/sys/ofed/drivers/infiniband/core/ib_cm.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cm.c > head/sys/ofed/drivers/infiniband/core/ib_cma.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cma.c > head/sys/ofed/drivers/infiniband/core/ib_cq.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_cq.c > head/sys/ofed/drivers/infiniband/core/ib_device.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_device.c > head/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_fmr_pool.c > head/sys/ofed/drivers/infiniband/core/ib_iwcm.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwcm.c > head/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwpm_msg.c > head/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_iwpm_util.c > head/sys/ofed/drivers/infiniband/core/ib_mad.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_mad.c > head/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_mad_rmpp.c > head/sys/ofed/drivers/infiniband/core/ib_multicast.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_multicast.c > head/sys/ofed/drivers/infiniband/core/ib_packer.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_packer.c > head/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c > head/sys/ofed/drivers/infiniband/core/ib_sa_query.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_sa_query.c > head/sys/ofed/drivers/infiniband/core/ib_smi.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_smi.c > head/sys/ofed/drivers/infiniband/core/ib_sysfs.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_sysfs.c > head/sys/ofed/drivers/infiniband/core/ib_ucm.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucm.c > head/sys/ofed/drivers/infiniband/core/ib_ucma.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ucma.c > head/sys/ofed/drivers/infiniband/core/ib_ud_header.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_ud_header.c > head/sys/ofed/drivers/infiniband/core/ib_umem.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_umem.c > head/sys/ofed/drivers/infiniband/core/ib_umem_odp.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_umem_odp.c > head/sys/ofed/drivers/infiniband/core/ib_umem_rbtree.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_umem_rbtree.c > head/sys/ofed/drivers/infiniband/core/ib_user_mad.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_user_mad.c > head/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_cmd.c > head/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_main.c > head/sys/ofed/drivers/infiniband/core/ib_uverbs_marshall.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_uverbs_marshall= .c > head/sys/ofed/drivers/infiniband/core/ib_verbs.c > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/ib_verbs.c > head/sys/ofed/drivers/infiniband/core/iwpm_util.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/iwpm_util.h > head/sys/ofed/drivers/infiniband/core/opa_smi.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/drivers/infiniband/core/opa_smi.h > head/sys/ofed/include/rdma/ib.h > - copied unchanged from r326168, projects/bsd_rdma_4_9/sys/ofed/incl= ude/rdma/ib.h > head/sys/ofed/include/rdma/ib_hdrs.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/include/rdma/ib_hdrs.h > head/sys/ofed/include/rdma/ib_umem_odp.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/include/rdma/ib_umem_odp.h > head/sys/ofed/include/rdma/iw_portmap.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/include/rdma/iw_portmap.h > head/sys/ofed/include/rdma/opa_port_info.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/include/rdma/opa_port_info.h > head/sys/ofed/include/rdma/opa_smi.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/include/rdma/opa_smi.h > head/sys/ofed/include/rdma/rdma_vt.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/include/rdma/rdma_vt.h > head/sys/ofed/include/rdma/rdmavt_cq.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/include/rdma/rdmavt_cq.h > head/sys/ofed/include/rdma/rdmavt_mr.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/include/rdma/rdmavt_mr.h > head/sys/ofed/include/rdma/rdmavt_qp.h > - copied unchanged from r326168, > projects/bsd_rdma_4_9/sys/ofed/include/rdma/rdmavt_qp.h head/sys/ofed/inc= lude/uapi/ > - copied from r326168, projects/bsd_rdma_4_9/sys/ofed/include/uapi/ > Replaced: > head/contrib/ofed/ > - copied from r326168, projects/bsd_rdma_4_9/contrib/ofed/ > Deleted: > head/sys/dev/mlx4/mlx4_ib/mlx4_exp.h > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_exp.c > head/sys/dev/mlx4/mlx4_ib/user.h > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_roce.c > head/sys/dev/mlx5/mlx5_ib/user.h > head/sys/modules/mthca/ > head/sys/ofed/drivers/infiniband/Kconfig > head/sys/ofed/drivers/infiniband/Makefile > head/sys/ofed/drivers/infiniband/core/addr.c > head/sys/ofed/drivers/infiniband/core/agent.c > head/sys/ofed/drivers/infiniband/core/cache.c > head/sys/ofed/drivers/infiniband/core/cm.c > head/sys/ofed/drivers/infiniband/core/cma.c > head/sys/ofed/drivers/infiniband/core/device.c > head/sys/ofed/drivers/infiniband/core/fmr_pool.c > head/sys/ofed/drivers/infiniband/core/iwcm.c > head/sys/ofed/drivers/infiniband/core/mad.c > head/sys/ofed/drivers/infiniband/core/mad_rmpp.c > head/sys/ofed/drivers/infiniband/core/multicast.c > head/sys/ofed/drivers/infiniband/core/packer.c > head/sys/ofed/drivers/infiniband/core/peer_mem.c > head/sys/ofed/drivers/infiniband/core/sa_query.c > head/sys/ofed/drivers/infiniband/core/smi.c > head/sys/ofed/drivers/infiniband/core/sysfs.c > head/sys/ofed/drivers/infiniband/core/ucm.c > head/sys/ofed/drivers/infiniband/core/ucma.c > head/sys/ofed/drivers/infiniband/core/ud_header.c > head/sys/ofed/drivers/infiniband/core/umem.c > head/sys/ofed/drivers/infiniband/core/user_mad.c > head/sys/ofed/drivers/infiniband/core/uverbs_cmd.c > head/sys/ofed/drivers/infiniband/core/uverbs_main.c > head/sys/ofed/drivers/infiniband/core/uverbs_marshall.c > head/sys/ofed/drivers/infiniband/core/verbs.c > head/sys/ofed/drivers/infiniband/debug/Makefile > head/sys/ofed/drivers/infiniband/debug/memtrack.c > head/sys/ofed/drivers/infiniband/debug/memtrack.h > head/sys/ofed/drivers/infiniband/debug/mtrack.h > head/sys/ofed/drivers/infiniband/hw/ > head/sys/ofed/drivers/infiniband/ulp/ipoib/Kconfig > head/sys/ofed/drivers/infiniband/util/Kconfig > head/sys/ofed/include/rdma/ib_peer_mem.h > head/sys/ofed/include/rdma/ib_user_cm.h > head/sys/ofed/include/rdma/ib_user_mad.h > head/sys/ofed/include/rdma/ib_user_sa.h > head/sys/ofed/include/rdma/ib_user_verbs.h > head/sys/ofed/include/rdma/ib_user_verbs_exp.h > head/sys/ofed/include/rdma/ib_verbs_exp.h > head/sys/ofed/include/rdma/peer_mem.h > head/sys/ofed/include/rdma/rdma_user_cm.h > head/sys/ofed/include/rdma/sdp_socket.h > Modified: > head/Makefile.inc1 > head/share/mk/bsd.libnames.mk > head/share/mk/src.libnames.mk > head/sys/amd64/conf/NOTES > head/sys/conf/files > head/sys/conf/kern.pre.mk > head/sys/contrib/rdma/krping/krping.c > head/sys/contrib/rdma/krping/krping.h > head/sys/contrib/rdma/krping/krping_dev.c > head/sys/dev/cxgbe/adapter.h > head/sys/dev/cxgbe/common/common.h > head/sys/dev/cxgbe/common/t4_hw.c > head/sys/dev/cxgbe/iw_cxgbe/cm.c > head/sys/dev/cxgbe/iw_cxgbe/cq.c > head/sys/dev/cxgbe/iw_cxgbe/device.c > head/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h > head/sys/dev/cxgbe/iw_cxgbe/mem.c > head/sys/dev/cxgbe/iw_cxgbe/provider.c > head/sys/dev/cxgbe/iw_cxgbe/qp.c > head/sys/dev/cxgbe/iw_cxgbe/t4.h > head/sys/dev/cxgbe/iw_cxgbe/user.h > head/sys/dev/cxgbe/offload.h > head/sys/dev/cxgbe/t4_main.c > head/sys/dev/iser/icl_iser.c > head/sys/dev/iser/icl_iser.h > head/sys/dev/iser/iser_memory.c > head/sys/dev/iser/iser_verbs.c > head/sys/dev/mlx4/device.h > head/sys/dev/mlx4/mlx4_ib/mlx4_ib.h > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_ah.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_alias_GUID.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_cm.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_cq.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mad.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mcg.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_mr.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_srq.c > head/sys/dev/mlx4/mlx4_ib/mlx4_ib_sysfs.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib.h > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_ah.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_cq.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mad.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mem.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_mr.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_qp.c > head/sys/dev/mlx5/mlx5_ib/mlx5_ib_srq.c > head/sys/dev/mlx5/qp.h > head/sys/i386/conf/NOTES > head/sys/modules/Makefile > head/sys/modules/cxgbe/iw_cxgbe/Makefile > head/sys/modules/ibcore/Makefile > head/sys/modules/ipoib/Makefile > head/sys/modules/iser/Makefile > head/sys/modules/mlx4/Makefile > head/sys/modules/mlx4ib/Makefile > head/sys/modules/mlx5ib/Makefile > head/sys/modules/rdma/krping/Makefile > head/sys/ofed/drivers/infiniband/core/agent.h > head/sys/ofed/drivers/infiniband/core/cm_msgs.h > head/sys/ofed/drivers/infiniband/core/core_priv.h > head/sys/ofed/drivers/infiniband/core/iwcm.h > head/sys/ofed/drivers/infiniband/core/mad_priv.h > head/sys/ofed/drivers/infiniband/core/smi.h > head/sys/ofed/drivers/infiniband/core/uverbs.h > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_multicast.c > head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_verbs.c > head/sys/ofed/drivers/infiniband/ulp/sdp/sdp.h > head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_cma.c > head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c > head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_proc.c > head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c > head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_tx.c > head/sys/ofed/include/rdma/ib_addr.h > head/sys/ofed/include/rdma/ib_cache.h > head/sys/ofed/include/rdma/ib_cm.h > head/sys/ofed/include/rdma/ib_mad.h > head/sys/ofed/include/rdma/ib_pack.h > head/sys/ofed/include/rdma/ib_pma.h > head/sys/ofed/include/rdma/ib_sa.h > head/sys/ofed/include/rdma/ib_smi.h > head/sys/ofed/include/rdma/ib_umem.h > head/sys/ofed/include/rdma/ib_verbs.h > head/sys/ofed/include/rdma/iw_cm.h > head/sys/ofed/include/rdma/rdma_cm.h > head/targets/pseudo/userland/lib/Makefile.depend > Directory Properties: > head/ (props changed) > head/MAINTAINERS (props changed) > head/cddl/ (props changed) > head/cddl/contrib/opensolaris/ (props changed) > head/cddl/contrib/opensolaris/cmd/zdb/ (props changed) > head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) > head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) > head/contrib/atf/ (props changed) > head/contrib/binutils/ (props changed) > head/contrib/blacklist/ (props changed) > head/contrib/bmake/ (props changed) > head/contrib/byacc/ (props changed) > head/contrib/compiler-rt/ (props changed) > head/contrib/dma/ (props changed) > head/contrib/elftoolchain/ (props changed) > head/contrib/elftoolchain/ar/ (props changed) > head/contrib/elftoolchain/elfdump/ (props changed) > head/contrib/file/ (props changed) > head/contrib/gcc/ (props changed) > head/contrib/ipfilter/ (props changed) > head/contrib/less/ (props changed) > head/contrib/libarchive/ (props changed) > head/contrib/libc++/ (props changed) > head/contrib/libc-vis/ (props changed) > head/contrib/libpcap/ (props changed) > head/contrib/libstdc++/ (props changed) > head/contrib/libxo/ (props changed) > head/contrib/llvm/ (props changed) > head/contrib/llvm/projects/libunwind/ (props changed) > head/contrib/llvm/tools/clang/ (props changed) > head/contrib/llvm/tools/lld/ (props changed) > head/contrib/llvm/tools/lldb/ (props changed) > head/contrib/mdocml/ (props changed) > head/contrib/netbsd-tests/ (props changed) > head/contrib/one-true-awk/ (props changed) > head/contrib/openbsm/ (props changed) > head/contrib/openpam/ (props changed) > head/contrib/pjdfstest/ (props changed) > head/contrib/sqlite3/ (props changed) > head/contrib/subversion/ (props changed) > head/contrib/tcpdump/ (props changed) > head/contrib/top/ (props changed) > head/contrib/tzdata/ (props changed) > head/contrib/unbound/ (props changed) > head/contrib/wpa/ (props changed) > head/contrib/xz/ (props changed) > head/contrib/zlib/ (props changed) > head/crypto/heimdal/ (props changed) > head/crypto/openssh/ (props changed) > head/crypto/openssl/ (props changed) > head/gnu/lib/ (props changed) > head/gnu/usr.bin/binutils/ (props changed) > head/gnu/usr.bin/cc/cc_tools/ (props changed) > head/gnu/usr.bin/gdb/ (props changed) > head/lib/libc/locale/ascii.c (props changed) > head/lib/libedit/ (props changed) > head/sys/amd64/amd64/efirt_machdep.c (props changed) > head/sys/cddl/contrib/opensolaris/ (props changed) > head/sys/contrib/dev/acpica/ (props changed) > head/sys/contrib/ena-com/ (props changed) > head/sys/contrib/ipfilter/ (props changed) > head/sys/contrib/octeon-sdk/ (props changed) > head/sys/contrib/zstd/ (props changed) > head/sys/dev/efidev/efirt.c (props changed) > head/sys/gnu/dts/arm/ (props changed) > head/sys/gnu/dts/include/ (props changed) > head/usr.sbin/bhyve/bhyvegc.c (props changed) > head/usr.sbin/bhyve/pci_fbuf.c (props changed) > head/usr.sbin/bhyve/pci_xhci.c (props changed) > head/usr.sbin/bhyve/rfb.c (props changed) > head/usr.sbin/bhyve/rfb.h (props changed) > head/usr.sbin/bhyve/vga.c (props changed) >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/Makefile.inc1 Fri Nov 24 14:29:32 2017 (r326168) > +++ head/Makefile.inc1 Fri Nov 24 14:50:28 2017 (r326169) > @@ -2410,16 +2410,24 @@ _lib_libradius=3D lib/libradius > .endif > =20 > .if ${MK_OFED} !=3D "no" > -_ofed_lib=3D contrib/ofed/usr.lib > -_prebuild_libs+=3D contrib/ofed/usr.lib/libosmcomp > -_prebuild_libs+=3D contrib/ofed/usr.lib/libopensm > -_prebuild_libs+=3D contrib/ofed/usr.lib/libibcommon > -_prebuild_libs+=3D contrib/ofed/usr.lib/libibverbs > -_prebuild_libs+=3D contrib/ofed/usr.lib/libibumad > +# > +# The OFED libraries are built in four steps > +# as reflected below, due to interdependencies. > +# > +# NOTE: Depending on contrib/ofed/include is only needed for > +# the lib32 compat build. > +# > +_ofed_lib=3D \ > +contrib/ofed/include \ > +contrib/ofed/usr.lib/0 \ > +contrib/ofed/usr.lib/1 \ > +contrib/ofed/usr.lib/2 \ > +contrib/ofed/usr.lib/3 > =20 > -contrib/ofed/usr.lib/libopensm__L: lib/libthr__L > -contrib/ofed/usr.lib/libosmcomp__L: lib/libthr__L > -contrib/ofed/usr.lib/libibumad__L: contrib/ofed/usr.lib/libibcommon__L > +contrib/ofed/usr.lib/0__L: contrib/ofed/include__L lib/libthr__L > +contrib/ofed/usr.lib/1__L: contrib/ofed/usr.lib/0__L > +contrib/ofed/usr.lib/2__L: contrib/ofed/usr.lib/1__L > +contrib/ofed/usr.lib/3__L: contrib/ofed/usr.lib/2__L > .endif > =20 > .if ${MK_CASPER} !=3D "no" >=20 > Modified: head/share/mk/bsd.libnames.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/mk/bsd.libnames.mk Fri Nov 24 14:29:32 2017 (r326168) > +++ head/share/mk/bsd.libnames.mk Fri Nov 24 14:50:28 2017 (r326169) > @@ -82,9 +82,8 @@ LIBHEIMNTLM?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libheimntlm. > LIBHEIMSQLITE?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libheimsqlite.a > LIBHX509?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libhx509.a > LIBIBCM?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libibcm.a > -LIBIBCOMMON?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libibcommon.a > LIBIBMAD?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libibmad.a > -LIBIBSDP?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libibsdp.a > +LIBIBNETDISC?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libibnetdisc.a > LIBIBUMAD?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libibumad.a > LIBIBVERBS?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libibverbs.a > LIBIFCONFIG?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libifconfig.a > @@ -108,9 +107,9 @@ LIBMEMSTAT?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libmemstat= .a > LIBMENU?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libmenu.a > LIBMILTER?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libmilter.a > LIBMLX4?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libmlx4.a > +LIBMLX5?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libmlx5.a > LIBMP?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libmp.a > LIBMT?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libmt.a > -LIBMTHCA?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libmthca.a > LIBNANDFS?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libnandfs.a > LIBNCURSES?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libncurses.a > LIBNCURSESW?=3D ${LIBDESTDIR}${LIBDIR_BASE}/libncursesw.a >=20 > Modified: head/share/mk/src.libnames.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/mk/src.libnames.mk Fri Nov 24 14:29:32 2017 (r326168) > +++ head/share/mk/src.libnames.mk Fri Nov 24 14:50:28 2017 (r326169) > @@ -194,18 +194,16 @@ _LIBRARIES+=3D \ > _LIBRARIES+=3D \ > cxgb4 \ > ibcm \ > - ibcommon \ > ibmad \ > - ibsdp \ > + ibnetdisc \ > ibumad \ > ibverbs \ > mlx4 \ > - mthca \ > - opensm \ > - osmcomp \ > - osmvendor \ > + mlx5 \ > rdmacm \ > - > + osmcomp \ > + opensm \ > + osmvendor > .endif > =20 > # Each library's LIBADD needs to be duplicated here for static linkage of > @@ -332,17 +330,21 @@ _DP_zfs=3D md pthread umem util uutil m nvpair avl = bsdxm > zfs_core > _DP_zfs_core=3D nvpair > _DP_zpool=3D md pthread z nvpair avl umem > + > +# OFED support > .if ${MK_OFED} !=3D "no" > _DP_cxgb4=3D ibverbs pthread > _DP_ibcm=3D ibverbs > -_DP_ibmad=3D ibcommon ibumad > -_DP_ibumad=3D ibcommon > +_DP_ibmad=3D ibumad > +_DP_ibnetdisc=3D osmcomp ibmad ibumad > +_DP_ibumad=3D=09 > +_DP_ibverbs=3D > _DP_mlx4=3D ibverbs pthread > -_DP_mthca=3D ibverbs pthread > -_DP_opensm=3D pthread > -_DP_osmcomp=3D pthread > -_DP_osmvendor=3D ibumad opensm osmcomp pthread > +_DP_mlx5=3D ibverbs pthread > _DP_rdmacm=3D ibverbs > +_DP_osmcomp=3D pthread > +_DP_opensm=3D pthread > +_DP_osmvendor=3D ibumad pthread > .endif > =20 > # Define special cases > @@ -483,19 +485,21 @@ LIBUUTILDIR=3D ${OBJTOP}/cddl/lib/libuutil > LIBZFSDIR=3D ${OBJTOP}/cddl/lib/libzfs > LIBZFS_COREDIR=3D ${OBJTOP}/cddl/lib/libzfs_core > LIBZPOOLDIR=3D ${OBJTOP}/cddl/lib/libzpool > -LIBCXGB4DIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libcxgb4 > -LIBIBCMDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libibcm > -LIBIBCOMMONDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libibcommon > -LIBIBMADDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libibmad > -LIBIBUMADDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libibumad > -LIBIBVERBSDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libibverbs > -LIBMLX4DIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libmlx4 > -LIBMTHCADIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libmthca > -LIBOPENSMDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libopensm > -LIBOSMCOMPDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libosmcomp > -LIBOSMVENDORDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libosmvendor > -LIBRDMACMDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/librdmacm > -LIBIBSDPDIR=3D ${OBJTOP}/contrib/ofed/usr.lib/libsdp > + > +# OFED support > +LIBCXGB4DIR=3D ${OBJTOP}/contrib/ofed/libcxgb4 > +LIBIBCMDIR=3D ${OBJTOP}/contrib/ofed/libibcm > +LIBIBMADDIR=3D ${OBJTOP}/contrib/ofed/libibmad > +LIBIBNETDISCDIR=3D${OBJTOP}/contrib/ofed/libibnetdisc > +LIBIBUMADDIR=3D ${OBJTOP}/contrib/ofed/libibumad > +LIBIBVERBSDIR=3D ${OBJTOP}/contrib/ofed/libibverbs > +LIBMLX4DIR=3D ${OBJTOP}/contrib/ofed/libmlx4 > +LIBMLX5DIR=3D ${OBJTOP}/contrib/ofed/libmlx5 > +LIBRDMACMDIR=3D ${OBJTOP}/contrib/ofed/librdmacm > +LIBOSMCOMPDIR=3D ${OBJTOP}/contrib/ofed/opensm/complib > +LIBOPENSMDIR=3D ${OBJTOP}/contrib/ofed/opensm/libopensm > +LIBOSMVENDORDIR=3D${OBJTOP}/contrib/ofed/opensm/libvendor > + > LIBDIALOGDIR=3D ${OBJTOP}/gnu/lib/libdialog > LIBGCOVDIR=3D ${OBJTOP}/gnu/lib/libgcov > LIBGOMPDIR=3D ${OBJTOP}/gnu/lib/libgomp >=20 > Modified: head/sys/amd64/conf/NOTES > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/amd64/conf/NOTES Fri Nov 24 14:29:32 2017 (r326168) > +++ head/sys/amd64/conf/NOTES Fri Nov 24 14:50:28 2017 (r326169) > @@ -317,7 +317,6 @@ options DRM_DEBUG # Include debug printfs (slow) > # ixlv: Intel XL710 40Gbe VF PCIE Ethernet > # mlx4ib: Mellanox ConnectX HCA InfiniBand > # mlx4en: Mellanox ConnectX HCA Ethernet > -# mthca: Mellanox HCA InfiniBand > # nfe: nVidia nForce MCP on-board Ethernet Networking (BSD open source) > # sfxge: Solarflare SFC9000 family 10Gb Ethernet adapters > # vmx: VMware VMXNET3 Ethernet (BSD open source) > @@ -338,7 +337,6 @@ device ixlv # Intel XL710 40Gbe VF > PCIE Ethernet device mlx4 # Shared code module between IB and > Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand > device mlx4en # Mellanox ConnectX HCA Ethernet > -device mthca # Mellanox HCA InfiniBand > device nfe # nVidia nForce MCP on-board Ethernet > device sfxge # Solarflare SFC9000 10Gb Ethernet > device vmx # VMware VMXNET3 Ethernet >=20 > Modified: head/sys/conf/files > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/conf/files Fri Nov 24 14:29:32 2017 (r326168) > +++ head/sys/conf/files Fri Nov 24 14:50:28 2017 (r326169) > @@ -4453,58 +4453,62 @@ compat/linuxkpi/common/src/linux_work.c optional > comp compile-with "${LINUXKPI_C}" > =20 > # OpenFabrics Enterprise Distribution (Infiniband) > -ofed/drivers/infiniband/core/addr.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/agent.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/cache.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -# XXX Mad.c must be ordered before cm.c for sysinit sets to occur in > -# the correct order. > -ofed/drivers/infiniband/core/mad.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/cm.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/ > -Wno-unused-function" -ofed/drivers/infiniband/core/cma.c optional > ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/device.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/fmr_pool.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/iwcm.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/mad_rmpp.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/multicast.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/packer.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/peer_mem.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/sa_query.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/smi.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/sysfs.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/ucm.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/ucma.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/ud_header.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/umem.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/user_mad.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/uverbs_cmd.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/uverbs_main.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/uverbs_marshall.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > -ofed/drivers/infiniband/core/verbs.c optional ofed \ > - compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/core/" > +ofed/drivers/infiniband/core/ib_addr.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_agent.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_cache.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_cm.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_cma.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_cq.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_device.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_fmr_pool.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_iwcm.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_iwpm_msg.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_iwpm_util.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_mad.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_mad_rmpp.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_multicast.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_packer.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_roce_gid_mgmt.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_sa_query.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_smi.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_sysfs.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_ucm.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_ucma.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_ud_header.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_umem.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_user_mad.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_uverbs_cmd.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_uverbs_main.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_uverbs_marshall.c optional ofed \ > + compile-with "${OFED_C}" > +ofed/drivers/infiniband/core/ib_verbs.c optional ofed \ > + compile-with "${OFED_C}" > =20 > ofed/drivers/infiniband/ulp/ipoib/ipoib_cm.c optional ipoib \ > compile-with "${OFED_C} -I$S/ofed/drivers/infiniband/ulp/ipoib/" > @@ -4550,8 +4554,6 @@ dev/mlx4/mlx4_ib/mlx4_ib_mad.c optional > mlx4ib pci o compile-with "${OFED_C}" > dev/mlx4/mlx4_ib/mlx4_ib_main.c optional mlx4ib pci ofed \ > compile-with "${OFED_C}" > -dev/mlx4/mlx4_ib/mlx4_ib_exp.c optional mlx4ib pci ofed \ > - compile-with "${OFED_C}" > dev/mlx4/mlx4_ib/mlx4_ib_mr.c optional mlx4ib pci ofed \ > compile-with "${OFED_C}" > dev/mlx4/mlx4_ib/mlx4_ib_qp.c optional mlx4ib pci ofed \ > @@ -4623,6 +4625,8 @@ dev/mlx5/mlx5_ib/mlx5_ib_cq.c optional > mlx5ib pci of compile-with "${OFED_C}" > dev/mlx5/mlx5_ib/mlx5_ib_doorbell.c optional mlx5ib pci ofed \ > compile-with "${OFED_C}" > +dev/mlx5/mlx5_ib/mlx5_ib_gsi.c optional mlx5ib pci ofed \ > + compile-with "${OFED_C}" > dev/mlx5/mlx5_ib/mlx5_ib_mad.c optional mlx5ib pci ofed \ > compile-with "${OFED_C}" > dev/mlx5/mlx5_ib/mlx5_ib_main.c optional mlx5ib pci ofed \ > @@ -4633,10 +4637,10 @@ dev/mlx5/mlx5_ib/mlx5_ib_mr.c optional > mlx5ib pci of compile-with "${OFED_C}" > dev/mlx5/mlx5_ib/mlx5_ib_qp.c optional mlx5ib pci ofed \ > compile-with "${OFED_C}" > -dev/mlx5/mlx5_ib/mlx5_ib_roce.c optional mlx5ib pci ofed \ > - compile-with "${OFED_C}" > dev/mlx5/mlx5_ib/mlx5_ib_srq.c optional mlx5ib pci ofed \ > compile-with "${OFED_C}" > +dev/mlx5/mlx5_ib/mlx5_ib_virt.c optional mlx5ib pci ofed \ > + compile-with "${OFED_C}" > =20 > dev/mlx5/mlx5_core/mlx5_alloc.c optional mlx5 pci \ > compile-with "${OFED_C}" > @@ -4694,43 +4698,6 @@ dev/mlx5/mlx5_en/mlx5_en_flow_table.c optional > mlx5en dev/mlx5/mlx5_en/mlx5_en_rx.c optional mlx5en pci inet > inet6 \ compile-with "${OFED_C}" > dev/mlx5/mlx5_en/mlx5_en_txrx.c optional mlx5en pci inet > inet6 \ > - compile-with "${OFED_C}" > - > -ofed/drivers/infiniband/hw/mthca/mthca_allocator.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_av.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_catas.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_cmd.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_cq.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_eq.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_mad.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_main.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_mcg.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_memfree.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_mr.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_pd.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_profile.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_provider.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_qp.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_reset.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_srq.c optional mthca \ > - compile-with "${OFED_C}" > -ofed/drivers/infiniband/hw/mthca/mthca_uar.c optional mthca \ > compile-with "${OFED_C}" > =20 > # crypto support >=20 > Modified: head/sys/conf/kern.pre.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/conf/kern.pre.mk Fri Nov 24 14:29:32 2017 (r326168) > +++ head/sys/conf/kern.pre.mk Fri Nov 24 14:50:28 2017 (r326169) > @@ -178,9 +178,10 @@ LINUXKPI_C=3D ${NORMAL_C} ${LINUXKPI_INCLUDES} > =20 > # Infiniband C flags. Correct include paths and omit errors that linux > # does not honor. > -OFEDINCLUDES=3D -I$S/ofed/include ${LINUXKPI_INCLUDES} > +OFEDINCLUDES=3D -I$S/ofed/include -I$S/ofed/include/uapi ${LINUXKPI_INCL= UDES} > OFEDNOERR=3D -Wno-cast-qual -Wno-pointer-arith > -OFEDCFLAGS=3D ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} > +OFEDCFLAGS=3D ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_MEM \ > + ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} > OFED_C_NOIMP=3D ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF} > OFED_C=3D ${OFED_C_NOIMP} ${.IMPSRC} > =20 >=20 > Modified: head/sys/contrib/rdma/krping/krping.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/contrib/rdma/krping/krping.c Fri Nov 24 14:29:32 2017 > (r326168) +++ head/sys/contrib/rdma/krping/krping.c Fri Nov 24 14:50:28 > 2017 (r326169) @@ -54,13 +54,14 @@ __FBSDID("$FreeBSD$"); > #include "krping.h" > #include "getopt.h" > =20 > +#define PFX "krping: " > + > extern int krping_debug; > -#define DEBUG_LOG(cb, x...) if (krping_debug) log(LOG_INFO, x) > -#define PRINTF(cb, x...) log(LOG_INFO, x) > +#define DEBUG_LOG(...) do { if (krping_debug) log(LOG_INFO, __VA_ARGS__)= ; } while (0) > #define BIND_INFO 1 > =20 > MODULE_AUTHOR("Steve Wise"); > -MODULE_DESCRIPTION("RDMA ping client/server"); > +MODULE_DESCRIPTION("RDMA ping server"); > MODULE_LICENSE("Dual BSD/GPL"); > MODULE_VERSION(krping, 1); > MODULE_DEPEND(krping, linuxkpi, 1, 1, 1); > @@ -77,9 +78,7 @@ typedef uint64_t cycles_t; > =20 > enum mem_type { > DMA =3D 1, > - FASTREG =3D 2, > - MW =3D 3, > - MR =3D 4 > + REG =3D 2, > }; > =20 > static const struct krping_option krping_opts[] =3D { > @@ -92,7 +91,6 @@ static const struct krping_option krping_opts[] =3D { > {"validate", OPT_NOPARAM, 'V'}, > {"server", OPT_NOPARAM, 's'}, > {"client", OPT_NOPARAM, 'c'}, > - {"mem_mode", OPT_STRING, 'm'}, > {"server_inv", OPT_NOPARAM, 'I'}, > {"wlat", OPT_NOPARAM, 'l'}, > {"rlat", OPT_NOPARAM, 'L'}, > @@ -102,14 +100,14 @@ static const struct krping_option krping_opts[] =3D= { > {"poll", OPT_NOPARAM, 'P'}, > {"local_dma_lkey", OPT_NOPARAM, 'Z'}, > {"read_inv", OPT_NOPARAM, 'R'}, > - {"fr", OPT_INT, 'f'}, > + {"fr", OPT_NOPARAM, 'f'}, > {NULL, 0, 0} > }; > =20 > #define htonll(x) cpu_to_be64((x)) > #define ntohll(x) cpu_to_be64((x)) > =20 > -static struct mutex krping_mutex; > +static DEFINE_MUTEX(krping_mutex); > =20 > /* > * List of running krping threads. > @@ -117,6 +115,13 @@ static struct mutex krping_mutex; > static LIST_HEAD(krping_cbs); > =20 > /* > + * Invoke like this, one on each side, using the server's address on > + * the RDMA device (iw%d): > + * > + * /bin/echo server,port=3D9999,addr=3D192.168.69.142,validate > /proc/k= rping =20 > + * /bin/echo client,port=3D9999,addr=3D192.168.69.142,validate > /proc/k= rping =20 > + * /bin/echo client,port=3D9999,addr6=3D2001:db8:0:f101::1,validate > /p= roc/krping > + * > * krping "ping/pong" loop: > * client sends source rkey/addr/len > * server receives source rkey/add/len > @@ -165,42 +170,35 @@ struct krping_rdma_info { > * Control block struct. > */ > struct krping_cb { > - void *cookie; > int server; /* 0 iff client */ > struct ib_cq *cq; > struct ib_pd *pd; > struct ib_qp *qp; > =20 > - enum mem_type mem; > struct ib_mr *dma_mr; > =20 > struct ib_fast_reg_page_list *page_list; > int page_list_len; > - struct ib_send_wr fastreg_wr; > + struct ib_reg_wr reg_mr_wr; > struct ib_send_wr invalidate_wr; > - struct ib_mr *fastreg_mr; > + struct ib_mr *reg_mr; > int server_invalidate; > int read_inv; > u8 key; > =20 > - struct ib_mw *mw; > - struct ib_mw_bind bind_attr; > - > struct ib_recv_wr rq_wr; /* recv work request record */ > struct ib_sge recv_sgl; /* recv single SGE */ > - struct krping_rdma_info recv_buf;/* malloc'd buffer */ > + struct krping_rdma_info recv_buf __aligned(16); /* malloc'd buffer */ > u64 recv_dma_addr; > DECLARE_PCI_UNMAP_ADDR(recv_mapping) > - struct ib_mr *recv_mr; > =20 > struct ib_send_wr sq_wr; /* send work requrest record */ > struct ib_sge send_sgl; > - struct krping_rdma_info send_buf;/* single send buf */ > + struct krping_rdma_info send_buf __aligned(16); /* single send buf */ > u64 send_dma_addr; > DECLARE_PCI_UNMAP_ADDR(send_mapping) > - struct ib_mr *send_mr; > =20 > - struct ib_send_wr rdma_sq_wr; /* rdma work request record */ > + struct ib_rdma_wr rdma_sq_wr; /* rdma work request record */ > struct ib_sge rdma_sgl; /* rdma single SGE */ > char *rdma_buf; /* used as rdma sink */ > u64 rdma_dma_addr; > @@ -221,12 +219,9 @@ struct krping_cb { > struct krping_stats stats; > =20 > uint16_t port; /* dst port in NBO */ > - union { > - struct in_addr v4; > - struct in6_addr v6; > - } addr; /* dst addr in NBO */ > - int addr_type; /* AF_INET or AF_INET6 */ > + u8 addr[16] __aligned(8); /* dst addr in NBO */ > char *addr_str; /* dst addr string */ > + uint8_t addr_type; /* ADDR_FAMILY - IPv4/V6 */ > int verbose; /* verbose logging */ > int count; /* ping count */ > int size; /* ping data size */ > @@ -238,8 +233,7 @@ struct krping_cb { > int poll; /* poll or block for rlat test */ > int txdepth; /* SQ depth */ > int local_dma_lkey; /* use 0 for lkey */ > - int frtest; /* fastreg test */ > - int testnum; > + int frtest; /* reg test */ > =20 > /* CM stuff */ > struct rdma_cm_id *cm_id; /* connection on client side,*/ > @@ -254,39 +248,34 @@ static int krping_cma_event_handler(struct rdma_cm_= id=20 > int ret; > struct krping_cb *cb =3D cma_id->context; > =20 > - DEBUG_LOG(cb, "cma_event type %d cma_id %p (%s)\n", event->event, > - cma_id, (cma_id =3D=3D cb->cm_id) ? "parent" : "child"); > + DEBUG_LOG("cma_event type %d cma_id %p (%s)\n", event->event, cma_id, > + (cma_id =3D=3D cb->cm_id) ? "parent" : "child"); > =20 > switch (event->event) { > case RDMA_CM_EVENT_ADDR_RESOLVED: > cb->state =3D ADDR_RESOLVED; > ret =3D rdma_resolve_route(cma_id, 2000); > if (ret) { > - PRINTF(cb, "rdma_resolve_route error %d\n", ret); > + printk(KERN_ERR PFX "rdma_resolve_route error %d\n",=20 > + ret); > wake_up_interruptible(&cb->sem); > } > break; > =20 > case RDMA_CM_EVENT_ROUTE_RESOLVED: > cb->state =3D ROUTE_RESOLVED; > - cb->child_cm_id =3D cma_id; > wake_up_interruptible(&cb->sem); > break; > =20 > case RDMA_CM_EVENT_CONNECT_REQUEST: > - if (cb->state =3D=3D IDLE) { > - cb->state =3D CONNECT_REQUEST; > - cb->child_cm_id =3D cma_id; > - } else { > - PRINTF(cb, "Received connection request in wrong state" > - " (%d)\n", cb->state); > - } > - DEBUG_LOG(cb, "child cma %p\n", cb->child_cm_id); > + cb->state =3D CONNECT_REQUEST; > + cb->child_cm_id =3D cma_id; > + DEBUG_LOG("child cma %p\n", cb->child_cm_id); > wake_up_interruptible(&cb->sem); > break; > =20 > case RDMA_CM_EVENT_ESTABLISHED: > - DEBUG_LOG(cb, "ESTABLISHED\n"); > + DEBUG_LOG("ESTABLISHED\n"); > if (!cb->server) { > cb->state =3D CONNECTED; > } > @@ -298,24 +287,24 @@ static int krping_cma_event_handler(struct rdma_cm_= id=20 > case RDMA_CM_EVENT_CONNECT_ERROR: > case RDMA_CM_EVENT_UNREACHABLE: > case RDMA_CM_EVENT_REJECTED: > - PRINTF(cb, "cma event %d, error %d\n", event->event, > + printk(KERN_ERR PFX "cma event %d, error %d\n", event->event, > event->status); > cb->state =3D ERROR; > wake_up_interruptible(&cb->sem); > break; > =20 > case RDMA_CM_EVENT_DISCONNECTED: > - PRINTF(cb, "DISCONNECT EVENT...\n"); > + printk(KERN_ERR PFX "DISCONNECT EVENT...\n"); > cb->state =3D ERROR; > wake_up_interruptible(&cb->sem); > break; > =20 > case RDMA_CM_EVENT_DEVICE_REMOVAL: > - PRINTF(cb, "cma detected device removal!!!!\n"); > + printk(KERN_ERR PFX "cma detected device removal!!!!\n"); > break; > =20 > default: > - PRINTF(cb, "oof bad type!\n"); > + printk(KERN_ERR PFX "oof bad type!\n"); > wake_up_interruptible(&cb->sem); > break; > } > @@ -325,7 +314,7 @@ static int krping_cma_event_handler(struct rdma_cm_id= =20 > static int server_recv(struct krping_cb *cb, struct ib_wc *wc) > { > if (wc->byte_len !=3D sizeof(cb->recv_buf)) { > - PRINTF(cb, "Received bogus data, size %d\n",=20 > + printk(KERN_ERR PFX "Received bogus data, size %d\n",=20 > wc->byte_len); > return -1; > } > @@ -333,7 +322,7 @@ static int server_recv(struct krping_cb *cb, struct ib > cb->remote_rkey =3D ntohl(cb->recv_buf.rkey); > cb->remote_addr =3D ntohll(cb->recv_buf.buf); > cb->remote_len =3D ntohl(cb->recv_buf.size); > - DEBUG_LOG(cb, "Received rkey %x addr %llx len %d from peer\n", > + DEBUG_LOG("Received rkey %x addr %llx len %d from peer\n", > cb->remote_rkey, (unsigned long long)cb->remote_addr,=20 > cb->remote_len); > =20 > @@ -348,7 +337,7 @@ static int server_recv(struct krping_cb *cb, struct ib > static int client_recv(struct krping_cb *cb, struct ib_wc *wc) > { > if (wc->byte_len !=3D sizeof(cb->recv_buf)) { > - PRINTF(cb, "Received bogus data, size %d\n",=20 > + printk(KERN_ERR PFX "Received bogus data, size %d\n",=20 > wc->byte_len); > return -1; > } > @@ -370,18 +359,22 @@ static void krping_cq_event_handler(struct ib_cq *c= q,=20 > =20 > BUG_ON(cb->cq !=3D cq); > if (cb->state =3D=3D ERROR) { > - PRINTF(cb, "cq completion in ERROR state\n"); > + printk(KERN_ERR PFX "cq completion in ERROR state\n"); > return; > } > - if (!cb->wlat && !cb->rlat && !cb->bw && !cb->frtest) > + if (cb->frtest) { > + printk(KERN_ERR PFX "cq completion event in frtest!\n"); > + return; > + } > + if (!cb->wlat && !cb->rlat && !cb->bw) > ib_req_notify_cq(cb->cq, IB_CQ_NEXT_COMP); > while ((ret =3D ib_poll_cq(cb->cq, 1, &wc)) =3D=3D 1) { > if (wc.status) { > if (wc.status =3D=3D IB_WC_WR_FLUSH_ERR) { > - DEBUG_LOG(cb, "cq flushed\n"); > + DEBUG_LOG("cq flushed\n"); > continue; > } else { > - PRINTF(cb, "cq completion failed with " > + printk(KERN_ERR PFX "cq completion failed with " > "wr_id %jx status %d opcode %d vender_err %x\n", > (uintmax_t)wc.wr_id, wc.status, wc.opcode, > wc.vendor_err); goto error; > @@ -390,44 +383,44 @@ static void krping_cq_event_handler(struct ib_cq *c= q,=20 > =20 > switch (wc.opcode) { > case IB_WC_SEND: > - DEBUG_LOG(cb, "send completion\n"); > + DEBUG_LOG("send completion\n"); > cb->stats.send_bytes +=3D cb->send_sgl.length; > cb->stats.send_msgs++; > break; > =20 > case IB_WC_RDMA_WRITE: > - DEBUG_LOG(cb, "rdma write completion\n"); > - cb->stats.write_bytes +=3D cb->rdma_sq_wr.sg_list->length; > + DEBUG_LOG("rdma write completion\n"); > + cb->stats.write_bytes +=3D cb->rdma_sq_wr.wr.sg_list->length; > cb->stats.write_msgs++; > cb->state =3D RDMA_WRITE_COMPLETE; > wake_up_interruptible(&cb->sem); > break; > =20 > case IB_WC_RDMA_READ: > - DEBUG_LOG(cb, "rdma read completion\n"); > - cb->stats.read_bytes +=3D cb->rdma_sq_wr.sg_list->length; > + DEBUG_LOG("rdma read completion\n"); > + cb->stats.read_bytes +=3D cb->rdma_sq_wr.wr.sg_list->length; > cb->stats.read_msgs++; > cb->state =3D RDMA_READ_COMPLETE; > wake_up_interruptible(&cb->sem); > break; > =20 > case IB_WC_RECV: > - DEBUG_LOG(cb, "recv completion\n"); > + DEBUG_LOG("recv completion\n"); > cb->stats.recv_bytes +=3D sizeof(cb->recv_buf); > cb->stats.recv_msgs++; > - if (cb->wlat || cb->rlat || cb->bw || cb->frtest) > + if (cb->wlat || cb->rlat || cb->bw) > ret =3D server_recv(cb, &wc); > else > ret =3D cb->server ? server_recv(cb, &wc) : > client_recv(cb, &wc); > if (ret) { > - PRINTF(cb, "recv wc error: %d\n", ret); > + printk(KERN_ERR PFX "recv wc error: %d\n", ret); > goto error; > } > =20 > ret =3D ib_post_recv(cb->qp, &cb->rq_wr, &bad_wr); > if (ret) { > - PRINTF(cb, "post recv error: %d\n",=20 > + printk(KERN_ERR PFX "post recv error: %d\n",=20 > ret); > goto error; > } > @@ -435,14 +428,14 @@ static void krping_cq_event_handler(struct ib_cq *c= q,=20 > break; > =20 > default: > - PRINTF(cb,=20 > + printk(KERN_ERR PFX > "%s:%d Unexpected opcode %d, Shutting down\n", > __func__, __LINE__, wc.opcode); > goto error; > } > } > if (ret) { > - PRINTF(cb, "poll error %d\n", ret); > + printk(KERN_ERR PFX "poll error %d\n", ret); > goto error; > } > return; > @@ -456,7 +449,7 @@ static int krping_accept(struct krping_cb *cb) > struct rdma_conn_param conn_param; > int ret; > =20 > - DEBUG_LOG(cb, "accepting client connection request\n"); > + DEBUG_LOG("accepting client connection request\n"); > =20 > memset(&conn_param, 0, sizeof conn_param); > conn_param.responder_resources =3D 1; > @@ -464,14 +457,14 @@ static int krping_accept(struct krping_cb *cb) > =20 > ret =3D rdma_accept(cb->child_cm_id, &conn_param); > if (ret) { > - PRINTF(cb, "rdma_accept error: %d\n", ret); > + printk(KERN_ERR PFX "rdma_accept error: %d\n", ret); > return ret; > } > =20 > - if (!cb->wlat && !cb->rlat && !cb->bw && !cb->frtest) { > + if (!cb->wlat && !cb->rlat && !cb->bw) { > wait_event_interruptible(cb->sem, cb->state >=3D CONNECTED); > if (cb->state =3D=3D ERROR) { > - PRINTF(cb, "wait for CONNECTED state %d\n",=20 > + printk(KERN_ERR PFX "wait for CONNECTED state %d\n",=20 > cb->state); > return -1; > } > @@ -483,278 +476,120 @@ static void krping_setup_wr(struct krping_cb *cb) > { > cb->recv_sgl.addr =3D cb->recv_dma_addr; > cb->recv_sgl.length =3D sizeof cb->recv_buf; > - if (cb->local_dma_lkey) > - cb->recv_sgl.lkey =3D cb->qp->device->local_dma_lkey; > - else if (cb->mem =3D=3D DMA) > - cb->recv_sgl.lkey =3D cb->dma_mr->lkey; > - else > - cb->recv_sgl.lkey =3D cb->recv_mr->lkey; > + cb->recv_sgl.lkey =3D cb->pd->local_dma_lkey; > cb->rq_wr.sg_list =3D &cb->recv_sgl; > cb->rq_wr.num_sge =3D 1; > =20 > cb->send_sgl.addr =3D cb->send_dma_addr; > cb->send_sgl.length =3D sizeof cb->send_buf; > - if (cb->local_dma_lkey) > - cb->send_sgl.lkey =3D cb->qp->device->local_dma_lkey; > - else if (cb->mem =3D=3D DMA) > - cb->send_sgl.lkey =3D cb->dma_mr->lkey; > - else > - cb->send_sgl.lkey =3D cb->send_mr->lkey; > + cb->send_sgl.lkey =3D cb->pd->local_dma_lkey; > =20 > cb->sq_wr.opcode =3D IB_WR_SEND; > cb->sq_wr.send_flags =3D IB_SEND_SIGNALED; > cb->sq_wr.sg_list =3D &cb->send_sgl; > cb->sq_wr.num_sge =3D 1; > =20 > - if (cb->server || cb->wlat || cb->rlat || cb->bw || cb->frtest) { > + if (cb->server || cb->wlat || cb->rlat || cb->bw) { > cb->rdma_sgl.addr =3D cb->rdma_dma_addr; > - if (cb->mem =3D=3D MR) > - cb->rdma_sgl.lkey =3D cb->rdma_mr->lkey; > - cb->rdma_sq_wr.send_flags =3D IB_SEND_SIGNALED; > - cb->rdma_sq_wr.sg_list =3D &cb->rdma_sgl; > - cb->rdma_sq_wr.num_sge =3D 1; > + cb->rdma_sq_wr.wr.send_flags =3D IB_SEND_SIGNALED; > + cb->rdma_sq_wr.wr.sg_list =3D &cb->rdma_sgl; > + cb->rdma_sq_wr.wr.num_sge =3D 1; > } > =20 > - switch(cb->mem) { > - case FASTREG: > + /*=20 > + * A chain of 2 WRs, INVALDATE_MR + REG_MR. > + * both unsignaled. The client uses them to reregister > + * the rdma buffers with a new key each iteration. > + */ > + cb->reg_mr_wr.wr.opcode =3D IB_WR_REG_MR; > + cb->reg_mr_wr.mr =3D cb->reg_mr; > =20 > - /*=20 > - * A chain of 2 WRs, INVALDATE_MR + FAST_REG_MR. > - * both unsignaled. The client uses them to reregister > - * the rdma buffers with a new key each iteration. > - */ > - cb->fastreg_wr.opcode =3D IB_WR_FAST_REG_MR; > - cb->fastreg_wr.wr.fast_reg.page_shift =3D PAGE_SHIFT; > - cb->fastreg_wr.wr.fast_reg.length =3D cb->size; > - cb->fastreg_wr.wr.fast_reg.page_list =3D cb->page_list; > - cb->fastreg_wr.wr.fast_reg.page_list_len =3D cb->page_list_len; > - > - cb->invalidate_wr.next =3D &cb->fastreg_wr; > - cb->invalidate_wr.opcode =3D IB_WR_LOCAL_INV; > - break; > - case MW: > - cb->bind_attr.wr_id =3D 0xabbaabba; > - cb->bind_attr.send_flags =3D 0; /* unsignaled */ > -#ifdef BIND_INFO > - cb->bind_attr.bind_info.length =3D cb->size; > -#else > - cb->bind_attr.length =3D cb->size; > -#endif > - break; > - default: > - break; > - } > + cb->invalidate_wr.next =3D &cb->reg_mr_wr.wr; > + cb->invalidate_wr.opcode =3D IB_WR_LOCAL_INV; > } > =20 > static int krping_setup_buffers(struct krping_cb *cb) > { > int ret; > - struct ib_phys_buf buf; > - u64 iovbase; > =20 > - DEBUG_LOG(cb, "krping_setup_buffers called on cb %p\n", cb); > + DEBUG_LOG(PFX "krping_setup_buffers called on cb %p\n", cb); > =20 > - cb->recv_dma_addr =3D ib_dma_map_single(cb->pd->device,=20 > + cb->recv_dma_addr =3D ib_dma_map_single(cb->pd->device, > &cb->recv_buf,=20 > sizeof(cb->recv_buf), DMA_BIDIRECTIONAL); > pci_unmap_addr_set(cb, recv_mapping, cb->recv_dma_addr); > - cb->send_dma_addr =3D ib_dma_map_single(cb->pd->device,=20 > + cb->send_dma_addr =3D ib_dma_map_single(cb->pd->device, > &cb->send_buf, sizeof(cb->send_buf), > DMA_BIDIRECTIONAL); > pci_unmap_addr_set(cb, send_mapping, cb->send_dma_addr); > =20 > - if (cb->mem =3D=3D DMA) { > - cb->dma_mr =3D ib_get_dma_mr(cb->pd, IB_ACCESS_LOCAL_WRITE| > - IB_ACCESS_REMOTE_READ| > - IB_ACCESS_REMOTE_WRITE); > - if (IS_ERR(cb->dma_mr)) { > - DEBUG_LOG(cb, "reg_dmamr failed\n"); > - ret =3D PTR_ERR(cb->dma_mr); > - goto bail; > - } > - } else { > - if (!cb->local_dma_lkey) { > - buf.addr =3D cb->recv_dma_addr; > - buf.size =3D sizeof cb->recv_buf; > - DEBUG_LOG(cb, "recv buf dma_addr %jx size %d\n", > - (uintmax_t)buf.addr, (int)buf.size); > - iovbase =3D cb->recv_dma_addr; > - cb->recv_mr =3D ib_reg_phys_mr(cb->pd, &buf, 1,=20 > - IB_ACCESS_LOCAL_WRITE,=20 > - &iovbase); > - > - if (IS_ERR(cb->recv_mr)) { > - DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); > - ret =3D PTR_ERR(cb->recv_mr); > - goto bail; > - } > - > - buf.addr =3D cb->send_dma_addr; > - buf.size =3D sizeof cb->send_buf; > - DEBUG_LOG(cb, "send buf dma_addr %jx size %d\n", > - (uintmax_t)buf.addr, (int)buf.size); > - iovbase =3D cb->send_dma_addr; > - cb->send_mr =3D ib_reg_phys_mr(cb->pd, &buf, 1,=20 > - 0, &iovbase); > - > - if (IS_ERR(cb->send_mr)) { > - DEBUG_LOG(cb, "send_buf reg_mr failed\n"); > - ret =3D PTR_ERR(cb->send_mr); > - goto bail; > - } > - } > - } > - > - cb->rdma_buf =3D kmalloc(cb->size, GFP_KERNEL); > + cb->rdma_buf =3D ib_dma_alloc_coherent(cb->pd->device, cb->size, > + &cb->rdma_dma_addr, > + GFP_KERNEL); > if (!cb->rdma_buf) { > - DEBUG_LOG(cb, "rdma_buf malloc failed\n"); > + DEBUG_LOG(PFX "rdma_buf allocation failed\n"); > ret =3D -ENOMEM; > goto bail; > } > - > - cb->rdma_dma_addr =3D ib_dma_map_single(cb->pd->device,=20 > - cb->rdma_buf, cb->size,=20 > - DMA_BIDIRECTIONAL); > pci_unmap_addr_set(cb, rdma_mapping, cb->rdma_dma_addr); > - if (cb->mem !=3D DMA) { > - switch (cb->mem) { > - case FASTREG: > - cb->page_list_len =3D (((cb->size - 1) & PAGE_MASK) + > - PAGE_SIZE) >> PAGE_SHIFT; > - cb->page_list =3D ib_alloc_fast_reg_page_list( > - cb->pd->device,=20 > - cb->page_list_len); > - if (IS_ERR(cb->page_list)) { > - DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); > - ret =3D PTR_ERR(cb->page_list); > - goto bail; > - } > - cb->fastreg_mr =3D ib_alloc_fast_reg_mr(cb->pd,=20 > - cb->page_list->max_page_list_len); > - if (IS_ERR(cb->fastreg_mr)) { > - DEBUG_LOG(cb, "recv_buf reg_mr failed\n"); > - ret =3D PTR_ERR(cb->fastreg_mr); > - goto bail; > - } > - DEBUG_LOG(cb, "fastreg rkey 0x%x page_list %p" > - " page_list_len %u\n", cb->fastreg_mr->rkey,=20 > - cb->page_list, cb->page_list_len); > - break; > - case MW: > - cb->mw =3D ib_alloc_mw(cb->pd,IB_MW_TYPE_1); > - if (IS_ERR(cb->mw)) { > - DEBUG_LOG(cb, "recv_buf alloc_mw failed\n"); > - ret =3D PTR_ERR(cb->mw); > - goto bail; > - } > - DEBUG_LOG(cb, "mw rkey 0x%x\n", cb->mw->rkey); > - /*FALLTHROUGH*/ > - case MR: > - buf.addr =3D cb->rdma_dma_addr; > - buf.size =3D cb->size; > - iovbase =3D cb->rdma_dma_addr; > - cb->rdma_mr =3D ib_reg_phys_mr(cb->pd, &buf, 1,=20 > - IB_ACCESS_LOCAL_WRITE| > - IB_ACCESS_REMOTE_READ|=20 > - IB_ACCESS_REMOTE_WRITE,=20 > - &iovbase); > - if (IS_ERR(cb->rdma_mr)) { > - DEBUG_LOG(cb, "rdma_buf reg_mr failed\n"); > - ret =3D PTR_ERR(cb->rdma_mr); > - goto bail; > - } > - DEBUG_LOG(cb, "rdma buf dma_addr %jx size %d mr rkey 0x%x\n", > - (uintmax_t)buf.addr, (int)buf.size, cb->rdma_mr->rkey); > - break; > - default: > - ret =3D -EINVAL; > - goto bail; > - break; > - } > + cb->page_list_len =3D (((cb->size - 1) & PAGE_MASK) + PAGE_SIZE) > + >> PAGE_SHIFT; > + cb->reg_mr =3D ib_alloc_mr(cb->pd, IB_MR_TYPE_MEM_REG, > + cb->page_list_len); > + if (IS_ERR(cb->reg_mr)) { > + ret =3D PTR_ERR(cb->reg_mr); > + DEBUG_LOG(PFX "recv_buf reg_mr failed %d\n", ret); > + goto bail; > } > + DEBUG_LOG(PFX "reg rkey 0x%x page_list_len %u\n", > + cb->reg_mr->rkey, cb->page_list_len); > =20 > - if (!cb->server || cb->wlat || cb->rlat || cb->bw || cb->frtest) { > + if (!cb->server || cb->wlat || cb->rlat || cb->bw) { > =20 > - cb->start_buf =3D kmalloc(cb->size, GFP_KERNEL); > + cb->start_buf =3D ib_dma_alloc_coherent(cb->pd->device, cb->size, > + &cb->start_dma_addr, > + GFP_KERNEL); > if (!cb->start_buf) { > - DEBUG_LOG(cb, "start_buf malloc failed\n"); > + DEBUG_LOG(PFX "start_buf malloc failed\n"); > ret =3D -ENOMEM; > goto bail; > } > - > - cb->start_dma_addr =3D ib_dma_map_single(cb->pd->device,=20 > - cb->start_buf, cb->size,=20 > - DMA_BIDIRECTIONAL); > pci_unmap_addr_set(cb, start_mapping, cb->start_dma_addr); > - > - if (cb->mem =3D=3D MR || cb->mem =3D=3D MW) { > - unsigned flags =3D IB_ACCESS_REMOTE_READ; > - > - if (cb->wlat || cb->rlat || cb->bw || cb->frtest) { > - flags |=3D IB_ACCESS_LOCAL_WRITE | > - IB_ACCESS_REMOTE_WRITE; > - } > - > - buf.addr =3D cb->start_dma_addr; >=20 > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > 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" Buildworld failure: Building /usr/obj/usr/src/amd64.amd64/contrib/ofed/opensm/complib/cl_pool.o --- cl_nodenamemap.o --- /usr/src/contrib/ofed/opensm/complib/cl_nodenamemap.c:77:11: error: conflic= ting types for 'open_node_name_map' nn_map_t *open_node_name_map(const char *node_name_map) ^ /usr/include/infiniband/complib/cl_nodenamemap.h:57:11: note: previous decl= aration is here nn_map_t *open_node_name_map(char *node_name_map); ^ 1 error generated. *** [cl_nodenamemap.o] Error code 1 --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/J+F5gfad7PlOhNr7t/S0dku Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWhhdEQAKCRDS528fyFhY lNQ+AgCpzfyt3CqBOVSyszsN0T4xUpHcT4y9R88msAl1f9pGvDTUH17XWfz8u1cO i6wABqDIGTJrFsZbQjJBGyxO2EdiAf4k17FEHZO/2hWeatzFBi+ZINFJq9nqJMhw HuFEVeX3Ae0dka1I5fzoJHTaBjL81K3utBpxZD/XXypfcEjDeALx =EnHL -----END PGP SIGNATURE----- --Sig_/J+F5gfad7PlOhNr7t/S0dku-- From owner-svn-src-head@freebsd.org Fri Nov 24 18:04: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 CEDACDED678; Fri, 24 Nov 2017 18:04: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 93B5D7E480; Fri, 24 Nov 2017 18:04:45 +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 938D026014D; Fri, 24 Nov 2017 19:04:42 +0100 (CET) Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... To: "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711241450.vAOEoSFW056744@repo.freebsd.org> <20171124185528.3a0ebfdc@thor.intern.walstatt.dynvpn.de> From: Hans Petter Selasky Message-ID: <90900084-c353-b453-ae8b-6ab0d0ad2b13@selasky.org> Date: Fri, 24 Nov 2017 19:01:57 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171124185528.3a0ebfdc@thor.intern.walstatt.dynvpn.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 18:04:45 -0000 On 11/24/17 18:55, O. Hartmann wrote: > Am Fri, 24 Nov 2017 14:50:28 +0000 (UTC) > Hans Petter Selasky schrieb: > Buildworld failure: > > Building /usr/obj/usr/src/amd64.amd64/contrib/ofed/opensm/complib/cl_pool.o > --- cl_nodenamemap.o --- > /usr/src/contrib/ofed/opensm/complib/cl_nodenamemap.c:77:11: error: conflicting types for > 'open_node_name_map' nn_map_t *open_node_name_map(const char *node_name_map) > ^ > /usr/include/infiniband/complib/cl_nodenamemap.h:57:11: note: previous declaration is here > nn_map_t *open_node_name_map(char *node_name_map); > ^ Hi, I think you need to "rm -rf /usr/include/infiniband" or run "make installincludes WITH_OFED=YES" first. I'm not sure how this can be avoided ... --HPS From owner-svn-src-head@freebsd.org Fri Nov 24 19:01: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 D2C10DEE89B; Fri, 24 Nov 2017 19:01:15 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C6837FE8B; Fri, 24 Nov 2017 19:01:15 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAOJ1Ejn062432; Fri, 24 Nov 2017 19:01:14 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOJ1Evf062431; Fri, 24 Nov 2017 19:01:14 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201711241901.vAOJ1Evf062431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Fri, 24 Nov 2017 19:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326174 - head/sys/modules/bhnd X-SVN-Group: head X-SVN-Commit-Author: landonf X-SVN-Commit-Paths: head/sys/modules/bhnd X-SVN-Commit-Revision: 326174 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:01:15 -0000 Author: landonf Date: Fri Nov 24 19:01:14 2017 New Revision: 326174 URL: https://svnweb.freebsd.org/changeset/base/326174 Log: bhnd(4): Add missing dependency on ofw_bus_if.h Reported by: wma Approved by: adrian (mentor, implicit) Modified: head/sys/modules/bhnd/Makefile Modified: head/sys/modules/bhnd/Makefile ============================================================================== --- head/sys/modules/bhnd/Makefile Fri Nov 24 17:57:00 2017 (r326173) +++ head/sys/modules/bhnd/Makefile Fri Nov 24 19:01:14 2017 (r326174) @@ -17,7 +17,7 @@ SRCS+= bhnd_erom_if.c bhnd_erom_if.h SRCS+= chipc.c chipc_subr.c SRCS+= chipc_gpio.c -SRCS+= gpio_if.h +SRCS+= gpio_if.h ofw_bus_if.h SRCS+= bhnd_sprom_chipc.c \ bhnd_pmu_chipc.c From owner-svn-src-head@freebsd.org Fri Nov 24 19:02: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 A6981DEE90E; Fri, 24 Nov 2017 19:02:07 +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 70E3D80076; Fri, 24 Nov 2017 19:02:07 +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 vAOJ26lZ066336; Fri, 24 Nov 2017 19:02:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOJ26Hv066335; Fri, 24 Nov 2017 19:02:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711241902.vAOJ26Hv066335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 Nov 2017 19:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326175 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:02:07 -0000 Author: markj Date: Fri Nov 24 19:02:06 2017 New Revision: 326175 URL: https://svnweb.freebsd.org/changeset/base/326175 Log: Add a missing lockstat:::sx-downgrade probe. We were returning without firing the probe when the lock had no shared waiters. MFC after: 1 week Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Fri Nov 24 19:01:14 2017 (r326174) +++ head/sys/kern/kern_sx.c Fri Nov 24 19:02:06 2017 (r326175) @@ -480,10 +480,8 @@ sx_downgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) x = sx->sx_lock; if (!(x & SX_LOCK_SHARED_WAITERS) && atomic_cmpset_rel_ptr(&sx->sx_lock, x, SX_SHARERS_LOCK(1) | - (x & SX_LOCK_EXCLUSIVE_WAITERS))) { - LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line); - return; - } + (x & SX_LOCK_EXCLUSIVE_WAITERS))) + goto out; /* * Lock the sleep queue so we can read the waiters bits @@ -504,11 +502,12 @@ sx_downgrade_int(struct sx *sx LOCK_FILE_LINE_ARG_DEF) 0, SQ_SHARED_QUEUE); sleepq_release(&sx->lock_object); - LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line); - LOCKSTAT_RECORD0(sx__downgrade, sx); - if (wakeup_swapper) kick_proc0(); + +out: + LOCK_LOG_LOCK("XDOWNGRADE", &sx->lock_object, 0, 0, file, line); + LOCKSTAT_RECORD0(sx__downgrade, sx); } void From owner-svn-src-head@freebsd.org Fri Nov 24 19: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 D254EDEEB16; Fri, 24 Nov 2017 19:04:32 +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 9BAF780446; Fri, 24 Nov 2017 19:04:32 +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 vAOJ4VxT066667; Fri, 24 Nov 2017 19:04:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOJ4VvG066666; Fri, 24 Nov 2017 19:04:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711241904.vAOJ4VvG066666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 Nov 2017 19:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326176 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326176 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:04:32 -0000 Author: markj Date: Fri Nov 24 19:04:31 2017 New Revision: 326176 URL: https://svnweb.freebsd.org/changeset/base/326176 Log: Have lockstat:::sx-release fire only after the lock state has changed. MFC after: 1 week Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Fri Nov 24 19:02:06 2017 (r326175) +++ head/sys/kern/kern_sx.c Fri Nov 24 19:04:31 2017 (r326176) @@ -1180,8 +1180,6 @@ _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_ if (SCHEDULER_STOPPED()) return; - LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER); - for (;;) { if (_sx_sunlock_try(sx, &x)) break; @@ -1217,6 +1215,7 @@ _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_ kick_proc0(); break; } + LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER); } void From owner-svn-src-head@freebsd.org Fri Nov 24 19:05: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 8CAB9DEEB94; Fri, 24 Nov 2017 19:05:46 +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 56DE0805A6; Fri, 24 Nov 2017 19:05:46 +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 vAOJ5jIt066758; Fri, 24 Nov 2017 19:05:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOJ5jkB066757; Fri, 24 Nov 2017 19:05:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711241905.vAOJ5jkB066757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 Nov 2017 19:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326177 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Commit-Revision: 326177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:05:46 -0000 Author: markj Date: Fri Nov 24 19:05:45 2017 New Revision: 326177 URL: https://svnweb.freebsd.org/changeset/base/326177 Log: Fix the type signature for sx(9) DTrace subroutines. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Nov 24 19:04:31 2017 (r326176) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Fri Nov 24 19:05:45 2017 (r326177) @@ -1315,7 +1315,7 @@ alloc: snprintf(intmtx_str, sizeof(intmtx_str), "int(%s`struct mtx *)",p); snprintf(threadmtx_str, sizeof(threadmtx_str), "struct thread *(%s`struct mtx *)",p); snprintf(rwlock_str, sizeof(rwlock_str), "int(%s`struct rwlock *)",p); - snprintf(sxlock_str, sizeof(sxlock_str), "int(%s`struct sxlock *)",p); + snprintf(sxlock_str, sizeof(sxlock_str), "int(%s`struct sx *)",p); } #endif From owner-svn-src-head@freebsd.org Fri Nov 24 19:08: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 29F31DEEC74; Fri, 24 Nov 2017 19:08:56 +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 E89D380859; Fri, 24 Nov 2017 19:08:55 +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 vAOJ8tLa067159; Fri, 24 Nov 2017 19:08:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOJ8tol067158; Fri, 24 Nov 2017 19:08:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711241908.vAOJ8tol067158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 Nov 2017 19:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326178 - head/sys/modules/dtrace/dtrace_test X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/modules/dtrace/dtrace_test X-SVN-Commit-Revision: 326178 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:08:56 -0000 Author: markj Date: Fri Nov 24 19:08:54 2017 New Revision: 326178 URL: https://svnweb.freebsd.org/changeset/base/326178 Log: Don't redefine _KERNEL. MFC after: 1 week Modified: head/sys/modules/dtrace/dtrace_test/Makefile Modified: head/sys/modules/dtrace/dtrace_test/Makefile ============================================================================== --- head/sys/modules/dtrace/dtrace_test/Makefile Fri Nov 24 19:05:45 2017 (r326177) +++ head/sys/modules/dtrace/dtrace_test/Makefile Fri Nov 24 19:08:54 2017 (r326178) @@ -11,8 +11,6 @@ SRCS+= vnode_if.h CFLAGS+= -I${SYSDIR} -CFLAGS+= -D_KERNEL - .include CFLAGS+= -include ${SYSDIR}/cddl/compat/opensolaris/sys/debug_compat.h From owner-svn-src-head@freebsd.org Fri Nov 24 19:17: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 EDDA0DEEF04; Fri, 24 Nov 2017 19:17:21 +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 806DD80D80; Fri, 24 Nov 2017 19:17:21 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vAOJHHSK096734; Fri, 24 Nov 2017 11:17:17 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vAOJHHrA096733; Fri, 24 Nov 2017 11:17:17 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201711241917.vAOJHHrA096733@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r326169 - in head: . contrib/ofed lib/libc/locale share/mk sys/amd64/amd64 sys/amd64/conf sys/conf sys/contrib/rdma/krping sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/... In-Reply-To: <4695efa6-c8d5-e860-3c9b-939ac4b91abc@selasky.org> To: Hans Petter Selasky Date: Fri, 24 Nov 2017 11:17:17 -0800 (PST) CC: Mark Johnston , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 19:17:22 -0000 [ Charset UTF-8 unsupported, converting... ] > On 11/24/17 18:35, Mark Johnston wrote: > > On Fri, Nov 24, 2017 at 06:29:25PM +0100, Hans Petter Selasky wrote: > >> On 11/24/17 18:22, Mark Johnston wrote: > >>> On Fri, Nov 24, 2017 at 06:09:25PM +0100, Hans Petter Selasky wrote: > >>>> On 11/24/17 16:00, Mark Johnston wrote: > >>>>> Are there non-trivial interoperability issues between mthca and the > >>>>> updated OFED stack? If so, could you describe them? If not, I would > >>>>> strongly prefer to retain the mthca driver, as Isilon still has plenty > >>>>> of hardware making use of it. > >>>> > >>>> Hi, > >>>> > >>>> There are no technical reasons except Mellanox hasn't focused on the > >>>> mthca driver in this upgrade. With little effort you should be able to > >>>> pull libmthca and the mthca driver from the mentioned sources and make > >>>> it work. > >>> > >>> In that case, could we please bring it back in to svn? It seems silly to > >>> remove a driver just because it's not being actively maintained: that > >>> isn't the bar for keeping drivers in FreeBSD, and I note that mthca is > >>> still present in Linux. If there is some work needed to get the kernel > >>> and userland components to compile again, I'm happy to do it; I just > >>> don't want to have to maintain an out-of-tree HCA driver when there's no > >>> good reason it can't stay in svn. > >>> > >> > >> Sure, but we probably want to put it into sys/dev/mthca instead of > >> sys/ofed/xxx . > > > > Ok. > > > >> Are you saying you want to pull it in yourself and make > >> it compile? > > > > I don't really *want* to, but I will if you don't. :) > > > > Let me discuss this at Mellanox first. I'll get back to you on Monday on > this topic. Just to add some input I would also like to see the mthca drive continue to live as a pair of them is part of my test bed here. But, I can understand these are pretty old products, and that they can be replaced for a sub $20.00 price off of ebay. (I already have a collection of Connectx-3 cards supported by mlx4 drivers.) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Nov 24 19:21: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 92597DEF295; Fri, 24 Nov 2017 19:21:22 +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 5C53713B8; Fri, 24 Nov 2017 19:21:22 +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 vAOJLLcK071423; Fri, 24 Nov 2017 19:21:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOJLLmK071422; Fri, 24 Nov 2017 19:21:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201711241921.vAOJLLmK071422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 Nov 2017 19:21:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326179 - head/sys/arm64/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/conf X-SVN-Commit-Revision: 326179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:21:22 -0000 Author: emaste Date: Fri Nov 24 19:21:21 2017 New Revision: 326179 URL: https://svnweb.freebsd.org/changeset/base/326179 Log: Temporarily disable VIMAGE on arm64 Loading a kernel module with a static VNET_DEFINE'd variable (e.g. if_lagg) currently results in a kernel panic. PR: 223670 Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Fri Nov 24 19:08:54 2017 (r326178) +++ head/sys/arm64/conf/GENERIC Fri Nov 24 19:21:21 2017 (r326179) @@ -26,7 +26,7 @@ makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption -options VIMAGE # Subsystem virtualization, e.g. VNET +#options VIMAGE # Subsystem virtualization, e.g. VNET options INET # InterNETworking options INET6 # IPv6 communications protocols options IPSEC # IP (v4/v6) security From owner-svn-src-head@freebsd.org Fri Nov 24 19:23: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 41C8EDEF4F6; Fri, 24 Nov 2017 19:23:54 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C8ADC17A1; Fri, 24 Nov 2017 19:23:52 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 3694991a; Fri, 24 Nov 2017 20:23:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; s=mail; bh=UQzlL2 XwwmXjp7unBM5o709RySA=; b=nUUXX1oBhEptSzHe0iD/nXaN+/PqKsDnPhiQWi jf0tcmtCG/yb1JT/Hpt0O9MO9bBKnTSGZ9c3Tzk78Uayc7XGEdJrRxDdPnoW7DMm rmWM3EgZzzXARM1UTENO++ROEriBmI3mQQG7tvowcqibzREcy2xke7lNpvATheUi Zcib8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; q=dns; s=mail; b= CpsTTyo+Ekl8X0dMBD7BRDfkkUAiTxw9VHLdbOVLkt+ZSfjZTT9DNoMcD0uxtAMo AQ2ntJzvkngJ+eR5gTsLYakdztoI/tts35mDCWd7jgdh2hp0n2SQk3uavocYfzhL 0q1yox2zyLo70gTvvDty+ubgpi+n/Ut8Ivycw0GAcDY= Received: from webmail.megadrive.org (www1.blih.net [212.83.177.180]) by mail.blih.net (OpenSMTPD) with ESMTP id 5f0f2c23; Fri, 24 Nov 2017 20:23:44 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 24 Nov 2017 20:23:44 +0100 From: Emmanuel Vadot To: Allan Jude Cc: rgrimes@freebsd.org, cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts Organization: Bidouilliste In-Reply-To: <38787424-ff48-df5e-0831-922d14f1603c@freebsd.org> References: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> <38787424-ff48-df5e-0831-922d14f1603c@freebsd.org> Message-ID: X-Sender: manu@bidouilliste.com User-Agent: Roundcube Webmail/1.1.1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:23:54 -0000 On 2017-11-24 17:46, Allan Jude wrote: > On 11/23/2017 12:29, Rodney W. Grimes wrote: >> [ Charset UTF-8 unsupported, converting... ] >>> On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes >>> wrote: >>>>> Also we do provide an ntp.conf so ... >>>> >>>> We do, a template, all commented out, and does not work for >>>> machines behind strong firewalls that wont allow ntp out >>>> to the net but have internal ntp servers that are used for >>>> such things. >>>> >>>> Well maybe not all commented out, I think it defaults to >>>> some public pools. I believe it would be missing iburst >>>> for use with ntp -pg >>> >>> Does ntpdate work out of the box in such environments? If so, how? >> >> ntpdate time.nist.gov >> >> ntpdate does not need a configureration file, just a command >> line argument. >> >> > > The point of this thread was which option the installer should use to > implement 'set the correct time on first boot'. The main point yes. I guess that I'll revert my commit and open a review which removes ntpd_sync_on_start and always add -g to rc_flags and people could argument there. > We are not talking about removing ntpdate in this thread. Well, after Ian said that it was deprecated I ask if we should remove it to be honest. -- Emmanuel Vadot From owner-svn-src-head@freebsd.org Fri Nov 24 19:39: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 A27A1DEF9A5; Fri, 24 Nov 2017 19:39:00 +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 6CFBA2578; Fri, 24 Nov 2017 19:39: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 vAOJcxFH080635; Fri, 24 Nov 2017 19:38:59 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOJcxUE080634; Fri, 24 Nov 2017 19:38:59 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201711241938.vAOJcxUE080634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 24 Nov 2017 19:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326180 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 326180 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:39:00 -0000 Author: tuexen Date: Fri Nov 24 19:38:59 2017 New Revision: 326180 URL: https://svnweb.freebsd.org/changeset/base/326180 Log: Fix SPDX line as suggested by pfg Modified: head/sys/netinet/sctp_ss_functions.c Modified: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- head/sys/netinet/sctp_ss_functions.c Fri Nov 24 19:21:21 2017 (r326179) +++ head/sys/netinet/sctp_ss_functions.c Fri Nov 24 19:38:59 2017 (r326180) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved. * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved. From owner-svn-src-head@freebsd.org Fri Nov 24 19:40: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 7BB34DEFA49; Fri, 24 Nov 2017 19:40:41 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42DAA26ED; Fri, 24 Nov 2017 19:40:41 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2003:cd:6bde:a000:c8f6:451a:8899:26cc] (p200300CD6BDEA000C8F6451A889926CC.dip0.t-ipconnect.de [IPv6:2003:cd:6bde:a000:c8f6:451a:8899:26cc]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 81D527041E079; Fri, 24 Nov 2017 20:40:33 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Subject: Re: svn commit: r326154 - head/sys/netinet From: Michael Tuexen In-Reply-To: <4b647431-fc5c-590c-9d96-0d02ed03bda8@FreeBSD.org> Date: Fri, 24 Nov 2017 20:40:20 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4391AF01-B48F-4609-A9DB-991D4D8E6D02@freebsd.org> References: <201711241125.vAOBPrdw073077@repo.freebsd.org> <4b647431-fc5c-590c-9d96-0d02ed03bda8@FreeBSD.org> To: Pedro Giffuni X-Mailer: Apple Mail (2.3445.4.7) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:40:41 -0000 > On 24. Nov 2017, at 16:43, Pedro Giffuni wrote: >=20 > Thanks, I have a bunch of those to do still. >=20 >=20 > On 24/11/2017 06:25, Michael Tuexen wrote: >> Author: tuexen >> Date: Fri Nov 24 11:25:53 2017 >> New Revision: 326154 >> URL: https://svnweb.freebsd.org/changeset/base/326154 >>=20 >> Log: >> Add SPDX line. >>=20 >> Modified: >> head/sys/netinet/sctp_ss_functions.c >>=20 >> Modified: head/sys/netinet/sctp_ss_functions.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/netinet/sctp_ss_functions.c Fri Nov 24 11:25:06 2017 = (r326153) >> +++ head/sys/netinet/sctp_ss_functions.c Fri Nov 24 11:25:53 2017 = (r326154) >> @@ -1,4 +1,6 @@ >> /*- >> + * SPDX-License-Identifier: BSD-2-Clause >=20 > Although not wrong, I think it should have been: >=20 > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD Fixed in r326180. I had to integrate your changes upstream an figured out that this file = was missing. That is why I tried to put in the appropriate term. Thanks for providing a hint how to do it right. Best regards Michael >=20 > There is a bunch of BSD variants here: >=20 > https://spdx.org/licenses/ >=20 > Cheers, >=20 > Pedro. >=20 >=20 >=20 >> + * >> * Copyright (c) 2010-2012, by Michael Tuexen. All rights reserved. >> * Copyright (c) 2010-2012, by Randall Stewart. All rights reserved. >> * Copyright (c) 2010-2012, by Robin Seggelmann. All rights = reserved. >>=20 >=20 >=20 From owner-svn-src-head@freebsd.org Fri Nov 24 19:41: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 3817EDEFB06 for ; Fri, 24 Nov 2017 19:41:45 +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 C70692A90 for ; Fri, 24 Nov 2017 19:41:44 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 52d26ccd-d14f-11e7-b805-f37e907b5733 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 52d26ccd-d14f-11e7-b805-f37e907b5733; Fri, 24 Nov 2017 19:40:29 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vAOJePOa001595; Fri, 24 Nov 2017 12:40:25 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1511552425.52392.1.camel@freebsd.org> Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts From: Ian Lepore To: Emmanuel Vadot , Allan Jude Cc: rgrimes@freebsd.org, cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Date: Fri, 24 Nov 2017 12:40:25 -0700 In-Reply-To: References: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> <38787424-ff48-df5e-0831-922d14f1603c@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 19:41:45 -0000 On Fri, 2017-11-24 at 20:23 +0100, Emmanuel Vadot wrote: > On 2017-11-24 17:46, Allan Jude wrote: > > > > On 11/23/2017 12:29, Rodney W. Grimes wrote: > > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > > > > On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes > > > > wrote: > > > > > > > > > > > > > > > > >  Also we do provide an ntp.conf so ... > > > > > We do, a template, all commented out, and does not work for > > > > > machines behind strong firewalls that wont allow ntp out > > > > > to the net but have internal ntp servers that are used for > > > > > such things. > > > > > > > > > > Well maybe not all commented out, I think it defaults to > > > > > some public pools.  I believe it would be missing iburst > > > > > for use with ntp -pg > > > > Does ntpdate work out of the box in such environments?  If so, how? > > > ntpdate time.nist.gov > > > > > > ntpdate does not need a configureration file, just a command > > > line argument. > > > > > > > > The point of this thread was which option the installer should use to > > implement 'set the correct time on first boot'. >   The main point yes. >   I guess that I'll revert my commit and open a review which removes  > ntpd_sync_on_start and always add -g to rc_flags and people could  > argument there. I think this idea is a non-starter.  Avoiding time-steps is an important requirement in some sites.  As another message in this thread pointed out, restarting ntpd on a running system could result in a step if -g is a default. -- Ian From owner-svn-src-head@freebsd.org Fri Nov 24 19:57: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 0B3CDDF020E; Fri, 24 Nov 2017 19:57:15 +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 D64C83416; Fri, 24 Nov 2017 19:57:14 +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 vAOJvDX2088982; Fri, 24 Nov 2017 19:57:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAOJvDfO088977; Fri, 24 Nov 2017 19:57:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201711241957.vAOJvDfO088977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 Nov 2017 19:57:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326181 - in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/uctf usr.sbin/dtrace/tests/common/probes usr.sbin/dtrace/tests/common/speculation usr.sbin/dtrace/tests/common/uct... X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/cddl: contrib/opensolaris/cmd/dtrace/test/tst/common/uctf usr.sbin/dtrace/tests/common/probes usr.sbin/dtrace/tests/common/speculation usr.sbin/dtrace/tests/common/uctf usr.sbin/dtrace/tests/t... X-SVN-Commit-Revision: 326181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 19:57:15 -0000 Author: markj Date: Fri Nov 24 19:57:13 2017 New Revision: 326181 URL: https://svnweb.freebsd.org/changeset/base/326181 Log: Compile one of the uctf test programs with -m32. The err.user64mode.ksh test expects it to run as a 32-bit process. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh head/cddl/usr.sbin/dtrace/tests/common/probes/Makefile head/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile head/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile head/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh Fri Nov 24 19:38:59 2017 (r326180) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh Fri Nov 24 19:57:13 2017 (r326181) @@ -38,7 +38,7 @@ fi ./$exe & pid=$! -$dtrace -qs /dev/stdin < Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 587F1DF1BEF; Fri, 24 Nov 2017 21:14:07 +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 19CB364DA1; Fri, 24 Nov 2017 21:14:06 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vAOLE4Pm097165; Fri, 24 Nov 2017 13:14:04 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vAOLE4b6097164; Fri, 24 Nov 2017 13:14:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201711242114.vAOLE4b6097164@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts In-Reply-To: To: Emmanuel Vadot Date: Fri, 24 Nov 2017 13:14:04 -0800 (PST) CC: Allan Jude , rgrimes@freebsd.org, cem@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.25 Precedence: list List-Id: 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, 24 Nov 2017 21:14:07 -0000 > On 2017-11-24 17:46, Allan Jude wrote: > > On 11/23/2017 12:29, Rodney W. Grimes wrote: > >> [ Charset UTF-8 unsupported, converting... ] > >>> On Thu, Nov 23, 2017 at 7:17 AM, Rodney W. Grimes > >>> wrote: > >>>>> Also we do provide an ntp.conf so ... > >>>> > >>>> We do, a template, all commented out, and does not work for > >>>> machines behind strong firewalls that wont allow ntp out > >>>> to the net but have internal ntp servers that are used for > >>>> such things. > >>>> > >>>> Well maybe not all commented out, I think it defaults to > >>>> some public pools. I believe it would be missing iburst > >>>> for use with ntp -pg > >>> > >>> Does ntpdate work out of the box in such environments? If so, how? > >> > >> ntpdate time.nist.gov > >> > >> ntpdate does not need a configureration file, just a command > >> line argument. > >> > >> > > > > The point of this thread was which option the installer should use to > > implement 'set the correct time on first boot'. > > The main point yes. > I guess that I'll revert my commit I see no reason to revert the commit, the commit just added an option to the installer to set ntpdate_enable in /etc/rc.conf, correct? > and open a review which removes > ntpd_sync_on_start and always add -g to rc_flags and people could > argument there. And as Ian pointed out I think that would be a non-starter. I dont see why we need to change any of what is there now, if a person knows how to use ntpd and configure it to there liking the current set of knobs and settings are easily tweaked to the desire of the site. Those that want to do the old school ntpdate -b blah blah before starting ntpd are free to configure it as such, those who like the newer sync on startup of ntpd are free to do that, I can not think of a configuration that the current knobs would not allow you to set up. > > We are not talking about removing ntpdate in this thread. > > Well, after Ian said that it was deprecated I ask if we should remove > it to be honest. And I think we have come to the agreement not to do that until the official distribution does it as well, is that also correct? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Nov 24 21:37: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 388A8DF2211 for ; Fri, 24 Nov 2017 21:37:24 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic305-18.consmr.mail.bf2.yahoo.com (sonic305-18.consmr.mail.bf2.yahoo.com [74.6.133.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3F8865963 for ; Fri, 24 Nov 2017 21:37:23 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1511559416; bh=8w+3f0rJUWP55JMWdZ4rGogT3aY4r8Po6N+LdiIxNvc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=X3wMcGP4P3WtAJeDsnGlOWrRA2qFQyrj5cPdwkM1/apZOiou/WcbCl6+1zYnKiktz6IzlgpkEMXmQGV3LMXJvMDPl1eW1jKeg/+xnu/dlRrxIktDW8hEU3N3dxZ5GYbConQzrDtgVpbbGujN+wso4jSNWVdsghiQ9rVBiEmJpIueJ12EVQr5VO0stAjYoEQB9D6JjrO71Y7/BLSLb2aOccuR1HaENrMkk8XIUAcEG9LkrNDwC9+uGOUXPsAhwmtjLp6dEu+yDTA/UxOAM+qsYGdN1O6XH/e6t92VQWY7p87v6j6/RNPhF+mJ16yR5y0U7DxxqOGzg4JyBg+4+t2b6Q== X-YMail-OSG: LPvrHJAVM1lzI6GGfFH8El5pS1Eg1q6Rco_DfO8O7wH2.bHpALxJfIG8LzkVBTx j2nPFPgwsD1yWIYD83wVSFku6vcHS.zvVF5gi8VUAeZylq003TZqrHBJqkYRZgnpbZbdnt0Mc8JU uaEiZAlowMTEjvWzhZxz9AMIIqB3vb.R6TAgAkPmJiUqPmirGJo1QRW.G21SJ8DkQF2l0W24PIoo iDdAXaJRdISAV.yN7NdV0HIA7moiV4fqEgtYNg8IIhfydSFXmVbJHJOL4GZA30Kjwdwip2pVTcE3 1676UeF.5aDdG3CwgaZd.GeQtKINix.xJp2SpU_l4tbNBdFdLzzaDeVE6EbJFbZMzXOawYGYfja_ m5c4VfCcHz5iLLxke7q3gLg13FURVAQ4YbOx6evhrwnDsNEtXYrjTi2.kqGcoymCu6pbOBRdEZta eCJ4.riW_H.8r7MN4AxnshCbsoDGMbMDiOtUhFVCR18DpuXotwPznuv_O9jS6nnbUsg3Fwn9d Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.bf2.yahoo.com with HTTP; Fri, 24 Nov 2017 21:36:56 +0000 Received: from smtp110.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.3]) ([98.139.233.86]) by smtp408.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 1259886661; Fri, 24 Nov 2017 21:26:33 +0000 (UTC) Subject: Re: svn commit: r326154 - head/sys/netinet To: Michael Tuexen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711241125.vAOBPrdw073077@repo.freebsd.org> <4b647431-fc5c-590c-9d96-0d02ed03bda8@FreeBSD.org> <4391AF01-B48F-4609-A9DB-991D4D8E6D02@freebsd.org> From: Pedro Giffuni Message-ID: Date: Fri, 24 Nov 2017 16:26:34 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <4391AF01-B48F-4609-A9DB-991D4D8E6D02@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 21:37:24 -0000 On 11/24/17 14:40, Michael Tuexen wrote: >> On 24. Nov 2017, at 16:43, Pedro Giffuni wrote: >> >> Thanks, I have a bunch of those to do still. >> >> >> On 24/11/2017 06:25, Michael Tuexen wrote: >>> Author: tuexen >>> Date: Fri Nov 24 11:25:53 2017 >>> New Revision: 326154 >>> URL: https://svnweb.freebsd.org/changeset/base/326154 >>> >>> Log: >>> Add SPDX line. >>> >>> Modified: >>> head/sys/netinet/sctp_ss_functions.c >>> >>> Modified: head/sys/netinet/sctp_ss_functions.c >>> ============================================================================== >>> --- head/sys/netinet/sctp_ss_functions.c Fri Nov 24 11:25:06 2017 (r326153) >>> +++ head/sys/netinet/sctp_ss_functions.c Fri Nov 24 11:25:53 2017 (r326154) >>> @@ -1,4 +1,6 @@ >>> /*- >>> + * SPDX-License-Identifier: BSD-2-Clause >> Although not wrong, I think it should have been: >> >> * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > Fixed in r326180. > > I had to integrate your changes upstream an figured out that this file was missing. > That is why I tried to put in the appropriate term. It's OK, I am half-way a much bigger patch for remaining BSDL files and I am just finding out what the terms should be. 3- and 4 Clauses have no extension. For 2-clause it's a mess: since this is FreeBSD, unless it says NetBSD or has a versioning tag from another OS, I assume it is -FreeBSD. And basically it has to be done by hand, there is no tool to do this stuff :(. Pedro. From owner-svn-src-head@freebsd.org Fri Nov 24 21:57: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 8298BDF28BC for ; Fri, 24 Nov 2017 21:57:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x232.google.com (mail-io0-x232.google.com [IPv6:2607:f8b0:4001: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 433AE66229 for ; Fri, 24 Nov 2017 21:57:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x232.google.com with SMTP id q101so30697858ioi.1 for ; Fri, 24 Nov 2017 13:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=d2D0iHvZ5YbMZuwOqjScdNEhh4m6gAoxf49aBfgs5F8=; b=wGrZlUnFEufPq6DAonR1f5LHQFomoeaw+wHQRGtvEV2267ze1HsMYDwkAhGSAc6qT2 d/7wuxY27zZMdkEeCXD2sb5jTom4YU4nqHFf4S4iVElzIDaHC/LccXTTSMI7eIrM2lvM MzN3DE+H9ek0QgFj9YVJ2qqUriXG/h3pxl6/VOYY1XWJ6E6/6Nep9B2wqXWmSmGn5uEm /MA6oDnoLbdFzzt0pzEBooWtaUrb4wllFJyQoiuy6XWAf8VylveSFAd0B1k3YjDk8ZL0 ifxsj6mN/UifF4WQyQ9tLySXIIUulpXfbX2qadXEq0zxjCzPn57JIqviRXjz8eecSvrv QfZw== 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=d2D0iHvZ5YbMZuwOqjScdNEhh4m6gAoxf49aBfgs5F8=; b=FXwcC9eqNFV9z+XZ/aklc4Oa6ZwgjAIvh9ZexFkDbTZa5M/bCXIWAGGwIDHRtScoOZ SiiyDY4PFVdc9UJy/aNCdB3BcnX9qzD2r5UNH/CHnJnTvHKMiRvX2Nhax27mziPpX8Yf yyiIjXXpQkg0E89gR7pB6ZuSnS2wsyMe1jqL9LQYJMu4UTzxWEyEjW+HNMk8CVatFiwD TdTd9FGFPMaxXWeGRo+O93HruQNWSJjlwJGx+JzQHom0m45wwHDnA39X0kngNkf5736B wnMg4ssECegb4PfXmLpCC/Cux9PcKtWXnn4Cs21hz0FeuBBjR+IQJJnG2sr0Mp9DOySr NxHA== X-Gm-Message-State: AJaThX5/yDb0eILAMMUl3kxSwybkMOIcEFIwmC/SiBVbygHSt66bAckv leMzTnRvZitvpi8j8Vfz5yQrjojUdaM0xOJNAvLEgA== X-Google-Smtp-Source: AGs4zMYAG/c6lnjLzjAHNLSf4So+R20oHZ9Rm/NGCZqa/1PuLP75wHLkepzBZo3PaKKqDb+nkA6NKIqf5ysxrzLgV4Q= X-Received: by 10.107.30.81 with SMTP id e78mr19621002ioe.130.1511560653530; Fri, 24 Nov 2017 13:57:33 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Fri, 24 Nov 2017 13:57:32 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:f964:7c3e:d2:aac5] In-Reply-To: <201711242114.vAOLE4b6097164@pdx.rh.CN85.dnsmgr.net> References: <201711242114.vAOLE4b6097164@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Fri, 24 Nov 2017 14:57:32 -0700 X-Google-Sender-Auth: 4nsa-jXGIfSbGe2MKi5Sfi2zyNU Message-ID: Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts To: "Rodney W. Grimes" Cc: Emmanuel Vadot , Allan Jude , "Conrad E. Meyer" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 21:57:34 -0000 On Fri, Nov 24, 2017 at 2:14 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > We are not talking about removing ntpdate in this thread. > > > > Well, after Ian said that it was deprecated I ask if we should remove > > it to be honest. > > And I think we have come to the agreement not to do that until the > official distribution does it as well, is that also correct? > I think we should do whatever Ian suggests. I did time things with atomic clocks and ntpd for about 8 years. He's done them for the same company I have and knows the current set of quirks better than anybody else in this thread. These days, it's generally better to use the freebsd ntp pool, like we have in ntp.conf, and in that scenario, an invocation of ntpd with the appropriate flags can give you almost identical behavior to ntpdate. The 'almost' here has a lot of quibbles that aren't relevant to the installer. And if you don't like the freebsd ntpd pool, then the installer should be writing an appropriate ntpd.conf file anyway, which has the host. It can all be done w/o using ntpdate (note: I didn't say remove it), and once that's in place, and we know there's something not unforeseen, we'll be ready if the ntpd folks ever make good on their threat to kill ntpdate. So remove the use of ntpdate here, but keep the utility around. tl;dr: Do what ever Ian says, if he doesn't do it himself. He's the expert with a decade of daily experience making products with ntpd work and shipping those to customers that have... somewhat diverse environments... Warner From owner-svn-src-head@freebsd.org Fri Nov 24 22:36:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCD31DF32CE for ; Fri, 24 Nov 2017 22:36:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC92467480 for ; Fri, 24 Nov 2017 22:36:25 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ee158be9-d167-11e7-97f4-9d8903e843e3 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.ore.mailhop.org (Halon) with ESMTPSA id ee158be9-d167-11e7-97f4-9d8903e843e3; Fri, 24 Nov 2017 22:36:37 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vAOMaMgK001879; Fri, 24 Nov 2017 15:36:22 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1511562982.1349.8.camel@freebsd.org> Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts From: Ian Lepore To: Warner Losh , "Rodney W. Grimes" Cc: Emmanuel Vadot , Allan Jude , "Conrad E. Meyer" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Fri, 24 Nov 2017 15:36:22 -0700 In-Reply-To: References: <201711242114.vAOLE4b6097164@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 22:36:25 -0000 On Fri, 2017-11-24 at 14:57 -0700, Warner Losh wrote: > On Fri, Nov 24, 2017 at 2:14 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > > > > > > > We are not talking about removing ntpdate in this thread. > > >   Well, after Ian said that it was deprecated I ask if we should remove > > > it to be honest. > > And I think we have come to the agreement not to do that until the > > official distribution does it as well, is that also correct? > > > I think we should do whatever Ian suggests. I did time things with atomic > clocks and ntpd for about 8 years. He's done them for the same company I > have and knows the current set of quirks better than anybody else in this > thread. These days, it's generally better to use the freebsd ntp pool, like > we have in ntp.conf, and in that scenario, an invocation of ntpd with the > appropriate flags can give you almost identical behavior to ntpdate. The > 'almost' here has a lot of quibbles that aren't relevant to the installer. > And if you don't like the freebsd ntpd pool, then the installer should be > writing an appropriate ntpd.conf file anyway, which has the host. It can > all be done w/o using ntpdate (note: I didn't say remove it), and once > that's in place, and we know there's something not unforeseen, we'll be > ready if the ntpd folks ever make good on their threat to kill ntpdate. So > remove the use of ntpdate here, but keep the utility around. > > tl;dr: Do what ever Ian says, if he doesn't do it himself. He's the expert > with a decade of daily experience making products with ntpd work and > shipping those to customers that have... somewhat diverse environments... > > Warner And yet, even with all that experience, I still neglected to consider the case where ntpd_sync_on_start=YES can cause a time-step on a running system if ntpd is restarted.  (Not that that's a common scenario, but it's still a Bad Thing for people with strict auditing requirements or timing-critical software running.) What the ntpd developers currently say[1] is: The combination of ntpd and sntp now implements the functions of ntpdate. As soon as a few remaining issues with sntp are resolved the ntpdate program will be retired. If you look at what they link to for the "sntp issues"[2] it hasn't been updated since 2011.  So that leads me to the conclusions:  - They have not yet provided a complete path away from ntpdate.  - They don't seem to be in a big hurry to eliminate ntpdate. All in all, I think what Manu committed is Good Enough For Now(tm). [1] https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate [2] https://support.ntp.org/bin/view/Dev/SntpIssues -- Ian From owner-svn-src-head@freebsd.org Fri Nov 24 23:06: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 4A8D8DF39BF; Fri, 24 Nov 2017 23:06:32 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CD076680EC; Fri, 24 Nov 2017 23:06:30 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 58d98c8a; Sat, 25 Nov 2017 00:06:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=3VcZBLBrIEj6ompnfo1sZXRi1Xk=; b=mrRfIpAtekl9RfJ+HTio33H5CMK6 z4hVCoTwjwB/DgIr8KSMH9dWFysSE2RNYmnRe5XkoozGBlYWU8FNQ1ZiF3EsKlw4 nAldxtu3EXM0qFkzzLOSQiTohNk4uKG+NuM0NkF/aq+wJUp1SoqT9kliijBc7BKx 7H/qcWxpF2KTSVQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=OVK4/zT5t4tAib0YGgIfy7pj8s06SaDELM3emanhVVigg3MQVhCmLZct 2zWIwGm8N/QMk728jA6XwCaGXPiiXszjxyqb5mIedwhRN+eAqxSNTTNpV6Mccwzx lrodYLGW1Aw2yQlha1DKHe0uDBb6qaXykXHe2PStHRptr43fbXk= Received: from knuckles.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 028261b4 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sat, 25 Nov 2017 00:06:27 +0100 (CET) Date: Sat, 25 Nov 2017 00:06:27 +0100 From: Emmanuel Vadot To: Ian Lepore Cc: Warner Losh , "Rodney W. Grimes" , Allan Jude , "Conrad E. Meyer" , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts Message-Id: <20171125000627.33e77500eeefbe02a8d18154@bidouilliste.com> In-Reply-To: <1511562982.1349.8.camel@freebsd.org> References: <201711242114.vAOLE4b6097164@pdx.rh.CN85.dnsmgr.net> <1511562982.1349.8.camel@freebsd.org> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 23:06:32 -0000 On Fri, 24 Nov 2017 15:36:22 -0700 Ian Lepore wrote: > On Fri, 2017-11-24 at 14:57 -0700, Warner Losh wrote: > > On Fri, Nov 24, 2017 at 2:14 PM, Rodney W. Grimes < > > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >=20 > > >=20 > > >=20 > > > >=20 > > > > >=20 > > > > > We are not talking about removing ntpdate in this thread. > > > > =A0 Well, after Ian said that it was deprecated I ask if we should = remove > > > > it to be honest. > > > And I think we have come to the agreement not to do that until the > > > official distribution does it as well, is that also correct? > > >=20 > > I think we should do whatever Ian suggests. I did time things with atom= ic > > clocks and ntpd for about 8 years. He's done them for the same company I > > have and knows the current set of quirks better than anybody else in th= is > > thread. These days, it's generally better to use the freebsd ntp pool, = like > > we have in ntp.conf, and in that scenario, an invocation of ntpd with t= he > > appropriate flags can give you almost identical behavior to ntpdate. The > > 'almost' here has a lot of quibbles that aren't relevant to the install= er. > > And if you don't like the freebsd ntpd pool, then the installer should = be > > writing an appropriate ntpd.conf file anyway, which has the host. It can > > all be done w/o using ntpdate (note: I didn't say remove it), and once > > that's in place, and we know there's something not unforeseen, we'll be > > ready if the ntpd folks ever make good on their threat to kill ntpdate.= So > > remove the use of ntpdate here, but keep the utility around. > >=20 > > tl;dr: Do what ever Ian says, if he doesn't do it himself. He's the exp= ert > > with a decade of daily experience making products with ntpd work and > > shipping those to customers that have... somewhat diverse environments.= .. > >=20 > > Warner >=20 > And yet, even with all that experience, I still neglected to consider > the case where ntpd_sync_on_start=3DYES can cause a time-step on a > running system if ntpd is restarted. =A0(Not that that's a common > scenario, but it's still a Bad Thing for people with strict auditing > requirements or timing-critical software running.) >=20 > What the ntpd developers currently say[1] is: >=20 > The combination of ntpd and sntp now implements the functions of > ntpdate. As soon as a few remaining issues with sntp are resolved > the ntpdate program will be retired. >=20 > If you look at what they link to for the "sntp issues"[2] it hasn't > been updated since 2011. =A0So that leads me to the conclusions: >=20 > =A0- They have not yet provided a complete path away from ntpdate. > =A0- They don't seem to be in a big hurry to eliminate ntpdate. >=20 > All in all, I think what Manu committed is Good Enough For Now(tm). Thank you Ian for your time one this, I'll leave the tree as is right now and when there is anything new in the ntp world we will see what we will do. Case closed, mail thread closed too. Cheers, > [1] https://support.ntp.org/bin/view/Dev/DeprecatingNtpdate > [2] https://support.ntp.org/bin/view/Dev/SntpIssues >=20 > -- Ian --=20 Emmanuel Vadot From owner-svn-src-head@freebsd.org Fri Nov 24 23:41: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 98D2FDF4214; Fri, 24 Nov 2017 23:41:05 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7262C68F90; Fri, 24 Nov 2017 23:41:05 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAONf4Hc082661; Fri, 24 Nov 2017 23:41:04 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAONf4HW082657; Fri, 24 Nov 2017 23:41:04 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711242341.vAONf4HW082657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Fri, 24 Nov 2017 23:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326182 - in head/stand: ofw/libofw powerpc/kboot powerpc/ps3 X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/stand: ofw/libofw powerpc/kboot powerpc/ps3 X-SVN-Commit-Revision: 326182 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 24 Nov 2017 23:41:05 -0000 Author: nwhitehorn Date: Fri Nov 24 23:41:04 2017 New Revision: 326182 URL: https://svnweb.freebsd.org/changeset/base/326182 Log: Modify all FreeBSD bootloaders on PowerPC AIM (Book-S) systems to pass a magic number to the kernel in r7 rather than the (currently unused and irrelevant) width of the metadata pointer, which I believe was intended for a never-used approach to the 64-bit port. This enables the kernel, in a future commit, to switch on the cookie to distinguish a real metadata pointer from loader(8) from garbage left in r6 by some other boot loader. MFC after: 3 weeks Modified: head/stand/ofw/libofw/elf_freebsd.c head/stand/ofw/libofw/ppc64_elf_freebsd.c head/stand/powerpc/kboot/ppc64_elf_freebsd.c head/stand/powerpc/ps3/ppc64_elf_freebsd.c Modified: head/stand/ofw/libofw/elf_freebsd.c ============================================================================== --- head/stand/ofw/libofw/elf_freebsd.c Fri Nov 24 19:57:13 2017 (r326181) +++ head/stand/ofw/libofw/elf_freebsd.c Fri Nov 24 23:41:04 2017 (r326182) @@ -91,7 +91,7 @@ __elfN(ofw_exec)(struct preloaded_file *fp) mdp, sizeof(mdp)); } else { OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, - (void *)mdp, sizeof(mdp)); + (void *)mdp, 0xfb5d104d); } panic("exec returned"); Modified: head/stand/ofw/libofw/ppc64_elf_freebsd.c ============================================================================== --- head/stand/ofw/libofw/ppc64_elf_freebsd.c Fri Nov 24 19:57:13 2017 (r326181) +++ head/stand/ofw/libofw/ppc64_elf_freebsd.c Fri Nov 24 23:41:04 2017 (r326182) @@ -93,11 +93,11 @@ ppc64_ofw_elf_exec(struct preloaded_file *fp) if (dtbp != 0) { OF_quiesce(); - ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, 0, 0, - mdp, sizeof(mdp)); + ((int (*)(u_long, u_long, u_long, void *, u_long))entry)(dtbp, + 0, 0, mdp, 0xfb5d104d); } else { OF_chain((void *)reloc, end - (char *)reloc, (void *)entry, - (void *)mdp, sizeof(mdp)); + (void *)mdp, 0xfb5d104d); } panic("exec returned"); Modified: head/stand/powerpc/kboot/ppc64_elf_freebsd.c ============================================================================== --- head/stand/powerpc/kboot/ppc64_elf_freebsd.c Fri Nov 24 19:57:13 2017 (r326181) +++ head/stand/powerpc/kboot/ppc64_elf_freebsd.c Fri Nov 24 23:41:04 2017 (r326182) @@ -96,7 +96,7 @@ ppc64_elf_exec(struct preloaded_file *fp) trampoline[3] = dtb; trampoline[6] = mdp; - trampoline[7] = sizeof(mdp); + trampoline[7] = 0xfb5d104d; printf("Kernel entry at %#jx (%#x) ...\n", e->e_entry, trampoline[2]); printf("DTB at %#x, mdp at %#x\n", dtb, mdp); Modified: head/stand/powerpc/ps3/ppc64_elf_freebsd.c ============================================================================== --- head/stand/powerpc/ps3/ppc64_elf_freebsd.c Fri Nov 24 19:57:13 2017 (r326181) +++ head/stand/powerpc/ps3/ppc64_elf_freebsd.c Fri Nov 24 23:41:04 2017 (r326182) @@ -89,7 +89,7 @@ ppc64_elf_exec(struct preloaded_file *fp) dev_cleanup(); entry(0 /* FDT */, 0 /* Phys. mem offset */, 0 /* OF entry */, - (void *)mdp, sizeof(mdp)); + (void *)mdp, 0xfb5d104d); panic("exec returned"); } From owner-svn-src-head@freebsd.org Sat Nov 25 03:59: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 34190DFDD20; Sat, 25 Nov 2017 03:59:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BB47720DA; Sat, 25 Nov 2017 03:59:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAP3xbg1096575; Sat, 25 Nov 2017 03:59:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAP3xaFD096570; Sat, 25 Nov 2017 03:59:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201711250359.vAP3xaFD096570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 25 Nov 2017 03:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326183 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 326183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 03:59:38 -0000 Author: jhb Date: Sat Nov 25 03:59:36 2017 New Revision: 326183 URL: https://svnweb.freebsd.org/changeset/base/326183 Log: Add stdio.h to the synopsis for sysdecode functions that take a FILE *. Modified: head/lib/libsysdecode/sysdecode_cap_rights.3 head/lib/libsysdecode/sysdecode_fcntl_arg.3 head/lib/libsysdecode/sysdecode_mask.3 head/lib/libsysdecode/sysdecode_quotactl_cmd.3 head/lib/libsysdecode/sysdecode_utrace.3 Modified: head/lib/libsysdecode/sysdecode_cap_rights.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_cap_rights.3 Fri Nov 24 23:41:04 2017 (r326182) +++ head/lib/libsysdecode/sysdecode_cap_rights.3 Sat Nov 25 03:59:36 2017 (r326183) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2016 +.Dd November 24, 2017 .Dt sysdecode_cap_rights 3 .Os .Sh NAME @@ -36,6 +36,7 @@ .Sh SYNOPSIS .In sys/types.h .In stdbool.h +.In stdio.h .In sysdecode.h .Ft void .Fn sysdecode_cap_rights "FILE *fp" "cap_rights_t *rightsp" Modified: head/lib/libsysdecode/sysdecode_fcntl_arg.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_fcntl_arg.3 Fri Nov 24 23:41:04 2017 (r326182) +++ head/lib/libsysdecode/sysdecode_fcntl_arg.3 Sat Nov 25 03:59:36 2017 (r326183) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2016 +.Dd November 24, 2017 .Dt sysdecode_fcntl_arg 3 .Os .Sh NAME @@ -37,6 +37,7 @@ .Sh SYNOPSIS .In sys/types.h .In stdbool.h +.In stdio.h .In sysdecode.h .Ft void .Fn sysdecode_fcntl_arg "FILE *fp" "int cmd" "uintptr_t arg" "int base" Modified: head/lib/libsysdecode/sysdecode_mask.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_mask.3 Fri Nov 24 23:41:04 2017 (r326182) +++ head/lib/libsysdecode/sysdecode_mask.3 Sat Nov 25 03:59:36 2017 (r326183) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 3, 2017 +.Dd November 24, 2017 .Dt sysdecode_mask 3 .Os .Sh NAME @@ -63,6 +63,7 @@ .Sh SYNOPSIS .In sys/types.h .In stdbool.h +.In stdio.h .In sysdecode.h .Ft bool .Fn sysdecode_access_mode "FILE *fp" "int mode" "int *rem" Modified: head/lib/libsysdecode/sysdecode_quotactl_cmd.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_quotactl_cmd.3 Fri Nov 24 23:41:04 2017 (r326182) +++ head/lib/libsysdecode/sysdecode_quotactl_cmd.3 Sat Nov 25 03:59:36 2017 (r326183) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2016 +.Dd November 24, 2017 .Dt sysdecode_quotactl_cmd 3 .Os .Sh NAME @@ -36,6 +36,7 @@ .Sh SYNOPSIS .In sys/types.h .In stdbool.h +.In stdio.h .In sysdecode.h .Ft bool .Fn sysdecode_quotactl_cmd "FILE *fp" "int cmd" Modified: head/lib/libsysdecode/sysdecode_utrace.3 ============================================================================== --- head/lib/libsysdecode/sysdecode_utrace.3 Fri Nov 24 23:41:04 2017 (r326182) +++ head/lib/libsysdecode/sysdecode_utrace.3 Sat Nov 25 03:59:36 2017 (r326183) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 17, 2016 +.Dd November 24, 2017 .Dt sysdecode_utrace 3 .Os .Sh NAME @@ -36,6 +36,7 @@ .Sh SYNOPSIS .In sys/types.h .In stdbool.h +.In stdio.h .In sysdecode.h .Ft int .Fn sysdecode_utrace "FILE *fp" "void *buf" "size_t len" "int decimal" From owner-svn-src-head@freebsd.org Sat Nov 25 04:49: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 298F2E0AD58; Sat, 25 Nov 2017 04:49:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2B457469A; Sat, 25 Nov 2017 04:49:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAP4nDeL017940; Sat, 25 Nov 2017 04:49:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAP4nCSW017923; Sat, 25 Nov 2017 04:49:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201711250449.vAP4nCSW017923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 25 Nov 2017 04:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326184 - in head: lib/libsysdecode sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump usr.bin/ktrace usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: lib/libsysdecode sys/compat/freebsd32 sys/kern sys/sys usr.bin/kdump usr.bin/ktrace usr.bin/truss X-SVN-Commit-Revision: 326184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 04:49:15 -0000 Author: jhb Date: Sat Nov 25 04:49:12 2017 New Revision: 326184 URL: https://svnweb.freebsd.org/changeset/base/326184 Log: Decode kevent structures logged via ktrace(2) in kdump. - Add a new KTR_STRUCT_ARRAY ktrace record type which dumps an array of structures. The structure name in the record payload is preceded by a size_t containing the size of the individual structures. Use this to replace the previous code that dumped the kevent arrays dumped for kevent(). kdump is now able to decode the kevent structures rather than dumping their contents via a hexdump. One change from before is that the 'changes' and 'events' arrays are not marked with separate 'read' and 'write' annotations in kdump output. Instead, the first array is the 'changes' array, and the second array (only present if kevent doesn't fail with an error) is the 'events' array. For kevent(), empty arrays are denoted by an entry with an array containing zero entries rather than no record. - Move kevent decoding tables from truss to libsysdecode. This adds three new functions to decode members of struct kevent: sysdecode_kevent_filter, sysdecode_kevent_flags, and sysdecode_kevent_fflags. kdump uses these helper functions to pretty-print kevent fields. - Move structure definitions for freebsd11 and freebsd32 kevent structures to so that they can be shared with userland. The 32-bit structures are only exposed if _WANT_KEVENT32 is defined. The freebsd11 structures are only exposed if _WANT_FREEBSD11_KEVENT is defined. The 32-bit freebsd11 structure requires both. - Decode freebsd11 kevent structures in truss for the compat11.kevent() system call. - Log 32-bit kevent structures via ktrace for 32-bit compat kevent() system calls. - While here, constify the 'void *data' argument to ktrstruct(). Reviewed by: kib (earlier version) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D12470 Added: head/lib/libsysdecode/sysdecode_kevent.3 (contents, props changed) Modified: head/lib/libsysdecode/Makefile head/lib/libsysdecode/flags.c head/lib/libsysdecode/mktables head/lib/libsysdecode/sysdecode.3 head/lib/libsysdecode/sysdecode.h head/sys/compat/freebsd32/freebsd32.h head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/kern_event.c head/sys/kern/kern_ktrace.c head/sys/sys/event.h head/sys/sys/ktrace.h head/usr.bin/kdump/kdump.c head/usr.bin/ktrace/ktrace.h head/usr.bin/truss/syscall.h head/usr.bin/truss/syscalls.c Modified: head/lib/libsysdecode/Makefile ============================================================================== --- head/lib/libsysdecode/Makefile Sat Nov 25 03:59:36 2017 (r326183) +++ head/lib/libsysdecode/Makefile Sat Nov 25 04:49:12 2017 (r326184) @@ -17,6 +17,7 @@ MAN= sysdecode.3 \ sysdecode_cap_rights.3 \ sysdecode_enum.3 \ sysdecode_fcntl_arg.3 \ + sysdecode_kevent.3 \ sysdecode_ioctlname.3 \ sysdecode_mask.3 \ sysdecode_quotactl_cmd.3 \ @@ -69,6 +70,9 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \ sysdecode_enum.3 sysdecode_vmresult.3 \ sysdecode_enum.3 sysdecode_whence.3 MLINKS+=sysdecode_fcntl_arg.3 sysdecode_fcntl_arg_p.3 +MLINKS+=sysdecode_kevent.3 sysdecode_kevent_fflags.3 \ + sysdecode_kevent.3 sysdecode_kevent_filter.3 \ + sysdecode_kevent.3 sysdecode_kevent_flags.3 MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \ sysdecode_mask.3 sysdecode_atflags.3 \ sysdecode_mask.3 sysdecode_capfcntlrights.3 \ Modified: head/lib/libsysdecode/flags.c ============================================================================== --- head/lib/libsysdecode/flags.c Sat Nov 25 03:59:36 2017 (r326183) +++ head/lib/libsysdecode/flags.c Sat Nov 25 04:49:12 2017 (r326184) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -499,6 +500,116 @@ sysdecode_getrusage_who(int who) { return (lookup_value(rusage, who)); +} + +static struct name_table kevent_user_ffctrl[] = { + X(NOTE_FFNOP) X(NOTE_FFAND) X(NOTE_FFOR) X(NOTE_FFCOPY) + XEND +}; + +static struct name_table kevent_rdwr_fflags[] = { + X(NOTE_LOWAT) X(NOTE_FILE_POLL) XEND +}; + +static struct name_table kevent_vnode_fflags[] = { + X(NOTE_DELETE) X(NOTE_WRITE) X(NOTE_EXTEND) X(NOTE_ATTRIB) + X(NOTE_LINK) X(NOTE_RENAME) X(NOTE_REVOKE) X(NOTE_OPEN) X(NOTE_CLOSE) + X(NOTE_CLOSE_WRITE) X(NOTE_READ) XEND +}; + +static struct name_table kevent_proc_fflags[] = { + X(NOTE_EXIT) X(NOTE_FORK) X(NOTE_EXEC) X(NOTE_TRACK) X(NOTE_TRACKERR) + X(NOTE_CHILD) XEND +}; + +static struct name_table kevent_timer_fflags[] = { + X(NOTE_SECONDS) X(NOTE_MSECONDS) X(NOTE_USECONDS) X(NOTE_NSECONDS) + X(NOTE_ABSTIME) XEND +}; + +void +sysdecode_kevent_fflags(FILE *fp, short filter, int fflags, int base) +{ + int rem; + + if (fflags == 0) { + fputs("0", fp); + return; + } + + switch (filter) { + case EVFILT_READ: + case EVFILT_WRITE: + if (!print_mask_int(fp, kevent_rdwr_fflags, fflags, &rem)) + fprintf(fp, "%#x", rem); + else if (rem != 0) + fprintf(fp, "|%#x", rem); + break; + case EVFILT_VNODE: + if (!print_mask_int(fp, kevent_vnode_fflags, fflags, &rem)) + fprintf(fp, "%#x", rem); + else if (rem != 0) + fprintf(fp, "|%#x", rem); + break; + case EVFILT_PROC: + case EVFILT_PROCDESC: + if (!print_mask_int(fp, kevent_proc_fflags, fflags, &rem)) + fprintf(fp, "%#x", rem); + else if (rem != 0) + fprintf(fp, "|%#x", rem); + break; + case EVFILT_TIMER: + if (!print_mask_int(fp, kevent_timer_fflags, fflags, &rem)) + fprintf(fp, "%#x", rem); + else if (rem != 0) + fprintf(fp, "|%#x", rem); + break; + case EVFILT_USER: { + unsigned int ctrl, data; + + ctrl = fflags & NOTE_FFCTRLMASK; + data = fflags & NOTE_FFLAGSMASK; + + if (fflags & NOTE_TRIGGER) { + fputs("NOTE_TRIGGER", fp); + if (fflags == NOTE_TRIGGER) + return; + fputc('|', fp); + } + + /* + * An event with 'ctrl' == NOTE_FFNOP is either a reported + * (output) event for which only 'data' should be output + * or a pointless input event. Assume that pointless + * input events don't occur in practice. An event with + * NOTE_TRIGGER is always an input event. + */ + if (ctrl != NOTE_FFNOP || fflags & NOTE_TRIGGER) { + fprintf(fp, "%s|%#x", + lookup_value(kevent_user_ffctrl, ctrl), data); + } else { + print_integer(fp, data, base); + } + break; + } + default: + print_integer(fp, fflags, base); + break; + } +} + +bool +sysdecode_kevent_flags(FILE *fp, int flags, int *rem) +{ + + return (print_mask_int(fp, keventflags, flags, rem)); +} + +const char * +sysdecode_kevent_filter(int filter) +{ + + return (lookup_value(keventfilters, filter)); } const char * Modified: head/lib/libsysdecode/mktables ============================================================================== --- head/lib/libsysdecode/mktables Sat Nov 25 03:59:36 2017 (r326183) +++ head/lib/libsysdecode/mktables Sat Nov 25 04:49:12 2017 (r326184) @@ -107,6 +107,8 @@ gen_table "mmapprot" "PROT_[A-Z]+[[:space:]]+0x gen_table "ngbtsolevel" "SOL_[A-Z0-9]+[[:space:]]+0x[0-9A-Fa-f]+" "netgraph/bluetooth/include/ng_btsocket.h" gen_table "fileflags" "[SU]F_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/stat.h" "UF_COMPRESSED|UF_TRACKED|UF_SETTABLE|SF_SETTABLE" gen_table "filemode" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h" +gen_table "keventflags" "EV_[A-Z]+[[:space:]]+0x[0-9]+" "sys/event.h" "EV_SYSFLAGS|EV_DROP|EV_FLAG[12]" +gen_table "keventfilters" "EVFILT_[A-Z]+[[:space:]]+\(-[0-9]+\)" "sys/event.h" gen_table "mountflags" "MNT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mount.h" gen_table "msyncflags" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h" gen_table "nfssvcflags" "NFSSVC_[A-Z0-9]+[[:space:]]+0x[0-9]+" "nfs/nfssvc.h" Modified: head/lib/libsysdecode/sysdecode.3 ============================================================================== --- head/lib/libsysdecode/sysdecode.3 Sat Nov 25 03:59:36 2017 (r326183) +++ head/lib/libsysdecode/sysdecode.3 Sat Nov 25 04:49:12 2017 (r326184) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 3, 2017 +.Dd November 24, 2017 .Dt SYSDECODE 3 .Os .Sh NAME @@ -73,6 +73,7 @@ A placeholder for use when the ABI is not known. .Xr sysdecode_enum 3 , .Xr sysdecode_fcntl_arg 3 , .Xr sysdecode_ioctlname 3 , +.Xr sysdecode_kevent 3 , .Xr sysdecode_mask 3 , .Xr sysdecode_quotactl_cmd 3 , .Xr sysdecode_sigcode 3 , Modified: head/lib/libsysdecode/sysdecode.h ============================================================================== --- head/lib/libsysdecode/sysdecode.h Sat Nov 25 03:59:36 2017 (r326183) +++ head/lib/libsysdecode/sysdecode.h Sat Nov 25 04:49:12 2017 (r326184) @@ -60,6 +60,10 @@ const char *sysdecode_getrusage_who(int _who); const char *sysdecode_idtype(int _idtype); const char *sysdecode_ioctlname(unsigned long _val); const char *sysdecode_ipproto(int _protocol); +void sysdecode_kevent_fflags(FILE *_fp, short _filter, int _fflags, + int _base); +const char *sysdecode_kevent_filter(int _filter); +bool sysdecode_kevent_flags(FILE *_fp, int _flags, int *_rem); const char *sysdecode_kldsym_cmd(int _cmd); const char *sysdecode_kldunload_flags(int _flags); const char *sysdecode_lio_listio_mode(int _mode); Added: head/lib/libsysdecode/sysdecode_kevent.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libsysdecode/sysdecode_kevent.3 Sat Nov 25 04:49:12 2017 (r326184) @@ -0,0 +1,126 @@ +.\" +.\" Copyright (c) 2017 John Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 24, 2017 +.Dt sysdecode_kevent 3 +.Os +.Sh NAME +.Nm sysdecode_kevent , +.Nm sysdecode_kevent_fflags , +.Nm sysdecode_kevent_filter , +.Nm sysdecode_kevent_flags +.Nd output description of kevent structure fields +.Sh LIBRARY +.Lb libsysdecode +.Sh SYNOPSIS +.In sys/types.h +.In stdbool.h +.In stdio.h +.In sysdecode.h +.Ft void +.Fn sysdecode_kevent_fflags "FILE *fp" "short filter" "int fflags" "int base" +.Ft bool +.Fn sysdecode_kevent_flags "FILE *fp" "int flags" "int *rem" +.Ft const char * +.Fn sysdecode_kevent_filter "int filter" +.Sh DESCRIPTION +These functions provide text descriptions of +.Vt struct kevent +fields. +.Pp +The +.Fn sysdecode_kevent_fflags +function outputs a text description of the +.Fa fflags +member of a +.Vt struct kevent +to the stream +.Fa fp . +For the +.Dv EVFILT_READ , +.Dv EVFILT_WRITE , +.Dv EVFILT_VNODE , +.Dv EVFILT_PROC , +.Dv EVFILT_PROCDESC , +.Dv EVFILT_TIMER , +and +.Dv EVFILT_USER +filters, +.Fn sysdecode_kevent_fflags +outputs a bitmask of filter-specific +.Dv NOTE_* +flags as documented in +.Xr kevent 2 . +For other values of +.Fa filter , +the value of +.Fa fflags +is output in the indicated +.Fa base +.Pq one of 8, 10, or 16 . +.Pp +The +.Fn sysdecode_kevent_filter +function returns a text description of the +.Fa filter +member of a +.Vt struct kevent . +.Dv NULL +is returned if the +.Fa filter +value is unknown. +.Pp +The +.Fn sysdecode_kevent_flags +function outputs a text description of the +.Fa flags +member of a +.Vt struct kevent +to the stream +.Fa fp . +This function uses the same calling convention and formatting as the other +functions described in +.Xr sysdecode_mask 3 . +.Sh RETURN VALUES +The +.Nm sysdecode_kevent_filter +function returns the name of a filter or +.Dv NULL if the filter value is unknown. +.Pp +The +.Nm sysdecode_kevent_flags +function returns +.Dv true +if any flags in the +.Fa flags +field were decoded and +.Dv false +if no flags were decoded. +.Sh SEE ALSO +.Xr sysdecode 3 , +.Xr sysdecode_enum 3 , +.Xr sysdecode_mask 3 Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Sat Nov 25 03:59:36 2017 (r326183) +++ head/sys/compat/freebsd32/freebsd32.h Sat Nov 25 04:49:12 2017 (r326184) @@ -145,22 +145,6 @@ struct statfs32 { int32_t f_spare[2]; }; -struct kevent32 { - uint32_t ident; /* identifier for this event */ - short filter; /* filter for event */ - u_short flags; - u_int fflags; -#ifndef __amd64__ - uint32_t pad0; -#endif - int32_t data1, data2; - uint32_t udata; /* opaque user data identifier */ -#ifndef __amd64__ - uint32_t pad1; -#endif - uint32_t ext64[8]; -}; - struct iovec32 { u_int32_t iov_base; int iov_len; Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sat Nov 25 03:59:36 2017 (r326183) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sat Nov 25 04:49:12 2017 (r326184) @@ -30,9 +30,14 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_ktrace.h" #define __ELF_WORD_SIZE 32 +#ifdef COMPAT_FREEBSD11 +#define _WANT_FREEBSD11_KEVENT +#endif + #include #include #include @@ -83,6 +88,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef KTRACE +#include +#endif #ifdef INET #include @@ -714,6 +722,9 @@ freebsd32_kevent(struct thread *td, struct freebsd32_k .k_copyout = freebsd32_kevent_copyout, .k_copyin = freebsd32_kevent_copyin, }; +#ifdef KTRACE + struct kevent32 *eventlist = uap->eventlist; +#endif int error; if (uap->timeout) { @@ -725,21 +736,22 @@ freebsd32_kevent(struct thread *td, struct freebsd32_k tsp = &ts; } else tsp = NULL; +#ifdef KTRACE + if (KTRPOINT(td, KTR_STRUCT_ARRAY)) + ktrstructarray("kevent32", UIO_USERSPACE, uap->changelist, + uap->nchanges, sizeof(struct kevent32)); +#endif error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents, &k_ops, tsp); +#ifdef KTRACE + if (error == 0 && KTRPOINT(td, KTR_STRUCT_ARRAY)) + ktrstructarray("kevent32", UIO_USERSPACE, eventlist, + td->td_retval[0], sizeof(struct kevent32)); +#endif return (error); } #ifdef COMPAT_FREEBSD11 -struct kevent32_freebsd11 { - u_int32_t ident; /* identifier for this event */ - short filter; /* filter for event */ - u_short flags; - u_int fflags; - int32_t data; - u_int32_t udata; /* opaque user data identifier */ -}; - static int freebsd32_kevent11_copyout(void *arg, struct kevent *kevp, int count) { @@ -807,6 +819,9 @@ freebsd11_freebsd32_kevent(struct thread *td, .k_copyout = freebsd32_kevent11_copyout, .k_copyin = freebsd32_kevent11_copyin, }; +#ifdef KTRACE + struct kevent32_freebsd11 *eventlist = uap->eventlist; +#endif int error; if (uap->timeout) { @@ -818,8 +833,20 @@ freebsd11_freebsd32_kevent(struct thread *td, tsp = &ts; } else tsp = NULL; +#ifdef KTRACE + if (KTRPOINT(td, KTR_STRUCT_ARRAY)) + ktrstructarray("kevent32_freebsd11", UIO_USERSPACE, + uap->changelist, uap->nchanges, + sizeof(struct kevent32_freebsd11)); +#endif error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents, &k_ops, tsp); +#ifdef KTRACE + if (error == 0 && KTRPOINT(td, KTR_STRUCT_ARRAY)) + ktrstructarray("kevent32_freebsd11", UIO_USERSPACE, + eventlist, td->td_retval[0], + sizeof(struct kevent32_freebsd11)); +#endif return (error); } #endif Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Sat Nov 25 03:59:36 2017 (r326183) +++ head/sys/kern/kern_event.c Sat Nov 25 04:49:12 2017 (r326184) @@ -33,6 +33,10 @@ __FBSDID("$FreeBSD$"); #include "opt_ktrace.h" #include "opt_kqueue.h" +#ifdef COMPAT_FREEBSD11 +#define _WANT_FREEBSD11_KEVENT +#endif + #include #include #include @@ -115,7 +119,7 @@ static void kqueue_fo_release(int filt); struct g_kevent_args; static int kern_kevent_generic(struct thread *td, struct g_kevent_args *uap, - struct kevent_copyops *k_ops); + struct kevent_copyops *k_ops, const char *struct_name); static fo_ioctl_t kqueue_ioctl; static fo_poll_t kqueue_poll; @@ -905,17 +909,6 @@ kern_kqueue(struct thread *td, int flags, struct filec return (0); } -#ifdef KTRACE -static size_t -kev_iovlen(int n, u_int kgio, size_t kevent_size) -{ - - if (n < 0 || n >= kgio / kevent_size) - return (kgio); - return (n * kevent_size); -} -#endif - struct g_kevent_args { int fd; void *changelist; @@ -943,22 +936,18 @@ sys_kevent(struct thread *td, struct kevent_args *uap) .timeout = uap->timeout, }; - return (kern_kevent_generic(td, &gk_args, &k_ops)); + return (kern_kevent_generic(td, &gk_args, &k_ops, "kevent")); } static int kern_kevent_generic(struct thread *td, struct g_kevent_args *uap, - struct kevent_copyops *k_ops) + struct kevent_copyops *k_ops, const char *struct_name) { struct timespec ts, *tsp; - int error; #ifdef KTRACE - struct uio ktruio; - struct iovec ktriov; - struct uio *ktruioin = NULL; - struct uio *ktruioout = NULL; - u_int kgio; + struct kevent *eventlist = uap->eventlist; #endif + int error; if (uap->timeout != NULL) { error = copyin(uap->timeout, &ts, sizeof(ts)); @@ -969,35 +958,18 @@ kern_kevent_generic(struct thread *td, struct g_kevent tsp = NULL; #ifdef KTRACE - if (KTRPOINT(td, KTR_GENIO)) { - kgio = ktr_geniosize; - ktriov.iov_base = uap->changelist; - ktriov.iov_len = kev_iovlen(uap->nchanges, kgio, - k_ops->kevent_size); - ktruio = (struct uio){ .uio_iov = &ktriov, .uio_iovcnt = 1, - .uio_segflg = UIO_USERSPACE, .uio_rw = UIO_READ, - .uio_td = td }; - ktruioin = cloneuio(&ktruio); - ktriov.iov_base = uap->eventlist; - ktriov.iov_len = kev_iovlen(uap->nevents, kgio, - k_ops->kevent_size); - ktriov.iov_len = uap->nevents * k_ops->kevent_size; - ktruioout = cloneuio(&ktruio); - } + if (KTRPOINT(td, KTR_STRUCT_ARRAY)) + ktrstructarray(struct_name, UIO_USERSPACE, uap->changelist, + uap->nchanges, k_ops->kevent_size); #endif error = kern_kevent(td, uap->fd, uap->nchanges, uap->nevents, k_ops, tsp); #ifdef KTRACE - if (ktruioin != NULL) { - ktruioin->uio_resid = kev_iovlen(uap->nchanges, kgio, - k_ops->kevent_size); - ktrgenio(uap->fd, UIO_WRITE, ktruioin, 0); - ktruioout->uio_resid = kev_iovlen(td->td_retval[0], kgio, - k_ops->kevent_size); - ktrgenio(uap->fd, UIO_READ, ktruioout, error); - } + if (error == 0 && KTRPOINT(td, KTR_STRUCT_ARRAY)) + ktrstructarray(struct_name, UIO_USERSPACE, eventlist, + td->td_retval[0], k_ops->kevent_size); #endif return (error); @@ -1040,15 +1012,6 @@ kevent_copyin(void *arg, struct kevent *kevp, int coun } #ifdef COMPAT_FREEBSD11 -struct kevent_freebsd11 { - __uintptr_t ident; /* identifier for this event */ - short filter; /* filter for event */ - unsigned short flags; - unsigned int fflags; - __intptr_t data; - void *udata; /* opaque user data identifier */ -}; - static int kevent11_copyout(void *arg, struct kevent *kevp, int count) { @@ -1123,7 +1086,7 @@ freebsd11_kevent(struct thread *td, struct freebsd11_k .timeout = uap->timeout, }; - return (kern_kevent_generic(td, &gk_args, &k_ops)); + return (kern_kevent_generic(td, &gk_args, &k_ops, "kevent_freebsd11")); } #endif Modified: head/sys/kern/kern_ktrace.c ============================================================================== --- head/sys/kern/kern_ktrace.c Sat Nov 25 03:59:36 2017 (r326183) +++ head/sys/kern/kern_ktrace.c Sat Nov 25 04:49:12 2017 (r326184) @@ -106,6 +106,7 @@ struct ktr_request { struct ktr_csw ktr_csw; struct ktr_fault ktr_fault; struct ktr_faultend ktr_faultend; + struct ktr_struct_array ktr_struct_array; } ktr_data; STAILQ_ENTRY(ktr_request) ktr_list; }; @@ -125,6 +126,7 @@ static int data_lengths[] = { [KTR_CAPFAIL] = sizeof(struct ktr_cap_fail), [KTR_FAULT] = sizeof(struct ktr_fault), [KTR_FAULTEND] = sizeof(struct ktr_faultend), + [KTR_STRUCT_ARRAY] = sizeof(struct ktr_struct_array), }; static STAILQ_HEAD(, ktr_request) ktr_free; @@ -742,7 +744,7 @@ ktrcsw(int out, int user, const char *wmesg) } void -ktrstruct(const char *name, void *data, size_t datalen) +ktrstruct(const char *name, const void *data, size_t datalen) { struct ktr_request *req; char *buf; @@ -759,6 +761,52 @@ ktrstruct(const char *name, void *data, size_t datalen free(buf, M_KTRACE); return; } + req->ktr_buffer = buf; + req->ktr_header.ktr_len = buflen; + ktr_submitrequest(curthread, req); +} + +void +ktrstructarray(const char *name, enum uio_seg seg, const void *data, + int num_items, size_t struct_size) +{ + struct ktr_request *req; + struct ktr_struct_array *ksa; + char *buf; + size_t buflen, datalen, namelen; + int max_items; + + /* Trim array length to genio size. */ + max_items = ktr_geniosize / struct_size; + if (num_items > max_items) { + if (max_items == 0) + num_items = 1; + else + num_items = max_items; + } + datalen = num_items * struct_size; + + if (data == NULL) + datalen = 0; + + namelen = strlen(name) + 1; + buflen = namelen + datalen; + buf = malloc(buflen, M_KTRACE, M_WAITOK); + strcpy(buf, name); + if (seg == UIO_SYSSPACE) + bcopy(data, buf + namelen, datalen); + else { + if (copyin(data, buf + namelen, datalen) != 0) { + free(buf, M_KTRACE); + return; + } + } + if ((req = ktr_getrequest(KTR_STRUCT_ARRAY)) == NULL) { + free(buf, M_KTRACE); + return; + } + ksa = &req->ktr_data.ktr_struct_array; + ksa->struct_size = struct_size; req->ktr_buffer = buf; req->ktr_header.ktr_len = buflen; ktr_submitrequest(curthread, req); Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Sat Nov 25 03:59:36 2017 (r326183) +++ head/sys/sys/event.h Sat Nov 25 04:49:12 2017 (r326184) @@ -71,6 +71,47 @@ struct kevent { __uint64_t ext[4]; }; +#if defined(_WANT_FREEBSD11_KEVENT) +/* Older structure used in FreeBSD 11.x and older. */ +struct kevent_freebsd11 { + __uintptr_t ident; /* identifier for this event */ + short filter; /* filter for event */ + unsigned short flags; + unsigned int fflags; + __intptr_t data; + void *udata; /* opaque user data identifier */ +}; +#endif + +#if defined(_WANT_KEVENT32) || (defined(_KERNEL) && defined(__LP64__)) +struct kevent32 { + uint32_t ident; /* identifier for this event */ + short filter; /* filter for event */ + u_short flags; + u_int fflags; +#ifndef __amd64__ + uint32_t pad0; +#endif + int32_t data1, data2; + uint32_t udata; /* opaque user data identifier */ +#ifndef __amd64__ + uint32_t pad1; +#endif + uint32_t ext64[8]; +}; + +#ifdef _WANT_FREEBSD11_KEVENT +struct kevent32_freebsd11 { + u_int32_t ident; /* identifier for this event */ + short filter; /* filter for event */ + u_short flags; + u_int fflags; + int32_t data; + u_int32_t udata; /* opaque user data identifier */ +}; +#endif +#endif + /* actions */ #define EV_ADD 0x0001 /* add event to kq (implies enable) */ #define EV_DELETE 0x0002 /* delete event from kq */ Modified: head/sys/sys/ktrace.h ============================================================================== --- head/sys/sys/ktrace.h Sat Nov 25 03:59:36 2017 (r326183) +++ head/sys/sys/ktrace.h Sat Nov 25 04:49:12 2017 (r326184) @@ -221,6 +221,18 @@ struct ktr_faultend { }; /* + * KTR_STRUCT_ARRAY - array of misc. structs + */ +#define KTR_STRUCT_ARRAY 15 +struct ktr_struct_array { + size_t struct_size; + /* + * Followed by null-terminated structure name and then payload + * contents. + */ +}; + +/* * KTR_DROP - If this bit is set in ktr_type, then at least one event * between the previous record and this record was dropped. */ @@ -244,6 +256,7 @@ struct ktr_faultend { #define KTRFAC_CAPFAIL (1< #include #include #include #include +#include #include #include #include @@ -111,6 +116,8 @@ void ktrstruct(char *, size_t); void ktrcapfail(struct ktr_cap_fail *); void ktrfault(struct ktr_fault *); void ktrfaultend(struct ktr_faultend *); +void ktrkevent(struct kevent *); +void ktrstructarray(struct ktr_struct_array *, size_t); void usage(void); #define TIMESTAMP_NONE 0x0 @@ -546,6 +553,9 @@ main(int argc, char *argv[]) case KTR_FAULTEND: ktrfaultend((struct ktr_faultend *)m); break; + case KTR_STRUCT_ARRAY: + ktrstructarray((struct ktr_struct_array *)m, ktrlen); + break; default: printf("\n"); break; @@ -680,6 +690,7 @@ dumpheader(struct ktr_header *kth) type = "USER"; break; case KTR_STRUCT: + case KTR_STRUCT_ARRAY: type = "STRU"; break; case KTR_SYSCTL: @@ -2069,6 +2080,137 @@ ktrfaultend(struct ktr_faultend *ktr) else printf("", ktr->result); printf("\n"); +} + +void +ktrkevent(struct kevent *kev) +{ + + printf("{ ident="); + switch (kev->filter) { + case EVFILT_READ: + case EVFILT_WRITE: + case EVFILT_VNODE: + case EVFILT_PROC: + case EVFILT_TIMER: + case EVFILT_PROCDESC: + case EVFILT_EMPTY: + printf("%ju", (uintmax_t)kev->ident); + break; + case EVFILT_SIGNAL: + print_signal(kev->ident); + break; + default: + printf("%p", (void *)kev->ident); + } + printf(", filter="); + print_integer_arg(sysdecode_kevent_filter, kev->filter); + printf(", flags="); + print_mask_arg0(sysdecode_kevent_flags, kev->flags); + printf(", fflags="); + sysdecode_kevent_fflags(stdout, kev->filter, kev->fflags, + decimal ? 10 : 16); + printf(", data=%#jx, udata=%p }", (uintmax_t)kev->data, kev->udata); +} + +void +ktrstructarray(struct ktr_struct_array *ksa, size_t buflen) +{ + struct kevent kev; + char *name, *data; + size_t namelen, datalen; + int i; + bool first; + + buflen -= sizeof(*ksa); + for (name = (char *)(ksa + 1), namelen = 0; + namelen < buflen && name[namelen] != '\0'; + ++namelen) + /* nothing */; + if (namelen == buflen) + goto invalid; + if (name[namelen] != '\0') + goto invalid; + /* sanity check */ + for (i = 0; i < (int)namelen; ++i) + if (!isalnum(name[i]) && name[i] != '_') + goto invalid; + data = name + namelen + 1; + datalen = buflen - namelen - 1; + printf("struct %s[] = { ", name); + first = true; + for (; datalen >= ksa->struct_size; + data += ksa->struct_size, datalen -= ksa->struct_size) { + if (!first) + printf("\n "); + else + first = false; + if (strcmp(name, "kevent") == 0) { + if (ksa->struct_size != sizeof(kev)) + goto bad_size; + memcpy(&kev, data, sizeof(kev)); + ktrkevent(&kev); + } else if (strcmp(name, "kevent_freebsd11") == 0) { + struct kevent_freebsd11 kev11; + + if (ksa->struct_size != sizeof(kev11)) + goto bad_size; + memcpy(&kev11, data, sizeof(kev11)); + memset(&kev, 0, sizeof(kev)); + kev.ident = kev11.ident; + kev.filter = kev11.filter; + kev.flags = kev11.flags; + kev.fflags = kev11.fflags; + kev.data = kev11.data; + kev.udata = kev11.udata; + ktrkevent(&kev); +#ifdef _WANT_KEVENT32 + } else if (strcmp(name, "kevent32") == 0) { + struct kevent32 kev32; + + if (ksa->struct_size != sizeof(kev32)) + goto bad_size; + memcpy(&kev32, data, sizeof(kev32)); + memset(&kev, 0, sizeof(kev)); + kev.ident = kev32.ident; + kev.filter = kev32.filter; + kev.flags = kev32.flags; + kev.fflags = kev32.fflags; +#if BYTE_ORDER == BIG_ENDIAN + kev.data = kev32.data2 | ((int64_t)kev32.data1 << 32); +#else + kev.data = kev32.data1 | ((int64_t)kev32.data2 << 32); +#endif + kev.udata = (void *)(uintptr_t)kev32.udata; + ktrkevent(&kev); + } else if (strcmp(name, "kevent32_freebsd11") == 0) { + struct kevent32_freebsd11 kev32; + + if (ksa->struct_size != sizeof(kev32)) + goto bad_size; + memcpy(&kev32, data, sizeof(kev32)); + memset(&kev, 0, sizeof(kev)); + kev.ident = kev32.ident; + kev.filter = kev32.filter; + kev.flags = kev32.flags; + kev.fflags = kev32.fflags; + kev.data = kev32.data; + kev.udata = (void *)(uintptr_t)kev32.udata; + ktrkevent(&kev); +#endif + } else { + printf(" }\n"); + return; + } + } + printf(" }\n"); + return; +invalid: + printf("invalid record\n"); + return; +bad_size: + printf(" }\n"); + return; } void Modified: head/usr.bin/ktrace/ktrace.h ============================================================================== --- head/usr.bin/ktrace/ktrace.h Sat Nov 25 03:59:36 2017 (r326183) +++ head/usr.bin/ktrace/ktrace.h Sat Nov 25 04:49:12 2017 (r326184) @@ -34,7 +34,8 @@ #define DEF_POINTS (KTRFAC_SYSCALL | KTRFAC_SYSRET | KTRFAC_NAMEI | \ KTRFAC_GENIO | KTRFAC_PSIG | KTRFAC_USER | \ - KTRFAC_STRUCT | KTRFAC_SYSCTL | KTRFAC_CAPFAIL) + KTRFAC_STRUCT | KTRFAC_SYSCTL | KTRFAC_CAPFAIL | \ + KTRFAC_STRUCT_ARRAY) #define PROC_ABI_POINTS (KTRFAC_PROCCTOR | KTRFAC_PROCDTOR) Modified: head/usr.bin/truss/syscall.h ============================================================================== --- head/usr.bin/truss/syscall.h Sat Nov 25 03:59:36 2017 (r326183) +++ head/usr.bin/truss/syscall.h Sat Nov 25 04:49:12 2017 (r326184) @@ -52,7 +52,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype, Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich, Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam, - PSig, Siginfo, + PSig, Siginfo, Kevent11, CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags, CloudABIFDStat, CloudABIFileStat, CloudABIFileType, Modified: head/usr.bin/truss/syscalls.c ============================================================================== --- head/usr.bin/truss/syscalls.c Sat Nov 25 03:59:36 2017 (r326183) +++ head/usr.bin/truss/syscalls.c Sat Nov 25 04:49:12 2017 (r326184) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#define _WANT_FREEBSD11_KEVENT #include #include #include @@ -152,6 +153,9 @@ static struct syscall decoded_syscalls[] = { { .name = "compat11.fstatat", .ret_type = 1, .nargs = 4, .args = { { Atfd, 0 }, { Name | IN, 1 }, { Stat11 | OUT, 2 }, { Atflags, 3 } } }, + { .name = "compat11.kevent", .ret_type = 1, .nargs = 6, + .args = { { Int, 0 }, { Kevent11, 1 }, { Int, 2 }, + { Kevent11 | OUT, 3 }, { Int, 4 }, { Timespec, 5 } } }, { .name = "compat11.lstat", .ret_type = 1, .nargs = 2, .args = { { Name | IN, 0 }, { Stat11 | OUT, 1 } } }, { .name = "compat11.stat", .ret_type = 1, .nargs = 2, @@ -650,43 +654,6 @@ struct xlat { #define X(a) { a, #a }, #define XEND { 0, NULL } -static struct xlat kevent_filters[] = { - X(EVFILT_READ) X(EVFILT_WRITE) X(EVFILT_AIO) X(EVFILT_VNODE) - X(EVFILT_PROC) X(EVFILT_SIGNAL) X(EVFILT_TIMER) - X(EVFILT_PROCDESC) X(EVFILT_FS) X(EVFILT_LIO) X(EVFILT_USER) - X(EVFILT_SENDFILE) XEND -}; - -static struct xlat kevent_flags[] = { - X(EV_ADD) X(EV_DELETE) X(EV_ENABLE) X(EV_DISABLE) X(EV_ONESHOT) - X(EV_CLEAR) X(EV_RECEIPT) X(EV_DISPATCH) X(EV_FORCEONESHOT) - X(EV_DROP) X(EV_FLAG1) X(EV_ERROR) X(EV_EOF) XEND -}; - -static struct xlat kevent_user_ffctrl[] = { - X(NOTE_FFNOP) X(NOTE_FFAND) X(NOTE_FFOR) X(NOTE_FFCOPY) - XEND -}; - -static struct xlat kevent_rdwr_fflags[] = { - X(NOTE_LOWAT) X(NOTE_FILE_POLL) XEND -}; - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Nov 25 09:03: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 AD562DC0930; Sat, 25 Nov 2017 09:03:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 781F37A824; Sat, 25 Nov 2017 09:03:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAP93cpg024942; Sat, 25 Nov 2017 09:03:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAP93cjS024941; Sat, 25 Nov 2017 09:03:38 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201711250903.vAP93cjS024941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 25 Nov 2017 09:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326185 - head/usr.bin/gzip X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.bin/gzip X-SVN-Commit-Revision: 326185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 09:03:39 -0000 Author: delphij Date: Sat Nov 25 09:03:38 2017 New Revision: 326185 URL: https://svnweb.freebsd.org/changeset/base/326185 Log: Set errno to EFTYPE instead of EINVAL to be more consistent with the rest of code. MFC after: 1 month Modified: head/usr.bin/gzip/zuncompress.c Modified: head/usr.bin/gzip/zuncompress.c ============================================================================== --- head/usr.bin/gzip/zuncompress.c Sat Nov 25 04:49:12 2017 (r326184) +++ head/usr.bin/gzip/zuncompress.c Sat Nov 25 09:03:38 2017 (r326185) @@ -281,7 +281,7 @@ zread(void *cookie, char *rbp, int num) if (zs->u.r.zs_code > zs->zs_free_ent || zs->u.r.zs_oldcode == -1) { /* Bad stream. */ - errno = EINVAL; + errno = EFTYPE; return (-1); } *zs->u.r.zs_stackp++ = zs->u.r.zs_finchar; From owner-svn-src-head@freebsd.org Sat Nov 25 09:42: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 45AE3DC1239; Sat, 25 Nov 2017 09:42:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 099967B731; Sat, 25 Nov 2017 09:42:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAP9gEl7040942; Sat, 25 Nov 2017 09:42:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAP9gEDU040941; Sat, 25 Nov 2017 09:42:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201711250942.vAP9gEDU040941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 25 Nov 2017 09:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326186 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 326186 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 09:42:16 -0000 Author: mav Date: Sat Nov 25 09:42:14 2017 New Revision: 326186 URL: https://svnweb.freebsd.org/changeset/base/326186 Log: Slightly fix bidirectional stream number allocation. This logic is still imperfect, since it allows at most 15 bidirectional streams out of 30 allowed by specification, but at least now those should work better. On the other side I don't remember I ever saw controller supporting the bidirectional streams, so this is likely a nop change. MFC after: 1 month Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sat Nov 25 09:03:38 2017 (r326185) +++ head/sys/dev/sound/pci/hda/hdac.c Sat Nov 25 09:42:14 2017 (r326186) @@ -1801,7 +1801,7 @@ hdac_find_stream(struct hdac_softc *sc, int dir, int s int i, ss; ss = -1; - /* Allocate ISS/BSS first. */ + /* Allocate ISS/OSS first. */ if (dir == 0) { for (i = 0; i < sc->num_iss; i++) { if (sc->streams[i].stream == stream) { @@ -1869,7 +1869,7 @@ hdac_stream_alloc(device_t dev, device_t child, int di /* Allocate stream number */ if (ss >= sc->num_iss + sc->num_oss) - stream = 15 - (ss - sc->num_iss + sc->num_oss); + stream = 15 - (ss - sc->num_iss - sc->num_oss); else if (ss >= sc->num_iss) stream = ss - sc->num_iss + 1; else From owner-svn-src-head@freebsd.org Sat Nov 25 09:47: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 6A304DC1338; Sat, 25 Nov 2017 09:47:32 +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 2E05F7B939; Sat, 25 Nov 2017 09:47:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAP9lVLW042029; Sat, 25 Nov 2017 09:47:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAP9lV0f042028; Sat, 25 Nov 2017 09:47:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201711250947.vAP9lV0f042028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 25 Nov 2017 09:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326187 - head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zdb X-SVN-Commit-Revision: 326187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 09:47:32 -0000 Author: avg Date: Sat Nov 25 09:47:31 2017 New Revision: 326187 URL: https://svnweb.freebsd.org/changeset/base/326187 Log: zdb: follow-up to r326150, check if malloc succeeded Reported by: rpokala MFC after: 1 week X-MFC with: r326150 Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 25 09:42:14 2017 (r326186) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Nov 25 09:47:31 2017 (r326187) @@ -3739,6 +3739,11 @@ zdb_embedded_block(char *thing) } ASSERT3U(BPE_GET_LSIZE(&bp), <=, SPA_MAXBLOCKSIZE); buf = malloc(SPA_MAXBLOCKSIZE); + if (buf == NULL) { + (void) fprintf(stderr, "%s: failed to allocate %llu bytes\n", + __func__, SPA_MAXBLOCKSIZE); + exit(1); + } err = decode_embedded_bp(&bp, buf, BPE_GET_LSIZE(&bp)); if (err != 0) { (void) printf("decode failed: %u\n", err); From owner-svn-src-head@freebsd.org Sat Nov 25 11:09: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 3DCF6DDE7C6; Sat, 25 Nov 2017 11:09:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id D58067D7C0; Sat, 25 Nov 2017 11:09:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id A74321A0BBF; Sat, 25 Nov 2017 22:09:07 +1100 (AEDT) Date: Sat, 25 Nov 2017 22:09:06 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ian Lepore cc: Bruce Evans , Devin Teske , rgrimes@freebsd.org, cem@freebsd.org, Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts In-Reply-To: <1511539000.94268.17.camel@freebsd.org> Message-ID: <20171125201623.J1236@besplex.bde.org> References: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> <20171124201621.K980@besplex.bde.org> <1511539000.94268.17.camel@freebsd.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=nlC_4_pT8q9DhB4Ho9EA:9 a=zgIJ6RRPz8K_KCKZVwwA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Nov 2017 11:09:18 -0000 On Fri, 24 Nov 2017, Ian Lepore wrote: > On Fri, 2017-11-24 at 22:25 +1100, Bruce Evans wrote: >> On Thu, 23 Nov 2017, Devin Teske wrote: >> [...] >> >> ntpdate's man page claims this, but is wrong AFAIK.=A0 It says that the >> functionality of ntpdate is now available in ntpd(8) using -q.=A0 Howeve= r >> ntpdate -q is far from having equivalent functionality.=A0 According to = both >> testing of the old version and its current man page, it does the same sl= ow >> syncing as normal ntpd startup, and just exits after this and doesn't >> daemonize while doing this.=A0 With the old version, this step takes 35-= 40 >> seconds starting with the time already synced to withing a few microseco= nds >> (by a previous invocation of ntpd), while ntpdate syncs (perhaps not so >> well) with a server half the world away in about 1 second. > > Ahh, the good ol' days, when ntpdate was fast by default. =A0Not > anymore... > > unicorn# time ntpdate ntp.hippie.lan > 24 Nov 15:21:31 ntpdate[734]: adjust time server [...] offset -0.000123 s= ec > 0.013u 0.006s 0:06.13 0.1%=A0=A0=A0=A0=A0=A0192+420k 0+0io 0pf+0w > > If you want the fast old sub-second behavior these days, you have to > add -p1. =A0Or, better yet, use sntp -r . The default of -p4 hasn't changed, but its speed has. I get the following times for ntpdate -q -pN: - old ntpdate -p1 0.31 seconds (my system -> US server ping latency 18= 0ms) - -p2 0.52 - -p3 0.83 - -p4 0.95 (default for -p) - new ntpdate -p1 0.37 seconds (freefall -> same US server) - -p2 2.39 - -p3 4.36 - -p4 6.36 (default) - old ntpdate -p8 0.10 (max for -p) (my system -> localhost ping lat 0.014 = ms) - new ntpdate -p8 fail (freefall -> localhost ping lat 0.060 m= s) - old ntpdate -p8 0.10 (my LAN -> my system ping lat 0.120 ms) - new ntpdate -pN same as US server (freefall -> freebsd server ping lat 80= ms) - old ntpdate -p8 0.24 (my system -> ISP server ping lat 12 ms= ) This shows that old ntpdate -pN takes approximately the ping latency times = N. New ntpdate takes that for N =3D 1; otherwise it takes almost 2 seconds for each increment of N. ktrace shows many sleeps of 100 msec between sendto/recvfrom pairs. > I'm not sure where you're coming up with numbers like "35 seconds" for > ntpd to initially step the clock. =A0The version we're currently > distributing in base takes the same 6-7 seconds as ntpdate (assuming > you've used 'iburst' in ntp.conf). =A0That's true in the normal startup > case, or when doing ntpd -qG to mimic ntpdate. This is for old ntpd [-q] with iburst maxpoll 6, to the ISP server. To the LAN server, ntpd -q takes the same 35 seconds. Normal startup with ntpd -N high takes about the same time. The examples in /etc/defaults/rc.conf don't give a hint about the -p flag for ntpdate or the -N flag for ntpd. Low -p values are probably good enough for ntpdate before ntpd. > If there is an ntpd.drift file, ntpd is essentially sync'd as soon as > it steps. If the drift file is correct. I do have a correct drift file, and the above times are with it. With a correct driftfile and ntpdate before ntpd, ntpd is essentially synced as soon as it starts :-). When calibrating it manually, I verify this by killing it soon after it starts and observing drift using ntpdate -q. > If there is not, it does a clock step, then does 300 seconds > of frequency training during which the clock can drift pretty far off- > time. =A0It used to be possible to shorten the frequency training > interval with the 'tinker stepout' command, but the ntpd folks > decoupled that (always inapproriately overloaded) behavior between > stepout interval and training interval. =A0There is no longer any way to > control the training interval at all, which IMO is a serious regression > in ntpd (albeit noticed primarily by those of us who DO have an atomic > clock and get a microsecond-accurate measurement of frequency drift in > just 2 seconds). Is there any use for ntp as a client if you have an atomic clock? Just to validate both it and ntpd? Bruce From owner-svn-src-head@freebsd.org Sat Nov 25 15:14: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 71A17DE7CA3; Sat, 25 Nov 2017 15:14:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48B3663361; Sat, 25 Nov 2017 15:14:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPFEfbN080391; Sat, 25 Nov 2017 15:14:41 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPFEfPI080387; Sat, 25 Nov 2017 15:14:41 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201711251514.vAPFEfPI080387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Nov 2017 15:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326190 - in head/sys/arm/allwinner: a83t clkng X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys/arm/allwinner: a83t clkng X-SVN-Commit-Revision: 326190 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 15:14:42 -0000 Author: kevans Date: Sat Nov 25 15:14:40 2017 New Revision: 326190 URL: https://svnweb.freebsd.org/changeset/base/326190 Log: Add r-ccu support for the Allwinner a83t The r-ccu on the a83t differs from the others only by what it names the ar100 parents. Export the _CCU macros (now converted to an enu) so that ccu_sun8i_r can differentiate between a83t r-ccu and the others, then add the compat string for the a83t r-ccu. Reviewed by: manu Approved by: emaste (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D13206 Modified: head/sys/arm/allwinner/a83t/files.a83t head/sys/arm/allwinner/clkng/aw_ccung.c head/sys/arm/allwinner/clkng/aw_ccung.h head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Modified: head/sys/arm/allwinner/a83t/files.a83t ============================================================================== --- head/sys/arm/allwinner/a83t/files.a83t Sat Nov 25 14:51:40 2017 (r326189) +++ head/sys/arm/allwinner/a83t/files.a83t Sat Nov 25 15:14:40 2017 (r326190) @@ -1,5 +1,6 @@ # $FreeBSD$ arm/allwinner/clkng/ccu_a83t.c standard +arm/allwinner/clkng/ccu_sun8i_r.c standard arm/allwinner/a83t/a83t_padconf.c standard arm/allwinner/a83t/a83t_r_padconf.c standard Modified: head/sys/arm/allwinner/clkng/aw_ccung.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.c Sat Nov 25 14:51:40 2017 (r326189) +++ head/sys/arm/allwinner/clkng/aw_ccung.c Sat Nov 25 15:14:40 2017 (r326190) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #if defined(SOC_ALLWINNER_A83T) #include +#include #endif #include "clkdev_if.h" @@ -88,28 +89,6 @@ static struct resource_spec aw_ccung_spec[] = { { -1, 0 } }; -#if defined(SOC_ALLWINNER_H3) || defined(SOC_ALLWINNER_H5) -#define H3_CCU 1 -#define H3_R_CCU 2 -#endif - -#if defined(SOC_ALLWINNER_A31) -#define A31_CCU 3 -#endif - -#if defined(SOC_ALLWINNER_A64) -#define A64_CCU 4 -#define A64_R_CCU 5 -#endif - -#if defined(SOC_ALLWINNER_A13) -#define A13_CCU 6 -#endif - -#if defined(SOC_ALLWINNER_A83T) -#define A83T_CCU 7 -#endif - static struct ofw_compat_data compat_data[] = { #if defined(SOC_ALLWINNER_A31) { "allwinner,sun5i-a13-ccu", A13_CCU}, @@ -127,6 +106,7 @@ static struct ofw_compat_data compat_data[] = { #endif #if defined(SOC_ALLWINNER_A83T) { "allwinner,sun8i-a83t-ccu", A83T_CCU }, + { "allwinner,sun8i-a83t-r-ccu", A83T_R_CCU }, #endif {NULL, 0 } }; @@ -373,6 +353,9 @@ aw_ccung_attach(device_t dev) #if defined(SOC_ALLWINNER_A83T) case A83T_CCU: ccu_a83t_register_clocks(sc); + break; + case A83T_R_CCU: + ccu_sun8i_r_register_clocks(sc); break; #endif } Modified: head/sys/arm/allwinner/clkng/aw_ccung.h ============================================================================== --- head/sys/arm/allwinner/clkng/aw_ccung.h Sat Nov 25 14:51:40 2017 (r326189) +++ head/sys/arm/allwinner/clkng/aw_ccung.h Sat Nov 25 15:14:40 2017 (r326190) @@ -29,6 +29,17 @@ #ifndef __CCU_NG_H__ #define __CCU_NG_H__ +enum aw_ccung_type { + H3_CCU = 1, + H3_R_CCU, + A31_CCU, + A64_CCU, + A64_R_CCU, + A13_CCU, + A83T_CCU, + A83T_R_CCU, +}; + struct aw_ccung_softc { device_t dev; struct resource *res; Modified: head/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sat Nov 25 14:51:40 2017 (r326189) +++ head/sys/arm/allwinner/clkng/ccu_sun8i_r.c Sat Nov 25 15:14:40 2017 (r326190) @@ -70,6 +70,7 @@ static struct aw_ccung_gate ccu_sun8i_r_gates[] = { }; static const char *ar100_parents[] = {"osc32k", "osc24M", "pll_periph0", "iosc"}; +static const char *a83t_ar100_parents[] = {"osc16M-d512", "osc24M", "pll_periph", "osc16M"}; PREDIV_CLK(ar100_clk, CLK_AR100, /* id */ "ar100", ar100_parents, /* name, parents */ 0x00, /* offset */ @@ -77,6 +78,13 @@ PREDIV_CLK(ar100_clk, CLK_AR100, /* id */ 4, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* div */ 8, 5, 0, AW_CLK_FACTOR_HAS_COND, /* prediv */ 16, 2, 2); /* prediv condition */ +PREDIV_CLK(a83t_ar100_clk, CLK_AR100, /* id */ + "ar100", a83t_ar100_parents, /* name, parents */ + 0x00, /* offset */ + 16, 2, /* mux */ + 4, 2, 0, AW_CLK_FACTOR_POWER_OF_TWO, /* div */ + 8, 5, 0, AW_CLK_FACTOR_HAS_COND, /* prediv */ + 16, 2, 2); /* prediv condition */ static const char *ahb0_parents[] = {"ar100"}; FIXED_CLK(ahb0_clk, @@ -96,10 +104,14 @@ DIV_CLK(apb0_clk, 0, 2, /* shift, width */ 0, NULL); /* flags, div table */ -static struct aw_clk_prediv_mux_def *prediv_mux_clks[] = { +static struct aw_clk_prediv_mux_def *r_ccu_prediv_mux_clks[] = { &ar100_clk, }; +static struct aw_clk_prediv_mux_def *a83t_r_ccu_prediv_mux_clks[] = { + &a83t_ar100_clk, +}; + static struct clk_div_def *div_clks[] = { &apb0_clk, }; @@ -112,11 +124,18 @@ void ccu_sun8i_r_register_clocks(struct aw_ccung_softc *sc) { int i; + struct aw_clk_prediv_mux_def **prediv_mux_clks; sc->resets = ccu_sun8i_r_resets; sc->nresets = nitems(ccu_sun8i_r_resets); sc->gates = ccu_sun8i_r_gates; sc->ngates = nitems(ccu_sun8i_r_gates); + + /* a83t names the parents differently than the others */ + if (sc->type == A83T_R_CCU) + prediv_mux_clks = a83t_r_ccu_prediv_mux_clks; + else + prediv_mux_clks = r_ccu_prediv_mux_clks; for (i = 0; i < nitems(prediv_mux_clks); i++) aw_clk_prediv_mux_register(sc->clkdom, prediv_mux_clks[i]); From owner-svn-src-head@freebsd.org Sat Nov 25 16:20: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 53800DE8FFB for ; Sat, 25 Nov 2017 16:20:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1ECC664D0F for ; Sat, 25 Nov 2017 16:20:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x230.google.com with SMTP id b5so16336259itc.3 for ; Sat, 25 Nov 2017 08:20:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=5k7wVqDi20T9L4lT1umQEO73TymWS9XvLuWc0t6pcVM=; b=tt8ZeMeVA6lWFzKcFKdfQU/9RteQ7vW/SJAgSAAsbILkh7jhvXhPAE0KQPyOF1wA1k IT3c/4ziLVqIofBUJ8i4yWZTdV+6fGCB+nKLGQCmT/B9A8z1lqTapYQ7zhiUpZs+DAF9 PKy0RP1HPk7KOa2G90QdsrkGOae13Arj59r/y7PN9TBK8JibdGBznMhAv5HvPhoGMDpq cQ6W/tJLSQdjrj/wqhSz09MzF/OwcZ6lZAJH8xHWGe+lEAte2ItAap9Gx8HRzT5En99j jaEpwjO8XsgOy4TUozzRokpkW/uKLwUQS+MRCcqPGkiLUasOzyfwqFY6EEML62kBmvbD HdHQ== 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=5k7wVqDi20T9L4lT1umQEO73TymWS9XvLuWc0t6pcVM=; b=Gxly0e9c4jBqQl+aylWJojDcIvVt/LxSpLQaM8CZrVcMfzvCWIn94TWATIPbDBoBSh 7agn4WUk9RPCH/AQTxjLerCO2ztuJBepUMY9a8Hv+YfB7hVJOXEpXhGvQ81uSHnvvgQK uLK0EhjrdDuYNYNriYuzWLSkmbA+AEieSqsUIHu359CoxAv30Fr0z7g1cct2rJRdA/Im NqKcmFrSYs49O39mYiXFVM5HaX7gR4pGZdRjXf8sjxP2DgPjH57VfF9GViNHhdnYTLK9 d4xOlyQCUNqp0DEDczMgoOK0kcn6PwzGjuQUsmIbJCApzbpGFxDfA5T5mB5R5Ol9zDfa bvRQ== X-Gm-Message-State: AJaThX7Y15cm9xtoPkaMPgch4oGeFxi6uoG/RER4cc4P/EN0FSKtlPeT AK/S1Vhcn5H0Hn1H7qNc8wwUcTmjSSur6tO5bL+kBA== X-Google-Smtp-Source: AGs4zMYZkXjzosNun8AaEb0hVaKMlNn7Jc8p9e46RWjZ1514MT1X72YJiLh4JSrBJqsNnsfUUn+n4v2kXAt73jphA1U= X-Received: by 10.36.131.200 with SMTP id d191mr21097554ite.97.1511626856305; Sat, 25 Nov 2017 08:20:56 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Sat, 25 Nov 2017 08:20:55 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:9579:bb73:7b7f:aadd] In-Reply-To: <20171125201623.J1236@besplex.bde.org> References: <201711231729.vANHTVmo092083@pdx.rh.CN85.dnsmgr.net> <20171124201621.K980@besplex.bde.org> <1511539000.94268.17.camel@freebsd.org> <20171125201623.J1236@besplex.bde.org> From: Warner Losh Date: Sat, 25 Nov 2017 09:20:55 -0700 X-Google-Sender-Auth: fdovqoc00FriV9lR9xAXws6aJ0w Message-ID: Subject: Re: svn commit: r326095 - head/usr.sbin/bsdinstall/scripts To: Bruce Evans Cc: Ian Lepore , Devin Teske , "Rodney W. Grimes" , "Conrad E. Meyer" , Emmanuel Vadot , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Nov 2017 16:20:57 -0000 On Sat, Nov 25, 2017 at 4:09 AM, Bruce Evans wrote: > Is there any use for ntp as a client if you have an atomic clock? Just to > validate both it and ntpd? NTP is a peer to peer time exchange. You run the same daemon either way. However, in the reference clock case, which is what you're talking about, the system still steers its time using ntp. ntp measures the differences between the atomic clock and the system time and adjusts the frequency offset to steer our any frequency error as well as introducing slight frequency errors to steer out any phase difference. gettimeofday() can't ask the atomic clock directly what time it is. So the ntp daemon is doing a time exchange not with a remote clock, but with a local one to get the right time. Some reference clock know the phase and frequency of the time (say a GPS receiver), others just know the frequency (an atomic clock just produces a PPS frequency standard, for example, since the time it's set to isn't from an internal to the clock source of truth). ntpd copes with all these issues to create a "paper clock" that it then steers the system to. Warner From owner-svn-src-head@freebsd.org Sat Nov 25 16:46: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 5B545DEAAEF; Sat, 25 Nov 2017 16:46:36 +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 278E265C72; Sat, 25 Nov 2017 16:46:36 +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 vAPGkZw3017894; Sat, 25 Nov 2017 16:46:35 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPGkZIb017893; Sat, 25 Nov 2017 16:46:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201711251646.vAPGkZIb017893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 25 Nov 2017 16:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326191 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 326191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 16:46:36 -0000 Author: kevans Date: Sat Nov 25 16:46:35 2017 New Revision: 326191 URL: https://svnweb.freebsd.org/changeset/base/326191 Log: Allwinner a83t: enable USB support Originally a patch by Mark Millard, augmented with information from work done on NetBSD by jmcneill@. Submitted by: Mark Millard (markmi@dsl-only.net) Reviewed by: emaste, manu Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D13240 Modified: head/sys/arm/allwinner/aw_usbphy.c Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Sat Nov 25 15:14:40 2017 (r326190) +++ head/sys/arm/allwinner/aw_usbphy.c Sat Nov 25 16:46:35 2017 (r326191) @@ -59,7 +59,8 @@ enum awusbphy_type { AWUSBPHY_TYPE_A20, AWUSBPHY_TYPE_A31, AWUSBPHY_TYPE_H3, - AWUSBPHY_TYPE_A64 + AWUSBPHY_TYPE_A64, + AWUSBPHY_TYPE_A83T }; struct aw_usbphy_conf { @@ -111,6 +112,13 @@ static const struct aw_usbphy_conf a64_usbphy_conf = { .phy0_route = true, }; +static const struct aw_usbphy_conf a83t_usbphy_conf = { + .num_phys = 3, + .phy_type = AWUSBPHY_TYPE_A83T, + .pmu_unk1 = false, + .phy0_route = false, +}; + static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-usb-phy", (uintptr_t)&a10_usbphy_conf }, { "allwinner,sun5i-a13-usb-phy", (uintptr_t)&a13_usbphy_conf }, @@ -118,6 +126,7 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-usb-phy", (uintptr_t)&a20_usbphy_conf }, { "allwinner,sun8i-h3-usb-phy", (uintptr_t)&h3_usbphy_conf }, { "allwinner,sun50i-a64-usb-phy", (uintptr_t)&a64_usbphy_conf }, + { "allwinner,sun8i-a83t-usb-phy", (uintptr_t)&a83t_usbphy_conf }, { NULL, 0 } }; From owner-svn-src-head@freebsd.org Sat Nov 25 17: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 29B08DEB34C; Sat, 25 Nov 2017 17:09:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B954766811; Sat, 25 Nov 2017 17:09:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPH9ntn026331; Sat, 25 Nov 2017 17:09:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPH9ioA026272; Sat, 25 Nov 2017 17:09:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711251709.vAPH9ioA026272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 25 Nov 2017 17:09:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326192 - in head/include: . rpc rpcsvc xlocale X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/include: . rpc rpcsvc xlocale X-SVN-Commit-Revision: 326192 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 17:09:51 -0000 Author: pfg Date: Sat Nov 25 17:09:43 2017 New Revision: 326192 URL: https://svnweb.freebsd.org/changeset/base/326192 Log: include: General further adoption of SPDX licensing ID tags. Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Modified: head/include/bitstring.h head/include/complex.h head/include/cpio.h head/include/elf-hints.h head/include/elf.h head/include/fmtmsg.h head/include/getopt.h head/include/hesiod.h head/include/iconv.h head/include/inttypes.h head/include/iso646.h head/include/kenv.h head/include/langinfo.h head/include/libgen.h head/include/link.h head/include/malloc_np.h head/include/mk-osreldate.sh head/include/monetary.h head/include/mqueue.h head/include/nl_types.h head/include/nss.h head/include/nsswitch.h head/include/printf.h head/include/proc_service.h head/include/pthread.h head/include/rpc/rpcsec_gss.h head/include/rpcsvc/yp_prot.h head/include/rpcsvc/ypclnt.h head/include/semaphore.h head/include/spawn.h head/include/stdalign.h head/include/stdbool.h head/include/stdnoreturn.h head/include/stringlist.h head/include/strings.h head/include/tgmath.h head/include/timers.h head/include/uchar.h head/include/ulimit.h head/include/utmpx.h head/include/uuid.h head/include/varargs.h head/include/wchar.h head/include/wctype.h head/include/wordexp.h head/include/xlocale.h head/include/xlocale/_ctype.h head/include/xlocale/_inttypes.h head/include/xlocale/_langinfo.h head/include/xlocale/_locale.h head/include/xlocale/_monetary.h head/include/xlocale/_stdio.h head/include/xlocale/_stdlib.h head/include/xlocale/_string.h head/include/xlocale/_time.h head/include/xlocale/_uchar.h head/include/xlocale/_wchar.h Modified: head/include/bitstring.h ============================================================================== --- head/include/bitstring.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/bitstring.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Poul-Henning Kamp * All rights reserved. * Modified: head/include/complex.h ============================================================================== --- head/include/complex.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/complex.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2001-2011 The FreeBSD Project. * All rights reserved. * Modified: head/include/cpio.h ============================================================================== --- head/include/cpio.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/cpio.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Mike Barcroft * All rights reserved. * Modified: head/include/elf-hints.h ============================================================================== --- head/include/elf-hints.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/elf-hints.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 1997 John D. Polstra. * All rights reserved. * Modified: head/include/elf.h ============================================================================== --- head/include/elf.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/elf.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2001 David E. O'Brien. * All rights reserved. * Modified: head/include/fmtmsg.h ============================================================================== --- head/include/fmtmsg.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/fmtmsg.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Mike Barcroft * All rights reserved. * Modified: head/include/getopt.h ============================================================================== --- head/include/getopt.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/getopt.h Sat Nov 25 17:09:43 2017 (r326192) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * Modified: head/include/hesiod.h ============================================================================== --- head/include/hesiod.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/hesiod.h Sat Nov 25 17:09:43 2017 (r326192) @@ -3,6 +3,8 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. * All rights reserved. * Modified: head/include/iconv.h ============================================================================== --- head/include/iconv.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/iconv.h Sat Nov 25 17:09:43 2017 (r326192) @@ -2,6 +2,8 @@ /* $NetBSD: iconv.h,v 1.6 2005/02/03 04:39:32 perry Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2003 Citrus Project, * Copyright (c) 2009, 2010 Gabor Kovesdan * All rights reserved. Modified: head/include/inttypes.h ============================================================================== --- head/include/inttypes.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/inttypes.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2001 Mike Barcroft * All rights reserved. * Modified: head/include/iso646.h ============================================================================== --- head/include/iso646.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/iso646.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 1998 Alex Nash * All rights reserved. * Modified: head/include/kenv.h ============================================================================== --- head/include/kenv.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/kenv.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Maxime Henrion * All rights reserved. * Modified: head/include/langinfo.h ============================================================================== --- head/include/langinfo.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/langinfo.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2001 Alexey Zelkin * All rights reserved. * Modified: head/include/libgen.h ============================================================================== --- head/include/libgen.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/libgen.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,7 +1,9 @@ /* $OpenBSD: libgen.h,v 1.4 1999/05/28 22:00:22 espie Exp $ */ /* $FreeBSD$ */ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1997 Todd C. Miller * All rights reserved. * Modified: head/include/link.h ============================================================================== --- head/include/link.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/link.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1993 Paul Kranenburg * All rights reserved. * Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/malloc_np.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (C) 2006 Jason Evans . * All rights reserved. * Modified: head/include/mk-osreldate.sh ============================================================================== --- head/include/mk-osreldate.sh Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/mk-osreldate.sh Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ #!/bin/sh - +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# # Copyright (c) 2013 Garrett Cooper # All rights reserved. # Modified: head/include/monetary.h ============================================================================== --- head/include/monetary.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/monetary.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2001 Alexey Zelkin * All rights reserved. * Modified: head/include/mqueue.h ============================================================================== --- head/include/mqueue.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/mqueue.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2005 David Xu * All rights reserved. * Modified: head/include/nl_types.h ============================================================================== --- head/include/nl_types.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/nl_types.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,6 +1,8 @@ /* $NetBSD: nl_types.h,v 1.9 2000/10/03 19:53:32 sommerfeld Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * * Copyright (c) 1996 The NetBSD Foundation, Inc. * All rights reserved. * Modified: head/include/nss.h ============================================================================== --- head/include/nss.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/nss.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Networks Associates Technology, Inc. * All rights reserved. * Modified: head/include/nsswitch.h ============================================================================== --- head/include/nsswitch.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/nsswitch.h Sat Nov 25 17:09:43 2017 (r326192) @@ -2,6 +2,8 @@ /* $FreeBSD$ */ /*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. * All rights reserved. * Modified: head/include/printf.h ============================================================================== --- head/include/printf.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/printf.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2005 Poul-Henning Kamp * All rights reserved. * Modified: head/include/proc_service.h ============================================================================== --- head/include/proc_service.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/proc_service.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 David Xu * Copyright (c) 2004 Marcel Moolenaar * All rights reserved. Modified: head/include/pthread.h ============================================================================== --- head/include/pthread.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/pthread.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu * Copyright (c) 1995-1998 by John Birrell * All rights reserved. Modified: head/include/rpc/rpcsec_gss.h ============================================================================== --- head/include/rpc/rpcsec_gss.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/rpc/rpcsec_gss.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2008 Doug Rabson * All rights reserved. * Modified: head/include/rpcsvc/yp_prot.h ============================================================================== --- head/include/rpcsvc/yp_prot.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/rpcsvc/yp_prot.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992/3 Theo de Raadt * All rights reserved. * Modified: head/include/rpcsvc/ypclnt.h ============================================================================== --- head/include/rpcsvc/ypclnt.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/rpcsvc/ypclnt.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1992/3 Theo de Raadt * All rights reserved. * Modified: head/include/semaphore.h ============================================================================== --- head/include/semaphore.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/semaphore.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2010 David Xu * * All rights reserved. Modified: head/include/spawn.h ============================================================================== --- head/include/spawn.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/spawn.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2008 Ed Schouten * All rights reserved. * Modified: head/include/stdalign.h ============================================================================== --- head/include/stdalign.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/stdalign.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2012 Ed Schouten * All rights reserved. * Modified: head/include/stdbool.h ============================================================================== --- head/include/stdbool.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/stdbool.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /* + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2000 Jeroen Ruigrok van der Werven * All rights reserved. * Modified: head/include/stdnoreturn.h ============================================================================== --- head/include/stdnoreturn.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/stdnoreturn.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2012 Ed Schouten * All rights reserved. * Modified: head/include/stringlist.h ============================================================================== --- head/include/stringlist.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/stringlist.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,6 +1,8 @@ /* $NetBSD: stringlist.h,v 1.2 1997/01/17 06:11:36 lukem Exp $ */ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * * Copyright (c) 1994 Christos Zoulas * All rights reserved. * Modified: head/include/strings.h ============================================================================== --- head/include/strings.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/strings.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Mike Barcroft * All rights reserved. * Modified: head/include/tgmath.h ============================================================================== --- head/include/tgmath.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/tgmath.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 Stefan Farfeleder. * All rights reserved. * Modified: head/include/timers.h ============================================================================== --- head/include/timers.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/timers.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /* ==== timers.h ============================================================ + * SPDX-License-Identifier: BSD-4-Clause + * * Copyright (c) 1994 by Chris Provenzano, proven@mit.edu * All rights reserved. * Modified: head/include/uchar.h ============================================================================== --- head/include/uchar.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/uchar.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Ed Schouten * All rights reserved. * Modified: head/include/ulimit.h ============================================================================== --- head/include/ulimit.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/ulimit.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Kyle Martin * All rights reserved. * Modified: head/include/utmpx.h ============================================================================== --- head/include/utmpx.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/utmpx.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2010 Ed Schouten * All rights reserved. * Modified: head/include/uuid.h ============================================================================== --- head/include/uuid.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/uuid.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002,2005 Marcel Moolenaar * Copyright (c) 2002 Hiten Mahesh Pandya * All rights reserved. Modified: head/include/varargs.h ============================================================================== --- head/include/varargs.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/varargs.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Alexander Kabaev * All rights reserved. * Modified: head/include/wchar.h ============================================================================== --- head/include/wchar.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/wchar.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)1999 Citrus Project, * All rights reserved. * Modified: head/include/wctype.h ============================================================================== --- head/include/wctype.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/wctype.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)1999 Citrus Project, * All rights reserved. * Modified: head/include/wordexp.h ============================================================================== --- head/include/wordexp.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/wordexp.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Tim J. Robbins. * All rights reserved. * Modified: head/include/xlocale.h ============================================================================== --- head/include/xlocale.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_ctype.h ============================================================================== --- head/include/xlocale/_ctype.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_ctype.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_inttypes.h ============================================================================== --- head/include/xlocale/_inttypes.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_inttypes.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_langinfo.h ============================================================================== --- head/include/xlocale/_langinfo.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_langinfo.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_locale.h ============================================================================== --- head/include/xlocale/_locale.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_locale.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_monetary.h ============================================================================== --- head/include/xlocale/_monetary.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_monetary.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_stdio.h ============================================================================== --- head/include/xlocale/_stdio.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_stdio.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_stdlib.h ============================================================================== --- head/include/xlocale/_stdlib.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_stdlib.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_string.h ============================================================================== --- head/include/xlocale/_string.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_string.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_time.h ============================================================================== --- head/include/xlocale/_time.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_time.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/include/xlocale/_uchar.h ============================================================================== --- head/include/xlocale/_uchar.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_uchar.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Ed Schouten * All rights reserved. * Modified: head/include/xlocale/_wchar.h ============================================================================== --- head/include/xlocale/_wchar.h Sat Nov 25 16:46:35 2017 (r326191) +++ head/include/xlocale/_wchar.h Sat Nov 25 17:09:43 2017 (r326192) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011, 2012 The FreeBSD Foundation * All rights reserved. * From owner-svn-src-head@freebsd.org Sat Nov 25 17:13:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 292FCDEB513; Sat, 25 Nov 2017 17:13:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9257866BDE; Sat, 25 Nov 2017 17:13:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPHCx6R030531; Sat, 25 Nov 2017 17:12:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPHCnNn030424; Sat, 25 Nov 2017 17:12:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201711251712.vAPHCnNn030424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 25 Nov 2017 17:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326193 - in head/lib/libc: amd64 amd64/gen amd64/string amd64/sys arm arm/aeabi arm/gen arm/sys db/mpool gdtoa gen i386 i386/gen i386/sys iconv include locale mips mips/gen net posix1e... X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/lib/libc: amd64 amd64/gen amd64/string amd64/sys arm arm/aeabi arm/gen arm/sys db/mpool gdtoa gen i386 i386/gen i386/sys iconv include locale mips mips/gen net posix1e powerpc powerpc/gen powe... X-SVN-Commit-Revision: 326193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 17:13:01 -0000 Author: pfg Date: Sat Nov 25 17:12:48 2017 New Revision: 326193 URL: https://svnweb.freebsd.org/changeset/base/326193 Log: libc: further adoption of SPDX licensing ID tags. Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Modified: head/lib/libc/amd64/_fpmath.h head/lib/libc/amd64/gen/_set_tp.c head/lib/libc/amd64/gen/getcontextx.c head/lib/libc/amd64/gen/makecontext.c head/lib/libc/amd64/gen/signalcontext.c head/lib/libc/amd64/string/strcpy.c head/lib/libc/amd64/sys/amd64_get_fsbase.c head/lib/libc/amd64/sys/amd64_get_gsbase.c head/lib/libc/amd64/sys/amd64_set_fsbase.c head/lib/libc/amd64/sys/amd64_set_gsbase.c head/lib/libc/arm/_fpmath.h head/lib/libc/arm/aeabi/aeabi_atexit.c head/lib/libc/arm/aeabi/aeabi_double.c head/lib/libc/arm/aeabi/aeabi_float.c head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c head/lib/libc/arm/gen/_set_tp.c head/lib/libc/arm/gen/arm_initfini.c head/lib/libc/arm/gen/flt_rounds.c head/lib/libc/arm/gen/getcontextx.c head/lib/libc/arm/gen/makecontext.c head/lib/libc/arm/gen/signalcontext.c head/lib/libc/arm/sys/__vdso_gettc.c head/lib/libc/db/mpool/mpool-compat.c head/lib/libc/gdtoa/_hdtoa.c head/lib/libc/gdtoa/_hldtoa.c head/lib/libc/gdtoa/_ldtoa.c head/lib/libc/gdtoa/machdep_ldisQ.c head/lib/libc/gdtoa/machdep_ldisd.c head/lib/libc/gdtoa/machdep_ldisx.c head/lib/libc/gen/__getosreldate.c head/lib/libc/gen/_once_stub.c head/lib/libc/gen/_pthread_stubs.c head/lib/libc/gen/_thread_init.c head/lib/libc/gen/auxv.c head/lib/libc/gen/cap_sandboxed.c head/lib/libc/gen/clock_getcpuclockid.c head/lib/libc/gen/ctermid.c head/lib/libc/gen/dirfd.c head/lib/libc/gen/dlfcn.c head/lib/libc/gen/dup3.c head/lib/libc/gen/elf_utils.c head/lib/libc/gen/errno.c head/lib/libc/gen/fdevname.c head/lib/libc/gen/fmtcheck.c head/lib/libc/gen/fmtmsg.c head/lib/libc/gen/fpclassify.c head/lib/libc/gen/frexp.c head/lib/libc/gen/ftok.c head/lib/libc/gen/getgrent.c head/lib/libc/gen/getpagesizes.c head/lib/libc/gen/getpeereid.c head/lib/libc/gen/getpwent.c head/lib/libc/gen/getutxent.c head/lib/libc/gen/isinf.c head/lib/libc/gen/isnan.c head/lib/libc/gen/libc_dlopen.c head/lib/libc/gen/lockf.c head/lib/libc/gen/posix_spawn.c head/lib/libc/gen/pututxline.c head/lib/libc/gen/sem.c head/lib/libc/gen/sem_new.c head/lib/libc/gen/semctl.c head/lib/libc/gen/stringlist.c head/lib/libc/gen/sysctlnametomib.c head/lib/libc/gen/tls.c head/lib/libc/gen/ulimit.c head/lib/libc/gen/unvis-compat.c head/lib/libc/gen/utxdb.c head/lib/libc/gen/utxdb.h head/lib/libc/gen/waitid.c head/lib/libc/gen/wordexp.c head/lib/libc/i386/_fpmath.h head/lib/libc/i386/gen/_set_tp.c head/lib/libc/i386/gen/getcontextx.c head/lib/libc/i386/gen/makecontext.c head/lib/libc/i386/gen/signalcontext.c head/lib/libc/i386/sys/i386_clr_watch.c head/lib/libc/i386/sys/i386_get_fsbase.c head/lib/libc/i386/sys/i386_get_gsbase.c head/lib/libc/i386/sys/i386_get_ioperm.c head/lib/libc/i386/sys/i386_get_ldt.c head/lib/libc/i386/sys/i386_set_fsbase.c head/lib/libc/i386/sys/i386_set_gsbase.c head/lib/libc/i386/sys/i386_set_ioperm.c head/lib/libc/i386/sys/i386_set_ldt.c head/lib/libc/i386/sys/i386_set_watch.c head/lib/libc/i386/sys/i386_vm86.c head/lib/libc/iconv/__iconv.c head/lib/libc/iconv/__iconv_free_list.c head/lib/libc/iconv/__iconv_get_list.c head/lib/libc/iconv/bsd_iconv.c head/lib/libc/iconv/citrus_aliasname_local.h head/lib/libc/iconv/citrus_bcs.c head/lib/libc/iconv/citrus_bcs.h head/lib/libc/iconv/citrus_bcs_strtol.c head/lib/libc/iconv/citrus_bcs_strtoul.c head/lib/libc/iconv/citrus_csmapper.c head/lib/libc/iconv/citrus_csmapper.h head/lib/libc/iconv/citrus_db.c head/lib/libc/iconv/citrus_db.h head/lib/libc/iconv/citrus_db_factory.c head/lib/libc/iconv/citrus_db_factory.h head/lib/libc/iconv/citrus_db_file.h head/lib/libc/iconv/citrus_db_hash.c head/lib/libc/iconv/citrus_db_hash.h head/lib/libc/iconv/citrus_esdb.c head/lib/libc/iconv/citrus_esdb.h head/lib/libc/iconv/citrus_esdb_file.h head/lib/libc/iconv/citrus_fix_grouping.h head/lib/libc/iconv/citrus_hash.c head/lib/libc/iconv/citrus_hash.h head/lib/libc/iconv/citrus_iconv.c head/lib/libc/iconv/citrus_iconv.h head/lib/libc/iconv/citrus_iconv_local.h head/lib/libc/iconv/citrus_lock.h head/lib/libc/iconv/citrus_lookup.c head/lib/libc/iconv/citrus_lookup.h head/lib/libc/iconv/citrus_lookup_factory.c head/lib/libc/iconv/citrus_lookup_factory.h head/lib/libc/iconv/citrus_lookup_file.h head/lib/libc/iconv/citrus_mapper.c head/lib/libc/iconv/citrus_mapper.h head/lib/libc/iconv/citrus_mapper_local.h head/lib/libc/iconv/citrus_memstream.c head/lib/libc/iconv/citrus_memstream.h head/lib/libc/iconv/citrus_mmap.c head/lib/libc/iconv/citrus_mmap.h head/lib/libc/iconv/citrus_module.c head/lib/libc/iconv/citrus_module.h head/lib/libc/iconv/citrus_namespace.h head/lib/libc/iconv/citrus_none.c head/lib/libc/iconv/citrus_none.h head/lib/libc/iconv/citrus_pivot_factory.c head/lib/libc/iconv/citrus_pivot_factory.h head/lib/libc/iconv/citrus_pivot_file.h head/lib/libc/iconv/citrus_prop.c head/lib/libc/iconv/citrus_prop.h head/lib/libc/iconv/citrus_region.h head/lib/libc/iconv/citrus_stdenc.c head/lib/libc/iconv/citrus_stdenc.h head/lib/libc/iconv/citrus_stdenc_local.h head/lib/libc/iconv/citrus_stdenc_template.h head/lib/libc/iconv/citrus_types.h head/lib/libc/iconv/iconv-internal.h head/lib/libc/iconv/iconv.c head/lib/libc/iconv/iconv_canonicalize.c head/lib/libc/iconv/iconv_close.c head/lib/libc/iconv/iconv_compat.c head/lib/libc/iconv/iconv_open.c head/lib/libc/iconv/iconv_open_into.c head/lib/libc/iconv/iconv_set_relocation_prefix.c head/lib/libc/iconv/iconvctl.c head/lib/libc/iconv/iconvlist.c head/lib/libc/include/compat.h head/lib/libc/include/errlst.h head/lib/libc/include/fpmath.h head/lib/libc/include/namespace.h head/lib/libc/include/nscache.h head/lib/libc/include/nscachedcli.h head/lib/libc/include/nss_tls.h head/lib/libc/include/reentrant.h head/lib/libc/include/un-namespace.h head/lib/libc/locale/btowc.c head/lib/libc/locale/c16rtomb.c head/lib/libc/locale/c32rtomb.c head/lib/libc/locale/cXXrtomb_iconv.h head/lib/libc/locale/collate.c head/lib/libc/locale/collate.h head/lib/libc/locale/collcmp.c head/lib/libc/locale/ctype.c head/lib/libc/locale/fix_grouping.c head/lib/libc/locale/gb18030.c head/lib/libc/locale/gb2312.c head/lib/libc/locale/ldpart.c head/lib/libc/locale/ldpart.h head/lib/libc/locale/lmessages.c head/lib/libc/locale/lmessages.h head/lib/libc/locale/lmonetary.c head/lib/libc/locale/lmonetary.h head/lib/libc/locale/lnumeric.c head/lib/libc/locale/lnumeric.h head/lib/libc/locale/mblen.c head/lib/libc/locale/mblocal.h head/lib/libc/locale/mbrlen.c head/lib/libc/locale/mbrtoc16.c head/lib/libc/locale/mbrtoc32.c head/lib/libc/locale/mbrtocXX_iconv.h head/lib/libc/locale/mbrtowc.c head/lib/libc/locale/mbsinit.c head/lib/libc/locale/mbsnrtowcs.c head/lib/libc/locale/mbsrtowcs.c head/lib/libc/locale/mbstowcs.c head/lib/libc/locale/mbtowc.c head/lib/libc/locale/mskanji.c head/lib/libc/locale/nextwctype.c head/lib/libc/locale/nl_langinfo.c head/lib/libc/locale/rpmatch.c head/lib/libc/locale/runefile.h head/lib/libc/locale/setlocale.h head/lib/libc/locale/utf8.c head/lib/libc/locale/wcrtomb.c head/lib/libc/locale/wcsftime.c head/lib/libc/locale/wcsnrtombs.c head/lib/libc/locale/wcsrtombs.c head/lib/libc/locale/wcstod.c head/lib/libc/locale/wcstof.c head/lib/libc/locale/wcstold.c head/lib/libc/locale/wcstombs.c head/lib/libc/locale/wctob.c head/lib/libc/locale/wctomb.c head/lib/libc/locale/wctrans.c head/lib/libc/locale/wctype.c head/lib/libc/locale/xlocale.c head/lib/libc/locale/xlocale_private.h head/lib/libc/mips/_fpmath.h head/lib/libc/mips/gen/_set_tp.c head/lib/libc/mips/gen/longjmp.c head/lib/libc/mips/gen/makecontext.c head/lib/libc/mips/gen/signalcontext.c head/lib/libc/net/gethostbynis.c head/lib/libc/net/gethostnamadr.c head/lib/libc/net/getifmaddrs.c head/lib/libc/net/getnetbynis.c head/lib/libc/net/getnetnamadr.c head/lib/libc/net/netdb_private.h head/lib/libc/net/nscache.c head/lib/libc/net/nscachedcli.c head/lib/libc/net/nsdispatch.c head/lib/libc/net/nslexer.l head/lib/libc/net/nsparser.y head/lib/libc/net/nss_backends.h head/lib/libc/net/nss_compat.c head/lib/libc/net/ntoh.c head/lib/libc/net/sockatmark.c head/lib/libc/net/sourcefilter.c head/lib/libc/posix1e/acl_branding.c head/lib/libc/posix1e/acl_calc_mask.c head/lib/libc/posix1e/acl_compat.c head/lib/libc/posix1e/acl_copy.c head/lib/libc/posix1e/acl_delete.c head/lib/libc/posix1e/acl_delete_entry.c head/lib/libc/posix1e/acl_entry.c head/lib/libc/posix1e/acl_flag.c head/lib/libc/posix1e/acl_free.c head/lib/libc/posix1e/acl_from_text.c head/lib/libc/posix1e/acl_from_text_nfs4.c head/lib/libc/posix1e/acl_get.c head/lib/libc/posix1e/acl_id_to_name.c head/lib/libc/posix1e/acl_init.c head/lib/libc/posix1e/acl_perm.c head/lib/libc/posix1e/acl_set.c head/lib/libc/posix1e/acl_strip.c head/lib/libc/posix1e/acl_support.c head/lib/libc/posix1e/acl_support.h head/lib/libc/posix1e/acl_support_nfs4.c head/lib/libc/posix1e/acl_to_text.c head/lib/libc/posix1e/acl_to_text_nfs4.c head/lib/libc/posix1e/acl_valid.c head/lib/libc/posix1e/extattr.c head/lib/libc/posix1e/mac.c head/lib/libc/posix1e/mac_exec.c head/lib/libc/posix1e/mac_get.c head/lib/libc/posix1e/mac_set.c head/lib/libc/powerpc/_fpmath.h head/lib/libc/powerpc/gen/_set_tp.c head/lib/libc/powerpc/gen/flt_rounds.c head/lib/libc/powerpc/gen/fpgetmask.c head/lib/libc/powerpc/gen/fpgetround.c head/lib/libc/powerpc/gen/fpgetsticky.c head/lib/libc/powerpc/gen/fpsetmask.c head/lib/libc/powerpc/gen/fpsetround.c head/lib/libc/powerpc/gen/makecontext.c head/lib/libc/powerpc/gen/signalcontext.c head/lib/libc/powerpc/gen/syncicache.c head/lib/libc/powerpc64/_fpmath.h head/lib/libc/powerpc64/gen/_set_tp.c head/lib/libc/powerpc64/gen/flt_rounds.c head/lib/libc/powerpc64/gen/fpgetmask.c head/lib/libc/powerpc64/gen/fpgetround.c head/lib/libc/powerpc64/gen/fpgetsticky.c head/lib/libc/powerpc64/gen/fpsetmask.c head/lib/libc/powerpc64/gen/fpsetround.c head/lib/libc/powerpc64/gen/makecontext.c head/lib/libc/powerpc64/gen/signalcontext.c head/lib/libc/powerpc64/gen/syncicache.c head/lib/libc/resolv/h_errno.c head/lib/libc/resolv/res_state.c head/lib/libc/rpc/mt_misc.h head/lib/libc/rpc/rpcsec_gss_stub.c head/lib/libc/softfloat/fpgetmask.c head/lib/libc/softfloat/fpgetround.c head/lib/libc/softfloat/fpgetsticky.c head/lib/libc/softfloat/fpsetmask.c head/lib/libc/softfloat/fpsetround.c head/lib/libc/softfloat/fpsetsticky.c head/lib/libc/sparc64/_fpmath.h head/lib/libc/sparc64/fpu/fpu_extern.h head/lib/libc/sparc64/fpu/fpu_qp.c head/lib/libc/sparc64/fpu/fpu_reg.h head/lib/libc/sparc64/gen/_set_tp.c head/lib/libc/sparc64/gen/makecontext.c head/lib/libc/sparc64/gen/signalcontext.c head/lib/libc/sparc64/sys/__sparc_sigtramp_setup.c head/lib/libc/sparc64/sys/__sparc_utrap.c head/lib/libc/sparc64/sys/__sparc_utrap_align.c head/lib/libc/sparc64/sys/__sparc_utrap_emul.c head/lib/libc/sparc64/sys/__sparc_utrap_install.c head/lib/libc/sparc64/sys/__sparc_utrap_private.h head/lib/libc/sparc64/sys/__sparc_utrap_setup.c head/lib/libc/stdio/dprintf.c head/lib/libc/stdio/fcloseall.c head/lib/libc/stdio/fgetwc.c head/lib/libc/stdio/fgetwln.c head/lib/libc/stdio/fgetws.c head/lib/libc/stdio/fmemopen.c head/lib/libc/stdio/fputwc.c head/lib/libc/stdio/fputws.c head/lib/libc/stdio/fwide.c head/lib/libc/stdio/fwprintf.c head/lib/libc/stdio/fwscanf.c head/lib/libc/stdio/getdelim.c head/lib/libc/stdio/getline.c head/lib/libc/stdio/getwc.c head/lib/libc/stdio/getwchar.c head/lib/libc/stdio/open_memstream.c head/lib/libc/stdio/open_wmemstream.c head/lib/libc/stdio/putwc.c head/lib/libc/stdio/putwchar.c head/lib/libc/stdio/swprintf.c head/lib/libc/stdio/swscanf.c head/lib/libc/stdio/ungetwc.c head/lib/libc/stdio/vasprintf.c head/lib/libc/stdio/vdprintf.c head/lib/libc/stdio/vswprintf.c head/lib/libc/stdio/vwprintf.c head/lib/libc/stdio/vwscanf.c head/lib/libc/stdio/wprintf.c head/lib/libc/stdio/wscanf.c head/lib/libc/stdio/xprintf_errno.c head/lib/libc/stdio/xprintf_hexdump.c head/lib/libc/stdio/xprintf_quote.c head/lib/libc/stdio/xprintf_vis.c head/lib/libc/stdlib/getenv.c head/lib/libc/stdlib/hcreate.c head/lib/libc/stdlib/imaxabs.c head/lib/libc/stdlib/imaxdiv.c head/lib/libc/stdlib/llabs.c head/lib/libc/stdlib/lldiv.c head/lib/libc/stdlib/ptsname.c head/lib/libc/stdlib/quick_exit.c head/lib/libc/stdlib/reallocf.c head/lib/libc/stdlib/realpath.c head/lib/libc/stdlib/strfmon.c head/lib/libc/stdtime/strptime.c head/lib/libc/stdtime/timelocal.c head/lib/libc/stdtime/timelocal.h head/lib/libc/string/memmem.c head/lib/libc/string/stpncpy.c head/lib/libc/string/strchrnul.c head/lib/libc/string/strcoll.c head/lib/libc/string/strcspn.c head/lib/libc/string/strlen.c head/lib/libc/string/strnlen.c head/lib/libc/string/strspn.c head/lib/libc/string/strxfrm.c head/lib/libc/string/wcpncpy.c head/lib/libc/string/wcscasecmp.c head/lib/libc/string/wcscat.c head/lib/libc/string/wcschr.c head/lib/libc/string/wcscoll.c head/lib/libc/string/wcscpy.c head/lib/libc/string/wcscspn.c head/lib/libc/string/wcsdup.c head/lib/libc/string/wcslcat.c head/lib/libc/string/wcslcpy.c head/lib/libc/string/wcslen.c head/lib/libc/string/wcsncasecmp.c head/lib/libc/string/wcsncat.c head/lib/libc/string/wcsnlen.c head/lib/libc/string/wcspbrk.c head/lib/libc/string/wcsrchr.c head/lib/libc/string/wcsspn.c head/lib/libc/string/wcsxfrm.c head/lib/libc/string/wmemchr.c head/lib/libc/string/wmemcmp.c head/lib/libc/string/wmemcpy.c head/lib/libc/string/wmemmove.c head/lib/libc/string/wmemset.c head/lib/libc/sys/__vdso_gettimeofday.c head/lib/libc/sys/clock_gettime.c head/lib/libc/sys/fcntl.c head/lib/libc/sys/gettimeofday.c head/lib/libc/sys/sigwait.c head/lib/libc/uuid/uuid_compare.c head/lib/libc/uuid/uuid_create.c head/lib/libc/uuid/uuid_create_nil.c head/lib/libc/uuid/uuid_equal.c head/lib/libc/uuid/uuid_from_string.c head/lib/libc/uuid/uuid_hash.c head/lib/libc/uuid/uuid_is_nil.c head/lib/libc/uuid/uuid_stream.c head/lib/libc/uuid/uuid_to_string.c head/lib/libc/yp/xdryp.c head/lib/libc/yp/yplib.c Modified: head/lib/libc/amd64/_fpmath.h ============================================================================== --- head/lib/libc/amd64/_fpmath.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/_fpmath.h Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002, 2003 David Schultz * All rights reserved. * Modified: head/lib/libc/amd64/gen/_set_tp.c ============================================================================== --- head/lib/libc/amd64/gen/_set_tp.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/gen/_set_tp.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 Doug Rabson * All rights reserved. * Modified: head/lib/libc/amd64/gen/getcontextx.c ============================================================================== --- head/lib/libc/amd64/gen/getcontextx.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/gen/getcontextx.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 Konstantin Belousov * All rights reserved. * Modified: head/lib/libc/amd64/gen/makecontext.c ============================================================================== --- head/lib/libc/amd64/gen/makecontext.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/gen/makecontext.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Marcel Moolenaar * All rights reserved. * Modified: head/lib/libc/amd64/gen/signalcontext.c ============================================================================== --- head/lib/libc/amd64/gen/signalcontext.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/gen/signalcontext.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Marcel Moolenaar * All rights reserved. * Modified: head/lib/libc/amd64/string/strcpy.c ============================================================================== --- head/lib/libc/amd64/string/strcpy.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/string/strcpy.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright 2011 George V. Neville-Neil. All rights reserved. * * The compilation of software known as FreeBSD is distributed under the Modified: head/lib/libc/amd64/sys/amd64_get_fsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_get_fsbase.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/sys/amd64_get_fsbase.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Peter Wemm * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. Modified: head/lib/libc/amd64/sys/amd64_get_gsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_get_gsbase.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/sys/amd64_get_gsbase.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Peter Wemm * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. Modified: head/lib/libc/amd64/sys/amd64_set_fsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_set_fsbase.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/sys/amd64_set_fsbase.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Peter Wemm * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. Modified: head/lib/libc/amd64/sys/amd64_set_gsbase.c ============================================================================== --- head/lib/libc/amd64/sys/amd64_set_gsbase.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/amd64/sys/amd64_set_gsbase.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Peter Wemm * Copyright (c) 2017 The FreeBSD Foundation * All rights reserved. Modified: head/lib/libc/arm/_fpmath.h ============================================================================== --- head/lib/libc/arm/_fpmath.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/_fpmath.h Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002, 2003 David Schultz * All rights reserved. * Modified: head/lib/libc/arm/aeabi/aeabi_atexit.c ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_atexit.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/aeabi/aeabi_atexit.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (C) 2012 Andrew Turner * All rights reserved. * Modified: head/lib/libc/arm/aeabi/aeabi_double.c ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_double.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/aeabi/aeabi_double.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (C) 2012 Andrew Turner * All rights reserved. * Modified: head/lib/libc/arm/aeabi/aeabi_float.c ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_float.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/aeabi/aeabi_float.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (C) 2012 Andrew Turner * All rights reserved. * Modified: head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c ============================================================================== --- head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/aeabi/aeabi_unwind_cpp.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (C) 2011 Andrew Turner * All rights reserved. * Modified: head/lib/libc/arm/gen/_set_tp.c ============================================================================== --- head/lib/libc/arm/gen/_set_tp.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/gen/_set_tp.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 Doug Rabson * All rights reserved. * Modified: head/lib/libc/arm/gen/arm_initfini.c ============================================================================== --- head/lib/libc/arm/gen/arm_initfini.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/gen/arm_initfini.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * * Copyright (c) 2013 The NetBSD Foundation, Inc. * Copyright (c) 2013 Andrew Turner * All rights reserved. Modified: head/lib/libc/arm/gen/flt_rounds.c ============================================================================== --- head/lib/libc/arm/gen/flt_rounds.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/gen/flt_rounds.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2012 Ian Lepore * All rights reserved. * Modified: head/lib/libc/arm/gen/getcontextx.c ============================================================================== --- head/lib/libc/arm/gen/getcontextx.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/gen/getcontextx.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2017 Michal Meloun * All rights reserved. * Modified: head/lib/libc/arm/gen/makecontext.c ============================================================================== --- head/lib/libc/arm/gen/makecontext.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/gen/makecontext.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,6 +1,8 @@ /* $NetBSD: makecontext.c,v 1.2 2003/01/18 11:06:24 thorpej Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. * Modified: head/lib/libc/arm/gen/signalcontext.c ============================================================================== --- head/lib/libc/arm/gen/signalcontext.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/gen/signalcontext.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 Olivier Houchard * All rights reserved. * Modified: head/lib/libc/arm/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/arm/sys/__vdso_gettc.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/arm/sys/__vdso_gettc.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2015 The FreeBSD Foundation * * This software was developed by Konstantin Belousov Modified: head/lib/libc/db/mpool/mpool-compat.c ============================================================================== --- head/lib/libc/db/mpool/mpool-compat.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/db/mpool/mpool-compat.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2009 Xin LI * All rights reserved. * Modified: head/lib/libc/gdtoa/_hdtoa.c ============================================================================== --- head/lib/libc/gdtoa/_hdtoa.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gdtoa/_hdtoa.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004-2008 David Schultz * All rights reserved. * Modified: head/lib/libc/gdtoa/_hldtoa.c ============================================================================== --- head/lib/libc/gdtoa/_hldtoa.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gdtoa/_hldtoa.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004-2008 David Schultz * All rights reserved. * Modified: head/lib/libc/gdtoa/_ldtoa.c ============================================================================== --- head/lib/libc/gdtoa/_ldtoa.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gdtoa/_ldtoa.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 David Schultz * All rights reserved. * Modified: head/lib/libc/gdtoa/machdep_ldisQ.c ============================================================================== --- head/lib/libc/gdtoa/machdep_ldisQ.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gdtoa/machdep_ldisQ.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 David Schultz * All rights reserved. * Modified: head/lib/libc/gdtoa/machdep_ldisd.c ============================================================================== --- head/lib/libc/gdtoa/machdep_ldisd.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gdtoa/machdep_ldisd.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 David Schultz * All rights reserved. * Modified: head/lib/libc/gdtoa/machdep_ldisx.c ============================================================================== --- head/lib/libc/gdtoa/machdep_ldisx.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gdtoa/machdep_ldisx.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 David Schultz * All rights reserved. * Modified: head/lib/libc/gen/__getosreldate.c ============================================================================== --- head/lib/libc/gen/__getosreldate.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/__getosreldate.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2007 Peter Wemm * All rights reserved. * Modified: head/lib/libc/gen/_once_stub.c ============================================================================== --- head/lib/libc/gen/_once_stub.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/_once_stub.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2009 Hudson River Trading LLC * Written by: John H. Baldwin * All rights reserved. Modified: head/lib/libc/gen/_pthread_stubs.c ============================================================================== --- head/lib/libc/gen/_pthread_stubs.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/_pthread_stubs.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2001 Daniel Eischen . * All rights reserved. * Modified: head/lib/libc/gen/_thread_init.c ============================================================================== --- head/lib/libc/gen/_thread_init.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/_thread_init.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2001 Daniel Eischen * All rights reserved. * Modified: head/lib/libc/gen/auxv.c ============================================================================== --- head/lib/libc/gen/auxv.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/auxv.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright 2010, 2012 Konstantin Belousov . * All rights reserved. * Modified: head/lib/libc/gen/cap_sandboxed.c ============================================================================== --- head/lib/libc/gen/cap_sandboxed.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/cap_sandboxed.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * Modified: head/lib/libc/gen/clock_getcpuclockid.c ============================================================================== --- head/lib/libc/gen/clock_getcpuclockid.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/clock_getcpuclockid.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2012 David Xu . * All rights reserved. * Modified: head/lib/libc/gen/ctermid.c ============================================================================== --- head/lib/libc/gen/ctermid.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/ctermid.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 Ed Schouten * All rights reserved. * Modified: head/lib/libc/gen/dirfd.c ============================================================================== --- head/lib/libc/gen/dirfd.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/dirfd.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 Gleb Kurtsou * All rights reserved. * Modified: head/lib/libc/gen/dlfcn.c ============================================================================== --- head/lib/libc/gen/dlfcn.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/dlfcn.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 1998 John D. Polstra * All rights reserved. * Modified: head/lib/libc/gen/dup3.c ============================================================================== --- head/lib/libc/gen/dup3.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/dup3.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2012 Jukka A. Ukkonen * All rights reserved. * Modified: head/lib/libc/gen/elf_utils.c ============================================================================== --- head/lib/libc/gen/elf_utils.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/elf_utils.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2010 Konstantin Belousov * All rights reserved. * Modified: head/lib/libc/gen/errno.c ============================================================================== --- head/lib/libc/gen/errno.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/errno.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Peter Wemm * All rights reserved. * Modified: head/lib/libc/gen/fdevname.c ============================================================================== --- head/lib/libc/gen/fdevname.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/fdevname.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2009 Ed Schouten * All rights reserved. * Modified: head/lib/libc/gen/fmtcheck.c ============================================================================== --- head/lib/libc/gen/fmtcheck.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/fmtcheck.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,6 +1,8 @@ /* $NetBSD: fmtcheck.c,v 1.8 2008/04/28 20:22:59 martin Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * * Copyright (c) 2000 The NetBSD Foundation, Inc. * All rights reserved. * Modified: head/lib/libc/gen/fmtmsg.c ============================================================================== --- head/lib/libc/gen/fmtmsg.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/fmtmsg.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Mike Barcroft * All rights reserved. * Modified: head/lib/libc/gen/fpclassify.c ============================================================================== --- head/lib/libc/gen/fpclassify.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/fpclassify.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Mike Barcroft * Copyright (c) 2002, 2003 David Schultz * All rights reserved. Modified: head/lib/libc/gen/frexp.c ============================================================================== --- head/lib/libc/gen/frexp.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/frexp.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 David Schultz * All rights reserved. * Modified: head/lib/libc/gen/ftok.c ============================================================================== --- head/lib/libc/gen/ftok.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/ftok.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 1994 SigmaSoft, Th. Lockert * All rights reserved. * Modified: head/lib/libc/gen/getgrent.c ============================================================================== --- head/lib/libc/gen/getgrent.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/getgrent.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Networks Associates Technology, Inc. * All rights reserved. * Modified: head/lib/libc/gen/getpagesizes.c ============================================================================== --- head/lib/libc/gen/getpagesizes.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/getpagesizes.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2009 Alan L. Cox * All rights reserved. * Modified: head/lib/libc/gen/getpeereid.c ============================================================================== --- head/lib/libc/gen/getpeereid.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/getpeereid.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2001 Dima Dorfman. * All rights reserved. * Modified: head/lib/libc/gen/getpwent.c ============================================================================== --- head/lib/libc/gen/getpwent.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/getpwent.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003 Networks Associates Technology, Inc. * All rights reserved. * Modified: head/lib/libc/gen/getutxent.c ============================================================================== --- head/lib/libc/gen/getutxent.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/getutxent.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2010 Ed Schouten * All rights reserved. * Modified: head/lib/libc/gen/isinf.c ============================================================================== --- head/lib/libc/gen/isinf.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/isinf.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 David Schultz * All rights reserved. * Modified: head/lib/libc/gen/isnan.c ============================================================================== --- head/lib/libc/gen/isnan.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/isnan.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 David Schultz * All rights reserved. * Modified: head/lib/libc/gen/libc_dlopen.c ============================================================================== --- head/lib/libc/gen/libc_dlopen.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/libc_dlopen.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 Xin Li * All rights reserved. * Modified: head/lib/libc/gen/lockf.c ============================================================================== --- head/lib/libc/gen/lockf.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/lockf.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,5 +1,7 @@ /* $NetBSD: lockf.c,v 1.3 2008/04/28 20:22:59 martin Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * * Copyright (c) 1997 The NetBSD Foundation, Inc. * All rights reserved. * Modified: head/lib/libc/gen/posix_spawn.c ============================================================================== --- head/lib/libc/gen/posix_spawn.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/posix_spawn.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2008 Ed Schouten * All rights reserved. * Modified: head/lib/libc/gen/pututxline.c ============================================================================== --- head/lib/libc/gen/pututxline.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/pututxline.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2010 Ed Schouten * All rights reserved. * Modified: head/lib/libc/gen/sem.c ============================================================================== --- head/lib/libc/gen/sem.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/sem.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (C) 2010 David Xu . * Copyright (C) 2000 Jason Evans . * All rights reserved. Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/sem_new.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (C) 2010 David Xu . * All rights reserved. * Modified: head/lib/libc/gen/semctl.c ============================================================================== --- head/lib/libc/gen/semctl.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/semctl.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Doug Rabson * All rights reserved. * Modified: head/lib/libc/gen/stringlist.c ============================================================================== --- head/lib/libc/gen/stringlist.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/stringlist.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 1994 Christos Zoulas * All rights reserved. * Modified: head/lib/libc/gen/sysctlnametomib.c ============================================================================== --- head/lib/libc/gen/sysctlnametomib.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/sysctlnametomib.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright 2001 The FreeBSD Project. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/lib/libc/gen/tls.c ============================================================================== --- head/lib/libc/gen/tls.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/tls.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 Doug Rabson * All rights reserved. * Modified: head/lib/libc/gen/ulimit.c ============================================================================== --- head/lib/libc/gen/ulimit.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/ulimit.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Kyle Martin * All rights reserved. * Modified: head/lib/libc/gen/unvis-compat.c ============================================================================== --- head/lib/libc/gen/unvis-compat.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/unvis-compat.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2012 SRI International * All rights reserved. * Modified: head/lib/libc/gen/utxdb.c ============================================================================== --- head/lib/libc/gen/utxdb.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/utxdb.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2010 Ed Schouten * All rights reserved. * Modified: head/lib/libc/gen/utxdb.h ============================================================================== --- head/lib/libc/gen/utxdb.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/utxdb.h Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2010 Ed Schouten * All rights reserved. * Modified: head/lib/libc/gen/waitid.c ============================================================================== --- head/lib/libc/gen/waitid.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/waitid.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2012 Jukka A. Ukkonen * All rights reserved. * Modified: head/lib/libc/gen/wordexp.c ============================================================================== --- head/lib/libc/gen/wordexp.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/gen/wordexp.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Tim J. Robbins. * All rights reserved. * Modified: head/lib/libc/i386/_fpmath.h ============================================================================== --- head/lib/libc/i386/_fpmath.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/_fpmath.h Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002, 2003 David Schultz * All rights reserved. * Modified: head/lib/libc/i386/gen/_set_tp.c ============================================================================== --- head/lib/libc/i386/gen/_set_tp.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/gen/_set_tp.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2004 Doug Rabson * All rights reserved. * Modified: head/lib/libc/i386/gen/getcontextx.c ============================================================================== --- head/lib/libc/i386/gen/getcontextx.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/gen/getcontextx.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2011 Konstantin Belousov * All rights reserved. * Modified: head/lib/libc/i386/gen/makecontext.c ============================================================================== --- head/lib/libc/i386/gen/makecontext.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/gen/makecontext.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2001 Daniel M. Eischen * All rights reserved. * Modified: head/lib/libc/i386/gen/signalcontext.c ============================================================================== --- head/lib/libc/i386/gen/signalcontext.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/gen/signalcontext.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2002 Jonathan Mini * All rights reserved. * Modified: head/lib/libc/i386/sys/i386_clr_watch.c ============================================================================== --- head/lib/libc/i386/sys/i386_clr_watch.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_clr_watch.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright 2000 Brian S. Dean * All Rights Reserved. * Modified: head/lib/libc/i386/sys/i386_get_fsbase.c ============================================================================== --- head/lib/libc/i386/sys/i386_get_fsbase.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_get_fsbase.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2005 Peter Wemm * All rights reserved. * Modified: head/lib/libc/i386/sys/i386_get_gsbase.c ============================================================================== --- head/lib/libc/i386/sys/i386_get_gsbase.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_get_gsbase.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2005 Peter Wemm * All rights reserved. * Modified: head/lib/libc/i386/sys/i386_get_ioperm.c ============================================================================== --- head/lib/libc/i386/sys/i386_get_ioperm.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_get_ioperm.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 1998 Jonathan Lemon * All rights reserved. * Modified: head/lib/libc/i386/sys/i386_get_ldt.c ============================================================================== --- head/lib/libc/i386/sys/i386_get_ldt.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_get_ldt.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 John Brezak * All rights reserved. * Modified: head/lib/libc/i386/sys/i386_set_fsbase.c ============================================================================== --- head/lib/libc/i386/sys/i386_set_fsbase.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_set_fsbase.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2005 Peter Wemm * All rights reserved. * Modified: head/lib/libc/i386/sys/i386_set_gsbase.c ============================================================================== --- head/lib/libc/i386/sys/i386_set_gsbase.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_set_gsbase.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2005 Peter Wemm * All rights reserved. * Modified: head/lib/libc/i386/sys/i386_set_ioperm.c ============================================================================== --- head/lib/libc/i386/sys/i386_set_ioperm.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_set_ioperm.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 1998 Jonathan Lemon * All rights reserved. * Modified: head/lib/libc/i386/sys/i386_set_ldt.c ============================================================================== --- head/lib/libc/i386/sys/i386_set_ldt.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_set_ldt.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 1993 John Brezak * All rights reserved. * Modified: head/lib/libc/i386/sys/i386_set_watch.c ============================================================================== --- head/lib/libc/i386/sys/i386_set_watch.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_set_watch.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright 2000 Brian S. Dean * All Rights Reserved. * Modified: head/lib/libc/i386/sys/i386_vm86.c ============================================================================== --- head/lib/libc/i386/sys/i386_vm86.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/i386/sys/i386_vm86.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 1998 Jonathan Lemon * All rights reserved. * Modified: head/lib/libc/iconv/__iconv.c ============================================================================== --- head/lib/libc/iconv/__iconv.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/__iconv.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Peter Wemm * All rights reserved. * Modified: head/lib/libc/iconv/__iconv_free_list.c ============================================================================== --- head/lib/libc/iconv/__iconv_free_list.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/__iconv_free_list.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Peter Wemm * All rights reserved. * Modified: head/lib/libc/iconv/__iconv_get_list.c ============================================================================== --- head/lib/libc/iconv/__iconv_get_list.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/__iconv_get_list.c Sat Nov 25 17:12:48 2017 (r326193) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2013 Peter Wemm * All rights reserved. * Modified: head/lib/libc/iconv/bsd_iconv.c ============================================================================== --- head/lib/libc/iconv/bsd_iconv.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/bsd_iconv.c Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: iconv.c,v 1.11 2009/03/03 16:22:33 explorer Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2003 Citrus Project, * Copyright (c) 2009, 2010 Gabor Kovesdan , * All rights reserved. Modified: head/lib/libc/iconv/citrus_aliasname_local.h ============================================================================== --- head/lib/libc/iconv/citrus_aliasname_local.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_aliasname_local.h Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_aliasname_local.h,v 1.2 2009/01/11 02:46:24 christos Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2008 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_bcs.c ============================================================================== --- head/lib/libc/iconv/citrus_bcs.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_bcs.c Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_bcs.c,v 1.5 2005/05/14 17:55:42 tshiozak Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_bcs.h ============================================================================== --- head/lib/libc/iconv/citrus_bcs.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_bcs.h Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_bcs.h,v 1.6 2009/01/11 02:46:24 christos Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_bcs_strtol.c ============================================================================== --- head/lib/libc/iconv/citrus_bcs_strtol.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_bcs_strtol.c Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_bcs_strtol.c,v 1.4 2013/04/26 21:20:47 joerg Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2005 The DragonFly Project. All rights reserved. * Copyright (c) 2003, 2008 Citrus Project, * All rights reserved. Modified: head/lib/libc/iconv/citrus_bcs_strtoul.c ============================================================================== --- head/lib/libc/iconv/citrus_bcs_strtoul.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_bcs_strtoul.c Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_bcs_strtoul.c,v 1.5 2013/04/26 21:20:48 joerg Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2005 The DragonFly Project. All rights reserved. * Copyright (c) 2003, 2008 Citrus Project, * All rights reserved. Modified: head/lib/libc/iconv/citrus_csmapper.c ============================================================================== --- head/lib/libc/iconv/citrus_csmapper.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_csmapper.c Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_csmapper.c,v 1.11 2011/11/20 07:43:52 tnozaki Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_csmapper.h ============================================================================== --- head/lib/libc/iconv/citrus_csmapper.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_csmapper.h Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_csmapper.h,v 1.3 2013/06/24 17:28:35 joerg Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_db.c ============================================================================== --- head/lib/libc/iconv/citrus_db.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_db.c Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_db.c,v 1.5 2008/02/09 14:56:20 junyoung Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_db.h ============================================================================== --- head/lib/libc/iconv/citrus_db.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_db.h Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_db.h,v 1.2 2008/02/09 14:56:20 junyoung Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_db_factory.c ============================================================================== --- head/lib/libc/iconv/citrus_db_factory.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_db_factory.c Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_db_factory.c,v 1.10 2013/09/14 13:05:51 joerg Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_db_factory.h ============================================================================== --- head/lib/libc/iconv/citrus_db_factory.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_db_factory.h Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_db_factory.h,v 1.3 2008/02/09 14:56:20 junyoung Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_db_file.h ============================================================================== --- head/lib/libc/iconv/citrus_db_file.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_db_file.h Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_db_file.h,v 1.4 2008/02/10 05:58:22 junyoung Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_db_hash.c ============================================================================== --- head/lib/libc/iconv/citrus_db_hash.c Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_db_hash.c Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_db_hash.c,v 1.5 2008/02/09 14:56:20 junyoung Exp $ */ /*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c)2003 Citrus Project, * All rights reserved. * Modified: head/lib/libc/iconv/citrus_db_hash.h ============================================================================== --- head/lib/libc/iconv/citrus_db_hash.h Sat Nov 25 17:09:43 2017 (r326192) +++ head/lib/libc/iconv/citrus_db_hash.h Sat Nov 25 17:12:48 2017 (r326193) @@ -2,6 +2,8 @@ /* $NetBSD: citrus_db_hash.h,v 1.2 2008/02/09 14:56:20 junyoung Exp $ */ /*- *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Nov 25 20:08: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 9661BDEEB4F; Sat, 25 Nov 2017 20:08:12 +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 6E07D6C344; Sat, 25 Nov 2017 20:08:12 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPK8B5a009195; Sat, 25 Nov 2017 20:08:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPK8Bhm009194; Sat, 25 Nov 2017 20:08:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711252008.vAPK8Bhm009194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Nov 2017 20:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326194 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 20:08:12 -0000 Author: mjg Date: Sat Nov 25 20:08:11 2017 New Revision: 326194 URL: https://svnweb.freebsd.org/changeset/base/326194 Log: rwlock: stop re-reading the owner when going to sleep Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Nov 25 17:12:48 2017 (r326193) +++ head/sys/kern/kern_rwlock.c Sat Nov 25 20:08:11 2017 (r326194) @@ -411,8 +411,8 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, LOCK_FILE_LINE_ARG_DEF) { struct turnstile *ts; + struct thread *owner; #ifdef ADAPTIVE_RWLOCKS - volatile struct thread *owner; int spintries = 0; int i, n; #endif @@ -531,6 +531,8 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, continue; } + owner = lv_rw_wowner(v); + #ifdef ADAPTIVE_RWLOCKS /* * The current lock owner might have started executing @@ -539,8 +541,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, * chain lock. If so, drop the turnstile lock and try * again. */ - if ((v & RW_LOCK_READ) == 0) { - owner = (struct thread *)RW_OWNER(v); + if (owner != NULL) { if (TD_IS_RUNNING(owner)) { turnstile_cancel(ts); continue; @@ -581,7 +582,8 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, #ifdef KDTRACE_HOOKS sleep_time -= lockstat_nsecs(&rw->lock_object); #endif - turnstile_wait(ts, rw_owner(rw), TS_SHARED_QUEUE); + MPASS(owner == rw_owner(rw)); + turnstile_wait(ts, owner, TS_SHARED_QUEUE); #ifdef KDTRACE_HOOKS sleep_time += lockstat_nsecs(&rw->lock_object); sleep_cnt++; @@ -850,8 +852,8 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC uintptr_t tid; struct rwlock *rw; struct turnstile *ts; + struct thread *owner; #ifdef ADAPTIVE_RWLOCKS - volatile struct thread *owner; int spintries = 0; int i, n; #endif @@ -981,6 +983,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC #endif ts = turnstile_trywait(&rw->lock_object); v = RW_READ_VALUE(rw); + owner = lv_rw_wowner(v); #ifdef ADAPTIVE_RWLOCKS /* @@ -990,8 +993,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC * chain lock. If so, drop the turnstile lock and try * again. */ - if (!(v & RW_LOCK_READ)) { - owner = (struct thread *)RW_OWNER(v); + if (owner != NULL) { if (TD_IS_RUNNING(owner)) { turnstile_cancel(ts); continue; @@ -1045,7 +1047,8 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC #ifdef KDTRACE_HOOKS sleep_time -= lockstat_nsecs(&rw->lock_object); #endif - turnstile_wait(ts, rw_owner(rw), TS_EXCLUSIVE_QUEUE); + MPASS(owner == rw_owner(rw)); + turnstile_wait(ts, owner, TS_EXCLUSIVE_QUEUE); #ifdef KDTRACE_HOOKS sleep_time += lockstat_nsecs(&rw->lock_object); sleep_cnt++; From owner-svn-src-head@freebsd.org Sat Nov 25 20:10: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 54ECFDEECCE; Sat, 25 Nov 2017 20:10: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 2C5A96C5FE; Sat, 25 Nov 2017 20:10: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 vAPKAYiH009338; Sat, 25 Nov 2017 20:10:34 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPKAYS7009336; Sat, 25 Nov 2017 20:10:34 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711252010.vAPKAYS7009336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Nov 2017 20:10:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326195 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 20:10:35 -0000 Author: mjg Date: Sat Nov 25 20:10:33 2017 New Revision: 326195 URL: https://svnweb.freebsd.org/changeset/base/326195 Log: locks: retry turnstile/sleepq loops on failed cmpset In order to go to sleep threads set waiter flags, but that can spuriously fail e.g. when a new reader arrives. Instead of unlocking everything and looping back, re-evaluate the new state while still holding the lock necessary to go to sleep. Modified: head/sys/kern/kern_rwlock.c head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Nov 25 20:08:11 2017 (r326194) +++ head/sys/kern/kern_rwlock.c Sat Nov 25 20:10:33 2017 (r326195) @@ -526,6 +526,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, * recheck its state and restart the loop if needed. */ v = RW_READ_VALUE(rw); +retry_ts: if (__rw_can_read(td, v, false)) { turnstile_cancel(ts); continue; @@ -561,12 +562,9 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, * lock and restart the loop. */ if (!(v & RW_LOCK_READ_WAITERS)) { - if (!atomic_cmpset_ptr(&rw->rw_lock, v, - v | RW_LOCK_READ_WAITERS)) { - turnstile_cancel(ts); - v = RW_READ_VALUE(rw); - continue; - } + if (!atomic_fcmpset_ptr(&rw->rw_lock, &v, + v | RW_LOCK_READ_WAITERS)) + goto retry_ts; if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p set read waiters flag", __func__, rw); @@ -757,7 +755,9 @@ __rw_runlock_hard(struct rwlock *rw, struct thread *td * last reader, so grab the turnstile lock. */ turnstile_chain_lock(&rw->lock_object); - v = rw->rw_lock & (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER); + v = RW_READ_VALUE(rw); +retry_ts: + v &= (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER); MPASS(v & RW_LOCK_WAITERS); /* @@ -782,12 +782,9 @@ __rw_runlock_hard(struct rwlock *rw, struct thread *td x |= (v & RW_LOCK_READ_WAITERS); } else queue = TS_SHARED_QUEUE; - if (!atomic_cmpset_rel_ptr(&rw->rw_lock, RW_READERS_LOCK(1) | v, - x)) { - turnstile_chain_unlock(&rw->lock_object); - v = RW_READ_VALUE(rw); - continue; - } + v |= RW_READERS_LOCK(1); + if (!atomic_fcmpset_rel_ptr(&rw->rw_lock, &v, x)) + goto retry_ts; if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p last succeeded with waiters", __func__, rw); @@ -983,6 +980,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC #endif ts = turnstile_trywait(&rw->lock_object); v = RW_READ_VALUE(rw); +retry_ts: owner = lv_rw_wowner(v); #ifdef ADAPTIVE_RWLOCKS @@ -1010,16 +1008,14 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC x = v & (RW_LOCK_WAITERS | RW_LOCK_WRITE_SPINNER); if ((v & ~x) == RW_UNLOCKED) { x &= ~RW_LOCK_WRITE_SPINNER; - if (atomic_cmpset_acq_ptr(&rw->rw_lock, v, tid | x)) { + if (atomic_fcmpset_acq_ptr(&rw->rw_lock, &v, tid | x)) { if (x) turnstile_claim(ts); else turnstile_cancel(ts); break; } - turnstile_cancel(ts); - v = RW_READ_VALUE(rw); - continue; + goto retry_ts; } /* * If the RW_LOCK_WRITE_WAITERS flag isn't set, then try to @@ -1027,12 +1023,9 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC * again. */ if (!(v & RW_LOCK_WRITE_WAITERS)) { - if (!atomic_cmpset_ptr(&rw->rw_lock, v, - v | RW_LOCK_WRITE_WAITERS)) { - turnstile_cancel(ts); - v = RW_READ_VALUE(rw); - continue; - } + if (!atomic_fcmpset_ptr(&rw->rw_lock, &v, + v | RW_LOCK_WRITE_WAITERS)) + goto retry_ts; if (LOCK_LOG_TEST(&rw->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p set write waiters flag", __func__, rw); Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Nov 25 20:08:11 2017 (r326194) +++ head/sys/kern/kern_sx.c Sat Nov 25 20:10:33 2017 (r326195) @@ -665,6 +665,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO sleepq_lock(&sx->lock_object); x = SX_READ_VALUE(sx); +retry_sleepq: /* * If the lock was released while spinning on the @@ -704,17 +705,13 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO * fail, restart the loop. */ if (x == (SX_LOCK_UNLOCKED | SX_LOCK_EXCLUSIVE_WAITERS)) { - if (atomic_cmpset_acq_ptr(&sx->sx_lock, - SX_LOCK_UNLOCKED | SX_LOCK_EXCLUSIVE_WAITERS, - tid | SX_LOCK_EXCLUSIVE_WAITERS)) { - sleepq_release(&sx->lock_object); - CTR2(KTR_LOCK, "%s: %p claimed by new writer", - __func__, sx); - break; - } + if (!atomic_fcmpset_acq_ptr(&sx->sx_lock, &x, + tid | SX_LOCK_EXCLUSIVE_WAITERS)) + goto retry_sleepq; sleepq_release(&sx->lock_object); - x = SX_READ_VALUE(sx); - continue; + CTR2(KTR_LOCK, "%s: %p claimed by new writer", + __func__, sx); + break; } /* @@ -722,11 +719,9 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, int opts LO * than loop back and retry. */ if (!(x & SX_LOCK_EXCLUSIVE_WAITERS)) { - if (!atomic_cmpset_ptr(&sx->sx_lock, x, + if (!atomic_fcmpset_ptr(&sx->sx_lock, &x, x | SX_LOCK_EXCLUSIVE_WAITERS)) { - sleepq_release(&sx->lock_object); - x = SX_READ_VALUE(sx); - continue; + goto retry_sleepq; } if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p set excl waiters flag", @@ -986,7 +981,7 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LO */ sleepq_lock(&sx->lock_object); x = SX_READ_VALUE(sx); - +retry_sleepq: /* * The lock could have been released while we spun. * In this case loop back and retry. @@ -1019,12 +1014,9 @@ _sx_slock_hard(struct sx *sx, int opts, uintptr_t x LO * back. */ if (!(x & SX_LOCK_SHARED_WAITERS)) { - if (!atomic_cmpset_ptr(&sx->sx_lock, x, - x | SX_LOCK_SHARED_WAITERS)) { - sleepq_release(&sx->lock_object); - x = SX_READ_VALUE(sx); - continue; - } + if (!atomic_fcmpset_ptr(&sx->sx_lock, &x, + x | SX_LOCK_SHARED_WAITERS)) + goto retry_sleepq; if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p set shared waiters flag", __func__, sx); From owner-svn-src-head@freebsd.org Sat Nov 25 20:13: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 60577DEEF12; Sat, 25 Nov 2017 20:13:52 +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 2AFC36C9CC; Sat, 25 Nov 2017 20:13:52 +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 vAPKDpCg013139; Sat, 25 Nov 2017 20:13:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPKDp7b013138; Sat, 25 Nov 2017 20:13:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711252013.vAPKDp7b013138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Nov 2017 20:13:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326196 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326196 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 20:13:52 -0000 Author: mjg Date: Sat Nov 25 20:13:50 2017 New Revision: 326196 URL: https://svnweb.freebsd.org/changeset/base/326196 Log: sx: change sunlock to wake waiters up if it locked sleepq sleepq is only locked if the curhtread is the last reader. By the time the lock gets acquired new ones could have arrived. The previous code would unlock and loop back. This results spurious relocking of sleepq. This is a step towards xadd-based unlock routine. Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Sat Nov 25 20:10:33 2017 (r326195) +++ head/sys/kern/kern_sx.c Sat Nov 25 20:13:50 2017 (r326196) @@ -1168,45 +1168,46 @@ static void __noinline _sx_sunlock_hard(struct sx *sx, uintptr_t x LOCK_FILE_LINE_ARG_DEF) { int wakeup_swapper; + uintptr_t setx; if (SCHEDULER_STOPPED()) return; - for (;;) { - if (_sx_sunlock_try(sx, &x)) - break; + if (_sx_sunlock_try(sx, &x)) + goto out_lockstat; - /* - * At this point, there should just be one sharer with - * exclusive waiters. - */ - MPASS(x == (SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS)); + /* + * At this point, there should just be one sharer with + * exclusive waiters. + */ + MPASS(x == (SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS)); - sleepq_lock(&sx->lock_object); - + sleepq_lock(&sx->lock_object); + x = SX_READ_VALUE(sx); + for (;;) { + MPASS(x & SX_LOCK_EXCLUSIVE_WAITERS); + MPASS(!(x & SX_LOCK_SHARED_WAITERS)); /* * Wake up semantic here is quite simple: * Just wake up all the exclusive waiters. * Note that the state of the lock could have changed, * so if it fails loop back and retry. */ - if (!atomic_cmpset_rel_ptr(&sx->sx_lock, - SX_SHARERS_LOCK(1) | SX_LOCK_EXCLUSIVE_WAITERS, - SX_LOCK_UNLOCKED)) { - sleepq_release(&sx->lock_object); - x = SX_READ_VALUE(sx); + setx = x - SX_ONE_SHARER; + setx &= ~SX_LOCK_EXCLUSIVE_WAITERS; + if (!atomic_fcmpset_rel_ptr(&sx->sx_lock, &x, setx)) continue; - } if (LOCK_LOG_TEST(&sx->lock_object, 0)) CTR2(KTR_LOCK, "%s: %p waking up all thread on" "exclusive queue", __func__, sx); wakeup_swapper = sleepq_broadcast(&sx->lock_object, SLEEPQ_SX, 0, SQ_EXCLUSIVE_QUEUE); - sleepq_release(&sx->lock_object); - if (wakeup_swapper) - kick_proc0(); break; } + sleepq_release(&sx->lock_object); + if (wakeup_swapper) + kick_proc0(); +out_lockstat: LOCKSTAT_PROFILE_RELEASE_RWLOCK(sx__release, sx, LOCKSTAT_READER); } From owner-svn-src-head@freebsd.org Sat Nov 25 20:22: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 3F559DEF2BB; Sat, 25 Nov 2017 20:22:53 +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 E45C96CF4E; Sat, 25 Nov 2017 20:22:52 +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 vAPKMp8F017459; Sat, 25 Nov 2017 20:22:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPKMpga017458; Sat, 25 Nov 2017 20:22:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711252022.vAPKMpga017458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Nov 2017 20:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326197 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 20:22:53 -0000 Author: mjg Date: Sat Nov 25 20:22:51 2017 New Revision: 326197 URL: https://svnweb.freebsd.org/changeset/base/326197 Log: rwlock: add __rw_try_{r,w}lock_int Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Nov 25 20:13:50 2017 (r326196) +++ head/sys/kern/kern_rwlock.c Sat Nov 25 20:22:51 2017 (r326197) @@ -284,9 +284,8 @@ _rw_wlock_cookie(volatile uintptr_t *c, const char *fi } int -__rw_try_wlock(volatile uintptr_t *c, const char *file, int line) +__rw_try_wlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF) { - struct rwlock *rw; struct thread *td; uintptr_t tid, v; int rval; @@ -297,8 +296,6 @@ __rw_try_wlock(volatile uintptr_t *c, const char *file if (SCHEDULER_STOPPED_TD(td)) return (1); - rw = rwlock2rw(c); - KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(td), ("rw_try_wlock() by idle thread %p on rwlock %s @ %s:%d", curthread, rw->lock_object.lo_name, file, line)); @@ -334,6 +331,15 @@ __rw_try_wlock(volatile uintptr_t *c, const char *file return (rval); } +int +__rw_try_wlock(volatile uintptr_t *c, const char *file, int line) +{ + struct rwlock *rw; + + rw = rwlock2rw(c); + return (__rw_try_wlock_int(rw, LOCK_FILE_LINE_ARG)); +} + void _rw_wunlock_cookie(volatile uintptr_t *c, const char *file, int line) { @@ -656,16 +662,13 @@ __rw_rlock(volatile uintptr_t *c, const char *file, in } int -__rw_try_rlock(volatile uintptr_t *c, const char *file, int line) +__rw_try_rlock_int(struct rwlock *rw LOCK_FILE_LINE_ARG_DEF) { - struct rwlock *rw; uintptr_t x; if (SCHEDULER_STOPPED()) return (1); - rw = rwlock2rw(c); - KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), ("rw_try_rlock() by idle thread %p on rwlock %s @ %s:%d", curthread, rw->lock_object.lo_name, file, line)); @@ -690,6 +693,15 @@ __rw_try_rlock(volatile uintptr_t *c, const char *file LOCK_LOG_TRY("RLOCK", &rw->lock_object, 0, 0, file, line); return (0); +} + +int +__rw_try_rlock(volatile uintptr_t *c, const char *file, int line) +{ + struct rwlock *rw; + + rw = rwlock2rw(c); + return (__rw_try_rlock_int(rw, LOCK_FILE_LINE_ARG)); } static bool __always_inline From owner-svn-src-head@freebsd.org Sat Nov 25 20: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 8B9DBDEF3C2; Sat, 25 Nov 2017 20:25:46 +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 55E646D0C5; Sat, 25 Nov 2017 20:25:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPKPjQN017603; Sat, 25 Nov 2017 20:25:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPKPjH6017602; Sat, 25 Nov 2017 20:25:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711252025.vAPKPjH6017602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Nov 2017 20:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326198 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 20:25:46 -0000 Author: mjg Date: Sat Nov 25 20:25:45 2017 New Revision: 326198 URL: https://svnweb.freebsd.org/changeset/base/326198 Log: rwlock: fix up compilation of the previous change commmitted wrong version of the patch Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Nov 25 20:22:51 2017 (r326197) +++ head/sys/kern/kern_rwlock.c Sat Nov 25 20:25:45 2017 (r326198) @@ -337,7 +337,7 @@ __rw_try_wlock(volatile uintptr_t *c, const char *file struct rwlock *rw; rw = rwlock2rw(c); - return (__rw_try_wlock_int(rw, LOCK_FILE_LINE_ARG)); + return (__rw_try_wlock_int(rw LOCK_FILE_LINE_ARG)); } void @@ -701,7 +701,7 @@ __rw_try_rlock(volatile uintptr_t *c, const char *file struct rwlock *rw; rw = rwlock2rw(c); - return (__rw_try_rlock_int(rw, LOCK_FILE_LINE_ARG)); + return (__rw_try_rlock_int(rw LOCK_FILE_LINE_ARG)); } static bool __always_inline From owner-svn-src-head@freebsd.org Sat Nov 25 20:37: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 9FAC3DEFB0C; Sat, 25 Nov 2017 20:37:14 +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 6A1296DADB; Sat, 25 Nov 2017 20:37:14 +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 vAPKbDBf022288; Sat, 25 Nov 2017 20:37:13 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPKbD0V022287; Sat, 25 Nov 2017 20:37:13 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711252037.vAPKbD0V022287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Nov 2017 20:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326199 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 326199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 20:37:14 -0000 Author: mjg Date: Sat Nov 25 20:37:13 2017 New Revision: 326199 URL: https://svnweb.freebsd.org/changeset/base/326199 Log: Convert in-kernel thread_lock_flags calls to thread_lock when debug is disabled The flags argument is not used in this case. Modified: head/sys/sys/mutex.h Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Sat Nov 25 20:25:45 2017 (r326198) +++ head/sys/sys/mutex.h Sat Nov 25 20:37:13 2017 (r326199) @@ -145,8 +145,14 @@ void _thread_lock(struct thread *); _thread_lock((tdp)) #endif +#if LOCK_DEBUG > 0 #define thread_lock_flags(tdp, opt) \ thread_lock_flags_((tdp), (opt), __FILE__, __LINE__) +#else +#define thread_lock_flags(tdp, opt) \ + _thread_lock(tdp) +#endif + #define thread_unlock(tdp) \ mtx_unlock_spin((tdp)->td_lock) From owner-svn-src-head@freebsd.org Sat Nov 25 20:49: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 94539DEFE56; Sat, 25 Nov 2017 20:49:28 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E8066E0BD; Sat, 25 Nov 2017 20:49:28 +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 vAPKnRTw026692; Sat, 25 Nov 2017 20:49:27 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPKnRaA026691; Sat, 25 Nov 2017 20:49:27 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201711252049.vAPKnRaA026691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sat, 25 Nov 2017 20:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326200 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 20:49:28 -0000 Author: mjg Date: Sat Nov 25 20:49:27 2017 New Revision: 326200 URL: https://svnweb.freebsd.org/changeset/base/326200 Log: Add the missing lockstat check for thread lock. Modified: head/sys/kern/kern_mutex.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Sat Nov 25 20:37:13 2017 (r326199) +++ head/sys/kern/kern_mutex.c Sat Nov 25 20:49:27 2017 (r326200) @@ -834,6 +834,8 @@ _thread_lock(struct thread *td) tid = (uintptr_t)curthread; + if (__predict_false(LOCKSTAT_PROFILE_ENABLED(spin__acquire))) + goto slowpath_noirq; spinlock_enter(); m = td->td_lock; thread_lock_validate(m, 0, file, line); @@ -855,7 +857,12 @@ _thread_lock(struct thread *td) _mtx_release_lock_quick(m); slowpath_unlocked: spinlock_exit(); +slowpath_noirq: +#if LOCK_DEBUG > 0 + thread_lock_flags_(td, opts, file, line); +#else thread_lock_flags_(td, 0, 0, 0); +#endif } #endif From owner-svn-src-head@freebsd.org Sat Nov 25 21:44: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 9A931DF0DD6; Sat, 25 Nov 2017 21:44:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 644886F9AE; Sat, 25 Nov 2017 21:44:24 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPLiNfs051614; Sat, 25 Nov 2017 21:44:23 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPLiNAI051613; Sat, 25 Nov 2017 21:44:23 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252144.vAPLiNAI051613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 21:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326202 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 326202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 21:44:24 -0000 Author: nwhitehorn Date: Sat Nov 25 21:44:23 2017 New Revision: 326202 URL: https://svnweb.freebsd.org/changeset/base/326202 Log: Automatically use the ELFv2 ABI on powerpc64 if supported by the compiler. This has the same effects on DDB working as -mcall=aixdesc, but also is supported by clang and marginally improves kernel performance. MFC after: 2 weeks Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sat Nov 25 21:29:07 2017 (r326201) +++ head/sys/conf/kern.mk Sat Nov 25 21:44:23 2017 (r326202) @@ -172,10 +172,16 @@ CFLAGS.gcc+= -mno-spe .endif # -# Use dot symbols on powerpc64 to make ddb happy +# Use dot symbols (or, better, the V2 ELF ABI) on powerpc64 to make +# DDB happy. ELFv2, if available, has some other efficiency benefits. # .if ${MACHINE_ARCH} == "powerpc64" +.if ${COMPILER_VERSION} >= 40900 +CFLAGS.gcc+= -mabi=elfv2 +.else CFLAGS.gcc+= -mcall-aixdesc +.endif +CFLAGS.clang+= -mabi=elfv2 .endif # From owner-svn-src-head@freebsd.org Sat Nov 25 21:45: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 398D2DF0E89; Sat, 25 Nov 2017 21:45:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 035246FB42; Sat, 25 Nov 2017 21:45:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPLjpJM051704; Sat, 25 Nov 2017 21:45:51 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPLjpV6051703; Sat, 25 Nov 2017 21:45:51 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252145.vAPLjpV6051703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 21:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326203 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 326203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 21:45:53 -0000 Author: nwhitehorn Date: Sat Nov 25 21:45:51 2017 New Revision: 326203 URL: https://svnweb.freebsd.org/changeset/base/326203 Log: Avoid emitting a PT_INTERP section for powerpc64 kernels and arrange for the first instruction to be at the start of the text segment. This allows the kernel to be booted correctly by stock kexec-lite. MFC after: 2 weeks Modified: head/sys/conf/ldscript.powerpc64 Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Sat Nov 25 21:44:23 2017 (r326202) +++ head/sys/conf/ldscript.powerpc64 Sat Nov 25 21:45:51 2017 (r326203) @@ -10,7 +10,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ - . = kernbase + SIZEOF_HEADERS; + . = kernbase; PROVIDE (begin = . - SIZEOF_HEADERS); .text : @@ -24,7 +24,10 @@ SECTIONS _etext = .; PROVIDE (etext = .); - .interp : { *(.interp) } + /* Do not emit PT_INTERP section, which confuses some loaders (kexec-lite) */ + .interpX : { *(.interp) } : NONE + /DISCARD/ : { *(.interp) } + .hash : { *(.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } From owner-svn-src-head@freebsd.org Sat Nov 25 21:46: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 4BE57DF0EF2; Sat, 25 Nov 2017 21:46:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 162176FC91; Sat, 25 Nov 2017 21:46:52 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPLkpC8051783; Sat, 25 Nov 2017 21:46:51 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPLkp8u051782; Sat, 25 Nov 2017 21:46:51 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252146.vAPLkp8u051782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 21:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326204 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 326204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 21:46:52 -0000 Author: nwhitehorn Date: Sat Nov 25 21:46:51 2017 New Revision: 326204 URL: https://svnweb.freebsd.org/changeset/base/326204 Log: Do not bind to CPUs with SMT, which use a different CPU numbering convention that does not play well with this driver. MFC after: 2 weeks Modified: head/sys/dev/ofw/ofw_cpu.c Modified: head/sys/dev/ofw/ofw_cpu.c ============================================================================== --- head/sys/dev/ofw/ofw_cpu.c Sat Nov 25 21:45:51 2017 (r326203) +++ head/sys/dev/ofw/ofw_cpu.c Sat Nov 25 21:46:51 2017 (r326204) @@ -191,6 +191,10 @@ ofw_cpu_probe(device_t dev) if (type == NULL || strcmp(type, "cpu") != 0) return (ENXIO); + /* Skip SMT CPUs, which we can't reasonably represent with this code */ + if (OF_hasprop(ofw_bus_get_node(dev), "ibm,ppc-interrupt-server#s")) + return (ENXIO); + device_set_desc(dev, "Open Firmware CPU"); return (0); } From owner-svn-src-head@freebsd.org Sat Nov 25 22:00: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 CCF26DF139D; Sat, 25 Nov 2017 22:00:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A434E7039A; Sat, 25 Nov 2017 22:00:01 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPM00FP056243; Sat, 25 Nov 2017 22:00:00 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPM00kU056235; Sat, 25 Nov 2017 22:00:00 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252200.vAPM00kU056235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326205 - in head/sys/powerpc: aim include mpc85xx powermac powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys/powerpc: aim include mpc85xx powermac powerpc X-SVN-Commit-Revision: 326205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:00:01 -0000 Author: nwhitehorn Date: Sat Nov 25 21:59:59 2017 New Revision: 326205 URL: https://svnweb.freebsd.org/changeset/base/326205 Log: Whether you can use mttb() or not is more complicated than whether PSL_HV is set and the right thing to do may be platform-dependent (it requires firmware on PowerNV, for instance). Make it a new platform method called platform_smp_timebase_sync(). MFC after: 3 weeks Modified: head/sys/powerpc/aim/mp_cpudep.c head/sys/powerpc/include/platform.h head/sys/powerpc/mpc85xx/platform_mpc85xx.c head/sys/powerpc/powermac/platform_powermac.c head/sys/powerpc/powerpc/mp_machdep.c head/sys/powerpc/powerpc/platform.c head/sys/powerpc/powerpc/platform_if.m Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Sat Nov 25 21:46:51 2017 (r326204) +++ head/sys/powerpc/aim/mp_cpudep.c Sat Nov 25 21:59:59 2017 (r326205) @@ -281,13 +281,8 @@ cpudep_ap_setup() vers = mfpvr() >> 16; /* The following is needed for restoring from sleep. */ -#ifdef __powerpc64__ - /* Writing to the time base register is hypervisor-privileged */ - if (mfmsr() & PSL_HV) - mttb(0); -#else - mttb(0); -#endif + platform_smp_timebase_sync(0, 1); + switch(vers) { case IBM970: case IBM970FX: Modified: head/sys/powerpc/include/platform.h ============================================================================== --- head/sys/powerpc/include/platform.h Sat Nov 25 21:46:51 2017 (r326204) +++ head/sys/powerpc/include/platform.h Sat Nov 25 21:59:59 2017 (r326205) @@ -45,6 +45,8 @@ struct mem_region { uint64_t mr_size; }; +/* Documentation for these functions is in platform_if.m */ + void mem_regions(struct mem_region **, int *, struct mem_region **, int *); vm_offset_t platform_real_maxaddr(void); @@ -54,6 +56,7 @@ int platform_smp_first_cpu(struct cpuref *); int platform_smp_next_cpu(struct cpuref *); int platform_smp_get_bsp(struct cpuref *); int platform_smp_start_cpu(struct pcpu *); +void platform_smp_timebase_sync(u_long tb, int ap); void platform_smp_ap_init(void); const char *installed_platform(void); Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Nov 25 21:46:51 2017 (r326204) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sat Nov 25 21:59:59 2017 (r326205) @@ -92,6 +92,7 @@ static int mpc85xx_smp_first_cpu(platform_t, struct cp static int mpc85xx_smp_next_cpu(platform_t, struct cpuref *cpuref); static int mpc85xx_smp_get_bsp(platform_t, struct cpuref *cpuref); static int mpc85xx_smp_start_cpu(platform_t, struct pcpu *cpu); +static void mpc85xx_smp_timebase_sync(platform_t, u_long tb, int ap); static void mpc85xx_idle(platform_t, int cpu); static int mpc85xx_idle_wakeup(platform_t plat, int cpu); @@ -107,6 +108,7 @@ static platform_method_t mpc85xx_methods[] = { PLATFORMMETHOD(platform_smp_next_cpu, mpc85xx_smp_next_cpu), PLATFORMMETHOD(platform_smp_get_bsp, mpc85xx_smp_get_bsp), PLATFORMMETHOD(platform_smp_start_cpu, mpc85xx_smp_start_cpu), + PLATFORMMETHOD(platform_smp_timebase_sync, mpc85xx_smp_timebase_sync), PLATFORMMETHOD(platform_reset, mpc85xx_reset), PLATFORMMETHOD(platform_idle, mpc85xx_idle), @@ -526,6 +528,13 @@ mpc85xx_reset(platform_t plat) printf("Reset failed...\n"); while (1) ; +} + +static void +mpc85xx_smp_timebase_sync(platform_t plat, u_long tb, int ap) +{ + + mttb(tb); } static void Modified: head/sys/powerpc/powermac/platform_powermac.c ============================================================================== --- head/sys/powerpc/powermac/platform_powermac.c Sat Nov 25 21:46:51 2017 (r326204) +++ head/sys/powerpc/powermac/platform_powermac.c Sat Nov 25 21:59:59 2017 (r326205) @@ -64,6 +64,7 @@ static int powermac_smp_first_cpu(platform_t, struct c static int powermac_smp_next_cpu(platform_t, struct cpuref *cpuref); static int powermac_smp_get_bsp(platform_t, struct cpuref *cpuref); static int powermac_smp_start_cpu(platform_t, struct pcpu *cpu); +static void powermac_smp_timebase_sync(platform_t, u_long tb, int ap); static void powermac_reset(platform_t); static void powermac_sleep(platform_t); @@ -77,6 +78,7 @@ static platform_method_t powermac_methods[] = { PLATFORMMETHOD(platform_smp_next_cpu, powermac_smp_next_cpu), PLATFORMMETHOD(platform_smp_get_bsp, powermac_smp_get_bsp), PLATFORMMETHOD(platform_smp_start_cpu, powermac_smp_start_cpu), + PLATFORMMETHOD(platform_smp_timebase_sync, powermac_smp_timebase_sync), PLATFORMMETHOD(platform_reset, powermac_reset), PLATFORMMETHOD(platform_sleep, powermac_sleep), @@ -387,6 +389,13 @@ powermac_smp_start_cpu(platform_t plat, struct pcpu *p /* No SMP support */ return (ENXIO); #endif +} + +static void +powermac_smp_timebase_sync(platform_t plat, u_long tb, int ap) +{ + + mttb(tb); } static void Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Sat Nov 25 21:46:51 2017 (r326204) +++ head/sys/powerpc/powerpc/mp_machdep.c Sat Nov 25 21:59:59 2017 (r326205) @@ -81,13 +81,7 @@ machdep_ap_bootstrap(void) ; /* Initialize DEC and TB, sync with the BSP values */ -#ifdef __powerpc64__ - /* Writing to the time base register is hypervisor-privileged */ - if (mfmsr() & PSL_HV) - mttb(ap_timebase); -#else - mttb(ap_timebase); -#endif + platform_smp_timebase_sync(ap_timebase, 1); decr_ap_init(); /* Give platform code a chance to do anything necessary */ @@ -144,7 +138,6 @@ cpu_mp_start(void) error = platform_smp_get_bsp(&bsp); KASSERT(error == 0, ("Don't know BSP")); - KASSERT(bsp.cr_cpuid == 0, ("%s: cpuid != 0", __func__)); error = platform_smp_first_cpu(&cpu); while (!error) { @@ -184,7 +177,7 @@ cpu_mp_announce(void) struct pcpu *pc; int i; - for (i = 0; i <= mp_maxid; i++) { + CPU_FOREACH(i) { pc = pcpu_find(i); if (pc == NULL) continue; @@ -246,13 +239,7 @@ cpu_mp_unleash(void *dummy) /* Let APs continue */ atomic_store_rel_int(&ap_letgo, 1); -#ifdef __powerpc64__ - /* Writing to the time base register is hypervisor-privileged */ - if (mfmsr() & PSL_HV) - mttb(ap_timebase); -#else - mttb(ap_timebase); -#endif + platform_smp_timebase_sync(ap_timebase, 0); while (ap_awake < smp_cpus) ; Modified: head/sys/powerpc/powerpc/platform.c ============================================================================== --- head/sys/powerpc/powerpc/platform.c Sat Nov 25 21:46:51 2017 (r326204) +++ head/sys/powerpc/powerpc/platform.c Sat Nov 25 21:59:59 2017 (r326205) @@ -266,6 +266,12 @@ platform_cpu_idle(int cpu) PLATFORM_IDLE(plat_obj, cpu); } +void platform_smp_timebase_sync(u_long tb, int ap) +{ + + PLATFORM_SMP_TIMEBASE_SYNC(plat_obj, tb, ap); +} + /* * Platform install routines. Highest priority wins, using the same * algorithm as bus attachment. Modified: head/sys/powerpc/powerpc/platform_if.m ============================================================================== --- head/sys/powerpc/powerpc/platform_if.m Sat Nov 25 21:46:51 2017 (r326204) +++ head/sys/powerpc/powerpc/platform_if.m Sat Nov 25 21:59:59 2017 (r326205) @@ -241,3 +241,14 @@ METHOD void sleep { platform_t _plat; }; +/** + * @brief Attempt to synchronize timebase of current CPU with others. + * Entered (approximately) simultaneously on all CPUs, including the BSP. + * Passed the timebase value on the BSP as of shortly before the call. + */ +METHOD void smp_timebase_sync { + platform_t _plat; + u_long _tb; + int _ap; +}; + From owner-svn-src-head@freebsd.org Sat Nov 25 22:01: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 23DD4DF15F0; Sat, 25 Nov 2017 22:01:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E234D706C3; Sat, 25 Nov 2017 22:01:56 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPM1tE3059951; Sat, 25 Nov 2017 22:01:55 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPM1tjj059950; Sat, 25 Nov 2017 22:01:55 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252201.vAPM1tjj059950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326206 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 326206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:01:57 -0000 Author: nwhitehorn Date: Sat Nov 25 22:01:55 2017 New Revision: 326206 URL: https://svnweb.freebsd.org/changeset/base/326206 Log: Yield while spinning on APs and avoid announcing all CPUs unless bootverbose is set. These improve startup performance on massively multithreaded systems with 8-way SMT and dozens to hundreds of CPUs. MFC after: 3 weeks Modified: head/sys/powerpc/powerpc/mp_machdep.c Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Sat Nov 25 21:59:59 2017 (r326205) +++ head/sys/powerpc/powerpc/mp_machdep.c Sat Nov 25 22:01:55 2017 (r326206) @@ -78,7 +78,8 @@ machdep_ap_bootstrap(void) __asm __volatile("msync; isync"); while (ap_letgo == 0) - ; + __asm __volatile("or 27,27,27"); + __asm __volatile("or 6,6,6"); /* Initialize DEC and TB, sync with the BSP values */ platform_smp_timebase_sync(ap_timebase, 1); @@ -176,6 +177,9 @@ cpu_mp_announce(void) { struct pcpu *pc; int i; + + if (!bootverbose) + return; CPU_FOREACH(i) { pc = pcpu_find(i); From owner-svn-src-head@freebsd.org Sat Nov 25 22:03: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 D049CDF177A; Sat, 25 Nov 2017 22:03:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A4F870AD7; Sat, 25 Nov 2017 22:03:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPM3Pxg060048; Sat, 25 Nov 2017 22:03:25 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPM3P31060047; Sat, 25 Nov 2017 22:03:25 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252203.vAPM3P31060047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326207 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 326207 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:03:26 -0000 Author: nwhitehorn Date: Sat Nov 25 22:03:25 2017 New Revision: 326207 URL: https://svnweb.freebsd.org/changeset/base/326207 Log: Preserve the LPCR on new-ish (POWER7 and POWER8) CPUs, preventing exceptions and such from ending on the wrong CPU on SMP systems. It would be good to have this be more generic somehow as POWER9s appear, but PPC does not have features bits, unfortunately. MFC after: 3 weeks Modified: head/sys/powerpc/aim/mp_cpudep.c Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Sat Nov 25 22:01:55 2017 (r326206) +++ head/sys/powerpc/aim/mp_cpudep.c Sat Nov 25 22:03:25 2017 (r326207) @@ -374,6 +374,13 @@ cpudep_ap_setup() reg = mpc74xx_l1i_enable(); break; + case IBMPOWER7: + case IBMPOWER7PLUS: + case IBMPOWER8: + case IBMPOWER8E: + if (mfmsr() & PSL_HV) + mtspr(SPR_LPCR, mfspr(SPR_LPCR) | LPCR_LPES); + break; default: #ifdef __powerpc64__ if (!(mfmsr() & PSL_HV)) /* Rely on HV to have set things up */ From owner-svn-src-head@freebsd.org Sat Nov 25 22:05: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 0C8A1DF1813; Sat, 25 Nov 2017 22:05:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA7F870C3F; Sat, 25 Nov 2017 22:05:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPM55mw060153; Sat, 25 Nov 2017 22:05:05 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPM55qT060151; Sat, 25 Nov 2017 22:05:05 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252205.vAPM55qT060151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326208 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 326208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:05:07 -0000 Author: nwhitehorn Date: Sat Nov 25 22:05:05 2017 New Revision: 326208 URL: https://svnweb.freebsd.org/changeset/base/326208 Log: Make n_slbs public in a more straightforward way. Some platforms (like PowerNV) use firmware-assisted mechanisms to discover it and need access to the variable. MFC after: 3 weeks Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_oea64.h Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Sat Nov 25 22:03:25 2017 (r326207) +++ head/sys/powerpc/aim/aim_machdep.c Sat Nov 25 22:05:05 2017 (r326208) @@ -130,7 +130,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef __powerpc64__ -extern int n_slbs; +#include "mmu_oea64.h" #endif #ifndef __powerpc64__ Modified: head/sys/powerpc/aim/mmu_oea64.h ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.h Sat Nov 25 22:03:25 2017 (r326207) +++ head/sys/powerpc/aim/mmu_oea64.h Sat Nov 25 22:05:05 2017 (r326208) @@ -81,6 +81,7 @@ extern int moea64_large_page_shift; extern uint64_t moea64_large_page_size; extern u_int moea64_pteg_count; extern u_int moea64_pteg_mask; +extern int n_slbs; #endif /* _POWERPC_AIM_MMU_OEA64_H */ From owner-svn-src-head@freebsd.org Sat Nov 25 22:06: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 6C65DDF188B; Sat, 25 Nov 2017 22:06:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3663370D95; Sat, 25 Nov 2017 22:06:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPM6eQj060222; Sat, 25 Nov 2017 22:06:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPM6e0A060221; Sat, 25 Nov 2017 22:06:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252206.vAPM6e0A060221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326209 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 326209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:06:41 -0000 Author: nwhitehorn Date: Sat Nov 25 22:06:40 2017 New Revision: 326209 URL: https://svnweb.freebsd.org/changeset/base/326209 Log: Missed platform_smp_timebase_sync() in r326205. MFC after: 3 weeks X-MFC-With: r326205 Modified: head/sys/powerpc/aim/aim_machdep.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Sat Nov 25 22:05:05 2017 (r326208) +++ head/sys/powerpc/aim/aim_machdep.c Sat Nov 25 22:06:40 2017 (r326209) @@ -595,7 +595,7 @@ cpu_sleep() while (1) mtmsr(msr); } - mttb(timebase); + platform_smp_timebase_sync(timebase, 0); PCPU_SET(curthread, curthread); PCPU_SET(curpcb, curthread->td_pcb); pmap_activate(curthread); From owner-svn-src-head@freebsd.org Sat Nov 25 22:08: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 82647DF1A61; Sat, 25 Nov 2017 22:08:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0B4710DD; Sat, 25 Nov 2017 22:08:41 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPM8eaI060323; Sat, 25 Nov 2017 22:08:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPM8e3o060321; Sat, 25 Nov 2017 22:08:40 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252208.vAPM8e3o060321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326210 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 326210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:08:41 -0000 Author: nwhitehorn Date: Sat Nov 25 22:08:40 2017 New Revision: 326210 URL: https://svnweb.freebsd.org/changeset/base/326210 Log: Definitions for registers and trap types found on new POWER CPUs. MFC after: 3 weeks Modified: head/sys/powerpc/include/spr.h head/sys/powerpc/include/trap.h Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sat Nov 25 22:06:40 2017 (r326209) +++ head/sys/powerpc/include/spr.h Sat Nov 25 22:08:40 2017 (r326210) @@ -210,6 +210,11 @@ #define EPCR_DMIUH 0x00400000 #define EPCR_PMGS 0x00200000 #define SPR_SPEFSCR 0x200 /* ..8 Signal Processing Engine FSCR. */ + +#define SPR_LPCR 0x13e /* Logical Partitioning Control */ +#define LPCR_LPES 0x008 /* Bit 60 */ +#define SPR_LPID 0x13f /* Logical Partitioning Control */ + #define SPR_IBAT0U 0x210 /* .68 Instruction BAT Reg 0 Upper */ #define SPR_IBAT0U 0x210 /* .6. Instruction BAT Reg 0 Upper */ #define SPR_IBAT0L 0x211 /* .6. Instruction BAT Reg 0 Lower */ Modified: head/sys/powerpc/include/trap.h ============================================================================== --- head/sys/powerpc/include/trap.h Sat Nov 25 22:06:40 2017 (r326209) +++ head/sys/powerpc/include/trap.h Sat Nov 25 22:08:40 2017 (r326210) @@ -77,6 +77,7 @@ #define EXC_DSMISS 0x1200 /* Data store translation miss */ /* Power ISA 2.06+: */ +#define EXC_HEA 0x0e40 /* Hypervisor Emulation Assistance */ #define EXC_VSX 0x0f40 /* VSX Unavailable */ /* The following are available on 4xx and 85xx */ From owner-svn-src-head@freebsd.org Sat Nov 25 22:10: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 63AE4DF1B37; Sat, 25 Nov 2017 22:10:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DBD771238; Sat, 25 Nov 2017 22:10:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPMABh5060439; Sat, 25 Nov 2017 22:10:11 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPMABET060438; Sat, 25 Nov 2017 22:10:11 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252210.vAPMABET060438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326211 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 326211 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:10:12 -0000 Author: nwhitehorn Date: Sat Nov 25 22:10:10 2017 New Revision: 326211 URL: https://svnweb.freebsd.org/changeset/base/326211 Log: Invalidate TLB at boot using the correct IS settings on newer-than-POWER5 CPUs. MFC after: 3 weeks Modified: head/sys/powerpc/aim/moea64_native.c Modified: head/sys/powerpc/aim/moea64_native.c ============================================================================== --- head/sys/powerpc/aim/moea64_native.c Sat Nov 25 22:08:40 2017 (r326210) +++ head/sys/powerpc/aim/moea64_native.c Sat Nov 25 22:10:10 2017 (r326211) @@ -382,7 +382,7 @@ moea64_cpu_bootstrap_native(mmu_t mmup, int ap) __asm __volatile ("slbmfee %0,%1; slbie %0;" : "=r"(seg0) : "r"(0)); - for (i = 0; i < 64; i++) { + for (i = 0; i < n_slbs; i++) { if (!(slb[i].slbe & SLBE_VALID)) continue; @@ -465,9 +465,23 @@ tlbia(void) register_t msr, scratch; #endif + i = 0xc00; /* IS = 11 */ + switch (mfpvr() >> 16) { + case IBM970: + case IBM970FX: + case IBM970MP: + case IBM970GX: + case IBMPOWER4: + case IBMPOWER4PLUS: + case IBMPOWER5: + case IBMPOWER5PLUS: + i = 0; /* IS not supported */ + break; + } + TLBSYNC(); - for (i = 0; i < 0xFF000; i += 0x00001000) { + for (; i < 0x200000; i += 0x00001000) { #ifdef __powerpc64__ __asm __volatile("tlbiel %0" :: "r"(i)); #else From owner-svn-src-head@freebsd.org Sat Nov 25 22:13: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 3AA63DF1D32; Sat, 25 Nov 2017 22:13:21 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0494371614; Sat, 25 Nov 2017 22:13:20 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPMDKIR064346; Sat, 25 Nov 2017 22:13:20 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPMDKII064345; Sat, 25 Nov 2017 22:13:20 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252213.vAPMDKII064345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326212 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 326212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:13:21 -0000 Author: nwhitehorn Date: Sat Nov 25 22:13:19 2017 New Revision: 326212 URL: https://svnweb.freebsd.org/changeset/base/326212 Log: Allow platform modules to set the size of large pizes, as potentially discovered from firmware, and better handle highly-discontiguous memory and CPU maps. MFC after: 3 weeks Modified: head/sys/powerpc/aim/mmu_oea64.c Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Sat Nov 25 22:10:10 2017 (r326211) +++ head/sys/powerpc/aim/mmu_oea64.c Sat Nov 25 22:13:19 2017 (r326212) @@ -572,8 +572,10 @@ moea64_probe_large_page(void) /* FALLTHROUGH */ default: - moea64_large_page_size = 0x1000000; /* 16 MB */ - moea64_large_page_shift = 24; + if (moea64_large_page_size == 0) { + moea64_large_page_size = 0x1000000; /* 16 MB */ + moea64_large_page_shift = 24; + } } moea64_large_page_mask = moea64_large_page_size - 1; @@ -873,9 +875,9 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelst /* * Calculate the last available physical address. */ + Maxmem = 0; for (i = 0; phys_avail[i + 2] != 0; i += 2) - ; - Maxmem = powerpc_btop(phys_avail[i + 1]); + Maxmem = max(Maxmem, powerpc_btop(phys_avail[i + 1])); /* * Initialize MMU and remap early physical mappings @@ -956,7 +958,7 @@ moea64_late_bootstrap(mmu_t mmup, vm_offset_t kernelst pa += PAGE_SIZE; va += PAGE_SIZE; } - dpcpu_init(dpcpu, 0); + dpcpu_init(dpcpu, curcpu); /* * Allocate some things for page zeroing. We put this directly From owner-svn-src-head@freebsd.org Sat Nov 25 22:14: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 79C35DF1DE5; Sat, 25 Nov 2017 22:14:31 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43DA371779; Sat, 25 Nov 2017 22:14:31 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPMEUL3064425; Sat, 25 Nov 2017 22:14:30 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPMEUNh064424; Sat, 25 Nov 2017 22:14:30 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252214.vAPMEUNh064424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326213 - head/sys/powerpc/ofw X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/ofw X-SVN-Commit-Revision: 326213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:14:31 -0000 Author: nwhitehorn Date: Sat Nov 25 22:14:30 2017 New Revision: 326213 URL: https://svnweb.freebsd.org/changeset/base/326213 Log: When booting from an FDT, make sure the FDT itself isn't included the range of available memory. Boot loaders are supposed to add a reserved entry for it, but not all do. MFC after: 2 weeks Modified: head/sys/powerpc/ofw/ofw_machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Sat Nov 25 22:13:19 2017 (r326212) +++ head/sys/powerpc/ofw/ofw_machdep.c Sat Nov 25 22:14:30 2017 (r326213) @@ -65,6 +65,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + static void *fdt; int ofw_real_mode; @@ -233,8 +235,17 @@ excise_fdt_reserved(struct mem_region *avail, int asz) fdtmapsize = OF_getprop(chosen, "fdtmemreserv", fdtmap, sizeof(fdtmap)); for (j = 0; j < fdtmapsize/sizeof(fdtmap[0]); j++) { - fdtmap[j].address = be64toh(fdtmap[j].address); - fdtmap[j].size = be64toh(fdtmap[j].size); + fdtmap[j].address = be64toh(fdtmap[j].address) & ~PAGE_MASK; + fdtmap[j].size = round_page(be64toh(fdtmap[j].size)); + } + + KASSERT(j*sizeof(fdtmap[0]) < sizeof(fdtmap), + ("Exceeded number of FDT reservations")); + /* Add a virtual entry for the FDT itself */ + if (fdt != NULL) { + fdtmap[j].address = (vm_offset_t)fdt & ~PAGE_MASK; + fdtmap[j].size = round_page(fdt_totalsize(fdt)); + fdtmapsize += sizeof(fdtmap[0]); } for (i = 0; i < asz; i++) { From owner-svn-src-head@freebsd.org Sat Nov 25 22:15: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 5D923DF1EAD; Sat, 25 Nov 2017 22:15:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 283BE719AB; Sat, 25 Nov 2017 22:15:57 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPMFuVR064728; Sat, 25 Nov 2017 22:15:56 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPMFuNk064727; Sat, 25 Nov 2017 22:15:56 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252215.vAPMFuNk064727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326214 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 326214 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:15:57 -0000 Author: nwhitehorn Date: Sat Nov 25 22:15:56 2017 New Revision: 326214 URL: https://svnweb.freebsd.org/changeset/base/326214 Log: Missed gate on __powerpc64__ for setting LPCR in r326207. MFC after: 3 weeks X-MFC-with: r326207 Modified: head/sys/powerpc/aim/mp_cpudep.c Modified: head/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- head/sys/powerpc/aim/mp_cpudep.c Sat Nov 25 22:14:30 2017 (r326213) +++ head/sys/powerpc/aim/mp_cpudep.c Sat Nov 25 22:15:56 2017 (r326214) @@ -378,8 +378,10 @@ cpudep_ap_setup() case IBMPOWER7PLUS: case IBMPOWER8: case IBMPOWER8E: +#ifdef __powerpc64__ if (mfmsr() & PSL_HV) mtspr(SPR_LPCR, mfspr(SPR_LPCR) | LPCR_LPES); +#endif break; default: #ifdef __powerpc64__ From owner-svn-src-head@freebsd.org Sat Nov 25 22:42: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 28562DF26BE; Sat, 25 Nov 2017 22:42:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8864726B5; Sat, 25 Nov 2017 22:42:06 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPMg6lM076197; Sat, 25 Nov 2017 22:42:06 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPMg61g076195; Sat, 25 Nov 2017 22:42:06 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252242.vAPMg61g076195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326215 - in head/sys/powerpc: include powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys/powerpc: include powerpc X-SVN-Commit-Revision: 326215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:42:07 -0000 Author: nwhitehorn Date: Sat Nov 25 22:42:05 2017 New Revision: 326215 URL: https://svnweb.freebsd.org/changeset/base/326215 Log: Return base IRQ of PIC when added and massively increase the number of available IRQs per PIC for large systems. MFC after: 3 weeks Modified: head/sys/powerpc/include/intr_machdep.h head/sys/powerpc/powerpc/intr_machdep.c Modified: head/sys/powerpc/include/intr_machdep.h ============================================================================== --- head/sys/powerpc/include/intr_machdep.h Sat Nov 25 22:15:56 2017 (r326214) +++ head/sys/powerpc/include/intr_machdep.h Sat Nov 25 22:42:05 2017 (r326215) @@ -46,7 +46,7 @@ driver_filter_t powerpc_ipi_handler; void intrcnt_add(const char *name, u_long **countp); -void powerpc_register_pic(device_t, uint32_t, u_int, u_int, u_int); +u_int powerpc_register_pic(device_t, uint32_t, u_int, u_int, u_int); u_int powerpc_get_irq(uint32_t, u_int); void powerpc_dispatch_intr(u_int, struct trapframe *); Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Sat Nov 25 22:15:56 2017 (r326214) +++ head/sys/powerpc/powerpc/intr_machdep.c Sat Nov 25 22:42:05 2017 (r326215) @@ -157,7 +157,7 @@ smp_intr_init(void *dummy __unused) for (vector = 0; vector < nvectors; vector++) { i = powerpc_intrs[vector]; - if (i != NULL && i->pic == root_pic) + if (i != NULL && i->event != NULL && i->pic == root_pic) PIC_BIND(i->pic, i->intline, i->cpu); } } @@ -319,7 +319,7 @@ powerpc_assign_intr_cpu(void *arg, int cpu) #endif } -void +u_int powerpc_register_pic(device_t dev, uint32_t node, u_int irqs, u_int ipis, u_int atpic) { @@ -358,6 +358,8 @@ powerpc_register_pic(device_t dev, uint32_t node, u_in ("Number of PICs exceeds maximum (%d)", MAX_PICS)); mtx_unlock(&intr_table_lock); + + return (p->base); } u_int @@ -387,7 +389,7 @@ powerpc_get_irq(uint32_t node, u_int pin) piclist[idx].irqs = 124; piclist[idx].ipis = 4; piclist[idx].base = nirqs; - nirqs += 128; + nirqs += (1 << 25); npics++; KASSERT(npics < MAX_PICS, From owner-svn-src-head@freebsd.org Sat Nov 25 22:43: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 E6AA6DF2778; Sat, 25 Nov 2017 22:43:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B31CE72852; Sat, 25 Nov 2017 22:43:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPMhqIQ077163; Sat, 25 Nov 2017 22:43:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPMhqqV077162; Sat, 25 Nov 2017 22:43:52 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252243.vAPMhqqV077162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 22:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326216 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 326216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 22:43:54 -0000 Author: nwhitehorn Date: Sat Nov 25 22:43:52 2017 New Revision: 326216 URL: https://svnweb.freebsd.org/changeset/base/326216 Log: On AIM systems, it is not actually possible to stop the CPU timer, so we just set it to a large default value (and inherit any previously existing value), hoping it never turns over. Instead, silently allow spurious one-shots from rollovers. MFC after: 10 days Modified: head/sys/powerpc/powerpc/clock.c Modified: head/sys/powerpc/powerpc/clock.c ============================================================================== --- head/sys/powerpc/powerpc/clock.c Sat Nov 25 22:42:05 2017 (r326215) +++ head/sys/powerpc/powerpc/clock.c Sat Nov 25 22:43:52 2017 (r326216) @@ -141,6 +141,9 @@ decr_intr(struct trapframe *frame) } else if (s->mode == 2) { nticks = 1; decr_et_stop(NULL); + } else if (s->mode == 0) { + /* Potemkin timer ran out without an event. Just reset it. */ + decr_et_stop(NULL); } while (nticks-- > 0) { From owner-svn-src-head@freebsd.org Sat Nov 25 23: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 4111BDF34BC; Sat, 25 Nov 2017 23:23:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AE9873C65; Sat, 25 Nov 2017 23:23:26 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPNNP3b093842; Sat, 25 Nov 2017 23:23:25 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPNNP6v093840; Sat, 25 Nov 2017 23:23:25 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252323.vAPNNP6v093840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 23:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326217 - in head/sys/powerpc: ofw powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys/powerpc: ofw powerpc X-SVN-Commit-Revision: 326217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 23:23:26 -0000 Author: nwhitehorn Date: Sat Nov 25 23:23:24 2017 New Revision: 326217 URL: https://svnweb.freebsd.org/changeset/base/326217 Log: Avoid assumptions about the BSP being CPU 0. MFC after: 3 weeks Modified: head/sys/powerpc/ofw/ofw_machdep.c head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/ofw/ofw_machdep.c ============================================================================== --- head/sys/powerpc/ofw/ofw_machdep.c Sat Nov 25 22:43:52 2017 (r326216) +++ head/sys/powerpc/ofw/ofw_machdep.c Sat Nov 25 23:23:24 2017 (r326217) @@ -530,11 +530,16 @@ openfirmware(void *args) return (-1); #ifdef SMP - rv_args.args = args; - rv_args.in_progress = 1; - smp_rendezvous(smp_no_rendezvous_barrier, ofw_rendezvous_dispatch, - smp_no_rendezvous_barrier, &rv_args); - result = rv_args.retval; + if (cold) { + result = openfirmware_core(args); + } else { + rv_args.args = args; + rv_args.in_progress = 1; + smp_rendezvous(smp_no_rendezvous_barrier, + ofw_rendezvous_dispatch, smp_no_rendezvous_barrier, + &rv_args); + result = rv_args.retval; + } #else result = openfirmware_core(args); #endif Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Sat Nov 25 22:43:52 2017 (r326216) +++ head/sys/powerpc/powerpc/machdep.c Sat Nov 25 23:23:24 2017 (r326217) @@ -235,9 +235,10 @@ uintptr_t powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp) { struct pcpu *pc; + struct cpuref bsp; vm_offset_t startkernel, endkernel; void *kmdp; - char *env; + char *env; bool ofw_bootargs = false; #ifdef DDB vm_offset_t ksym_start; @@ -311,32 +312,20 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs */ proc_linkup0(&proc0, &thread0); thread0.td_frame = &frame0; - - /* - * Set up per-cpu data. - */ - pc = __pcpu; - pcpu_init(pc, 0, sizeof(struct pcpu)); - pc->pc_curthread = &thread0; #ifdef __powerpc64__ - __asm __volatile("mr 13,%0" :: "r"(pc->pc_curthread)); + __asm __volatile("mr 13,%0" :: "r"(&thread0)); #else - __asm __volatile("mr 2,%0" :: "r"(pc->pc_curthread)); + __asm __volatile("mr 2,%0" :: "r"(&thread0)); #endif - pc->pc_cpuid = 0; - __asm __volatile("mtsprg 0, %0" :: "r"(pc)); - /* * Init mutexes, which we use heavily in PMAP */ - mutex_init(); /* * Install the OF client interface */ - OF_bootstrap(); if (ofw_bootargs) @@ -347,19 +336,6 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs */ cninit(); - /* - * Complain if there is no metadata. - */ - if (mdp == NULL || kmdp == NULL) { - printf("powerpc_init: no loader metadata.\n"); - } - - /* - * Init KDB - */ - - kdb_init(); - #ifdef AIM aim_cpu_init(toc); #else /* BOOKE */ @@ -374,6 +350,25 @@ powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offs */ platform_probe_and_attach(); + + /* + * Set up real per-cpu data. + */ + if (platform_smp_get_bsp(&bsp) != 0) + bsp.cr_cpuid = 0; + pc = &__pcpu[bsp.cr_cpuid]; + pcpu_init(pc, bsp.cr_cpuid, sizeof(struct pcpu)); + pc->pc_curthread = &thread0; + thread0.td_oncpu = bsp.cr_cpuid; + pc->pc_cpuid = bsp.cr_cpuid; + pc->pc_hwref = bsp.cr_hwref; + pc->pc_pir = mfspr(SPR_PIR); + __asm __volatile("mtsprg 0, %0" :: "r"(pc)); + + /* + * Init KDB + */ + kdb_init(); /* * Bring up MMU From owner-svn-src-head@freebsd.org Sat Nov 25 23:41: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 48A9DDF38D4; Sat, 25 Nov 2017 23:41:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 21FDE74210; Sat, 25 Nov 2017 23:41:07 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAPNf68q001470; Sat, 25 Nov 2017 23:41:06 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAPNf5Qx001464; Sat, 25 Nov 2017 23:41:05 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201711252341.vAPNf5Qx001464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sat, 25 Nov 2017 23:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326218 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: 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, 25 Nov 2017 23:41:07 -0000 Author: nwhitehorn Date: Sat Nov 25 23:41:05 2017 New Revision: 326218 URL: https://svnweb.freebsd.org/changeset/base/326218 Log: Remove some, but not all, assumptions that the BSP is CPU 0 and that CPUs are numbered densely from there to n_cpus. MFC after: 1 month Modified: head/sys/kern/kern_clock.c head/sys/kern/kern_clocksource.c head/sys/kern/kern_shutdown.c head/sys/kern/kern_timeout.c head/sys/kern/sched_ule.c head/sys/kern/subr_pcpu.c Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Sat Nov 25 23:23:24 2017 (r326217) +++ head/sys/kern/kern_clock.c Sat Nov 25 23:41:05 2017 (r326218) @@ -573,7 +573,9 @@ hardclock_cnt(int cnt, int usermode) void hardclock_sync(int cpu) { - int *t = DPCPU_ID_PTR(cpu, pcputicks); + int *t; + KASSERT(!CPU_ABSENT(cpu), ("Absent CPU %d", cpu)); + t = DPCPU_ID_PTR(cpu, pcputicks); *t = ticks; } Modified: head/sys/kern/kern_clocksource.c ============================================================================== --- head/sys/kern/kern_clocksource.c Sat Nov 25 23:23:24 2017 (r326217) +++ head/sys/kern/kern_clocksource.c Sat Nov 25 23:41:05 2017 (r326218) @@ -822,6 +822,8 @@ cpu_new_callout(int cpu, sbintime_t bt, sbintime_t bt_ CTR6(KTR_SPARE2, "new co at %d: on %d at %d.%08x - %d.%08x", curcpu, cpu, (int)(bt_opt >> 32), (u_int)(bt_opt & 0xffffffff), (int)(bt >> 32), (u_int)(bt & 0xffffffff)); + + KASSERT(!CPU_ABSENT(cpu), ("Absent CPU %d", cpu)); state = DPCPU_ID_PTR(cpu, timerstate); ET_HW_LOCK(state); Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat Nov 25 23:23:24 2017 (r326217) +++ head/sys/kern/kern_shutdown.c Sat Nov 25 23:41:05 2017 (r326218) @@ -373,15 +373,16 @@ kern_reboot(int howto) #if defined(SMP) /* - * Bind us to CPU 0 so that all shutdown code runs there. Some + * Bind us to the first CPU so that all shutdown code runs there. Some * systems don't shutdown properly (i.e., ACPI power off) if we * run on another processor. */ if (!SCHEDULER_STOPPED()) { thread_lock(curthread); - sched_bind(curthread, 0); + sched_bind(curthread, CPU_FIRST()); thread_unlock(curthread); - KASSERT(PCPU_GET(cpuid) == 0, ("boot: not running on cpu 0")); + KASSERT(PCPU_GET(cpuid) == CPU_FIRST(), + ("boot: not running on cpu 0")); } #endif /* We're in the process of rebooting. */ Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Sat Nov 25 23:23:24 2017 (r326217) +++ head/sys/kern/kern_timeout.c Sat Nov 25 23:41:05 2017 (r326218) @@ -264,7 +264,7 @@ cc_cce_migrating(struct callout_cpu *cc, int direct) /* * Kernel low level callwheel initialization - * called on cpu0 during kernel startup. + * called on the BSP during kernel startup. */ static void callout_callwheel_init(void *dummy) @@ -277,7 +277,7 @@ callout_callwheel_init(void *dummy) * XXX: Clip callout to result of previous function of maxusers * maximum 384. This is still huge, but acceptable. */ - memset(CC_CPU(0), 0, sizeof(cc_cpu)); + memset(CC_CPU(curcpu), 0, sizeof(cc_cpu)); ncallout = imin(16 + maxproc + maxfiles, 18508); TUNABLE_INT_FETCH("kern.ncallout", &ncallout); @@ -295,7 +295,7 @@ callout_callwheel_init(void *dummy) TUNABLE_INT_FETCH("kern.pin_pcpu_swi", &pin_pcpu_swi); /* - * Only cpu0 handles timeout(9) and receives a preallocation. + * Only BSP handles timeout(9) and receives a preallocation. * * XXX: Once all timeout(9) consumers are converted this can * be removed. @@ -330,7 +330,7 @@ callout_cpu_init(struct callout_cpu *cc, int cpu) cc_cce_cleanup(cc, i); snprintf(cc->cc_ktr_event_name, sizeof(cc->cc_ktr_event_name), "callwheel cpu %d", cpu); - if (cc->cc_callout == NULL) /* Only cpu0 handles timeout(9) */ + if (cc->cc_callout == NULL) /* Only BSP handles timeout(9) */ return; for (i = 0; i < ncallout; i++) { c = &cc->cc_callout[i]; @@ -400,7 +400,7 @@ start_softclock(void *dummy) if (cpu == timeout_cpu) continue; cc = CC_CPU(cpu); - cc->cc_callout = NULL; /* Only cpu0 handles timeout(9). */ + cc->cc_callout = NULL; /* Only BSP handles timeout(9). */ callout_cpu_init(cc, cpu); snprintf(name, sizeof(name), "clock (%d)", cpu); ie = NULL; Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Sat Nov 25 23:23:24 2017 (r326217) +++ head/sys/kern/sched_ule.c Sat Nov 25 23:41:05 2017 (r326218) @@ -1224,6 +1224,8 @@ sched_pickcpu(struct thread *td, int flags) self = PCPU_GET(cpuid); ts = td_get_sched(td); + KASSERT(!CPU_ABSENT(ts->ts_cpu), ("sched_pickcpu: Start scheduler on " + "absent CPU %d for thread %s.", ts->ts_cpu, td->td_name)); if (smp_started == 0) return (self); /* @@ -1294,6 +1296,7 @@ sched_pickcpu(struct thread *td, int flags) if (cpu == -1) cpu = sched_lowest(cpu_top, mask, -1, INT_MAX, ts->ts_cpu); KASSERT(cpu != -1, ("sched_pickcpu: Failed to find a cpu.")); + KASSERT(!CPU_ABSENT(cpu), ("sched_pickcpu: Picked absent CPU %d.", cpu)); /* * Compare the lowest loaded cpu to current cpu. */ @@ -1400,6 +1403,7 @@ sched_setup(void *dummy) /* Add thread0's load since it's running. */ TDQ_LOCK(tdq); + td_get_sched(&thread0)->ts_cpu = curcpu; /* Something valid to start */ thread0.td_lock = TDQ_LOCKPTR(TDQ_SELF()); tdq_load_add(tdq, &thread0); tdq->tdq_lowpri = thread0.td_priority; @@ -1837,6 +1841,9 @@ sched_switch_migrate(struct tdq *tdq, struct thread *t { struct tdq *tdn; + KASSERT(!CPU_ABSENT(td_get_sched(td)->ts_cpu), ("sched_switch_migrate: " + "thread %s queued on absent CPU %d.", td->td_name, + td_get_sched(td)->ts_cpu)); tdn = TDQ_CPU(td_get_sched(td)->ts_cpu); #ifdef SMP tdq_load_rem(tdq, td); @@ -2444,6 +2451,7 @@ sched_add(struct thread *td, int flags) * Pick the destination cpu and if it isn't ours transfer to the * target cpu. */ + td_get_sched(td)->ts_cpu = curcpu; /* Pick something valid to start */ cpu = sched_pickcpu(td, flags); tdq = sched_setcpu(td, cpu, flags); tdq_add(tdq, td, flags); Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Sat Nov 25 23:23:24 2017 (r326217) +++ head/sys/kern/subr_pcpu.c Sat Nov 25 23:41:05 2017 (r326218) @@ -279,6 +279,8 @@ pcpu_destroy(struct pcpu *pcpu) struct pcpu * pcpu_find(u_int cpuid) { + KASSERT(cpuid_to_pcpu[cpuid] != NULL, + ("Getting uninitialized PCPU %d", cpuid)); return (cpuid_to_pcpu[cpuid]); } @@ -409,7 +411,7 @@ DB_SHOW_ALL_COMMAND(pcpu, db_show_cpu_all) int id; db_printf("Current CPU: %d\n\n", PCPU_GET(cpuid)); - for (id = 0; id <= mp_maxid; id++) { + CPU_FOREACH(id) { pc = pcpu_find(id); if (pc != NULL) { show_pcpu(pc);