From owner-svn-src-all@freebsd.org Sun Aug 2 04:25:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AAB1370E4C; Sun, 2 Aug 2020 04:25:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BK7Gg0Qkyz44Gj; Sun, 2 Aug 2020 04:25:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E59591E19A; Sun, 2 Aug 2020 04:25:14 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0724PENa050127; Sun, 2 Aug 2020 04:25:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0724PCxX050114; Sun, 2 Aug 2020 04:25:12 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008020425.0724PCxX050114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 2 Aug 2020 04:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363768 - in stable/12: contrib/ipfilter/iplang contrib/ipfilter/ipsend libexec/rc/rc.d sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/12: contrib/ipfilter/iplang contrib/ipfilter/ipsend libexec/rc/rc.d sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 363768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 04:25:15 -0000 Author: cy Date: Sun Aug 2 04:25:11 2020 New Revision: 363768 URL: https://svnweb.freebsd.org/changeset/base/363768 Log: MFC r363284-r363285, r363452, r363670 r363284: pfil_run_hooks() can be called recursively, so we have to define FASTROUTE_RECURSION in fil.c Submitted by: christos@NetBSD.org Reported by: christos@NetBSD.org Obtained from: NetBSD r1.31 r363285: Fix incorrect byte order in ipfstat -f output. - make sure frag is initialized to 0 - initialize ipfr_p field NetBSD PR: 55137 Submitted by: christos@NetBSD.org Reported by: christos@NetBSD.org Obtained from: NetBSD fil.c r1.32, ip_frag.c r1.8 r363452: Load ipfilter, ipnat, and ippool rules, and start ipmon in a vnet jail. PR: 248109 Reported by: joeb1@a1poweruser.com r363670: Continued ipfilter #ifdef cleanup. The r343701 log entry contains a complete description. Modified: stable/12/contrib/ipfilter/iplang/iplang_y.y stable/12/contrib/ipfilter/ipsend/arp.c stable/12/contrib/ipfilter/ipsend/ipresend.c stable/12/contrib/ipfilter/ipsend/ipsend.c stable/12/contrib/ipfilter/ipsend/iptest.c stable/12/contrib/ipfilter/ipsend/iptests.c stable/12/contrib/ipfilter/ipsend/sock.c stable/12/libexec/rc/rc.d/ipfilter stable/12/libexec/rc/rc.d/ipmon stable/12/libexec/rc/rc.d/ipnat stable/12/libexec/rc/rc.d/ippool stable/12/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/ip_frag.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/ipfilter/iplang/iplang_y.y ============================================================================== --- stable/12/contrib/ipfilter/iplang/iplang_y.y Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/contrib/ipfilter/iplang/iplang_y.y Sun Aug 2 04:25:11 2020 (r363768) @@ -45,11 +45,6 @@ #include "ipf.h" #include "iplang.h" -#if !defined(__NetBSD__) && (!defined(__FreeBSD_version) && \ - __FreeBSD_version < 400020) && (!SOLARIS || SOLARIS2 < 10) -extern struct ether_addr *ether_aton __P((char *)); -#endif - extern int opts; extern struct ipopt_names ionames[]; extern int state, state, lineNum, token; @@ -58,11 +53,7 @@ extern char yytext[]; extern FILE *yyin; int yylex __P((void)); #define YYDEBUG 1 -#if !defined(ultrix) && !defined(hpux) int yydebug = 1; -#else -extern int yydebug; -#endif iface_t *iflist = NULL, **iftail = &iflist; iface_t *cifp = NULL; Modified: stable/12/contrib/ipfilter/ipsend/arp.c ============================================================================== --- stable/12/contrib/ipfilter/ipsend/arp.c Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/contrib/ipfilter/ipsend/arp.c Sun Aug 2 04:25:11 2020 (r363768) @@ -11,17 +11,13 @@ static const char rcsid[] = "@(#)$Id$"; #endif #include #include -#if !defined(ultrix) && !defined(hpux) && !defined(__hpux) && !defined(__osf__) && !defined(_AIX51) # include -#endif #include #include #include #include #include -#ifndef ultrix # include -#endif #include #include #include Modified: stable/12/contrib/ipfilter/ipsend/ipresend.c ============================================================================== --- stable/12/contrib/ipfilter/ipsend/ipresend.c Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/contrib/ipfilter/ipsend/ipresend.c Sun Aug 2 04:25:11 2020 (r363768) @@ -38,15 +38,7 @@ int opts = 0; # ifdef sun char default_device[] = "le0"; # else -# ifdef ultrix -char default_device[] = "ln0"; -# else -# ifdef __bsdi__ -char default_device[] = "ef0"; -# else char default_device[] = "lan0"; -# endif -# endif # endif #else char default_device[] = DEFAULT_DEVICE; Modified: stable/12/contrib/ipfilter/ipsend/ipsend.c ============================================================================== --- stable/12/contrib/ipfilter/ipsend/ipsend.c Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/contrib/ipfilter/ipsend/ipsend.c Sun Aug 2 04:25:11 2020 (r363768) @@ -33,15 +33,7 @@ extern void iplang __P((FILE *)); char options[68]; int opts; -# ifdef ultrix -char default_device[] = "ln0"; -# else -# ifdef __bsdi__ -char default_device[] = "ef0"; -# else char default_device[] = "le0"; -# endif /* __bsdi__ */ -# endif /* ultrix */ static void usage __P((char *)); Modified: stable/12/contrib/ipfilter/ipsend/iptest.c ============================================================================== --- stable/12/contrib/ipfilter/ipsend/iptest.c Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/contrib/ipfilter/ipsend/iptest.c Sun Aug 2 04:25:11 2020 (r363768) @@ -34,15 +34,7 @@ char options[68]; # ifdef sun char default_device[] = "le0"; # else -# ifdef ultrix -char default_device[] = "ln0"; -# else -# ifdef __bsdi__ -char default_device[] = "ef0"; -# else char default_device[] = "lan0"; -# endif -# endif # endif static void usage __P((char *)); Modified: stable/12/contrib/ipfilter/ipsend/iptests.c ============================================================================== --- stable/12/contrib/ipfilter/ipsend/iptests.c Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/contrib/ipfilter/ipsend/iptests.c Sun Aug 2 04:25:11 2020 (r363768) @@ -36,18 +36,13 @@ typedef int boolean_t; # endif # undef _KERNEL # undef KERNEL -#if !defined(solaris) && !defined(linux) && !defined(__sgi) +#if !defined(solaris) # include # include # include #endif -#if !defined(ultrix) && !defined(hpux) && !defined(linux) && \ - !defined(__sgi) && !defined(__osf__) && !defined(_AIX51) # include -#endif -#ifndef ultrix # include -#endif #if defined(solaris) # include #else @@ -57,11 +52,9 @@ typedef int boolean_t; #include #include #endif -#if BSD >= 199103 # include # include # include -#endif #include #include #include @@ -74,7 +67,7 @@ typedef int boolean_t; #include #include #include -#if defined(__SVR4) || defined(__svr4__) || defined(__sgi) +#if defined(__SVR4) || defined(__svr4__) # include #endif #include @@ -82,7 +75,7 @@ typedef int boolean_t; #include #include # include -# if !defined(__hpux) && !defined(solaris) +# if !defined(solaris) # include # endif #include "ipsend.h" Modified: stable/12/contrib/ipfilter/ipsend/sock.c ============================================================================== --- stable/12/contrib/ipfilter/ipsend/sock.c Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/contrib/ipfilter/ipsend/sock.c Sun Aug 2 04:25:11 2020 (r363768) @@ -21,14 +21,8 @@ static const char rcsid[] = "@(#)$Id$"; */ typedef int boolean_t; #endif -#ifndef ultrix #include -#endif -#if (__FreeBSD_version >= 300000) # include -#else -# include -#endif # ifdef __NetBSD__ # include # endif @@ -38,10 +32,6 @@ typedef int boolean_t; # define _KERNEL # define KERNEL # endif -# ifdef ultrix -# undef LOCORE -# include -# endif # include # ifdef __FreeBSD__ # undef _WANT_FILE @@ -54,18 +44,14 @@ typedef int boolean_t; #include #include #include -#if !defined(ultrix) && !defined(hpux) && !defined(__osf__) # include -#endif #ifdef sun #include #include #endif -#if BSD >= 199103 #include #include #include -#endif #include #include #include @@ -143,128 +129,10 @@ int kmemcpy(buf, pos, n) struct nlist names[4] = { { "_proc" }, { "_nproc" }, -#ifdef ultrix - { "_u" }, -#else { NULL }, -#endif { NULL } }; -#if BSD < 199103 -static struct proc *getproc() -{ - struct proc *p; - pid_t pid = getpid(); - int siz, n; - - n = nlist(KERNEL, names); - if (n != 0) - { - fprintf(stderr, "nlist(%#x) == %d\n", names, n); - return NULL; - } - if (KMCPY(&nproc, names[1].n_value, sizeof(nproc)) == -1) - { - fprintf(stderr, "read nproc (%#x)\n", names[1].n_value); - return NULL; - } - siz = nproc * sizeof(struct proc); - if (KMCPY(&p, names[0].n_value, sizeof(p)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) proc\n", - names[0].n_value, &p, sizeof(p)); - return NULL; - } - proc = (struct proc *)malloc(siz); - if (KMCPY(proc, p, siz) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) proc\n", - p, proc, siz); - return NULL; - } - - p = proc; - - for (n = nproc; n; n--, p++) - if (p->p_pid == pid) - break; - if (!n) - return NULL; - - return p; -} - - -struct tcpcb *find_tcp(fd, ti) - int fd; - struct tcpiphdr *ti; -{ - struct tcpcb *t; - struct inpcb *i; - struct socket *s; - struct user *up; - struct proc *p; - struct file *f, **o; - - if (!(p = getproc())) - return NULL; - up = (struct user *)malloc(sizeof(*up)); -#ifndef ultrix - if (KMCPY(up, p->p_uarea, sizeof(*up)) == -1) - { - fprintf(stderr, "read(%#x,%#x) failed\n", p, p->p_uarea); - return NULL; - } -#else - if (KMCPY(up, names[2].n_value, sizeof(*up)) == -1) - { - fprintf(stderr, "read(%#x,%#x) failed\n", p, names[2].n_value); - return NULL; - } -#endif - - o = (struct file **)calloc(up->u_lastfile + 1, sizeof(*o)); - if (KMCPY(o, up->u_ofile, (up->u_lastfile + 1) * sizeof(*o)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - u_ofile - failed\n", - up->u_ofile, o, sizeof(*o)); - return NULL; - } - f = (struct file *)calloc(1, sizeof(*f)); - if (KMCPY(f, o[fd], sizeof(*f)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - o[fd] - failed\n", - up->u_ofile[fd], f, sizeof(*f)); - return NULL; - } - - s = (struct socket *)calloc(1, sizeof(*s)); - if (KMCPY(s, f->f_data, sizeof(*s)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - f_data - failed\n", - o[fd], s, sizeof(*s)); - return NULL; - } - - i = (struct inpcb *)calloc(1, sizeof(*i)); - if (KMCPY(i, s->so_pcb, sizeof(*i)) == -1) - { - fprintf(stderr, "kvm_read(%#x,%#x,%d) - so_pcb - failed\n", - s->so_pcb, i, sizeof(*i)); - return NULL; - } - - t = (struct tcpcb *)calloc(1, sizeof(*t)); - if (KMCPY(t, i->inp_ppcb, sizeof(*t)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - inp_ppcb - failed\n", - i->inp_ppcb, t, sizeof(*t)); - return NULL; - } - return (struct tcpcb *)i->inp_ppcb; -} -#else static struct kinfo_proc *getproc() { static struct kinfo_proc kp; @@ -304,7 +172,7 @@ struct tcpcb *find_tcp(tfd, ti) fd = (struct filedesc *)malloc(sizeof(*fd)); if (fd == NULL) return NULL; -#if defined( __FreeBSD_version) && __FreeBSD_version >= 500013 +#if defined( __FreeBSD_version) if (KMCPY(fd, p->ki_fd, sizeof(*fd)) == -1) { fprintf(stderr, "read(%#lx,%#lx) failed\n", @@ -381,7 +249,6 @@ finderror: free(t); return NULL; } -#endif /* BSD < 199301 */ int do_socket(dev, mtu, ti, gwip) char *dev; Modified: stable/12/libexec/rc/rc.d/ipfilter ============================================================================== --- stable/12/libexec/rc/rc.d/ipfilter Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/libexec/rc/rc.d/ipfilter Sun Aug 2 04:25:11 2020 (r363768) @@ -5,7 +5,7 @@ # PROVIDE: ipfilter # REQUIRE: FILESYSTEMS -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr Modified: stable/12/libexec/rc/rc.d/ipmon ============================================================================== --- stable/12/libexec/rc/rc.d/ipmon Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/libexec/rc/rc.d/ipmon Sun Aug 2 04:25:11 2020 (r363768) @@ -6,7 +6,7 @@ # PROVIDE: ipmon # REQUIRE: FILESYSTEMS hostname sysctl ipfilter # BEFORE: SERVERS -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr Modified: stable/12/libexec/rc/rc.d/ipnat ============================================================================== --- stable/12/libexec/rc/rc.d/ipnat Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/libexec/rc/rc.d/ipnat Sun Aug 2 04:25:11 2020 (r363768) @@ -5,7 +5,7 @@ # PROVIDE: ipnat # REQUIRE: ipfilter -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr Modified: stable/12/libexec/rc/rc.d/ippool ============================================================================== --- stable/12/libexec/rc/rc.d/ippool Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/libexec/rc/rc.d/ippool Sun Aug 2 04:25:11 2020 (r363768) @@ -6,7 +6,7 @@ # PROVIDE: ippool # REQUIRE: FILESYSTEMS # BEFORE: ipfilter -# KEYWORD: nojail +# KEYWORD: nojailvnet . /etc/rc.subr Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Sun Aug 2 04:25:11 2020 (r363768) @@ -115,6 +115,8 @@ extern int opts; extern int blockreason; #endif /* _KERNEL */ +#define FASTROUTE_RECURSION + #define LBUMP(x) softc->x++ #define LBUMPD(x, y) do { softc->x.y++; DT(y); } while (0) @@ -1696,7 +1698,7 @@ ipf_pr_ipv4hdr(fin) fi->fi_p = p; fin->fin_crc = p; fi->fi_tos = ip->ip_tos; - fin->fin_id = ip->ip_id; + fin->fin_id = ntohs(ip->ip_id); off = ntohs(ip->ip_off); /* Get both TTL and protocol */ Modified: stable/12/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_frag.c Sat Aug 1 16:02:32 2020 (r363767) +++ stable/12/sys/contrib/ipfilter/netinet/ip_frag.c Sun Aug 2 04:25:11 2020 (r363768) @@ -404,6 +404,7 @@ ipfr_frag_new(softc, softf, fin, pass, table } } + memset(&frag, 0, sizeof(frag)); frag.ipfr_v = fin->fin_v; idx = fin->fin_v; frag.ipfr_p = fin->fin_p; @@ -452,6 +453,7 @@ ipfr_frag_new(softc, softf, fin, pass, table FBUMPD(ifs_nomem); return NULL; } + memset(fran, 0, sizeof(*fran)); WRITE_ENTER(lock); @@ -489,6 +491,7 @@ ipfr_frag_new(softc, softf, fin, pass, table table[idx] = fra; bcopy((char *)&frag.ipfr_ifp, (char *)&fra->ipfr_ifp, IPFR_CMPSZ); fra->ipfr_v = fin->fin_v; + fra->ipfr_p = fin->fin_p; fra->ipfr_ttl = softc->ipf_ticks + softf->ipfr_ttl; fra->ipfr_firstend = frag.ipfr_firstend; @@ -677,6 +680,7 @@ ipf_frag_lookup(softc, softf, fin, table * * build up a hash value to index the table with. */ + memset(&frag, 0, sizeof(frag)); frag.ipfr_v = fin->fin_v; idx = fin->fin_v; frag.ipfr_p = fin->fin_p; From owner-svn-src-all@freebsd.org Sun Aug 2 04:25:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B39FA370DE0; Sun, 2 Aug 2020 04:25:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BK7H64LnYz44Q1; Sun, 2 Aug 2020 04:25:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E54E1E08F; Sun, 2 Aug 2020 04:25:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0724PcVv050209; Sun, 2 Aug 2020 04:25:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0724PaY2050201; Sun, 2 Aug 2020 04:25:36 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008020425.0724PaY2050201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 2 Aug 2020 04:25:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363769 - in stable/11: contrib/ipfilter/iplang contrib/ipfilter/ipsend sys/contrib/ipfilter/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/11: contrib/ipfilter/iplang contrib/ipfilter/ipsend sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 363769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 04:25:38 -0000 Author: cy Date: Sun Aug 2 04:25:36 2020 New Revision: 363769 URL: https://svnweb.freebsd.org/changeset/base/363769 Log: MFC r363284-r363285, r363670 r363284: pfil_run_hooks() can be called recursively, so we have to define FASTROUTE_RECURSION in fil.c Submitted by: christos@NetBSD.org Reported by: christos@NetBSD.org Obtained from: NetBSD r1.31 r363285: Fix incorrect byte order in ipfstat -f output. - make sure frag is initialized to 0 - initialize ipfr_p field NetBSD PR: 55137 Submitted by: christos@NetBSD.org Reported by: christos@NetBSD.org Obtained from: NetBSD fil.c r1.32, ip_frag.c r1.8 r363670: Continued ipfilter #ifdef cleanup. The r343701 log entry contains a complete description. Modified: stable/11/contrib/ipfilter/iplang/iplang_y.y stable/11/contrib/ipfilter/ipsend/arp.c stable/11/contrib/ipfilter/ipsend/ipresend.c stable/11/contrib/ipfilter/ipsend/ipsend.c stable/11/contrib/ipfilter/ipsend/iptest.c stable/11/contrib/ipfilter/ipsend/iptests.c stable/11/contrib/ipfilter/ipsend/sock.c stable/11/sys/contrib/ipfilter/netinet/fil.c stable/11/sys/contrib/ipfilter/netinet/ip_frag.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ipfilter/iplang/iplang_y.y ============================================================================== --- stable/11/contrib/ipfilter/iplang/iplang_y.y Sun Aug 2 04:25:11 2020 (r363768) +++ stable/11/contrib/ipfilter/iplang/iplang_y.y Sun Aug 2 04:25:36 2020 (r363769) @@ -45,11 +45,6 @@ #include "ipf.h" #include "iplang.h" -#if !defined(__NetBSD__) && (!defined(__FreeBSD_version) && \ - __FreeBSD_version < 400020) && (!SOLARIS || SOLARIS2 < 10) -extern struct ether_addr *ether_aton __P((char *)); -#endif - extern int opts; extern struct ipopt_names ionames[]; extern int state, state, lineNum, token; @@ -58,11 +53,7 @@ extern char yytext[]; extern FILE *yyin; int yylex __P((void)); #define YYDEBUG 1 -#if !defined(ultrix) && !defined(hpux) int yydebug = 1; -#else -extern int yydebug; -#endif iface_t *iflist = NULL, **iftail = &iflist; iface_t *cifp = NULL; Modified: stable/11/contrib/ipfilter/ipsend/arp.c ============================================================================== --- stable/11/contrib/ipfilter/ipsend/arp.c Sun Aug 2 04:25:11 2020 (r363768) +++ stable/11/contrib/ipfilter/ipsend/arp.c Sun Aug 2 04:25:36 2020 (r363769) @@ -11,17 +11,13 @@ static const char rcsid[] = "@(#)$Id$"; #endif #include #include -#if !defined(ultrix) && !defined(hpux) && !defined(__hpux) && !defined(__osf__) && !defined(_AIX51) # include -#endif #include #include #include #include #include -#ifndef ultrix # include -#endif #include #include #include Modified: stable/11/contrib/ipfilter/ipsend/ipresend.c ============================================================================== --- stable/11/contrib/ipfilter/ipsend/ipresend.c Sun Aug 2 04:25:11 2020 (r363768) +++ stable/11/contrib/ipfilter/ipsend/ipresend.c Sun Aug 2 04:25:36 2020 (r363769) @@ -38,15 +38,7 @@ int opts = 0; # ifdef sun char default_device[] = "le0"; # else -# ifdef ultrix -char default_device[] = "ln0"; -# else -# ifdef __bsdi__ -char default_device[] = "ef0"; -# else char default_device[] = "lan0"; -# endif -# endif # endif #else char default_device[] = DEFAULT_DEVICE; Modified: stable/11/contrib/ipfilter/ipsend/ipsend.c ============================================================================== --- stable/11/contrib/ipfilter/ipsend/ipsend.c Sun Aug 2 04:25:11 2020 (r363768) +++ stable/11/contrib/ipfilter/ipsend/ipsend.c Sun Aug 2 04:25:36 2020 (r363769) @@ -33,15 +33,7 @@ extern void iplang __P((FILE *)); char options[68]; int opts; -# ifdef ultrix -char default_device[] = "ln0"; -# else -# ifdef __bsdi__ -char default_device[] = "ef0"; -# else char default_device[] = "le0"; -# endif /* __bsdi__ */ -# endif /* ultrix */ static void usage __P((char *)); Modified: stable/11/contrib/ipfilter/ipsend/iptest.c ============================================================================== --- stable/11/contrib/ipfilter/ipsend/iptest.c Sun Aug 2 04:25:11 2020 (r363768) +++ stable/11/contrib/ipfilter/ipsend/iptest.c Sun Aug 2 04:25:36 2020 (r363769) @@ -34,15 +34,7 @@ char options[68]; # ifdef sun char default_device[] = "le0"; # else -# ifdef ultrix -char default_device[] = "ln0"; -# else -# ifdef __bsdi__ -char default_device[] = "ef0"; -# else char default_device[] = "lan0"; -# endif -# endif # endif static void usage __P((char *)); Modified: stable/11/contrib/ipfilter/ipsend/iptests.c ============================================================================== --- stable/11/contrib/ipfilter/ipsend/iptests.c Sun Aug 2 04:25:11 2020 (r363768) +++ stable/11/contrib/ipfilter/ipsend/iptests.c Sun Aug 2 04:25:36 2020 (r363769) @@ -36,18 +36,13 @@ typedef int boolean_t; # endif # undef _KERNEL # undef KERNEL -#if !defined(solaris) && !defined(linux) && !defined(__sgi) +#if !defined(solaris) # include # include # include #endif -#if !defined(ultrix) && !defined(hpux) && !defined(linux) && \ - !defined(__sgi) && !defined(__osf__) && !defined(_AIX51) # include -#endif -#ifndef ultrix # include -#endif #if defined(solaris) # include #else @@ -57,11 +52,9 @@ typedef int boolean_t; #include #include #endif -#if BSD >= 199103 # include # include # include -#endif #include #include #include @@ -74,7 +67,7 @@ typedef int boolean_t; #include #include #include -#if defined(__SVR4) || defined(__svr4__) || defined(__sgi) +#if defined(__SVR4) || defined(__svr4__) # include #endif #include @@ -82,7 +75,7 @@ typedef int boolean_t; #include #include # include -# if !defined(__hpux) && !defined(solaris) +# if !defined(solaris) # include # endif #include "ipsend.h" Modified: stable/11/contrib/ipfilter/ipsend/sock.c ============================================================================== --- stable/11/contrib/ipfilter/ipsend/sock.c Sun Aug 2 04:25:11 2020 (r363768) +++ stable/11/contrib/ipfilter/ipsend/sock.c Sun Aug 2 04:25:36 2020 (r363769) @@ -21,14 +21,8 @@ static const char rcsid[] = "@(#)$Id$"; */ typedef int boolean_t; #endif -#ifndef ultrix #include -#endif -#if (__FreeBSD_version >= 300000) # include -#else -# include -#endif # ifdef __NetBSD__ # include # endif @@ -38,10 +32,6 @@ typedef int boolean_t; # define _KERNEL # define KERNEL # endif -# ifdef ultrix -# undef LOCORE -# include -# endif # include # ifdef __FreeBSD__ # undef _WANT_FILE @@ -54,18 +44,14 @@ typedef int boolean_t; #include #include #include -#if !defined(ultrix) && !defined(hpux) && !defined(__osf__) # include -#endif #ifdef sun #include #include #endif -#if BSD >= 199103 #include #include #include -#endif #include #include #include @@ -141,128 +127,10 @@ int kmemcpy(buf, pos, n) struct nlist names[4] = { { "_proc" }, { "_nproc" }, -#ifdef ultrix - { "_u" }, -#else { NULL }, -#endif { NULL } }; -#if BSD < 199103 -static struct proc *getproc() -{ - struct proc *p; - pid_t pid = getpid(); - int siz, n; - - n = nlist(KERNEL, names); - if (n != 0) - { - fprintf(stderr, "nlist(%#x) == %d\n", names, n); - return NULL; - } - if (KMCPY(&nproc, names[1].n_value, sizeof(nproc)) == -1) - { - fprintf(stderr, "read nproc (%#x)\n", names[1].n_value); - return NULL; - } - siz = nproc * sizeof(struct proc); - if (KMCPY(&p, names[0].n_value, sizeof(p)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) proc\n", - names[0].n_value, &p, sizeof(p)); - return NULL; - } - proc = (struct proc *)malloc(siz); - if (KMCPY(proc, p, siz) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) proc\n", - p, proc, siz); - return NULL; - } - - p = proc; - - for (n = nproc; n; n--, p++) - if (p->p_pid == pid) - break; - if (!n) - return NULL; - - return p; -} - - -struct tcpcb *find_tcp(fd, ti) - int fd; - struct tcpiphdr *ti; -{ - struct tcpcb *t; - struct inpcb *i; - struct socket *s; - struct user *up; - struct proc *p; - struct file *f, **o; - - if (!(p = getproc())) - return NULL; - up = (struct user *)malloc(sizeof(*up)); -#ifndef ultrix - if (KMCPY(up, p->p_uarea, sizeof(*up)) == -1) - { - fprintf(stderr, "read(%#x,%#x) failed\n", p, p->p_uarea); - return NULL; - } -#else - if (KMCPY(up, names[2].n_value, sizeof(*up)) == -1) - { - fprintf(stderr, "read(%#x,%#x) failed\n", p, names[2].n_value); - return NULL; - } -#endif - - o = (struct file **)calloc(up->u_lastfile + 1, sizeof(*o)); - if (KMCPY(o, up->u_ofile, (up->u_lastfile + 1) * sizeof(*o)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - u_ofile - failed\n", - up->u_ofile, o, sizeof(*o)); - return NULL; - } - f = (struct file *)calloc(1, sizeof(*f)); - if (KMCPY(f, o[fd], sizeof(*f)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - o[fd] - failed\n", - up->u_ofile[fd], f, sizeof(*f)); - return NULL; - } - - s = (struct socket *)calloc(1, sizeof(*s)); - if (KMCPY(s, f->f_data, sizeof(*s)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - f_data - failed\n", - o[fd], s, sizeof(*s)); - return NULL; - } - - i = (struct inpcb *)calloc(1, sizeof(*i)); - if (KMCPY(i, s->so_pcb, sizeof(*i)) == -1) - { - fprintf(stderr, "kvm_read(%#x,%#x,%d) - so_pcb - failed\n", - s->so_pcb, i, sizeof(*i)); - return NULL; - } - - t = (struct tcpcb *)calloc(1, sizeof(*t)); - if (KMCPY(t, i->inp_ppcb, sizeof(*t)) == -1) - { - fprintf(stderr, "read(%#x,%#x,%d) - inp_ppcb - failed\n", - i->inp_ppcb, t, sizeof(*t)); - return NULL; - } - return (struct tcpcb *)i->inp_ppcb; -} -#else static struct kinfo_proc *getproc() { static struct kinfo_proc kp; @@ -302,7 +170,7 @@ struct tcpcb *find_tcp(tfd, ti) fd = (struct filedesc *)malloc(sizeof(*fd)); if (fd == NULL) return NULL; -#if defined( __FreeBSD_version) && __FreeBSD_version >= 500013 +#if defined( __FreeBSD_version) if (KMCPY(fd, p->ki_fd, sizeof(*fd)) == -1) { fprintf(stderr, "read(%#lx,%#lx) failed\n", @@ -379,7 +247,6 @@ finderror: free(t); return NULL; } -#endif /* BSD < 199301 */ int do_socket(dev, mtu, ti, gwip) char *dev; Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Aug 2 04:25:11 2020 (r363768) +++ stable/11/sys/contrib/ipfilter/netinet/fil.c Sun Aug 2 04:25:36 2020 (r363769) @@ -115,6 +115,8 @@ extern int opts; extern int blockreason; #endif /* _KERNEL */ +#define FASTROUTE_RECURSION + #define LBUMP(x) softc->x++ #define LBUMPD(x, y) do { softc->x.y++; DT(y); } while (0) @@ -1696,7 +1698,7 @@ ipf_pr_ipv4hdr(fin) fi->fi_p = p; fin->fin_crc = p; fi->fi_tos = ip->ip_tos; - fin->fin_id = ip->ip_id; + fin->fin_id = ntohs(ip->ip_id); off = ntohs(ip->ip_off); /* Get both TTL and protocol */ Modified: stable/11/sys/contrib/ipfilter/netinet/ip_frag.c ============================================================================== --- stable/11/sys/contrib/ipfilter/netinet/ip_frag.c Sun Aug 2 04:25:11 2020 (r363768) +++ stable/11/sys/contrib/ipfilter/netinet/ip_frag.c Sun Aug 2 04:25:36 2020 (r363769) @@ -404,6 +404,7 @@ ipfr_frag_new(softc, softf, fin, pass, table } } + memset(&frag, 0, sizeof(frag)); frag.ipfr_v = fin->fin_v; idx = fin->fin_v; frag.ipfr_p = fin->fin_p; @@ -452,6 +453,7 @@ ipfr_frag_new(softc, softf, fin, pass, table FBUMPD(ifs_nomem); return NULL; } + memset(fran, 0, sizeof(*fran)); WRITE_ENTER(lock); @@ -489,6 +491,7 @@ ipfr_frag_new(softc, softf, fin, pass, table table[idx] = fra; bcopy((char *)&frag.ipfr_ifp, (char *)&fra->ipfr_ifp, IPFR_CMPSZ); fra->ipfr_v = fin->fin_v; + fra->ipfr_p = fin->fin_p; fra->ipfr_ttl = softc->ipf_ticks + softf->ipfr_ttl; fra->ipfr_firstend = frag.ipfr_firstend; @@ -677,6 +680,7 @@ ipf_frag_lookup(softc, softf, fin, table * * build up a hash value to index the table with. */ + memset(&frag, 0, sizeof(frag)); frag.ipfr_v = fin->fin_v; idx = fin->fin_v; frag.ipfr_p = fin->fin_p; From owner-svn-src-all@freebsd.org Sun Aug 2 16:34:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03DCB3A1E79; Sun, 2 Aug 2020 16:34:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKRS36P1pz4dyy; Sun, 2 Aug 2020 16:34:27 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF3622645C; Sun, 2 Aug 2020 16:34:27 +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 072GYRkh002923; Sun, 2 Aug 2020 16:34:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072GYR5B002922; Sun, 2 Aug 2020 16:34:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202008021634.072GYR5B002922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 2 Aug 2020 16:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363770 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 16:34:28 -0000 Author: cem Date: Sun Aug 2 16:34:27 2020 New Revision: 363770 URL: https://svnweb.freebsd.org/changeset/base/363770 Log: Unlocked getblk: Fix new false-positive assertion A free buf's lock may be held (temporarily) due to unlocked lookup, so buf_alloc() must acquire it without LK_NOWAIT. The unlocked getblk path should unlock it promptly once it realizes the identity does not match the buffer it was searching for. Reported by: gallatin Reviewed by: kib Tested by: pho X-MFC-With: r363482 Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D25914 Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Aug 2 04:25:36 2020 (r363769) +++ head/sys/kern/vfs_bio.c Sun Aug 2 16:34:27 2020 (r363770) @@ -1637,7 +1637,7 @@ static struct buf * buf_alloc(struct bufdomain *bd) { struct buf *bp; - int freebufs; + int freebufs, error; /* * We can only run out of bufs in the buf zone if the average buf @@ -1660,8 +1660,10 @@ buf_alloc(struct bufdomain *bd) if (freebufs == bd->bd_lofreebuffers) bufspace_daemon_wakeup(bd); - if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) != 0) - panic("getnewbuf_empty: Locked buf %p on free queue.", bp); + error = BUF_LOCK(bp, LK_EXCLUSIVE, NULL); + KASSERT(error == 0, ("%s: BUF_LOCK on free buf %p: %d.", __func__, bp, + error)); + (void)error; KASSERT(bp->b_vp == NULL, ("bp: %p still has vnode %p.", bp, bp->b_vp)); From owner-svn-src-all@freebsd.org Sun Aug 2 16:41:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3D1E3A2398; Sun, 2 Aug 2020 16:41:36 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKRcJ4NWFz4fYs; Sun, 2 Aug 2020 16:41:36 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 79C5826563; Sun, 2 Aug 2020 16:41:36 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072GfaMc004554; Sun, 2 Aug 2020 16:41:36 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072GfaqI004537; Sun, 2 Aug 2020 16:41:36 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202008021641.072GfaqI004537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 2 Aug 2020 16:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363771 - head/usr.bin/vtfontcvt X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/vtfontcvt X-SVN-Commit-Revision: 363771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 16:41:36 -0000 Author: 0mp (doc,ports committer) Date: Sun Aug 2 16:41:36 2020 New Revision: 363771 URL: https://svnweb.freebsd.org/changeset/base/363771 Log: Document automatic handling of font height for BDF files PR: 248395 Submitted by: Dmitry Wagin Reviewed by: bcr, emaste, tsoome Differential Revision: https://reviews.freebsd.org/D25907 Modified: head/usr.bin/vtfontcvt/vtfontcvt.8 Modified: head/usr.bin/vtfontcvt/vtfontcvt.8 ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.8 Sun Aug 2 16:34:27 2020 (r363770) +++ head/usr.bin/vtfontcvt/vtfontcvt.8 Sun Aug 2 16:41:36 2020 (r363771) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Mar 10, 2020 +.Dd August 2, 2020 .Dt VTFONTCVT 8 .Os .Sh NAME @@ -63,7 +63,7 @@ file. .It Fl h Ar height Set font height. The default is 16. -Font height is set automatically for HEX files that have a +Font height is set automatically for BDF files and for HEX files that have a .Ql # Height: Ar height comment before any font data. .It Fl n @@ -75,7 +75,7 @@ Display verbose statistics about the converted font. .It Fl w Ar width Set font width. The default is 8. -Font width is set automatically for HEX files that have a +Font width is set automatically for BDF files and for HEX files that have a .Ql # Width: Ar width comment before any font data. .El From owner-svn-src-all@freebsd.org Sun Aug 2 16:59:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E730E3A23F1; Sun, 2 Aug 2020 16:59:14 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKS0f5tPZz3Rcc; Sun, 2 Aug 2020 16:59:14 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADF3126B61; Sun, 2 Aug 2020 16:59:14 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072GxE4o016305; Sun, 2 Aug 2020 16:59:14 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072GxEVY016304; Sun, 2 Aug 2020 16:59:14 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202008021659.072GxEVY016304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 2 Aug 2020 16:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363772 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 363772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 16:59:15 -0000 Author: 0mp (doc,ports committer) Date: Sun Aug 2 16:59:14 2020 New Revision: 363772 URL: https://svnweb.freebsd.org/changeset/base/363772 Log: core(5) appeared in Version 1 AT&T UNIX Based on the scans of manual pages available at https://www.bell-labs.com/usr/dmr/www/man51.pdf, which are a part of the following collection: https://www.bell-labs.com/usr/dmr/www/1stEdman.html. Obtained from: NetBSD Differential Revision: https://reviews.freebsd.org/D25849 Modified: head/share/man/man5/core.5 Modified: head/share/man/man5/core.5 ============================================================================== --- head/share/man/man5/core.5 Sun Aug 2 16:41:36 2020 (r363771) +++ head/share/man/man5/core.5 Sun Aug 2 16:59:14 2020 (r363772) @@ -28,7 +28,7 @@ .\" @(#)core.5 8.3 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd February 13, 2018 +.Dd August 2, 2020 .Dt CORE 5 .Os .Sh NAME @@ -171,4 +171,4 @@ command can be used: A .Nm file format appeared in -.At v6 . +.At v1 . From owner-svn-src-all@freebsd.org Sun Aug 2 19:42:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD9D13A5C44; Sun, 2 Aug 2020 19:42:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKWcb5dn8z3bws; Sun, 2 Aug 2020 19:42:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A4DC08C1D; Sun, 2 Aug 2020 19:42:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072Jg7Ik020796; Sun, 2 Aug 2020 19:42:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072Jg7iu020794; Sun, 2 Aug 2020 19:42:07 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008021942.072Jg7iu020794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Aug 2020 19:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363780 - 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: 363780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 19:42:07 -0000 Author: mjg Date: Sun Aug 2 19:42:06 2020 New Revision: 363780 URL: https://svnweb.freebsd.org/changeset/base/363780 Log: vfs: move namecache initialisation into cache_vnode_init Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Aug 2 18:34:29 2020 (r363779) +++ head/sys/kern/vfs_cache.c Sun Aug 2 19:42:06 2020 (r363780) @@ -2071,6 +2071,15 @@ nchinit(void *dummy __unused) SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nchinit, NULL); void +cache_vnode_init(struct vnode *vp) +{ + + LIST_INIT(&vp->v_cache_src); + TAILQ_INIT(&vp->v_cache_dst); + vp->v_cache_dd = NULL; +} + +void cache_changesize(u_long newmaxvnodes) { struct nchashhead *new_nchashtbl, *old_nchashtbl; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Aug 2 18:34:29 2020 (r363779) +++ head/sys/kern/vfs_subr.c Sun Aug 2 19:42:06 2020 (r363780) @@ -563,8 +563,7 @@ vnode_init(void *mem, int size, int flags) /* * Initialize namecache. */ - LIST_INIT(&vp->v_cache_src); - TAILQ_INIT(&vp->v_cache_dst); + cache_vnode_init(vp); /* * Initialize rangelocks. */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Aug 2 18:34:29 2020 (r363779) +++ head/sys/sys/vnode.h Sun Aug 2 19:42:06 2020 (r363780) @@ -635,6 +635,7 @@ void cache_enter_time(struct vnode *dvp, struct vnode struct timespec *dtsp); int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp); +void cache_vnode_init(struct vnode *vp); void cache_purge(struct vnode *vp); void cache_purge_negative(struct vnode *vp); void cache_purgevfs(struct mount *mp, bool force); From owner-svn-src-all@freebsd.org Sun Aug 2 20:00:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 350903A64CB; Sun, 2 Aug 2020 20:00:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKX240knpz3cYC; Sun, 2 Aug 2020 20:00:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F14398BC3; Sun, 2 Aug 2020 20:00:43 +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 072K0hfi028196; Sun, 2 Aug 2020 20:00:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072K0h7C028195; Sun, 2 Aug 2020 20:00:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008022000.072K0h7C028195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Aug 2020 20:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363781 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363781 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 20:00:44 -0000 Author: mjg Date: Sun Aug 2 20:00:43 2020 New Revision: 363781 URL: https://svnweb.freebsd.org/changeset/base/363781 Log: vfs: shorten v_iflag and v_vflag While here renumber VI_* flags to remove the gaps. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D25921 Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Sun Aug 2 19:42:06 2020 (r363780) +++ head/sys/sys/vnode.h Sun Aug 2 20:00:43 2020 (r363781) @@ -107,6 +107,7 @@ struct vnode { enum vtype v_type:8; /* u vnode type */ short v_irflag; /* i frequently read flags */ seqc_t v_seqc; /* i modification count */ + uint32_t v_nchash; /* u namecache hash */ struct vop_vector *v_op; /* u vnode operations vector */ void *v_data; /* u private data for fs */ @@ -171,8 +172,8 @@ struct vnode { u_int v_holdcnt; /* I prevents recycling. */ u_int v_usecount; /* I ref count of users */ - u_int v_iflag; /* i vnode flags (see below) */ - u_int v_vflag; /* v vnode flags */ + u_short v_iflag; /* i vnode flags (see below) */ + u_short v_vflag; /* v vnode flags */ u_short v_mflag; /* l mnt-specific vnode flags */ short v_dbatchcpu; /* i LRU requeue deferral batch */ int v_writecount; /* I ref count of writers or @@ -245,10 +246,10 @@ struct xvnode { #define VIRF_DOOMED 0x0001 /* This vnode is being recycled */ #define VI_TEXT_REF 0x0001 /* Text ref grabbed use ref */ -#define VI_MOUNT 0x0020 /* Mount in progress */ -#define VI_DOINGINACT 0x0800 /* VOP_INACTIVE is in progress */ -#define VI_OWEINACT 0x1000 /* Need to call inactive */ -#define VI_DEFINACT 0x2000 /* deferred inactive */ +#define VI_MOUNT 0x0002 /* Mount in progress */ +#define VI_DOINGINACT 0x0004 /* VOP_INACTIVE is in progress */ +#define VI_OWEINACT 0x0008 /* Need to call inactive */ +#define VI_DEFINACT 0x0010 /* deferred inactive */ #define VV_ROOT 0x0001 /* root of its filesystem */ #define VV_ISTTY 0x0002 /* vnode represents a tty */ From owner-svn-src-all@freebsd.org Sun Aug 2 20:02:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADA1E3A66D8; Sun, 2 Aug 2020 20:02:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKX3f43LSz3dJD; Sun, 2 Aug 2020 20:02:06 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FD138F27; Sun, 2 Aug 2020 20:02: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 072K26c5031423; Sun, 2 Aug 2020 20:02:06 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072K26lC031422; Sun, 2 Aug 2020 20:02:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008022002.072K26lC031422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Aug 2020 20:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363782 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363782 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 20:02:06 -0000 Author: mjg Date: Sun Aug 2 20:02:06 2020 New Revision: 363782 URL: https://svnweb.freebsd.org/changeset/base/363782 Log: vfs: store precomputed namecache hash in the vnode This significantly speeds up path lookup, Cascade Lake doing access(2) on ufs on /usr/obj/usr/src/amd64.amd64/sys/GENERIC/vnode_if.c, ops/s: before: 2535298 after: 2797621 Over +10%. The reversed order of computation here does not seem to matter for hash distribution. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D25921 Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sun Aug 2 20:00:43 2020 (r363781) +++ head/sys/kern/vfs_cache.c Sun Aug 2 20:02:06 2020 (r363782) @@ -490,14 +490,22 @@ cache_assert_vnode_locked(struct vnode *vp) cache_assert_vlp_locked(vlp); } +/* + * TODO: With the value stored we can do better than computing the hash based + * on the address and the choice of FNV should also be revisisted. + */ +static void +cache_prehash(struct vnode *vp) +{ + + vp->v_nchash = fnv_32_buf(&vp, sizeof(vp), FNV1_32_INIT); +} + static uint32_t cache_get_hash(char *name, u_char len, struct vnode *dvp) { - uint32_t hash; - hash = fnv_32_buf(name, len, FNV1_32_INIT); - hash = fnv_32_buf(&dvp, sizeof(dvp), hash); - return (hash); + return (fnv_32_buf(name, len, dvp->v_nchash)); } static inline struct rwlock * @@ -2077,6 +2085,7 @@ cache_vnode_init(struct vnode *vp) LIST_INIT(&vp->v_cache_src); TAILQ_INIT(&vp->v_cache_dst); vp->v_cache_dd = NULL; + cache_prehash(vp); } void From owner-svn-src-all@freebsd.org Sun Aug 2 20:03:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5ED43A69A8; Sun, 2 Aug 2020 20:03:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKX574MSDz3dFQ; Sun, 2 Aug 2020 20:03:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 791038D6A; Sun, 2 Aug 2020 20:03:23 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072K3Nmb034050; Sun, 2 Aug 2020 20:03:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072K3NHC034049; Sun, 2 Aug 2020 20:03:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008022003.072K3NHC034049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 2 Aug 2020 20:03:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363783 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363783 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 20:03:23 -0000 Author: mjg Date: Sun Aug 2 20:03:23 2020 New Revision: 363783 URL: https://svnweb.freebsd.org/changeset/base/363783 Log: Bump __FreeBSD_version after vnode layout changes Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Aug 2 20:02:06 2020 (r363782) +++ head/sys/sys/param.h Sun Aug 2 20:03:23 2020 (r363783) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300103 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300104 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sun Aug 2 20:18:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F0383A6BE3; Sun, 2 Aug 2020 20:18:38 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKXQk0S2Cz3dvv; Sun, 2 Aug 2020 20:18:38 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6EFD8F46; Sun, 2 Aug 2020 20:18:37 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 072KIb5N040666; Sun, 2 Aug 2020 20:18:37 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 072KIbFX040665; Sun, 2 Aug 2020 20:18:37 GMT (envelope-from jah@FreeBSD.org) Message-Id: <202008022018.072KIbFX040665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sun, 2 Aug 2020 20:18:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363784 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 363784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Aug 2020 20:18:38 -0000 Author: jah Date: Sun Aug 2 20:18:37 2020 New Revision: 363784 URL: https://svnweb.freebsd.org/changeset/base/363784 Log: vt(4): CONS_HISTORY/CONS_CLRHIST should operate on issuing terminal Currently the CONS_HISTORY and CONS_CLRHIST ioctls modify the state of the active terminal instead of the terminal against which the ioctl was issued. Because of the way vidcontrol(1) works, these are the same in most cases. But a poorly-timed window switch can make them differ. This is reproducible by issuing e.g. 'vidcontrol -s 2 && vidcontrol -C' to switch from vty 1 to vty 2; teken will reset the cursor position on vty 1 but vt(4) will clear the history buffer of vty 2, producing an interesting state of affairs. Differential Revision: https://reviews.freebsd.org/D25564 Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sun Aug 2 20:03:23 2020 (r363783) +++ head/sys/dev/vt/vt_core.c Sun Aug 2 20:18:37 2020 (r363784) @@ -454,7 +454,7 @@ vt_window_postswitch(struct vt_window *vw) return (0); } -/* vt_late_window_switch will done VT switching for regular case. */ +/* vt_late_window_switch will do VT switching for regular case. */ static int vt_late_window_switch(struct vt_window *vw) { @@ -2326,12 +2326,11 @@ skip_thunk: case CONS_HISTORY: if (*(int *)data < 0) return EINVAL; - if (*(int *)data != vd->vd_curwindow->vw_buf.vb_history_size) - vtbuf_sethistory_size(&vd->vd_curwindow->vw_buf, - *(int *)data); + if (*(int *)data != vw->vw_buf.vb_history_size) + vtbuf_sethistory_size(&vw->vw_buf, *(int *)data); return (0); case CONS_CLRHIST: - vtbuf_clearhistory(&vd->vd_curwindow->vw_buf); + vtbuf_clearhistory(&vw->vw_buf); /* * Invalidate the entire visible window; it is not guaranteed * that this operation will be immediately followed by a scroll @@ -2339,9 +2338,11 @@ skip_thunk: * to remain visible. */ VT_LOCK(vd); - vd->vd_flags |= VDF_INVALID; + if (vw == vd->vd_curwindow) { + vd->vd_flags |= VDF_INVALID; + vt_resume_flush_timer(vw, 0); + } VT_UNLOCK(vd); - vt_resume_flush_timer(vd->vd_curwindow, 0); return (0); case CONS_GET: /* XXX */ From owner-svn-src-all@freebsd.org Mon Aug 3 01:00:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B166B3ABEDD; Mon, 3 Aug 2020 01:00:20 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKfgm4Jqbz485w; Mon, 3 Aug 2020 01:00:20 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7781BC61B; Mon, 3 Aug 2020 01:00:20 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 07310KTG011529; Mon, 3 Aug 2020 01:00:20 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07310K97011528; Mon, 3 Aug 2020 01:00:20 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202008030100.07310K97011528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Mon, 3 Aug 2020 01:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363786 - stable/12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: stable/12/release/tools X-SVN-Commit-Revision: 363786 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 01:00:20 -0000 Author: cperciva Date: Mon Aug 3 01:00:20 2020 New Revision: 363786 URL: https://svnweb.freebsd.org/changeset/base/363786 Log: MFC r362791: Make EC2 AMIs use portsnap and freebsd-update mirrors hosted in AWS Modified: stable/12/release/tools/ec2.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/release/tools/ec2.conf ============================================================================== --- stable/12/release/tools/ec2.conf Sun Aug 2 23:50:55 2020 (r363785) +++ stable/12/release/tools/ec2.conf Mon Aug 3 01:00:20 2020 (r363786) @@ -111,6 +111,12 @@ vm_extra_pre_umount() { 's/^#ChallengeResponseAuthentication yes/ChallengeResponseAuthentication no/' \ ${DESTDIR}/etc/ssh/sshd_config + # Use FreeBSD Update and Portsnap mirrors hosted in AWS + sed -i '' -e 's/update.FreeBSD.org/aws.update.FreeBSD.org/' \ + ${DESTDIR}/etc/freebsd-update.conf + sed -i '' -e 's/portsnap.FreeBSD.org/aws.portsnap.FreeBSD.org/' \ + ${DESTDIR}/etc/portsnap.conf + # Use the NTP service provided by Amazon sed -i '' -e 's/^pool/#pool/' \ -e '1,/^#server/s/^#server.*/server 169.254.169.123 iburst/' \ From owner-svn-src-all@freebsd.org Mon Aug 3 06:10:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D47F37030A; Mon, 3 Aug 2020 06:10:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKnYL3hM6z4MGw; Mon, 3 Aug 2020 06: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5ED4BF9F8; Mon, 3 Aug 2020 06:10:14 +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 0736AEUK003270; Mon, 3 Aug 2020 06:10:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0736AEFM003269; Mon, 3 Aug 2020 06:10:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202008030610.0736AEFM003269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 3 Aug 2020 06:10:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363787 - stable/12/sys/arm/allwinner/clkng X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 363787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 06:10:14 -0000 Author: avg Date: Mon Aug 3 06:10:13 2020 New Revision: 363787 URL: https://svnweb.freebsd.org/changeset/base/363787 Log: MFC r363597: actually enable gate control for allwinner's r-ccu ir clock Modified: stable/12/sys/arm/allwinner/clkng/ccu_sun8i_r.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/clkng/ccu_sun8i_r.c ============================================================================== --- stable/12/sys/arm/allwinner/clkng/ccu_sun8i_r.c Mon Aug 3 01:00:20 2020 (r363786) +++ stable/12/sys/arm/allwinner/clkng/ccu_sun8i_r.c Mon Aug 3 06:10:13 2020 (r363787) @@ -122,7 +122,7 @@ NM_CLK(r_ccu_ir_clk, 16, 2, 0, 0, /* M flags */ 24, 2, /* mux */ 31, /* gate */ - AW_CLK_HAS_MUX | AW_CLK_REPARENT); /* flags */ + AW_CLK_HAS_MUX | AW_CLK_REPARENT | AW_CLK_HAS_GATE);/* flags */ static const char *a83t_ir_parents[] = {"osc16M", "osc24M"}; static struct aw_clk_nm_def a83t_ir_clk = { From owner-svn-src-all@freebsd.org Mon Aug 3 06:54:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 199A0370F99; Mon, 3 Aug 2020 06:54:05 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKpWw6w1Pz4P7c; Mon, 3 Aug 2020 06:54:04 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D087410468; Mon, 3 Aug 2020 06:54:04 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0736s4RX033342; Mon, 3 Aug 2020 06:54:04 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0736s4jd033341; Mon, 3 Aug 2020 06:54:04 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202008030654.0736s4jd033341@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Mon, 3 Aug 2020 06:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363788 - stable/12/bin/sh X-SVN-Group: stable-12 X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: stable/12/bin/sh X-SVN-Commit-Revision: 363788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 06:54:05 -0000 Author: pstef Date: Mon Aug 3 06:54:04 2020 New Revision: 363788 URL: https://svnweb.freebsd.org/changeset/base/363788 Log: MFC 363621: sh(1): print a newline when ^D quits sh Modified: stable/12/bin/sh/main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/sh/main.c ============================================================================== --- stable/12/bin/sh/main.c Mon Aug 3 06:10:13 2020 (r363787) +++ stable/12/bin/sh/main.c Mon Aug 3 06:54:04 2020 (r363788) @@ -241,6 +241,10 @@ cmdloop(int top) } } popstackmark(&smark); + if (top && iflag) { + out2c('\n'); + flushout(out2); + } } From owner-svn-src-all@freebsd.org Mon Aug 3 09:11:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4D622373CEC; Mon, 3 Aug 2020 09:11:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKsZ71BRkz4Wtc; Mon, 3 Aug 2020 09:11:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C5B811E4E; Mon, 3 Aug 2020 09:11:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0739BAOs017508; Mon, 3 Aug 2020 09:11:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0739BAmB017507; Mon, 3 Aug 2020 09:11:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008030911.0739BAmB017507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Aug 2020 09:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363789 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363789 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 09:11:11 -0000 Author: hselasky Date: Mon Aug 3 09:11:10 2020 New Revision: 363789 URL: https://svnweb.freebsd.org/changeset/base/363789 Log: MFC r361549: Add overflow.h to the LinuxKPI. Only add check_add_overflow and check_mul_overflow as those are the only two needed function by DRM v5.3. Both gcc and clang have builtin to do this check so use them directly but throw an error if the compiler/code checker doesn't support this builtin. Sponsored-by: The FreeBSD Foundation Reviewed by: hselsasky Differential Revision: https://reviews.freebsd.org/D25015 Added: stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h - copied unchanged from r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h Modified: Directory Properties: stable/12/ (props changed) Copied: stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h (from r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:11:10 2020 (r363789, copy of r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot 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 __LINUX_OVERFLOW_H__ +#define __LINUX_OVERFLOW_H__ + +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + +#if __has_builtin(__builtin_add_overflow) +#define check_add_overflow(a, b, c) \ + __builtin_add_overflow(a, b, c) +#else +#error "Compiler does not support __builtin_add_overflow" +#endif + +#if __has_builtin(__builtin_mul_overflow) +#define check_mul_overflow(a, b, c) \ + __builtin_mul_overflow(a, b, c) +#else +#error "Compiler does not support __builtin_mul_overflow" +#endif + +#endif /* __LINUX_OVERFLOW_H__ */ From owner-svn-src-all@freebsd.org Mon Aug 3 09:13:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35F75373F8A; Mon, 3 Aug 2020 09:13:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKscM0dbGz4X0l; Mon, 3 Aug 2020 09:13:07 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED46B1211E; Mon, 3 Aug 2020 09:13:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0739D6GQ020627; Mon, 3 Aug 2020 09:13:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0739D6NH020625; Mon, 3 Aug 2020 09:13:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008030913.0739D6NH020625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Aug 2020 09:13:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363790 - in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 363790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 09:13:07 -0000 Author: hselasky Date: Mon Aug 3 09:13:06 2020 New Revision: 363790 URL: https://svnweb.freebsd.org/changeset/base/363790 Log: MFC r363077: Implement the array_size() function in the LinuxKPI. This function basically multiplies its two arguments and returns SIZE_MAX if the result overflows the size_t type. Else the product of the two arguments is returned. Bump the FreeBSD_version to mitigate issues with existing implementation of array_size() in drm-devel-kmod. Discussed with: manu@ Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:11:10 2020 (r363789) +++ stable/12/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:13:06 2020 (r363790) @@ -31,6 +31,9 @@ #ifndef __LINUX_OVERFLOW_H__ #define __LINUX_OVERFLOW_H__ +#include +#include + #ifndef __has_builtin #define __has_builtin(x) 0 #endif @@ -45,6 +48,16 @@ #if __has_builtin(__builtin_mul_overflow) #define check_mul_overflow(a, b, c) \ __builtin_mul_overflow(a, b, c) + +static inline size_t +array_size(size_t x, size_t y) +{ + size_t retval; + + if (__builtin_mul_overflow(x, y, &retval)) + retval = SIZE_MAX; + return (retval); +} #else #error "Compiler does not support __builtin_mul_overflow" #endif Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Mon Aug 3 09:11:10 2020 (r363789) +++ stable/12/sys/sys/param.h Mon Aug 3 09:13:06 2020 (r363790) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201520 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201521 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Aug 3 09:14:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9D9A373F19; Mon, 3 Aug 2020 09:14:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKsdh4xm3z4XSJ; Mon, 3 Aug 2020 09:14:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D8D812061; Mon, 3 Aug 2020 09:14:16 +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 0739EGTN020733; Mon, 3 Aug 2020 09:14:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0739EGgt020732; Mon, 3 Aug 2020 09:14:16 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008030914.0739EGgt020732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Aug 2020 09:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363791 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 09:14:16 -0000 Author: hselasky Date: Mon Aug 3 09:14:16 2020 New Revision: 363791 URL: https://svnweb.freebsd.org/changeset/base/363791 Log: MFC r361549: Add overflow.h to the LinuxKPI. Only add check_add_overflow and check_mul_overflow as those are the only two needed function by DRM v5.3. Both gcc and clang have builtin to do this check so use them directly but throw an error if the compiler/code checker doesn't support this builtin. Sponsored-by: The FreeBSD Foundation Reviewed by: hselsasky Differential Revision: https://reviews.freebsd.org/D25015 Added: stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h - copied unchanged from r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h (from r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:14:16 2020 (r363791, copy of r361549, head/sys/compat/linuxkpi/common/include/linux/overflow.h) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot 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 __LINUX_OVERFLOW_H__ +#define __LINUX_OVERFLOW_H__ + +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + +#if __has_builtin(__builtin_add_overflow) +#define check_add_overflow(a, b, c) \ + __builtin_add_overflow(a, b, c) +#else +#error "Compiler does not support __builtin_add_overflow" +#endif + +#if __has_builtin(__builtin_mul_overflow) +#define check_mul_overflow(a, b, c) \ + __builtin_mul_overflow(a, b, c) +#else +#error "Compiler does not support __builtin_mul_overflow" +#endif + +#endif /* __LINUX_OVERFLOW_H__ */ From owner-svn-src-all@freebsd.org Mon Aug 3 09:15:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 837E2373FB0; Mon, 3 Aug 2020 09:15:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKsgH2pmlz4XQZ; Mon, 3 Aug 2020 09:15:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 43EEC12062; Mon, 3 Aug 2020 09:15:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0739FdoG020862; Mon, 3 Aug 2020 09:15:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0739Fcqh020861; Mon, 3 Aug 2020 09:15:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008030915.0739Fcqh020861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Aug 2020 09:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363792 - in stable/11/sys: compat/linuxkpi/common/include/linux sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys: compat/linuxkpi/common/include/linux sys X-SVN-Commit-Revision: 363792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 09:15:39 -0000 Author: hselasky Date: Mon Aug 3 09:15:38 2020 New Revision: 363792 URL: https://svnweb.freebsd.org/changeset/base/363792 Log: MFC r363077: Implement the array_size() function in the LinuxKPI. This function basically multiplies its two arguments and returns SIZE_MAX if the result overflows the size_t type. Else the product of the two arguments is returned. Bump the FreeBSD_version to mitigate issues with existing implementation of array_size() in drm-devel-kmod. Discussed with: manu@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:14:16 2020 (r363791) +++ stable/11/sys/compat/linuxkpi/common/include/linux/overflow.h Mon Aug 3 09:15:38 2020 (r363792) @@ -31,6 +31,9 @@ #ifndef __LINUX_OVERFLOW_H__ #define __LINUX_OVERFLOW_H__ +#include +#include + #ifndef __has_builtin #define __has_builtin(x) 0 #endif @@ -45,6 +48,16 @@ #if __has_builtin(__builtin_mul_overflow) #define check_mul_overflow(a, b, c) \ __builtin_mul_overflow(a, b, c) + +static inline size_t +array_size(size_t x, size_t y) +{ + size_t retval; + + if (__builtin_mul_overflow(x, y, &retval)) + retval = SIZE_MAX; + return (retval); +} #else #error "Compiler does not support __builtin_mul_overflow" #endif Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Mon Aug 3 09:14:16 2020 (r363791) +++ stable/11/sys/sys/param.h Mon Aug 3 09:15:38 2020 (r363792) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104503 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104504 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Mon Aug 3 09:19:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54E923743A8; Mon, 3 Aug 2020 09:19:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKsl81cSJz4Xfm; Mon, 3 Aug 2020 09:19:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 170401227D; Mon, 3 Aug 2020 09:19:00 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0739Ixgw021061; Mon, 3 Aug 2020 09:18:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0739Ixib021060; Mon, 3 Aug 2020 09:18:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008030918.0739Ixib021060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Aug 2020 09:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363793 - stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 09:19:00 -0000 Author: hselasky Date: Mon Aug 3 09:18:59 2020 New Revision: 363793 URL: https://svnweb.freebsd.org/changeset/base/363793 Log: MFC r363078: Implement the bitmap_subset() function in the LinuxKPI. This function checks if the bitmap pointed to by the first argument is a subset of the bitmap pointed to by the second argument. The function returns one on success and zero on failure. Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/bitmap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/bitmap.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/bitmap.h Mon Aug 3 09:15:38 2020 (r363792) +++ stable/12/sys/compat/linuxkpi/common/include/linux/bitmap.h Mon Aug 3 09:18:59 2020 (r363793) @@ -243,6 +243,28 @@ bitmap_equal(const unsigned long *pa, return (1); } +static inline int +bitmap_subset(const unsigned long *pa, + const unsigned long *pb, unsigned size) +{ + const unsigned end = BIT_WORD(size); + const unsigned tail = size & (BITS_PER_LONG - 1); + unsigned i; + + for (i = 0; i != end; i++) { + if (pa[i] & ~pb[i]) + return (0); + } + + if (tail) { + const unsigned long mask = BITMAP_LAST_WORD_MASK(tail); + + if (pa[end] & ~pb[end] & mask) + return (0); + } + return (1); +} + static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, const unsigned int size) From owner-svn-src-all@freebsd.org Mon Aug 3 09:20:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 528063743E6; Mon, 3 Aug 2020 09:20:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKsmx1bTxz4XvQ; Mon, 3 Aug 2020 09:20:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A0B212068; Mon, 3 Aug 2020 09:20:33 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0739KWdO021224; Mon, 3 Aug 2020 09:20:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0739KWEk021223; Mon, 3 Aug 2020 09:20:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202008030920.0739KWEk021223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 3 Aug 2020 09:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363794 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363794 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 09:20:33 -0000 Author: hselasky Date: Mon Aug 3 09:20:32 2020 New Revision: 363794 URL: https://svnweb.freebsd.org/changeset/base/363794 Log: MFC r363078: Implement the bitmap_subset() function in the LinuxKPI. This function checks if the bitmap pointed to by the first argument is a subset of the bitmap pointed to by the second argument. The function returns one on success and zero on failure. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h Mon Aug 3 09:18:59 2020 (r363793) +++ stable/11/sys/compat/linuxkpi/common/include/linux/bitmap.h Mon Aug 3 09:20:32 2020 (r363794) @@ -243,6 +243,28 @@ bitmap_equal(const unsigned long *pa, return (1); } +static inline int +bitmap_subset(const unsigned long *pa, + const unsigned long *pb, unsigned size) +{ + const unsigned end = BIT_WORD(size); + const unsigned tail = size & (BITS_PER_LONG - 1); + unsigned i; + + for (i = 0; i != end; i++) { + if (pa[i] & ~pb[i]) + return (0); + } + + if (tail) { + const unsigned long mask = BITMAP_LAST_WORD_MASK(tail); + + if (pa[end] & ~pb[end] & mask) + return (0); + } + return (1); +} + static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, const unsigned int size) From owner-svn-src-all@freebsd.org Mon Aug 3 10:19:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17B92375B5B; Mon, 3 Aug 2020 10:19:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKv5N6y8bz4bv6; Mon, 3 Aug 2020 10:19:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9B7712B53; Mon, 3 Aug 2020 10:19:52 +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 073AJqo6058094; Mon, 3 Aug 2020 10:19:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073AJpwk058088; Mon, 3 Aug 2020 10:19:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008031019.073AJpwk058088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Aug 2020 10:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363795 - in head/sys: arm/broadcom/bcm2835 conf dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 conf dev/usb/controller X-SVN-Commit-Revision: 363795 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 10:19:53 -0000 Author: andrew Date: Mon Aug 3 10:19:50 2020 New Revision: 363795 URL: https://svnweb.freebsd.org/changeset/base/363795 Log: Handle Raspberry Pi 4 xhci firmware loading. The newer hardware revisions of the Raspberry Pi 4 removed the ability of the VIA VL805 xhci controller to load its own firmware. Instead the firmware must be installed at the appropriate time by the VideoCore coprocessor. Submitted by: Robert Crowston Differential Revision: https://reviews.freebsd.org/D25261 Added: head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h head/sys/arm/broadcom/bcm2835/files.bcm283x head/sys/conf/files.arm64 head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c Mon Aug 3 10:19:50 2020 (r363795) @@ -397,10 +397,10 @@ int bcm2835_mbox_property(void *msg, size_t msg_size) { struct bcm_mbox_softc *sc; - struct msg_set_power_state *buf; bus_dma_tag_t msg_tag; bus_dmamap_t msg_map; bus_addr_t msg_phys; + char *buf; uint32_t reg; device_t mbox; int err; @@ -468,6 +468,26 @@ bcm2835_mbox_set_power_state(uint32_t device_id, boole } int +bcm2835_mbox_notify_xhci_reset(uint32_t pci_dev_addr) +{ + struct msg_notify_xhci_reset msg; + int err; + + memset(&msg, 0, sizeof(msg)); + msg.hdr.buf_size = sizeof(msg); + msg.hdr.code = BCM2835_MBOX_CODE_REQ; + msg.tag_hdr.tag = BCM2835_MBOX_TAG_NOTIFY_XHCI_RESET; + msg.tag_hdr.val_buf_size = sizeof(msg.body); + msg.tag_hdr.val_len = sizeof(msg.body.req); + msg.body.req.pci_device_addr = pci_dev_addr; + msg.end_tag = 0; + + err = bcm2835_mbox_property(&msg, sizeof(msg)); + + return (err); +} + +int bcm2835_mbox_get_clock_rate(uint32_t clock_id, uint32_t *hz) { struct msg_get_clock_rate msg; @@ -572,3 +592,4 @@ bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb) return (err); } + Modified: head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/arm/broadcom/bcm2835/bcm2835_mbox_prop.h Mon Aug 3 10:19:50 2020 (r363795) @@ -112,6 +112,24 @@ struct msg_set_power_state { /* Sets the power state for a given device */ int bcm2835_mbox_set_power_state(uint32_t, boolean_t); +#define BCM2835_MBOX_TAG_NOTIFY_XHCI_RESET 0x00030058 + +struct msg_notify_xhci_reset { + struct bcm2835_mbox_hdr hdr; + struct bcm2835_mbox_tag_hdr tag_hdr; + union { + struct { + uint32_t pci_device_addr; + } req; + struct { + } resp; + } body; + uint32_t end_tag; +}; + +/* Prompts the VideoCore processor to reload the xhci firmware. */ +int bcm2835_mbox_notify_xhci_reset(uint32_t); + #define BCM2835_MBOX_CLOCK_ID_EMMC 0x00000001 #define BCM2838_MBOX_CLOCK_ID_EMMC2 0x0000000c Added: head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2838_xhci.c Mon Aug 3 10:19:50 2020 (r363795) @@ -0,0 +1,217 @@ +/*- + * SPDX-License-Identifier: ISC + * + * Copyright (c) 2020 Dr Robert Harvey Crowston + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * + * $FreeBSD$ + * + */ + +/* + * VIA VL805 controller on the Raspberry Pi 4. + * The VL805 is a generic xhci controller. However, in the newer hardware + * revisions of the Raspberry Pi 4, it is incapable of loading its own firmware. + * Instead, the VideoCore GPU must load the firmware into the controller at the + * appropriate time. This driver is a shim that pre-loads the firmware before + * handing control to the xhci generic driver. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define VL805_FIRMWARE_REG 0x50 +#define PCIE_BUS_SHIFT 20 +#define PCIE_SLOT_SHIFT 15 +#define PCIE_FUNC_SHIFT 12 + +static int +bcm_xhci_probe(device_t dev) +{ + phandle_t root; + uint32_t device_id; + + device_id = pci_get_devid(dev); + if (device_id != 0x34831106) /* VIA VL805 USB 3.0 controller. */ + return (ENXIO); + + /* + * The VIA chip is not unique to the Pi, but we only want to use this + * driver if the SoC is a Raspberry Pi 4. Walk the device tree to + * discover if the system is a Pi 4. + */ + root = OF_finddevice("/"); + if (root == -1) + return (ENXIO); + if (!ofw_bus_node_is_compatible(root, "raspberrypi,4-model-b")) + return (ENXIO); + + /* + * On the Pi 4, the VIA chip with the firmware-loading limitation is + * soldered-on to a particular bus/slot/function. But, it's possible a + * user could desolder the VIA chip, replace it with a pci-pci bridge, + * then plug in a commodity VIA PCI-e card on the new bridge. In that + * case we don't want to try to load the firmware to a commodity + * expansion card. + */ + if (pci_get_bus(dev) != 1 || pci_get_slot(dev) != 0 || + pci_get_function(dev) != 0 ) + return (ENXIO); + + device_set_desc(dev, + "VL805 USB 3.0 controller (on the Raspberry Pi 4b)"); + + return (BUS_PROBE_SPECIFIC); +} + +static uint32_t +bcm_xhci_check_firmware(device_t dev, bool expect_loaded) +{ + uint32_t revision; + bool loaded; + + revision = pci_read_config(dev, VL805_FIRMWARE_REG, 4); + loaded = !(revision == 0 || revision == 0xffffffff); + + if (expect_loaded && !loaded) + device_printf(dev, "warning: xhci firmware not found.\n"); + else if (bootverbose && !loaded) + device_printf(dev, "note: xhci firmware not found.\n"); + else if (bootverbose) + device_printf(dev, + "note: xhci firmware detected; firmware is revision %x.\n", + revision); + + if (!loaded) + return 0; + + return (revision); +} + +static void +bcm_xhci_install_xhci_firmware(device_t dev) +{ + uint32_t revision, dev_addr; + int error; + + revision = bcm_xhci_check_firmware(dev, false); + if (revision > 0) { + /* + * With the pre-June 2020 boot firmware, it does not seem + * possible to reload already-installed xhci firmware. + */ + return; + } + + /* + * Notify the VideoCore gpu processor that it needs to reload the xhci + * firmware into the xhci controller. This needs to happen after the pci + * bridge topology is registered with the controller. + */ + if (bootverbose) + device_printf(dev, "note: installing xhci firmware.\n"); + + dev_addr = + pci_get_bus(dev) << PCIE_BUS_SHIFT | + pci_get_slot(dev) << PCIE_SLOT_SHIFT | + pci_get_function(dev) << PCIE_FUNC_SHIFT; + + error = bcm2835_mbox_notify_xhci_reset(dev_addr); + if (error) + device_printf(dev, + "warning: xhci firmware install failed (error %d).\n", + error); + + DELAY(1000); + bcm_xhci_check_firmware(dev, true); + + return; +} + +static int +bcm_xhci_attach(device_t dev) +{ + struct xhci_softc *sc; + int error; + + sc = device_get_softc(dev); + + bcm_xhci_install_xhci_firmware(dev); + + error = xhci_pci_attach(dev); + if (error) + return (error); + + /* 32 bit DMA is a limitation of the PCI-e controller, not the VL805. */ + sc->sc_bus.dma_bits = 32; + if (bootverbose) + device_printf(dev, "note: switched to 32-bit DMA.\n"); + + return (0); +} + +/* + * Device method table. + */ +static device_method_t bcm_xhci_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, bcm_xhci_probe), + DEVMETHOD(device_attach, bcm_xhci_attach), +}; + +DEFINE_CLASS_1(bcm_xhci, bcm_xhci_driver, bcm_xhci_methods, + sizeof(struct xhci_softc), xhci_pci_driver); + +static devclass_t xhci_devclass; +DRIVER_MODULE(bcm_xhci, pci, bcm_xhci_driver, xhci_devclass, 0, 0); MODULE_DEPEND(bcm_xhci, usb, 1, 1, 1); + Modified: head/sys/arm/broadcom/bcm2835/files.bcm283x ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm283x Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/arm/broadcom/bcm2835/files.bcm283x Mon Aug 3 10:19:50 2020 (r363795) @@ -19,6 +19,7 @@ arm/broadcom/bcm2835/bcm2835_vcbus.c standard arm/broadcom/bcm2835/bcm2835_vcio.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bcm2838_pci.c optional pci +arm/broadcom/bcm2835/bcm2838_xhci.c optional xhci arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt dev/mbox/mbox_if.m standard Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/conf/files.arm64 Mon Aug 3 10:19:50 2020 (r363795) @@ -107,6 +107,7 @@ arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt | soc_brcm_bcm2838 fdt arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 | dwcotg fdt soc_brcm_bcm2838 arm/broadcom/bcm2835/bcm2838_pci.c optional soc_brcm_bcm2838 fdt pci +arm/broadcom/bcm2835/bcm2838_xhci.c optional soc_brcm_bcm2838 fdt pci xhci arm/freescale/vybrid/vf_i2c.c optional vf_i2c iicbus SOC_NXP_LS arm/mv/a37x0_gpio.c optional a37x0_gpio gpio fdt arm/mv/a37x0_iic.c optional a37x0_iic iicbus fdt Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/dev/usb/controller/xhci.h Mon Aug 3 10:19:50 2020 (r363795) @@ -544,5 +544,8 @@ usb_error_t xhci_init(struct xhci_softc *, device_t, u usb_error_t xhci_start_controller(struct xhci_softc *); void xhci_interrupt(struct xhci_softc *); void xhci_uninit(struct xhci_softc *); +int xhci_pci_attach(device_t); + +DECLARE_CLASS(xhci_pci_driver); #endif /* _XHCI_H_ */ Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Mon Aug 3 09:20:32 2020 (r363794) +++ head/sys/dev/usb/controller/xhci_pci.c Mon Aug 3 10:19:50 2020 (r363795) @@ -63,7 +63,6 @@ __FBSDID("$FreeBSD$"); #include "usb_if.h" static device_probe_t xhci_pci_probe; -static device_attach_t xhci_pci_attach; static device_detach_t xhci_pci_detach; static usb_take_controller_t xhci_pci_take_controller; @@ -80,15 +79,12 @@ static device_method_t xhci_device_methods[] = { DEVMETHOD_END }; -static driver_t xhci_driver = { - .name = "xhci", - .methods = xhci_device_methods, - .size = sizeof(struct xhci_softc), -}; +DEFINE_CLASS_0(xhci, xhci_pci_driver, xhci_device_methods, + sizeof(struct xhci_softc)); static devclass_t xhci_devclass; -DRIVER_MODULE(xhci, pci, xhci_driver, xhci_devclass, NULL, NULL); +DRIVER_MODULE(xhci, pci, xhci_pci_driver, xhci_devclass, NULL, NULL); MODULE_DEPEND(xhci, usb, 1, 1, 1); static const char * @@ -223,7 +219,7 @@ xhci_pci_port_route(device_t self, uint32_t set, uint3 return (0); } -static int +int xhci_pci_attach(device_t self) { struct xhci_softc *sc = device_get_softc(self); From owner-svn-src-all@freebsd.org Mon Aug 3 12:48:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42D85379DD5; Mon, 3 Aug 2020 12:48:54 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKyPK3KKJz3WZs; Mon, 3 Aug 2020 12:48:53 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6631147BD; Mon, 3 Aug 2020 12:48:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073CmqRh051121; Mon, 3 Aug 2020 12:48:52 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073CmpJg051118; Mon, 3 Aug 2020 12:48:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202008031248.073CmpJg051118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 3 Aug 2020 12:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363796 - in head: lib/libc/riscv/gen sys/riscv/include X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: lib/libc/riscv/gen sys/riscv/include X-SVN-Commit-Revision: 363796 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 12:48:55 -0000 Author: kp Date: Mon Aug 3 12:48:51 2020 New Revision: 363796 URL: https://svnweb.freebsd.org/changeset/base/363796 Log: libc: Provide sub fp(s|g)etmask() implementations for RISC-V RISC-V doesn't support floating-point exceptions. RISC-V Instruction Set Manual: Volume I: User-Level ISA, 11.2 Floating-Point Control and Status Register: "As allowed by the standard, we do not support traps on floating-point exceptions in the base ISA, but instead require explicit checks of the flags in software. We considered adding branches controlled directly by the contents of the floating-point accrued exception flags, but ultimately chose to omit these instructions to keep the ISA simple." We still need these functions, because some applications (notably Perl) call them, but we cannot provide a meaningful implementation. Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D25740 Added: head/lib/libc/riscv/gen/fpgetmask.c (contents, props changed) head/lib/libc/riscv/gen/fpsetmask.c (contents, props changed) Modified: head/lib/libc/riscv/gen/Makefile.inc head/sys/riscv/include/ieeefp.h Modified: head/lib/libc/riscv/gen/Makefile.inc ============================================================================== --- head/lib/libc/riscv/gen/Makefile.inc Mon Aug 3 10:19:50 2020 (r363795) +++ head/lib/libc/riscv/gen/Makefile.inc Mon Aug 3 12:48:51 2020 (r363796) @@ -3,6 +3,8 @@ SRCS+= _ctx_start.S \ fabs.S \ flt_rounds.c \ + fpgetmask.c \ + fpsetmask.c \ infinity.c \ ldexp.c \ makecontext.c \ Added: head/lib/libc/riscv/gen/fpgetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/riscv/gen/fpgetmask.c Mon Aug 3 12:48:51 2020 (r363796) @@ -0,0 +1,41 @@ +/*- + * Copyright (c) 2020 Axiado + * All rights reserved. + * + * This software was developed by Kristof Provost under + * sponsorship from Axiado. + * + * 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 + +fp_except_t +fpgetmask(void) +{ + + return (0); +} Added: head/lib/libc/riscv/gen/fpsetmask.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/riscv/gen/fpsetmask.c Mon Aug 3 12:48:51 2020 (r363796) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2020 Axiado + * All rights reserved. + * + * This software was developed by Kristof Provost under + * sponsorship from Axiado. + * + * 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 + +/** + * RISC-V doesn't support floating-point exceptions: RISC-V Instruction Set + * Manual: Volume I: User-Level ISA, 11.2 Floating-Point Control and Status + * Register: "As allowed by the standard, we do not support traps on + * floating-point exceptions in the base ISA, but instead require explicit + * checks of the flags in software. We considered adding branches controlled + * directly by the contents of the floating-point accrued exception flags, but + * ultimately chose to omit these instructions to keep the ISA simple." + * + * We still need this function, because some applications (notably Perl) call + * it, but we cannot provide a meaningful implementation. + **/ +fp_except_t +fpsetmask(fp_except_t mask) +{ + + return (0); +} Modified: head/sys/riscv/include/ieeefp.h ============================================================================== --- head/sys/riscv/include/ieeefp.h Mon Aug 3 10:19:50 2020 (r363795) +++ head/sys/riscv/include/ieeefp.h Mon Aug 3 12:48:51 2020 (r363796) @@ -4,5 +4,6 @@ #define _MACHINE_IEEEFP_H_ /* TODO */ +typedef int fp_except_t; #endif /* _MACHINE_IEEEFP_H_ */ From owner-svn-src-all@freebsd.org Mon Aug 3 12:51:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B82237A18E; Mon, 3 Aug 2020 12:51:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKyS26Zp4z3XBg; Mon, 3 Aug 2020 12:51:14 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C549A14B93; Mon, 3 Aug 2020 12:51:14 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073CpEG5054403; Mon, 3 Aug 2020 12:51:14 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073CpEB4054402; Mon, 3 Aug 2020 12:51:14 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202008031251.073CpEB4054402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 3 Aug 2020 12:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363797 - head/contrib/googletest/googletest/test X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/contrib/googletest/googletest/test X-SVN-Commit-Revision: 363797 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 12:51:15 -0000 Author: lwhsu Date: Mon Aug 3 12:51:14 2020 New Revision: 363797 URL: https://svnweb.freebsd.org/changeset/base/363797 Log: Disable tests failing after r363679 PR: 248452 Sponsored by: The FreeBSD Foundation Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc ============================================================================== --- head/contrib/googletest/googletest/test/googletest-port-test.cc Mon Aug 3 12:48:51 2020 (r363796) +++ head/contrib/googletest/googletest/test/googletest-port-test.cc Mon Aug 3 12:51:14 2020 (r363797) @@ -403,6 +403,8 @@ typedef testing::Types< TYPED_TEST_CASE(RETest, StringTypes); // Tests RE's implicit constructors. +/* +https://bugs.freebsd.org/248452 TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE empty(TypeParam("")); EXPECT_STREQ("", empty.pattern()); @@ -413,6 +415,7 @@ TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE normal(TypeParam(".*(\\w+)")); EXPECT_STREQ(".*(\\w+)", normal.pattern()); } +*/ // Tests that RE's constructors reject invalid regular expressions. TYPED_TEST(RETest, RejectsInvalidRegex) { @@ -861,6 +864,8 @@ TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNo } // Tests RE's implicit constructors. +/* +https://bugs.freebsd.org/248452 TEST(RETest, ImplicitConstructorWorks) { const RE empty(""); EXPECT_STREQ("", empty.pattern()); @@ -868,6 +873,7 @@ TEST(RETest, ImplicitConstructorWorks) { const RE simple("hello"); EXPECT_STREQ("hello", simple.pattern()); } +*/ // Tests that RE's constructors reject invalid regular expressions. TEST(RETest, RejectsInvalidRegex) { From owner-svn-src-all@freebsd.org Mon Aug 3 13:12:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4200A37AB54; Mon, 3 Aug 2020 13:12:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BKyw811GKz3YhS; Mon, 3 Aug 2020 13:12:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 072E014E6F; Mon, 3 Aug 2020 13:12:08 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073DC7ZM067632; Mon, 3 Aug 2020 13:12:07 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073DC7Bp067631; Mon, 3 Aug 2020 13:12:07 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202008031312.073DC7Bp067631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Mon, 3 Aug 2020 13:12:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363798 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 363798 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 13:12:08 -0000 Author: 0mp (doc,ports committer) Date: Mon Aug 3 13:12:07 2020 New Revision: 363798 URL: https://svnweb.freebsd.org/changeset/base/363798 Log: Do not mention portsnap(8) in ports.7 As we are moving away from portsnap, let's not recommend it in the manual page. Reviewed by: bcr (manpages), mat (portmgr) Differential Revision: https://reviews.freebsd.org/D25847 Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Mon Aug 3 12:51:14 2020 (r363797) +++ head/share/man/man7/ports.7 Mon Aug 3 13:12:07 2020 (r363798) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2020 +.Dd August 3, 2020 .Dt PORTS 7 .Os .Sh NAME @@ -70,9 +70,7 @@ branch contains all the latest changes, while the branches only provide critical fixes. The .Em head -branch can be installed or updated using either -.Xr portsnap 8 , -or from Subversion repository at: +branch can be installed or updated from the Subversion repository located at: .Pp .Lk https://svn.FreeBSD.org/ports/head .Pp @@ -626,8 +624,7 @@ is going to be built with Python 3.7 support.) .Xr make 1 , .Xr make.conf 5 , .Xr development 7 , -.Xr pkg 7 , -.Xr portsnap 8 +.Xr pkg 7 .Pp Additional developer documentation: .Bl -dash -width "" -offset indent From owner-svn-src-all@freebsd.org Mon Aug 3 16:26:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC0A237F7FA; Mon, 3 Aug 2020 16:26:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL3D34c69z438p; Mon, 3 Aug 2020 16:26:11 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 817AC174C0; Mon, 3 Aug 2020 16:26:11 +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 073GQBC7089142; Mon, 3 Aug 2020 16:26:11 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073GQBB5089141; Mon, 3 Aug 2020 16:26:11 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008031626.073GQBB5089141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Aug 2020 16:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363799 - head/sys/dev/fdt X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/fdt X-SVN-Commit-Revision: 363799 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 16:26:11 -0000 Author: andrew Date: Mon Aug 3 16:26:10 2020 New Revision: 363799 URL: https://svnweb.freebsd.org/changeset/base/363799 Log: Allow child classes of simplebus to call attach directly Reduce code duplication when a bus is subclassed from simplebus by allowing them to call simplebus_attach directly. This is useful when the child bus will just implement the same calls. As not all children will expect to have a ranges property, e.g. the Raspberry Pi firmware, allow this property to be missing. Reviewed by: manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25925 Modified: head/sys/dev/fdt/simplebus.c head/sys/dev/fdt/simplebus.h Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Mon Aug 3 13:12:07 2020 (r363798) +++ head/sys/dev/fdt/simplebus.c Mon Aug 3 16:26:10 2020 (r363799) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); * Bus interface. */ static int simplebus_probe(device_t dev); -static int simplebus_attach(device_t dev); static struct resource *simplebus_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static void simplebus_probe_nomatch(device_t bus, device_t child); @@ -134,7 +133,7 @@ simplebus_probe(device_t dev) return (BUS_PROBE_GENERIC); } -static int +int simplebus_attach(device_t dev) { struct simplebus_softc *sc; @@ -142,7 +141,8 @@ simplebus_attach(device_t dev) sc = device_get_softc(dev); simplebus_init(dev, 0); - if (simplebus_fill_ranges(sc->node, sc) < 0) { + if ((sc->flags & SB_FLAG_NO_RANGES) == 0 && + simplebus_fill_ranges(sc->node, sc) < 0) { device_printf(dev, "could not get ranges\n"); return (ENXIO); } Modified: head/sys/dev/fdt/simplebus.h ============================================================================== --- head/sys/dev/fdt/simplebus.h Mon Aug 3 13:12:07 2020 (r363798) +++ head/sys/dev/fdt/simplebus.h Mon Aug 3 16:26:10 2020 (r363799) @@ -47,6 +47,8 @@ struct simplebus_softc { struct simplebus_range *ranges; int nranges; +#define SB_FLAG_NO_RANGES (1 << 0) /* Bus doesn't have ranges property */ + int flags; pcell_t acells, scells; }; @@ -63,4 +65,7 @@ struct simplebus_devinfo *simplebus_setup_dinfo(device struct simplebus_devinfo *di); int simplebus_fill_ranges(phandle_t node, struct simplebus_softc *sc); + +int simplebus_attach(device_t dev); + #endif /* _FDT_SIMPLEBUS_H */ From owner-svn-src-all@freebsd.org Mon Aug 3 16:43:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5F31F37FDB9; Mon, 3 Aug 2020 16:43:41 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL3cF1vy4z44wp; Mon, 3 Aug 2020 16:43: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AAC217904; Mon, 3 Aug 2020 16:43: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 073GheAF002211; Mon, 3 Aug 2020 16:43:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073Ghewx002210; Mon, 3 Aug 2020 16:43:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008031643.073Ghewx002210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Aug 2020 16:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363800 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 363800 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 16:43:41 -0000 Author: andrew Date: Mon Aug 3 16:43:40 2020 New Revision: 363800 URL: https://svnweb.freebsd.org/changeset/base/363800 Log: Allow the Raspberry Pi firmware driver to be a bus There are child nodes in the device tree, e.g. the Raspberry Pi firmware GPIO device. Add support for this to be a bus so we can attach these children. Reviewed by: manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25848 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Mon Aug 3 16:26:10 2020 (r363799) +++ head/sys/arm/broadcom/bcm2835/bcm2835_firmware.c Mon Aug 3 16:43:40 2020 (r363800) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include @@ -47,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include struct bcm2835_firmware_softc { - device_t sc_dev; + struct simplebus_softc sc; phandle_t sc_mbox; }; @@ -82,7 +84,6 @@ bcm2835_firmware_attach(device_t dev) int rv; sc = device_get_softc(dev); - sc->sc_dev = dev; node = ofw_bus_get_node(dev); rv = OF_getencprop(node, "mboxes", &mbox, sizeof(mbox)); @@ -94,14 +95,17 @@ bcm2835_firmware_attach(device_t dev) OF_device_register_xref(OF_xref_from_node(node), dev); - ctx = device_get_sysctl_ctx(sc->sc_dev); - tree_node = device_get_sysctl_tree(sc->sc_dev); + ctx = device_get_sysctl_ctx(dev); + tree_node = device_get_sysctl_tree(dev); tree = SYSCTL_CHILDREN(tree_node); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "revision", CTLTYPE_UINT | CTLFLAG_RD, sc, sizeof(*sc), sysctl_bcm2835_firmware_get_revision, "IU", "Firmware revision"); - return (0); + + /* The firmwaare doesn't have a ranges property */ + sc->sc.flags |= SB_FLAG_NO_RANGES; + return (simplebus_attach(dev)); } int @@ -150,7 +154,7 @@ sysctl_bcm2835_firmware_get_revision(SYSCTL_HANDLER_AR uint32_t rev; int err; - if (bcm2835_firmware_property(sc->sc_dev, + if (bcm2835_firmware_property(sc->sc.dev, BCM2835_MBOX_TAG_FIRMWARE_REVISION, &rev, sizeof(rev)) != 0) return (ENXIO); @@ -171,11 +175,9 @@ static device_method_t bcm2835_firmware_methods[] = { }; static devclass_t bcm2835_firmware_devclass; -static driver_t bcm2835_firmware_driver = { - "bcm2835_firmware", - bcm2835_firmware_methods, - sizeof(struct bcm2835_firmware_softc), -}; +DEFINE_CLASS_1(bcm2835_firmware, bcm2835_firmware_driver, + bcm2835_firmware_methods, sizeof(struct bcm2835_firmware_softc), + simplebus_driver); EARLY_DRIVER_MODULE(bcm2835_firmware, simplebus, bcm2835_firmware_driver, bcm2835_firmware_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); From owner-svn-src-all@freebsd.org Mon Aug 3 17:17:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 321B83A2011; Mon, 3 Aug 2020 17:17:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL4M20Yqrz46ts; Mon, 3 Aug 2020 17:17: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC2E017D9D; Mon, 3 Aug 2020 17:17: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 073HHHrJ021312; Mon, 3 Aug 2020 17:17:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073HHHEv021311; Mon, 3 Aug 2020 17:17:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008031717.073HHHEv021311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Aug 2020 17:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363801 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363801 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 17:17:18 -0000 Author: kib Date: Mon Aug 3 17:17:17 2020 New Revision: 363801 URL: https://svnweb.freebsd.org/changeset/base/363801 Log: Provide more correct description for sysctl kern.smp.cores. Reported by: dewayne@heuristicsystems.com.au PR: 248454 Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Mon Aug 3 16:43:40 2020 (r363800) +++ head/sys/kern/subr_smp.c Mon Aug 3 17:17:17 2020 (r363801) @@ -104,7 +104,7 @@ SYSCTL_INT(_kern_smp, OID_AUTO, threads_per_core, CTLF int mp_ncores = -1; /* how many physical cores running */ SYSCTL_INT(_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncores, 0, - "Number of CPUs online"); + "Number of physical cores online"); int smp_topology = 0; /* Which topology we're using. */ SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, &smp_topology, 0, From owner-svn-src-all@freebsd.org Mon Aug 3 17:18:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B10F53A1A6C; Mon, 3 Aug 2020 17:18:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL4N541gwz47Xf; Mon, 3 Aug 2020 17:18:13 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 550E517D1C; Mon, 3 Aug 2020 17:18:13 +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 073HIDPs021419; Mon, 3 Aug 2020 17:18:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073HIDPi021417; Mon, 3 Aug 2020 17:18:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008031718.073HIDPi021417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 3 Aug 2020 17:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363802 - in head/sys: arm/broadcom/bcm2835 conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 conf X-SVN-Commit-Revision: 363802 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 17:18:13 -0000 Author: andrew Date: Mon Aug 3 17:18:12 2020 New Revision: 363802 URL: https://svnweb.freebsd.org/changeset/base/363802 Log: Add a GPIO driver for the Raspberry Pi firmware GPIOs These exist on the Raspberry Pi 3 and 4 and control and external IO expander. Reviewed by: manu Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D25858 Added: head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c (contents, props changed) Modified: head/sys/conf/files.arm64 Added: head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/raspberrypi_gpio.c Mon Aug 3 17:18:12 2020 (r363802) @@ -0,0 +1,457 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2012 Oleksandr Tymoshenko + * Copyright (c) 2012-2015 Luiz Otavio O Souza + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "gpio_if.h" + +#define RPI_FW_GPIO_PINS 8 +#define RPI_FW_GPIO_BASE 128 +#define RPI_FW_GPIO_DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) + +struct rpi_fw_gpio_softc { + device_t sc_busdev; + device_t sc_firmware; + struct sx sc_sx; + struct gpio_pin sc_gpio_pins[RPI_FW_GPIO_PINS]; + uint8_t sc_gpio_state; +}; + +#define RPI_FW_GPIO_LOCK(_sc) sx_xlock(&(_sc)->sc_sx) +#define RPI_FW_GPIO_UNLOCK(_sc) sx_xunlock(&(_sc)->sc_sx) + +static struct ofw_compat_data compat_data[] = { + {"raspberrypi,firmware-gpio", 1}, + {NULL, 0} +}; + +static int +rpi_fw_gpio_pin_configure(struct rpi_fw_gpio_softc *sc, struct gpio_pin *pin, + unsigned int flags) +{ + union msg_get_gpio_config old_cfg; + union msg_set_gpio_config new_cfg; + int rv; + + bzero(&old_cfg, sizeof(old_cfg)); + bzero(&new_cfg, sizeof(new_cfg)); + old_cfg.req.gpio = RPI_FW_GPIO_BASE + pin->gp_pin; + + RPI_FW_GPIO_LOCK(sc); + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_GET_GPIO_CONFIG, &old_cfg, sizeof(old_cfg)); + if (rv == 0 && old_cfg.resp.gpio != 0) + rv = EIO; + if (rv != 0) + goto fail; + + new_cfg.req.gpio = RPI_FW_GPIO_BASE + pin->gp_pin; + if (flags & GPIO_PIN_INPUT) { + new_cfg.req.dir = BCM2835_FIRMWARE_GPIO_IN; + new_cfg.req.state = 0; + pin->gp_flags = GPIO_PIN_INPUT; + } else if (flags & GPIO_PIN_OUTPUT) { + new_cfg.req.dir = BCM2835_FIRMWARE_GPIO_OUT; + if (flags & (GPIO_PIN_PRESET_HIGH | GPIO_PIN_PRESET_LOW)) { + if (flags & GPIO_PIN_PRESET_HIGH) { + new_cfg.req.state = 1; + sc->sc_gpio_state |= (1 << pin->gp_pin); + } else { + new_cfg.req.state = 0; + sc->sc_gpio_state &= ~(1 << pin->gp_pin); + } + } else { + if ((sc->sc_gpio_state & (1 << pin->gp_pin)) != 0) { + new_cfg.req.state = 1; + } else { + new_cfg.req.state = 0; + } + } + pin->gp_flags = GPIO_PIN_OUTPUT; + } else { + new_cfg.req.dir = old_cfg.resp.dir; + /* Use the old state to decide high/low */ + if ((sc->sc_gpio_state & (1 << pin->gp_pin)) != 0) + new_cfg.req.state = 1; + else + new_cfg.req.state = 0; + } + new_cfg.req.pol = old_cfg.resp.pol; + new_cfg.req.term_en = 0; + new_cfg.req.term_pull_up = 0; + + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_SET_GPIO_CONFIG, &new_cfg, sizeof(new_cfg)); + +fail: + RPI_FW_GPIO_UNLOCK(sc); + + return (rv); +} + +static device_t +rpi_fw_gpio_get_bus(device_t dev) +{ + struct rpi_fw_gpio_softc *sc; + + sc = device_get_softc(dev); + + return (sc->sc_busdev); +} + +static int +rpi_fw_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = RPI_FW_GPIO_PINS - 1; + return (0); +} + +static int +rpi_fw_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct rpi_fw_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + *caps = RPI_FW_GPIO_DEFAULT_CAPS; + return (0); +} + +static int +rpi_fw_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct rpi_fw_gpio_softc *sc = device_get_softc(dev); + int i; + + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + RPI_FW_GPIO_LOCK(sc); + *flags = sc->sc_gpio_pins[i].gp_flags; + RPI_FW_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rpi_fw_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct rpi_fw_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + RPI_FW_GPIO_LOCK(sc); + memcpy(name, sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME); + RPI_FW_GPIO_UNLOCK(sc); + + return (0); +} + +static int +rpi_fw_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct rpi_fw_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + return (rpi_fw_gpio_pin_configure(sc, &sc->sc_gpio_pins[i], flags)); +} + +static int +rpi_fw_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct rpi_fw_gpio_softc *sc; + union msg_set_gpio_state state; + int i, rv; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + state.req.gpio = RPI_FW_GPIO_BASE + pin; + state.req.state = value; + + RPI_FW_GPIO_LOCK(sc); + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_SET_GPIO_STATE, &state, sizeof(state)); + /* The firmware sets gpio to 0 on success */ + if (rv == 0 && state.resp.gpio != 0) + rv = EINVAL; + if (rv == 0) { + sc->sc_gpio_pins[i].gp_flags &= ~(GPIO_PIN_PRESET_HIGH | + GPIO_PIN_PRESET_LOW); + if (value) + sc->sc_gpio_state |= (1 << i); + else + sc->sc_gpio_state &= ~(1 << i); + } + RPI_FW_GPIO_UNLOCK(sc); + + return (rv); +} + +static int +rpi_fw_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct rpi_fw_gpio_softc *sc; + union msg_get_gpio_state state; + int i, rv; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + bzero(&state, sizeof(state)); + state.req.gpio = RPI_FW_GPIO_BASE + pin; + + RPI_FW_GPIO_LOCK(sc); + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_GET_GPIO_STATE, &state, sizeof(state)); + RPI_FW_GPIO_UNLOCK(sc); + + /* The firmware sets gpio to 0 on success */ + if (rv == 0 && state.resp.gpio != 0) + rv = EINVAL; + if (rv == 0) + *val = !state.resp.state; + + return (rv); +} + +static int +rpi_fw_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct rpi_fw_gpio_softc *sc; + union msg_get_gpio_state old_state; + union msg_set_gpio_state new_state; + int i, rv; + + sc = device_get_softc(dev); + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + if (sc->sc_gpio_pins[i].gp_pin == pin) + break; + } + if (i >= RPI_FW_GPIO_PINS) + return (EINVAL); + + bzero(&old_state, sizeof(old_state)); + bzero(&new_state, sizeof(new_state)); + + old_state.req.gpio = RPI_FW_GPIO_BASE + pin; + new_state.req.gpio = RPI_FW_GPIO_BASE + pin; + + RPI_FW_GPIO_LOCK(sc); + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_GET_GPIO_STATE, &old_state, sizeof(old_state)); + /* The firmware sets gpio to 0 on success */ + if (rv == 0 && old_state.resp.gpio == 0) { + /* Set the new state to invert the GPIO */ + new_state.req.state = !old_state.resp.state; + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_SET_GPIO_STATE, &new_state, + sizeof(new_state)); + } + if (rv == 0 && (old_state.resp.gpio != 0 || new_state.resp.gpio != 0)) + rv = EINVAL; + RPI_FW_GPIO_UNLOCK(sc); + + return (rv); +} + +static int +rpi_fw_gpio_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Raspberry Pi Firmware GPIO controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +rpi_fw_gpio_attach(device_t dev) +{ + union msg_get_gpio_config cfg; + struct rpi_fw_gpio_softc *sc; + char *names; + phandle_t gpio; + int i, nelems, elm_pos, rv; + + sc = device_get_softc(dev); + sc->sc_firmware = device_get_parent(dev); + sx_init(&sc->sc_sx, "Raspberry Pi firmware gpio"); + /* Find our node. */ + gpio = ofw_bus_get_node(dev); + if (!OF_hasprop(gpio, "gpio-controller")) + /* This is not a GPIO controller. */ + goto fail; + + nelems = OF_getprop_alloc(gpio, "gpio-line-names", (void **)&names); + if (nelems <= 0) + names = NULL; + elm_pos = 0; + for (i = 0; i < RPI_FW_GPIO_PINS; i++) { + /* Set the current pin name */ + if (names != NULL && elm_pos < nelems && + names[elm_pos] != '\0') { + snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, + "%s", names + elm_pos); + /* Find the next pin name */ + elm_pos += strlen(names + elm_pos) + 1; + } else { + snprintf(sc->sc_gpio_pins[i].gp_name, GPIOMAXNAME, + "pin %d", i); + } + + sc->sc_gpio_pins[i].gp_pin = i; + sc->sc_gpio_pins[i].gp_caps = RPI_FW_GPIO_DEFAULT_CAPS; + + bzero(&cfg, sizeof(cfg)); + cfg.req.gpio = RPI_FW_GPIO_BASE + i; + rv = bcm2835_firmware_property(sc->sc_firmware, + BCM2835_FIRMWARE_TAG_GET_GPIO_CONFIG, &cfg, sizeof(cfg)); + if (rv == 0 && cfg.resp.gpio == 0) { + if (cfg.resp.dir == BCM2835_FIRMWARE_GPIO_IN) + sc->sc_gpio_pins[i].gp_flags = GPIO_PIN_INPUT; + else + sc->sc_gpio_pins[i].gp_flags = GPIO_PIN_OUTPUT; + } else { + sc->sc_gpio_pins[i].gp_flags = GPIO_PIN_INPUT; + } + } + free(names, M_OFWPROP); + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) + goto fail; + + return (0); + +fail: + sx_destroy(&sc->sc_sx); + + return (ENXIO); +} + +static int +rpi_fw_gpio_detach(device_t dev) +{ + + return (EBUSY); +} + +static device_method_t rpi_fw_gpio_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, rpi_fw_gpio_probe), + DEVMETHOD(device_attach, rpi_fw_gpio_attach), + DEVMETHOD(device_detach, rpi_fw_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_get_bus, rpi_fw_gpio_get_bus), + DEVMETHOD(gpio_pin_max, rpi_fw_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, rpi_fw_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, rpi_fw_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, rpi_fw_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, rpi_fw_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, rpi_fw_gpio_pin_get), + DEVMETHOD(gpio_pin_set, rpi_fw_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, rpi_fw_gpio_pin_toggle), + + DEVMETHOD_END +}; + +static devclass_t rpi_fw_gpio_devclass; + +static driver_t rpi_fw_gpio_driver = { + "gpio", + rpi_fw_gpio_methods, + sizeof(struct rpi_fw_gpio_softc), +}; + +EARLY_DRIVER_MODULE(rpi_fw_gpio, bcm2835_firmware, rpi_fw_gpio_driver, + rpi_fw_gpio_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon Aug 3 17:17:17 2020 (r363801) +++ head/sys/conf/files.arm64 Mon Aug 3 17:18:12 2020 (r363802) @@ -108,6 +108,7 @@ arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 | dwcotg fdt soc_brcm_bcm2838 arm/broadcom/bcm2835/bcm2838_pci.c optional soc_brcm_bcm2838 fdt pci arm/broadcom/bcm2835/bcm2838_xhci.c optional soc_brcm_bcm2838 fdt pci xhci +arm/broadcom/bcm2835/raspberrypi_gpio.c optional soc_brcm_bcm2837 gpio | soc_brcm_bcm2838 gpio arm/freescale/vybrid/vf_i2c.c optional vf_i2c iicbus SOC_NXP_LS arm/mv/a37x0_gpio.c optional a37x0_gpio gpio fdt arm/mv/a37x0_iic.c optional a37x0_iic iicbus fdt From owner-svn-src-all@freebsd.org Mon Aug 3 17:53:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31C443A3373; Mon, 3 Aug 2020 17:53:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL58X0bh5z4BVt; Mon, 3 Aug 2020 17:53:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC07118433; Mon, 3 Aug 2020 17:53:15 +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 073HrFop046260; Mon, 3 Aug 2020 17:53:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073HrF9c046259; Mon, 3 Aug 2020 17:53:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008031753.073HrF9c046259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 3 Aug 2020 17:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363804 - head/lib/ncurses/ncurses X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/ncurses/ncurses X-SVN-Commit-Revision: 363804 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 17:53:16 -0000 Author: jhb Date: Mon Aug 3 17:53:15 2020 New Revision: 363804 URL: https://svnweb.freebsd.org/changeset/base/363804 Log: Pass the full CFLAGS to cpp for MKlib_gen.sh. GCC's cpp was exiting immediately when it failed to find requested includes ( and ). clang-cpp emitted an error for the missing header files but continued processing the file (thus not honoring any macros defined in the missing headers). Arguably, the awk script is buggy since it doesn't check the return value of the command it executes. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D25731 Modified: head/lib/ncurses/ncurses/Makefile Modified: head/lib/ncurses/ncurses/Makefile ============================================================================== --- head/lib/ncurses/ncurses/Makefile Mon Aug 3 17:51:57 2020 (r363803) +++ head/lib/ncurses/ncurses/Makefile Mon Aug 3 17:53:15 2020 (r363804) @@ -345,7 +345,7 @@ codes.c: MKcodes.awk ${AWK} -f ${NCURSES_DIR}/ncurses/tinfo/MKcodes.awk bigstrings=${USE_BIG_STRINGS} ${NCURSES_DIR}/include/Caps > codes.c lib_gen.c: MKlib_gen.sh curses.h ncurses_dll.h - LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CPPFLAGS}" \ + LC_ALL=C sh ${NCURSES_DIR}/ncurses/base/MKlib_gen.sh "${CPP:N${CCACHE_BIN}} ${CFLAGS}" \ "${AWK}" generated < curses.h >$@ lib_keyname.c: keys.list MKkeyname.awk From owner-svn-src-all@freebsd.org Mon Aug 3 18:07:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04C0A3A3C3D; Mon, 3 Aug 2020 18:07:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL5SR6Mvyz4CKZ; Mon, 3 Aug 2020 18:07:03 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id BFF8C2B354; Mon, 3 Aug 2020 18:07:02 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.39.20071300 Date: Mon, 03 Aug 2020 11:06:59 -0700 Subject: Re: svn commit: r363733 - head/usr.sbin/bhyve From: Ravi Pokala To: Peter Grehan , , , Message-ID: Thread-Topic: svn commit: r363733 - head/usr.sbin/bhyve References: <202007311210.06VCATN9057871@repo.freebsd.org> In-Reply-To: <202007311210.06VCATN9057871@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 18:07:04 -0000 -----Original Message----- From: on behalf of Peter Grehan Date: 2020-07-31, Friday at 05:10 To: , , Subject: svn commit: r363733 - head/usr.sbin/bhyve Author: grehan Date: Fri Jul 31 12:10:28 2020 New Revision: 363733 URL: https://svnweb.freebsd.org/changeset/base/363733 Log: Replace magic numbers in Identify page register 0 with ATA definitions. No functional change. Verified with objdump output before/after. Requested by: rpokala Reviewed by: rpokala MFC after: 3 weeks Thanks! :-) -Ravi (rpokala@) Modified: head/usr.sbin/bhyve/pci_ahci.c Modified: head/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- head/usr.sbin/bhyve/pci_ahci.c Fri Jul 31 12:09:59 2020 (r363732) +++ head/usr.sbin/bhyve/pci_ahci.c Fri Jul 31 12:10:28 2020 (r363733) @@ -999,7 +999,8 @@ ata_identify_init(struct ahci_port* p, int atapi) struct ata_params* ata_ident = &p->ata_ident; if (atapi) { - ata_ident->config = (2 << 14 | 5 << 8 | 1 << 7 | 2 << 5); + ata_ident->config = ATA_PROTO_ATAPI | ATA_ATAPI_TYPE_CDROM | + ATA_ATAPI_REMOVABLE | ATA_DRQ_FAST; ata_ident->capabilities1 = ATA_SUPPORT_LBA | ATA_SUPPORT_DMA; ata_ident->capabilities2 = (1 << 14 | 1); From owner-svn-src-all@freebsd.org Mon Aug 3 18:08:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C47573A3C4B; Mon, 3 Aug 2020 18:08:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL5Tc4pdGz4Cl5; Mon, 3 Aug 2020 18:08:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8470B17EFC; Mon, 3 Aug 2020 18:08:04 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073I84OO052985; Mon, 3 Aug 2020 18:08:04 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073I84oi052984; Mon, 3 Aug 2020 18:08:04 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008031808.073I84oi052984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 3 Aug 2020 18:08:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363805 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 363805 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 18:08:04 -0000 Author: arichardson Date: Mon Aug 3 18:08:04 2020 New Revision: 363805 URL: https://svnweb.freebsd.org/changeset/base/363805 Log: Allow building setmode.c on Linux/macOS We bootstrap this file to allow compiling FreeBSD on Linux systems since some boostrap tools use setmode(). Unfortunately, glibc's sys/stat.h declares a non-static getumask() function (which is unimplemented!) and that conflicts with the local getumask() function. To work around this simply use a different name here. Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D25929 Modified: head/lib/libc/gen/setmode.c Modified: head/lib/libc/gen/setmode.c ============================================================================== --- head/lib/libc/gen/setmode.c Mon Aug 3 17:53:15 2020 (r363804) +++ head/lib/libc/gen/setmode.c Mon Aug 3 18:08:04 2020 (r363805) @@ -70,7 +70,7 @@ typedef struct bitcmd { #define CMD2_OBITS 0x08 #define CMD2_UBITS 0x10 -static mode_t getumask(void); +static mode_t get_current_umask(void); static BITCMD *addcmd(BITCMD *, mode_t, mode_t, mode_t, mode_t); static void compress_mode(BITCMD *); #ifdef SETMODE_DEBUG @@ -186,7 +186,7 @@ setmode(const char *p) * Get a copy of the mask for the permissions that are mask relative. * Flip the bits, we want what's not set. */ - mask = ~getumask(); + mask = ~get_current_umask(); setlen = SET_LEN + 2; @@ -343,13 +343,14 @@ out: } static mode_t -getumask(void) +get_current_umask(void) { sigset_t sigset, sigoset; size_t len; mode_t mask; u_short smask; +#ifdef KERN_PROC_UMASK /* * First try requesting the umask without temporarily modifying it. * Note that this does not work if the sysctl @@ -359,7 +360,7 @@ getumask(void) if (sysctl((int[4]){ CTL_KERN, KERN_PROC, KERN_PROC_UMASK, 0 }, 4, &smask, &len, NULL, 0) == 0) return (smask); - +#endif /* * Since it's possible that the caller is opening files inside a signal * handler, protect them as best we can. From owner-svn-src-all@freebsd.org Mon Aug 3 18:08:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53F933A3EC2; Mon, 3 Aug 2020 18:08:13 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL5Tm6mM1z4Cnq; Mon, 3 Aug 2020 18:08:12 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1127718617; Mon, 3 Aug 2020 18:08:11 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073I8ACS053039; Mon, 3 Aug 2020 18:08:10 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073I8ANI053038; Mon, 3 Aug 2020 18:08:10 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202008031808.073I8ANI053038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 3 Aug 2020 18:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363806 - head/usr.sbin/nmtree X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.sbin/nmtree X-SVN-Commit-Revision: 363806 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 18:08:13 -0000 Author: arichardson Date: Mon Aug 3 18:08:10 2020 New Revision: 363806 URL: https://svnweb.freebsd.org/changeset/base/363806 Log: Allow bootstrapping mtree on Linux systems Linux glibc has a dummy lchmod that always fails and emitting a linker warning when used. Don't fail the build due to that warning when bootstrapping by setting LD_FATAL_WARNINGS=no. Reviewed By: brooks, emaste Differential Revision: https://reviews.freebsd.org/D25930 Modified: head/usr.sbin/nmtree/Makefile Modified: head/usr.sbin/nmtree/Makefile ============================================================================== --- head/usr.sbin/nmtree/Makefile Mon Aug 3 18:08:04 2020 (r363805) +++ head/usr.sbin/nmtree/Makefile Mon Aug 3 18:08:10 2020 (r363806) @@ -22,4 +22,10 @@ MLINKS= mtree.8 nmtree.8 HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +.if defined(BOOTSTRAPPING) +# Linux glibc has a dummy lchmod that always fails. Don't fail due to +# the linker warning that it emits. +LD_FATAL_WARNINGS=no +.endif + .include From owner-svn-src-all@freebsd.org Mon Aug 3 18:55:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00CAE3A4FBB; Mon, 3 Aug 2020 18:55:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL6Xc6Lcrz4H8x; Mon, 3 Aug 2020 18:55:44 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A431918C71; Mon, 3 Aug 2020 18:55:44 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073ItiBg084530; Mon, 3 Aug 2020 18:55:44 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073IteXB084506; Mon, 3 Aug 2020 18:55:40 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008031855.073IteXB084506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 3 Aug 2020 18:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363807 - in vendor/bc/dist: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc/dist: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc X-SVN-Commit-Revision: 363807 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 18:55:45 -0000 Author: se Date: Mon Aug 3 18:55:39 2020 New Revision: 363807 URL: https://svnweb.freebsd.org/changeset/base/363807 Log: Import version 3.1.4 This version makes dc exit after processing all commands passed via -e or -f instead of waiting for more input on STDIN (add "-f -" to the command line to emulate the behavior of versionm 3.1.3 and earlier, if desired). The version and copyright message are no longer printed for interactive sessions as was the case with the prior implementation in the FreeBSD base system. Obtained from: https://git.yzena.com/gavin/bc Added: vendor/bc/dist/tests/bc/misc6.txt (contents, props changed) vendor/bc/dist/tests/bc/misc6_results.txt (contents, props changed) vendor/bc/dist/tests/bc/misc7.txt (contents, props changed) vendor/bc/dist/tests/bc/misc7_results.txt (contents, props changed) vendor/bc/dist/tests/bc/stdin1.txt (contents, props changed) vendor/bc/dist/tests/bc/stdin1_results.txt (contents, props changed) vendor/bc/dist/tests/bc/stdin2.txt (contents, props changed) vendor/bc/dist/tests/bc/stdin2_results.txt (contents, props changed) Modified: vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/README.md vendor/bc/dist/include/bc.h vendor/bc/dist/include/vm.h vendor/bc/dist/manuals/bc.1.md.in vendor/bc/dist/manuals/bc/A.1 vendor/bc/dist/manuals/bc/A.1.md vendor/bc/dist/manuals/bc/E.1 vendor/bc/dist/manuals/bc/E.1.md vendor/bc/dist/manuals/bc/EH.1 vendor/bc/dist/manuals/bc/EH.1.md vendor/bc/dist/manuals/bc/EHN.1 vendor/bc/dist/manuals/bc/EHN.1.md vendor/bc/dist/manuals/bc/EHNP.1 vendor/bc/dist/manuals/bc/EHNP.1.md vendor/bc/dist/manuals/bc/EHP.1 vendor/bc/dist/manuals/bc/EHP.1.md vendor/bc/dist/manuals/bc/EN.1 vendor/bc/dist/manuals/bc/EN.1.md vendor/bc/dist/manuals/bc/ENP.1 vendor/bc/dist/manuals/bc/ENP.1.md vendor/bc/dist/manuals/bc/EP.1 vendor/bc/dist/manuals/bc/EP.1.md vendor/bc/dist/manuals/bc/H.1 vendor/bc/dist/manuals/bc/H.1.md vendor/bc/dist/manuals/bc/HN.1 vendor/bc/dist/manuals/bc/HN.1.md vendor/bc/dist/manuals/bc/HNP.1 vendor/bc/dist/manuals/bc/HNP.1.md vendor/bc/dist/manuals/bc/HP.1 vendor/bc/dist/manuals/bc/HP.1.md vendor/bc/dist/manuals/bc/N.1 vendor/bc/dist/manuals/bc/N.1.md vendor/bc/dist/manuals/bc/NP.1 vendor/bc/dist/manuals/bc/NP.1.md vendor/bc/dist/manuals/bc/P.1 vendor/bc/dist/manuals/bc/P.1.md vendor/bc/dist/manuals/dc.1.md.in vendor/bc/dist/manuals/dc/A.1 vendor/bc/dist/manuals/dc/A.1.md vendor/bc/dist/manuals/dc/E.1 vendor/bc/dist/manuals/dc/E.1.md vendor/bc/dist/manuals/dc/EH.1 vendor/bc/dist/manuals/dc/EH.1.md vendor/bc/dist/manuals/dc/EHN.1 vendor/bc/dist/manuals/dc/EHN.1.md vendor/bc/dist/manuals/dc/EHNP.1 vendor/bc/dist/manuals/dc/EHNP.1.md vendor/bc/dist/manuals/dc/EHP.1 vendor/bc/dist/manuals/dc/EHP.1.md vendor/bc/dist/manuals/dc/EN.1 vendor/bc/dist/manuals/dc/EN.1.md vendor/bc/dist/manuals/dc/ENP.1 vendor/bc/dist/manuals/dc/ENP.1.md vendor/bc/dist/manuals/dc/EP.1 vendor/bc/dist/manuals/dc/EP.1.md vendor/bc/dist/manuals/dc/H.1 vendor/bc/dist/manuals/dc/H.1.md vendor/bc/dist/manuals/dc/HN.1 vendor/bc/dist/manuals/dc/HN.1.md vendor/bc/dist/manuals/dc/HNP.1 vendor/bc/dist/manuals/dc/HNP.1.md vendor/bc/dist/manuals/dc/HP.1 vendor/bc/dist/manuals/dc/HP.1.md vendor/bc/dist/manuals/dc/N.1 vendor/bc/dist/manuals/dc/N.1.md vendor/bc/dist/manuals/dc/NP.1 vendor/bc/dist/manuals/dc/NP.1.md vendor/bc/dist/manuals/dc/P.1 vendor/bc/dist/manuals/dc/P.1.md vendor/bc/dist/src/args.c vendor/bc/dist/src/bc/bc.c vendor/bc/dist/src/bc/parse.c vendor/bc/dist/src/dc/dc.c vendor/bc/dist/src/vm.c vendor/bc/dist/tests/bc/all.txt Modified: vendor/bc/dist/Makefile.in ============================================================================== --- vendor/bc/dist/Makefile.in Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/Makefile.in Mon Aug 3 18:55:39 2020 (r363807) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.3 +VERSION = 3.1.4 SRC = %%SRC%% OBJ = %%OBJ%% Modified: vendor/bc/dist/NEWS.md ============================================================================== --- vendor/bc/dist/NEWS.md Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/NEWS.md Mon Aug 3 18:55:39 2020 (r363807) @@ -1,5 +1,24 @@ # News +## 3.1.4 + +This is a production release that fixes one bug, changes two behaviors, and +removes one environment variable. + +The bug is like the one in the last release except it applies if files are being +executed. I also made the fix more general. + +The behavior that was changed is that `bc` now exits when given `-e`, `-f`, +`--expression` or `--file`. However, if the last one of those is `-f-` (using +`stdin` as the file), `bc` does not exit. If `-f-` exists and is not the last of +the `-e` and `-f` options (and equivalents), `bc` gives a fatal error and exits. + +Next, I removed the `BC_EXPR_EXIT` and `DC_EXPR_EXIT` environment variables +since their use is not needed with the behavior change. + +Finally, I made it so `bc` does not print the header, though the `-q` and +`--quiet` options were kept for compatibility with GNU `bc`. + ## 3.1.3 This is a production release that fixes one minor bug: if `bc` was invoked like Modified: vendor/bc/dist/README.md ============================================================================== --- vendor/bc/dist/README.md Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/README.md Mon Aug 3 18:55:39 2020 (r363807) @@ -262,8 +262,8 @@ Other projects based on this bc are: toybox `bc` should be reported there. * [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better - to report bugs there, and the maintainers of the package will contact me if - necessary. + to [report bugs there][24], as well as [submit patches][25], and the + maintainers of the package will contact me if necessary. ## Language @@ -332,4 +332,6 @@ Folders: [20]: https://git.yzena.com/gavin/bc [21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/ [22]: https://www.deepl.com/translator -[23]: https://github.com/freebsd/freebsd/tree/master/contrib/bc +[23]: https://svnweb.freebsd.org/base/head/contrib/bc/ +[24]: https://bugs.freebsd.org/ +[25]: https://reviews.freebsd.org/ Modified: vendor/bc/dist/include/bc.h ============================================================================== --- vendor/bc/dist/include/bc.h Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/include/bc.h Mon Aug 3 18:55:39 2020 (r363807) @@ -159,9 +159,6 @@ void bc_parse_expr(BcParse *p, uint8_t flags); void bc_parse_parse(BcParse *p); void bc_parse_expr_status(BcParse *p, uint8_t flags, BcParseNext next); -// This is necessary to clear up for if statements at the end of files. -void bc_parse_noElse(BcParse *p); - extern const char bc_sig_msg[]; extern const uchar bc_sig_msg_len; Modified: vendor/bc/dist/include/vm.h ============================================================================== --- vendor/bc/dist/include/vm.h Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/include/vm.h Mon Aug 3 18:55:39 2020 (r363807) @@ -102,11 +102,10 @@ #define BC_FLAG_G (UINTMAX_C(1)<<4) #endif // BC_ENABLED -#define BC_FLAG_Q (UINTMAX_C(1)<<5) -#define BC_FLAG_I (UINTMAX_C(1)<<6) -#define BC_FLAG_P (UINTMAX_C(1)<<7) -#define BC_FLAG_TTYIN (UINTMAX_C(1)<<8) -#define BC_FLAG_TTY (UINTMAX_C(1)<<9) +#define BC_FLAG_I (UINTMAX_C(1)<<5) +#define BC_FLAG_P (UINTMAX_C(1)<<6) +#define BC_FLAG_TTYIN (UINTMAX_C(1)<<7) +#define BC_FLAG_TTY (UINTMAX_C(1)<<8) #define BC_TTYIN (vm.flags & BC_FLAG_TTYIN) #define BC_TTY (vm.flags & BC_FLAG_TTY) @@ -279,12 +278,6 @@ #define BC_VM_INVALID_CATALOG ((nl_catd) -1) -// dc does not use is_stdin. -#if !BC_ENABLED -#define bc_vm_process(text, is_stdin) bc_vm_process(text) -#else // BC_ENABLED -#endif // BC_ENABLED - typedef struct BcVm { volatile sig_atomic_t status; @@ -310,6 +303,7 @@ typedef struct BcVm { uint16_t nchars; uint16_t line_len; + bool no_exit_exprs; bool eof; BcBigDig maxes[BC_PROG_GLOBALS_LEN + BC_ENABLE_EXTRA_MATH]; @@ -360,7 +354,7 @@ typedef struct BcVm { void bc_vm_info(const char* const help); void bc_vm_boot(int argc, char *argv[], const char *env_len, - const char* const env_args, const char* env_exp_quit); + const char* const env_args); void bc_vm_shutdown(void); void bc_vm_printf(const char *fmt, ...); Modified: vendor/bc/dist/manuals/bc.1.md.in ============================================================================== --- vendor/bc/dist/manuals/bc.1.md.in Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc.1.md.in Mon Aug 3 18:55:39 2020 (r363807) @@ -195,11 +195,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -229,9 +229,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -241,9 +242,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -1614,12 +1614,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: vendor/bc/dist/manuals/bc/A.1 ============================================================================== --- vendor/bc/dist/manuals/bc/A.1 Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/A.1 Mon Aug 3 18:55:39 2020 (r363807) @@ -187,13 +187,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -231,10 +231,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -246,10 +248,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1913,14 +1914,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: vendor/bc/dist/manuals/bc/A.1.md ============================================================================== --- vendor/bc/dist/manuals/bc/A.1.md Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/A.1.md Mon Aug 3 18:55:39 2020 (r363807) @@ -153,11 +153,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -187,9 +187,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -199,9 +200,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -1523,12 +1523,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: vendor/bc/dist/manuals/bc/E.1 ============================================================================== --- vendor/bc/dist/manuals/bc/E.1 Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/E.1 Mon Aug 3 18:55:39 2020 (r363807) @@ -148,13 +148,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -192,10 +192,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -207,10 +209,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1159,14 +1160,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: vendor/bc/dist/manuals/bc/E.1.md ============================================================================== --- vendor/bc/dist/manuals/bc/E.1.md Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/E.1.md Mon Aug 3 18:55:39 2020 (r363807) @@ -137,11 +137,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -171,9 +171,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -183,9 +184,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -919,12 +919,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EH.1 ============================================================================== --- vendor/bc/dist/manuals/bc/EH.1 Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EH.1 Mon Aug 3 18:55:39 2020 (r363807) @@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -189,10 +189,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -204,10 +206,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1156,14 +1157,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EH.1.md ============================================================================== --- vendor/bc/dist/manuals/bc/EH.1.md Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EH.1.md Mon Aug 3 18:55:39 2020 (r363807) @@ -134,11 +134,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -168,9 +168,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -180,9 +181,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EHN.1 ============================================================================== --- vendor/bc/dist/manuals/bc/EHN.1 Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EHN.1 Mon Aug 3 18:55:39 2020 (r363807) @@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -189,10 +189,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -204,10 +206,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1156,14 +1157,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EHN.1.md ============================================================================== --- vendor/bc/dist/manuals/bc/EHN.1.md Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EHN.1.md Mon Aug 3 18:55:39 2020 (r363807) @@ -134,11 +134,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -168,9 +168,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -180,9 +181,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EHNP.1 ============================================================================== --- vendor/bc/dist/manuals/bc/EHNP.1 Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EHNP.1 Mon Aug 3 18:55:39 2020 (r363807) @@ -140,13 +140,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -184,10 +184,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -199,10 +201,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1151,14 +1152,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EHNP.1.md ============================================================================== --- vendor/bc/dist/manuals/bc/EHNP.1.md Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EHNP.1.md Mon Aug 3 18:55:39 2020 (r363807) @@ -130,11 +130,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -164,9 +164,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -176,9 +177,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -912,12 +912,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EHP.1 ============================================================================== --- vendor/bc/dist/manuals/bc/EHP.1 Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EHP.1 Mon Aug 3 18:55:39 2020 (r363807) @@ -140,13 +140,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -184,10 +184,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -199,10 +201,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1151,14 +1152,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EHP.1.md ============================================================================== --- vendor/bc/dist/manuals/bc/EHP.1.md Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EHP.1.md Mon Aug 3 18:55:39 2020 (r363807) @@ -130,11 +130,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -164,9 +164,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -176,9 +177,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -912,12 +912,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EN.1 ============================================================================== --- vendor/bc/dist/manuals/bc/EN.1 Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EN.1 Mon Aug 3 18:55:39 2020 (r363807) @@ -148,13 +148,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -192,10 +192,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -207,10 +209,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1159,14 +1160,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: vendor/bc/dist/manuals/bc/EN.1.md ============================================================================== --- vendor/bc/dist/manuals/bc/EN.1.md Mon Aug 3 18:08:10 2020 (r363806) +++ vendor/bc/dist/manuals/bc/EN.1.md Mon Aug 3 18:55:39 2020 (r363807) @@ -137,11 +137,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 3 19:00:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C30F93A517C; Mon, 3 Aug 2020 19:00:13 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL6dn4hcXz4HHy; Mon, 3 Aug 2020 19:00:13 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68F5718C75; Mon, 3 Aug 2020 19:00:13 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073J0DKu084831; Mon, 3 Aug 2020 19:00:13 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073J0Dur084830; Mon, 3 Aug 2020 19:00:13 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008031900.073J0Dur084830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 3 Aug 2020 19:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363808 - vendor/bc/3.1.4 X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: vendor/bc/3.1.4 X-SVN-Commit-Revision: 363808 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 19:00:14 -0000 Author: se Date: Mon Aug 3 19:00:12 2020 New Revision: 363808 URL: https://svnweb.freebsd.org/changeset/base/363808 Log: Tag version 3.1.4 Added: vendor/bc/3.1.4/ - copied from r363807, vendor/bc/dist/ From owner-svn-src-all@freebsd.org Mon Aug 3 19:18:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D9D73A5B27; Mon, 3 Aug 2020 19:18:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL7332lhZz4Jj2; Mon, 3 Aug 2020 19:18:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4169D193AA; Mon, 3 Aug 2020 19:18:39 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073JIdMW097209; Mon, 3 Aug 2020 19:18:39 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073JId8R097208; Mon, 3 Aug 2020 19:18:39 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008031918.073JId8R097208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 3 Aug 2020 19:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363809 - head/usr.bin/gh-bc X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.bin/gh-bc X-SVN-Commit-Revision: 363809 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 19:18:39 -0000 Author: se Date: Mon Aug 3 19:18:38 2020 New Revision: 363809 URL: https://svnweb.freebsd.org/changeset/base/363809 Log: Upgrade to version 3.1.4 This version omits the printing of a copyright header in interactive mode and the dc command now exits after execution of the commands passed via -e or -f instead of switching to interactive mode. To pass further commands via STDIN when dc has been invoked with -e or -f, add "-f -" to the parameter list. Modified: head/usr.bin/gh-bc/Makefile Modified: head/usr.bin/gh-bc/Makefile ============================================================================== --- head/usr.bin/gh-bc/Makefile Mon Aug 3 19:00:12 2020 (r363808) +++ head/usr.bin/gh-bc/Makefile Mon Aug 3 19:18:38 2020 (r363809) @@ -59,6 +59,10 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif +.if ${MK_TESTS} != "no" +#SUBDIR+= tests +.endif + .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} NLSSRCFILES_${catalog:C/.*://}= ${catalog:C/.*://}.msg From owner-svn-src-all@freebsd.org Mon Aug 3 19:20:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A20583A5B42; Mon, 3 Aug 2020 19:20:31 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL75C48Mtz4JgF; Mon, 3 Aug 2020 19:20:31 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72365190BB; Mon, 3 Aug 2020 19:20:31 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073JKVnW097397; Mon, 3 Aug 2020 19:20:31 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073JKRTE097372; Mon, 3 Aug 2020 19:20:27 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008031920.073JKRTE097372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 3 Aug 2020 19:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363810 - in head/contrib/bc: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/contrib/bc: . include manuals manuals/bc manuals/dc src src/bc src/dc tests/bc X-SVN-Commit-Revision: 363810 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 19:20:31 -0000 Author: se Date: Mon Aug 3 19:20:26 2020 New Revision: 363810 URL: https://svnweb.freebsd.org/changeset/base/363810 Log: Upgrade to version 3.1.4 This version omits the printing of a copyright header in interactive mode and the dc command now exits after execution of the commands passed via -e or -f instead of switching to interactive mode. To pass further commands via STDIN when dc has been invoked with -e or -f, add "-f -" to the parameter list. Added: head/contrib/bc/tests/bc/misc6.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6.txt head/contrib/bc/tests/bc/misc6_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc6_results.txt head/contrib/bc/tests/bc/misc7.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7.txt head/contrib/bc/tests/bc/misc7_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/misc7_results.txt head/contrib/bc/tests/bc/stdin1.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1.txt head/contrib/bc/tests/bc/stdin1_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin1_results.txt head/contrib/bc/tests/bc/stdin2.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2.txt head/contrib/bc/tests/bc/stdin2_results.txt - copied unchanged from r363808, vendor/bc/dist/tests/bc/stdin2_results.txt Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/README.md head/contrib/bc/include/bc.h head/contrib/bc/include/vm.h head/contrib/bc/manuals/bc.1.md.in head/contrib/bc/manuals/bc/A.1 head/contrib/bc/manuals/bc/A.1.md head/contrib/bc/manuals/bc/E.1 head/contrib/bc/manuals/bc/E.1.md head/contrib/bc/manuals/bc/EH.1 head/contrib/bc/manuals/bc/EH.1.md head/contrib/bc/manuals/bc/EHN.1 head/contrib/bc/manuals/bc/EHN.1.md head/contrib/bc/manuals/bc/EHNP.1 head/contrib/bc/manuals/bc/EHNP.1.md head/contrib/bc/manuals/bc/EHP.1 head/contrib/bc/manuals/bc/EHP.1.md head/contrib/bc/manuals/bc/EN.1 head/contrib/bc/manuals/bc/EN.1.md head/contrib/bc/manuals/bc/ENP.1 head/contrib/bc/manuals/bc/ENP.1.md head/contrib/bc/manuals/bc/EP.1 head/contrib/bc/manuals/bc/EP.1.md head/contrib/bc/manuals/bc/H.1 head/contrib/bc/manuals/bc/H.1.md head/contrib/bc/manuals/bc/HN.1 head/contrib/bc/manuals/bc/HN.1.md head/contrib/bc/manuals/bc/HNP.1 head/contrib/bc/manuals/bc/HNP.1.md head/contrib/bc/manuals/bc/HP.1 head/contrib/bc/manuals/bc/HP.1.md head/contrib/bc/manuals/bc/N.1 head/contrib/bc/manuals/bc/N.1.md head/contrib/bc/manuals/bc/NP.1 head/contrib/bc/manuals/bc/NP.1.md head/contrib/bc/manuals/bc/P.1 head/contrib/bc/manuals/bc/P.1.md head/contrib/bc/manuals/dc.1.md.in head/contrib/bc/manuals/dc/A.1 head/contrib/bc/manuals/dc/A.1.md head/contrib/bc/manuals/dc/E.1 head/contrib/bc/manuals/dc/E.1.md head/contrib/bc/manuals/dc/EH.1 head/contrib/bc/manuals/dc/EH.1.md head/contrib/bc/manuals/dc/EHN.1 head/contrib/bc/manuals/dc/EHN.1.md head/contrib/bc/manuals/dc/EHNP.1 head/contrib/bc/manuals/dc/EHNP.1.md head/contrib/bc/manuals/dc/EHP.1 head/contrib/bc/manuals/dc/EHP.1.md head/contrib/bc/manuals/dc/EN.1 head/contrib/bc/manuals/dc/EN.1.md head/contrib/bc/manuals/dc/ENP.1 head/contrib/bc/manuals/dc/ENP.1.md head/contrib/bc/manuals/dc/EP.1 head/contrib/bc/manuals/dc/EP.1.md head/contrib/bc/manuals/dc/H.1 head/contrib/bc/manuals/dc/H.1.md head/contrib/bc/manuals/dc/HN.1 head/contrib/bc/manuals/dc/HN.1.md head/contrib/bc/manuals/dc/HNP.1 head/contrib/bc/manuals/dc/HNP.1.md head/contrib/bc/manuals/dc/HP.1 head/contrib/bc/manuals/dc/HP.1.md head/contrib/bc/manuals/dc/N.1 head/contrib/bc/manuals/dc/N.1.md head/contrib/bc/manuals/dc/NP.1 head/contrib/bc/manuals/dc/NP.1.md head/contrib/bc/manuals/dc/P.1 head/contrib/bc/manuals/dc/P.1.md head/contrib/bc/src/args.c head/contrib/bc/src/bc/bc.c head/contrib/bc/src/bc/parse.c head/contrib/bc/src/dc/dc.c head/contrib/bc/src/vm.c head/contrib/bc/tests/bc/all.txt Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in ============================================================================== --- head/contrib/bc/Makefile.in Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/Makefile.in Mon Aug 3 19:20:26 2020 (r363810) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.3 +VERSION = 3.1.4 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md ============================================================================== --- head/contrib/bc/NEWS.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/NEWS.md Mon Aug 3 19:20:26 2020 (r363810) @@ -1,5 +1,24 @@ # News +## 3.1.4 + +This is a production release that fixes one bug, changes two behaviors, and +removes one environment variable. + +The bug is like the one in the last release except it applies if files are being +executed. I also made the fix more general. + +The behavior that was changed is that `bc` now exits when given `-e`, `-f`, +`--expression` or `--file`. However, if the last one of those is `-f-` (using +`stdin` as the file), `bc` does not exit. If `-f-` exists and is not the last of +the `-e` and `-f` options (and equivalents), `bc` gives a fatal error and exits. + +Next, I removed the `BC_EXPR_EXIT` and `DC_EXPR_EXIT` environment variables +since their use is not needed with the behavior change. + +Finally, I made it so `bc` does not print the header, though the `-q` and +`--quiet` options were kept for compatibility with GNU `bc`. + ## 3.1.3 This is a production release that fixes one minor bug: if `bc` was invoked like Modified: head/contrib/bc/README.md ============================================================================== --- head/contrib/bc/README.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/README.md Mon Aug 3 19:20:26 2020 (r363810) @@ -262,8 +262,8 @@ Other projects based on this bc are: toybox `bc` should be reported there. * [FreeBSD `bc`][23]. While the `bc` in FreeBSD is kept up-to-date, it is better - to report bugs there, and the maintainers of the package will contact me if - necessary. + to [report bugs there][24], as well as [submit patches][25], and the + maintainers of the package will contact me if necessary. ## Language @@ -332,4 +332,6 @@ Folders: [20]: https://git.yzena.com/gavin/bc [21]: https://gavinhoward.com/2020/04/i-am-moving-away-from-github/ [22]: https://www.deepl.com/translator -[23]: https://github.com/freebsd/freebsd/tree/master/contrib/bc +[23]: https://svnweb.freebsd.org/base/head/contrib/bc/ +[24]: https://bugs.freebsd.org/ +[25]: https://reviews.freebsd.org/ Modified: head/contrib/bc/include/bc.h ============================================================================== --- head/contrib/bc/include/bc.h Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/include/bc.h Mon Aug 3 19:20:26 2020 (r363810) @@ -159,9 +159,6 @@ void bc_parse_expr(BcParse *p, uint8_t flags); void bc_parse_parse(BcParse *p); void bc_parse_expr_status(BcParse *p, uint8_t flags, BcParseNext next); -// This is necessary to clear up for if statements at the end of files. -void bc_parse_noElse(BcParse *p); - extern const char bc_sig_msg[]; extern const uchar bc_sig_msg_len; Modified: head/contrib/bc/include/vm.h ============================================================================== --- head/contrib/bc/include/vm.h Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/include/vm.h Mon Aug 3 19:20:26 2020 (r363810) @@ -102,11 +102,10 @@ #define BC_FLAG_G (UINTMAX_C(1)<<4) #endif // BC_ENABLED -#define BC_FLAG_Q (UINTMAX_C(1)<<5) -#define BC_FLAG_I (UINTMAX_C(1)<<6) -#define BC_FLAG_P (UINTMAX_C(1)<<7) -#define BC_FLAG_TTYIN (UINTMAX_C(1)<<8) -#define BC_FLAG_TTY (UINTMAX_C(1)<<9) +#define BC_FLAG_I (UINTMAX_C(1)<<5) +#define BC_FLAG_P (UINTMAX_C(1)<<6) +#define BC_FLAG_TTYIN (UINTMAX_C(1)<<7) +#define BC_FLAG_TTY (UINTMAX_C(1)<<8) #define BC_TTYIN (vm.flags & BC_FLAG_TTYIN) #define BC_TTY (vm.flags & BC_FLAG_TTY) @@ -279,12 +278,6 @@ #define BC_VM_INVALID_CATALOG ((nl_catd) -1) -// dc does not use is_stdin. -#if !BC_ENABLED -#define bc_vm_process(text, is_stdin) bc_vm_process(text) -#else // BC_ENABLED -#endif // BC_ENABLED - typedef struct BcVm { volatile sig_atomic_t status; @@ -310,6 +303,7 @@ typedef struct BcVm { uint16_t nchars; uint16_t line_len; + bool no_exit_exprs; bool eof; BcBigDig maxes[BC_PROG_GLOBALS_LEN + BC_ENABLE_EXTRA_MATH]; @@ -360,7 +354,7 @@ typedef struct BcVm { void bc_vm_info(const char* const help); void bc_vm_boot(int argc, char *argv[], const char *env_len, - const char* const env_args, const char* env_exp_quit); + const char* const env_args); void bc_vm_shutdown(void); void bc_vm_printf(const char *fmt, ...); Modified: head/contrib/bc/manuals/bc.1.md.in ============================================================================== --- head/contrib/bc/manuals/bc.1.md.in Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc.1.md.in Mon Aug 3 19:20:26 2020 (r363810) @@ -195,11 +195,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -229,9 +229,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -241,9 +242,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -1614,12 +1614,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/A.1 ============================================================================== --- head/contrib/bc/manuals/bc/A.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/A.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -187,13 +187,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -231,10 +231,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -246,10 +248,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1913,14 +1914,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/A.1.md ============================================================================== --- head/contrib/bc/manuals/bc/A.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/A.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -153,11 +153,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -187,9 +187,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -199,9 +200,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -1523,12 +1523,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/E.1 ============================================================================== --- head/contrib/bc/manuals/bc/E.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/E.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -148,13 +148,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -192,10 +192,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -207,10 +209,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1159,14 +1160,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/E.1.md ============================================================================== --- head/contrib/bc/manuals/bc/E.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/E.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -137,11 +137,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -171,9 +171,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -183,9 +184,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -919,12 +919,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EH.1 ============================================================================== --- head/contrib/bc/manuals/bc/EH.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EH.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -189,10 +189,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -204,10 +206,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1156,14 +1157,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EH.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EH.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EH.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -134,11 +134,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -168,9 +168,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -180,9 +181,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHN.1 ============================================================================== --- head/contrib/bc/manuals/bc/EHN.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHN.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -145,13 +145,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -189,10 +189,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -204,10 +206,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1156,14 +1157,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHN.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EHN.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHN.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -134,11 +134,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -168,9 +168,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -180,9 +181,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -916,12 +916,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHNP.1 ============================================================================== --- head/contrib/bc/manuals/bc/EHNP.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHNP.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -140,13 +140,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -184,10 +184,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -199,10 +201,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1151,14 +1152,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHNP.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EHNP.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHNP.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -130,11 +130,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -164,9 +164,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -176,9 +177,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -912,12 +912,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHP.1 ============================================================================== --- head/contrib/bc/manuals/bc/EHP.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHP.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -140,13 +140,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -184,10 +184,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -199,10 +201,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1151,14 +1152,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EHP.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EHP.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EHP.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -130,11 +130,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. - This is mostly for compatibility with the [GNU bc(1)][2]. - This is a **non-portable extension**. **-s**, **--standard** @@ -164,9 +164,10 @@ The following are the options that bc(1) accepts. evaluated in the order given. This means that if a file is given before an expression, the file is read in and evaluated first. - In other bc(1) implementations, this option causes the program to execute - the expressions and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. + However, if any other **-e**, **--expression**, **-f**, or **--file** + arguments are given after that, bc(1) will give a fatal error and exit. This is a **non-portable extension**. @@ -176,9 +177,8 @@ The following are the options that bc(1) accepts. through **stdin**. If expressions are also given (see above), the expressions are evaluated in the order given. - In other bc(1) implementations, this option causes the program to execute - the files and then exit. This bc(1) does not, unless the - **BC_EXPR_EXIT** is defined (see the **ENVIRONMENT VARIABLES** section). + After processing all expressions and files, bc(1) will exit, unless **-** + (**stdin**) was given as an argument at least once to **-f** or **--file**. This is a **non-portable extension**. @@ -912,12 +912,6 @@ bc(1) recognizes the following environment variables: than **1** and is less than **UINT16_MAX** (**2\^16-1**), bc(1) will output lines to that length, including the backslash (**\\**). The default line length is **70**. - -**BC_EXPR_EXIT** - -: If this variable exists (no matter the contents), bc(1) will exit - immediately after executing expressions and files given by the **-e** and/or - **-f** command-line options (and any equivalents). # EXIT STATUS Modified: head/contrib/bc/manuals/bc/EN.1 ============================================================================== --- head/contrib/bc/manuals/bc/EN.1 Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EN.1 Mon Aug 3 19:20:26 2020 (r363810) @@ -148,13 +148,13 @@ This is a \f[B]non\-portable extension\f[]. .RE .TP .B \f[B]\-q\f[], \f[B]\-\-quiet\f[] -Do not print copyright header. -bc(1) will also suppress the header in non\-interactive mode. +This option is for compatibility with the GNU +bc(1) (https://www.gnu.org/software/bc/); it is a no\-op. +Without this option, GNU bc(1) prints a copyright header. +This bc(1) only prints the copyright header if one or more of the +\f[B]\-v\f[], \f[B]\-V\f[], or \f[B]\-\-version\f[] options are given. .RS .PP -This is mostly for compatibility with the GNU -bc(1) (https://www.gnu.org/software/bc/). -.PP This is a \f[B]non\-portable extension\f[]. .RE .TP @@ -192,10 +192,12 @@ This means that if a file is given before an expressio read in and evaluated first. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the expressions and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. +However, if any other \f[B]\-e\f[], \f[B]\-\-expression\f[], +\f[B]\-f\f[], or \f[B]\-\-file\f[] arguments are given after that, bc(1) +will give a fatal error and exit. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -207,10 +209,9 @@ If expressions are also given (see above), the express in the order given. .RS .PP -In other bc(1) implementations, this option causes the program to -execute the files and then exit. -This bc(1) does not, unless the \f[B]BC_EXPR_EXIT\f[] is defined (see -the \f[B]ENVIRONMENT VARIABLES\f[] section). +After processing all expressions and files, bc(1) will exit, unless +\f[B]\-\f[] (\f[B]stdin\f[]) was given as an argument at least once to +\f[B]\-f\f[] or \f[B]\-\-file\f[]. .PP This is a \f[B]non\-portable extension\f[]. .RE @@ -1159,14 +1160,6 @@ greater than \f[B]1\f[] and is less than \f[B]UINT16_M (\f[B]2^16\-1\f[]), bc(1) will output lines to that length, including the backslash (\f[B]\\\f[]). The default line length is \f[B]70\f[]. -.RS -.RE -.TP -.B \f[B]BC_EXPR_EXIT\f[] -If this variable exists (no matter the contents), bc(1) will exit -immediately after executing expressions and files given by the -\f[B]\-e\f[] and/or \f[B]\-f\f[] command\-line options (and any -equivalents). .RS .RE .SH EXIT STATUS Modified: head/contrib/bc/manuals/bc/EN.1.md ============================================================================== --- head/contrib/bc/manuals/bc/EN.1.md Mon Aug 3 19:18:38 2020 (r363809) +++ head/contrib/bc/manuals/bc/EN.1.md Mon Aug 3 19:20:26 2020 (r363810) @@ -137,11 +137,11 @@ The following are the options that bc(1) accepts. **-q**, **--quiet** -: Do not print copyright header. bc(1) will also suppress the header in - non-interactive mode. +: This option is for compatibility with the [GNU bc(1)][2]; it is a no-op. + Without this option, GNU bc(1) prints a copyright header. This bc(1) only + prints the copyright header if one or more of the **-v**, **-V**, or + **--version** options are given. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 3 20:26:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4D423A6E80; Mon, 3 Aug 2020 20:26:05 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BL8Xs4Rcgz4MW6; Mon, 3 Aug 2020 20:26:05 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 750F11A212; Mon, 3 Aug 2020 20:26:05 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073KQ5jY040430; Mon, 3 Aug 2020 20:26:05 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073KQ4BK040427; Mon, 3 Aug 2020 20:26:04 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008032026.073KQ4BK040427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Mon, 3 Aug 2020 20:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363811 - in head: etc/mtree usr.bin/gh-bc usr.bin/gh-bc/tests X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head: etc/mtree usr.bin/gh-bc usr.bin/gh-bc/tests X-SVN-Commit-Revision: 363811 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 20:26:05 -0000 Author: se Date: Mon Aug 3 20:26:04 2020 New Revision: 363811 URL: https://svnweb.freebsd.org/changeset/base/363811 Log: Connect the tests provided with the new bc and dc The tests compare the command output (including of error cases) with the expected output and exit code. Not all tests are executed, since some expect to have a known good bc and dc binary installed and compare results of large amounts of generated data being processed by both versions to test for regressions. Added: head/usr.bin/gh-bc/tests/ head/usr.bin/gh-bc/tests/Makefile (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/gh-bc/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Aug 3 19:20:26 2020 (r363810) +++ head/etc/mtree/BSD.tests.dist Mon Aug 3 20:26:04 2020 (r363811) @@ -1002,6 +1002,8 @@ .. getconf .. + gh-bc + .. grep .. gzip Modified: head/usr.bin/gh-bc/Makefile ============================================================================== --- head/usr.bin/gh-bc/Makefile Mon Aug 3 19:20:26 2020 (r363810) +++ head/usr.bin/gh-bc/Makefile Mon Aug 3 20:26:04 2020 (r363811) @@ -59,9 +59,8 @@ MAN_SRC_DC= dc/A.1 CFLAGS+= -flto .endif -.if ${MK_TESTS} != "no" -#SUBDIR+= tests -.endif +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests .for catalog in ${CATALOGS} NLS+= ${catalog:C/.*://} Added: head/usr.bin/gh-bc/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/gh-bc/tests/Makefile Mon Aug 3 20:26:04 2020 (r363811) @@ -0,0 +1,67 @@ +# $FreeBSD$ + +.include + +PACKAGE= tests + +TEST_DIR= ${SRCTOP}/contrib/bc + +TESTSDIR= ${TESTSBASE}/usr.bin/gh-bc + +.PATH: ${SRCTOP}/tests + +FILESGROUPS+= FILESf +FILESfPACKAGE= ${PACKAGE} +FILESfDIR= ${TESTSDIR} +FILESf= ${TEST_DIR}/functions.sh +FILESfMODE= 0755 + +FILESGROUPS+= FILEStests +FILEStestsPACKAGE= ${PACKAGE} +FILEStestsDIR= ${TESTSDIR}/tests +FILEStests!= echo ${TEST_DIR}/tests/*.py ${TEST_DIR}/tests/*.sh ${TEST_DIR}/tests/*.txt +FILEStestsMODE= 0755 + +FILESGROUPS+= FILESbc +FILESbcPACKAGE= ${PACKAGE} +FILESbcDIR= ${TESTSDIR}/tests/bc +FILESbc!= echo ${TEST_DIR}/tests/bc/*.* + +FILESGROUPS+= FILESbc_errors +FILESbc_errorsPACKAGE= ${PACKAGE} +FILESbc_errorsDIR= ${TESTSDIR}/tests/bc/errors +FILESbc_errors!= echo ${TEST_DIR}/tests/bc/errors/*.* + +FILESGROUPS+= FILESbc_scripts +FILESbc_scriptsPACKAGE= ${PACKAGE} +FILESbc_scriptsDIR= ${TESTSDIR}/tests/bc/scripts +FILESbc_scripts!= echo ${TEST_DIR}/tests/bc/scripts/*.* +FILESbc_scriptsMODE= 0755 + +FILESGROUPS+= FILESdc +FILESdcPACKAGE= ${PACKAGE} +FILESdcDIR= ${TESTSDIR}/tests/dc +FILESdc!= echo ${TEST_DIR}/tests/dc/*.* + +FILESGROUPS+= FILESdc_errors +FILESdc_errorsPACKAGE= ${PACKAGE} +FILESdc_errorsDIR= ${TESTSDIR}/tests/dc/errors +FILESdc_errors!= echo ${TEST_DIR}/tests/dc/errors/*.* + +FILESGROUPS+= FILESdc_scripts +FILESdc_scriptsPACKAGE= ${PACKAGE} +FILESdc_scriptsDIR= ${TESTSDIR}/tests/dc/scripts +FILESdc_scripts!= echo ${TEST_DIR}/tests/dc/scripts/*.* +FILESdc_scriptsMODE= 0755 + +PLAIN_TESTS_SH= bc_tests dc_tests + +bc_tests.sh: + echo "#!/bin/sh" > ${.TARGET} + echo "env LANG=C ${TESTSDIR}/tests/all.sh bc 1 1 0 0 bc" >> ${.TARGET} + +dc_tests.sh: + echo "#!/bin/sh" > ${.TARGET} + echo "env LANG=C ${TESTSDIR}/tests/all.sh dc 1 1 0 0 dc" >> ${.TARGET} + +.include From owner-svn-src-all@freebsd.org Mon Aug 3 22:12:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDD143A8C21; Mon, 3 Aug 2020 22:12:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLBvQ5cY4z4Rmh; Mon, 3 Aug 2020 22:12:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A54431B589; Mon, 3 Aug 2020 22:12:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073MCIBv007841; Mon, 3 Aug 2020 22:12:18 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073MCIqu007800; Mon, 3 Aug 2020 22:12:18 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202008032212.073MCIqu007800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 3 Aug 2020 22:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363812 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363812 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 22:12:19 -0000 Author: imp Date: Mon Aug 3 22:12:18 2020 New Revision: 363812 URL: https://svnweb.freebsd.org/changeset/base/363812 Log: Some function had the blank lines, others didn't. Most of the ones that didn't were newer, so remove this now-optional blank line everywhere. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Aug 3 20:26:04 2020 (r363811) +++ head/sys/kern/subr_bus.c Mon Aug 3 22:12:18 2020 (r363812) @@ -234,7 +234,6 @@ devclass_sysctl_handler(SYSCTL_HANDLER_ARGS) static void devclass_sysctl_init(devclass_t dc) { - if (dc->sysctl_tree != NULL) return; sysctl_ctx_init(&dc->sysctl_ctx); @@ -453,7 +452,6 @@ devinit(void) static int devopen(struct cdev *dev, int oflags, int devtype, struct thread *td) { - mtx_lock(&devsoftc.mtx); if (devsoftc.inuse) { mtx_unlock(&devsoftc.mtx); @@ -468,7 +466,6 @@ devopen(struct cdev *dev, int oflags, int devtype, str static int devclose(struct cdev *dev, int fflag, int devtype, struct thread *td) { - mtx_lock(&devsoftc.mtx); devsoftc.inuse = 0; devsoftc.nonblock = 0; @@ -522,7 +519,6 @@ static int devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, struct thread *td) { switch (cmd) { - case FIONBIO: if (*(int*)data) devsoftc.nonblock = 1; @@ -585,7 +581,6 @@ devkqfilter(struct cdev *dev, struct knote *kn) static void filt_devctl_detach(struct knote *kn) { - knlist_remove(&devsoftc.sel.si_note, kn, 0); } @@ -661,7 +656,6 @@ out: void devctl_queue_data(char *data) { - devctl_queue_data_f(data, M_NOWAIT); } @@ -704,7 +698,6 @@ void devctl_notify(const char *system, const char *subsystem, const char *type, const char *data) { - devctl_notify_f(system, subsystem, type, data, M_NOWAIT); } @@ -876,7 +869,6 @@ sysctl_devctl_queue(SYSCTL_HANDLER_ARGS) void devctl_safe_quote_sb(struct sbuf *sb, const char *src) { - while (*src != '\0') { if (*src == '"' || *src == '\\') sbuf_putc(sb, '\\'); @@ -2597,7 +2589,6 @@ device_claim_softc(device_t dev) void * device_get_ivars(device_t dev) { - KASSERT(dev != NULL, ("device_get_ivars(NULL, ...)")); return (dev->ivars); } @@ -2608,7 +2599,6 @@ device_get_ivars(device_t dev) void device_set_ivars(device_t dev, void * ivars) { - KASSERT(dev != NULL, ("device_set_ivars(NULL, ...)")); dev->ivars = ivars; } @@ -3087,7 +3077,6 @@ device_detach(device_t dev) int device_quiesce(device_t dev) { - PDEBUG(("%s", DEVICENAME(dev))); if (dev->state == DS_BUSY) return (EBUSY); @@ -3148,7 +3137,6 @@ device_set_unit(device_t dev, int unit) void resource_init_map_request_impl(struct resource_map_request *args, size_t sz) { - bzero(args, sz); args->size = sz; args->memattr = VM_MEMATTR_UNCACHEABLE; @@ -3704,7 +3692,6 @@ resource_list_purge(struct resource_list *rl) device_t bus_generic_add_child(device_t dev, u_int order, const char *name, int unit) { - return (device_add_child_ordered(dev, order, name, unit)); } @@ -3852,7 +3839,6 @@ bus_generic_suspend_child(device_t dev, device_t child int bus_generic_resume_child(device_t dev, device_t child) { - DEVICE_RESUME(child); child->flags &= ~DF_SUSPENDED; @@ -3944,7 +3930,6 @@ bus_helper_reset_post(device_t dev, int flags) static void bus_helper_reset_prepare_rollback(device_t dev, device_t child, int flags) { - child = TAILQ_NEXT(child, link); if (child == NULL) return; @@ -4356,7 +4341,6 @@ int bus_generic_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_BIND_INTR(dev->parent, child, irq, cpu)); @@ -4373,7 +4357,6 @@ int bus_generic_config_intr(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_CONFIG_INTR(dev->parent, irq, trig, pol)); @@ -4390,7 +4373,6 @@ int bus_generic_describe_intr(device_t dev, device_t child, struct resource *irq, void *cookie, const char *descr) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent) return (BUS_DESCRIBE_INTR(dev->parent, child, irq, cookie, @@ -4408,7 +4390,6 @@ int bus_generic_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent != NULL) return (BUS_GET_CPUS(dev->parent, child, op, setsize, cpuset)); @@ -4424,7 +4405,6 @@ bus_generic_get_cpus(device_t dev, device_t child, enu bus_dma_tag_t bus_generic_get_dma_tag(device_t dev, device_t child) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent != NULL) return (BUS_GET_DMA_TAG(dev->parent, child)); @@ -4440,7 +4420,6 @@ bus_generic_get_dma_tag(device_t dev, device_t child) bus_space_tag_t bus_generic_get_bus_tag(device_t dev, device_t child) { - /* Propagate up the bus hierarchy until someone handles it. */ if (dev->parent != NULL) return (BUS_GET_BUS_TAG(dev->parent, child)); @@ -4587,7 +4566,6 @@ bus_generic_child_present(device_t dev, device_t child int bus_generic_get_domain(device_t dev, device_t child, int *domain) { - if (dev->parent) return (BUS_GET_DOMAIN(dev->parent, dev, domain)); @@ -4603,7 +4581,6 @@ bus_generic_get_domain(device_t dev, device_t child, i int bus_null_rescan(device_t dev) { - return (ENXIO); } @@ -5101,7 +5078,6 @@ static int root_get_cpus(device_t dev, device_t child, enum cpu_sets op, size_t setsize, cpuset_t *cpuset) { - switch (op) { case INTR_CPUS: /* Default to returning the set of all CPUs. */ @@ -5182,7 +5158,6 @@ DECLARE_MODULE(rootbus, root_bus_mod, SI_SUB_DRIVERS, void root_bus_configure(void) { - PDEBUG((".")); /* Eventually this will be split up, but this is sufficient for now. */ @@ -5556,7 +5531,6 @@ bus_data_generation_check(int generation) void bus_data_generation_update(void) { - atomic_add_int(&bus_data_generation, 1); } @@ -5944,7 +5918,6 @@ static struct cdevsw devctl2_cdevsw = { static void devctl2_init(void) { - make_dev_credf(MAKEDEV_ETERNAL, &devctl2_cdevsw, 0, NULL, UID_ROOT, GID_WHEEL, 0600, "devctl2"); } @@ -5960,7 +5933,6 @@ SYSCTL_INT(_debug, OID_AUTO, obsolete_panic, CTLFLAG_R static void gone_panic(int major, int running, const char *msg) { - switch (obsolete_panic) { case 0: @@ -5977,7 +5949,6 @@ gone_panic(int major, int running, const char *msg) void _gone_in(int major, const char *msg) { - gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg); if (P_OSREL_MAJOR(__FreeBSD_version) >= major) printf("Obsolete code will be removed soon: %s\n", msg); @@ -5989,7 +5960,6 @@ _gone_in(int major, const char *msg) void _gone_in_dev(device_t dev, int major, const char *msg) { - gone_panic(major, P_OSREL_MAJOR(__FreeBSD_version), msg); if (P_OSREL_MAJOR(__FreeBSD_version) >= major) device_printf(dev, From owner-svn-src-all@freebsd.org Mon Aug 3 22:13:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 092E03A8E04; Mon, 3 Aug 2020 22:13:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLBwH6QxHz4SGV; Mon, 3 Aug 2020 22:13:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C14531B3D5; Mon, 3 Aug 2020 22:13:03 +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 073MD32f008087; Mon, 3 Aug 2020 22:13:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073MD3om008083; Mon, 3 Aug 2020 22:13:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202008032213.073MD3om008083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 3 Aug 2020 22:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363813 - in head: lib/libc/gen share/man/man4 sys/kern sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: lib/libc/gen share/man/man4 sys/kern sys/sys X-SVN-Commit-Revision: 363813 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 22:13:04 -0000 Author: kib Date: Mon Aug 3 22:13:02 2020 New Revision: 363813 URL: https://svnweb.freebsd.org/changeset/base/363813 Log: Add SOL_LOCAL symbolic constant for unix socket option level. The constant seems to exists on MacOS X >= 10.8. Requested by: swills Reviewed by: allanjude, kevans Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25933 Modified: head/lib/libc/gen/getpeereid.c head/share/man/man4/unix.4 head/sys/kern/uipc_usrreq.c head/sys/sys/un.h Modified: head/lib/libc/gen/getpeereid.c ============================================================================== --- head/lib/libc/gen/getpeereid.c Mon Aug 3 22:12:18 2020 (r363812) +++ head/lib/libc/gen/getpeereid.c Mon Aug 3 22:13:02 2020 (r363813) @@ -47,7 +47,7 @@ getpeereid(int s, uid_t *euid, gid_t *egid) int error; xuclen = sizeof(xuc); - error = _getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); + error = _getsockopt(s, SOL_LOCAL, LOCAL_PEERCRED, &xuc, &xuclen); if (error != 0) return (error); if (xuc.cr_version != XUCRED_VERSION) { Modified: head/share/man/man4/unix.4 ============================================================================== --- head/share/man/man4/unix.4 Mon Aug 3 22:12:18 2020 (r363812) +++ head/share/man/man4/unix.4 Mon Aug 3 22:13:02 2020 (r363813) @@ -28,7 +28,7 @@ .\" @(#)unix.4 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd August 3, 2020 .Dt UNIX 4 .Os .Sh NAME @@ -195,7 +195,9 @@ The sending process could have exited and its process reused for a new process. .Sh SOCKET OPTIONS .Tn UNIX -domain sockets support a number of socket options which can be set with +domain sockets support a number of socket options for the options level +.Dv SOL_LOCAL , +which can be set with .Xr setsockopt 2 and tested with .Xr getsockopt 2 : Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Mon Aug 3 22:12:18 2020 (r363812) +++ head/sys/kern/uipc_usrreq.c Mon Aug 3 22:13:02 2020 (r363813) @@ -1470,7 +1470,7 @@ uipc_ctloutput(struct socket *so, struct sockopt *sopt struct xucred xu; int error, optval; - if (sopt->sopt_level != 0) + if (sopt->sopt_level != SOL_LOCAL) return (EINVAL); unp = sotounpcb(so); Modified: head/sys/sys/un.h ============================================================================== --- head/sys/sys/un.h Mon Aug 3 22:12:18 2020 (r363812) +++ head/sys/sys/un.h Mon Aug 3 22:13:02 2020 (r363813) @@ -62,6 +62,8 @@ struct sockaddr_un { #if __BSD_VISIBLE +#define SOL_LOCAL 0 /* Options for local socket */ + /* Socket options. */ #define LOCAL_PEERCRED 1 /* retrieve peer credentials */ #define LOCAL_CREDS 2 /* pass credentials to receiver */ From owner-svn-src-all@freebsd.org Mon Aug 3 23:05:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EED423A9364; Mon, 3 Aug 2020 23:05:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLD5765HYz4VMG; Mon, 3 Aug 2020 23:05:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B43151BB74; Mon, 3 Aug 2020 23:05:47 +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 073N5lIs038843; Mon, 3 Aug 2020 23:05:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073N5lIs038842; Mon, 3 Aug 2020 23:05:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008032305.073N5lIs038842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Aug 2020 23:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363814 - stable/12/sys/dev/cxgbe X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/cxgbe X-SVN-Commit-Revision: 363814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 23:05:48 -0000 Author: markj Date: Mon Aug 3 23:05:47 2020 New Revision: 363814 URL: https://svnweb.freebsd.org/changeset/base/363814 Log: MFC r363623: cxgbe(4): Stop checking for failures from malloc(M_WAITOK). Modified: stable/12/sys/dev/cxgbe/t4_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/12/sys/dev/cxgbe/t4_main.c Mon Aug 3 22:13:02 2020 (r363813) +++ stable/12/sys/dev/cxgbe/t4_main.c Mon Aug 3 23:05:47 2020 (r363814) @@ -9667,10 +9667,6 @@ load_fw(struct adapter *sc, struct t4_data *fw) } fw_data = malloc(fw->len, M_CXGBE, M_WAITOK); - if (fw_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(fw->data, fw_data, fw->len); if (rc == 0) @@ -9699,10 +9695,6 @@ load_cfg(struct adapter *sc, struct t4_data *cfg) } cfg_data = malloc(cfg->len, M_CXGBE, M_WAITOK); - if (cfg_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(cfg->data, cfg_data, cfg->len); if (rc == 0) @@ -9748,10 +9740,6 @@ load_boot(struct adapter *sc, struct t4_bootrom *br) } br_data = malloc(br->len, M_CXGBE, M_WAITOK); - if (br_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(br->data, br_data, br->len); if (rc == 0) @@ -9780,10 +9768,6 @@ load_bootcfg(struct adapter *sc, struct t4_data *bc) } bc_data = malloc(bc->len, M_CXGBE, M_WAITOK); - if (bc_data == NULL) { - rc = ENOMEM; - goto done; - } rc = copyin(bc->data, bc_data, bc->len); if (rc == 0) From owner-svn-src-all@freebsd.org Mon Aug 3 23:06:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D78F03A936D; Mon, 3 Aug 2020 23:06:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLD625Rpmz4VNJ; Mon, 3 Aug 2020 23:06:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E8461BE2D; Mon, 3 Aug 2020 23:06:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 073N6Ycw038927; Mon, 3 Aug 2020 23:06:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 073N6XbV038920; Mon, 3 Aug 2020 23:06:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008032306.073N6XbV038920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 3 Aug 2020 23:06:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363815 - in stable/12/sys/dev: mpr mps X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/dev: mpr mps X-SVN-Commit-Revision: 363815 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Aug 2020 23:06:34 -0000 Author: markj Date: Mon Aug 3 23:06:33 2020 New Revision: 363815 URL: https://svnweb.freebsd.org/changeset/base/363815 Log: MFC r363608: mpr(4), mps(4): Stop checking for failures from malloc(M_WAITOK). Modified: stable/12/sys/dev/mpr/mpr.c stable/12/sys/dev/mpr/mpr_sas.c stable/12/sys/dev/mpr/mpr_user.c stable/12/sys/dev/mps/mps.c stable/12/sys/dev/mps/mps_sas.c stable/12/sys/dev/mps/mps_user.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mpr/mpr.c ============================================================================== --- stable/12/sys/dev/mpr/mpr.c Mon Aug 3 23:05:47 2020 (r363814) +++ stable/12/sys/dev/mpr/mpr.c Mon Aug 3 23:06:33 2020 (r363815) @@ -1562,10 +1562,6 @@ mpr_alloc_requests(struct mpr_softc *sc) */ sc->commands = malloc(sizeof(struct mpr_command) * sc->num_reqs, M_MPR, M_WAITOK | M_ZERO); - if (!sc->commands) { - mpr_dprint(sc, MPR_ERROR, "Cannot allocate command memory\n"); - return (ENOMEM); - } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; cm->cm_req = sc->req_frames + i * sc->reqframesz; @@ -2716,11 +2712,6 @@ mpr_register_events(struct mpr_softc *sc, uint8_t *mas int error = 0; eh = malloc(sizeof(struct mpr_event_handle), M_MPR, M_WAITOK|M_ZERO); - if (!eh) { - mpr_dprint(sc, MPR_EVENT|MPR_ERROR, - "Cannot allocate event memory\n"); - return (ENOMEM); - } eh->callback = cb; eh->data = data; TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list); Modified: stable/12/sys/dev/mpr/mpr_sas.c ============================================================================== --- stable/12/sys/dev/mpr/mpr_sas.c Mon Aug 3 23:05:47 2020 (r363814) +++ stable/12/sys/dev/mpr/mpr_sas.c Mon Aug 3 23:06:33 2020 (r363815) @@ -755,11 +755,6 @@ mpr_attach_sas(struct mpr_softc *sc) mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); sassc = malloc(sizeof(struct mprsas_softc), M_MPR, M_WAITOK|M_ZERO); - if (!sassc) { - mpr_dprint(sc, MPR_INIT|MPR_ERROR, - "Cannot allocate SAS subsystem memory\n"); - return (ENOMEM); - } /* * XXX MaxTargets could change during a reinit. Since we don't @@ -770,12 +765,6 @@ mpr_attach_sas(struct mpr_softc *sc) sassc->maxtargets = sc->facts->MaxTargets + sc->facts->MaxVolumes; sassc->targets = malloc(sizeof(struct mprsas_target) * sassc->maxtargets, M_MPR, M_WAITOK|M_ZERO); - if (!sassc->targets) { - mpr_dprint(sc, MPR_INIT|MPR_ERROR, - "Cannot allocate SAS target memory\n"); - free(sassc, M_MPR); - return (ENOMEM); - } sc->sassc = sassc; sassc->sc = sc; @@ -3960,8 +3949,4 @@ mprsas_realloc_targets(struct mpr_softc *sc, int maxta sassc->targets = malloc(sizeof(struct mprsas_target) * maxtargets, M_MPR, M_WAITOK|M_ZERO); - if (!sassc->targets) { - panic("%s failed to alloc targets with error %d\n", - __func__, ENOMEM); - } } Modified: stable/12/sys/dev/mpr/mpr_user.c ============================================================================== --- stable/12/sys/dev/mpr/mpr_user.c Mon Aug 3 23:05:47 2020 (r363814) +++ stable/12/sys/dev/mpr/mpr_user.c Mon Aug 3 23:06:33 2020 (r363815) @@ -1533,13 +1533,6 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re bzero(sc->fw_diag_buffer, buffer_size); ctx = malloc(sizeof(*ctx), M_MPR, M_WAITOK | M_ZERO); - if (ctx == NULL) { - device_printf(sc->mpr_dev, "%s: context malloc failed\n", - __func__); - *return_code = MPR_FW_DIAG_ERROR_NO_BUFFER; - status = MPR_DIAG_FAILURE; - goto bailout; - } ctx->addr = &sc->fw_diag_busaddr; ctx->buffer_dmat = sc->fw_diag_dmat; ctx->buffer_dmamap = sc->fw_diag_map; Modified: stable/12/sys/dev/mps/mps.c ============================================================================== --- stable/12/sys/dev/mps/mps.c Mon Aug 3 23:05:47 2020 (r363814) +++ stable/12/sys/dev/mps/mps.c Mon Aug 3 23:06:33 2020 (r363815) @@ -1513,10 +1513,6 @@ mps_alloc_requests(struct mps_softc *sc) */ sc->commands = malloc(sizeof(struct mps_command) * sc->num_reqs, M_MPT2, M_WAITOK | M_ZERO); - if(!sc->commands) { - mps_dprint(sc, MPS_ERROR, "Cannot allocate command memory\n"); - return (ENOMEM); - } for (i = 1; i < sc->num_reqs; i++) { cm = &sc->commands[i]; cm->cm_req = sc->req_frames + i * sc->reqframesz; @@ -2584,10 +2580,6 @@ mps_register_events(struct mps_softc *sc, u32 *mask, int error = 0; eh = malloc(sizeof(struct mps_event_handle), M_MPT2, M_WAITOK|M_ZERO); - if(!eh) { - mps_dprint(sc, MPS_ERROR, "Cannot allocate event memory\n"); - return (ENOMEM); - } eh->callback = cb; eh->data = data; TAILQ_INSERT_TAIL(&sc->event_list, eh, eh_list); Modified: stable/12/sys/dev/mps/mps_sas.c ============================================================================== --- stable/12/sys/dev/mps/mps_sas.c Mon Aug 3 23:05:47 2020 (r363814) +++ stable/12/sys/dev/mps/mps_sas.c Mon Aug 3 23:06:33 2020 (r363815) @@ -738,11 +738,6 @@ mps_attach_sas(struct mps_softc *sc) mps_dprint(sc, MPS_INIT, "%s entered\n", __func__); sassc = malloc(sizeof(struct mpssas_softc), M_MPT2, M_WAITOK|M_ZERO); - if(!sassc) { - mps_dprint(sc, MPS_INIT|MPS_ERROR, - "Cannot allocate SAS controller memory\n"); - return (ENOMEM); - } /* * XXX MaxTargets could change during a reinit. Since we don't @@ -753,12 +748,6 @@ mps_attach_sas(struct mps_softc *sc) sassc->maxtargets = sc->facts->MaxTargets + sc->facts->MaxVolumes; sassc->targets = malloc(sizeof(struct mpssas_target) * sassc->maxtargets, M_MPT2, M_WAITOK|M_ZERO); - if(!sassc->targets) { - mps_dprint(sc, MPS_INIT|MPS_ERROR, - "Cannot allocate SAS target memory\n"); - free(sassc, M_MPT2); - return (ENOMEM); - } sc->sassc = sassc; sassc->sc = sc; @@ -3671,8 +3660,4 @@ mpssas_realloc_targets(struct mps_softc *sc, int maxta sassc->targets = malloc(sizeof(struct mpssas_target) * maxtargets, M_MPT2, M_WAITOK|M_ZERO); - if (!sassc->targets) { - panic("%s failed to alloc targets with error %d\n", - __func__, ENOMEM); - } } Modified: stable/12/sys/dev/mps/mps_user.c ============================================================================== --- stable/12/sys/dev/mps/mps_user.c Mon Aug 3 23:05:47 2020 (r363814) +++ stable/12/sys/dev/mps/mps_user.c Mon Aug 3 23:06:33 2020 (r363815) @@ -1436,13 +1436,6 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re bzero(sc->fw_diag_buffer, buffer_size); ctx = malloc(sizeof(*ctx), M_MPSUSER, M_WAITOK | M_ZERO); - if (ctx == NULL) { - device_printf(sc->mps_dev, "%s: context malloc failed\n", - __func__); - *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; - status = MPS_DIAG_FAILURE; - goto bailout; - } ctx->addr = &sc->fw_diag_busaddr; ctx->buffer_dmat = sc->fw_diag_dmat; ctx->buffer_dmamap = sc->fw_diag_map; From owner-svn-src-all@freebsd.org Tue Aug 4 00:28:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6C063AB28F; Tue, 4 Aug 2020 00:28:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLFw65Pg1z4ZN9; Tue, 4 Aug 2020 00:28:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CDBD1CE8A; Tue, 4 Aug 2020 00:28:06 +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 0740S60o088808; Tue, 4 Aug 2020 00:28:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0740S6QJ088807; Tue, 4 Aug 2020 00:28:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008040028.0740S6QJ088807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Aug 2020 00:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363816 - stable/12/bin/ps X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/bin/ps X-SVN-Commit-Revision: 363816 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 00:28:06 -0000 Author: markj Date: Tue Aug 4 00:28:06 2020 New Revision: 363816 URL: https://svnweb.freebsd.org/changeset/base/363816 Log: MFC r363649: ps(1): Fix formatting of the "command" field for kernel threads. Modified: stable/12/bin/ps/ps.c Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/ps/ps.c ============================================================================== --- stable/12/bin/ps/ps.c Mon Aug 3 23:06:33 2020 (r363815) +++ stable/12/bin/ps/ps.c Tue Aug 4 00:28:06 2020 (r363816) @@ -1264,6 +1264,7 @@ fmt(char **(*fn)(kvm_t *, const struct kinfo_proc *, i static void saveuser(KINFO *ki) { + char tdname[COMMLEN + 1]; char *argsp; if (ki->ki_p->ki_flag & P_INMEM) { @@ -1280,12 +1281,14 @@ saveuser(KINFO *ki) * save arguments if needed */ if (needcomm) { - if (ki->ki_p->ki_stat == SZOMB) + if (ki->ki_p->ki_stat == SZOMB) { ki->ki_args = strdup(""); - else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) + } else if (UREADOK(ki) || (ki->ki_p->ki_args != NULL)) { + (void)snprintf(tdname, sizeof(tdname), "%s%s", + ki->ki_p->ki_tdname, ki->ki_p->ki_moretdname); ki->ki_args = fmt(kvm_getargv, ki, - ki->ki_p->ki_comm, ki->ki_p->ki_tdname, MAXCOMLEN); - else { + ki->ki_p->ki_comm, tdname, COMMLEN * 2 + 1); + } else { asprintf(&argsp, "(%s)", ki->ki_p->ki_comm); ki->ki_args = argsp; } From owner-svn-src-all@freebsd.org Tue Aug 4 02:06:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DF073ADAB0; Tue, 4 Aug 2020 02:06:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJ622Hvcz4fks; Tue, 4 Aug 2020 02:06:50 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 335C01E0ED; Tue, 4 Aug 2020 02:06:50 +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 07426o3S050071; Tue, 4 Aug 2020 02:06:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07426oHE050070; Tue, 4 Aug 2020 02:06:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040206.07426oHE050070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363817 - head/lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/regex X-SVN-Commit-Revision: 363817 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 02:06:50 -0000 Author: kevans Date: Tue Aug 4 02:06:49 2020 New Revision: 363817 URL: https://svnweb.freebsd.org/changeset/base/363817 Log: regex(3): belatedly document REG_POSIX from r363734 My original patch included this documented, but it appears that I failed to include the manpage update. Do so now. Modified: head/lib/libc/regex/regex.3 Modified: head/lib/libc/regex/regex.3 ============================================================================== --- head/lib/libc/regex/regex.3 Tue Aug 4 00:28:06 2020 (r363816) +++ head/lib/libc/regex/regex.3 Tue Aug 4 02:06:49 2020 (r363817) @@ -32,7 +32,7 @@ .\" @(#)regex.3 8.4 (Berkeley) 3/20/94 .\" $FreeBSD$ .\" -.Dd May 25, 2016 +.Dd April 15, 2017 .Dt REGEX 3 .Os .Sh NAME @@ -178,6 +178,17 @@ member is of type .Ft "const char *" . This flag permits inclusion of NULs in the RE; they are considered ordinary characters. +This is an extension, +compatible with but not specified by +.St -p1003.2 , +and should be used with +caution in software intended to be portable to other systems. +.It Dv REG_POSIX +Compile only +.St -p1003.2 +compliant expressions. +This flag has no effect unless linking against +.Nm libregex . This is an extension, compatible with but not specified by .St -p1003.2 , From owner-svn-src-all@freebsd.org Tue Aug 4 02:14:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 779863AE012; Tue, 4 Aug 2020 02:14:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJHJ2WyMz4gKX; Tue, 4 Aug 2020 02:14:52 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A96E1DEE1; Tue, 4 Aug 2020 02:14:52 +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 0742EqYg056051; Tue, 4 Aug 2020 02:14:52 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742Epw2056049; Tue, 4 Aug 2020 02:14:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040214.0742Epw2056049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363818 - head/lib/libc/regex X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/regex X-SVN-Commit-Revision: 363818 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 02:14:52 -0000 Author: kevans Date: Tue Aug 4 02:14:51 2020 New Revision: 363818 URL: https://svnweb.freebsd.org/changeset/base/363818 Log: libregex: Implement a subset of the GNU extensions The entire patch-set is not yet mature enough for commit, but this usable subset is generally enough for googletest to be happy with and mostly map to some existing concepts, so they're not as invasive. The specific changes included here are: - Branching in BREs with \| - \w and \W for [[:alnum:]] and [^[:alnum:]] respectively - \s and \S for [[:space:]] and [^[:space:]] respectively - Additional quantifiers in BREs, \? and \+ (self-explanatory) There's some #ifdef'd out work for allowing empty branches as a match-all. This is a feature that's under assessment... future work will determine how standard this behavior is and act accordingly. Modified: head/lib/libc/regex/regcomp.c head/lib/libc/regex/regex2.h Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Tue Aug 4 02:06:49 2020 (r363817) +++ head/lib/libc/regex/regcomp.c Tue Aug 4 02:14:51 2020 (r363818) @@ -92,6 +92,7 @@ struct parse { const char *next; /* next character in RE */ const char *end; /* end of string (-> NUL normally) */ int error; /* has an error been seen? */ + int gnuext; sop *strip; /* malloced strip */ sopno ssize; /* malloced strip size (allocated) */ sopno slen; /* malloced strip length (used) */ @@ -131,7 +132,9 @@ static int p_count(struct parse *p); static void p_bracket(struct parse *p); static int p_range_cmp(wchar_t c1, wchar_t c2); static void p_b_term(struct parse *p, cset *cs); +static int p_b_pseudoclass(struct parse *p, char c); static void p_b_cclass(struct parse *p, cset *cs); +static void p_b_cclass_named(struct parse *p, cset *cs, const char[]); static void p_b_eclass(struct parse *p, cset *cs); static wint_t p_b_symbol(struct parse *p); static wint_t p_b_coll_elem(struct parse *p, wint_t endc); @@ -181,6 +184,7 @@ static char nuls[10]; /* place to point scanner in ev #define SEESPEC(a) (p->bre ? SEETWO('\\', a) : SEE(a)) #define EAT(c) ((SEE(c)) ? (NEXT(), 1) : 0) #define EATTWO(a, b) ((SEETWO(a, b)) ? (NEXT2(), 1) : 0) +#define EATSPEC(a) (p->bre ? EATTWO('\\', a) : EAT(a)) #define NEXT() (p->next++) #define NEXT2() (p->next += 2) #define NEXTn(n) (p->next += (n)) @@ -270,14 +274,22 @@ regcomp_internal(regex_t * __restrict preg, p->pbegin[i] = 0; p->pend[i] = 0; } +#ifdef LIBREGEX + if (cflags®_POSIX) { + p->gnuext = false; + p->allowbranch = (cflags & REG_EXTENDED) != 0; + } else + p->gnuext = p->allowbranch = true; +#else + p->gnuext = false; + p->allowbranch = (cflags & REG_EXTENDED) != 0; +#endif if (cflags & REG_EXTENDED) { - p->allowbranch = true; p->bre = false; p->parse_expr = p_ere_exp; p->pre_parse = NULL; p->post_parse = NULL; } else { - p->allowbranch = false; p->bre = true; p->parse_expr = p_simp_re; p->pre_parse = p_bre_pre_parse; @@ -388,6 +400,10 @@ p_ere_exp(struct parse *p, struct branchc *bc) sopno pos; int count; int count2; +#ifdef LIBREGEX + int i; + int handled; +#endif sopno subno; int wascaret = 0; @@ -395,6 +411,9 @@ p_ere_exp(struct parse *p, struct branchc *bc) assert(MORE()); /* caller should have ensured this */ c = GETNEXT(); +#ifdef LIBREGEX + handled = 0; +#endif pos = HERE(); switch (c) { case '(': @@ -457,6 +476,47 @@ p_ere_exp(struct parse *p, struct branchc *bc) case '\\': (void)REQUIRE(MORE(), REG_EESCAPE); wc = WGETNEXT(); +#ifdef LIBREGEX + if (p->gnuext) { + handled = 1; + switch (wc) { + case 'W': + case 'w': + case 'S': + case 's': + p_b_pseudoclass(p, wc); + break; + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + i = wc - '0'; + assert(i < NPAREN); + if (p->pend[i] != 0) { + assert(i <= p->g->nsub); + EMIT(OBACK_, i); + assert(p->pbegin[i] != 0); + assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); + assert(OP(p->strip[p->pend[i]]) == ORPAREN); + (void) dupl(p, p->pbegin[i]+1, p->pend[i]); + EMIT(O_BACK, i); + } else + SETERROR(REG_ESUBREG); + p->g->backrefs = 1; + break; + default: + handled = 0; + } + /* Don't proceed to the POSIX bits if we've already handled it */ + if (handled) + break; + } +#endif switch (wc) { case '<': EMIT(OBOW, 0); @@ -567,7 +627,7 @@ p_branch_eat_delim(struct parse *p, struct branchc *bc (void)bc; nskip = 0; - while (EAT('|')) + while (EATSPEC('|')) ++nskip; return (nskip); } @@ -619,9 +679,15 @@ static bool p_branch_empty(struct parse *p, struct branchc *bc) { +#if defined(LIBREGEX) && defined(NOTYET) + if (bc->outer) + p->g->iflags |= EMPTBR; + return (true); +#else (void)bc; SETERROR(REG_EMPTY); return (false); +#endif } /* @@ -713,7 +779,11 @@ p_re(struct parse *p, } if (p->post_parse != NULL) p->post_parse(p, &bc); - (void) REQUIRE(HERE() != bc.start, REG_EMPTY); + (void) REQUIRE(p->gnuext || HERE() != bc.start, REG_EMPTY); +#ifdef LIBREGEX + if (HERE() == bc.start && !p_branch_empty(p, &bc)) + break; +#endif if (!p->allowbranch) break; /* @@ -740,101 +810,122 @@ static bool /* was the simple RE an unbackslashed $? p_simp_re(struct parse *p, struct branchc *bc) { int c; + int cc; /* convenient/control character */ int count; int count2; sopno pos; + bool handled; int i; wint_t wc; sopno subno; # define BACKSL (1<gnuext) { + handled = true; + switch (c) { + case BACKSL|'W': + case BACKSL|'w': + case BACKSL|'S': + case BACKSL|'s': + p_b_pseudoclass(p, cc); + break; + default: + handled = false; + } + } +#endif } - switch (c) { - case '.': - if (p->g->cflags®_NEWLINE) - nonnewline(p); - else - EMIT(OANY, 0); - break; - case '[': - p_bracket(p); - break; - case BACKSL|'<': - EMIT(OBOW, 0); - break; - case BACKSL|'>': - EMIT(OEOW, 0); - break; - case BACKSL|'{': - SETERROR(REG_BADRPT); - break; - case BACKSL|'(': - p->g->nsub++; - subno = p->g->nsub; - if (subno < NPAREN) - p->pbegin[subno] = HERE(); - EMIT(OLPAREN, subno); - /* the MORE here is an error heuristic */ - if (MORE() && !SEETWO('\\', ')')) - p_re(p, '\\', ')'); - if (subno < NPAREN) { - p->pend[subno] = HERE(); - assert(p->pend[subno] != 0); + if (!handled) { + switch (c) { + case '.': + if (p->g->cflags®_NEWLINE) + nonnewline(p); + else + EMIT(OANY, 0); + break; + case '[': + p_bracket(p); + break; + case BACKSL|'<': + EMIT(OBOW, 0); + break; + case BACKSL|'>': + EMIT(OEOW, 0); + break; + case BACKSL|'{': + SETERROR(REG_BADRPT); + break; + case BACKSL|'(': + p->g->nsub++; + subno = p->g->nsub; + if (subno < NPAREN) + p->pbegin[subno] = HERE(); + EMIT(OLPAREN, subno); + /* the MORE here is an error heuristic */ + if (MORE() && !SEETWO('\\', ')')) + p_re(p, '\\', ')'); + if (subno < NPAREN) { + p->pend[subno] = HERE(); + assert(p->pend[subno] != 0); + } + EMIT(ORPAREN, subno); + (void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN); + break; + case BACKSL|')': /* should not get here -- must be user */ + SETERROR(REG_EPAREN); + break; + case BACKSL|'1': + case BACKSL|'2': + case BACKSL|'3': + case BACKSL|'4': + case BACKSL|'5': + case BACKSL|'6': + case BACKSL|'7': + case BACKSL|'8': + case BACKSL|'9': + i = (c&~BACKSL) - '0'; + assert(i < NPAREN); + if (p->pend[i] != 0) { + assert(i <= p->g->nsub); + EMIT(OBACK_, i); + assert(p->pbegin[i] != 0); + assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); + assert(OP(p->strip[p->pend[i]]) == ORPAREN); + (void) dupl(p, p->pbegin[i]+1, p->pend[i]); + EMIT(O_BACK, i); + } else + SETERROR(REG_ESUBREG); + p->g->backrefs = 1; + break; + case '*': + /* + * Ordinary if used as the first character beyond BOL anchor of + * a (sub-)expression, counts as a bad repetition operator if it + * appears otherwise. + */ + (void)REQUIRE(bc->nchain == 0, REG_BADRPT); + /* FALLTHROUGH */ + default: + if (p->error != 0) + return (false); /* Definitely not $... */ + p->next--; + wc = WGETNEXT(); + if ((c & BACKSL) == 0 || may_escape(p, wc)) + ordinary(p, wc); + else + SETERROR(REG_EESCAPE); + break; } - EMIT(ORPAREN, subno); - (void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN); - break; - case BACKSL|')': /* should not get here -- must be user */ - SETERROR(REG_EPAREN); - break; - case BACKSL|'1': - case BACKSL|'2': - case BACKSL|'3': - case BACKSL|'4': - case BACKSL|'5': - case BACKSL|'6': - case BACKSL|'7': - case BACKSL|'8': - case BACKSL|'9': - i = (c&~BACKSL) - '0'; - assert(i < NPAREN); - if (p->pend[i] != 0) { - assert(i <= p->g->nsub); - EMIT(OBACK_, i); - assert(p->pbegin[i] != 0); - assert(OP(p->strip[p->pbegin[i]]) == OLPAREN); - assert(OP(p->strip[p->pend[i]]) == ORPAREN); - (void) dupl(p, p->pbegin[i]+1, p->pend[i]); - EMIT(O_BACK, i); - } else - SETERROR(REG_ESUBREG); - p->g->backrefs = 1; - break; - case '*': - /* - * Ordinary if used as the first character beyond BOL anchor of - * a (sub-)expression, counts as a bad repetition operator if it - * appears otherwise. - */ - (void)REQUIRE(bc->nchain == 0, REG_BADRPT); - /* FALLTHROUGH */ - default: - if (p->error != 0) - return (false); /* Definitely not $... */ - p->next--; - wc = WGETNEXT(); - if ((c & BACKSL) == 0 || may_escape(p, wc)) - ordinary(p, wc); - else - SETERROR(REG_EESCAPE); - break; } if (EAT('*')) { /* implemented as +? */ @@ -843,6 +934,14 @@ p_simp_re(struct parse *p, struct branchc *bc) ASTERN(O_PLUS, pos); INSERT(OQUEST_, pos); ASTERN(O_QUEST, pos); +#ifdef LIBREGEX + } else if (p->gnuext && EATTWO('\\', '?')) { + INSERT(OQUEST_, pos); + ASTERN(O_QUEST, pos); + } else if (p->gnuext && EATTWO('\\', '+')) { + INSERT(OPLUS_, pos); + ASTERN(O_PLUS, pos); +#endif } else if (EATTWO('\\', '{')) { count = p_count(p); if (EAT(',')) { @@ -1035,6 +1134,41 @@ p_b_term(struct parse *p, cset *cs) } /* + - p_b_pseudoclass - parse a pseudo-class (\w, \W, \s, \S) + == static int p_b_pseudoclass(struct parse *p, char c) + */ +static int +p_b_pseudoclass(struct parse *p, char c) { + cset *cs; + + if ((cs = allocset(p)) == NULL) + return(0); + + if (p->g->cflags®_ICASE) + cs->icase = 1; + + switch (c) { + case 'W': + cs->invert = 1; + /* PASSTHROUGH */ + case 'w': + p_b_cclass_named(p, cs, "alnum"); + break; + case 'S': + cs->invert = 1; + /* PASSTHROUGH */ + case 's': + p_b_cclass_named(p, cs, "space"); + break; + default: + return(0); + } + + EMIT(OANYOF, (int)(cs - p->g->sets)); + return(1); +} + +/* - p_b_cclass - parse a character-class name and deal with it == static void p_b_cclass(struct parse *p, cset *cs); */ @@ -1043,7 +1177,6 @@ p_b_cclass(struct parse *p, cset *cs) { const char *sp = p->next; size_t len; - wctype_t wct; char clname[16]; while (MORE() && isalpha((uch)PEEK())) @@ -1055,6 +1188,17 @@ p_b_cclass(struct parse *p, cset *cs) } memcpy(clname, sp, len); clname[len] = '\0'; + + p_b_cclass_named(p, cs, clname); +} +/* + - p_b_cclass_named - deal with a named character class + == static void p_b_cclass_named(struct parse *p, cset *cs, const char []); + */ +static void +p_b_cclass_named(struct parse *p, cset *cs, const char clname[]) { + wctype_t wct; + if ((wct = wctype(clname)) == 0) { SETERROR(REG_ECTYPE); return; Modified: head/lib/libc/regex/regex2.h ============================================================================== --- head/lib/libc/regex/regex2.h Tue Aug 4 02:06:49 2020 (r363817) +++ head/lib/libc/regex/regex2.h Tue Aug 4 02:14:51 2020 (r363818) @@ -182,6 +182,7 @@ struct re_guts { # define USEBOL 01 /* used ^ */ # define USEEOL 02 /* used $ */ # define BAD 04 /* something wrong */ +# define EMPTBR 010 /* empty branch present */ int nbol; /* number of ^ used */ int neol; /* number of $ used */ char *must; /* match must contain this string */ From owner-svn-src-all@freebsd.org Tue Aug 4 02:16:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22B903ADDDA; Tue, 4 Aug 2020 02:16:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJKS04mkz3Rhr; Tue, 4 Aug 2020 02:16:44 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA3101DC74; Tue, 4 Aug 2020 02:16:43 +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 0742Gh07056184; Tue, 4 Aug 2020 02:16:43 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742GhUW056183; Tue, 4 Aug 2020 02:16:43 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040216.0742GhUW056183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363819 - head/lib/libregex/tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libregex/tests X-SVN-Commit-Revision: 363819 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 02:16:44 -0000 Author: kevans Date: Tue Aug 4 02:16:43 2020 New Revision: 363819 URL: https://svnweb.freebsd.org/changeset/base/363819 Log: libregex: disable some of the unimplemented test cases for now This should allow the tests to actually pass. Future work will uncomment the unimplemented tests as they're implemented. Modified: head/lib/libregex/tests/gnuext.in head/lib/libregex/tests/libregex_test.sh Modified: head/lib/libregex/tests/gnuext.in ============================================================================== --- head/lib/libregex/tests/gnuext.in Tue Aug 4 02:14:51 2020 (r363818) +++ head/lib/libregex/tests/gnuext.in Tue Aug 4 02:16:43 2020 (r363819) @@ -17,14 +17,16 @@ a\|b\|c b abc a \s\+ b aSNTb SNT # Word boundaries (\b, \B, \<, \>, \`, \') # (is/not boundary, start/end word, start/end subject string) -\babc\b & abc +# Most of these are disabled for the moment, and will be re-enabled as +# we become feature complete. +#\babc\b & abc \ & abc -\Babc\B & abc -\B[abc]\B & b -\B[abc]+ - bc -\B[abc]\+ b bc -\`abc\' & abc abc -\`.+\' - abNc abNc -\`.\+\' b abNc abNc -(\`a) - Na -(a\') - aN +#\Babc\B & abc +#\B[abc]\B & b +#\B[abc]+ - bc +#\B[abc]\+ b bc +#\`abc\' & abc abc +#\`.+\' - abNc abNc +#\`.\+\' b abNc abNc +#(\`a) - Na +#(a\') - aN Modified: head/lib/libregex/tests/libregex_test.sh ============================================================================== --- head/lib/libregex/tests/libregex_test.sh Tue Aug 4 02:14:51 2020 (r363818) +++ head/lib/libregex/tests/libregex_test.sh Tue Aug 4 02:16:43 2020 (r363819) @@ -30,10 +30,6 @@ check() { local dataname="${1}"; shift - if [ "${dataname}" == "gnuext" ]; then - atf_expect_fail "GNU extensions are not currently implemented" - fi - prog="$(atf_get_srcdir)/h_regex" data="$(atf_get_srcdir)/data/${dataname}.in" From owner-svn-src-all@freebsd.org Tue Aug 4 02:18:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 784463AE18A; Tue, 4 Aug 2020 02:18:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJMP2fBdz3Rv2; Tue, 4 Aug 2020 02:18:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E02B1DE5E; Tue, 4 Aug 2020 02:18:25 +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 0742IPbf056300; Tue, 4 Aug 2020 02:18:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742IOa6056297; Tue, 4 Aug 2020 02:18:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040218.0742IOa6056297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363820 - in head: lib/googletest/gtest share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/googletest/gtest share/mk X-SVN-Commit-Revision: 363820 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 02:18:25 -0000 Author: kevans Date: Tue Aug 4 02:18:24 2020 New Revision: 363820 URL: https://svnweb.freebsd.org/changeset/base/363820 Log: gtest: link against libregex for GNU extensions gtest tests want to use \w ([[:alnum:]]) at the very least, which was causing them to fail after r363679. Start linking against libregex so that this shorthand is implemented. PR: 248452 Modified: head/lib/googletest/gtest/Makefile head/share/mk/src.libnames.mk Modified: head/lib/googletest/gtest/Makefile ============================================================================== --- head/lib/googletest/gtest/Makefile Tue Aug 4 02:16:43 2020 (r363819) +++ head/lib/googletest/gtest/Makefile Tue Aug 4 02:18:24 2020 (r363820) @@ -45,7 +45,7 @@ INTERNAL_CUSTOM_INCS+= gtest/internal/custom/gtest.h SRCS+= gtest-all.cc -LIBADD+= pthread +LIBADD+= pthread regex HAS_TESTS= SUBDIR.${MK_TESTS}+= tests Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Tue Aug 4 02:16:43 2020 (r363819) +++ head/share/mk/src.libnames.mk Tue Aug 4 02:18:24 2020 (r363820) @@ -320,7 +320,7 @@ _DP_dpv= dialog figpar util ncursesw _DP_dialog= ncursesw m _DP_cuse= pthread _DP_atf_cxx= atf_c -_DP_gtest= pthread +_DP_gtest= pthread regex _DP_gmock= gtest _DP_gmock_main= gmock _DP_gtest_main= gtest From owner-svn-src-all@freebsd.org Tue Aug 4 02:20:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 576533AE061; Tue, 4 Aug 2020 02:20:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJPX1fk9z3Rqc; Tue, 4 Aug 2020 02:20:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DB5F1E249; Tue, 4 Aug 2020 02:20:16 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0742KFNR056486; Tue, 4 Aug 2020 02:20:15 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742KFjf056485; Tue, 4 Aug 2020 02:20:15 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040220.0742KFjf056485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:20:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363821 - head/contrib/googletest/googletest/test X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/googletest/googletest/test X-SVN-Commit-Revision: 363821 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 02:20:16 -0000 Author: kevans Date: Tue Aug 4 02:20:15 2020 New Revision: 363821 URL: https://svnweb.freebsd.org/changeset/base/363821 Log: Re-enable disabled googletest-port-test tests after r363820 gtest now links against libregex here, and the tests pass locally. PR: 248452 Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc Modified: head/contrib/googletest/googletest/test/googletest-port-test.cc ============================================================================== --- head/contrib/googletest/googletest/test/googletest-port-test.cc Tue Aug 4 02:18:24 2020 (r363820) +++ head/contrib/googletest/googletest/test/googletest-port-test.cc Tue Aug 4 02:20:15 2020 (r363821) @@ -403,8 +403,6 @@ typedef testing::Types< TYPED_TEST_CASE(RETest, StringTypes); // Tests RE's implicit constructors. -/* -https://bugs.freebsd.org/248452 TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE empty(TypeParam("")); EXPECT_STREQ("", empty.pattern()); @@ -415,7 +413,6 @@ TYPED_TEST(RETest, ImplicitConstructorWorks) { const RE normal(TypeParam(".*(\\w+)")); EXPECT_STREQ(".*(\\w+)", normal.pattern()); } -*/ // Tests that RE's constructors reject invalid regular expressions. TYPED_TEST(RETest, RejectsInvalidRegex) { @@ -864,8 +861,6 @@ TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNo } // Tests RE's implicit constructors. -/* -https://bugs.freebsd.org/248452 TEST(RETest, ImplicitConstructorWorks) { const RE empty(""); EXPECT_STREQ("", empty.pattern()); @@ -873,7 +868,6 @@ TEST(RETest, ImplicitConstructorWorks) { const RE simple("hello"); EXPECT_STREQ("hello", simple.pattern()); } -*/ // Tests that RE's constructors reject invalid regular expressions. TEST(RETest, RejectsInvalidRegex) { From owner-svn-src-all@freebsd.org Tue Aug 4 02:31:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 962C03AE806; Tue, 4 Aug 2020 02:31:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLJfx3WkXz3Sf3; Tue, 4 Aug 2020 02:31:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C1AA1E41F; Tue, 4 Aug 2020 02:31:53 +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 0742VrVg068325; Tue, 4 Aug 2020 02:31:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742VrvG068324; Tue, 4 Aug 2020 02:31:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202008040231.0742VrvG068324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 4 Aug 2020 02:31:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363822 - stable/12/usr.sbin/ctld X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/usr.sbin/ctld X-SVN-Commit-Revision: 363822 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 02:31:53 -0000 Author: mav Date: Tue Aug 4 02:31:52 2020 New Revision: 363822 URL: https://svnweb.freebsd.org/changeset/base/363822 Log: MFC r363656: When modifying LUN pass "special" options too. Before switching to nvlists CTL merged previous and new options, so any options not passed just kept previous value. Now CTL completely replaces them, so we must pass everything still relevant. Modified: stable/12/usr.sbin/ctld/kernel.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/ctld/kernel.c ============================================================================== --- stable/12/usr.sbin/ctld/kernel.c Tue Aug 4 02:20:15 2020 (r363821) +++ stable/12/usr.sbin/ctld/kernel.c Tue Aug 4 02:31:52 2020 (r363822) @@ -776,6 +776,30 @@ kernel_lun_modify(struct lun *lun) req.reqdata.modify.lun_id = lun->l_ctl_lun; req.reqdata.modify.lun_size_bytes = lun->l_size; + if (lun->l_path != NULL) { + o = option_find(&lun->l_options, "file"); + if (o != NULL) { + option_set(o, lun->l_path); + } else { + o = option_new(&lun->l_options, "file", lun->l_path); + assert(o != NULL); + } + } + + o = option_find(&lun->l_options, "ctld_name"); + if (o != NULL) { + option_set(o, lun->l_name); + } else { + o = option_new(&lun->l_options, "ctld_name", lun->l_name); + assert(o != NULL); + } + + o = option_find(&lun->l_options, "scsiname"); + if (o == NULL && lun->l_scsiname != NULL) { + o = option_new(&lun->l_options, "scsiname", lun->l_scsiname); + assert(o != NULL); + } + if (!TAILQ_EMPTY(&lun->l_options)) { req.args_nvl = nvlist_create(0); if (req.args_nvl == NULL) { From owner-svn-src-all@freebsd.org Tue Aug 4 02:47:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DABD3AEF09; Tue, 4 Aug 2020 02:47:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLK0s1pV8z3T4B; Tue, 4 Aug 2020 02:47:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 222111E8B5; Tue, 4 Aug 2020 02:47:25 +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 0742lPT2074679; Tue, 4 Aug 2020 02:47:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0742lO9a074677; Tue, 4 Aug 2020 02:47:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040247.0742lO9a074677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 02:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363823 - head/usr.bin/grep X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/grep X-SVN-Commit-Revision: 363823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 02:47:25 -0000 Author: kevans Date: Tue Aug 4 02:47:24 2020 New Revision: 363823 URL: https://svnweb.freebsd.org/changeset/base/363823 Log: bsdgrep: switch to libregex for GNU_GREP_COMPAT libregex is incomplete, but it's a bit less buggy than the in-base libgnuregex and mostly OK. While here, rename -DIWTH_GNU -> -DWITH_GNU_COMPAT; the option implies that we're compatible with the GNU counterpart, not that we're including GNU anything. Modified: head/usr.bin/grep/Makefile head/usr.bin/grep/grep.c Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Tue Aug 4 02:31:52 2020 (r363822) +++ head/usr.bin/grep/Makefile Tue Aug 4 02:47:24 2020 (r363823) @@ -61,8 +61,8 @@ MLINKS+= grep.1 egrep.1 \ .endif .if ${MK_GNU_GREP_COMPAT} != "no" -CFLAGS+= -I${SYSROOT:U${DESTDIR}}/usr/include/gnu -DWITH_GNU -LIBADD+= gnuregex +CFLAGS+= -DWITH_GNU_COMPAT +LIBADD+= regex .endif HAS_TESTS= Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Tue Aug 4 02:31:52 2020 (r363822) +++ head/usr.bin/grep/grep.c Tue Aug 4 02:47:24 2020 (r363823) @@ -555,7 +555,7 @@ main(int argc, char *argv[]) filebehave = FILE_MMAP; break; case 'V': -#ifdef WITH_GNU +#ifdef WITH_GNU_COMPAT printf(errstr[9], getprogname(), VERSION); #else printf(errstr[8], getprogname(), VERSION); From owner-svn-src-all@freebsd.org Tue Aug 4 03:43:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 470583AFEEA; Tue, 4 Aug 2020 03:43:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLLFY1BDkz3XXR; Tue, 4 Aug 2020 03:43:29 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BB361EFC3; Tue, 4 Aug 2020 03:43:29 +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 0743hSxh013230; Tue, 4 Aug 2020 03:43:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0743hSX3013228; Tue, 4 Aug 2020 03:43:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008040343.0743hSX3013228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 03:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363824 - in head: . lib X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: . lib X-SVN-Commit-Revision: 363824 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 03:43:29 -0000 Author: kevans Date: Tue Aug 4 03:43:28 2020 New Revision: 363824 URL: https://svnweb.freebsd.org/changeset/base/363824 Log: Ensure libregex is built in time for googletest In lib/Makefile, we document the dependency with SUBDIR_DEPEND For buildworld orchestration, just prebuild libregex if GOOGLETEST is enabled. googletest will get built in a later pass. Modified: head/Makefile.inc1 head/lib/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 4 02:47:24 2020 (r363823) +++ head/Makefile.inc1 Tue Aug 4 03:43:28 2020 (r363824) @@ -2741,6 +2741,10 @@ _prebuild_libs+= gnu/lib/libdialog gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L .endif +.if ${MK_GOOGLETEST} != "no" +_prebuild_libs+= lib/libregex +.endif + .if ${MK_LIBCPLUSPLUS} != "no" _prebuild_libs+= lib/libc++ .endif Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Tue Aug 4 02:47:24 2020 (r363823) +++ head/lib/Makefile Tue Aug 4 03:43:28 2020 (r363824) @@ -107,6 +107,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ # libraries, those libraries should be listed as build order dependencies here. SUBDIR_DEPEND_geom= libufs +SUBDIR_DEPEND_googletest= libregex SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd libzstd SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} From owner-svn-src-all@freebsd.org Tue Aug 4 08:03:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AF8F3B446C for ; Tue, 4 Aug 2020 08:03:53 +0000 (UTC) (envelope-from noreply@email.alpes-plafond.com) Received: from email.alpes-plafond.com (email.alpes-plafond.com [153.92.229.239]) (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 4BLS201cHPz41kG for ; Tue, 4 Aug 2020 08:03:51 +0000 (UTC) (envelope-from noreply@email.alpes-plafond.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alpes-plafond.com; q=dns/txt; s=mail; bh=iBjT1wuBInqVPnY0TojS0n1UEY92LFZbK/0eFwj+Nbg=; h=from:reply-to:subject:date:mime-version:content-type:list-id:list-unsubscribe:x-csa-complaints:list-unsubscribe-post; b=DyPP70ySscpYvtKtr5dSZbynIRat6RvtJ6ir2OxHhS50WnoO6RhhFhKdXnenC9GixwV4tCWlZSIb EUnjbj9QWrGszQ0mDvTcay1yVH8T7sOhZk4Tn6Adagtqvh0pODQF14RJ0vXmO0KCvkT/ZGwdiBt6 AGTY1sKsuBx42n7uFBc= To: Subject: Votre projet ... Date: Tue, 04 Aug 2020 08:03:44 +0000 Feedback-ID: 153.92.229.239:1320145_317:1320145:Sendinblue From: Alpes Plafond List-Unsubscribe-Post: List-Unsubscribe=One-Click MIME-Version: 1.0 Message-Id: <202004080803.1yiqgrnfxabklzj@email.alpes-plafond.com> Precedence: bulk Reply-To: alpesplafond@free.fr X-Csa-Complaints: whitelist-complaints@eco.de X-Mailer: Sendinblue X-Mailin-Campaign: 317 X-Mailin-Client: 1320145 X-Mailin-Version: 2 | 0 X-sib-id: 0oaD4acd7WdYjsWK7tZWOCO4GXTRY_Q5Gw5qN8M7UjvQ7kM7M7iEijMHTRS6_QYSmHf7fYmwqQDIl06YYJEZcY_k5m51SGjXjzxAWhS4xioq1YHgeXQd98vxo-tydOB73Tay_6zPXPCtNj6EHFriDkzB0MJXw652JTnmbiGcz_iAiC4 X-Rspamd-Queue-Id: 4BLS201cHPz41kG X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=alpes-plafond.com header.s=mail header.b=DyPP70yS; dmarc=none; spf=pass (mx1.freebsd.org: domain of noreply@email.alpes-plafond.com designates 153.92.229.239 as permitted sender) smtp.mailfrom=noreply@email.alpes-plafond.com X-Spamd-Result: default: False [3.54 / 15.00]; HAS_REPLYTO(0.00)[alpesplafond@free.fr]; XM_UA_NO_VERSION(0.01)[]; R_SPF_ALLOW(-0.20)[+ip4:153.92.224.0/19]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[alpes-plafond.com:+]; NEURAL_HAM_SHORT(-0.21)[-0.214]; FORGED_SENDER(0.30)[contact@alpes-plafond.com,noreply@email.alpes-plafond.com]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:200484, ipnet:153.92.228.0/22, country:FR]; FROM_NEQ_ENVFROM(0.00)[contact@alpes-plafond.com,noreply@email.alpes-plafond.com]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[alpes-plafond.com:s=mail]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HTML_SHORT_LINK_IMG_1(2.00)[]; PRECEDENCE_BULK(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FREEMAIL_REPLYTO(0.00)[free.fr]; HAS_LIST_UNSUB(-0.01)[]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MANY_INVISIBLE_PARTS(1.00)[10]; DMARC_NA(0.00)[alpes-plafond.com]; NEURAL_SPAM_MEDIUM(0.29)[0.292]; NEURAL_SPAM_LONG(0.66)[0.660] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 08:03:53 -0000 [ ]( # ) [ ]( # ) [ ]( # ) [ ]( # ) [ ]( http://www.alpesplafond.sitew.fr/?utm_source=3Dsendinblue&utm_campaig= n=3Dmini_site_TEST_HARDBOUNCES_Rnovez_vos_plafonds_sans_travaux_sans_bouger= _vos_meubles&utm_medium=3Demail ) [ ]( # ) =C2=A0 RENOVER SON PLAFOND =C2=A0 [ ]( # ) =C2=A0 en 1 journ=C3=A9e seulement=C2=A0 =C2=A0 [ ]( # ) =C2=A0 sans d=C3=A9m=C3=A9nager les meubles, sans poussi=C3=A8re, sans peinture ga= rantie 10 ans =C2=A0 [ ]( # ) =C2=A0 =C3=A0 un PRIX ABORDABLE =C2=A0 [ ]( # ) =C2=A0 C'EST POSSIBLE ! =C2=A0 [ ]( # ) =C2=A0 [ En savoir + ]( http://www.alpesplafond.sitew.fr/?ut= m_source=3Dsendinblue&utm_campaign=3Dmini_site_TEST_HARDBOUNCES_Rnovez_vos_= plafonds_sans_travaux_sans_bouger_vos_meubles&utm_medium=3Demail ) =C2= =A0 [ ]( # ) =C2=A0 =C2=A0 [ Cliquez pour voir nos r=C3=A9alisations : ]( http://www.alpesplafo= nd.sitew.fr/?utm_source=3Dsendinblue&utm_campaign=3Dmini_site_TEST_HARDBOUN= CES_Rnovez_vos_plafonds_sans_travaux_sans_bouger_vos_meubles&utm_medium=3De= mail ) =C2=A0 [ ]( # ) [ ]( http://www.alpesplafond.sitew.fr/?utm_source=3Dsendinblue&utm_campaig= n=3Dmini_site_TEST_HARDBOUNCES_Rnovez_vos_plafonds_sans_travaux_sans_bouger= _vos_meubles&utm_medium=3Demail ) [ ]( # ) Sp=C3=A9cialiste depuis + de 15 ans dans la pose de plafond tendu Is=C3=A8re, Savoie, Haute Savoie [ ]( # ) =C2=A0 [ Consultez les avis de nos clients ]( https://www.societe-des-avis-garanti= s.fr/alpes-plafond-com/?utm_source=3Dsendinblue&utm_campaign=3Dmini_site_TE= ST_HARDBOUNCES_Rnovez_vos_plafonds_sans_travaux_sans_bouger_vos_meubles&utm= _medium=3Demail ) =C2=A0 [ ]( # ) =C2=A0 =C2=A0 Alpes Plafond=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A004.76.00.93.06 19, boulevard des Alpes=C2=A0 =C2=A0 =C2=A0 [ alpesplafond@orange.fr ]( mai= lto:alpesplafond@orange.fr ) 38240 MEYLAN=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0[ www.alpes-plafond.com ]( http://www.alpes-plafond.com/?utm_source= =3Dsendinblue&utm_campaign=3Dmini_site_TEST_HARDBOUNCES_Rnovez_vos_plafonds= _sans_travaux_sans_bouger_vos_meubles&utm_medium=3Demail ) [ ]( # ) =C2=A0 [ Se d=C3=A9sinscrire ]( http://r.email.alpes-plafond.com/mk/un/PELD3WmkGmg= VOmI7zcP6Oqgszge7GWnIVRRb6fvKe9qYZxeQyM0V0QqQGlTUoYGpZRJ3C9EgC0lrUIHkkSe-iE= lGbrZDzS3wCYFi87G5L56AfHCdPk5kqC2aT8oAlZKi0QumD3JuF_FmDIGbUfCFuComdSuJy2b-l= Wl1Nndp8g ) =C2=A0 From owner-svn-src-all@freebsd.org Tue Aug 4 08:46:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CBFA3B53C3; Tue, 4 Aug 2020 08:46:29 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLSz91qKRz44Hr; Tue, 4 Aug 2020 08:46:29 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 093A122D8B; Tue, 4 Aug 2020 08:46:29 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0748kS4n096912; Tue, 4 Aug 2020 08:46:28 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0748kS7e096911; Tue, 4 Aug 2020 08:46:28 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008040846.0748kS7e096911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Tue, 4 Aug 2020 08:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363829 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 363829 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 08:46:29 -0000 Author: gbe (doc committer) Date: Tue Aug 4 08:46:28 2020 New Revision: 363829 URL: https://svnweb.freebsd.org/changeset/base/363829 Log: directory(3): Add an ERRORS section - Add an ERRORS section for opendir(3) and closedir(3) - Document also the errors of readdir(3), readdir_r(3) and telldir(3) - Convert the code sample into an EXAMPLES section PR: 75711 Submitted by: abc Reviewed by: 0mp, bcr, jilles Approved by: 0mp, bcr, jilles Obtained from: partial from OpenBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25892 Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Tue Aug 4 06:39:49 2020 (r363828) +++ head/lib/libc/gen/directory.3 Tue Aug 4 08:46:28 2020 (r363829) @@ -28,7 +28,7 @@ .\" @(#)directory.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 30, 2019 +.Dd August 1, 2020 .Dt DIRECTORY 3 .Os .Sh NAME @@ -242,7 +242,7 @@ returns the integer file descriptor associated with th .Em directory stream , see .Xr open 2 . -.Pp +.Sh EXAMPLES Sample code which searches a directory for entry ``name'' is: .Bd -literal -offset indent dirp = opendir("."); @@ -258,6 +258,76 @@ while ((dp = readdir(dirp)) != NULL) { (void)closedir(dirp); return (NOT_FOUND); .Ed +.Sh ERRORS +The +.Fn opendir +function will fail if: +.Bl -tag -width Er +.It Bq Er EACCES +Search permission is denied for the component of the path prefix of +.Fa filename +or read permission is denied for +.Fa filename . +.It Bq Er ELOOP +A loop exists in symbolic links encountered during resolution of the +.Fa filename +argument. +.It Bq Er ENAMETOOLONG +The length of the +.Fa filename +argument exceeds +.Brq Dv PATH_MAX +or +a pathname component is longer than +.Brq Dv NAME_MAX . +.It Bq Er ENOENT +A component of +.Fa filename +does not name an existing directory or +.Fa filename +is an empty string. +.It Bq Er ENOTDIR +A component of +.Fa filename +is not a directory. +.El +.Pp +The +.Fn fdopendir +function will fail if: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid file descriptor open for reading. +.It Bq Er ENOTDIR +The descriptor +.Fa fd +is not associated with a directory. +.El +.Pp +The +.Fn readdir +and +.Fn readdir_r +functions may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr getdents 2 . +.Pp +The +.Fn telldir +function may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr realloc 3 . +.Pp +The +.Fn closedir +function may also fail and set +.Va errno +for any of the errors specified for the routine +.Xr close 2 . .Sh SEE ALSO .Xr close 2 , .Xr lseek 2 , From owner-svn-src-all@freebsd.org Tue Aug 4 11:13:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8FA237040F; Tue, 4 Aug 2020 11:13:13 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLXDT4zDQz4DQB; Tue, 4 Aug 2020 11:13:13 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F5312489C; Tue, 4 Aug 2020 11:13:13 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074BDD9S089884; Tue, 4 Aug 2020 11:13:13 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074BDDMT089883; Tue, 4 Aug 2020 11:13:13 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008041113.074BDDMT089883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Tue, 4 Aug 2020 11:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363830 - head/usr.sbin/iovctl X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.sbin/iovctl X-SVN-Commit-Revision: 363830 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 11:13:13 -0000 Author: gbe (doc committer) Date: Tue Aug 4 11:13:13 2020 New Revision: 363830 URL: https://svnweb.freebsd.org/changeset/base/363830 Log: iovctl.conf(5): Use Lk macro for the URL of the UCL website PR: 248334 Reported by: chuck at tuffli dot net Reviewed by: bcr, 0mp Approved by: bcr, 0mp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25891 Modified: head/usr.sbin/iovctl/iovctl.conf.5 Modified: head/usr.sbin/iovctl/iovctl.conf.5 ============================================================================== --- head/usr.sbin/iovctl/iovctl.conf.5 Tue Aug 4 08:46:28 2020 (r363829) +++ head/usr.sbin/iovctl/iovctl.conf.5 Tue Aug 4 11:13:13 2020 (r363830) @@ -51,7 +51,7 @@ The .Nm file uses UCL format. UCL syntax is documented at the official UCL website: -http://github.com/vstakhov/libucl. +.Lk http://github.com/vstakhov/libucl . .Pp There are three types of sections in the .Nm From owner-svn-src-all@freebsd.org Tue Aug 4 12:04:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FF1937226F; Tue, 4 Aug 2020 12:04:48 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLYN02pGCz4H0h; Tue, 4 Aug 2020 12:04:48 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4373524F58; Tue, 4 Aug 2020 12:04:48 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074C4m6G020736; Tue, 4 Aug 2020 12:04:48 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074C4lCp020734; Tue, 4 Aug 2020 12:04:47 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202008041204.074C4lCp020734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 4 Aug 2020 12:04:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363831 - in stable/12: lib/libpmc sys/dev/hwpmc X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable/12: lib/libpmc sys/dev/hwpmc X-SVN-Commit-Revision: 363831 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 12:04:48 -0000 Author: freqlabs Date: Tue Aug 4 12:04:47 2020 New Revision: 363831 URL: https://svnweb.freebsd.org/changeset/base/363831 Log: MFC r363630: libpmc: Use known pmc_cpuid buffer size Use the existing PMC_CPUID_LEN to size pmc_cpuid in the kernel and various buffers for reading it in libpmc. This avoids some extra syscalls and malloc/frees. While in here, use strlcpy to copy a user-provided cpuid string instead of memcpy, to make sure we terminate the buffer. Reviewed by: mav Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25679 Modified: stable/12/lib/libpmc/libpmc_pmu_util.c stable/12/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- stable/12/lib/libpmc/libpmc_pmu_util.c Tue Aug 4 11:13:13 2020 (r363830) +++ stable/12/lib/libpmc/libpmc_pmu_util.c Tue Aug 4 12:04:47 2020 (r363831) @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -89,20 +90,13 @@ static struct pmu_alias pmu_amd_alias_table[] = { static pmu_mfr_t pmu_events_mfr(void) { - char *buf; - size_t s; + char buf[PMC_CPUID_LEN]; + size_t s = sizeof(buf); pmu_mfr_t mfr; - if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, &s, + if (sysctlbyname("kern.hwpmc.cpuid", buf, &s, (void *)NULL, 0) == -1) return (PMU_INVALID); - if ((buf = malloc(s + 1)) == NULL) - return (PMU_INVALID); - if (sysctlbyname("kern.hwpmc.cpuid", buf, &s, - (void *)NULL, 0) == -1) { - free(buf); - return (PMU_INVALID); - } if (strcasestr(buf, "AuthenticAMD") != NULL || strcasestr(buf, "HygonGenuine") != NULL) mfr = PMU_AMD; @@ -110,7 +104,6 @@ pmu_events_mfr(void) mfr = PMU_INTEL; else mfr = PMU_INVALID; - free(buf); return (mfr); } @@ -169,17 +162,14 @@ pmu_events_map_get(const char *cpuid) { regex_t re; regmatch_t pmatch[1]; - size_t s; - char buf[64]; + char buf[PMC_CPUID_LEN]; + size_t s = sizeof(buf); int match; const struct pmu_events_map *pme; if (cpuid != NULL) { - memcpy(buf, cpuid, 64); + strlcpy(buf, cpuid, s); } else { - if (sysctlbyname("kern.hwpmc.cpuid", (void *)NULL, &s, - (void *)NULL, 0) == -1) - return (NULL); if (sysctlbyname("kern.hwpmc.cpuid", buf, &s, (void *)NULL, 0) == -1) return (NULL); Modified: stable/12/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/12/sys/dev/hwpmc/hwpmc_mod.c Tue Aug 4 11:13:13 2020 (r363830) +++ stable/12/sys/dev/hwpmc/hwpmc_mod.c Tue Aug 4 12:04:47 2020 (r363831) @@ -304,7 +304,7 @@ static int pmc_callchaindepth = PMC_CALLCHAIN_DEPTH; SYSCTL_INT(_kern_hwpmc, OID_AUTO, callchaindepth, CTLFLAG_RDTUN, &pmc_callchaindepth, 0, "depth of call chain records"); -char pmc_cpuid[64]; +char pmc_cpuid[PMC_CPUID_LEN]; SYSCTL_STRING(_kern_hwpmc, OID_AUTO, cpuid, CTLFLAG_RD, pmc_cpuid, 0, "cpu version string"); #ifdef HWPMC_DEBUG From owner-svn-src-all@freebsd.org Tue Aug 4 12:42:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39855372EE7; Tue, 4 Aug 2020 12:42:57 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLZD10knNz4JbG; Tue, 4 Aug 2020 12:42:57 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F08F825871; Tue, 4 Aug 2020 12:42:56 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074CguhT044970; Tue, 4 Aug 2020 12:42:56 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Cgtmn044962; Tue, 4 Aug 2020 12:42:55 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202008041242.074Cgtmn044962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Tue, 4 Aug 2020 12:42:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363832 - in stable/12/sys: compat/freebsd32 kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: in stable/12/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 363832 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 12:42:57 -0000 Author: kaktus Date: Tue Aug 4 12:42:55 2020 New Revision: 363832 URL: https://svnweb.freebsd.org/changeset/base/363832 Log: MFC kernel part of r351729 Add sysctlbyname system call The two syscalls that exists in head but not in stable/12 are marked as UNIMPL to keep the __sysctlbyname syscall number the same (570). Userland part to be commited in about a week time. Requested by: mjg Discussed with: kib Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c stable/12/sys/compat/freebsd32/syscalls.master stable/12/sys/kern/capabilities.conf stable/12/sys/kern/kern_sysctl.c stable/12/sys/kern/syscalls.master stable/12/sys/sys/param.h stable/12/sys/sys/syscall.mk stable/12/sys/sys/sysctl.h Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 4 12:04:47 2020 (r363831) +++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 4 12:42:55 2020 (r363832) @@ -2279,6 +2279,32 @@ freebsd32___sysctl(struct thread *td, struct freebsd32 } int +freebsd32___sysctlbyname(struct thread *td, + struct freebsd32___sysctlbyname_args *uap) +{ + size_t oldlen, rv; + int error; + uint32_t tmp; + + if (uap->oldlenp != NULL) { + error = fueword32(uap->oldlenp, &tmp); + oldlen = tmp; + } else { + error = oldlen = 0; + } + if (error != 0) + return (EFAULT); + error = kern___sysctlbyname(td, uap->name, uap->namelen, uap->old, + &oldlen, uap->new, uap->newlen, &rv, SCTL_MASK32, 1); + if (error != 0) + return (error); + if (uap->oldlenp != NULL) + error = suword32(uap->oldlenp, rv); + + return (error); +} + +int freebsd32_jail(struct thread *td, struct freebsd32_jail_args *uap) { uint32_t version; Modified: stable/12/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/12/sys/compat/freebsd32/syscalls.master Tue Aug 4 12:04:47 2020 (r363831) +++ stable/12/sys/compat/freebsd32/syscalls.master Tue Aug 4 12:42:55 2020 (r363832) @@ -1127,5 +1127,10 @@ const char *to); } 567 AUE_NULL NOPROTO { int fhreadlink( struct fhandle *fhp, char *buf, \ size_t bufsize); } +568 AUE_NULL UNIMPL funlinkat +569 AUE_NULL UNIMPL copy_file_range +570 AUE_SYSCTL STD { int freebsd32___sysctlbyname(const char *name, \ + size_t namelen, void *old, uint32_t *oldlenp, \ + void *new, size_t newlen); } ; vim: syntax=off Modified: stable/12/sys/kern/capabilities.conf ============================================================================== --- stable/12/sys/kern/capabilities.conf Tue Aug 4 12:04:47 2020 (r363831) +++ stable/12/sys/kern/capabilities.conf Tue Aug 4 12:42:55 2020 (r363832) @@ -63,6 +63,7 @@ __mac_set_proc ## proxying daemon in userspace. ## __sysctl +__sysctlbyname ## ## Allow umtx operations as these are scoped by address space. Modified: stable/12/sys/kern/kern_sysctl.c ============================================================================== --- stable/12/sys/kern/kern_sysctl.c Tue Aug 4 12:04:47 2020 (r363831) +++ stable/12/sys/kern/kern_sysctl.c Tue Aug 4 12:42:55 2020 (r363832) @@ -2102,6 +2102,68 @@ sys___sysctl(struct thread *td, struct sysctl_args *ua return (error); } +int +kern___sysctlbyname(struct thread *td, const char *oname, size_t namelen, + void *old, size_t *oldlenp, void *new, size_t newlen, size_t *retval, + int flags, bool inkernel) +{ + int oid[CTL_MAXNAME]; + char namebuf[16]; + char *name; + size_t oidlen; + int error; + + if (namelen > MAXPATHLEN || namelen == 0) + return (EINVAL); + name = namebuf; + if (namelen > sizeof(namebuf)) + name = malloc(namelen, M_SYSCTL, M_WAITOK); + error = copyin(oname, name, namelen); + if (error != 0) + goto out; + + oid[0] = CTL_SYSCTL; + oid[1] = CTL_SYSCTL_NAME2OID; + oidlen = sizeof(oid); + error = kernel_sysctl(td, oid, 2, oid, &oidlen, (void *)name, namelen, + retval, flags); + if (error != 0) + goto out; + error = userland_sysctl(td, oid, *retval / sizeof(int), old, oldlenp, + inkernel, new, newlen, retval, flags); + +out: + if (namelen > sizeof(namebuf)) + free(name, M_SYSCTL); + return (error); +} + +#ifndef _SYS_SYSPROTO_H_ +struct __sysctlbyname_args { + const char *name; + size_t namelen; + void *old; + size_t *oldlenp; + void *new; + size_t newlen; +}; +#endif +int +sys___sysctlbyname(struct thread *td, struct __sysctlbyname_args *uap) +{ + size_t rv; + int error; + + error = kern___sysctlbyname(td, uap->name, uap->namelen, uap->old, + uap->oldlenp, uap->new, uap->newlen, &rv, 0, 0); + if (error != 0) + return (error); + if (uap->oldlenp != NULL) + error = copyout(&rv, uap->oldlenp, sizeof(rv)); + + return (error); +} + /* * This is used from various compatibility syscalls too. That's why name * must be in kernel space. Modified: stable/12/sys/kern/syscalls.master ============================================================================== --- stable/12/sys/kern/syscalls.master Tue Aug 4 12:04:47 2020 (r363831) +++ stable/12/sys/kern/syscalls.master Tue Aug 4 12:42:55 2020 (r363832) @@ -1368,6 +1368,19 @@ size_t bufsize \ ); \ } +568 AUE_NULL UNIMPL funlinkat +569 AUE_NULL UNIMPL copy_file_range +570 AUE_SYSCTL STD { \ + int __sysctlbyname( \ + _In_reads_(namelen) const char *name, \ + size_t namelen, \ + _Out_writes_bytes_opt_(*oldlenp) void *old, \ + _Inout_opt_ size_t *oldlenp, \ + _In_reads_bytes_opt_(newlen) void *new, \ + size_t newlen \ + ); \ + } + ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Tue Aug 4 12:04:47 2020 (r363831) +++ stable/12/sys/sys/param.h Tue Aug 4 12:42:55 2020 (r363832) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201521 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201522 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: stable/12/sys/sys/syscall.mk ============================================================================== --- stable/12/sys/sys/syscall.mk Tue Aug 4 12:04:47 2020 (r363831) +++ stable/12/sys/sys/syscall.mk Tue Aug 4 12:42:55 2020 (r363832) @@ -408,4 +408,5 @@ MIASM = \ getfhat.o \ fhlink.o \ fhlinkat.o \ - fhreadlink.o + fhreadlink.o \ + __sysctlbyname.o Modified: stable/12/sys/sys/sysctl.h ============================================================================== --- stable/12/sys/sys/sysctl.h Tue Aug 4 12:04:47 2020 (r363831) +++ stable/12/sys/sys/sysctl.h Tue Aug 4 12:42:55 2020 (r363832) @@ -1102,6 +1102,9 @@ int sysctl_find_oid(int *name, u_int namelen, struct s void sysctl_wlock(void); void sysctl_wunlock(void); int sysctl_wire_old_buffer(struct sysctl_req *req, size_t len); +int kern___sysctlbyname(struct thread *td, const char *name, + size_t namelen, void *old, size_t *oldlenp, void *new, + size_t newlen, size_t *retval, int flags, bool inkernel); struct sbuf; struct sbuf *sbuf_new_for_sysctl(struct sbuf *, char *, int, From owner-svn-src-all@freebsd.org Tue Aug 4 12:44:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86DAC372EF8; Tue, 4 Aug 2020 12:44:50 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLZGB30Rmz4K49; Tue, 4 Aug 2020 12:44:50 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45D34259C0; Tue, 4 Aug 2020 12:44:50 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074Cio2U045164; Tue, 4 Aug 2020 12:44:50 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074CimgQ045155; Tue, 4 Aug 2020 12:44:48 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202008041244.074CimgQ045155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Tue, 4 Aug 2020 12:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363833 - in stable/12/sys: compat/freebsd32 kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: in stable/12/sys: compat/freebsd32 kern sys X-SVN-Commit-Revision: 363833 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 12:44:50 -0000 Author: kaktus Date: Tue Aug 4 12:44:47 2020 New Revision: 363833 URL: https://svnweb.freebsd.org/changeset/base/363833 Log: regen Modified: stable/12/sys/compat/freebsd32/freebsd32_proto.h stable/12/sys/compat/freebsd32/freebsd32_syscall.h stable/12/sys/compat/freebsd32/freebsd32_syscalls.c stable/12/sys/compat/freebsd32/freebsd32_sysent.c stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c stable/12/sys/kern/init_sysent.c stable/12/sys/kern/syscalls.c stable/12/sys/kern/systrace_args.c stable/12/sys/sys/syscall.h stable/12/sys/sys/sysproto.h Modified: stable/12/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_proto.h Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/compat/freebsd32/freebsd32_proto.h Tue Aug 4 12:44:47 2020 (r363833) @@ -728,6 +728,14 @@ struct freebsd32_cpuset_setdomain_args { char mask_l_[PADL_(domainset_t *)]; domainset_t * mask; char mask_r_[PADR_(domainset_t *)]; char policy_l_[PADL_(int)]; int policy; char policy_r_[PADR_(int)]; }; +struct freebsd32___sysctlbyname_args { + char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; + char namelen_l_[PADL_(size_t)]; size_t namelen; char namelen_r_[PADR_(size_t)]; + char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; + char oldlenp_l_[PADL_(uint32_t *)]; uint32_t * oldlenp; char oldlenp_r_[PADR_(uint32_t *)]; + char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; + char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; +}; #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) #define PAD64_REQUIRED #endif @@ -865,6 +873,7 @@ int freebsd32_mknodat(struct thread *, struct freebsd3 int freebsd32_kevent(struct thread *, struct freebsd32_kevent_args *); int freebsd32_cpuset_getdomain(struct thread *, struct freebsd32_cpuset_getdomain_args *); int freebsd32_cpuset_setdomain(struct thread *, struct freebsd32_cpuset_setdomain_args *); +int freebsd32___sysctlbyname(struct thread *, struct freebsd32___sysctlbyname_args *); #ifdef COMPAT_43 @@ -1419,6 +1428,7 @@ int freebsd11_freebsd32_fstatat(struct thread *, struc #define FREEBSD32_SYS_AUE_freebsd32_kevent AUE_KEVENT #define FREEBSD32_SYS_AUE_freebsd32_cpuset_getdomain AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_cpuset_setdomain AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32___sysctlbyname AUE_SYSCTL #undef PAD_ #undef PADL_ Modified: stable/12/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_syscall.h Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/compat/freebsd32/freebsd32_syscall.h Tue Aug 4 12:44:47 2020 (r363833) @@ -494,4 +494,5 @@ #define FREEBSD32_SYS_fhlink 565 #define FREEBSD32_SYS_fhlinkat 566 #define FREEBSD32_SYS_fhreadlink 567 -#define FREEBSD32_SYS_MAXSYSCALL 568 +#define FREEBSD32_SYS_freebsd32___sysctlbyname 570 +#define FREEBSD32_SYS_MAXSYSCALL 571 Modified: stable/12/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_syscalls.c Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/compat/freebsd32/freebsd32_syscalls.c Tue Aug 4 12:44:47 2020 (r363833) @@ -604,4 +604,7 @@ const char *freebsd32_syscallnames[] = { "fhlink", /* 565 = fhlink */ "fhlinkat", /* 566 = fhlinkat */ "fhreadlink", /* 567 = fhreadlink */ + "#568", /* 568 = funlinkat */ + "#569", /* 569 = copy_file_range */ + "freebsd32___sysctlbyname", /* 570 = freebsd32___sysctlbyname */ }; Modified: stable/12/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_sysent.c Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/compat/freebsd32/freebsd32_sysent.c Tue Aug 4 12:44:47 2020 (r363833) @@ -651,4 +651,7 @@ struct sysent freebsd32_sysent[] = { { AS(fhlink_args), (sy_call_t *)sys_fhlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 565 = fhlink */ { AS(fhlinkat_args), (sy_call_t *)sys_fhlinkat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 566 = fhlinkat */ { AS(fhreadlink_args), (sy_call_t *)sys_fhreadlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 567 = fhreadlink */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 568 = funlinkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 569 = copy_file_range */ + { AS(freebsd32___sysctlbyname_args), (sy_call_t *)freebsd32___sysctlbyname, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 570 = freebsd32___sysctlbyname */ }; Modified: stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c Tue Aug 4 12:44:47 2020 (r363833) @@ -3310,6 +3310,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } + /* freebsd32___sysctlbyname */ + case 570: { + struct freebsd32___sysctlbyname_args *p = params; + uarg[0] = (intptr_t) p->name; /* const char * */ + uarg[1] = p->namelen; /* size_t */ + uarg[2] = (intptr_t) p->old; /* void * */ + uarg[3] = (intptr_t) p->oldlenp; /* uint32_t * */ + uarg[4] = (intptr_t) p->new; /* void * */ + uarg[5] = p->newlen; /* size_t */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8905,6 +8917,31 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* freebsd32___sysctlbyname */ + case 570: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "size_t"; + break; + case 2: + p = "userland void *"; + break; + case 3: + p = "userland uint32_t *"; + break; + case 4: + p = "userland void *"; + break; + case 5: + p = "size_t"; + break; + default: + break; + }; + break; default: break; }; @@ -10771,6 +10808,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* fhreadlink */ case 567: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* freebsd32___sysctlbyname */ + case 570: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: stable/12/sys/kern/init_sysent.c ============================================================================== --- stable/12/sys/kern/init_sysent.c Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/kern/init_sysent.c Tue Aug 4 12:44:47 2020 (r363833) @@ -617,4 +617,7 @@ struct sysent sysent[] = { { AS(fhlink_args), (sy_call_t *)sys_fhlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 565 = fhlink */ { AS(fhlinkat_args), (sy_call_t *)sys_fhlinkat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 566 = fhlinkat */ { AS(fhreadlink_args), (sy_call_t *)sys_fhreadlink, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 567 = fhreadlink */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 568 = funlinkat */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 569 = copy_file_range */ + { AS(__sysctlbyname_args), (sy_call_t *)sys___sysctlbyname, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 570 = __sysctlbyname */ }; Modified: stable/12/sys/kern/syscalls.c ============================================================================== --- stable/12/sys/kern/syscalls.c Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/kern/syscalls.c Tue Aug 4 12:44:47 2020 (r363833) @@ -574,4 +574,7 @@ const char *syscallnames[] = { "fhlink", /* 565 = fhlink */ "fhlinkat", /* 566 = fhlinkat */ "fhreadlink", /* 567 = fhreadlink */ + "#568", /* 568 = funlinkat */ + "#569", /* 569 = copy_file_range */ + "__sysctlbyname", /* 570 = __sysctlbyname */ }; Modified: stable/12/sys/kern/systrace_args.c ============================================================================== --- stable/12/sys/kern/systrace_args.c Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/kern/systrace_args.c Tue Aug 4 12:44:47 2020 (r363833) @@ -3302,6 +3302,18 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 3; break; } + /* __sysctlbyname */ + case 570: { + struct __sysctlbyname_args *p = params; + uarg[0] = (intptr_t) p->name; /* const char * */ + uarg[1] = p->namelen; /* size_t */ + uarg[2] = (intptr_t) p->old; /* void * */ + uarg[3] = (intptr_t) p->oldlenp; /* size_t * */ + uarg[4] = (intptr_t) p->new; /* void * */ + uarg[5] = p->newlen; /* size_t */ + *n_args = 6; + break; + } default: *n_args = 0; break; @@ -8810,6 +8822,31 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* __sysctlbyname */ + case 570: + switch(ndx) { + case 0: + p = "userland const char *"; + break; + case 1: + p = "size_t"; + break; + case 2: + p = "userland void *"; + break; + case 3: + p = "userland size_t *"; + break; + case 4: + p = "userland void *"; + break; + case 5: + p = "size_t"; + break; + default: + break; + }; + break; default: break; }; @@ -10703,6 +10740,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* fhreadlink */ case 567: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* __sysctlbyname */ + case 570: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: stable/12/sys/sys/syscall.h ============================================================================== --- stable/12/sys/sys/syscall.h Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/sys/syscall.h Tue Aug 4 12:44:47 2020 (r363833) @@ -503,4 +503,5 @@ #define SYS_fhlink 565 #define SYS_fhlinkat 566 #define SYS_fhreadlink 567 -#define SYS_MAXSYSCALL 568 +#define SYS___sysctlbyname 570 +#define SYS_MAXSYSCALL 571 Modified: stable/12/sys/sys/sysproto.h ============================================================================== --- stable/12/sys/sys/sysproto.h Tue Aug 4 12:42:55 2020 (r363832) +++ stable/12/sys/sys/sysproto.h Tue Aug 4 12:44:47 2020 (r363833) @@ -1790,6 +1790,14 @@ struct fhreadlink_args { char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)]; char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)]; }; +struct __sysctlbyname_args { + char name_l_[PADL_(const char *)]; const char * name; char name_r_[PADR_(const char *)]; + char namelen_l_[PADL_(size_t)]; size_t namelen; char namelen_r_[PADR_(size_t)]; + char old_l_[PADL_(void *)]; void * old; char old_r_[PADR_(void *)]; + char oldlenp_l_[PADL_(size_t *)]; size_t * oldlenp; char oldlenp_r_[PADR_(size_t *)]; + char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; + char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2174,6 +2182,7 @@ int sys_getfhat(struct thread *, struct getfhat_args * int sys_fhlink(struct thread *, struct fhlink_args *); int sys_fhlinkat(struct thread *, struct fhlinkat_args *); int sys_fhreadlink(struct thread *, struct fhreadlink_args *); +int sys___sysctlbyname(struct thread *, struct __sysctlbyname_args *); #ifdef COMPAT_43 @@ -3075,6 +3084,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_fhlink AUE_NULL #define SYS_AUE_fhlinkat AUE_NULL #define SYS_AUE_fhreadlink AUE_NULL +#define SYS_AUE___sysctlbyname AUE_SYSCTL #undef PAD_ #undef PADL_ From owner-svn-src-all@freebsd.org Tue Aug 4 13:58:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5D7A37467C; Tue, 4 Aug 2020 13:58:40 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLbvN4kWyz4N2h; Tue, 4 Aug 2020 13:58: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 857AF26685; Tue, 4 Aug 2020 13:58:40 +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 074DweAJ088348; Tue, 4 Aug 2020 13:58:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074DwbEv088331; Tue, 4 Aug 2020 13:58:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008041358.074DwbEv088331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Aug 2020 13:58:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363834 - in head: . share/man/man9 sys/dev/hwpmc sys/dev/ioat sys/dev/iommu sys/dev/nvme sys/kern sys/net sys/sys sys/vm sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: . share/man/man9 sys/dev/hwpmc sys/dev/ioat sys/dev/iommu sys/dev/nvme sys/kern sys/net sys/sys sys/vm sys/x86/x86 X-SVN-Commit-Revision: 363834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 13:58:40 -0000 Author: markj Date: Tue Aug 4 13:58:36 2020 New Revision: 363834 URL: https://svnweb.freebsd.org/changeset/base/363834 Log: Remove free_domain() and uma_zfree_domain(). These functions were introduced before UMA started ensuring that freed memory gets placed in domain-local caches. They no longer serve any purpose since UMA now provides their functionality by default. Remove them to simplyify the kernel memory allocator interfaces a bit. Reviewed by: cem, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25937 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/malloc.9 head/share/man/man9/zone.9 head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/ioat/ioat.c head/sys/dev/iommu/busdma_iommu.c head/sys/dev/nvme/nvme_qpair.c head/sys/kern/kern_malloc.c head/sys/kern/subr_bus.c head/sys/net/if.c head/sys/sys/malloc.h head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/x86/x86/busdma_bounce.c Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Aug 4 12:44:47 2020 (r363833) +++ head/ObsoleteFiles.inc Tue Aug 4 13:58:36 2020 (r363834) @@ -36,6 +36,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20200803: remove free_domain(9) and uma_zfree_domain(9) +OLD_FILES+=usr/share/man/man9/free_domain.9.gz +OLD_FILES+=usr/share/man/man9/uma_zfree_domain.9.gz + # 20200729: remove long expired serial drivers OLD_FILES+=usr/share/man/man4/cy.4.gz OLD_FILES+=usr/share/man/man4/rc.4.gz Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Aug 4 12:44:47 2020 (r363833) +++ head/share/man/man9/Makefile Tue Aug 4 13:58:36 2020 (r363834) @@ -1378,7 +1378,6 @@ MLINKS+=make_dev.9 destroy_dev.9 \ make_dev.9 make_dev_s.9 MLINKS+=malloc.9 free.9 \ malloc.9 malloc_domainset.9 \ - malloc.9 free_domain.9 \ malloc.9 mallocarray.9 \ malloc.9 MALLOC_DECLARE.9 \ malloc.9 MALLOC_DEFINE.9 \ @@ -2343,7 +2342,6 @@ MLINKS+=zone.9 uma.9 \ zone.9 uma_zdestroy.9 \ zone.9 uma_zfree.9 \ zone.9 uma_zfree_arg.9 \ - zone.9 uma_zfree_domain.9 \ zone.9 uma_zfree_pcpu.9 \ zone.9 uma_zfree_pcpu_arg.9 \ zone.9 uma_zone_get_cur.9 \ Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Tue Aug 4 12:44:47 2020 (r363833) +++ head/share/man/man9/malloc.9 Tue Aug 4 13:58:36 2020 (r363834) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd October 30, 2018 +.Dd August 3, 2020 .Dt MALLOC 9 .Os .Sh NAME @@ -64,8 +64,6 @@ .In sys/domainset.h .Ft void * .Fn malloc_domainset "size_t size" "struct malloc_type *type" "struct domainset *ds" "int flags" -.Ft void -.Fn free_domain "void *addr" "struct malloc_type *type" .Sh DESCRIPTION The .Fn malloc @@ -81,8 +79,6 @@ domain using the specified domain selection policy. See .Xr domainset 9 for some example policies. -Memory allocated with this function should be returned with -.Fn free_domain . .Pp The .Fn mallocarray Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Tue Aug 4 12:44:47 2020 (r363833) +++ head/share/man/man9/zone.9 Tue Aug 4 13:58:36 2020 (r363834) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 4, 2020 +.Dd August 3, 2020 .Dt UMA 9 .Os .Sh NAME @@ -86,8 +86,6 @@ typedef void (*uma_free)(void *item, vm_size_t size, u .Ft void .Fn uma_zfree_arg "uma_zone_t zone" "void *item" "void *arg" .Ft void -.Fn uma_zfree_domain "uma_zone_t zone" "void *item" "void *arg" -.Ft void .Fn uma_zfree_pcpu "uma_zone_t zone" "void *item" .Ft void .Fn uma_zfree_pcpu_arg "uma_zone_t zone" "void *item" "void *arg" @@ -394,11 +392,6 @@ function allows callers to specify a fixed domain to allocate from. This uses a guaranteed but slow path in the allocator which reduces concurrency. -The -.Fn uma_zfree_domain -function should be used to return memory allocated in this fashion. -This function infers the domain from the pointer and does not require it as an -argument. .Pp The .Fn uma_zone_prealloc Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Aug 4 13:58:36 2020 (r363834) @@ -5893,13 +5893,13 @@ pmc_cleanup(void) KASSERT(pmc_pcpu[cpu]->pc_sb[PMC_UR] != NULL, ("[pmc,%d] Null userret cpu sample buffer cpu=%d", __LINE__, cpu)); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_HR]->ps_callchains, M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_HR], M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_SR]->ps_callchains, M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_SR], M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_UR]->ps_callchains, M_PMC); - free_domain(pmc_pcpu[cpu]->pc_sb[PMC_UR], M_PMC); - free_domain(pmc_pcpu[cpu], M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_HR]->ps_callchains, M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_HR], M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_SR]->ps_callchains, M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_SR], M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_UR]->ps_callchains, M_PMC); + free(pmc_pcpu[cpu]->pc_sb[PMC_UR], M_PMC); + free(pmc_pcpu[cpu], M_PMC); } free(pmc_pcpu, M_PMC); Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/dev/ioat/ioat.c Tue Aug 4 13:58:36 2020 (r363834) @@ -1578,7 +1578,7 @@ ioat_free_ring(struct ioat_softc *ioat, uint32_t size, struct ioat_descriptor *ring) { - free_domain(ring, M_IOAT); + free(ring, M_IOAT); } static struct ioat_descriptor * Modified: head/sys/dev/iommu/busdma_iommu.c ============================================================================== --- head/sys/dev/iommu/busdma_iommu.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/dev/iommu/busdma_iommu.c Tue Aug 4 13:58:36 2020 (r363834) @@ -410,7 +410,7 @@ iommu_bus_dma_tag_destroy(bus_dma_tag_t dmat1) 1) { if (dmat == dmat->ctx->tag) iommu_free_ctx(dmat->ctx); - free_domain(dmat->segments, M_IOMMU_DMAMAP); + free(dmat->segments, M_IOMMU_DMAMAP); free(dmat, M_DEVBUF); dmat = parent; } else @@ -447,7 +447,7 @@ iommu_bus_dmamap_create(bus_dma_tag_t dmat, int flags, tag->common.nsegments, M_IOMMU_DMAMAP, DOMAINSET_PREF(tag->common.domain), M_NOWAIT); if (tag->segments == NULL) { - free_domain(map, M_IOMMU_DMAMAP); + free(map, M_IOMMU_DMAMAP); *mapp = NULL; return (ENOMEM); } @@ -479,7 +479,7 @@ iommu_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmama return (EBUSY); } IOMMU_DOMAIN_UNLOCK(domain); - free_domain(map, M_IOMMU_DMAMAP); + free(map, M_IOMMU_DMAMAP); } tag->map_count--; return (0); @@ -537,7 +537,7 @@ iommu_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, map = (struct bus_dmamap_iommu *)map1; if ((map->flags & BUS_DMAMAP_IOMMU_MALLOC) != 0) { - free_domain(vaddr, M_DEVBUF); + free(vaddr, M_DEVBUF); map->flags &= ~BUS_DMAMAP_IOMMU_MALLOC; } else { KASSERT((map->flags & BUS_DMAMAP_IOMMU_KMEM_ALLOC) != 0, Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/dev/nvme/nvme_qpair.c Tue Aug 4 13:58:36 2020 (r363834) @@ -819,7 +819,7 @@ nvme_qpair_destroy(struct nvme_qpair *qpair) } if (qpair->act_tr) { - free_domain(qpair->act_tr, M_NVME); + free(qpair->act_tr, M_NVME); qpair->act_tr = NULL; } @@ -828,7 +828,7 @@ nvme_qpair_destroy(struct nvme_qpair *qpair) TAILQ_REMOVE(&qpair->free_tr, tr, tailq); bus_dmamap_destroy(qpair->dma_tag_payload, tr->payload_dma_map); - free_domain(tr, M_NVME); + free(tr, M_NVME); } if (qpair->cmd != NULL) { Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/kern/kern_malloc.c Tue Aug 4 13:58:36 2020 (r363834) @@ -862,40 +862,6 @@ zfree(void *addr, struct malloc_type *mtp) malloc_type_freed(mtp, size); } -void -free_domain(void *addr, struct malloc_type *mtp) -{ - uma_zone_t zone; - uma_slab_t slab; - u_long size; - -#ifdef MALLOC_DEBUG - if (free_dbg(&addr, mtp) != 0) - return; -#endif - - /* free(NULL, ...) does nothing */ - if (addr == NULL) - return; - - vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); - if (slab == NULL) - panic("free_domain: address %p(%p) has not been allocated.\n", - addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); - - if (__predict_true(!malloc_large_slab(slab))) { - size = zone->uz_size; -#ifdef INVARIANTS - free_save_type(addr, mtp, size); -#endif - uma_zfree_domain(zone, addr, slab); - } else { - size = malloc_large_size(slab); - free_large(addr, size); - } - malloc_type_freed(mtp, size); -} - /* * realloc: change the size of a memory block */ Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/kern/subr_bus.c Tue Aug 4 13:58:36 2020 (r363834) @@ -2542,7 +2542,7 @@ void device_set_softc(device_t dev, void *softc) { if (dev->softc && !(dev->flags & DF_EXTERNALSOFTC)) - free_domain(dev->softc, M_BUS_SC); + free(dev->softc, M_BUS_SC); dev->softc = softc; if (dev->softc) dev->flags |= DF_EXTERNALSOFTC; @@ -2559,7 +2559,7 @@ device_set_softc(device_t dev, void *softc) void device_free_softc(void *softc) { - free_domain(softc, M_BUS_SC); + free(softc, M_BUS_SC); } /** @@ -2826,7 +2826,7 @@ device_set_driver(device_t dev, driver_t *driver) return (0); if (dev->softc && !(dev->flags & DF_EXTERNALSOFTC)) { - free_domain(dev->softc, M_BUS_SC); + free(dev->softc, M_BUS_SC); dev->softc = NULL; } device_set_desc(dev, NULL); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/net/if.c Tue Aug 4 13:58:36 2020 (r363834) @@ -629,10 +629,7 @@ if_free_internal(struct ifnet *ifp) free(ifp->if_description, M_IFDESCR); free(ifp->if_hw_addr, M_IFADDR); - if (ifp->if_numa_domain == IF_NODOM) - free(ifp, M_IFNET); - else - free_domain(ifp, M_IFNET); + free(ifp, M_IFNET); } static void Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/sys/malloc.h Tue Aug 4 13:58:36 2020 (r363834) @@ -180,7 +180,6 @@ void *contigmalloc_domainset(unsigned long size, struc __malloc_like __result_use_check __alloc_size(1) __alloc_align(7); void free(void *addr, struct malloc_type *type); void zfree(void *addr, struct malloc_type *type); -void free_domain(void *addr, struct malloc_type *type); void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like __result_use_check __alloc_size(1); /* Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/vm/uma.h Tue Aug 4 13:58:36 2020 (r363834) @@ -387,16 +387,6 @@ void uma_zfree_pcpu_arg(uma_zone_t zone, void *item, v void uma_zfree_smr(uma_zone_t zone, void *item); /* - * Frees an item back to the specified zone's domain specific pool. - * - * Arguments: - * zone The zone the item was originally allocated out of. - * item The memory to be freed. - * arg Argument passed to the destructor - */ -void uma_zfree_domain(uma_zone_t zone, void *item, void *arg); - -/* * Frees an item back to a zone without supplying an argument * * This is just a wrapper for uma_zfree_arg for convenience. Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/vm/uma_core.c Tue Aug 4 13:58:36 2020 (r363834) @@ -4338,24 +4338,6 @@ cache_free(uma_zone_t zone, uma_cache_t cache, void *u return (true); } -void -uma_zfree_domain(uma_zone_t zone, void *item, void *udata) -{ - - /* Enable entropy collection for RANDOM_ENABLE_UMA kernel option */ - random_harvest_fast_uma(&zone, sizeof(zone), RANDOM_UMA); - - CTR2(KTR_UMA, "uma_zfree_domain zone %s(%p)", zone->uz_name, zone); - - KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), - ("uma_zfree_domain: called with spinlock or critical section held")); - - /* uma_zfree(..., NULL) does nothing, to match free(9). */ - if (item == NULL) - return; - zone_free_item(zone, item, udata, SKIP_NONE); -} - static void slab_free_item(uma_zone_t zone, uma_slab_t slab, void *item) { Modified: head/sys/x86/x86/busdma_bounce.c ============================================================================== --- head/sys/x86/x86/busdma_bounce.c Tue Aug 4 12:44:47 2020 (r363833) +++ head/sys/x86/x86/busdma_bounce.c Tue Aug 4 13:58:36 2020 (r363834) @@ -271,7 +271,7 @@ bounce_bus_dma_tag_destroy(bus_dma_tag_t dmat) atomic_subtract_int(&dmat->common.ref_count, 1); if (dmat->common.ref_count == 0) { if (dmat->segments != NULL) - free_domain(dmat->segments, M_DEVBUF); + free(dmat->segments, M_DEVBUF); free(dmat, M_DEVBUF); /* * Last reference count, so @@ -387,7 +387,7 @@ bounce_bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmam } if (dmat->bounce_zone) dmat->bounce_zone->map_count--; - free_domain(map, M_DEVBUF); + free(map, M_DEVBUF); } dmat->map_count--; CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); @@ -504,7 +504,7 @@ bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr if (map != NULL) panic("bus_dmamem_free: Invalid map freed\n"); if ((dmat->bounce_flags & BUS_DMA_KMEM_ALLOC) == 0) - free_domain(vaddr, M_DEVBUF); + free(vaddr, M_DEVBUF); else kmem_free((vm_offset_t)vaddr, dmat->common.maxsize); CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, @@ -1188,7 +1188,7 @@ alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages) M_DEVBUF, DOMAINSET_PREF(dmat->common.domain), M_NOWAIT, 0ul, bz->lowaddr, PAGE_SIZE, 0); if (bpage->vaddr == 0) { - free_domain(bpage, M_DEVBUF); + free(bpage, M_DEVBUF); break; } bpage->busaddr = pmap_kextract(bpage->vaddr); From owner-svn-src-all@freebsd.org Tue Aug 4 14:42:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BEE2375EF0; Tue, 4 Aug 2020 14:42:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLct72K6fz4QV6; Tue, 4 Aug 2020 14:42:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32DE726CFD; Tue, 4 Aug 2020 14:42:39 +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 074EgdjO018829; Tue, 4 Aug 2020 14:42:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074EgdsH018828; Tue, 4 Aug 2020 14:42:39 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041442.074EgdsH018828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363835 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 14:42:39 -0000 Author: manu Date: Tue Aug 4 14:42:38 2020 New Revision: 363835 URL: https://svnweb.freebsd.org/changeset/base/363835 Log: linuxkpi: Add linux/sizes.h This file contain some defines for common sizes. Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25941 Added: head/sys/compat/linuxkpi/common/include/linux/sizes.h (contents, props changed) Added: head/sys/compat/linuxkpi/common/include/linux/sizes.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/sizes.h Tue Aug 4 14:42:38 2020 (r363835) @@ -0,0 +1,51 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * + * This software was developed by Emmanuel Vadot 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 __LINUX_SIZES_H__ +#define __LINUX_SIZES_H__ + +#define SZ_1K (1024 * 1) +#define SZ_4K (1024 * 4) +#define SZ_8K (1024 * 8) +#define SZ_16K (1024 * 16) +#define SZ_32K (1024 * 32) +#define SZ_64K (1024 * 64) +#define SZ_128K (1024 * 128) +#define SZ_256K (1024 * 256) +#define SZ_512K (1024 * 512) + +#define SZ_1M (1024 * 1024 * 1) +#define SZ_2M (1024 * 1024 * 2) +#define SZ_8M (1024 * 1024 * 8) +#define SZ_16M (1024 * 1024 * 16) +#define SZ_32M (1024 * 1024 * 32) +#define SZ_64M (1024 * 1024 * 64) + +#endif From owner-svn-src-all@freebsd.org Tue Aug 4 14:44:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC946375D7C; Tue, 4 Aug 2020 14:44:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLcw04BmNz4Qjr; Tue, 4 Aug 2020 14:44:16 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 736DC26EA6; Tue, 4 Aug 2020 14:44:16 +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 074EiGWW018964; Tue, 4 Aug 2020 14:44:16 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074EiGKo018963; Tue, 4 Aug 2020 14:44:16 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041444.074EiGKo018963@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:44:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363836 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363836 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 14:44:16 -0000 Author: manu Date: Tue Aug 4 14:44:16 2020 New Revision: 363836 URL: https://svnweb.freebsd.org/changeset/base/363836 Log: linuxkpi: Add kref_put_lock Same as kref_put but in addition to calling the rel function it will acquire the lock first. Sponsored by: The FreeBSD Foundation Reviewed by: hselasky, emaste Differential Revision: https://reviews.freebsd.org/D25942 Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kref.h Tue Aug 4 14:42:38 2020 (r363835) +++ head/sys/compat/linuxkpi/common/include/linux/kref.h Tue Aug 4 14:44:16 2020 (r363836) @@ -38,6 +38,7 @@ #include #include #include +#include #include @@ -76,6 +77,20 @@ kref_put(struct kref *kref, void (*rel)(struct kref *k } return 0; } + +static inline int +kref_put_lock(struct kref *kref, void (*rel)(struct kref *kref), + spinlock_t *lock) +{ + + if (refcount_release(&kref->refcount.counter)) { + spin_lock(lock); + rel(kref); + return (1); + } + return (0); +} + static inline int kref_sub(struct kref *kref, unsigned int count, From owner-svn-src-all@freebsd.org Tue Aug 4 14:45:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EFA3B37627C; Tue, 4 Aug 2020 14:45:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLcxG63FBz4QsG; Tue, 4 Aug 2020 14:45:22 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B371C26BC7; Tue, 4 Aug 2020 14:45:22 +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 074EjM44019077; Tue, 4 Aug 2020 14:45:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074EjMqE019076; Tue, 4 Aug 2020 14:45:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041445.074EjMqE019076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363837 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363837 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 14:45:23 -0000 Author: manu Date: Tue Aug 4 14:45:22 2020 New Revision: 363837 URL: https://svnweb.freebsd.org/changeset/base/363837 Log: linuxkpi: Add nested variant of mutex_lock_interruptible We don't do anything with the _nesteds variant so just call mutex_lock_interruptible Sponsoredby: The FreeBSD Foundation Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25944 Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h Modified: head/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mutex.h Tue Aug 4 14:44:16 2020 (r363836) +++ head/sys/compat/linuxkpi/common/include/linux/mutex.h Tue Aug 4 14:45:22 2020 (r363837) @@ -67,6 +67,8 @@ typedef struct mutex { linux_mutex_lock_interruptible(_m); \ }) +#define mutex_lock_interruptible_nested(m, c) mutex_lock_interruptible(m) + /* * Reuse the interruptable method since the SX * lock handles both signals and interrupts: From owner-svn-src-all@freebsd.org Tue Aug 4 14:48:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB9D4376508; Tue, 4 Aug 2020 14:48:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLd1B46MVz4R8m; Tue, 4 Aug 2020 14:48:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7136C2701E; Tue, 4 Aug 2020 14:48:46 +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 074EmkhP019267; Tue, 4 Aug 2020 14:48:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Emjlm019264; Tue, 4 Aug 2020 14:48:45 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041448.074Emjlm019264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363838 - in head/share/examples: ipfilter smbfs smbfs/print X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/share/examples: ipfilter smbfs smbfs/print X-SVN-Commit-Revision: 363838 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 14:48:46 -0000 Author: manu Date: Tue Aug 4 14:48:45 2020 New Revision: 363838 URL: https://svnweb.freebsd.org/changeset/base/363838 Log: pkgbase: Remove the last users of the FreeBSD-example package Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D24176 Modified: head/share/examples/ipfilter/Makefile head/share/examples/smbfs/Makefile head/share/examples/smbfs/print/Makefile Modified: head/share/examples/ipfilter/Makefile ============================================================================== --- head/share/examples/ipfilter/Makefile Tue Aug 4 14:45:22 2020 (r363837) +++ head/share/examples/ipfilter/Makefile Tue Aug 4 14:48:45 2020 (r363838) @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=examples +PACKAGE=ipf FILES= README # dist sample files Modified: head/share/examples/smbfs/Makefile ============================================================================== --- head/share/examples/smbfs/Makefile Tue Aug 4 14:45:22 2020 (r363837) +++ head/share/examples/smbfs/Makefile Tue Aug 4 14:48:45 2020 (r363838) @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=examples +PACKAGE=utilities FILESDIR= ${SHAREDIR}/examples/smbfs FILES= dot.nsmbrc Modified: head/share/examples/smbfs/print/Makefile ============================================================================== --- head/share/examples/smbfs/print/Makefile Tue Aug 4 14:45:22 2020 (r363837) +++ head/share/examples/smbfs/print/Makefile Tue Aug 4 14:48:45 2020 (r363838) @@ -1,6 +1,6 @@ # $FreeBSD$ -PACKAGE=examples +PACKAGE=utilities FILESDIR= ${SHAREDIR}/examples/smbfs/print FILES= lj6l ljspool printcap.sample tolj From owner-svn-src-all@freebsd.org Tue Aug 4 14:53:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D2803762E2; Tue, 4 Aug 2020 14:53:42 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLd6s71mQz4RR2; Tue, 4 Aug 2020 14:53:41 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D43A72723F; Tue, 4 Aug 2020 14:53:41 +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 074Erfrg025054; Tue, 4 Aug 2020 14:53:41 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Erfwx025053; Tue, 4 Aug 2020 14:53:41 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041453.074Erfwx025053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 14:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363839 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363839 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 14:53:42 -0000 Author: manu Date: Tue Aug 4 14:53:41 2020 New Revision: 363839 URL: https://svnweb.freebsd.org/changeset/base/363839 Log: Re-apply r363564. We now have linux/sizes.h in the tree. Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Tue Aug 4 14:48:45 2020 (r363838) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Tue Aug 4 14:53:41 2020 (r363839) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include From owner-svn-src-all@freebsd.org Tue Aug 4 14:59:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C21A1376736; Tue, 4 Aug 2020 14:59:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLdFr4jVXz4SKT; Tue, 4 Aug 2020 14:59:44 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85DF427047; Tue, 4 Aug 2020 14:59:44 +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 074ExigZ025388; Tue, 4 Aug 2020 14:59:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074ExhOY025384; Tue, 4 Aug 2020 14:59:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008041459.074ExhOY025384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Aug 2020 14:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363840 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 363840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 14:59:44 -0000 Author: markj Date: Tue Aug 4 14:59:43 2020 New Revision: 363840 URL: https://svnweb.freebsd.org/changeset/base/363840 Log: Remove most lingering references to the page lock in comments. Finish updating comments to reflect new locking protocols introduced over the past year. In particular, vm_page_lock is now effectively unused. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25868 Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h head/sys/vm/vm_pageout.c head/sys/vm/vnode_pager.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Aug 4 14:53:41 2020 (r363839) +++ head/sys/vm/vm_page.c Tue Aug 4 14:59:43 2020 (r363840) @@ -2675,7 +2675,7 @@ retry: * ascending order.) (2) It is not reserved, and it is * transitioning from free to allocated. (Conversely, * the transition from allocated to free for managed - * pages is blocked by the page lock.) (3) It is + * pages is blocked by the page busy lock.) (3) It is * allocated but not contained by an object and not * wired, e.g., allocated by Xen's balloon driver. */ @@ -3622,8 +3622,6 @@ vm_page_pqbatch_drain(void) * Request removal of the given page from its current page * queue. Physical removal from the queue may be deferred * indefinitely. - * - * The page must be locked. */ void vm_page_dequeue_deferred(vm_page_t m) @@ -3804,8 +3802,8 @@ vm_page_free_prep(vm_page_t m) * Returns the given page to the free list, disassociating it * from any VM object. * - * The object must be locked. The page must be locked if it is - * managed. + * The object must be locked. The page must be exclusively busied if it + * belongs to an object. */ static void vm_page_free_toq(vm_page_t m) @@ -3834,9 +3832,6 @@ vm_page_free_toq(vm_page_t m) * Returns a list of pages to the free list, disassociating it * from any VM object. In other words, this is equivalent to * calling vm_page_free_toq() for each page of a list of VM objects. - * - * The objects must be locked. The pages must be locked if it is - * managed. */ void vm_page_free_pages_toq(struct spglist *free, bool update_wire_count) @@ -3974,8 +3969,6 @@ vm_page_unwire_managed(vm_page_t m, uint8_t nqueue, bo * of wirings transitions to zero and the page is eligible for page out, then * the page is added to the specified paging queue. If the released wiring * represented the last reference to the page, the page is freed. - * - * A managed page must be locked. */ void vm_page_unwire(vm_page_t m, uint8_t nqueue) @@ -4022,8 +4015,6 @@ vm_page_unwire_noq(vm_page_t m) * Ensure that the page ends up in the specified page queue. If the page is * active or being moved to the active queue, ensure that its act_count is * at least ACT_INIT but do not otherwise mess with it. - * - * A managed page must be locked. */ static __always_inline void vm_page_mvqueue(vm_page_t m, const uint8_t nqueue, const uint16_t nflag) @@ -4269,14 +4260,14 @@ vm_page_try_remove_write(vm_page_t m) * vm_page_advise * * Apply the specified advice to the given page. - * - * The object and page must be locked. */ void vm_page_advise(vm_page_t m, int advice) { VM_OBJECT_ASSERT_WLOCKED(m->object); + vm_page_assert_xbusied(m); + if (advice == MADV_FREE) /* * Mark the page clean. This will allow the page to be freed Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Tue Aug 4 14:53:41 2020 (r363839) +++ head/sys/vm/vm_page.h Tue Aug 4 14:59:43 2020 (r363840) @@ -95,19 +95,17 @@ * synchronized using either one of or a combination of locks. If a * field is annotated with two of these locks then holding either is * sufficient for read access but both are required for write access. - * The physical address of a page is used to select its page lock from - * a pool. The queue lock for a page depends on the value of its queue - * field and is described in detail below. + * The queue lock for a page depends on the value of its queue field and is + * described in detail below. * * The following annotations are possible: * (A) the field must be accessed using atomic(9) and may require * additional synchronization. * (B) the page busy lock. * (C) the field is immutable. - * (F) the per-domain lock for the free queues + * (F) the per-domain lock for the free queues. * (M) Machine dependent, defined by pmap layer. * (O) the object that the page belongs to. - * (P) the page lock. * (Q) the page's queue lock. * * The busy lock is an embedded reader-writer lock that protects the @@ -270,7 +268,7 @@ struct vm_page { * cleared only when the corresponding object's write lock is held. * * VPRC_BLOCKED is used to atomically block wirings via pmap lookups while - * attempting to tear down all mappings of a given page. The page lock and + * attempting to tear down all mappings of a given page. The page busy lock and * object write lock must both be held in order to set or clear this bit. */ #define VPRC_BLOCKED 0x40000000u /* mappings are being removed */ @@ -411,27 +409,26 @@ extern struct mtx_padalign pa_lock[]; * * PGA_ENQUEUED is set and cleared when a page is inserted into or removed * from a page queue, respectively. It determines whether the plinks.q field - * of the page is valid. To set or clear this flag, the queue lock for the - * page must be held: the page queue lock corresponding to the page's "queue" - * field if its value is not PQ_NONE, and the page lock otherwise. + * of the page is valid. To set or clear this flag, page's "queue" field must + * be a valid queue index, and the corresponding page queue lock must be held. * * PGA_DEQUEUE is set when the page is scheduled to be dequeued from a page * queue, and cleared when the dequeue request is processed. A page may * have PGA_DEQUEUE set and PGA_ENQUEUED cleared, for instance if a dequeue * is requested after the page is scheduled to be enqueued but before it is - * actually inserted into the page queue. For allocated pages, the page lock - * must be held to set this flag, but it may be set by vm_page_free_prep() - * without the page lock held. The page queue lock must be held to clear the - * PGA_DEQUEUE flag. + * actually inserted into the page queue. * * PGA_REQUEUE is set when the page is scheduled to be enqueued or requeued - * in its page queue. The page lock must be held to set this flag, and the - * queue lock for the page must be held to clear it. + * in its page queue. * * PGA_REQUEUE_HEAD is a special flag for enqueuing pages near the head of - * the inactive queue, thus bypassing LRU. The page lock must be held to - * set this flag, and the queue lock for the page must be held to clear it. + * the inactive queue, thus bypassing LRU. * + * The PGA_DEQUEUE, PGA_REQUEUE and PGA_REQUEUE_HEAD flags must be set using an + * atomic RMW operation to ensure that the "queue" field is a valid queue index, + * and the corresponding page queue lock must be held when clearing any of the + * flags. + * * PGA_SWAP_FREE is used to defer freeing swap space to the pageout daemon * when the context that dirties the page does not have the object write lock * held. @@ -451,8 +448,8 @@ extern struct mtx_padalign pa_lock[]; #define PGA_QUEUE_STATE_MASK (PGA_ENQUEUED | PGA_QUEUE_OP_MASK) /* - * Page flags. If changed at any other time than page allocation or - * freeing, the modification must be protected by the vm_page lock. + * Page flags. Updates to these flags are not synchronized, and thus they must + * be set during page allocation or free to avoid races. * * The PG_PCPU_CACHE flag is set at allocation time if the page was * allocated from a per-CPU cache. It is cleared the next time that the Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Tue Aug 4 14:53:41 2020 (r363839) +++ head/sys/vm/vm_pageout.c Tue Aug 4 14:59:43 2020 (r363840) @@ -257,10 +257,9 @@ vm_pageout_end_scan(struct scan_state *ss) * physically dequeued if the caller so requests. Otherwise, the returned * batch may contain marker pages, and it is up to the caller to handle them. * - * When processing the batch queue, vm_page_queue() must be used to - * determine whether the page has been logically dequeued by another thread. - * Once this check is performed, the page lock guarantees that the page will - * not be disassociated from the queue. + * When processing the batch queue, vm_pageout_defer() must be used to + * determine whether the page has been logically dequeued since the batch was + * collected. */ static __always_inline void vm_pageout_collect_batch(struct scan_state *ss, const bool dequeue) Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Tue Aug 4 14:53:41 2020 (r363839) +++ head/sys/vm/vnode_pager.c Tue Aug 4 14:59:43 2020 (r363840) @@ -1307,7 +1307,7 @@ vnode_pager_generic_putpages(struct vnode *vp, vm_page * the last page is partially invalid. In this case the filesystem * may not properly clear the dirty bits for the entire page (which * could be VM_PAGE_BITS_ALL due to the page having been mmap()d). - * With the page locked we are free to fix-up the dirty bits here. + * With the page busied we are free to fix up the dirty bits here. * * We do not under any circumstances truncate the valid bits, as * this will screw up bogus page replacement. From owner-svn-src-all@freebsd.org Tue Aug 4 15:00:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E332C376798; Tue, 4 Aug 2020 15:00:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLdGB5m9cz4SLR; Tue, 4 Aug 2020 15:00:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A90B926FF1; Tue, 4 Aug 2020 15:00:02 +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 074F02sK025516; Tue, 4 Aug 2020 15:00:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074F02bM025515; Tue, 4 Aug 2020 15:00:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008041500.074F02bM025515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Aug 2020 15:00:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363841 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 363841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 15:00:03 -0000 Author: markj Date: Tue Aug 4 15:00:02 2020 New Revision: 363841 URL: https://svnweb.freebsd.org/changeset/base/363841 Log: Remove an incorrect assertion from in6p_lookup_mcast_ifp(). The socket may be bound to an IPv4-mapped IPv6 address. However, the inp address is not relevant to the JOIN_GROUP or LEAVE_GROUP operations. While here remove an unnecessary check for inp == NULL. Reported by: syzbot+d01ab3d5e6c1516a393c@syzkaller.appspotmail.com Reviewed by: hselasky MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25888 Modified: head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Tue Aug 4 14:59:43 2020 (r363840) +++ head/sys/netinet6/in6_mcast.c Tue Aug 4 15:00:02 2020 (r363841) @@ -1817,31 +1817,27 @@ ip6_getmoptions(struct inpcb *inp, struct sockopt *sop * * This routine exists to support legacy IPv6 multicast applications. * - * If inp is non-NULL, use this socket's current FIB number for any - * required FIB lookup. Look up the group address in the unicast FIB, - * and use its ifp; usually, this points to the default next-hop. - * If the FIB lookup fails, return NULL. + * Use the socket's current FIB number for any required FIB lookup. Look up the + * group address in the unicast FIB, and use its ifp; usually, this points to + * the default next-hop. If the FIB lookup fails, return NULL. * * FUTURE: Support multiple forwarding tables for IPv6. * * Returns NULL if no ifp could be found. */ static struct ifnet * -in6p_lookup_mcast_ifp(const struct inpcb *inp, - const struct sockaddr_in6 *gsin6) +in6p_lookup_mcast_ifp(const struct inpcb *inp, const struct sockaddr_in6 *gsin6) { struct nhop_object *nh; struct in6_addr dst; uint32_t scopeid; uint32_t fibnum; - KASSERT(inp->inp_vflag & INP_IPV6, - ("%s: not INP_IPV6 inpcb", __func__)); KASSERT(gsin6->sin6_family == AF_INET6, ("%s: not AF_INET6 group", __func__)); in6_splitscope(&gsin6->sin6_addr, &dst, &scopeid); - fibnum = inp ? inp->inp_inc.inc_fibnum : RT_DEFAULT_FIB; + fibnum = inp->inp_inc.inc_fibnum; nh = fib6_lookup(fibnum, &dst, scopeid, 0, 0); return (nh ? nh->nh_ifp : NULL); From owner-svn-src-all@freebsd.org Tue Aug 4 15:25:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1B7A377429; Tue, 4 Aug 2020 15:25:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLdqR4DnNz4Tvq; Tue, 4 Aug 2020 15:25:23 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7073D27544; Tue, 4 Aug 2020 15:25:23 +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 074FPNGc043750; Tue, 4 Aug 2020 15:25:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074FPNLh043749; Tue, 4 Aug 2020 15:25:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041525.074FPNLh043749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 15:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363842 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363842 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 15:25:23 -0000 Author: manu Date: Tue Aug 4 15:25:22 2020 New Revision: 363842 URL: https://svnweb.freebsd.org/changeset/base/363842 Log: linuxkpi: Add clear_bit_unlock This calls clear_bit and adds a memory barrier. Sponsored by: The FreeBSD Foundation Reviewed by: hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25943 Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 15:00:02 2020 (r363841) +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 15:25:22 2020 (r363842) @@ -275,6 +275,13 @@ find_next_zero_bit(const unsigned long *addr, unsigned #define test_bit(i, a) \ !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) +static inline void +clear_bit_unlock(long bit, volatile unsigned long *var) +{ + clear_bit(bit, var); + wmb(); +} + static inline int test_and_clear_bit(long bit, volatile unsigned long *var) { From owner-svn-src-all@freebsd.org Tue Aug 4 15:27:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EA20377444; Tue, 4 Aug 2020 15:27:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLdsx0Rmdz4VCk; Tue, 4 Aug 2020 15:27:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E696727710; Tue, 4 Aug 2020 15:27:32 +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 074FRWjw043908; Tue, 4 Aug 2020 15:27:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074FRW6d043907; Tue, 4 Aug 2020 15:27:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041527.074FRW6d043907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 15:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363843 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 363843 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 15:27:33 -0000 Author: manu Date: Tue Aug 4 15:27:32 2020 New Revision: 363843 URL: https://svnweb.freebsd.org/changeset/base/363843 Log: linuxkpi: Add time_after32 and time_before32 This compare two 32 bits times Sponsored by: The FreeBSD Foundation Reviewed by: kib, hselasky MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25700 Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h Modified: head/sys/compat/linuxkpi/common/include/linux/jiffies.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/jiffies.h Tue Aug 4 15:25:22 2020 (r363842) +++ head/sys/compat/linuxkpi/common/include/linux/jiffies.h Tue Aug 4 15:27:32 2020 (r363843) @@ -45,7 +45,9 @@ #define MAX_JIFFY_OFFSET ((INT_MAX >> 1) - 1) #define time_after(a, b) ((int)((b) - (a)) < 0) +#define time_after32(a, b) ((int32_t)((uint32_t)(b) - (uint32_t)(a)) < 0) #define time_before(a, b) time_after(b,a) +#define time_before32(a, b) time_after32(b, a) #define time_after_eq(a, b) ((int)((a) - (b)) >= 0) #define time_before_eq(a, b) time_after_eq(b, a) #define time_in_range(a,b,c) \ From owner-svn-src-all@freebsd.org Tue Aug 4 15:48:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBCD0377AA4; Tue, 4 Aug 2020 15:48:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLfKn6Ndsz4W8Q; Tue, 4 Aug 2020 15:48:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5E1A278B8; Tue, 4 Aug 2020 15:48:13 +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 074FmDxP056209; Tue, 4 Aug 2020 15:48:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074FmCUp056205; Tue, 4 Aug 2020 15:48:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008041548.074FmCUp056205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Aug 2020 15:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363844 - in stable/12/sys: dev/vmware/vmxnet3 net X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: dev/vmware/vmxnet3 net X-SVN-Commit-Revision: 363844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 15:48:14 -0000 Author: markj Date: Tue Aug 4 15:48:12 2020 New Revision: 363844 URL: https://svnweb.freebsd.org/changeset/base/363844 Log: MFC r358996 (by pkelsey): Fix iflib zero-length fragment handling MFC r358997 (by pkelsey): Remove freelist contiguous-indexes assertion from rxd_frag_to_sd() MFC r358998 (by pkelsey): Allow iflib drivers to specify the buffer size used for each receive queue MFC r358999 (by pkelsey): Remove refill budget from iflib MFC r359000 (by pkelsey): Fix if_vmx receive checksum offload bug and harden against the device skipping receive descriptors MFC r359001 (by pkelsey): Adjust if_vmx default receive parameters for better out-of-box performance MFC r359002 (by pkelsey): Remove extraneous code from iflib MFC r359029 (by pkelsey): Restore power-of-2 queue count constraint from r290948 Tested by: marcus, mav Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h stable/12/sys/net/iflib.c stable/12/sys/net/iflib.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Tue Aug 4 15:27:32 2020 (r363843) +++ stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Tue Aug 4 15:48:12 2020 (r363844) @@ -321,6 +321,13 @@ vmxnet3_register(device_t dev) } static int +trunc_powerof2(int val) +{ + + return (1U << (fls(val) - 1)); +} + +static int vmxnet3_attach_pre(if_ctx_t ctx) { device_t dev; @@ -349,12 +356,16 @@ vmxnet3_attach_pre(if_ctx_t ctx) /* If 0, the iflib tunable was not set, so set to the default */ if (scctx->isc_nrxqsets == 0) scctx->isc_nrxqsets = VMXNET3_DEF_RX_QUEUES; + scctx->isc_nrxqsets = trunc_powerof2(scctx->isc_nrxqsets); scctx->isc_nrxqsets_max = min(VMXNET3_MAX_RX_QUEUES, mp_ncpus); + scctx->isc_nrxqsets_max = trunc_powerof2(scctx->isc_nrxqsets_max); /* If 0, the iflib tunable was not set, so set to the default */ if (scctx->isc_ntxqsets == 0) scctx->isc_ntxqsets = VMXNET3_DEF_TX_QUEUES; + scctx->isc_ntxqsets = trunc_powerof2(scctx->isc_ntxqsets); scctx->isc_ntxqsets_max = min(VMXNET3_MAX_TX_QUEUES, mp_ncpus); + scctx->isc_ntxqsets_max = trunc_powerof2(scctx->isc_ntxqsets_max); /* * Enforce that the transmit completion queue descriptor count is @@ -381,6 +392,12 @@ vmxnet3_attach_pre(if_ctx_t ctx) scctx->isc_rxqsizes[2] = sizeof(struct vmxnet3_rxdesc) * scctx->isc_nrxd[2]; + /* + * Initialize the max frame size and descriptor queue buffer + * sizes. + */ + vmxnet3_mtu_set(ctx, if_getmtu(sc->vmx_ifp)); + scctx->isc_rss_table_size = UPT1_RSS_MAX_IND_TABLE_SIZE; /* Map PCI BARs */ @@ -1494,6 +1511,7 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, if_rxd_info_t ri) int cqidx; uint16_t total_len; uint8_t nfrags; + uint8_t i; uint8_t flid; sc = vsc; @@ -1517,6 +1535,7 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, if_rxd_info_t ri) KASSERT(rxcd->sop && rxcd->eop, ("%s: zero-length packet without both sop and eop set", __func__)); + rxc->vxcr_zero_length++; if (++cqidx == rxc->vxcr_ndesc) { cqidx = 0; rxc->vxcr_gen ^= 1; @@ -1572,31 +1591,6 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, if_rxd_info_t ri) } } - /* VLAN */ - if (rxcd->vlan) { - ri->iri_flags |= M_VLANTAG; - ri->iri_vtag = rxcd->vtag; - } - - /* Checksum offload */ - if (!rxcd->no_csum) { - uint32_t csum_flags = 0; - - if (rxcd->ipv4) { - csum_flags |= CSUM_IP_CHECKED; - if (rxcd->ipcsum_ok) - csum_flags |= CSUM_IP_VALID; - } - if (!rxcd->fragment && (rxcd->tcp || rxcd->udp)) { - csum_flags |= CSUM_L4_CALC; - if (rxcd->csum_ok) { - csum_flags |= CSUM_L4_VALID; - ri->iri_csum_data = 0xffff; - } - } - ri->iri_csum_flags = csum_flags; - } - /* * The queue numbering scheme used for rxcd->qid is as follows: * - All of the command ring 0s are numbered [0, nrxqsets - 1] @@ -1632,6 +1626,46 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, if_rxd_info_t ri) ri->iri_nfrags = nfrags; ri->iri_len = total_len; + /* + * If there's an error, the last descriptor in the packet will + * have the error indicator set. In this case, set all + * fragment lengths to zero. This will cause iflib to discard + * the packet, but process all associated descriptors through + * the refill mechanism. + */ + if (__predict_false(rxcd->error)) { + rxc->vxcr_pkt_errors++; + for (i = 0; i < nfrags; i++) { + frag = &ri->iri_frags[i]; + frag->irf_len = 0; + } + } else { + /* Checksum offload information is in the last descriptor. */ + if (!rxcd->no_csum) { + uint32_t csum_flags = 0; + + if (rxcd->ipv4) { + csum_flags |= CSUM_IP_CHECKED; + if (rxcd->ipcsum_ok) + csum_flags |= CSUM_IP_VALID; + } + if (!rxcd->fragment && (rxcd->tcp || rxcd->udp)) { + csum_flags |= CSUM_L4_CALC; + if (rxcd->csum_ok) { + csum_flags |= CSUM_L4_VALID; + ri->iri_csum_data = 0xffff; + } + } + ri->iri_csum_flags = csum_flags; + } + + /* VLAN information is in the last descriptor. */ + if (rxcd->vlan) { + ri->iri_flags |= M_VLANTAG; + ri->iri_vtag = rxcd->vtag; + } + } + return (0); } @@ -1645,14 +1679,13 @@ vmxnet3_isc_rxd_refill(void *vsc, if_rxd_update_t iru) uint64_t *paddrs; int count; int len; - int pidx; + int idx; int i; uint8_t flid; uint8_t btype; count = iru->iru_count; len = iru->iru_buf_size; - pidx = iru->iru_pidx; flid = iru->iru_flidx; paddrs = iru->iru_paddrs; @@ -1666,17 +1699,32 @@ vmxnet3_isc_rxd_refill(void *vsc, if_rxd_update_t iru) * command ring 1 is filled with BTYPE_BODY descriptors. */ btype = (flid == 0) ? VMXNET3_BTYPE_HEAD : VMXNET3_BTYPE_BODY; - for (i = 0; i < count; i++) { - rxd[pidx].addr = paddrs[i]; - rxd[pidx].len = len; - rxd[pidx].btype = btype; - rxd[pidx].gen = rxr->vxrxr_gen; + /* + * The refill entries from iflib will advance monotonically, + * but the refilled descriptors may not be contiguous due to + * earlier skipping of descriptors by the device. The refill + * entries from iflib need an entire state update, while the + * descriptors previously skipped by the device only need to + * have their generation numbers updated. + */ + idx = rxr->vxrxr_refill_start; + i = 0; + do { + if (idx == iru->iru_idxs[i]) { + rxd[idx].addr = paddrs[i]; + rxd[idx].len = len; + rxd[idx].btype = btype; + i++; + } else + rxr->vxrxr_desc_skips++; + rxd[idx].gen = rxr->vxrxr_gen; - if (++pidx == rxr->vxrxr_ndesc) { - pidx = 0; + if (++idx == rxr->vxrxr_ndesc) { + idx = 0; rxr->vxrxr_gen ^= 1; } - } + } while (i != count); + rxr->vxrxr_refill_start = idx; } static void @@ -1825,6 +1873,8 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct vmxnet for (i = 0; i < sc->vmx_sctx->isc_nrxqs - 1; i++) { rxr = &rxq->vxrxq_cmd_ring[i]; rxr->vxrxr_gen = VMXNET3_INIT_GEN; + rxr->vxrxr_desc_skips = 0; + rxr->vxrxr_refill_start = 0; /* * iflib has zeroed out the descriptor array during the * prior attach or stop @@ -1834,6 +1884,8 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct vmxnet for (/**/; i < VMXNET3_RXRINGS_PERQ; i++) { rxr = &rxq->vxrxq_cmd_ring[i]; rxr->vxrxr_gen = 0; + rxr->vxrxr_desc_skips = 0; + rxr->vxrxr_refill_start = 0; bzero(rxr->vxrxr_rxd, rxr->vxrxr_ndesc * sizeof(struct vmxnet3_rxdesc)); } @@ -1841,6 +1893,8 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct vmxnet rxc = &rxq->vxrxq_comp_ring; rxc->vxcr_next = 0; rxc->vxcr_gen = VMXNET3_INIT_GEN; + rxc->vxcr_zero_length = 0; + rxc->vxcr_pkt_errors = 0; /* * iflib has zeroed out the descriptor array during the prior attach * or stop @@ -1906,14 +1960,9 @@ static void vmxnet3_init(if_ctx_t ctx) { struct vmxnet3_softc *sc; - if_softc_ctx_t scctx; sc = iflib_get_softc(ctx); - scctx = sc->vmx_scctx; - scctx->isc_max_frame_size = if_getmtu(iflib_get_ifp(ctx)) + - ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + ETHER_CRC_LEN; - /* Use the current MAC address. */ bcopy(IF_LLADDR(sc->vmx_ifp), sc->vmx_lladdr, ETHER_ADDR_LEN); vmxnet3_set_lladdr(sc); @@ -1938,11 +1987,37 @@ vmxnet3_multi_set(if_ctx_t ctx) static int vmxnet3_mtu_set(if_ctx_t ctx, uint32_t mtu) { + struct vmxnet3_softc *sc; + if_softc_ctx_t scctx; + sc = iflib_get_softc(ctx); + scctx = sc->vmx_scctx; + if (mtu > VMXNET3_TX_MAXSIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + ETHER_CRC_LEN)) return (EINVAL); + /* + * Update the max frame size so that the rx mbuf size is + * chosen based on the new mtu during the interface init that + * will occur after this routine returns. + */ + scctx->isc_max_frame_size = mtu + + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + ETHER_CRC_LEN; + /* RX completion queue - n/a */ + scctx->isc_rxd_buf_size[0] = 0; + /* + * For header-type descriptors (used for first segment of + * packet), let iflib determine the buffer size based on the + * max frame size. + */ + scctx->isc_rxd_buf_size[1] = 0; + /* + * For body-type descriptors (used for jumbo frames and LRO), + * always use page-sized buffers. + */ + scctx->isc_rxd_buf_size[2] = MJUMPAGESIZE; + return (0); } @@ -2288,14 +2363,22 @@ vmxnet3_setup_debug_sysctl(struct vmxnet3_softc *sc, &rxq->vxrxq_cmd_ring[0].vxrxr_ndesc, 0, ""); SYSCTL_ADD_INT(ctx, list, OID_AUTO, "cmd0_gen", CTLFLAG_RD, &rxq->vxrxq_cmd_ring[0].vxrxr_gen, 0, ""); + SYSCTL_ADD_U64(ctx, list, OID_AUTO, "cmd0_desc_skips", CTLFLAG_RD, + &rxq->vxrxq_cmd_ring[0].vxrxr_desc_skips, 0, ""); SYSCTL_ADD_UINT(ctx, list, OID_AUTO, "cmd1_ndesc", CTLFLAG_RD, &rxq->vxrxq_cmd_ring[1].vxrxr_ndesc, 0, ""); SYSCTL_ADD_INT(ctx, list, OID_AUTO, "cmd1_gen", CTLFLAG_RD, &rxq->vxrxq_cmd_ring[1].vxrxr_gen, 0, ""); + SYSCTL_ADD_U64(ctx, list, OID_AUTO, "cmd1_desc_skips", CTLFLAG_RD, + &rxq->vxrxq_cmd_ring[1].vxrxr_desc_skips, 0, ""); SYSCTL_ADD_UINT(ctx, list, OID_AUTO, "comp_ndesc", CTLFLAG_RD, &rxq->vxrxq_comp_ring.vxcr_ndesc, 0,""); SYSCTL_ADD_INT(ctx, list, OID_AUTO, "comp_gen", CTLFLAG_RD, &rxq->vxrxq_comp_ring.vxcr_gen, 0, ""); + SYSCTL_ADD_U64(ctx, list, OID_AUTO, "comp_zero_length", CTLFLAG_RD, + &rxq->vxrxq_comp_ring.vxcr_zero_length, 0, ""); + SYSCTL_ADD_U64(ctx, list, OID_AUTO, "comp_pkt_errors", CTLFLAG_RD, + &rxq->vxrxq_comp_ring.vxcr_pkt_errors, 0, ""); } } Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h ============================================================================== --- stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h Tue Aug 4 15:27:32 2020 (r363843) +++ stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h Tue Aug 4 15:48:12 2020 (r363844) @@ -41,7 +41,7 @@ struct vmxnet3_softc; #define VMXNET3_MAX_TX_NDESC 4096 #define VMXNET3_MIN_TX_NDESC 32 #define VMXNET3_MASK_TX_NDESC 0x1F -#define VMXNET3_DEF_RX_NDESC 256 +#define VMXNET3_DEF_RX_NDESC 512 #define VMXNET3_MAX_RX_NDESC 2048 #define VMXNET3_MIN_RX_NDESC 32 #define VMXNET3_MASK_RX_NDESC 0x1F @@ -63,6 +63,8 @@ struct vmxnet3_rxring { u_int vxrxr_ndesc; int vxrxr_gen; bus_addr_t vxrxr_paddr; + uint64_t vxrxr_desc_skips; + uint16_t vxrxr_refill_start; }; struct vmxnet3_comp_ring { @@ -78,6 +80,8 @@ struct vmxnet3_comp_ring { u_int vxcr_ndesc; int vxcr_gen; bus_addr_t vxcr_paddr; + uint64_t vxcr_zero_length; + uint64_t vxcr_pkt_errors; }; struct vmxnet3_txqueue { Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Tue Aug 4 15:27:32 2020 (r363843) +++ stable/12/sys/net/iflib.c Tue Aug 4 15:48:12 2020 (r363844) @@ -453,7 +453,6 @@ typedef struct if_rxsd { caddr_t *ifsd_cl; struct mbuf **ifsd_m; iflib_fl_t ifsd_fl; - qidx_t ifsd_cidx; } *if_rxsd_t; /* multiple of word size */ @@ -713,6 +712,7 @@ static int iflib_altq_if_transmit(if_t ifp, struct mbu static int iflib_register(if_ctx_t); static void iflib_deregister(if_ctx_t); static void iflib_unregister_vlan_handlers(if_ctx_t ctx); +static uint16_t iflib_get_mbuf_size_for(unsigned int size); static void iflib_init_locked(if_ctx_t ctx); static void iflib_add_device_sysctl_pre(if_ctx_t ctx); static void iflib_add_device_sysctl_post(if_ctx_t ctx); @@ -2130,7 +2130,7 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun } static __inline uint8_t -__iflib_fl_refill_lt(if_ctx_t ctx, iflib_fl_t fl, int max) +__iflib_fl_refill_all(if_ctx_t ctx, iflib_fl_t fl) { /* we avoid allowing pidx to catch up with cidx as it confuses ixl */ int32_t reclaimable = fl->ifl_size - fl->ifl_credits - 1; @@ -2142,7 +2142,7 @@ __iflib_fl_refill_lt(if_ctx_t ctx, iflib_fl_t fl, int MPASS(reclaimable == delta); if (reclaimable > 0) - return (_iflib_fl_refill(ctx, fl, min(max, reclaimable))); + return (_iflib_fl_refill(ctx, fl, reclaimable)); return (0); } @@ -2213,6 +2213,8 @@ iflib_fl_setup(iflib_fl_t fl) { iflib_rxq_t rxq = fl->ifl_rxq; if_ctx_t ctx = rxq->ifr_ctx; + if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + int qidx; bit_nclear(fl->ifl_rx_bitmap, 0, fl->ifl_size - 1); /* @@ -2221,7 +2223,16 @@ iflib_fl_setup(iflib_fl_t fl) iflib_fl_bufs_free(fl); /* Now replenish the mbufs */ MPASS(fl->ifl_credits == 0); - fl->ifl_buf_size = ctx->ifc_rx_mbuf_sz; + qidx = rxq->ifr_fl_offset + fl->ifl_id; + if (scctx->isc_rxd_buf_size[qidx] != 0) + fl->ifl_buf_size = scctx->isc_rxd_buf_size[qidx]; + else + fl->ifl_buf_size = ctx->ifc_rx_mbuf_sz; + /* + * ifl_buf_size may be a driver-supplied value, so pull it up + * to the selected mbuf size. + */ + fl->ifl_buf_size = iflib_get_mbuf_size_for(fl->ifl_buf_size); if (fl->ifl_buf_size > ctx->ifc_max_fl_buf_size) ctx->ifc_max_fl_buf_size = fl->ifl_buf_size; fl->ifl_cltype = m_gettype(fl->ifl_buf_size); @@ -2353,6 +2364,16 @@ iflib_timer(void *arg) STATE_UNLOCK(ctx); } +static uint16_t +iflib_get_mbuf_size_for(unsigned int size) +{ + + if (size <= MCLBYTES) + return (MCLBYTES); + else + return (MJUMPAGESIZE); +} + static void iflib_calc_rx_mbuf_sz(if_ctx_t ctx) { @@ -2362,10 +2383,8 @@ iflib_calc_rx_mbuf_sz(if_ctx_t ctx) * XXX don't set the max_frame_size to larger * than the hardware can handle */ - if (sctx->isc_max_frame_size <= MCLBYTES) - ctx->ifc_rx_mbuf_sz = MCLBYTES; - else - ctx->ifc_rx_mbuf_sz = MJUMPAGESIZE; + ctx->ifc_rx_mbuf_sz = + iflib_get_mbuf_size_for(sctx->isc_max_frame_size); } uint32_t @@ -2578,7 +2597,6 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int cidx = irf->irf_idx; fl = &rxq->ifr_fl[flid]; sd->ifsd_fl = fl; - sd->ifsd_cidx = cidx; sd->ifsd_m = &fl->ifl_sds.ifsd_m[cidx]; sd->ifsd_cl = &fl->ifl_sds.ifsd_cl[cidx]; fl->ifl_credits--; @@ -2590,12 +2608,10 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t irf, int next = (cidx + CACHE_PTR_INCREMENT) & (fl->ifl_size-1); prefetch(&fl->ifl_sds.ifsd_map[next]); map = fl->ifl_sds.ifsd_map[cidx]; - next = (cidx + CACHE_LINE_SIZE) & (fl->ifl_size-1); - /* not valid assert if bxe really does SGE from non-contiguous elements */ - MPASS(fl->ifl_cidx == cidx); bus_dmamap_sync(fl->ifl_buf_tag, map, BUS_DMASYNC_POSTREAD); - if (unload) + + if (unload && irf->irf_len != 0) bus_dmamap_unload(fl->ifl_buf_tag, map); fl->ifl_cidx = (fl->ifl_cidx + 1) & (fl->ifl_size-1); if (__predict_false(fl->ifl_cidx == 0)) @@ -2667,6 +2683,7 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) /* should I merge this back in now that the two paths are basically duplicated? */ if (ri->iri_nfrags == 1 && + ri->iri_frags[0].irf_len != 0 && ri->iri_frags[0].irf_len <= MIN(IFLIB_RX_COPY_THRESH, MHLEN)) { rxd_frag_to_sd(rxq, &ri->iri_frags[0], FALSE, &sd); m = *sd.ifsd_m; @@ -2680,6 +2697,8 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) m->m_len = ri->iri_frags[0].irf_len; } else { m = assemble_segments(rxq, ri, &sd); + if (m == NULL) + return (NULL); } m->m_pkthdr.len = ri->iri_len; m->m_pkthdr.rcvif = ri->iri_ifp; @@ -2780,7 +2799,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) cidxp = &rxq->ifr_fl[0].ifl_cidx; if ((avail = iflib_rxd_avail(ctx, rxq, *cidxp, budget)) == 0) { for (i = 0, fl = &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, fl++) - retval |= __iflib_fl_refill_lt(ctx, fl, budget + 8); + retval |= __iflib_fl_refill_all(ctx, fl); DBG_COUNTER_INC(rx_unavail); return (retval); } @@ -2836,7 +2855,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) } /* make sure that we can refill faster than drain */ for (i = 0, fl = &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, fl++) - retval |= __iflib_fl_refill_lt(ctx, fl, budget + 8); + retval |= __iflib_fl_refill_all(ctx, fl); lro_enabled = (if_getcapenable(ifp) & IFCAP_LRO); if (lro_enabled) @@ -6702,6 +6721,9 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) SYSCTL_ADD_U16(ctx_list, fl_list, OID_AUTO, "credits", CTLFLAG_RD, &fl->ifl_credits, 1, "credits available"); + SYSCTL_ADD_U16(ctx_list, fl_list, OID_AUTO, "buf_size", + CTLFLAG_RD, + &fl->ifl_buf_size, 1, "buffer size"); #if MEMORY_LOGGING SYSCTL_ADD_QUAD(ctx_list, fl_list, OID_AUTO, "fl_m_enqueued", CTLFLAG_RD, Modified: stable/12/sys/net/iflib.h ============================================================================== --- stable/12/sys/net/iflib.h Tue Aug 4 15:27:32 2020 (r363843) +++ stable/12/sys/net/iflib.h Tue Aug 4 15:48:12 2020 (r363844) @@ -221,6 +221,9 @@ typedef struct if_softc_ctx { uint32_t isc_tx_qdepth; iflib_intr_mode_t isc_intr; + uint16_t isc_rxd_buf_size[8]; /* set at init time by driver, 0 + means use iflib-calculated size + based on isc_max_frame_size */ uint16_t isc_max_frame_size; /* set at init time by driver */ uint16_t isc_min_frame_size; /* set at init time by driver, only used if IFLIB_NEED_ETHER_PAD is set. */ From owner-svn-src-all@freebsd.org Tue Aug 4 15:54:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B52F03781E9; Tue, 4 Aug 2020 15:54:16 +0000 (UTC) (envelope-from jclarke@marcuscom.com) Received: from creme-brulee.marcuscom.com (creme-brulee.marcuscom.com [IPv6:2607:fc50:1:f300::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "*.marcuscom.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLfSm078Zz4Wnl; Tue, 4 Aug 2020 15:54:15 +0000 (UTC) (envelope-from jclarke@marcuscom.com) Received: from rtp-jclarke-nitro9.cisco.com ([173.38.117.79]) (authenticated bits=0) by creme-brulee.marcuscom.com (8.16.1/8.16.1) with ESMTPSA id 074FsBbH030503 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 4 Aug 2020 11:54:12 -0400 (EDT) (envelope-from jclarke@marcuscom.com) X-Authentication-Warning: creme-brulee.marcuscom.com: Host [173.38.117.79] claimed to be rtp-jclarke-nitro9.cisco.com From: Joe Clarke Message-Id: <591D9FE1-043F-4025-83F8-E6100D680EB2@marcuscom.com> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r363844 - in stable/12/sys: dev/vmware/vmxnet3 net Date: Tue, 4 Aug 2020 11:54:06 -0400 In-Reply-To: <202008041548.074FmCUp056205@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org To: Mark Johnston References: <202008041548.074FmCUp056205@repo.freebsd.org> X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Spam-Status: No, score=3.4 required=5.0 tests=HTML_MESSAGE, RDNS_NONE, TW_CQ, TW_DX,TW_MX,TW_NR,TW_QS,TW_RX,TW_SV,TW_TX,TW_VM,TW_XC,TW_XQ,TW_XS autolearn=disabled version=3.4.4 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on creme-brulee.marcuscom.com X-Rspamd-Queue-Id: 4BLfSm078Zz4Wnl X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jclarke@marcuscom.com has no SPF policy when checking 2607:fc50:1:f300::2) smtp.mailfrom=jclarke@marcuscom.com X-Spamd-Result: default: False [1.95 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[marcuscom.com]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_MEDIUM(0.34)[0.344]; NEURAL_HAM_SHORT(-0.10)[-0.101]; NEURAL_SPAM_LONG(0.31)[0.311]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:2607:fc50::/36, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 15:54:16 -0000 Thanks, Mark. Joe > On Aug 4, 2020, at 11:48, Mark Johnston wrote: >=20 > Author: markj > Date: Tue Aug 4 15:48:12 2020 > New Revision: 363844 > URL: https://svnweb.freebsd.org/changeset/base/363844 >=20 > Log: > MFC r358996 (by pkelsey): > Fix iflib zero-length fragment handling >=20 > MFC r358997 (by pkelsey): > Remove freelist contiguous-indexes assertion from rxd_frag_to_sd() >=20 > MFC r358998 (by pkelsey): > Allow iflib drivers to specify the buffer size used for each receive = queue >=20 > MFC r358999 (by pkelsey): > Remove refill budget from iflib >=20 > MFC r359000 (by pkelsey): > Fix if_vmx receive checksum offload bug and harden against the device > skipping receive descriptors >=20 > MFC r359001 (by pkelsey): > Adjust if_vmx default receive parameters for better out-of-box = performance >=20 > MFC r359002 (by pkelsey): > Remove extraneous code from iflib >=20 > MFC r359029 (by pkelsey): > Restore power-of-2 queue count constraint from r290948 >=20 > Tested by: marcus, mav >=20 > Modified: > stable/12/sys/dev/vmware/vmxnet3/if_vmx.c > stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h > stable/12/sys/net/iflib.c > stable/12/sys/net/iflib.h > Directory Properties: > stable/12/ (props changed) >=20 > Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmx.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 > --- stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Tue Aug 4 15:27:32 2020 = (r363843) > +++ stable/12/sys/dev/vmware/vmxnet3/if_vmx.c Tue Aug 4 15:48:12 2020 = (r363844) > @@ -321,6 +321,13 @@ vmxnet3_register(device_t dev) > } >=20 > static int > +trunc_powerof2(int val) > +{ > + > + return (1U << (fls(val) - 1)); > +} > + > +static int > vmxnet3_attach_pre(if_ctx_t ctx) > { > device_t dev; > @@ -349,12 +356,16 @@ vmxnet3_attach_pre(if_ctx_t ctx) > /* If 0, the iflib tunable was not set, so set to the default */ > if (scctx->isc_nrxqsets =3D=3D 0) > scctx->isc_nrxqsets =3D VMXNET3_DEF_RX_QUEUES; > + scctx->isc_nrxqsets =3D trunc_powerof2(scctx->isc_nrxqsets); > scctx->isc_nrxqsets_max =3D min(VMXNET3_MAX_RX_QUEUES, = mp_ncpus); > + scctx->isc_nrxqsets_max =3D = trunc_powerof2(scctx->isc_nrxqsets_max); >=20 > /* If 0, the iflib tunable was not set, so set to the default */ > if (scctx->isc_ntxqsets =3D=3D 0) > scctx->isc_ntxqsets =3D VMXNET3_DEF_TX_QUEUES; > + scctx->isc_ntxqsets =3D trunc_powerof2(scctx->isc_ntxqsets); > scctx->isc_ntxqsets_max =3D min(VMXNET3_MAX_TX_QUEUES, = mp_ncpus); > + scctx->isc_ntxqsets_max =3D = trunc_powerof2(scctx->isc_ntxqsets_max); >=20 > /* > * Enforce that the transmit completion queue descriptor count = is > @@ -381,6 +392,12 @@ vmxnet3_attach_pre(if_ctx_t ctx) > scctx->isc_rxqsizes[2] =3D > sizeof(struct vmxnet3_rxdesc) * scctx->isc_nrxd[2]; >=20 > + /* > + * Initialize the max frame size and descriptor queue buffer > + * sizes. > + */ > + vmxnet3_mtu_set(ctx, if_getmtu(sc->vmx_ifp)); > + > scctx->isc_rss_table_size =3D UPT1_RSS_MAX_IND_TABLE_SIZE; >=20 > /* Map PCI BARs */ > @@ -1494,6 +1511,7 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, if_rxd_info_t = ri) > int cqidx; > uint16_t total_len; > uint8_t nfrags; > + uint8_t i; > uint8_t flid; >=20 > sc =3D vsc; > @@ -1517,6 +1535,7 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, if_rxd_info_t = ri) > KASSERT(rxcd->sop && rxcd->eop, > ("%s: zero-length packet without both sop and eop = set", > __func__)); > + rxc->vxcr_zero_length++; > if (++cqidx =3D=3D rxc->vxcr_ndesc) { > cqidx =3D 0; > rxc->vxcr_gen ^=3D 1; > @@ -1572,31 +1591,6 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, = if_rxd_info_t ri) > } > } >=20 > - /* VLAN */ > - if (rxcd->vlan) { > - ri->iri_flags |=3D M_VLANTAG; > - ri->iri_vtag =3D rxcd->vtag; > - } > - > - /* Checksum offload */ > - if (!rxcd->no_csum) { > - uint32_t csum_flags =3D 0; > - > - if (rxcd->ipv4) { > - csum_flags |=3D CSUM_IP_CHECKED; > - if (rxcd->ipcsum_ok) > - csum_flags |=3D CSUM_IP_VALID; > - } > - if (!rxcd->fragment && (rxcd->tcp || rxcd->udp)) { > - csum_flags |=3D CSUM_L4_CALC; > - if (rxcd->csum_ok) { > - csum_flags |=3D CSUM_L4_VALID; > - ri->iri_csum_data =3D 0xffff; > - } > - } > - ri->iri_csum_flags =3D csum_flags; > - } > - > /* > * The queue numbering scheme used for rxcd->qid is as follows: > * - All of the command ring 0s are numbered [0, nrxqsets - 1] > @@ -1632,6 +1626,46 @@ vmxnet3_isc_rxd_pkt_get(void *vsc, = if_rxd_info_t ri) > ri->iri_nfrags =3D nfrags; > ri->iri_len =3D total_len; >=20 > + /* > + * If there's an error, the last descriptor in the packet will > + * have the error indicator set. In this case, set all > + * fragment lengths to zero. This will cause iflib to discard > + * the packet, but process all associated descriptors through > + * the refill mechanism. > + */ > + if (__predict_false(rxcd->error)) { > + rxc->vxcr_pkt_errors++; > + for (i =3D 0; i < nfrags; i++) { > + frag =3D &ri->iri_frags[i]; > + frag->irf_len =3D 0; > + } > + } else { > + /* Checksum offload information is in the last = descriptor. */ > + if (!rxcd->no_csum) { > + uint32_t csum_flags =3D 0; > + > + if (rxcd->ipv4) { > + csum_flags |=3D CSUM_IP_CHECKED; > + if (rxcd->ipcsum_ok) > + csum_flags |=3D CSUM_IP_VALID; > + } > + if (!rxcd->fragment && (rxcd->tcp || rxcd->udp)) = { > + csum_flags |=3D CSUM_L4_CALC; > + if (rxcd->csum_ok) { > + csum_flags |=3D CSUM_L4_VALID; > + ri->iri_csum_data =3D 0xffff; > + } > + } > + ri->iri_csum_flags =3D csum_flags; > + } > + > + /* VLAN information is in the last descriptor. */ > + if (rxcd->vlan) { > + ri->iri_flags |=3D M_VLANTAG; > + ri->iri_vtag =3D rxcd->vtag; > + } > + } > + > return (0); > } >=20 > @@ -1645,14 +1679,13 @@ vmxnet3_isc_rxd_refill(void *vsc, = if_rxd_update_t iru) > uint64_t *paddrs; > int count; > int len; > - int pidx; > + int idx; > int i; > uint8_t flid; > uint8_t btype; >=20 > count =3D iru->iru_count; > len =3D iru->iru_buf_size; > - pidx =3D iru->iru_pidx; > flid =3D iru->iru_flidx; > paddrs =3D iru->iru_paddrs; >=20 > @@ -1666,17 +1699,32 @@ vmxnet3_isc_rxd_refill(void *vsc, = if_rxd_update_t iru) > * command ring 1 is filled with BTYPE_BODY descriptors. > */ > btype =3D (flid =3D=3D 0) ? VMXNET3_BTYPE_HEAD : = VMXNET3_BTYPE_BODY; > - for (i =3D 0; i < count; i++) { > - rxd[pidx].addr =3D paddrs[i]; > - rxd[pidx].len =3D len; > - rxd[pidx].btype =3D btype; > - rxd[pidx].gen =3D rxr->vxrxr_gen; > + /* > + * The refill entries from iflib will advance monotonically, > + * but the refilled descriptors may not be contiguous due to > + * earlier skipping of descriptors by the device. The refill > + * entries from iflib need an entire state update, while the > + * descriptors previously skipped by the device only need to > + * have their generation numbers updated. > + */ > + idx =3D rxr->vxrxr_refill_start; > + i =3D 0; > + do { > + if (idx =3D=3D iru->iru_idxs[i]) { > + rxd[idx].addr =3D paddrs[i]; > + rxd[idx].len =3D len; > + rxd[idx].btype =3D btype; > + i++; > + } else > + rxr->vxrxr_desc_skips++; > + rxd[idx].gen =3D rxr->vxrxr_gen; >=20 > - if (++pidx =3D=3D rxr->vxrxr_ndesc) { > - pidx =3D 0; > + if (++idx =3D=3D rxr->vxrxr_ndesc) { > + idx =3D 0; > rxr->vxrxr_gen ^=3D 1; > } > - } > + } while (i !=3D count); > + rxr->vxrxr_refill_start =3D idx; > } >=20 > static void > @@ -1825,6 +1873,8 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct = vmxnet > for (i =3D 0; i < sc->vmx_sctx->isc_nrxqs - 1; i++) { > rxr =3D &rxq->vxrxq_cmd_ring[i]; > rxr->vxrxr_gen =3D VMXNET3_INIT_GEN; > + rxr->vxrxr_desc_skips =3D 0; > + rxr->vxrxr_refill_start =3D 0; > /* > * iflib has zeroed out the descriptor array during the > * prior attach or stop > @@ -1834,6 +1884,8 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct = vmxnet > for (/**/; i < VMXNET3_RXRINGS_PERQ; i++) { > rxr =3D &rxq->vxrxq_cmd_ring[i]; > rxr->vxrxr_gen =3D 0; > + rxr->vxrxr_desc_skips =3D 0; > + rxr->vxrxr_refill_start =3D 0; > bzero(rxr->vxrxr_rxd, > rxr->vxrxr_ndesc * sizeof(struct vmxnet3_rxdesc)); > } > @@ -1841,6 +1893,8 @@ vmxnet3_rxinit(struct vmxnet3_softc *sc, struct = vmxnet > rxc =3D &rxq->vxrxq_comp_ring; > rxc->vxcr_next =3D 0; > rxc->vxcr_gen =3D VMXNET3_INIT_GEN; > + rxc->vxcr_zero_length =3D 0; > + rxc->vxcr_pkt_errors =3D 0; > /* > * iflib has zeroed out the descriptor array during the prior = attach > * or stop > @@ -1906,14 +1960,9 @@ static void > vmxnet3_init(if_ctx_t ctx) > { > struct vmxnet3_softc *sc; > - if_softc_ctx_t scctx; > =09 > sc =3D iflib_get_softc(ctx); > - scctx =3D sc->vmx_scctx; >=20 > - scctx->isc_max_frame_size =3D if_getmtu(iflib_get_ifp(ctx)) + > - ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + ETHER_CRC_LEN; > - > /* Use the current MAC address. */ > bcopy(IF_LLADDR(sc->vmx_ifp), sc->vmx_lladdr, ETHER_ADDR_LEN); > vmxnet3_set_lladdr(sc); > @@ -1938,11 +1987,37 @@ vmxnet3_multi_set(if_ctx_t ctx) > static int > vmxnet3_mtu_set(if_ctx_t ctx, uint32_t mtu) > { > + struct vmxnet3_softc *sc; > + if_softc_ctx_t scctx; >=20 > + sc =3D iflib_get_softc(ctx); > + scctx =3D sc->vmx_scctx; > + > if (mtu > VMXNET3_TX_MAXSIZE - (ETHER_HDR_LEN + = ETHER_VLAN_ENCAP_LEN + > ETHER_CRC_LEN)) > return (EINVAL); >=20 > + /* > + * Update the max frame size so that the rx mbuf size is > + * chosen based on the new mtu during the interface init that > + * will occur after this routine returns. > + */ > + scctx->isc_max_frame_size =3D mtu + > + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + ETHER_CRC_LEN; > + /* RX completion queue - n/a */ > + scctx->isc_rxd_buf_size[0] =3D 0; > + /* > + * For header-type descriptors (used for first segment of > + * packet), let iflib determine the buffer size based on the > + * max frame size. > + */ > + scctx->isc_rxd_buf_size[1] =3D 0; > + /* > + * For body-type descriptors (used for jumbo frames and LRO), > + * always use page-sized buffers. > + */ > + scctx->isc_rxd_buf_size[2] =3D MJUMPAGESIZE; > + > return (0); > } >=20 > @@ -2288,14 +2363,22 @@ vmxnet3_setup_debug_sysctl(struct = vmxnet3_softc *sc, > &rxq->vxrxq_cmd_ring[0].vxrxr_ndesc, 0, ""); > SYSCTL_ADD_INT(ctx, list, OID_AUTO, "cmd0_gen", = CTLFLAG_RD, > &rxq->vxrxq_cmd_ring[0].vxrxr_gen, 0, ""); > + SYSCTL_ADD_U64(ctx, list, OID_AUTO, "cmd0_desc_skips", = CTLFLAG_RD, > + &rxq->vxrxq_cmd_ring[0].vxrxr_desc_skips, 0, ""); > SYSCTL_ADD_UINT(ctx, list, OID_AUTO, "cmd1_ndesc", = CTLFLAG_RD, > &rxq->vxrxq_cmd_ring[1].vxrxr_ndesc, 0, ""); > SYSCTL_ADD_INT(ctx, list, OID_AUTO, "cmd1_gen", = CTLFLAG_RD, > &rxq->vxrxq_cmd_ring[1].vxrxr_gen, 0, ""); > + SYSCTL_ADD_U64(ctx, list, OID_AUTO, "cmd1_desc_skips", = CTLFLAG_RD, > + &rxq->vxrxq_cmd_ring[1].vxrxr_desc_skips, 0, ""); > SYSCTL_ADD_UINT(ctx, list, OID_AUTO, "comp_ndesc", = CTLFLAG_RD, > &rxq->vxrxq_comp_ring.vxcr_ndesc, 0,""); > SYSCTL_ADD_INT(ctx, list, OID_AUTO, "comp_gen", = CTLFLAG_RD, > &rxq->vxrxq_comp_ring.vxcr_gen, 0, ""); > + SYSCTL_ADD_U64(ctx, list, OID_AUTO, "comp_zero_length", = CTLFLAG_RD, > + &rxq->vxrxq_comp_ring.vxcr_zero_length, 0, ""); > + SYSCTL_ADD_U64(ctx, list, OID_AUTO, "comp_pkt_errors", = CTLFLAG_RD, > + &rxq->vxrxq_comp_ring.vxcr_pkt_errors, 0, ""); > } > } >=20 >=20 > Modified: stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h Tue Aug 4 = 15:27:32 2020 (r363843) > +++ stable/12/sys/dev/vmware/vmxnet3/if_vmxvar.h Tue Aug 4 = 15:48:12 2020 (r363844) > @@ -41,7 +41,7 @@ struct vmxnet3_softc; > #define VMXNET3_MAX_TX_NDESC 4096 > #define VMXNET3_MIN_TX_NDESC 32 > #define VMXNET3_MASK_TX_NDESC 0x1F > -#define VMXNET3_DEF_RX_NDESC 256 > +#define VMXNET3_DEF_RX_NDESC 512 > #define VMXNET3_MAX_RX_NDESC 2048 > #define VMXNET3_MIN_RX_NDESC 32 > #define VMXNET3_MASK_RX_NDESC 0x1F > @@ -63,6 +63,8 @@ struct vmxnet3_rxring { > u_int vxrxr_ndesc; > int vxrxr_gen; > bus_addr_t vxrxr_paddr; > + uint64_t vxrxr_desc_skips; > + uint16_t vxrxr_refill_start; > }; >=20 > struct vmxnet3_comp_ring { > @@ -78,6 +80,8 @@ struct vmxnet3_comp_ring { > u_int vxcr_ndesc; > int vxcr_gen; > bus_addr_t vxcr_paddr; > + uint64_t vxcr_zero_length; > + uint64_t vxcr_pkt_errors; > }; >=20 > struct vmxnet3_txqueue { >=20 > Modified: stable/12/sys/net/iflib.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 > --- stable/12/sys/net/iflib.c Tue Aug 4 15:27:32 2020 = (r363843) > +++ stable/12/sys/net/iflib.c Tue Aug 4 15:48:12 2020 = (r363844) > @@ -453,7 +453,6 @@ typedef struct if_rxsd { > caddr_t *ifsd_cl; > struct mbuf **ifsd_m; > iflib_fl_t ifsd_fl; > - qidx_t ifsd_cidx; > } *if_rxsd_t; >=20 > /* multiple of word size */ > @@ -713,6 +712,7 @@ static int iflib_altq_if_transmit(if_t ifp, struct = mbu > static int iflib_register(if_ctx_t); > static void iflib_deregister(if_ctx_t); > static void iflib_unregister_vlan_handlers(if_ctx_t ctx); > +static uint16_t iflib_get_mbuf_size_for(unsigned int size); > static void iflib_init_locked(if_ctx_t ctx); > static void iflib_add_device_sysctl_pre(if_ctx_t ctx); > static void iflib_add_device_sysctl_post(if_ctx_t ctx); > @@ -2130,7 +2130,7 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, = int coun > } >=20 > static __inline uint8_t > -__iflib_fl_refill_lt(if_ctx_t ctx, iflib_fl_t fl, int max) > +__iflib_fl_refill_all(if_ctx_t ctx, iflib_fl_t fl) > { > /* we avoid allowing pidx to catch up with cidx as it confuses = ixl */ > int32_t reclaimable =3D fl->ifl_size - fl->ifl_credits - 1; > @@ -2142,7 +2142,7 @@ __iflib_fl_refill_lt(if_ctx_t ctx, iflib_fl_t = fl, int=20 > MPASS(reclaimable =3D=3D delta); >=20 > if (reclaimable > 0) > - return (_iflib_fl_refill(ctx, fl, min(max, = reclaimable))); > + return (_iflib_fl_refill(ctx, fl, reclaimable)); > return (0); > } >=20 > @@ -2213,6 +2213,8 @@ iflib_fl_setup(iflib_fl_t fl) > { > iflib_rxq_t rxq =3D fl->ifl_rxq; > if_ctx_t ctx =3D rxq->ifr_ctx; > + if_softc_ctx_t scctx =3D &ctx->ifc_softc_ctx; > + int qidx; >=20 > bit_nclear(fl->ifl_rx_bitmap, 0, fl->ifl_size - 1); > /* > @@ -2221,7 +2223,16 @@ iflib_fl_setup(iflib_fl_t fl) > iflib_fl_bufs_free(fl); > /* Now replenish the mbufs */ > MPASS(fl->ifl_credits =3D=3D 0); > - fl->ifl_buf_size =3D ctx->ifc_rx_mbuf_sz; > + qidx =3D rxq->ifr_fl_offset + fl->ifl_id; > + if (scctx->isc_rxd_buf_size[qidx] !=3D 0) > + fl->ifl_buf_size =3D scctx->isc_rxd_buf_size[qidx]; > + else > + fl->ifl_buf_size =3D ctx->ifc_rx_mbuf_sz; > + /* > + * ifl_buf_size may be a driver-supplied value, so pull it up > + * to the selected mbuf size. > + */ > + fl->ifl_buf_size =3D iflib_get_mbuf_size_for(fl->ifl_buf_size); > if (fl->ifl_buf_size > ctx->ifc_max_fl_buf_size) > ctx->ifc_max_fl_buf_size =3D fl->ifl_buf_size; > fl->ifl_cltype =3D m_gettype(fl->ifl_buf_size); > @@ -2353,6 +2364,16 @@ iflib_timer(void *arg) > STATE_UNLOCK(ctx); > } >=20 > +static uint16_t > +iflib_get_mbuf_size_for(unsigned int size) > +{ > + > + if (size <=3D MCLBYTES) > + return (MCLBYTES); > + else > + return (MJUMPAGESIZE); > +} > + > static void > iflib_calc_rx_mbuf_sz(if_ctx_t ctx) > { > @@ -2362,10 +2383,8 @@ iflib_calc_rx_mbuf_sz(if_ctx_t ctx) > * XXX don't set the max_frame_size to larger > * than the hardware can handle > */ > - if (sctx->isc_max_frame_size <=3D MCLBYTES) > - ctx->ifc_rx_mbuf_sz =3D MCLBYTES; > - else > - ctx->ifc_rx_mbuf_sz =3D MJUMPAGESIZE; > + ctx->ifc_rx_mbuf_sz =3D > + iflib_get_mbuf_size_for(sctx->isc_max_frame_size); > } >=20 > uint32_t > @@ -2578,7 +2597,6 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t = irf, int > cidx =3D irf->irf_idx; > fl =3D &rxq->ifr_fl[flid]; > sd->ifsd_fl =3D fl; > - sd->ifsd_cidx =3D cidx; > sd->ifsd_m =3D &fl->ifl_sds.ifsd_m[cidx]; > sd->ifsd_cl =3D &fl->ifl_sds.ifsd_cl[cidx]; > fl->ifl_credits--; > @@ -2590,12 +2608,10 @@ rxd_frag_to_sd(iflib_rxq_t rxq, if_rxd_frag_t = irf, int > next =3D (cidx + CACHE_PTR_INCREMENT) & (fl->ifl_size-1); > prefetch(&fl->ifl_sds.ifsd_map[next]); > map =3D fl->ifl_sds.ifsd_map[cidx]; > - next =3D (cidx + CACHE_LINE_SIZE) & (fl->ifl_size-1); >=20 > - /* not valid assert if bxe really does SGE from non-contiguous = elements */ > - MPASS(fl->ifl_cidx =3D=3D cidx); > bus_dmamap_sync(fl->ifl_buf_tag, map, BUS_DMASYNC_POSTREAD); > - if (unload) > + > + if (unload && irf->irf_len !=3D 0) > bus_dmamap_unload(fl->ifl_buf_tag, map); > fl->ifl_cidx =3D (fl->ifl_cidx + 1) & (fl->ifl_size-1); > if (__predict_false(fl->ifl_cidx =3D=3D 0)) > @@ -2667,6 +2683,7 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t = ri) >=20 > /* should I merge this back in now that the two paths are = basically duplicated? */ > if (ri->iri_nfrags =3D=3D 1 && > + ri->iri_frags[0].irf_len !=3D 0 && > ri->iri_frags[0].irf_len <=3D MIN(IFLIB_RX_COPY_THRESH, = MHLEN)) { > rxd_frag_to_sd(rxq, &ri->iri_frags[0], FALSE, &sd); > m =3D *sd.ifsd_m; > @@ -2680,6 +2697,8 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t = ri) > m->m_len =3D ri->iri_frags[0].irf_len; > } else { > m =3D assemble_segments(rxq, ri, &sd); > + if (m =3D=3D NULL) > + return (NULL); > } > m->m_pkthdr.len =3D ri->iri_len; > m->m_pkthdr.rcvif =3D ri->iri_ifp; > @@ -2780,7 +2799,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) > cidxp =3D &rxq->ifr_fl[0].ifl_cidx; > if ((avail =3D iflib_rxd_avail(ctx, rxq, *cidxp, budget)) =3D=3D = 0) { > for (i =3D 0, fl =3D &rxq->ifr_fl[0]; i < sctx->isc_nfl; = i++, fl++) > - retval |=3D __iflib_fl_refill_lt(ctx, fl, budget = + 8); > + retval |=3D __iflib_fl_refill_all(ctx, fl); > DBG_COUNTER_INC(rx_unavail); > return (retval); > } > @@ -2836,7 +2855,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) > } > /* make sure that we can refill faster than drain */ > for (i =3D 0, fl =3D &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, = fl++) > - retval |=3D __iflib_fl_refill_lt(ctx, fl, budget + 8); > + retval |=3D __iflib_fl_refill_all(ctx, fl); >=20 > lro_enabled =3D (if_getcapenable(ifp) & IFCAP_LRO); > if (lro_enabled) > @@ -6702,6 +6721,9 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) > SYSCTL_ADD_U16(ctx_list, fl_list, OID_AUTO, = "credits", > CTLFLAG_RD, > &fl->ifl_credits, 1, "credits = available"); > + SYSCTL_ADD_U16(ctx_list, fl_list, OID_AUTO, = "buf_size", > + CTLFLAG_RD, > + &fl->ifl_buf_size, 1, "buffer = size"); > #if MEMORY_LOGGING > SYSCTL_ADD_QUAD(ctx_list, fl_list, OID_AUTO, = "fl_m_enqueued", > CTLFLAG_RD, >=20 > Modified: stable/12/sys/net/iflib.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/12/sys/net/iflib.h Tue Aug 4 15:27:32 2020 = (r363843) > +++ stable/12/sys/net/iflib.h Tue Aug 4 15:48:12 2020 = (r363844) > @@ -221,6 +221,9 @@ typedef struct if_softc_ctx { > uint32_t isc_tx_qdepth; >=20 > iflib_intr_mode_t isc_intr; > + uint16_t isc_rxd_buf_size[8]; /* set at init time by driver, 0 > + means use iflib-calculated size > + based on isc_max_frame_size */ > uint16_t isc_max_frame_size; /* set at init time by driver */ > uint16_t isc_min_frame_size; /* set at init time by driver, only = used if > IFLIB_NEED_ETHER_PAD is set. */ > _______________________________________________ > 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" --- PGP Key : http://www.marcuscom.com/pgp.asc From owner-svn-src-all@freebsd.org Tue Aug 4 16:06:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 546DB378A65; Tue, 4 Aug 2020 16:06:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLflR1YVnz4XVj; Tue, 4 Aug 2020 16:06:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A13227E5D; Tue, 4 Aug 2020 16:06:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074G6wI0068480; Tue, 4 Aug 2020 16:06:58 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074G6wrr068478; Tue, 4 Aug 2020 16:06:58 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008041606.074G6wrr068478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 4 Aug 2020 16:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363845 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 363845 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 16:06:59 -0000 Author: markj Date: Tue Aug 4 16:06:58 2020 New Revision: 363845 URL: https://svnweb.freebsd.org/changeset/base/363845 Log: MFC r362962, r362963: iflib: Fix handling of mbuf cluster allocation failures. Modified: stable/12/sys/net/iflib.c stable/12/sys/net/iflib.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Tue Aug 4 15:48:12 2020 (r363844) +++ stable/12/sys/net/iflib.c Tue Aug 4 16:06:58 2020 (r363845) @@ -207,8 +207,6 @@ struct iflib_ctx { #define isc_rxd_pkt_get ifc_txrx.ift_rxd_pkt_get #define isc_rxd_refill ifc_txrx.ift_rxd_refill #define isc_rxd_flush ifc_txrx.ift_rxd_flush -#define isc_rxd_refill ifc_txrx.ift_rxd_refill -#define isc_rxd_refill ifc_txrx.ift_rxd_refill #define isc_legacy_intr ifc_txrx.ift_legacy_intr eventhandler_tag ifc_vlan_attach_event; eventhandler_tag ifc_vlan_detach_event; @@ -394,8 +392,7 @@ struct iflib_fl { bus_dma_tag_t ifl_buf_tag; iflib_dma_info_t ifl_ifdi; uint64_t ifl_bus_addrs[IFLIB_MAX_RX_REFRESH] __aligned(CACHE_LINE_SIZE); - caddr_t ifl_vm_addrs[IFLIB_MAX_RX_REFRESH]; - qidx_t ifl_rxd_idxs[IFLIB_MAX_RX_REFRESH]; + qidx_t ifl_rxd_idxs[IFLIB_MAX_RX_REFRESH]; } __aligned(CACHE_LINE_SIZE); static inline qidx_t @@ -859,7 +856,6 @@ netmap_fl_refill(iflib_rxq_t rxq, struct netmap_kring if (addr == NETMAP_BUF_BASE(na)) /* bad buf */ return netmap_ring_reinit(kring); - fl->ifl_vm_addrs[tmp_pidx] = addr; if (__predict_false(init)) { netmap_load_map(na, fl->ifl_buf_tag, map[nic_i], addr); @@ -1333,7 +1329,6 @@ iru_init(if_rxd_update_t iru, iflib_rxq_t rxq, uint8_t fl = &rxq->ifr_fl[flid]; iru->iru_paddrs = fl->ifl_bus_addrs; - iru->iru_vaddrs = &fl->ifl_vm_addrs[0]; iru->iru_idxs = fl->ifl_rxd_idxs; iru->iru_qsidx = rxq->ifr_id; iru->iru_buf_size = fl->ifl_buf_size; @@ -1987,7 +1982,7 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int } /** - * _iflib_fl_refill - refill an rxq free-buffer list + * iflib_fl_refill - refill an rxq free-buffer list * @ctx: the iflib context * @fl: the free list to refill * @count: the number of new buffers to allocate @@ -1996,7 +1991,7 @@ _rxq_refill_cb(void *arg, bus_dma_segment_t *segs, int * The caller must assure that @count does not exceed the queue's capacity. */ static uint8_t -_iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) +iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int count) { struct if_rxd_update iru; struct rxq_refill_cb_arg cb_arg; @@ -2033,12 +2028,13 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun if (n > 8) DBG_COUNTER_INC(fl_refills_large); iru_init(&iru, fl->ifl_rxq, fl->ifl_id); - while (n--) { + while (n-- > 0) { /* * We allocate an uninitialized mbuf + cluster, mbuf is * initialized after rx. * - * If the cluster is still set then we know a minimum sized packet was received + * If the cluster is still set then we know a minimum sized + * packet was received */ bit_ffc_at(fl->ifl_rx_bitmap, frag_idx, fl->ifl_size, &frag_idx); @@ -2046,7 +2042,8 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun bit_ffc(fl->ifl_rx_bitmap, fl->ifl_size, &frag_idx); MPASS(frag_idx >= 0); if ((cl = sd_cl[frag_idx]) == NULL) { - if ((cl = m_cljget(NULL, M_NOWAIT, fl->ifl_buf_size)) == NULL) + cl = uma_zalloc(fl->ifl_zone, M_NOWAIT); + if (__predict_false(cl == NULL)) break; cb_arg.error = 0; @@ -2054,16 +2051,12 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun err = bus_dmamap_load(fl->ifl_buf_tag, sd_map[frag_idx], cl, fl->ifl_buf_size, _rxq_refill_cb, &cb_arg, BUS_DMA_NOWAIT); - if (err != 0 || cb_arg.error) { - /* - * !zone_pack ? - */ - if (fl->ifl_zone == zone_pack) - uma_zfree(fl->ifl_zone, cl); + if (__predict_false(err != 0 || cb_arg.error)) { + uma_zfree(fl->ifl_zone, cl); break; } - sd_ba[frag_idx] = bus_addr = cb_arg.seg.ds_addr; + sd_ba[frag_idx] = bus_addr = cb_arg.seg.ds_addr; sd_cl[frag_idx] = cl; #if MEMORY_LOGGING fl->ifl_cl_enqueued++; @@ -2075,9 +2068,9 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun BUS_DMASYNC_PREREAD); MPASS(sd_m[frag_idx] == NULL); - if ((m = m_gethdr(M_NOWAIT, MT_NOINIT)) == NULL) { + m = m_gethdr(M_NOWAIT, MT_NOINIT); + if (__predict_false(m == NULL)) break; - } sd_m[frag_idx] = m; bit_set(fl->ifl_rx_bitmap, frag_idx); #if MEMORY_LOGGING @@ -2087,50 +2080,58 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun DBG_COUNTER_INC(rx_allocs); fl->ifl_rxd_idxs[i] = frag_idx; fl->ifl_bus_addrs[i] = bus_addr; - fl->ifl_vm_addrs[i] = cl; credits++; i++; MPASS(credits <= fl->ifl_size); if (++idx == fl->ifl_size) { +#ifdef INVARIANTS fl->ifl_gen = 1; +#endif idx = 0; } if (n == 0 || i == IFLIB_MAX_RX_REFRESH) { iru.iru_pidx = pidx; iru.iru_count = i; ctx->isc_rxd_refill(ctx->ifc_softc, &iru); - i = 0; - pidx = idx; fl->ifl_pidx = idx; fl->ifl_credits = credits; + pidx = idx; + i = 0; } } - if (i) { - iru.iru_pidx = pidx; - iru.iru_count = i; - ctx->isc_rxd_refill(ctx->ifc_softc, &iru); - fl->ifl_pidx = idx; - fl->ifl_credits = credits; + if (n < count - 1) { + if (i != 0) { + iru.iru_pidx = pidx; + iru.iru_count = i; + ctx->isc_rxd_refill(ctx->ifc_softc, &iru); + fl->ifl_pidx = idx; + fl->ifl_credits = credits; + } + DBG_COUNTER_INC(rxd_flush); + if (fl->ifl_pidx == 0) + pidx = fl->ifl_size - 1; + else + pidx = fl->ifl_pidx - 1; + + bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + ctx->isc_rxd_flush(ctx->ifc_softc, fl->ifl_rxq->ifr_id, + fl->ifl_id, pidx); + if (__predict_true(bit_test(fl->ifl_rx_bitmap, frag_idx))) { + fl->ifl_fragidx = frag_idx + 1; + if (fl->ifl_fragidx == fl->ifl_size) + fl->ifl_fragidx = 0; + } else { + fl->ifl_fragidx = frag_idx; + } } - DBG_COUNTER_INC(rxd_flush); - if (fl->ifl_pidx == 0) - pidx = fl->ifl_size - 1; - else - pidx = fl->ifl_pidx - 1; - bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map, - BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); - ctx->isc_rxd_flush(ctx->ifc_softc, fl->ifl_rxq->ifr_id, fl->ifl_id, pidx); - fl->ifl_fragidx = frag_idx + 1; - if (fl->ifl_fragidx == fl->ifl_size) - fl->ifl_fragidx = 0; - return (n == -1 ? 0 : IFLIB_RXEOF_EMPTY); } -static __inline uint8_t -__iflib_fl_refill_all(if_ctx_t ctx, iflib_fl_t fl) +static inline uint8_t +iflib_fl_refill_all(if_ctx_t ctx, iflib_fl_t fl) { /* we avoid allowing pidx to catch up with cidx as it confuses ixl */ int32_t reclaimable = fl->ifl_size - fl->ifl_credits - 1; @@ -2142,7 +2143,7 @@ __iflib_fl_refill_all(if_ctx_t ctx, iflib_fl_t fl) MPASS(reclaimable == delta); if (reclaimable > 0) - return (_iflib_fl_refill(ctx, fl, reclaimable)); + return (iflib_fl_refill(ctx, fl, reclaimable)); return (0); } @@ -2173,22 +2174,20 @@ iflib_fl_bufs_free(iflib_fl_t fl) bus_dmamap_sync(fl->ifl_buf_tag, sd_map, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(fl->ifl_buf_tag, sd_map); - if (*sd_cl != NULL) - uma_zfree(fl->ifl_zone, *sd_cl); + uma_zfree(fl->ifl_zone, *sd_cl); + *sd_cl = NULL; if (*sd_m != NULL) { m_init(*sd_m, M_NOWAIT, MT_DATA, 0); uma_zfree(zone_mbuf, *sd_m); + *sd_m = NULL; } } else { - MPASS(*sd_cl == NULL); MPASS(*sd_m == NULL); } #if MEMORY_LOGGING fl->ifl_m_dequeued++; fl->ifl_cl_dequeued++; #endif - *sd_cl = NULL; - *sd_m = NULL; } #ifdef INVARIANTS for (i = 0; i < fl->ifl_size; i++) { @@ -2242,7 +2241,7 @@ iflib_fl_setup(iflib_fl_t fl) /* avoid pre-allocating zillions of clusters to an idle card * potentially speeding up attach */ - (void) _iflib_fl_refill(ctx, fl, min(128, fl->ifl_size)); + (void)iflib_fl_refill(ctx, fl, min(128, fl->ifl_size)); MPASS(min(128, fl->ifl_size) == fl->ifl_credits); if (min(128, fl->ifl_size) != fl->ifl_credits) return (ENOBUFS); @@ -2799,7 +2798,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) cidxp = &rxq->ifr_fl[0].ifl_cidx; if ((avail = iflib_rxd_avail(ctx, rxq, *cidxp, budget)) == 0) { for (i = 0, fl = &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, fl++) - retval |= __iflib_fl_refill_all(ctx, fl); + retval |= iflib_fl_refill_all(ctx, fl); DBG_COUNTER_INC(rx_unavail); return (retval); } @@ -2855,7 +2854,7 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) } /* make sure that we can refill faster than drain */ for (i = 0, fl = &rxq->ifr_fl[0]; i < sctx->isc_nfl; i++, fl++) - retval |= __iflib_fl_refill_all(ctx, fl); + retval |= iflib_fl_refill_all(ctx, fl); lro_enabled = (if_getcapenable(ifp) & IFCAP_LRO); if (lro_enabled) Modified: stable/12/sys/net/iflib.h ============================================================================== --- stable/12/sys/net/iflib.h Tue Aug 4 15:48:12 2020 (r363844) +++ stable/12/sys/net/iflib.h Tue Aug 4 16:06:58 2020 (r363845) @@ -95,7 +95,6 @@ typedef struct if_rxd_info { typedef struct if_rxd_update { uint64_t *iru_paddrs; - caddr_t *iru_vaddrs; qidx_t *iru_idxs; qidx_t iru_pidx; uint16_t iru_qsidx; From owner-svn-src-all@freebsd.org Tue Aug 4 18:11:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DBDA37B754; Tue, 4 Aug 2020 18:11:06 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0b-0010f301.pphosted.com (mx0b-0010f301.pphosted.com [148.163.153.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "Thawte RSA CA 2018" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjVd1QtNz4fkD; Tue, 4 Aug 2020 18:11:04 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102858.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 074HnfEN020473; Tue, 4 Aug 2020 13:11:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=r96/fbvc7txA5O/RlVDmOUs2K8dguw/4wF4NJKm3594=; b=KIXcxu3K1gA7HtimYvix2weDYMFqzdPrua+APywB7nqXlDq8i93e9LkmZbsREdIVAb7W d44MMJ5ElFcve9UO7oZ9jbaYmYFLi/Fvj1ZcHnnUhATWm9f5pVBV7M2q/oYlyh858mXl bauNRqjik6ZHZDtJKSQqccCey30CtNjCw2C9nzQEf04H/+QuasKa17lAvPrsFc9dyHcj UAJ6uTY+nZyEZ5EVpv8RaOo7DFun/uhns3mbfXWC270ESDJrWmJFFE5sgi7PUSaTqgWh +NWa5DBJry2hU/U7m3uH7u2u4L/cJE+WAn+iyVlyC2Euzh/9d3iXR+os/Dp3Y0KdiCad iA== Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx0b-0010f301.pphosted.com with ESMTP id 32n60ckh3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Aug 2020 13:11:03 -0500 Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 1C1EE460B9F; Tue, 4 Aug 2020 13:11:03 -0500 (CDT) Received-X: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 1AA5346099D; Tue, 4 Aug 2020 13:11:03 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received-X: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id WbdwhqVRf7zr; Tue, 4 Aug 2020 13:11:03 -0500 (CDT) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id C189D46067B; Tue, 4 Aug 2020 13:11:02 -0500 (CDT) Subject: Re: svn commit: r363842 - head/sys/compat/linuxkpi/common/include/linux To: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008041525.074FPNLh043749@repo.freebsd.org> From: Alan Cox Message-ID: <1c90911b-d5f6-f8b1-8f4d-97a88fa028bd@rice.edu> Date: Tue, 4 Aug 2020 13:11:02 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <202008041525.074FPNLh043749@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-08-04_04:2020-08-03, 2020-08-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 clxscore=1011 mlxscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=684 impostorscore=0 adultscore=0 malwarescore=0 bulkscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008040131 X-Rspamd-Queue-Id: 4BLjVd1QtNz4fkD X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=rice.edu header.s=ricemail header.b=KIXcxu3K; dmarc=pass (policy=none) header.from=rice.edu; spf=pass (mx1.freebsd.org: domain of alc@rice.edu designates 148.163.153.244 as permitted sender) smtp.mailfrom=alc@rice.edu X-Spamd-Result: default: False [-5.22 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[rice.edu:s=ricemail]; NEURAL_HAM_MEDIUM(-1.00)[-1.005]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+a:a32.spf.rice.edu]; NEURAL_HAM_LONG(-0.98)[-0.983]; DWL_DNSWL_LOW(-1.00)[rice.edu:dkim]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[rice.edu:+]; DMARC_POLICY_ALLOW(-0.50)[rice.edu,none]; NEURAL_HAM_SHORT(-1.14)[-1.135]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22843, ipnet:148.163.152.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[148.163.153.244:from] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 18:11:06 -0000 On 8/4/20 10:25 AM, Emmanuel Vadot wrote: > Author: manu > Date: Tue Aug 4 15:25:22 2020 > New Revision: 363842 > URL: https://svnweb.freebsd.org/changeset/base/363842 > > Log: > linuxkpi: Add clear_bit_unlock > > This calls clear_bit and adds a memory barrier. > > Sponsored by: The FreeBSD Foundation > > Reviewed by: hselasky > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D25943 > > Modified: > head/sys/compat/linuxkpi/common/include/linux/bitops.h > > Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h > ============================================================================== > --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 15:00:02 2020 (r363841) > +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 15:25:22 2020 (r363842) > @@ -275,6 +275,13 @@ find_next_zero_bit(const unsigned long *addr, unsigned > #define test_bit(i, a) \ > !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) > > +static inline void > +clear_bit_unlock(long bit, volatile unsigned long *var) > +{ > + clear_bit(bit, var); > + wmb(); For an unlock operation, the memory barrier should come before the clear_bit() call, not after.  See, for example, the alpha implementation in Linux.  Also, the correct "spelling" for this memory barrier in FreeBSD would be atomic_thread_fence_rel(). See, for example, the comment at the top of sys/amd64/include/atomic.h. > +} > + > static inline int > test_and_clear_bit(long bit, volatile unsigned long *var) > { From owner-svn-src-all@freebsd.org Tue Aug 4 18:19:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7ABCA37B870; Tue, 4 Aug 2020 18:19:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjhL2fwhz3RNG; Tue, 4 Aug 2020 18:19:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 39A3C95B3; Tue, 4 Aug 2020 18:19:30 +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 074IJUSf047942; Tue, 4 Aug 2020 18:19:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074IJU23047941; Tue, 4 Aug 2020 18:19:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008041819.074IJU23047941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Aug 2020 18:19:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363846 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 363846 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 18:19:30 -0000 Author: jhb Date: Tue Aug 4 18:19:29 2020 New Revision: 363846 URL: https://svnweb.freebsd.org/changeset/base/363846 Log: Turn off errors for -Wmaybe-uninitialized in GCC 6+. Recent changes to trigger this warning and seem like a false positive. Differential Revision: https://reviews.freebsd.org/D25726 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Aug 4 16:06:58 2020 (r363845) +++ head/share/mk/bsd.sys.mk Tue Aug 4 18:19:29 2020 (r363846) @@ -150,7 +150,8 @@ CWARNFLAGS+= -Wno-error=address \ # GCC 6.1.0 .if ${COMPILER_VERSION} >= 60100 -CWARNFLAGS+= -Wno-error=nonnull-compare \ +CWARNFLAGS+= -Wno-error=maybe-uninitialized \ + -Wno-error=nonnull-compare \ -Wno-error=shift-negative-value \ -Wno-error=tautological-compare \ -Wno-error=unused-const-variable From owner-svn-src-all@freebsd.org Tue Aug 4 18:20:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F237E37B94D; Tue, 4 Aug 2020 18:20:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjjg6C4cz3RTH; Tue, 4 Aug 2020 18:20:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B866496E2; Tue, 4 Aug 2020 18:20:39 +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 074IKdAw050400; Tue, 4 Aug 2020 18:20:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074IKdOE050399; Tue, 4 Aug 2020 18:20:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008041820.074IKdOE050399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Aug 2020 18:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363847 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 363847 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 18:20:40 -0000 Author: jhb Date: Tue Aug 4 18:20:39 2020 New Revision: 363847 URL: https://svnweb.freebsd.org/changeset/base/363847 Log: Disable errors for -Wredundant-decls for GCC 6+. GCC triggers warnings for this that clang does not for duplicate declarations of yylex(). Differential Revision: https://reviews.freebsd.org/D25727 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Aug 4 18:19:29 2020 (r363846) +++ head/share/mk/bsd.sys.mk Tue Aug 4 18:20:39 2020 (r363847) @@ -152,6 +152,7 @@ CWARNFLAGS+= -Wno-error=address \ .if ${COMPILER_VERSION} >= 60100 CWARNFLAGS+= -Wno-error=maybe-uninitialized \ -Wno-error=nonnull-compare \ + -Wno-error=redundant-decls \ -Wno-error=shift-negative-value \ -Wno-error=tautological-compare \ -Wno-error=unused-const-variable From owner-svn-src-all@freebsd.org Tue Aug 4 18:23:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C8DB37B7D7; Tue, 4 Aug 2020 18:23:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjn13fHVz3RwN; Tue, 4 Aug 2020 18:23:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61C9196F6; Tue, 4 Aug 2020 18:23:33 +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 074INXxc054019; Tue, 4 Aug 2020 18:23:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074INXHM054018; Tue, 4 Aug 2020 18:23:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008041823.074INXHM054018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Aug 2020 18:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363848 - head/lib/csu/mips X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/lib/csu/mips X-SVN-Commit-Revision: 363848 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 18:23:33 -0000 Author: jhb Date: Tue Aug 4 18:23:32 2020 New Revision: 363848 URL: https://svnweb.freebsd.org/changeset/base/363848 Log: ld.bfd requires an explicit emulation for MIPS for ld -r. Unlike lld, ld.bfd doesn't infer the emulation from the first object file, but assumes its compiled in default for ld -r. Differential Revision: https://reviews.freebsd.org/D25728 Modified: head/lib/csu/mips/Makefile Modified: head/lib/csu/mips/Makefile ============================================================================== --- head/lib/csu/mips/Makefile Tue Aug 4 18:20:39 2020 (r363847) +++ head/lib/csu/mips/Makefile Tue Aug 4 18:23:32 2020 (r363848) @@ -2,6 +2,27 @@ .PATH: ${.CURDIR:H}/common +.include + CFLAGS+= -DCRT_IRELOC_SUPPRESS + +.if ${MACHINE_ARCH:Mmips64} +ELFCLASS= 64 +.else +ELFCLASS= 32 +.endif +.if ${MACHINE_ARCH:Mmips*el} +ENDIAN= l +.else +ENDIAN= b +.endif +.if ${MACHINE_ARCH:Mmipsn32*} +SUFFIX= n32 +.else +SUFFIX= +.endif + +# binutils requires an explicit emulation for ld -r +LDFLAGS.bfd+= -Wl,-m -Wl,elf${ELFCLASS}${ENDIAN}tsmip${SUFFIX}_fbsd .include From owner-svn-src-all@freebsd.org Tue Aug 4 18:24:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1CD3137BF0E; Tue, 4 Aug 2020 18:24:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjpQ62mQz3S6G; Tue, 4 Aug 2020 18:24:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3E3999AA; Tue, 4 Aug 2020 18:24:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074IOkgn054129; Tue, 4 Aug 2020 18:24:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074IOkWS054128; Tue, 4 Aug 2020 18:24:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202008041824.074IOkWS054128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 4 Aug 2020 18:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363849 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 363849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 18:24:47 -0000 Author: jhb Date: Tue Aug 4 18:24:46 2020 New Revision: 363849 URL: https://svnweb.freebsd.org/changeset/base/363849 Log: Disable errors for -Wsystem-headers for GCC on aarch64. GCC's own arm_neon.h triggers multiple warnings on both GCC 6 and GCC 9. Differential Revision: https://reviews.freebsd.org/D25729 Modified: head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Aug 4 18:23:32 2020 (r363848) +++ head/share/mk/bsd.sys.mk Tue Aug 4 18:24:46 2020 (r363849) @@ -184,6 +184,11 @@ CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations -Wno-error=sizeof-pointer-memaccess \ -Wno-error=stringop-truncation .endif + +# GCC's own arm_neon.h triggers various warnings +.if ${MACHINE_ARCH} == "aarch64" +CWARNFLAGS+= -Wno-system-headers +.endif .endif # gcc # How to handle FreeBSD custom printf format specifiers. From owner-svn-src-all@freebsd.org Tue Aug 4 18:25:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EFF937C017; Tue, 4 Aug 2020 18:25:51 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mx.blih.net (mx.blih.net [212.83.155.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx.blih.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjqd5z0fz3SGh; Tue, 4 Aug 2020 18:25:49 +0000 (UTC) (envelope-from manu@bidouilliste.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bidouilliste.com; s=mx; t=1596565541; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ds1YB/MuO1zBd8vtCqHp6X9LDxGQCsV7+OMeavWI0q8=; b=pV2IFv7A/q9LV26l1Bt+9SpVlhBiqMXCQIaojrEwuFyjb9G52d3WUiHlkm4HLDkq9GwMHA tC5kQb9GR0ZgAThDub+b5LXgoUSEFIzz7hul6hA8BH6FEUko6xmJY1+ycF6COeNVka5/x2 mMfFam/spyrOr79gYrSQg3NGOiqgnCc= Received: from skull.home.blih.net (lfbn-idf2-1-1138-237.w90-92.abo.wanadoo.fr [90.92.20.237]) by mx.blih.net (OpenSMTPD) with ESMTPSA id ef8f1af6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 4 Aug 2020 18:25:41 +0000 (UTC) Date: Tue, 4 Aug 2020 20:25:41 +0200 From: Emmanuel Vadot To: Alan Cox Cc: Emmanuel Vadot , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363842 - head/sys/compat/linuxkpi/common/include/linux Message-Id: <20200804202541.0b6b3eb6ce26522ee12a796c@bidouilliste.com> In-Reply-To: <1c90911b-d5f6-f8b1-8f4d-97a88fa028bd@rice.edu> References: <202008041525.074FPNLh043749@repo.freebsd.org> <1c90911b-d5f6-f8b1-8f4d-97a88fa028bd@rice.edu> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4BLjqd5z0fz3SGh X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bidouilliste.com header.s=mx header.b=pV2IFv7A; dmarc=pass (policy=none) header.from=bidouilliste.com; spf=pass (mx1.freebsd.org: domain of manu@bidouilliste.com designates 212.83.155.74 as permitted sender) smtp.mailfrom=manu@bidouilliste.com X-Spamd-Result: default: False [-3.05 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[bidouilliste.com:s=mx]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.02)[-1.024]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bidouilliste.com:+]; DMARC_POLICY_ALLOW(-0.50)[bidouilliste.com,none]; NEURAL_HAM_SHORT(-0.50)[-0.497]; NEURAL_HAM_MEDIUM(-1.02)[-1.023]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:12876, ipnet:212.83.128.0/19, country:FR]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 18:25:51 -0000 On Tue, 4 Aug 2020 13:11:02 -0500 Alan Cox wrote: >=20 > On 8/4/20 10:25 AM, Emmanuel Vadot wrote: > > Author: manu > > Date: Tue Aug 4 15:25:22 2020 > > New Revision: 363842 > > URL: https://svnweb.freebsd.org/changeset/base/363842 > > > > Log: > > linuxkpi: Add clear_bit_unlock > > =20 > > This calls clear_bit and adds a memory barrier. > > =20 > > Sponsored by: The FreeBSD Foundation > > =20 > > Reviewed by: hselasky > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D25943 > > > > Modified: > > head/sys/compat/linuxkpi/common/include/linux/bitops.h > > > > Modified: head/sys/compat/linuxkpi/common/include/linux/bitops.h > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 1= 5:00:02 2020 (r363841) > > +++ head/sys/compat/linuxkpi/common/include/linux/bitops.h Tue Aug 4 1= 5:25:22 2020 (r363842) > > @@ -275,6 +275,13 @@ find_next_zero_bit(const unsigned long *addr, unsi= gned > > #define test_bit(i, a) \ > > !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) = & BIT_MASK(i)) > > =20 > > +static inline void > > +clear_bit_unlock(long bit, volatile unsigned long *var) > > +{ > > + clear_bit(bit, var); > > + wmb(); >=20 >=20 > For an unlock operation, the memory barrier should come before the=20 > clear_bit() call, not after.=A0 See, for example, the alpha implementatio= n=20 > in Linux.=A0 Also, the correct "spelling" for this memory barrier in=20 > FreeBSD would be atomic_thread_fence_rel(). See, for example, the=20 > comment at the top of sys/amd64/include/atomic.h. Ah yes, thanks. I probably got lost looking for the linux implem but that does make sense, I'll fix that probably tomorow. Thanks. >=20 > > +} > > + > > static inline int > > test_and_clear_bit(long bit, volatile unsigned long *var) > > { --=20 Emmanuel Vadot From owner-svn-src-all@freebsd.org Tue Aug 4 18:30:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A02A37BEF7; Tue, 4 Aug 2020 18:30:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLjwm731kz3ShT; Tue, 4 Aug 2020 18:30:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8203:2990:f048:ff6b:240e:4c18]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 2C83916647; Tue, 4 Aug 2020 18:30:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r363849 - head/share/mk From: John Baldwin To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008041824.074IOkWS054128@repo.freebsd.org> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <33146746-fc65-8eea-7235-2677e38d282d@FreeBSD.org> Date: Tue, 4 Aug 2020 11:30:14 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202008041824.074IOkWS054128@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 18:30:17 -0000 On 8/4/20 11:24 AM, John Baldwin wrote: > Author: jhb > Date: Tue Aug 4 18:24:46 2020 > New Revision: 363849 > URL: https://svnweb.freebsd.org/changeset/base/363849 > > Log: > Disable errors for -Wsystem-headers for GCC on aarch64. > > GCC's own arm_neon.h triggers multiple warnings on both GCC 6 and > GCC 9. > > Differential Revision: https://reviews.freebsd.org/D25729 This (and the previous fixes) was found by a knob I have in review to switch 'make tinderbox' to using GCC toolchains when possible. It lets you do 'make tinderbox USE_GCC_TOOLCHAINS=yes' and it uses GCC instead of LLVM for architectures with a GCC package. The current patch in review at the URL below uses GCC 6 packages. I have a WIP branch to move to GCC9 which adds riscv and 32-bit powerpc leaving 32-bit arm as the only architecture without a GCC toolchain. https://reviews.freebsd.org/D25732 -- John Baldwin From owner-svn-src-all@freebsd.org Tue Aug 4 19:05:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5B0037CB83; Tue, 4 Aug 2020 19:05:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLkjr50rhz3V1S; Tue, 4 Aug 2020 19:05:52 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D8FEA028; Tue, 4 Aug 2020 19:05:52 +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 074J5qmP078771; Tue, 4 Aug 2020 19:05:52 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074J5knX078741; Tue, 4 Aug 2020 19:05:46 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041905.074J5knX078741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 19:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363850 - in vendor/device-tree/dist: Bindings Bindings/arm Bindings/arm/amlogic Bindings/arm/calxeda Bindings/arm/freescale Bindings/arm/mediatek Bindings/arm/nxp Bindings/arm/samsung ... X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in vendor/device-tree/dist: Bindings Bindings/arm Bindings/arm/amlogic Bindings/arm/calxeda Bindings/arm/freescale Bindings/arm/mediatek Bindings/arm/nxp Bindings/arm/samsung Bindings/arm/socionext Bi... X-SVN-Commit-Revision: 363850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:05:52 -0000 Author: manu Date: Tue Aug 4 19:05:45 2020 New Revision: 363850 URL: https://svnweb.freebsd.org/changeset/base/363850 Log: Import DTS from Linux 5.8 Added: vendor/device-tree/dist/Bindings/ABI.rst vendor/device-tree/dist/Bindings/arm/calxeda/hb-sregs.yaml vendor/device-tree/dist/Bindings/arm/calxeda/l2ecc.yaml vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mipi0a.txt (contents, props changed) vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pericfg.yaml vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vcodecsys.txt (contents, props changed) vendor/device-tree/dist/Bindings/ata/sata_highbank.yaml vendor/device-tree/dist/Bindings/auxdisplay/hit,hd44780.yaml vendor/device-tree/dist/Bindings/bus/arm,integrator-ap-lm.yaml vendor/device-tree/dist/Bindings/bus/baikal,bt1-apb.yaml vendor/device-tree/dist/Bindings/bus/baikal,bt1-axi.yaml vendor/device-tree/dist/Bindings/clock/baikal,bt1-ccu-div.yaml vendor/device-tree/dist/Bindings/clock/baikal,bt1-ccu-pll.yaml vendor/device-tree/dist/Bindings/clock/calxeda.yaml vendor/device-tree/dist/Bindings/clock/cirrus,lochnagar.yaml vendor/device-tree/dist/Bindings/clock/imx1-clock.yaml vendor/device-tree/dist/Bindings/clock/imx21-clock.yaml vendor/device-tree/dist/Bindings/clock/imx23-clock.yaml vendor/device-tree/dist/Bindings/clock/imx25-clock.yaml vendor/device-tree/dist/Bindings/clock/imx27-clock.yaml vendor/device-tree/dist/Bindings/clock/imx28-clock.yaml vendor/device-tree/dist/Bindings/clock/imx31-clock.yaml vendor/device-tree/dist/Bindings/clock/imx35-clock.yaml vendor/device-tree/dist/Bindings/clock/imx5-clock.yaml vendor/device-tree/dist/Bindings/clock/imx6q-clock.yaml vendor/device-tree/dist/Bindings/clock/imx6sl-clock.yaml vendor/device-tree/dist/Bindings/clock/imx6sll-clock.yaml vendor/device-tree/dist/Bindings/clock/imx6sx-clock.yaml vendor/device-tree/dist/Bindings/clock/imx6ul-clock.yaml vendor/device-tree/dist/Bindings/clock/imx7d-clock.yaml vendor/device-tree/dist/Bindings/clock/imx8qxp-lpcg.yaml vendor/device-tree/dist/Bindings/clock/ingenic,cgu.yaml vendor/device-tree/dist/Bindings/clock/intel,agilex.yaml vendor/device-tree/dist/Bindings/clock/intel,cgu-lgm.yaml vendor/device-tree/dist/Bindings/clock/marvell,mmp2-audio-clock.yaml vendor/device-tree/dist/Bindings/clock/qcom,a53pll.yaml vendor/device-tree/dist/Bindings/clock/renesas,cpg-div6-clock.yaml vendor/device-tree/dist/Bindings/clock/renesas,cpg-mstp-clocks.yaml vendor/device-tree/dist/Bindings/cpufreq/nvidia,tegra20-cpufreq.txt (contents, props changed) vendor/device-tree/dist/Bindings/display/bridge/analogix,anx7814.yaml vendor/device-tree/dist/Bindings/display/bridge/chrontel,ch7033.yaml vendor/device-tree/dist/Bindings/display/bridge/ite,it6505.yaml vendor/device-tree/dist/Bindings/display/bridge/nwl-dsi.yaml vendor/device-tree/dist/Bindings/display/bridge/simple-bridge.yaml vendor/device-tree/dist/Bindings/display/bridge/snps,dw-mipi-dsi.yaml vendor/device-tree/dist/Bindings/display/bridge/thine,thc63lvd1024.yaml vendor/device-tree/dist/Bindings/display/panel/arm,versatile-tft-panel.yaml vendor/device-tree/dist/Bindings/display/panel/asus,z00t-tm5p5-nt35596.yaml vendor/device-tree/dist/Bindings/display/panel/boe,himax8279d.yaml vendor/device-tree/dist/Bindings/display/panel/feiyang,fy07024di26a30d.yaml vendor/device-tree/dist/Bindings/display/panel/ilitek,ili9322.yaml vendor/device-tree/dist/Bindings/display/panel/ilitek,ili9881c.yaml vendor/device-tree/dist/Bindings/display/panel/innolux,p097pfg.yaml vendor/device-tree/dist/Bindings/display/panel/innolux,p120zdg-bf1.yaml vendor/device-tree/dist/Bindings/display/panel/jdi,lt070me05000.yaml vendor/device-tree/dist/Bindings/display/panel/kingdisplay,kd035g6-54nt.yaml vendor/device-tree/dist/Bindings/display/panel/leadtek,ltk050h3146w.yaml vendor/device-tree/dist/Bindings/display/panel/lg,lg4573.yaml vendor/device-tree/dist/Bindings/display/panel/lgphilips,lb035q02.yaml vendor/device-tree/dist/Bindings/display/panel/olimex,lcd-olinuxino.yaml vendor/device-tree/dist/Bindings/display/panel/raydium,rm67191.yaml vendor/device-tree/dist/Bindings/display/panel/samsung,amoled-mipi-dsi.yaml vendor/device-tree/dist/Bindings/display/panel/samsung,ld9040.yaml vendor/device-tree/dist/Bindings/display/panel/samsung,s6d16d0.yaml vendor/device-tree/dist/Bindings/display/panel/samsung,s6e63m0.yaml vendor/device-tree/dist/Bindings/display/panel/seiko,43wvf1g.yaml vendor/device-tree/dist/Bindings/display/panel/sharp,lq150x1lg11.yaml vendor/device-tree/dist/Bindings/display/panel/sharp,ls037v7dw01.yaml vendor/device-tree/dist/Bindings/display/panel/sharp,ls043t1le01.yaml vendor/device-tree/dist/Bindings/display/panel/sitronix,st7701.yaml vendor/device-tree/dist/Bindings/display/panel/sitronix,st7789v.yaml vendor/device-tree/dist/Bindings/display/panel/sony,acx565akm.yaml vendor/device-tree/dist/Bindings/display/panel/startek,startek-kd050c.yaml vendor/device-tree/dist/Bindings/display/panel/tpo,td.yaml vendor/device-tree/dist/Bindings/display/panel/visionox,rm69299.yaml vendor/device-tree/dist/Bindings/display/rockchip/rockchip,rk3066-hdmi.yaml vendor/device-tree/dist/Bindings/display/rockchip/rockchip-vop.yaml vendor/device-tree/dist/Bindings/dma/ingenic,dma.yaml vendor/device-tree/dist/Bindings/dma/renesas,rcar-dmac.yaml vendor/device-tree/dist/Bindings/dma/renesas,usb-dmac.yaml vendor/device-tree/dist/Bindings/extcon/wlf,arizona.yaml vendor/device-tree/dist/Bindings/gpio/fsl-imx-gpio.yaml vendor/device-tree/dist/Bindings/gpio/gpio-mxs.yaml vendor/device-tree/dist/Bindings/gpio/renesas,em-gio.yaml vendor/device-tree/dist/Bindings/gpio/renesas,rcar-gpio.yaml vendor/device-tree/dist/Bindings/gpio/snps,dw-apb-gpio.yaml vendor/device-tree/dist/Bindings/hwmon/baikal,bt1-pvt.yaml vendor/device-tree/dist/Bindings/hwmon/cirrus,lochnagar.yaml vendor/device-tree/dist/Bindings/i2c/cdns,i2c-r1p10.yaml vendor/device-tree/dist/Bindings/i2c/i2c-qcom-cci.txt (contents, props changed) vendor/device-tree/dist/Bindings/i2c/ingenic,i2c.yaml vendor/device-tree/dist/Bindings/i2c/nuvoton,npcm7xx-i2c.yaml vendor/device-tree/dist/Bindings/i2c/snps,designware-i2c.yaml vendor/device-tree/dist/Bindings/i2c/xlnx,xps-iic-2.00.a.yaml vendor/device-tree/dist/Bindings/iio/adc/adi,ad9467.yaml vendor/device-tree/dist/Bindings/iio/adc/adi,axi-adc.yaml vendor/device-tree/dist/Bindings/iio/adc/maxim,max1241.yaml vendor/device-tree/dist/Bindings/iio/adc/rockchip-saradc.yaml vendor/device-tree/dist/Bindings/iio/chemical/ams,ccs811.yaml vendor/device-tree/dist/Bindings/iio/common.yaml vendor/device-tree/dist/Bindings/iio/dac/st,stm32-dac.yaml vendor/device-tree/dist/Bindings/iio/imu/adi,adis16475.yaml vendor/device-tree/dist/Bindings/iio/imu/bosch,bmi160.yaml vendor/device-tree/dist/Bindings/iio/light/amstaos,tsl2563.yaml vendor/device-tree/dist/Bindings/iio/light/vishay,vcnl4000.yaml vendor/device-tree/dist/Bindings/iio/proximity/vishay,vcnl3020.yaml vendor/device-tree/dist/Bindings/index.rst vendor/device-tree/dist/Bindings/input/gpio-keys.yaml vendor/device-tree/dist/Bindings/input/iqs269a.yaml vendor/device-tree/dist/Bindings/input/touchscreen/cypress,cy8ctma140.yaml vendor/device-tree/dist/Bindings/input/touchscreen/elan,elants_i2c.yaml vendor/device-tree/dist/Bindings/interconnect/fsl,imx8m-noc.yaml vendor/device-tree/dist/Bindings/interrupt-controller/fsl,irqsteer.yaml vendor/device-tree/dist/Bindings/interrupt-controller/ingenic,intc.yaml vendor/device-tree/dist/Bindings/interrupt-controller/loongson,htvec.yaml vendor/device-tree/dist/Bindings/interrupt-controller/loongson,pch-msi.yaml vendor/device-tree/dist/Bindings/interrupt-controller/loongson,pch-pic.yaml vendor/device-tree/dist/Bindings/interrupt-controller/renesas,intc-irqpin.yaml vendor/device-tree/dist/Bindings/iommu/allwinner,sun50i-h6-iommu.yaml vendor/device-tree/dist/Bindings/iommu/renesas,ipmmu-vmsa.yaml vendor/device-tree/dist/Bindings/ipmi/ipmi-smic.yaml vendor/device-tree/dist/Bindings/leds/backlight/qcom-wled.yaml vendor/device-tree/dist/Bindings/leds/leds-aw2013.yaml vendor/device-tree/dist/Bindings/leds/leds-sgm3140.yaml vendor/device-tree/dist/Bindings/mailbox/fsl,mu.yaml vendor/device-tree/dist/Bindings/mailbox/qcom,apcs-kpss-global.yaml vendor/device-tree/dist/Bindings/mailbox/qcom-ipcc.yaml vendor/device-tree/dist/Bindings/mailbox/sprd-mailbox.yaml vendor/device-tree/dist/Bindings/media/i2c/ov8856.yaml vendor/device-tree/dist/Bindings/media/marvell,mmp2-ccic.yaml vendor/device-tree/dist/Bindings/media/rockchip,vdec.yaml vendor/device-tree/dist/Bindings/media/rockchip-rga.yaml vendor/device-tree/dist/Bindings/media/rockchip-vpu.yaml vendor/device-tree/dist/Bindings/memory-controllers/baikal,bt1-l2-ctl.yaml vendor/device-tree/dist/Bindings/memory-controllers/calxeda-ddr-ctrlr.yaml vendor/device-tree/dist/Bindings/memory-controllers/ingenic,nemc.yaml vendor/device-tree/dist/Bindings/memory-controllers/nvidia,tegra210-emc.yaml vendor/device-tree/dist/Bindings/memory-controllers/renesas,dbsc.yaml vendor/device-tree/dist/Bindings/mfd/cirrus,lochnagar.yaml vendor/device-tree/dist/Bindings/mfd/cirrus,madera.yaml vendor/device-tree/dist/Bindings/mfd/gateworks-gsc.yaml vendor/device-tree/dist/Bindings/mfd/mps,mp2629.yaml vendor/device-tree/dist/Bindings/mfd/wlf,arizona.yaml vendor/device-tree/dist/Bindings/mips/loongson/rs780e-acpi.yaml vendor/device-tree/dist/Bindings/mmc/amlogic,meson-mx-sdhc.yaml vendor/device-tree/dist/Bindings/mmc/ingenic,mmc.yaml vendor/device-tree/dist/Bindings/mmc/sdhci-pxa.yaml vendor/device-tree/dist/Bindings/mtd/arasan,nand-controller.yaml vendor/device-tree/dist/Bindings/mtd/ingenic,nand.yaml vendor/device-tree/dist/Bindings/net/calxeda-xgmac.yaml vendor/device-tree/dist/Bindings/net/imx-dwmac.txt (contents, props changed) vendor/device-tree/dist/Bindings/net/mediatek,star-emac.yaml vendor/device-tree/dist/Bindings/net/nxp,tja11xx.yaml vendor/device-tree/dist/Bindings/net/qca,ar71xx.yaml vendor/device-tree/dist/Bindings/net/qcom,ipq4019-mdio.yaml vendor/device-tree/dist/Bindings/net/realtek-bluetooth.yaml vendor/device-tree/dist/Bindings/net/socionext,uniphier-ave4.yaml vendor/device-tree/dist/Bindings/net/stm32-dwmac.yaml vendor/device-tree/dist/Bindings/net/ti,dp83867.yaml vendor/device-tree/dist/Bindings/net/ti,k3-am654-cpts.yaml vendor/device-tree/dist/Bindings/nvmem/imx-iim.yaml vendor/device-tree/dist/Bindings/nvmem/imx-ocotp.yaml vendor/device-tree/dist/Bindings/nvmem/mxs-ocotp.yaml vendor/device-tree/dist/Bindings/nvmem/rockchip-efuse.yaml vendor/device-tree/dist/Bindings/pci/cdns-pcie-ep.yaml vendor/device-tree/dist/Bindings/pci/loongson.yaml vendor/device-tree/dist/Bindings/pci/rcar-pci-ep.yaml vendor/device-tree/dist/Bindings/pci/socionext,uniphier-pcie-ep.yaml vendor/device-tree/dist/Bindings/phy/amlogic,meson8b-usb2-phy.yaml vendor/device-tree/dist/Bindings/phy/calxeda-combophy.yaml vendor/device-tree/dist/Bindings/phy/cdns,salvo-phy.yaml vendor/device-tree/dist/Bindings/phy/intel,combo-phy.yaml vendor/device-tree/dist/Bindings/phy/qcom,qmp-phy.yaml vendor/device-tree/dist/Bindings/phy/qcom,qmp-usb3-dp-phy.yaml vendor/device-tree/dist/Bindings/phy/qcom,usb-snps-femto-v2.yaml vendor/device-tree/dist/Bindings/phy/qcom-usb-ipq4019-phy.yaml vendor/device-tree/dist/Bindings/phy/renesas,usb2-phy.yaml vendor/device-tree/dist/Bindings/phy/renesas,usb3-phy.yaml vendor/device-tree/dist/Bindings/phy/rockchip-mipi-dphy-rx0.yaml vendor/device-tree/dist/Bindings/phy/socionext,uniphier-pcie-phy.yaml vendor/device-tree/dist/Bindings/phy/socionext,uniphier-usb2-phy.yaml vendor/device-tree/dist/Bindings/phy/socionext,uniphier-usb3hs-phy.yaml vendor/device-tree/dist/Bindings/phy/socionext,uniphier-usb3ss-phy.yaml vendor/device-tree/dist/Bindings/pinctrl/cirrus,lochnagar.yaml vendor/device-tree/dist/Bindings/pinctrl/cirrus,madera.yaml vendor/device-tree/dist/Bindings/pinctrl/qcom,sm8250-pinctrl.yaml vendor/device-tree/dist/Bindings/power/fsl,imx-gpc.yaml vendor/device-tree/dist/Bindings/power/fsl,imx-gpcv2.yaml vendor/device-tree/dist/Bindings/power/reset/syscon-reboot-mode.yaml vendor/device-tree/dist/Bindings/power/supply/bq27xxx.yaml vendor/device-tree/dist/Bindings/power/supply/cw2015_battery.yaml vendor/device-tree/dist/Bindings/power/supply/power-supply.yaml vendor/device-tree/dist/Bindings/power/supply/rohm,bd99954.yaml vendor/device-tree/dist/Bindings/power/supply/sbs,sbs-battery.yaml vendor/device-tree/dist/Bindings/pwm/imx-pwm.yaml vendor/device-tree/dist/Bindings/pwm/imx-tpm-pwm.yaml vendor/device-tree/dist/Bindings/pwm/mxs-pwm.yaml vendor/device-tree/dist/Bindings/regulator/anatop-regulator.yaml vendor/device-tree/dist/Bindings/regulator/maxim,max77826.yaml vendor/device-tree/dist/Bindings/regulator/wlf,arizona.yaml vendor/device-tree/dist/Bindings/remoteproc/ingenic,vpu.yaml vendor/device-tree/dist/Bindings/rng/arm-cctrng.yaml vendor/device-tree/dist/Bindings/rtc/rtc-mxc.yaml vendor/device-tree/dist/Bindings/rtc/rtc-mxc_v2.yaml vendor/device-tree/dist/Bindings/serial/8250.yaml vendor/device-tree/dist/Bindings/serial/ingenic,uart.yaml vendor/device-tree/dist/Bindings/serial/qca,ar9330-uart.yaml vendor/device-tree/dist/Bindings/serial/renesas,em-uart.yaml vendor/device-tree/dist/Bindings/soc/qcom/qcom,geni-se.yaml vendor/device-tree/dist/Bindings/soc/ti/k3-socinfo.yaml vendor/device-tree/dist/Bindings/sound/cirrus,lochnagar.yaml vendor/device-tree/dist/Bindings/sound/cirrus,madera.yaml vendor/device-tree/dist/Bindings/sound/fsl,easrc.yaml vendor/device-tree/dist/Bindings/sound/marvell,mmp-sspa.yaml vendor/device-tree/dist/Bindings/sound/rt1016.txt (contents, props changed) vendor/device-tree/dist/Bindings/sound/simple-card.yaml vendor/device-tree/dist/Bindings/sound/wlf,arizona.yaml vendor/device-tree/dist/Bindings/sound/zl38060.yaml vendor/device-tree/dist/Bindings/spi/marvell,mmp2-ssp.yaml vendor/device-tree/dist/Bindings/spi/mikrotik,rb4xx-spi.yaml vendor/device-tree/dist/Bindings/spi/renesas,rspi.yaml vendor/device-tree/dist/Bindings/spi/snps,dw-apb-ssi.yaml vendor/device-tree/dist/Bindings/spi/socionext,uniphier-spi.yaml vendor/device-tree/dist/Bindings/submitting-patches.rst vendor/device-tree/dist/Bindings/thermal/imx-thermal.yaml vendor/device-tree/dist/Bindings/thermal/imx8mm-thermal.yaml vendor/device-tree/dist/Bindings/thermal/rcar-gen3-thermal.yaml vendor/device-tree/dist/Bindings/thermal/socionext,uniphier-thermal.yaml vendor/device-tree/dist/Bindings/thermal/thermal-cooling-devices.yaml vendor/device-tree/dist/Bindings/thermal/thermal-idle.yaml vendor/device-tree/dist/Bindings/thermal/thermal-sensor.yaml vendor/device-tree/dist/Bindings/thermal/thermal-zones.yaml vendor/device-tree/dist/Bindings/thermal/ti,am654-thermal.yaml vendor/device-tree/dist/Bindings/timer/cdns,ttc.yaml vendor/device-tree/dist/Bindings/timer/fsl,imxgpt.yaml vendor/device-tree/dist/Bindings/timer/ingenic,tcu.yaml vendor/device-tree/dist/Bindings/timer/nxp,sysctr-timer.yaml vendor/device-tree/dist/Bindings/timer/nxp,tpm-timer.yaml vendor/device-tree/dist/Bindings/timer/renesas,cmt.yaml vendor/device-tree/dist/Bindings/timer/renesas,em-sti.yaml vendor/device-tree/dist/Bindings/timer/renesas,mtu2.yaml vendor/device-tree/dist/Bindings/timer/renesas,ostm.yaml vendor/device-tree/dist/Bindings/timer/snps,dw-apb-timer.yaml vendor/device-tree/dist/Bindings/usb/brcm,bcm7445-ehci.yaml vendor/device-tree/dist/Bindings/usb/marvell,pxau2o-ehci.yaml vendor/device-tree/dist/Bindings/usb/qcom,dwc3.yaml vendor/device-tree/dist/Bindings/usb/ti,keystone-dwc3.yaml vendor/device-tree/dist/Bindings/usb/ti,tps6598x.yaml vendor/device-tree/dist/Bindings/watchdog/arm-smc-wdt.yaml vendor/device-tree/dist/Bindings/watchdog/fsl-imx-wdt.yaml vendor/device-tree/dist/Bindings/watchdog/fsl-imx7ulp-wdt.yaml vendor/device-tree/dist/Bindings/watchdog/renesas,wdt.yaml vendor/device-tree/dist/Bindings/watchdog/socionext,uniphier-wdt.yaml vendor/device-tree/dist/Bindings/writing-bindings.rst vendor/device-tree/dist/include/dt-bindings/clock/agilex-clock.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/bt1-ccu.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/intel,lgm-clk.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/marvell,mmp2-audio.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/mt6765-clk.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8939.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/r8a7742-cpg-mssr.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/clock/x1830-cgu.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/interconnect/imx8mm.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/interconnect/imx8mn.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/interconnect/imx8mq.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/mailbox/qcom-ipcc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/pinctrl/pads-imx8dxl.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/marvell,mmp2.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/meson-gxbb-power.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/meson8-power.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/power/r8a7742-sysc.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/bt1-ccu.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/imx8mp-reset.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/qcom,gcc-msm8939.h (contents, props changed) vendor/device-tree/dist/include/dt-bindings/reset/realtek,rtd1195.h (contents, props changed) vendor/device-tree/dist/src/arm/am5729-beagleboneai.dts (contents, props changed) vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-yosemitev2.dts (contents, props changed) vendor/device-tree/dist/src/arm/aspeed-bmc-opp-nicole.dts (contents, props changed) vendor/device-tree/dist/src/arm/at91-sama5d2_icp.dts (contents, props changed) vendor/device-tree/dist/src/arm/bcm2835-rpi-common.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/dra7-ipu-dsp-common.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/dra74-ipu-dsp-common.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/exynos4210-i9100.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6dl-colibri-v1_1-eval-v3.dts (contents, props changed) vendor/device-tree/dist/src/arm/imx6qdl-colibri-v1_1-uhs.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/integratorap-im-pd1.dts (contents, props changed) vendor/device-tree/dist/src/arm/kirkwood-l-50.dts (contents, props changed) vendor/device-tree/dist/src/arm/r8a7742-iwg21d-q7.dts (contents, props changed) vendor/device-tree/dist/src/arm/r8a7742-iwg21m.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/r8a7742.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/rtd1195-horseradish.dts (contents, props changed) vendor/device-tree/dist/src/arm/rtd1195-mele-x1000.dts (contents, props changed) vendor/device-tree/dist/src/arm/rtd1195.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp157a-dhcor-avenger96.dts (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp157a-iot-box.dts (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp157a-stinger96.dts (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp157a-stinger96.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp157c-lxa-mc1.dts (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp15xx-dhcom-pdk2.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp15xx-dhcom-som.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp15xx-dhcor-avenger96.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp15xx-dhcor-io1v8.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp15xx-dhcor-som.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/stm32mp15xx-osd32.dtsi (contents, props changed) vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-lime-emmc.dts (contents, props changed) vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-cpu-opp.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-gtking-pro.dts (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-gtking.dts (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-w400.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s805x.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905d-sml5442tw.dts (contents, props changed) vendor/device-tree/dist/src/arm64/amlogic/meson-sm1-odroid-c4.dts (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/imx8mm-beacon-baseboard.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/imx8mm-beacon-kit.dts (contents, props changed) vendor/device-tree/dist/src/arm64/freescale/imx8mm-beacon-som.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/mediatek/mt6358.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm-hana-rev7.dts (contents, props changed) vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm-hana.dts (contents, props changed) vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm-hana.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm.dts (contents, props changed) vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/qcom/sdm660-xiaomi-lavender.dts (contents, props changed) vendor/device-tree/dist/src/arm64/qcom/sdm660.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd1295-xnano-x5.dts (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd1395-bpi-m4.dts (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd1395-lionskin.dts (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd1395.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd139x.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd1619-mjolnir.dts (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd1619.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/realtek/rtd16xx.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/aistarvision-mipi-adapter-2.1.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/renesas/r8a774c0-ek874-mipi-2.1.dts (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3326-odroid-go2.dts (contents, props changed) vendor/device-tree/dist/src/arm64/rockchip/rk3326.dtsi (contents, props changed) vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20-akebi96.dts (contents, props changed) vendor/device-tree/dist/src/arm64/ti/k3-am654-industrial-thermal.dtsi (contents, props changed) vendor/device-tree/dist/src/mips/ingenic/gcw0_proto.dts (contents, props changed) Deleted: vendor/device-tree/dist/Bindings/ABI.txt vendor/device-tree/dist/Bindings/arm/calxeda/l2ecc.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pericfg.txt vendor/device-tree/dist/Bindings/ata/sata_highbank.txt vendor/device-tree/dist/Bindings/auxdisplay/hit,hd44780.txt vendor/device-tree/dist/Bindings/clock/calxeda.txt vendor/device-tree/dist/Bindings/clock/cirrus,lochnagar.txt vendor/device-tree/dist/Bindings/clock/imx1-clock.txt vendor/device-tree/dist/Bindings/clock/imx21-clock.txt vendor/device-tree/dist/Bindings/clock/imx23-clock.txt vendor/device-tree/dist/Bindings/clock/imx25-clock.txt vendor/device-tree/dist/Bindings/clock/imx27-clock.txt vendor/device-tree/dist/Bindings/clock/imx28-clock.txt vendor/device-tree/dist/Bindings/clock/imx31-clock.txt vendor/device-tree/dist/Bindings/clock/imx35-clock.txt vendor/device-tree/dist/Bindings/clock/imx5-clock.txt vendor/device-tree/dist/Bindings/clock/imx6q-clock.txt vendor/device-tree/dist/Bindings/clock/imx6sl-clock.txt vendor/device-tree/dist/Bindings/clock/imx6sll-clock.txt vendor/device-tree/dist/Bindings/clock/imx6sx-clock.txt vendor/device-tree/dist/Bindings/clock/imx6ul-clock.txt vendor/device-tree/dist/Bindings/clock/imx7d-clock.txt vendor/device-tree/dist/Bindings/clock/imx8qxp-lpcg.txt vendor/device-tree/dist/Bindings/clock/ingenic,cgu.txt vendor/device-tree/dist/Bindings/clock/qcom,a53pll.txt vendor/device-tree/dist/Bindings/clock/renesas,cpg-div6-clocks.txt vendor/device-tree/dist/Bindings/clock/renesas,cpg-mstp-clocks.txt vendor/device-tree/dist/Bindings/display/bridge/adi,adv7123.txt vendor/device-tree/dist/Bindings/display/bridge/anx7814.txt vendor/device-tree/dist/Bindings/display/bridge/dumb-vga-dac.txt vendor/device-tree/dist/Bindings/display/bridge/dw_mipi_dsi.txt vendor/device-tree/dist/Bindings/display/bridge/thine,thc63lvd1024.txt vendor/device-tree/dist/Bindings/display/bridge/ti,ths813x.txt vendor/device-tree/dist/Bindings/display/panel/arm,versatile-tft-panel.txt vendor/device-tree/dist/Bindings/display/panel/boe,himax8279d.txt vendor/device-tree/dist/Bindings/display/panel/feiyang,fy07024di26a30d.txt vendor/device-tree/dist/Bindings/display/panel/ilitek,ili9322.txt vendor/device-tree/dist/Bindings/display/panel/ilitek,ili9881c.txt vendor/device-tree/dist/Bindings/display/panel/innolux,p097pfg.txt vendor/device-tree/dist/Bindings/display/panel/innolux,p120zdg-bf1.txt vendor/device-tree/dist/Bindings/display/panel/jdi,lt070me05000.txt vendor/device-tree/dist/Bindings/display/panel/kingdisplay,kd035g6-54nt.txt vendor/device-tree/dist/Bindings/display/panel/kingdisplay,kd097d04.txt vendor/device-tree/dist/Bindings/display/panel/lg,acx467akm-7.txt vendor/device-tree/dist/Bindings/display/panel/lg,ld070wx3-sl01.txt vendor/device-tree/dist/Bindings/display/panel/lg,lg4573.txt vendor/device-tree/dist/Bindings/display/panel/lg,lh500wx1-sd03.txt vendor/device-tree/dist/Bindings/display/panel/lgphilips,lb035q02.txt vendor/device-tree/dist/Bindings/display/panel/olimex,lcd-olinuxino.txt vendor/device-tree/dist/Bindings/display/panel/osddisplays,osd101t2587-53ts.txt vendor/device-tree/dist/Bindings/display/panel/raydium,rm67191.txt vendor/device-tree/dist/Bindings/display/panel/samsung,ld9040.txt vendor/device-tree/dist/Bindings/display/panel/samsung,s6d16d0.txt vendor/device-tree/dist/Bindings/display/panel/samsung,s6e3ha2.txt vendor/device-tree/dist/Bindings/display/panel/samsung,s6e63j0x03.txt vendor/device-tree/dist/Bindings/display/panel/samsung,s6e63m0.txt vendor/device-tree/dist/Bindings/display/panel/seiko,43wvf1g.txt vendor/device-tree/dist/Bindings/display/panel/sharp,lq150x1lg11.txt vendor/device-tree/dist/Bindings/display/panel/sharp,ls037v7dw01.txt vendor/device-tree/dist/Bindings/display/panel/sharp,ls043t1le01.txt vendor/device-tree/dist/Bindings/display/panel/simple-panel.txt vendor/device-tree/dist/Bindings/display/panel/sitronix,st7701.txt vendor/device-tree/dist/Bindings/display/panel/sitronix,st7789v.txt vendor/device-tree/dist/Bindings/display/panel/sony,acx565akm.txt vendor/device-tree/dist/Bindings/display/panel/startek,startek-kd050c.txt vendor/device-tree/dist/Bindings/display/panel/tpo,td028ttec1.txt vendor/device-tree/dist/Bindings/display/panel/tpo,td043mtea1.txt vendor/device-tree/dist/Bindings/display/rockchip/rockchip,rk3066-hdmi.txt vendor/device-tree/dist/Bindings/display/rockchip/rockchip-vop.txt vendor/device-tree/dist/Bindings/dma/jz4780-dma.txt vendor/device-tree/dist/Bindings/dma/renesas,rcar-dmac.txt vendor/device-tree/dist/Bindings/dma/renesas,usb-dmac.txt vendor/device-tree/dist/Bindings/extcon/extcon-arizona.txt vendor/device-tree/dist/Bindings/gpio/fsl-imx-gpio.txt vendor/device-tree/dist/Bindings/gpio/gpio-mxs.txt vendor/device-tree/dist/Bindings/gpio/renesas,gpio-rcar.txt vendor/device-tree/dist/Bindings/gpio/snps-dwapb-gpio.txt vendor/device-tree/dist/Bindings/hwmon/cirrus,lochnagar.txt vendor/device-tree/dist/Bindings/i2c/i2c-cadence.txt vendor/device-tree/dist/Bindings/i2c/i2c-designware.txt vendor/device-tree/dist/Bindings/i2c/i2c-jz4780.txt vendor/device-tree/dist/Bindings/i2c/i2c-xiic.txt vendor/device-tree/dist/Bindings/iio/adc/rockchip-saradc.txt vendor/device-tree/dist/Bindings/iio/dac/st,stm32-dac.txt vendor/device-tree/dist/Bindings/iio/imu/bmi160.txt vendor/device-tree/dist/Bindings/iio/light/tsl2563.txt vendor/device-tree/dist/Bindings/iio/light/vcnl4000.txt vendor/device-tree/dist/Bindings/input/elants_i2c.txt vendor/device-tree/dist/Bindings/input/gpio-keys-polled.txt vendor/device-tree/dist/Bindings/input/gpio-keys.txt vendor/device-tree/dist/Bindings/input/msm-vibrator.txt vendor/device-tree/dist/Bindings/interrupt-controller/fsl,irqsteer.txt vendor/device-tree/dist/Bindings/interrupt-controller/ingenic,intc.txt vendor/device-tree/dist/Bindings/interrupt-controller/renesas,intc-irqpin.txt vendor/device-tree/dist/Bindings/iommu/renesas,ipmmu-vmsa.txt vendor/device-tree/dist/Bindings/ipmi/ipmi-smic.txt vendor/device-tree/dist/Bindings/leds/backlight/qcom-wled.txt vendor/device-tree/dist/Bindings/mailbox/fsl,mu.txt vendor/device-tree/dist/Bindings/mailbox/qcom,apcs-kpss-global.txt vendor/device-tree/dist/Bindings/media/marvell,mmp2-ccic.txt vendor/device-tree/dist/Bindings/media/rockchip-rga.txt vendor/device-tree/dist/Bindings/media/rockchip-vpu.txt vendor/device-tree/dist/Bindings/memory-controllers/calxeda-ddr-ctrlr.txt vendor/device-tree/dist/Bindings/memory-controllers/ingenic,jz4780-nemc.txt vendor/device-tree/dist/Bindings/memory-controllers/renesas,dbsc.txt vendor/device-tree/dist/Bindings/mfd/arizona.txt vendor/device-tree/dist/Bindings/mfd/cirrus,lochnagar.txt vendor/device-tree/dist/Bindings/mfd/madera.txt vendor/device-tree/dist/Bindings/mmc/jz4740.txt vendor/device-tree/dist/Bindings/mmc/sdhci-pxa.txt vendor/device-tree/dist/Bindings/mtd/ingenic,jz4780-nand.txt vendor/device-tree/dist/Bindings/net/calxeda-xgmac.txt vendor/device-tree/dist/Bindings/net/qca,ar71xx.txt vendor/device-tree/dist/Bindings/net/socionext,uniphier-ave4.txt vendor/device-tree/dist/Bindings/net/stm32-dwmac.txt vendor/device-tree/dist/Bindings/net/ti,dp83867.txt vendor/device-tree/dist/Bindings/nvmem/imx-iim.txt vendor/device-tree/dist/Bindings/nvmem/imx-ocotp.txt vendor/device-tree/dist/Bindings/nvmem/mxs-ocotp.txt vendor/device-tree/dist/Bindings/nvmem/rockchip-efuse.txt vendor/device-tree/dist/Bindings/phy/calxeda-combophy.txt vendor/device-tree/dist/Bindings/phy/meson-gxl-usb3-phy.txt vendor/device-tree/dist/Bindings/phy/meson8b-usb2-phy.txt vendor/device-tree/dist/Bindings/phy/qcom-qmp-phy.txt vendor/device-tree/dist/Bindings/phy/rcar-gen3-phy-usb2.txt vendor/device-tree/dist/Bindings/phy/rcar-gen3-phy-usb3.txt vendor/device-tree/dist/Bindings/phy/uniphier-pcie-phy.txt vendor/device-tree/dist/Bindings/phy/uniphier-usb2-phy.txt vendor/device-tree/dist/Bindings/phy/uniphier-usb3-hsphy.txt vendor/device-tree/dist/Bindings/phy/uniphier-usb3-ssphy.txt vendor/device-tree/dist/Bindings/pinctrl/cirrus,lochnagar.txt vendor/device-tree/dist/Bindings/pinctrl/cirrus,madera-pinctrl.txt vendor/device-tree/dist/Bindings/power/fsl,imx-gpc.txt vendor/device-tree/dist/Bindings/power/fsl,imx-gpcv2.txt vendor/device-tree/dist/Bindings/power/reset/syscon-reboot-mode.txt vendor/device-tree/dist/Bindings/power/supply/bq27xxx.txt vendor/device-tree/dist/Bindings/power/supply/sbs_sbs-battery.txt vendor/device-tree/dist/Bindings/pwm/imx-pwm.txt vendor/device-tree/dist/Bindings/pwm/imx-tpm-pwm.txt vendor/device-tree/dist/Bindings/pwm/mxs-pwm.txt vendor/device-tree/dist/Bindings/regulator/anatop-regulator.txt vendor/device-tree/dist/Bindings/regulator/arizona-regulator.txt vendor/device-tree/dist/Bindings/regulator/cirrus,lochnagar.txt vendor/device-tree/dist/Bindings/rtc/dw-apb.txt vendor/device-tree/dist/Bindings/rtc/rtc-mxc.txt vendor/device-tree/dist/Bindings/rtc/rtc-mxc_v2.txt vendor/device-tree/dist/Bindings/serial/8250.txt vendor/device-tree/dist/Bindings/serial/ingenic,uart.txt vendor/device-tree/dist/Bindings/serial/mrvl-serial.txt vendor/device-tree/dist/Bindings/serial/qca,ar9330-uart.txt vendor/device-tree/dist/Bindings/soc/qcom/qcom,geni-se.txt vendor/device-tree/dist/Bindings/sound/cirrus,lochnagar.txt vendor/device-tree/dist/Bindings/sound/madera.txt vendor/device-tree/dist/Bindings/sound/simple-card.txt vendor/device-tree/dist/Bindings/sound/wlf,arizona.txt vendor/device-tree/dist/Bindings/spi/snps,dw-apb-ssi.txt vendor/device-tree/dist/Bindings/spi/spi-dw.txt vendor/device-tree/dist/Bindings/spi/spi-pxa2xx.txt vendor/device-tree/dist/Bindings/spi/spi-rspi.txt vendor/device-tree/dist/Bindings/spi/spi-uniphier.txt vendor/device-tree/dist/Bindings/sram/rockchip-pmu-sram.txt vendor/device-tree/dist/Bindings/submitting-patches.txt vendor/device-tree/dist/Bindings/thermal/imx-thermal.txt vendor/device-tree/dist/Bindings/thermal/imx8mm-thermal.txt vendor/device-tree/dist/Bindings/thermal/rcar-gen3-thermal.txt vendor/device-tree/dist/Bindings/thermal/uniphier-thermal.txt vendor/device-tree/dist/Bindings/timer/cadence,ttc-timer.txt vendor/device-tree/dist/Bindings/timer/fsl,imxgpt.txt vendor/device-tree/dist/Bindings/timer/ingenic,tcu.txt vendor/device-tree/dist/Bindings/timer/nxp,sysctr-timer.txt vendor/device-tree/dist/Bindings/timer/nxp,tpm-timer.txt vendor/device-tree/dist/Bindings/timer/renesas,cmt.txt vendor/device-tree/dist/Bindings/timer/renesas,mtu2.txt vendor/device-tree/dist/Bindings/timer/renesas,ostm.txt vendor/device-tree/dist/Bindings/usb/amlogic,dwc3.txt vendor/device-tree/dist/Bindings/usb/ehci-mv.txt vendor/device-tree/dist/Bindings/usb/keystone-usb.txt vendor/device-tree/dist/Bindings/usb/qcom,dwc3.txt vendor/device-tree/dist/Bindings/usb/usb-conn-gpio.txt vendor/device-tree/dist/Bindings/watchdog/fsl-imx-wdt.txt vendor/device-tree/dist/Bindings/watchdog/fsl-imx7ulp-wdt.txt vendor/device-tree/dist/Bindings/watchdog/renesas,wdt.txt vendor/device-tree/dist/Bindings/watchdog/uniphier-wdt.txt vendor/device-tree/dist/Bindings/writing-bindings.txt vendor/device-tree/dist/src/arm/stm32mp157c-dhcom-som.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8016-sbc-pmic-pins.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8016-sbc-soc-pins.dtsi vendor/device-tree/dist/src/powerpc/ep405.dts vendor/device-tree/dist/src/powerpc/virtex440-ml507.dts vendor/device-tree/dist/src/powerpc/virtex440-ml510.dts vendor/device-tree/dist/src/powerpc/walnut.dts Modified: vendor/device-tree/dist/Bindings/Makefile vendor/device-tree/dist/Bindings/arm/altera.yaml vendor/device-tree/dist/Bindings/arm/amlogic.yaml vendor/device-tree/dist/Bindings/arm/amlogic/amlogic,meson-gx-ao-secure.yaml vendor/device-tree/dist/Bindings/arm/arm,scmi.txt vendor/device-tree/dist/Bindings/arm/arm,vexpress-juno.yaml vendor/device-tree/dist/Bindings/arm/atmel-at91.yaml vendor/device-tree/dist/Bindings/arm/bitmain.yaml vendor/device-tree/dist/Bindings/arm/coresight-cti.yaml vendor/device-tree/dist/Bindings/arm/cpus.yaml vendor/device-tree/dist/Bindings/arm/freescale/fsl,scu.txt vendor/device-tree/dist/Bindings/arm/fsl.yaml vendor/device-tree/dist/Bindings/arm/l2c2x0.yaml vendor/device-tree/dist/Bindings/arm/mediatek.yaml vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,audsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,camsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt vendor/device-tree/dist/Bindings/arm/nxp/lpc32xx.yaml vendor/device-tree/dist/Bindings/arm/psci.yaml vendor/device-tree/dist/Bindings/arm/qcom.yaml vendor/device-tree/dist/Bindings/arm/realtek.yaml vendor/device-tree/dist/Bindings/arm/renesas,prr.yaml vendor/device-tree/dist/Bindings/arm/renesas.yaml vendor/device-tree/dist/Bindings/arm/rockchip.yaml vendor/device-tree/dist/Bindings/arm/samsung/exynos-chipid.yaml vendor/device-tree/dist/Bindings/arm/samsung/samsung-boards.yaml vendor/device-tree/dist/Bindings/arm/socionext/uniphier.yaml vendor/device-tree/dist/Bindings/arm/stm32/st,mlahb.yaml vendor/device-tree/dist/Bindings/arm/stm32/st,stm32-syscon.yaml vendor/device-tree/dist/Bindings/arm/stm32/stm32.yaml vendor/device-tree/dist/Bindings/arm/sunxi.yaml vendor/device-tree/dist/Bindings/arm/syna.txt vendor/device-tree/dist/Bindings/arm/tegra/nvidia,tegra20-pmc.yaml vendor/device-tree/dist/Bindings/ata/faraday,ftide010.yaml vendor/device-tree/dist/Bindings/ata/renesas,rcar-sata.yaml vendor/device-tree/dist/Bindings/bus/allwinner,sun50i-a64-de2.yaml vendor/device-tree/dist/Bindings/bus/allwinner,sun8i-a23-rsb.yaml vendor/device-tree/dist/Bindings/bus/socionext,uniphier-system-bus.yaml vendor/device-tree/dist/Bindings/clock/allwinner,sun4i-a10-gates-clk.yaml vendor/device-tree/dist/Bindings/clock/bitmain,bm1880-clk.yaml vendor/device-tree/dist/Bindings/clock/fixed-factor-clock.yaml vendor/device-tree/dist/Bindings/clock/fsl,plldig.yaml vendor/device-tree/dist/Bindings/clock/idt,versaclock5.txt vendor/device-tree/dist/Bindings/clock/marvell,mmp2-clock.yaml vendor/device-tree/dist/Bindings/clock/qcom,gcc-sc7180.yaml vendor/device-tree/dist/Bindings/clock/qcom,gcc-sm8150.yaml vendor/device-tree/dist/Bindings/clock/qcom,gcc-sm8250.yaml vendor/device-tree/dist/Bindings/clock/qcom,gcc.yaml vendor/device-tree/dist/Bindings/clock/qcom,mmcc.yaml vendor/device-tree/dist/Bindings/clock/qcom,sc7180-dispcc.yaml vendor/device-tree/dist/Bindings/clock/qcom,sc7180-gpucc.yaml vendor/device-tree/dist/Bindings/clock/qcom,sc7180-mss.yaml vendor/device-tree/dist/Bindings/clock/qcom,sc7180-videocc.yaml vendor/device-tree/dist/Bindings/clock/qcom,sdm845-dispcc.yaml vendor/device-tree/dist/Bindings/clock/qcom,sdm845-gpucc.yaml vendor/device-tree/dist/Bindings/clock/qcom,sdm845-videocc.yaml vendor/device-tree/dist/Bindings/clock/renesas,cpg-mssr.yaml vendor/device-tree/dist/Bindings/clock/renesas,rcar-usb2-clock-sel.txt vendor/device-tree/dist/Bindings/clock/silabs,si5341.txt vendor/device-tree/dist/Bindings/clock/sprd,sc9863a-clk.yaml vendor/device-tree/dist/Bindings/connector/usb-connector.yaml vendor/device-tree/dist/Bindings/crypto/allwinner,sun4i-a10-crypto.yaml vendor/device-tree/dist/Bindings/crypto/allwinner,sun8i-ce.yaml vendor/device-tree/dist/Bindings/crypto/amlogic,gxl-crypto.yaml vendor/device-tree/dist/Bindings/crypto/st,stm32-hash.yaml vendor/device-tree/dist/Bindings/display/allwinner,sun4i-a10-display-engine.yaml vendor/device-tree/dist/Bindings/display/allwinner,sun4i-a10-hdmi.yaml vendor/device-tree/dist/Bindings/display/allwinner,sun4i-a10-tcon.yaml vendor/device-tree/dist/Bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml vendor/device-tree/dist/Bindings/display/allwinner,sun8i-a83t-dw-hdmi.yaml vendor/device-tree/dist/Bindings/display/bridge/anx6345.yaml vendor/device-tree/dist/Bindings/display/bridge/lvds-codec.yaml vendor/device-tree/dist/Bindings/display/bridge/ps8640.yaml vendor/device-tree/dist/Bindings/display/bridge/sii902x.txt vendor/device-tree/dist/Bindings/display/dsi-controller.yaml vendor/device-tree/dist/Bindings/display/imx/fsl-imx-drm.txt vendor/device-tree/dist/Bindings/display/imx/ldb.txt vendor/device-tree/dist/Bindings/display/mediatek/mediatek,dpi.txt vendor/device-tree/dist/Bindings/display/mediatek/mediatek,dsi.txt vendor/device-tree/dist/Bindings/display/panel/boe,tv101wum-nl6.yaml vendor/device-tree/dist/Bindings/display/panel/display-timings.yaml vendor/device-tree/dist/Bindings/display/panel/panel-common.yaml vendor/device-tree/dist/Bindings/display/panel/panel-simple-dsi.yaml vendor/device-tree/dist/Bindings/display/panel/panel-simple.yaml vendor/device-tree/dist/Bindings/display/panel/panel-timing.yaml vendor/device-tree/dist/Bindings/display/panel/sony,acx424akp.yaml vendor/device-tree/dist/Bindings/display/panel/xinpeng,xpp055c272.yaml vendor/device-tree/dist/Bindings/display/renesas,cmm.yaml vendor/device-tree/dist/Bindings/display/renesas,du.txt vendor/device-tree/dist/Bindings/display/rockchip/rockchip-drm.yaml vendor/device-tree/dist/Bindings/display/tegra/nvidia,tegra20-host1x.txt vendor/device-tree/dist/Bindings/display/ti/ti,am65x-dss.yaml vendor/device-tree/dist/Bindings/display/ti/ti,j721e-dss.yaml vendor/device-tree/dist/Bindings/dma/dma-common.yaml vendor/device-tree/dist/Bindings/dma/mtk-uart-apdma.txt vendor/device-tree/dist/Bindings/dma/sifive,fu540-c000-pdma.yaml vendor/device-tree/dist/Bindings/dma/st,stm32-dma.yaml vendor/device-tree/dist/Bindings/dma/ti/k3-udma.yaml vendor/device-tree/dist/Bindings/dsp/fsl,dsp.yaml vendor/device-tree/dist/Bindings/eeprom/at24.yaml vendor/device-tree/dist/Bindings/example-schema.yaml vendor/device-tree/dist/Bindings/extcon/extcon-usbc-cros-ec.yaml vendor/device-tree/dist/Bindings/firmware/intel,stratix10-svc.txt vendor/device-tree/dist/Bindings/fpga/intel-stratix10-soc-fpga-mgr.txt vendor/device-tree/dist/Bindings/gpio/brcm,xgs-iproc-gpio.yaml vendor/device-tree/dist/Bindings/gpio/mediatek,mt7621-gpio.txt vendor/device-tree/dist/Bindings/gpio/sifive,gpio.yaml vendor/device-tree/dist/Bindings/gpu/arm,mali-bifrost.yaml vendor/device-tree/dist/Bindings/gpu/arm,mali-midgard.yaml vendor/device-tree/dist/Bindings/gpu/arm,mali-utgard.yaml vendor/device-tree/dist/Bindings/gpu/vivante,gc.yaml vendor/device-tree/dist/Bindings/hwmon/adi,axi-fan-control.yaml vendor/device-tree/dist/Bindings/hwmon/adi,ltc2947.yaml vendor/device-tree/dist/Bindings/hwmon/adt7475.yaml vendor/device-tree/dist/Bindings/hwmon/ti,tmp513.yaml vendor/device-tree/dist/Bindings/i2c/brcm,bcm2835-i2c.txt vendor/device-tree/dist/Bindings/i2c/i2c-mt65xx.txt vendor/device-tree/dist/Bindings/i2c/i2c-rk3x.yaml vendor/device-tree/dist/Bindings/i2c/i2c.txt vendor/device-tree/dist/Bindings/i2c/nvidia,tegra20-i2c.txt vendor/device-tree/dist/Bindings/i2c/renesas,i2c.txt vendor/device-tree/dist/Bindings/i2c/renesas,iic.txt vendor/device-tree/dist/Bindings/i2c/st,stm32-i2c.yaml vendor/device-tree/dist/Bindings/iio/accel/bma180.txt vendor/device-tree/dist/Bindings/iio/adc/adi,ad7124.yaml vendor/device-tree/dist/Bindings/iio/adc/lltc,ltc2496.yaml vendor/device-tree/dist/Bindings/iio/adc/microchip,mcp3911.yaml vendor/device-tree/dist/Bindings/iio/adc/st,stm32-adc.yaml vendor/device-tree/dist/Bindings/iio/adc/st,stm32-dfsdm-adc.yaml vendor/device-tree/dist/Bindings/iio/chemical/atlas,sensor.yaml vendor/device-tree/dist/Bindings/iio/dac/ltc2632.txt vendor/device-tree/dist/Bindings/iio/gyroscope/bmg160.txt vendor/device-tree/dist/Bindings/iio/light/tsl2772.yaml vendor/device-tree/dist/Bindings/iio/magnetometer/ak8974.txt vendor/device-tree/dist/Bindings/iio/st-sensors.txt vendor/device-tree/dist/Bindings/iio/temperature/adi,ltc2983.yaml vendor/device-tree/dist/Bindings/input/allwinner,sun4i-a10-lradc-keys.yaml vendor/device-tree/dist/Bindings/input/input.yaml vendor/device-tree/dist/Bindings/input/iqs62x-keys.yaml vendor/device-tree/dist/Bindings/input/touchscreen/edt-ft5x06.yaml vendor/device-tree/dist/Bindings/input/touchscreen/goodix.yaml vendor/device-tree/dist/Bindings/input/touchscreen/mms114.txt vendor/device-tree/dist/Bindings/interconnect/qcom,msm8916.yaml vendor/device-tree/dist/Bindings/interconnect/qcom,msm8974.yaml vendor/device-tree/dist/Bindings/interconnect/qcom,qcs404.yaml vendor/device-tree/dist/Bindings/interconnect/qcom,sc7180.yaml vendor/device-tree/dist/Bindings/interconnect/qcom,sdm845.yaml vendor/device-tree/dist/Bindings/interrupt-controller/allwinner,sun7i-a20-sc-nmi.yaml vendor/device-tree/dist/Bindings/interrupt-controller/arm,gic-v3.yaml vendor/device-tree/dist/Bindings/interrupt-controller/arm,gic.yaml vendor/device-tree/dist/Bindings/interrupt-controller/csky,mpintc.txt vendor/device-tree/dist/Bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml vendor/device-tree/dist/Bindings/interrupt-controller/loongson,liointc.yaml vendor/device-tree/dist/Bindings/interrupt-controller/renesas,irqc.yaml vendor/device-tree/dist/Bindings/interrupt-controller/st,stm32-exti.yaml vendor/device-tree/dist/Bindings/iommu/arm,smmu.yaml vendor/device-tree/dist/Bindings/iommu/samsung,sysmmu.yaml vendor/device-tree/dist/Bindings/leds/common.yaml vendor/device-tree/dist/Bindings/leds/leds-gpio.yaml vendor/device-tree/dist/Bindings/leds/rohm,bd71828-leds.yaml vendor/device-tree/dist/Bindings/mailbox/st,stm32-ipcc.yaml vendor/device-tree/dist/Bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt vendor/device-tree/dist/Bindings/media/allwinner,sun4i-a10-csi.yaml vendor/device-tree/dist/Bindings/media/allwinner,sun4i-a10-video-engine.yaml vendor/device-tree/dist/Bindings/media/amlogic,gx-vdec.yaml vendor/device-tree/dist/Bindings/media/amlogic,meson-gx-ao-cec.yaml vendor/device-tree/dist/Bindings/media/i2c/imx219.yaml vendor/device-tree/dist/Bindings/media/qcom,sc7180-venus.yaml vendor/device-tree/dist/Bindings/media/qcom,sdm845-venus-v2.yaml vendor/device-tree/dist/Bindings/media/qcom,sdm845-venus.yaml vendor/device-tree/dist/Bindings/media/rc.yaml vendor/device-tree/dist/Bindings/media/renesas,ceu.yaml vendor/device-tree/dist/Bindings/media/renesas,csi2.yaml vendor/device-tree/dist/Bindings/media/renesas,vin.yaml vendor/device-tree/dist/Bindings/media/ti,vpe.yaml vendor/device-tree/dist/Bindings/media/video-interfaces.txt vendor/device-tree/dist/Bindings/memory-controllers/exynos-srom.yaml vendor/device-tree/dist/Bindings/memory-controllers/fsl/imx8m-ddrc.yaml vendor/device-tree/dist/Bindings/memory-controllers/nvidia,tegra124-emc.yaml vendor/device-tree/dist/Bindings/memory-controllers/nvidia,tegra124-mc.yaml vendor/device-tree/dist/Bindings/memory-controllers/nvidia,tegra30-emc.yaml vendor/device-tree/dist/Bindings/memory-controllers/nvidia,tegra30-mc.yaml vendor/device-tree/dist/Bindings/mfd/allwinner,sun4i-a10-ts.yaml vendor/device-tree/dist/Bindings/mfd/max8998.txt vendor/device-tree/dist/Bindings/mfd/mt6397.txt vendor/device-tree/dist/Bindings/mfd/st,stm32-lptimer.yaml vendor/device-tree/dist/Bindings/mfd/st,stm32-timers.yaml vendor/device-tree/dist/Bindings/mfd/st,stpmic1.yaml vendor/device-tree/dist/Bindings/mfd/syscon.yaml vendor/device-tree/dist/Bindings/mips/ingenic/devices.yaml vendor/device-tree/dist/Bindings/misc/olpc,xo1.75-ec.txt vendor/device-tree/dist/Bindings/mmc/arasan,sdhci.txt vendor/device-tree/dist/Bindings/mmc/aspeed,sdhci.yaml vendor/device-tree/dist/Bindings/mmc/cdns,sdhci.yaml vendor/device-tree/dist/Bindings/mmc/mmc-controller.yaml vendor/device-tree/dist/Bindings/mmc/owl-mmc.yaml vendor/device-tree/dist/Bindings/mmc/renesas,mmcif.txt vendor/device-tree/dist/Bindings/mmc/renesas,sdhi.txt vendor/device-tree/dist/Bindings/mmc/rockchip-dw-mshc.yaml vendor/device-tree/dist/Bindings/mmc/sdhci-msm.txt vendor/device-tree/dist/Bindings/mmc/socionext,uniphier-sd.yaml vendor/device-tree/dist/Bindings/mmc/synopsys-dw-mshc-common.yaml vendor/device-tree/dist/Bindings/mtd/allwinner,sun4i-a10-nand.yaml vendor/device-tree/dist/Bindings/mtd/brcm,brcmnand.txt vendor/device-tree/dist/Bindings/mtd/denali,nand.yaml vendor/device-tree/dist/Bindings/mtd/nand-controller.yaml vendor/device-tree/dist/Bindings/mtd/partition.txt vendor/device-tree/dist/Bindings/net/allwinner,sun8i-a83t-emac.yaml vendor/device-tree/dist/Bindings/net/amlogic,meson-dwmac.yaml vendor/device-tree/dist/Bindings/net/can/bosch,m_can.yaml vendor/device-tree/dist/Bindings/net/ethernet-controller.yaml vendor/device-tree/dist/Bindings/net/ethernet-phy.yaml vendor/device-tree/dist/Bindings/net/fsl-fec.txt vendor/device-tree/dist/Bindings/net/mdio.yaml vendor/device-tree/dist/Bindings/net/mediatek-bluetooth.txt vendor/device-tree/dist/Bindings/net/qca,ar803x.yaml vendor/device-tree/dist/Bindings/net/qcom,ipa.yaml vendor/device-tree/dist/Bindings/net/qualcomm-bluetooth.txt vendor/device-tree/dist/Bindings/net/renesas,ether.yaml vendor/device-tree/dist/Bindings/net/renesas,ravb.txt vendor/device-tree/dist/Bindings/net/snps,dwmac.yaml vendor/device-tree/dist/Bindings/net/ti,cpsw-switch.yaml vendor/device-tree/dist/Bindings/net/ti,davinci-mdio.yaml vendor/device-tree/dist/Bindings/net/ti,dp83869.yaml vendor/device-tree/dist/Bindings/net/ti,k3-am654-cpsw-nuss.yaml vendor/device-tree/dist/Bindings/net/wireless/mediatek,mt76.txt vendor/device-tree/dist/Bindings/net/wireless/qcom,ath10k.txt vendor/device-tree/dist/Bindings/nvmem/nvmem.yaml vendor/device-tree/dist/Bindings/nvmem/st,stm32-romem.yaml vendor/device-tree/dist/Bindings/opp/opp.txt vendor/device-tree/dist/Bindings/pci/aardvark-pci.txt vendor/device-tree/dist/Bindings/pci/brcm,stb-pcie.yaml vendor/device-tree/dist/Bindings/pci/cdns,cdns-pcie-ep.yaml vendor/device-tree/dist/Bindings/pci/cdns,cdns-pcie-host.yaml vendor/device-tree/dist/Bindings/pci/cdns-pcie-host.yaml vendor/device-tree/dist/Bindings/pci/cdns-pcie.yaml vendor/device-tree/dist/Bindings/pci/intel-gw-pcie.yaml vendor/device-tree/dist/Bindings/pci/pci-ep.yaml vendor/device-tree/dist/Bindings/pci/pci-rcar-gen2.txt vendor/device-tree/dist/Bindings/pci/rcar-pci.txt vendor/device-tree/dist/Bindings/phy/amlogic,meson-axg-mipi-pcie-analog.yaml vendor/device-tree/dist/Bindings/phy/amlogic,meson-axg-pcie.yaml vendor/device-tree/dist/Bindings/phy/intel,lgm-emmc-phy.yaml vendor/device-tree/dist/Bindings/phy/phy-cadence-torrent.yaml vendor/device-tree/dist/Bindings/phy/qcom,qusb2-phy.yaml vendor/device-tree/dist/Bindings/phy/rcar-gen2-phy.txt vendor/device-tree/dist/Bindings/phy/rockchip,px30-dsi-dphy.yaml vendor/device-tree/dist/Bindings/pinctrl/allwinner,sun4i-a10-pinctrl.yaml vendor/device-tree/dist/Bindings/pinctrl/aspeed,ast2400-pinctrl.yaml vendor/device-tree/dist/Bindings/pinctrl/aspeed,ast2500-pinctrl.yaml vendor/device-tree/dist/Bindings/pinctrl/aspeed,ast2600-pinctrl.yaml vendor/device-tree/dist/Bindings/pinctrl/brcm,bcm2835-gpio.txt vendor/device-tree/dist/Bindings/pinctrl/fsl,imx8mm-pinctrl.yaml vendor/device-tree/dist/Bindings/pinctrl/fsl,imx8mn-pinctrl.yaml vendor/device-tree/dist/Bindings/pinctrl/fsl,imx8mp-pinctrl.yaml vendor/device-tree/dist/Bindings/pinctrl/fsl,imx8mq-pinctrl.yaml vendor/device-tree/dist/Bindings/pinctrl/intel,lgm-io.yaml vendor/device-tree/dist/Bindings/pinctrl/mscc,ocelot-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/pinmux-node.yaml vendor/device-tree/dist/Bindings/pinctrl/qcom,ipq6018-pinctrl.yaml vendor/device-tree/dist/Bindings/pinctrl/renesas,pfc-pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/rockchip,pinctrl.txt vendor/device-tree/dist/Bindings/pinctrl/st,stm32-pinctrl.yaml vendor/device-tree/dist/Bindings/power/amlogic,meson-ee-pwrc.yaml vendor/device-tree/dist/Bindings/power/qcom,rpmpd.yaml vendor/device-tree/dist/Bindings/power/renesas,apmu.yaml vendor/device-tree/dist/Bindings/power/renesas,rcar-sysc.yaml vendor/device-tree/dist/Bindings/power/reset/syscon-reboot.yaml vendor/device-tree/dist/Bindings/power/supply/battery.txt vendor/device-tree/dist/Bindings/power/supply/power_supply.txt vendor/device-tree/dist/Bindings/property-units.txt vendor/device-tree/dist/Bindings/pwm/pwm-samsung.yaml vendor/device-tree/dist/Bindings/pwm/renesas,pwm-rcar.yaml vendor/device-tree/dist/Bindings/regulator/gpio-regulator.yaml vendor/device-tree/dist/Bindings/regulator/mps,mp5416.yaml vendor/device-tree/dist/Bindings/regulator/mps,mpq7920.yaml vendor/device-tree/dist/Bindings/regulator/regulator.yaml vendor/device-tree/dist/Bindings/regulator/rohm,bd71828-regulator.yaml vendor/device-tree/dist/Bindings/regulator/rohm,bd71837-regulator.yaml vendor/device-tree/dist/Bindings/regulator/rohm,bd71847-regulator.yaml vendor/device-tree/dist/Bindings/regulator/st,stm32-booster.yaml vendor/device-tree/dist/Bindings/regulator/st,stm32mp1-pwr-reg.yaml vendor/device-tree/dist/Bindings/remoteproc/qcom,adsp.txt vendor/device-tree/dist/Bindings/remoteproc/qcom,q6v5.txt vendor/device-tree/dist/Bindings/remoteproc/st,stm32-rproc.yaml vendor/device-tree/dist/Bindings/reserved-memory/ramoops.txt vendor/device-tree/dist/Bindings/reserved-memory/reserved-memory.txt vendor/device-tree/dist/Bindings/reset/brcm,bcm7216-pcie-sata-rescal.yaml vendor/device-tree/dist/Bindings/reset/fsl,imx7-src.txt vendor/device-tree/dist/Bindings/reset/intel,rcu-gw.yaml vendor/device-tree/dist/Bindings/reset/renesas,rst.yaml vendor/device-tree/dist/Bindings/riscv/cpus.yaml vendor/device-tree/dist/Bindings/rtc/renesas,sh-rtc.yaml vendor/device-tree/dist/Bindings/rtc/st,stm32-rtc.yaml vendor/device-tree/dist/Bindings/serial/amlogic,meson-uart.yaml vendor/device-tree/dist/Bindings/serial/nxp,sc16is7xx.txt vendor/device-tree/dist/Bindings/serial/pl011.yaml vendor/device-tree/dist/Bindings/serial/renesas,hscif.yaml vendor/device-tree/dist/Bindings/serial/renesas,scif.yaml vendor/device-tree/dist/Bindings/serial/renesas,scifa.yaml vendor/device-tree/dist/Bindings/serial/renesas,scifb.yaml vendor/device-tree/dist/Bindings/serial/rs485.yaml vendor/device-tree/dist/Bindings/serial/samsung_uart.yaml vendor/device-tree/dist/Bindings/serial/serial.yaml vendor/device-tree/dist/Bindings/serial/sifive-serial.yaml vendor/device-tree/dist/Bindings/serial/st,stm32-uart.yaml vendor/device-tree/dist/Bindings/soc/amlogic/amlogic,canvas.yaml vendor/device-tree/dist/Bindings/soc/qcom/qcom,aoss-qmp.txt vendor/device-tree/dist/Bindings/soc/qcom/qcom,apr.txt vendor/device-tree/dist/Bindings/sound/adi,adau7118.yaml vendor/device-tree/dist/Bindings/sound/allwinner,sun4i-a10-codec.yaml vendor/device-tree/dist/Bindings/sound/amlogic,aiu.yaml vendor/device-tree/dist/Bindings/sound/amlogic,g12a-toacodec.yaml vendor/device-tree/dist/Bindings/sound/amlogic,t9015.yaml vendor/device-tree/dist/Bindings/sound/audio-graph-card.txt vendor/device-tree/dist/Bindings/sound/da7213.txt vendor/device-tree/dist/Bindings/sound/fsl,asrc.txt vendor/device-tree/dist/Bindings/sound/fsl,esai.txt vendor/device-tree/dist/Bindings/sound/nau8810.txt vendor/device-tree/dist/Bindings/sound/nau8825.txt vendor/device-tree/dist/Bindings/sound/nvidia,tegra-audio-wm8903.txt vendor/device-tree/dist/Bindings/sound/qcom,lpass-cpu.txt vendor/device-tree/dist/Bindings/sound/qcom,q6adm.txt vendor/device-tree/dist/Bindings/sound/qcom,q6afe.txt vendor/device-tree/dist/Bindings/sound/qcom,q6asm.txt vendor/device-tree/dist/Bindings/sound/qcom,q6core.txt vendor/device-tree/dist/Bindings/sound/qcom,wcd934x.yaml vendor/device-tree/dist/Bindings/sound/renesas,fsi.yaml vendor/device-tree/dist/Bindings/sound/renesas,rsnd.txt vendor/device-tree/dist/Bindings/sound/rockchip-i2s.yaml vendor/device-tree/dist/Bindings/sound/st,sti-asoc-card.txt vendor/device-tree/dist/Bindings/sound/tdm-slot.txt vendor/device-tree/dist/Bindings/sound/tlv320adcx140.yaml vendor/device-tree/dist/Bindings/sound/wm8994.txt vendor/device-tree/dist/Bindings/spi/amlogic,meson-gx-spicc.yaml vendor/device-tree/dist/Bindings/spi/brcm,spi-bcm-qspi.txt vendor/device-tree/dist/Bindings/spi/qcom,spi-geni-qcom.txt vendor/device-tree/dist/Bindings/spi/qcom,spi-qcom-qspi.yaml vendor/device-tree/dist/Bindings/spi/renesas,hspi.yaml vendor/device-tree/dist/Bindings/spi/renesas,sh-msiof.yaml vendor/device-tree/dist/Bindings/spi/spi-controller.yaml vendor/device-tree/dist/Bindings/spi/spi-pl022.yaml vendor/device-tree/dist/Bindings/spi/spi-sifive.yaml vendor/device-tree/dist/Bindings/spi/st,stm32-qspi.yaml vendor/device-tree/dist/Bindings/spi/ti_qspi.txt vendor/device-tree/dist/Bindings/sram/allwinner,sun4i-a10-system-control.yaml vendor/device-tree/dist/Bindings/sram/sram.yaml vendor/device-tree/dist/Bindings/thermal/amlogic,thermal.yaml vendor/device-tree/dist/Bindings/thermal/qcom-tsens.yaml vendor/device-tree/dist/Bindings/thermal/rcar-thermal.yaml vendor/device-tree/dist/Bindings/thermal/sprd-thermal.yaml vendor/device-tree/dist/Bindings/timer/arm,arch_timer.yaml vendor/device-tree/dist/Bindings/timer/arm,arch_timer_mmio.yaml vendor/device-tree/dist/Bindings/timer/csky,mptimer.txt vendor/device-tree/dist/Bindings/ufs/ti,j721e-ufs.yaml vendor/device-tree/dist/Bindings/usb/amlogic,meson-g12a-usb-ctrl.yaml vendor/device-tree/dist/Bindings/usb/aspeed,usb-vhub.yaml vendor/device-tree/dist/Bindings/usb/atmel-usb.txt vendor/device-tree/dist/Bindings/usb/dwc2.yaml vendor/device-tree/dist/Bindings/usb/dwc3.txt vendor/device-tree/dist/Bindings/usb/generic-ehci.yaml vendor/device-tree/dist/Bindings/usb/generic-ohci.yaml vendor/device-tree/dist/Bindings/usb/ingenic,musb.yaml vendor/device-tree/dist/Bindings/usb/nvidia,tegra-xudc.yaml vendor/device-tree/dist/Bindings/usb/renesas,usb3-peri.yaml vendor/device-tree/dist/Bindings/usb/renesas,usbhs.yaml vendor/device-tree/dist/Bindings/usb/ti,j721e-usb.yaml vendor/device-tree/dist/Bindings/usb/usb-xhci.txt vendor/device-tree/dist/Bindings/vendor-prefixes.yaml vendor/device-tree/dist/Bindings/watchdog/ti,rti-wdt.yaml vendor/device-tree/dist/Bindings/xilinx.txt vendor/device-tree/dist/include/dt-bindings/clock/at91.h vendor/device-tree/dist/include/dt-bindings/clock/imx7ulp-clock.h vendor/device-tree/dist/include/dt-bindings/clock/imx8mp-clock.h vendor/device-tree/dist/include/dt-bindings/clock/marvell,mmp2.h vendor/device-tree/dist/include/dt-bindings/clock/meson8b-clkc.h vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8998.h vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-sc7180.h vendor/device-tree/dist/include/dt-bindings/clock/sprd,sc9863a-clk.h vendor/device-tree/dist/include/dt-bindings/clock/tegra114-car.h vendor/device-tree/dist/include/dt-bindings/clock/tegra124-car-common.h vendor/device-tree/dist/include/dt-bindings/clock/tegra20-car.h vendor/device-tree/dist/include/dt-bindings/clock/tegra210-car.h vendor/device-tree/dist/include/dt-bindings/clock/tegra30-car.h vendor/device-tree/dist/include/dt-bindings/clock/x1000-cgu.h vendor/device-tree/dist/include/dt-bindings/firmware/imx/rsrc.h vendor/device-tree/dist/include/dt-bindings/input/linux-event-codes.h vendor/device-tree/dist/include/dt-bindings/phy/phy.h vendor/device-tree/dist/include/dt-bindings/pinctrl/rockchip.h vendor/device-tree/dist/include/dt-bindings/power/qcom-rpmpd.h vendor/device-tree/dist/include/dt-bindings/reset/amlogic,meson-gxbb-reset.h vendor/device-tree/dist/include/dt-bindings/reset/imx8mq-reset.h vendor/device-tree/dist/include/dt-bindings/reset/realtek,rtd1295.h vendor/device-tree/dist/src/arm/am335x-baltos.dtsi vendor/device-tree/dist/src/arm/am335x-boneblack-common.dtsi vendor/device-tree/dist/src/arm/am335x-boneblack-wireless.dts vendor/device-tree/dist/src/arm/am335x-boneblue.dts vendor/device-tree/dist/src/arm/am335x-bonegreen-wireless.dts vendor/device-tree/dist/src/arm/am335x-evm.dts vendor/device-tree/dist/src/arm/am335x-evmsk.dts vendor/device-tree/dist/src/arm/am335x-guardian.dts vendor/device-tree/dist/src/arm/am335x-lxm.dts vendor/device-tree/dist/src/arm/am335x-moxa-uc-2100-common.dtsi vendor/device-tree/dist/src/arm/am335x-moxa-uc-8100-me-t.dts vendor/device-tree/dist/src/arm/am335x-pepper.dts vendor/device-tree/dist/src/arm/am335x-phycore-som.dtsi vendor/device-tree/dist/src/arm/am335x-pocketbeagle.dts vendor/device-tree/dist/src/arm/am33xx-l4.dtsi vendor/device-tree/dist/src/arm/am33xx.dtsi vendor/device-tree/dist/src/arm/am3517-evm.dts vendor/device-tree/dist/src/arm/am3517.dtsi vendor/device-tree/dist/src/arm/am4372.dtsi vendor/device-tree/dist/src/arm/am437x-cm-t43.dts vendor/device-tree/dist/src/arm/am437x-gp-evm.dts vendor/device-tree/dist/src/arm/am437x-l4.dtsi vendor/device-tree/dist/src/arm/am437x-sk-evm.dts vendor/device-tree/dist/src/arm/am43x-epos-evm.dts vendor/device-tree/dist/src/arm/am571x-idk.dts vendor/device-tree/dist/src/arm/am572x-idk-common.dtsi vendor/device-tree/dist/src/arm/am57xx-beagle-x15-common.dtsi vendor/device-tree/dist/src/arm/am57xx-idk-common.dtsi vendor/device-tree/dist/src/arm/armada-370-xp.dtsi vendor/device-tree/dist/src/arm/armada-375.dtsi vendor/device-tree/dist/src/arm/armada-38x.dtsi vendor/device-tree/dist/src/arm/armada-39x.dtsi vendor/device-tree/dist/src/arm/aspeed-ast2600-evb.dts vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-tiogapass.dts vendor/device-tree/dist/src/arm/aspeed-bmc-ibm-rainier.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-mihawk.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-romulus.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-tacoma.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-witherspoon.dts vendor/device-tree/dist/src/arm/aspeed-bmc-opp-zaius.dts vendor/device-tree/dist/src/arm/aspeed-g4.dtsi vendor/device-tree/dist/src/arm/aspeed-g5.dtsi vendor/device-tree/dist/src/arm/aspeed-g6.dtsi vendor/device-tree/dist/src/arm/at91-dvk_su60_somc.dtsi vendor/device-tree/dist/src/arm/at91-kizbox3-hs.dts vendor/device-tree/dist/src/arm/at91-kizbox3_common.dtsi vendor/device-tree/dist/src/arm/at91-sam9x60ek.dts vendor/device-tree/dist/src/arm/at91-sama5d27_som1.dtsi vendor/device-tree/dist/src/arm/at91-sama5d27_som1_ek.dts vendor/device-tree/dist/src/arm/at91-sama5d27_wlsom1.dtsi vendor/device-tree/dist/src/arm/at91-sama5d27_wlsom1_ek.dts vendor/device-tree/dist/src/arm/at91-sama5d2_ptc_ek.dts vendor/device-tree/dist/src/arm/at91-sama5d2_xplained.dts vendor/device-tree/dist/src/arm/at91-wb50n.dtsi vendor/device-tree/dist/src/arm/at91rm9200.dtsi vendor/device-tree/dist/src/arm/at91sam9g45.dtsi vendor/device-tree/dist/src/arm/at91sam9m10g45ek.dts vendor/device-tree/dist/src/arm/at91sam9n12.dtsi vendor/device-tree/dist/src/arm/at91sam9n12ek.dts vendor/device-tree/dist/src/arm/at91sam9rl.dtsi vendor/device-tree/dist/src/arm/at91sam9x5.dtsi vendor/device-tree/dist/src/arm/bcm-nsp.dtsi vendor/device-tree/dist/src/arm/bcm2711-rpi-4-b.dts vendor/device-tree/dist/src/arm/bcm2835-common.dtsi vendor/device-tree/dist/src/arm/bcm2835.dtsi vendor/device-tree/dist/src/arm/bcm2836.dtsi vendor/device-tree/dist/src/arm/bcm2837.dtsi vendor/device-tree/dist/src/arm/bcm47094-luxul-xwc-2000.dts vendor/device-tree/dist/src/arm/bcm958522er.dts vendor/device-tree/dist/src/arm/bcm958525er.dts vendor/device-tree/dist/src/arm/bcm958525xmc.dts vendor/device-tree/dist/src/arm/bcm958622hr.dts vendor/device-tree/dist/src/arm/bcm958623hr.dts vendor/device-tree/dist/src/arm/bcm958625hr.dts vendor/device-tree/dist/src/arm/bcm958625k.dts vendor/device-tree/dist/src/arm/berlin2.dtsi vendor/device-tree/dist/src/arm/berlin2cd.dtsi vendor/device-tree/dist/src/arm/berlin2q.dtsi vendor/device-tree/dist/src/arm/dm814x.dtsi vendor/device-tree/dist/src/arm/dm816x.dtsi vendor/device-tree/dist/src/arm/dove.dtsi vendor/device-tree/dist/src/arm/dra7-evm-common.dtsi vendor/device-tree/dist/src/arm/dra7-evm.dts vendor/device-tree/dist/src/arm/dra7-l4.dtsi vendor/device-tree/dist/src/arm/dra7.dtsi vendor/device-tree/dist/src/arm/dra71-evm.dts vendor/device-tree/dist/src/arm/dra72-evm-common.dtsi vendor/device-tree/dist/src/arm/dra72-evm-revc.dts vendor/device-tree/dist/src/arm/dra72-evm.dts vendor/device-tree/dist/src/arm/dra72x.dtsi vendor/device-tree/dist/src/arm/dra74x.dtsi vendor/device-tree/dist/src/arm/dra76-evm.dts vendor/device-tree/dist/src/arm/e60k02.dtsi vendor/device-tree/dist/src/arm/exynos3250-monk.dts vendor/device-tree/dist/src/arm/exynos3250-rinato.dts vendor/device-tree/dist/src/arm/exynos4210-origen.dts vendor/device-tree/dist/src/arm/exynos4210-trats.dts vendor/device-tree/dist/src/arm/exynos4210-universal_c210.dts vendor/device-tree/dist/src/arm/exynos4412-galaxy-s3.dtsi vendor/device-tree/dist/src/arm/exynos4412-midas.dtsi vendor/device-tree/dist/src/arm/exynos4412-odroid-common.dtsi vendor/device-tree/dist/src/arm/exynos4412-origen.dts vendor/device-tree/dist/src/arm/exynos5250-arndale.dts vendor/device-tree/dist/src/arm/exynos5420-arndale-octa.dts vendor/device-tree/dist/src/arm/imx50.dtsi vendor/device-tree/dist/src/arm/imx51.dtsi vendor/device-tree/dist/src/arm/imx53-cx9020.dts vendor/device-tree/dist/src/arm/imx53.dtsi vendor/device-tree/dist/src/arm/imx6q-dhcom-pdk2.dts vendor/device-tree/dist/src/arm/imx6qdl-colibri.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw551x.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw552x.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw560x.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw5904.dtsi vendor/device-tree/dist/src/arm/imx6qdl-gw5910.dtsi vendor/device-tree/dist/src/arm/imx6qdl-icore.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sabresd.dtsi vendor/device-tree/dist/src/arm/imx6qdl-sr-som.dtsi vendor/device-tree/dist/src/arm/imx6qdl.dtsi vendor/device-tree/dist/src/arm/imx6sl.dtsi vendor/device-tree/dist/src/arm/imx6sx-sabreauto.dts vendor/device-tree/dist/src/arm/imx6sx-sdb.dtsi vendor/device-tree/dist/src/arm/imx6sx.dtsi vendor/device-tree/dist/src/arm/imx6ul-kontron-n6x1x-s.dtsi vendor/device-tree/dist/src/arm/imx6ul-kontron-n6x1x-som-common.dtsi vendor/device-tree/dist/src/arm/imx6ul.dtsi vendor/device-tree/dist/src/arm/imx7-tqma7.dtsi vendor/device-tree/dist/src/arm/imx7d-cl-som-imx7.dts vendor/device-tree/dist/src/arm/imx7d-colibri.dtsi vendor/device-tree/dist/src/arm/imx7d-nitrogen7.dts vendor/device-tree/dist/src/arm/imx7d-pinfunc.h vendor/device-tree/dist/src/arm/imx7d-sdb.dts vendor/device-tree/dist/src/arm/imx7d-tqma7.dtsi vendor/device-tree/dist/src/arm/imx7d-zii-rmu2.dts vendor/device-tree/dist/src/arm/imx7d-zii-rpu2.dts vendor/device-tree/dist/src/arm/imx7d.dtsi vendor/device-tree/dist/src/arm/imx7s.dtsi vendor/device-tree/dist/src/arm/integratorap.dts vendor/device-tree/dist/src/arm/keystone-k2e.dtsi vendor/device-tree/dist/src/arm/keystone-k2g-evm.dts vendor/device-tree/dist/src/arm/keystone-k2g.dtsi vendor/device-tree/dist/src/arm/keystone-k2hk.dtsi vendor/device-tree/dist/src/arm/keystone-k2l.dtsi vendor/device-tree/dist/src/arm/kirkwood-netgear_readynas_nv+_v2.dts vendor/device-tree/dist/src/arm/kirkwood.dtsi vendor/device-tree/dist/src/arm/logicpd-torpedo-baseboard.dtsi vendor/device-tree/dist/src/arm/ls1021a-twr.dts vendor/device-tree/dist/src/arm/meson.dtsi vendor/device-tree/dist/src/arm/meson8b-odroidc1.dts vendor/device-tree/dist/src/arm/meson8b.dtsi vendor/device-tree/dist/src/arm/meson8m2-mxiii-plus.dts vendor/device-tree/dist/src/arm/meson8m2.dtsi vendor/device-tree/dist/src/arm/mmp2.dtsi vendor/device-tree/dist/src/arm/mmp3.dtsi vendor/device-tree/dist/src/arm/motorola-cpcap-mapphone.dtsi vendor/device-tree/dist/src/arm/mt2701-evb.dts vendor/device-tree/dist/src/arm/mt2701.dtsi vendor/device-tree/dist/src/arm/mt7623.dtsi vendor/device-tree/dist/src/arm/mt7623n-rfb-emmc.dts vendor/device-tree/dist/src/arm/omap2.dtsi vendor/device-tree/dist/src/arm/omap2420.dtsi vendor/device-tree/dist/src/arm/omap2430.dtsi vendor/device-tree/dist/src/arm/omap3-beagle.dts vendor/device-tree/dist/src/arm/omap3-devkit8000.dts vendor/device-tree/dist/src/arm/omap3-gta04.dtsi vendor/device-tree/dist/src/arm/omap3-n900.dts vendor/device-tree/dist/src/arm/omap3.dtsi vendor/device-tree/dist/src/arm/omap4-duovero-parlor.dts vendor/device-tree/dist/src/arm/omap4-l4.dtsi vendor/device-tree/dist/src/arm/omap4.dtsi vendor/device-tree/dist/src/arm/omap5-l4.dtsi vendor/device-tree/dist/src/arm/omap5.dtsi vendor/device-tree/dist/src/arm/pxa168.dtsi vendor/device-tree/dist/src/arm/pxa3xx.dtsi vendor/device-tree/dist/src/arm/pxa910.dtsi vendor/device-tree/dist/src/arm/qcom-ipq4019.dtsi vendor/device-tree/dist/src/arm/qcom-ipq8064.dtsi vendor/device-tree/dist/src/arm/qcom-msm8974-samsung-klte.dts vendor/device-tree/dist/src/arm/qcom-msm8974.dtsi vendor/device-tree/dist/src/arm/r8a7740.dtsi vendor/device-tree/dist/src/arm/r8a7743.dtsi vendor/device-tree/dist/src/arm/r8a7744.dtsi vendor/device-tree/dist/src/arm/r8a7745.dtsi vendor/device-tree/dist/src/arm/r8a7790.dtsi vendor/device-tree/dist/src/arm/r8a7791.dtsi vendor/device-tree/dist/src/arm/r8a7793.dtsi vendor/device-tree/dist/src/arm/r8a7794.dtsi vendor/device-tree/dist/src/arm/rk3036-kylin.dts vendor/device-tree/dist/src/arm/rk3066a-mk808.dts vendor/device-tree/dist/src/arm/rk3188-radxarock.dts vendor/device-tree/dist/src/arm/rk3229-xms6.dts vendor/device-tree/dist/src/arm/rk322x.dtsi vendor/device-tree/dist/src/arm/rk3288-firefly-reload.dts vendor/device-tree/dist/src/arm/rk3288-firefly.dtsi vendor/device-tree/dist/src/arm/rk3288-miqi.dts vendor/device-tree/dist/src/arm/rk3288-phycore-som.dtsi vendor/device-tree/dist/src/arm/rk3288-rock2-square.dts vendor/device-tree/dist/src/arm/rk3288-tinker.dtsi vendor/device-tree/dist/src/arm/rk3288.dtsi vendor/device-tree/dist/src/arm/s5pv210-aries.dtsi vendor/device-tree/dist/src/arm/s5pv210-fascinate4g.dts vendor/device-tree/dist/src/arm/s5pv210-galaxys.dts vendor/device-tree/dist/src/arm/s5pv210-pinctrl.dtsi vendor/device-tree/dist/src/arm/s5pv210.dtsi vendor/device-tree/dist/src/arm/sama5d2.dtsi vendor/device-tree/dist/src/arm/sama5d3.dtsi vendor/device-tree/dist/src/arm/sama5d3_can.dtsi vendor/device-tree/dist/src/arm/sama5d3_emac.dtsi vendor/device-tree/dist/src/arm/sama5d3_gmac.dtsi vendor/device-tree/dist/src/arm/sama5d3_lcd.dtsi vendor/device-tree/dist/src/arm/sama5d3_mci2.dtsi vendor/device-tree/dist/src/arm/sama5d3_tcb1.dtsi vendor/device-tree/dist/src/arm/sama5d3_uart.dtsi vendor/device-tree/dist/src/arm/sama5d3xmb.dtsi vendor/device-tree/dist/src/arm/sama5d3xmb_cmp.dtsi vendor/device-tree/dist/src/arm/sama5d4.dtsi vendor/device-tree/dist/src/arm/sh73a0.dtsi vendor/device-tree/dist/src/arm/socfpga.dtsi vendor/device-tree/dist/src/arm/socfpga_arria10.dtsi vendor/device-tree/dist/src/arm/ste-ux500-samsung-golden.dts vendor/device-tree/dist/src/arm/ste-ux500-samsung-skomer.dts vendor/device-tree/dist/src/arm/stih407-family.dtsi vendor/device-tree/dist/src/arm/stih418.dtsi vendor/device-tree/dist/src/arm/stm32f429.dtsi vendor/device-tree/dist/src/arm/stm32h743.dtsi vendor/device-tree/dist/src/arm/stm32mp15-pinctrl.dtsi vendor/device-tree/dist/src/arm/stm32mp151.dtsi vendor/device-tree/dist/src/arm/stm32mp157.dtsi vendor/device-tree/dist/src/arm/stm32mp157a-avenger96.dts vendor/device-tree/dist/src/arm/stm32mp157c-dhcom-pdk2.dts vendor/device-tree/dist/src/arm/stm32mp157c-dk2.dts vendor/device-tree/dist/src/arm/stm32mp157c-ed1.dts vendor/device-tree/dist/src/arm/stm32mp157c-ev1.dts vendor/device-tree/dist/src/arm/stm32mp15xx-dkx.dtsi vendor/device-tree/dist/src/arm/sun4i-a10.dtsi vendor/device-tree/dist/src/arm/sun5i.dtsi vendor/device-tree/dist/src/arm/sun7i-a20.dtsi vendor/device-tree/dist/src/arm/sun8i-a83t.dtsi vendor/device-tree/dist/src/arm/sun8i-h2-plus-bananapi-m2-zero.dts vendor/device-tree/dist/src/arm/sun8i-h3.dtsi vendor/device-tree/dist/src/arm/sunxi-h3-h5.dtsi vendor/device-tree/dist/src/arm/tegra114-dalmore.dts vendor/device-tree/dist/src/arm/tegra124-venice2.dts vendor/device-tree/dist/src/arm/tegra20-colibri-eval-v3.dts vendor/device-tree/dist/src/arm/tegra20-colibri-iris.dts vendor/device-tree/dist/src/arm/tegra20-harmony.dts vendor/device-tree/dist/src/arm/tegra20-medcom-wide.dts vendor/device-tree/dist/src/arm/tegra20-paz00.dts vendor/device-tree/dist/src/arm/tegra20-seaboard.dts vendor/device-tree/dist/src/arm/tegra20-ventana.dts vendor/device-tree/dist/src/arm/tegra30-apalis-eval.dts vendor/device-tree/dist/src/arm/tegra30-apalis-v1.1-eval.dts vendor/device-tree/dist/src/arm/tegra30-beaver.dts vendor/device-tree/dist/src/arm/tegra30-cardhu.dtsi vendor/device-tree/dist/src/arm/tegra30-colibri-eval-v3.dts vendor/device-tree/dist/src/arm/uniphier-ld4.dtsi vendor/device-tree/dist/src/arm/uniphier-ld6b-ref.dts vendor/device-tree/dist/src/arm/uniphier-pro4-ace.dts vendor/device-tree/dist/src/arm/uniphier-pro4-ref.dts vendor/device-tree/dist/src/arm/uniphier-pro4-sanji.dts vendor/device-tree/dist/src/arm/uniphier-pro4.dtsi vendor/device-tree/dist/src/arm/uniphier-pro5.dtsi vendor/device-tree/dist/src/arm/uniphier-pxs2-gentil.dts vendor/device-tree/dist/src/arm/uniphier-pxs2-vodka.dts vendor/device-tree/dist/src/arm/uniphier-pxs2.dtsi vendor/device-tree/dist/src/arm/uniphier-sld8.dtsi vendor/device-tree/dist/src/arm/vexpress-v2m-rs1.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64-olinuxino.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-a64.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-beelink-gs1.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-orangepi-3.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-orangepi-lite2.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-orangepi.dtsi vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-pine-h64.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-tanix-tx6.dts vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6.dtsi vendor/device-tree/dist/src/arm64/altera/socfpga_stratix10.dtsi vendor/device-tree/dist/src/arm64/altera/socfpga_stratix10_socdk.dts vendor/device-tree/dist/src/arm64/altera/socfpga_stratix10_socdk_nand.dts vendor/device-tree/dist/src/arm64/amlogic/meson-axg.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-g12-common.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-g12.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-khadas-vim3.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-s922x.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-ugoos-am6.dts vendor/device-tree/dist/src/arm64/amlogic/meson-g12b.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gx-libretech-pc.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gx-p23x-q20x.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gx.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-kii-pro.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-nanopi-k2.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-nexbox-a95x.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-odroidc2.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-vega-s95.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-wetek-play2.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb-wetek.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxbb.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s805x-libretech-ac.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s805x-p241.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905d-phicomm-n1.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905w-p281.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905w-tx3-mini.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905x-p212.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxl.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-khadas-vim2.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-nexbox-a1.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-rbox-pro.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxm-vega-s96.dts vendor/device-tree/dist/src/arm64/amlogic/meson-gxm.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-khadas-vim3.dtsi vendor/device-tree/dist/src/arm64/amlogic/meson-sm1-sei610.dts vendor/device-tree/dist/src/arm64/amlogic/meson-sm1.dtsi vendor/device-tree/dist/src/arm64/arm/foundation-v8-gicv2.dtsi vendor/device-tree/dist/src/arm64/arm/foundation-v8-gicv3.dtsi vendor/device-tree/dist/src/arm64/arm/foundation-v8.dtsi vendor/device-tree/dist/src/arm64/arm/fvp-base-revc.dts vendor/device-tree/dist/src/arm64/arm/juno-base.dtsi vendor/device-tree/dist/src/arm64/arm/juno-motherboard.dtsi vendor/device-tree/dist/src/arm64/arm/rtsm_ve-aemv8a.dts vendor/device-tree/dist/src/arm64/arm/rtsm_ve-motherboard-rs2.dtsi vendor/device-tree/dist/src/arm64/arm/rtsm_ve-motherboard.dtsi vendor/device-tree/dist/src/arm64/arm/vexpress-v2m-rs1.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-frdm.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-frwy.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-qds.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a-rdb.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1012a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1028a-kontron-sl28-var2.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1028a-kontron-sl28.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1028a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-ls1043a-rdb.dts vendor/device-tree/dist/src/arm64/freescale/fsl-ls1043a.dtsi vendor/device-tree/dist/src/arm64/freescale/fsl-lx2160a.dtsi vendor/device-tree/dist/src/arm64/freescale/imx8mm-evk.dts vendor/device-tree/dist/src/arm64/freescale/imx8mm.dtsi vendor/device-tree/dist/src/arm64/freescale/imx8mn-ddr4-evk.dts vendor/device-tree/dist/src/arm64/freescale/imx8mn.dtsi vendor/device-tree/dist/src/arm64/freescale/imx8mp.dtsi vendor/device-tree/dist/src/arm64/freescale/imx8mq-librem5-devkit.dts vendor/device-tree/dist/src/arm64/freescale/imx8mq.dtsi vendor/device-tree/dist/src/arm64/freescale/imx8qxp-mek.dts vendor/device-tree/dist/src/arm64/freescale/imx8qxp.dtsi vendor/device-tree/dist/src/arm64/freescale/qoriq-fman3-0.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi3660.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hi6220-coresight.dtsi vendor/device-tree/dist/src/arm64/hisilicon/hikey960-pinctrl.dtsi vendor/device-tree/dist/src/arm64/intel/socfpga_agilex.dtsi vendor/device-tree/dist/src/arm64/intel/socfpga_agilex_socdk.dts vendor/device-tree/dist/src/arm64/marvell/armada-3720-db.dts vendor/device-tree/dist/src/arm64/marvell/armada-3720-espressobin.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-3720-turris-mox.dts vendor/device-tree/dist/src/arm64/marvell/armada-3720-uDPU.dts vendor/device-tree/dist/src/arm64/marvell/armada-37xx.dtsi vendor/device-tree/dist/src/arm64/marvell/armada-8040-clearfog-gt-8k.dts vendor/device-tree/dist/src/arm64/marvell/armada-8040-mcbin-singleshot.dts vendor/device-tree/dist/src/arm64/marvell/armada-8040-mcbin.dts vendor/device-tree/dist/src/arm64/marvell/armada-ap80x.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt2712-evb.dts vendor/device-tree/dist/src/arm64/mediatek/mt2712e.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt6797-x20-dev.dts vendor/device-tree/dist/src/arm64/mediatek/mt6797.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt7622-bananapi-bpi-r64.dts vendor/device-tree/dist/src/arm64/mediatek/mt7622-rfb1.dts vendor/device-tree/dist/src/arm64/mediatek/mt7622.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt8173.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt8183-evb.dts vendor/device-tree/dist/src/arm64/mediatek/mt8183.dtsi vendor/device-tree/dist/src/arm64/mediatek/mt8516.dtsi vendor/device-tree/dist/src/arm64/mediatek/pumpkin-common.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra132-norrin.dts vendor/device-tree/dist/src/arm64/nvidia/tegra186-p3310.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra194-p2888.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra194.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra210-p2180.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra210-p2597.dtsi vendor/device-tree/dist/src/arm64/nvidia/tegra210-p3450-0000.dts vendor/device-tree/dist/src/arm64/nvidia/tegra210.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8016-sbc.dtsi vendor/device-tree/dist/src/arm64/qcom/apq8096-db820c.dtsi vendor/device-tree/dist/src/arm64/qcom/ipq8074-hk01.dts vendor/device-tree/dist/src/arm64/qcom/ipq8074.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8916-longcheer-l8150.dts vendor/device-tree/dist/src/arm64/qcom/msm8916-pins.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8916-samsung-a2015-common.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8916-samsung-a3u-eur.dts vendor/device-tree/dist/src/arm64/qcom/msm8916-samsung-a5u-eur.dts vendor/device-tree/dist/src/arm64/qcom/msm8916.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8996.dtsi vendor/device-tree/dist/src/arm64/qcom/msm8998.dtsi vendor/device-tree/dist/src/arm64/qcom/pm8150.dtsi vendor/device-tree/dist/src/arm64/qcom/pm8150b.dtsi vendor/device-tree/dist/src/arm64/qcom/pm8150l.dtsi vendor/device-tree/dist/src/arm64/qcom/pmi8994.dtsi vendor/device-tree/dist/src/arm64/qcom/qcs404-evb.dtsi vendor/device-tree/dist/src/arm64/qcom/qcs404.dtsi vendor/device-tree/dist/src/arm64/qcom/sc7180-idp.dts vendor/device-tree/dist/src/arm64/qcom/sc7180.dtsi vendor/device-tree/dist/src/arm64/qcom/sdm845-cheza.dtsi vendor/device-tree/dist/src/arm64/qcom/sdm845-db845c.dts vendor/device-tree/dist/src/arm64/qcom/sdm845-mtp.dts vendor/device-tree/dist/src/arm64/qcom/sdm845.dtsi vendor/device-tree/dist/src/arm64/qcom/sdm850-lenovo-yoga-c630.dts vendor/device-tree/dist/src/arm64/qcom/sm8250-mtp.dts vendor/device-tree/dist/src/arm64/qcom/sm8250.dtsi vendor/device-tree/dist/src/arm64/realtek/rtd1293-ds418j.dts vendor/device-tree/dist/src/arm64/realtek/rtd1293.dtsi vendor/device-tree/dist/src/arm64/realtek/rtd1295-mele-v9.dts vendor/device-tree/dist/src/arm64/realtek/rtd1295-probox2-ava.dts vendor/device-tree/dist/src/arm64/realtek/rtd1295-zidoo-x9s.dts vendor/device-tree/dist/src/arm64/realtek/rtd1295.dtsi vendor/device-tree/dist/src/arm64/realtek/rtd1296-ds418.dts vendor/device-tree/dist/src/arm64/realtek/rtd1296.dtsi vendor/device-tree/dist/src/arm64/realtek/rtd129x.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a774a1.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a774b1.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a774c0.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77950.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77951.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77960.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77961.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77965.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77970.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77980.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77990.dtsi vendor/device-tree/dist/src/arm64/renesas/r8a77995.dtsi vendor/device-tree/dist/src/arm64/rockchip/px30.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3308-roc-cc.dts vendor/device-tree/dist/src/arm64/rockchip/rk3328-a1.dts vendor/device-tree/dist/src/arm64/rockchip/rk3328-roc-cc.dts vendor/device-tree/dist/src/arm64/rockchip/rk3328-rock64.dts vendor/device-tree/dist/src/arm64/rockchip/rk3328.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3368-geekbox.dts vendor/device-tree/dist/src/arm64/rockchip/rk3368-orion-r68-meta.dts vendor/device-tree/dist/src/arm64/rockchip/rk3368-r88.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-ficus.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-firefly.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-hugsun-x99.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-nanopi4.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399-orangepi.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-pinebook-pro.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-rock960.dts vendor/device-tree/dist/src/arm64/rockchip/rk3399-rockpro64.dtsi vendor/device-tree/dist/src/arm64/rockchip/rk3399.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11-global.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11-ref.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld11.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20-global.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20-ref.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20.dtsi vendor/device-tree/dist/src/arm64/socionext/uniphier-pxs3-ref.dts vendor/device-tree/dist/src/arm64/socionext/uniphier-pxs3.dtsi vendor/device-tree/dist/src/arm64/sprd/sc9863a.dtsi vendor/device-tree/dist/src/arm64/sprd/sharkl3.dtsi vendor/device-tree/dist/src/arm64/ti/k3-am65-main.dtsi vendor/device-tree/dist/src/arm64/ti/k3-am65-mcu.dtsi vendor/device-tree/dist/src/arm64/ti/k3-am65-wakeup.dtsi vendor/device-tree/dist/src/arm64/ti/k3-j721e-common-proc-board.dts vendor/device-tree/dist/src/arm64/ti/k3-j721e-main.dtsi vendor/device-tree/dist/src/arm64/ti/k3-j721e-mcu-wakeup.dtsi vendor/device-tree/dist/src/arm64/xilinx/zynqmp.dtsi vendor/device-tree/dist/src/mips/ingenic/ci20.dts vendor/device-tree/dist/src/mips/ingenic/gcw0.dts vendor/device-tree/dist/src/mips/ingenic/jz4740.dtsi vendor/device-tree/dist/src/mips/ingenic/jz4770.dtsi vendor/device-tree/dist/src/mips/ingenic/jz4780.dtsi vendor/device-tree/dist/src/mips/ingenic/x1000.dtsi vendor/device-tree/dist/src/mips/loongson/rs780e-pch.dtsi vendor/device-tree/dist/src/mips/mscc/ocelot.dtsi vendor/device-tree/dist/src/mips/qca/ar9331.dtsi vendor/device-tree/dist/src/mips/qca/ar9331_dpt_module.dts vendor/device-tree/dist/src/powerpc/pcm032.dts Added: vendor/device-tree/dist/Bindings/ABI.rst ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/ABI.rst Tue Aug 4 19:05:45 2020 (r363850) @@ -0,0 +1,42 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=================== +Devicetree (DT) ABI +=================== + +I. Regarding stable bindings/ABI, we quote from the 2013 ARM mini-summit + summary document: + + "That still leaves the question of, what does a stable binding look + like? Certainly a stable binding means that a newer kernel will not + break on an older device tree, but that doesn't mean the binding is + frozen for all time. Grant said there are ways to change bindings that + don't result in breakage. For instance, if a new property is added, + then default to the previous behaviour if it is missing. If a binding + truly needs an incompatible change, then change the compatible string + at the same time. The driver can bind against both the old and the + new. These guidelines aren't new, but they desperately need to be + documented." + +II. General binding rules + + 1) Maintainers, don't let perfect be the enemy of good. Don't hold up a + binding because it isn't perfect. + + 2) Use specific compatible strings so that if we need to add a feature (DMA) + in the future, we can create a new compatible string. See I. + + 3) Bindings can be augmented, but the driver shouldn't break when given + the old binding. ie. add additional properties, but don't change the + meaning of an existing property. For drivers, default to the original + behaviour when a newly added property is missing. + + 4) Don't submit bindings for staging or unstable. That will be decided by + the devicetree maintainers *after* discussion on the mailinglist. + +III. Notes + + 1) This document is intended as a general familiarization with the process as + decided at the 2013 Kernel Summit. When in doubt, the current word of the + devicetree maintainers overrules this document. In that situation, a patch + updating this document would be appreciated. Modified: vendor/device-tree/dist/Bindings/Makefile ============================================================================== --- vendor/device-tree/dist/Bindings/Makefile Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/Makefile Tue Aug 4 19:05:45 2020 (r363850) @@ -2,13 +2,20 @@ DT_DOC_CHECKER ?= dt-doc-validate DT_EXTRACT_EX ?= dt-extract-example DT_MK_SCHEMA ?= dt-mk-schema -DT_MK_SCHEMA_USERONLY_FLAG := $(if $(DT_SCHEMA_FILES), -u) +DT_SCHEMA_MIN_VERSION = 2020.5 + +PHONY += check_dtschema_version +check_dtschema_version: + @{ echo $(DT_SCHEMA_MIN_VERSION); \ + $(DT_DOC_CHECKER) --version 2>/dev/null || echo 0; } | sort -VC || \ + { echo "ERROR: dtschema minimum version is v$(DT_SCHEMA_MIN_VERSION)" >&2; false; } + quiet_cmd_chk_binding = CHKDT $(patsubst $(srctree)/%,%,$<) cmd_chk_binding = $(DT_DOC_CHECKER) -u $(srctree)/$(src) $< ; \ $(DT_EXTRACT_EX) $< > $@ -$(obj)/%.example.dts: $(src)/%.yaml FORCE +$(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE $(call if_changed,chk_binding) # Use full schemas when checking %.example.dts @@ -27,21 +34,40 @@ quiet_cmd_mk_schema = SCHEMA $@ DT_DOCS = $(shell $(find_cmd) | sed -e 's|^$(srctree)/||') -DT_SCHEMA_FILES ?= $(DT_DOCS) - -extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) -extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES)) -extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml - override DTC_FLAGS := \ -Wno-avoid_unnecessary_addr_size \ - -Wno-graph_child_address + -Wno-graph_child_address \ + -Wno-interrupt_provider -$(obj)/processed-schema-examples.yaml: $(DT_DOCS) FORCE +$(obj)/processed-schema-examples.yaml: $(DT_DOCS) check_dtschema_version FORCE $(call if_changed,mk_schema) -$(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := $(DT_MK_SCHEMA_USERONLY_FLAG) -$(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) FORCE +ifeq ($(DT_SCHEMA_FILES),) + +# Unless DT_SCHEMA_FILES is specified, use the full schema for dtbs_check too. +# Just copy processed-schema-examples.yaml + +$(obj)/processed-schema.yaml: $(obj)/processed-schema-examples.yaml FORCE + $(call if_changed,copy) + +DT_SCHEMA_FILES = $(DT_DOCS) + +else + +# If DT_SCHEMA_FILES is specified, use it for processed-schema.yaml + +$(obj)/processed-schema.yaml: DT_MK_SCHEMA_FLAGS := -u +$(obj)/processed-schema.yaml: $(DT_SCHEMA_FILES) check_dtschema_version FORCE $(call if_changed,mk_schema) -extra-y += processed-schema.yaml +endif + +extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES)) +extra-$(CHECK_DT_BINDING) += $(patsubst $(src)/%.yaml,%.example.dt.yaml, $(DT_SCHEMA_FILES)) +extra-$(CHECK_DT_BINDING) += processed-schema-examples.yaml +extra-$(CHECK_DTBS) += processed-schema.yaml + +# Hack: avoid 'Argument list too long' error for 'make clean'. Remove most of +# build artifacts here before they are processed by scripts/Makefile.clean +clean-files = $(shell find $(obj) \( -name '*.example.dts' -o \ + -name '*.example.dt.yaml' \) -delete 2>/dev/null) Modified: vendor/device-tree/dist/Bindings/arm/altera.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/altera.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/altera.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -13,8 +13,8 @@ properties: compatible: items: - enum: - - altr,socfpga-cyclone5 - - altr,socfpga-arria5 - - altr,socfpga-arria10 + - altr,socfpga-cyclone5 + - altr,socfpga-arria5 + - altr,socfpga-arria10 - const: altr,socfpga ... Modified: vendor/device-tree/dist/Bindings/arm/amlogic.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/amlogic.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/amlogic.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -17,7 +17,7 @@ description: |+ any time. Be sure to use a device tree binary and a kernel image generated from the same source tree. - Please refer to Documentation/devicetree/bindings/ABI.txt for a definition of a + Please refer to Documentation/devicetree/bindings/ABI.rst for a definition of a stable binding/ABI. properties: @@ -107,6 +107,7 @@ properties: - amlogic,p231 - libretech,aml-s905d-pc - phicomm,n1 + - smartlabs,sml5442tw - const: amlogic,s905d - const: amlogic,meson-gxl @@ -148,6 +149,8 @@ properties: - description: Boards with the Amlogic Meson G12B S922X SoC items: - enum: + - azw,gtking + - azw,gtking-pro - hardkernel,odroid-n2 - khadas,vim3 - ugoos,am6 @@ -159,6 +162,7 @@ properties: - enum: - seirobotics,sei610 - khadas,vim3l + - hardkernel,odroid-c4 - const: amlogic,sm1 - description: Boards with the Amlogic Meson A1 A113L SoC Modified: vendor/device-tree/dist/Bindings/arm/amlogic/amlogic,meson-gx-ao-secure.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/amlogic/amlogic,meson-gx-ao-secure.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/amlogic/amlogic,meson-gx-ao-secure.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -25,7 +25,7 @@ select: properties: compatible: - items: + items: - const: amlogic,meson-gx-ao-secure - const: syscon Modified: vendor/device-tree/dist/Bindings/arm/arm,scmi.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/arm,scmi.txt Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/arm,scmi.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -14,7 +14,7 @@ Required properties: The scmi node with the following properties shall be under the /firmware/ node. -- compatible : shall be "arm,scmi" +- compatible : shall be "arm,scmi" or "arm,scmi-smc" for smc/hvc transports - mboxes: List of phandle and mailbox channel specifiers. It should contain exactly one or two mailboxes, one for transmitting messages("tx") and another optional for receiving the notifications("rx") if @@ -25,6 +25,7 @@ The scmi node with the following properties shall be u protocol identifier for a given sub-node. - #size-cells : should be '0' as 'reg' property doesn't have any size associated with it. +- arm,smc-id : SMC id required when using smc or hvc transports Optional properties: Modified: vendor/device-tree/dist/Bindings/arm/arm,vexpress-juno.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/arm,vexpress-juno.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/arm,vexpress-juno.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -131,26 +131,23 @@ properties: property, describing the physical location of the children nodes. 0 means motherboard site, while 1 and 2 are daughterboard sites, and 0xf means "sisterboard" which is the site containing the main CPU tile. - allOf: - - $ref: '/schemas/types.yaml#/definitions/uint32' - - minimum: 0 - maximum: 15 + $ref: '/schemas/types.yaml#/definitions/uint32' + minimum: 0 + maximum: 15 arm,vexpress,position: description: When daughterboards are stacked on one site, their position in the stack be be described this attribute. - allOf: - - $ref: '/schemas/types.yaml#/definitions/uint32' - - minimum: 0 - maximum: 3 + $ref: '/schemas/types.yaml#/definitions/uint32' + minimum: 0 + maximum: 3 arm,vexpress,dcc: description: When describing tiles consisting of more than one DCC, its number can be specified with this attribute. - allOf: - - $ref: '/schemas/types.yaml#/definitions/uint32' - - minimum: 0 - maximum: 3 + $ref: '/schemas/types.yaml#/definitions/uint32' + minimum: 0 + maximum: 3 patternProperties: "^bus@[0-9a-f]+$": @@ -162,8 +159,7 @@ patternProperties: "simple-bus". If the compatible is placed in the "motherboard" node, it is stricter and always has two compatibles. type: object - allOf: - - $ref: '/schemas/simple-bus.yaml' + $ref: '/schemas/simple-bus.yaml' properties: compatible: @@ -195,11 +191,11 @@ patternProperties: - const: simple-bus arm,v2m-memory-map: description: This describes the memory map type. - allOf: - - $ref: '/schemas/types.yaml#/definitions/string' - - enum: - - rs1 - - rs2 + $ref: '/schemas/types.yaml#/definitions/string' + enum: + - rs1 + - rs2 + required: - compatible required: Modified: vendor/device-tree/dist/Bindings/arm/atmel-at91.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/atmel-at91.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/atmel-at91.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -82,6 +82,13 @@ properties: - const: atmel,sama5d2 - const: atmel,sama5 + - description: Microchip SAMA5D2 Industrial Connectivity Platform + items: + - const: microchip,sama5d2-icp + - const: atmel,sama5d27 + - const: atmel,sama5d2 + - const: atmel,sama5 + - description: SAM9X60-EK board items: - const: microchip,sam9x60ek Modified: vendor/device-tree/dist/Bindings/arm/bitmain.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/bitmain.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/bitmain.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -13,6 +13,6 @@ properties: compatible: items: - enum: - - bitmain,sophon-edge + - bitmain,sophon-edge - const: bitmain,bm1880 ... Added: vendor/device-tree/dist/Bindings/arm/calxeda/hb-sregs.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/calxeda/hb-sregs.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -0,0 +1,49 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/calxeda/hb-sregs.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Calxeda Highbank system registers + +description: | + The Calxeda Highbank system has a block of MMIO registers controlling + several generic system aspects. Those can be used to control some power + management, they also contain some gate and PLL clocks. + +maintainers: + - Andre Przywara + +properties: + compatible: + const: calxeda,hb-sregs + + reg: + maxItems: 1 + + clocks: + type: object + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + sregs@fff3c000 { + compatible = "calxeda,hb-sregs"; + reg = <0xfff3c000 0x1000>; + + clocks { + #address-cells = <1>; + #size-cells = <0>; + + osc: oscillator { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <33333000>; + }; + }; + }; Added: vendor/device-tree/dist/Bindings/arm/calxeda/l2ecc.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/calxeda/l2ecc.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/calxeda/l2ecc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Calxeda Highbank L2 cache ECC + +description: | + Binding for the Calxeda Highbank L2 cache controller ECC device. + This does not cover the actual L2 cache controller control registers, + but just the error reporting functionality. + +maintainers: + - Andre Przywara + +properties: + compatible: + const: "calxeda,hb-sregs-l2-ecc" + + reg: + maxItems: 1 + + interrupts: + items: + - description: single bit error interrupt + - description: double bit error interrupt + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + sregs@fff3c200 { + compatible = "calxeda,hb-sregs-l2-ecc"; + reg = <0xfff3c200 0x100>; + interrupts = <0 71 4>, <0 72 4>; + }; Modified: vendor/device-tree/dist/Bindings/arm/coresight-cti.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/coresight-cti.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/coresight-cti.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -140,16 +140,14 @@ patternProperties: maxItems: 1 arm,trig-in-sigs: - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32-array + $ref: /schemas/types.yaml#/definitions/uint32-array minItems: 1 maxItems: 32 description: List of CTI trigger in signal numbers in use by a trig-conns node. arm,trig-in-types: - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32-array + $ref: /schemas/types.yaml#/definitions/uint32-array minItems: 1 maxItems: 32 description: @@ -159,16 +157,14 @@ patternProperties: completely, then the types will default to GEN_IO. arm,trig-out-sigs: - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32-array + $ref: /schemas/types.yaml#/definitions/uint32-array minItems: 1 maxItems: 32 description: List of CTI trigger out signal numbers in use by a trig-conns node. arm,trig-out-types: - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32-array + $ref: /schemas/types.yaml#/definitions/uint32-array minItems: 1 maxItems: 32 description: @@ -178,8 +174,7 @@ patternProperties: or omitted completely, then the types will default to GEN_IO. arm,trig-filters: - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32-array + $ref: /schemas/types.yaml#/definitions/uint32-array minItems: 1 maxItems: 32 description: @@ -187,8 +182,7 @@ patternProperties: active, unless filtering is disabled on the driver. arm,trig-conn-name: - allOf: - - $ref: /schemas/types.yaml#/definitions/string + $ref: /schemas/types.yaml#/definitions/string description: Defines a connection name that will be displayed, if the cpu or arm,cs-dev-assoc properties are not being used in this connection. @@ -301,7 +295,7 @@ examples: - | cti@20110000 { compatible = "arm,coresight-cti", "arm,primecell"; - reg = <0 0x20110000 0 0x1000>; + reg = <0x20110000 0x1000>; clocks = <&soc_smc50mhz>; clock-names = "apb_pclk"; Modified: vendor/device-tree/dist/Bindings/arm/cpus.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/cpus.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/cpus.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -167,53 +167,53 @@ properties: - qcom,kryo260 - qcom,kryo280 - qcom,kryo385 + - qcom,kryo468 - qcom,kryo485 - qcom,scorpion enable-method: - allOf: - - $ref: '/schemas/types.yaml#/definitions/string' - - oneOf: - # On ARM v8 64-bit this property is required - - enum: - - psci - - spin-table - # On ARM 32-bit systems this property is optional - - enum: - - actions,s500-smp - - allwinner,sun6i-a31 - - allwinner,sun8i-a23 - - allwinner,sun9i-a80-smp - - allwinner,sun8i-a83t-smp - - amlogic,meson8-smp - - amlogic,meson8b-smp - - arm,realview-smp - - aspeed,ast2600-smp - - brcm,bcm11351-cpu-method - - brcm,bcm23550 - - brcm,bcm2836-smp - - brcm,bcm63138 - - brcm,bcm-nsp-smp - - brcm,brahma-b15 - - marvell,armada-375-smp - - marvell,armada-380-smp - - marvell,armada-390-smp - - marvell,armada-xp-smp - - marvell,98dx3236-smp - - marvell,mmp3-smp - - mediatek,mt6589-smp - - mediatek,mt81xx-tz-smp - - qcom,gcc-msm8660 - - qcom,kpss-acc-v1 - - qcom,kpss-acc-v2 - - renesas,apmu - - renesas,r9a06g032-smp - - rockchip,rk3036-smp - - rockchip,rk3066-smp - - socionext,milbeaut-m10v-smp - - ste,dbx500-smp - - ti,am3352 - - ti,am4372 + $ref: '/schemas/types.yaml#/definitions/string' + oneOf: + # On ARM v8 64-bit this property is required + - enum: + - psci + - spin-table + # On ARM 32-bit systems this property is optional + - enum: + - actions,s500-smp + - allwinner,sun6i-a31 + - allwinner,sun8i-a23 + - allwinner,sun9i-a80-smp + - allwinner,sun8i-a83t-smp + - amlogic,meson8-smp + - amlogic,meson8b-smp + - arm,realview-smp + - aspeed,ast2600-smp + - brcm,bcm11351-cpu-method + - brcm,bcm23550 + - brcm,bcm2836-smp + - brcm,bcm63138 + - brcm,bcm-nsp-smp + - brcm,brahma-b15 + - marvell,armada-375-smp + - marvell,armada-380-smp + - marvell,armada-390-smp + - marvell,armada-xp-smp + - marvell,98dx3236-smp + - marvell,mmp3-smp + - mediatek,mt6589-smp + - mediatek,mt81xx-tz-smp + - qcom,gcc-msm8660 + - qcom,kpss-acc-v1 + - qcom,kpss-acc-v2 + - renesas,apmu + - renesas,r9a06g032-smp + - rockchip,rk3036-smp + - rockchip,rk3066-smp + - socionext,milbeaut-m10v-smp + - ste,dbx500-smp + - ti,am3352 + - ti,am4372 cpu-release-addr: $ref: '/schemas/types.yaml#/definitions/uint64' Modified: vendor/device-tree/dist/Bindings/arm/freescale/fsl,scu.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/freescale/fsl,scu.txt Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/freescale/fsl,scu.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -47,7 +47,7 @@ Required properties: &lsio_mu1 1 2 &lsio_mu1 1 3 &lsio_mu1 3 3>; - See Documentation/devicetree/bindings/mailbox/fsl,mu.txt + See Documentation/devicetree/bindings/mailbox/fsl,mu.yaml for detailed mailbox binding. Note: Each mu which supports general interrupt should have an alias correctly @@ -108,7 +108,8 @@ This binding uses the i.MX common pinctrl binding[3]. Required properties: - compatible: Should be one of: "fsl,imx8qm-iomuxc", - "fsl,imx8qxp-iomuxc". + "fsl,imx8qxp-iomuxc", + "fsl,imx8dxl-iomuxc". Required properties for Pinctrl sub nodes: - fsl,pins: Each entry consists of 3 integers which represents @@ -116,7 +117,8 @@ Required properties for Pinctrl sub nodes: integers are specified using a PIN_FUNC_ID macro, which can be found in , - . + , + . The last integer CONFIG is the pad setting value like pull-up on this pin. Modified: vendor/device-tree/dist/Bindings/arm/fsl.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/fsl.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/fsl.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -119,6 +119,7 @@ properties: - fsl,imx6q-sabreauto - fsl,imx6q-sabrelite - fsl,imx6q-sabresd + - kontron,imx6q-samx6i # Kontron i.MX6 Dual/Quad SMARC Module - technexion,imx6q-pico-dwarf # TechNexion i.MX6Q Pico-Dwarf - technexion,imx6q-pico-hobbit # TechNexion i.MX6Q Pico-Hobbit - technexion,imx6q-pico-nymph # TechNexion i.MX6Q Pico-Nymph @@ -170,6 +171,7 @@ properties: - emtrion,emcon-mx6-avari # emCON-MX6S or emCON-MX6DL SoM on Avari Base - fsl,imx6dl-sabreauto # i.MX6 DualLite/Solo SABRE Automotive Board - fsl,imx6dl-sabresd # i.MX6 DualLite SABRE Smart Device Board + - kontron,imx6dl-samx6i # Kontron i.MX6 Solo SMARC Module - technexion,imx6dl-pico-dwarf # TechNexion i.MX6DL Pico-Dwarf - technexion,imx6dl-pico-hobbit # TechNexion i.MX6DL Pico-Hobbit - technexion,imx6dl-pico-nymph # TechNexion i.MX6DL Pico-Nymph @@ -177,7 +179,9 @@ properties: - technologic,imx6dl-ts4900 - technologic,imx6dl-ts7970 - toradex,colibri_imx6dl # Colibri iMX6 Module + - toradex,colibri_imx6dl-v1_1 # Colibri iMX6 Module V1.1 - toradex,colibri_imx6dl-eval-v3 # Colibri iMX6 Module on Colibri Evaluation Board V3 + - toradex,colibri_imx6dl-v1_1-eval-v3 # Colibri iMX6 Module V1.1 on Colibri Evaluation Board V3 - ysoft,imx6dl-yapp4-draco # i.MX6 DualLite Y Soft IOTA Draco board - ysoft,imx6dl-yapp4-hydra # i.MX6 DualLite Y Soft IOTA Hydra board - ysoft,imx6dl-yapp4-ursa # i.MX6 Solo Y Soft IOTA Ursa board Modified: vendor/device-tree/dist/Bindings/arm/l2c2x0.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/l2c2x0.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/l2c2x0.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -70,43 +70,39 @@ properties: description: Cycles of latency for Data RAM accesses. Specifies 3 cells of read, write and setup latencies. Minimum valid values are 1. Controllers without setup latency control should use a value of 0. - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32-array - - minItems: 2 - maxItems: 3 - items: - minimum: 0 - maximum: 8 + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 2 + maxItems: 3 + items: + minimum: 0 + maximum: 8 arm,tag-latency: description: Cycles of latency for Tag RAM accesses. Specifies 3 cells of read, write and setup latencies. Controllers without setup latency control should use 0. Controllers without separate read and write Tag RAM latency values should only use the first cell. - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32-array - - minItems: 1 - maxItems: 3 - items: - minimum: 0 - maximum: 8 + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 3 + items: + minimum: 0 + maximum: 8 arm,dirty-latency: description: Cycles of latency for Dirty RAMs. This is a single cell. - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - minimum: 1 - maximum: 8 + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 8 arm,filter-ranges: description: Starting address and length of window to filter. Addresses in the filter window are directed to the M1 port. Other addresses will go to the M0 port. - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32-array - - items: - minItems: 2 - maxItems: 2 + $ref: /schemas/types.yaml#/definitions/uint32-array + items: + minItems: 2 + maxItems: 2 arm,io-coherent: description: indicates that the system is operating in an hardware @@ -131,36 +127,31 @@ properties: arm,double-linefill: description: Override double linefill enable setting. Enable if non-zero, disable if zero. - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 0, 1 ] + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] arm,double-linefill-incr: description: Override double linefill on INCR read. Enable if non-zero, disable if zero. - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 0, 1 ] + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] arm,double-linefill-wrap: description: Override double linefill on WRAP read. Enable if non-zero, disable if zero. - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 0, 1 ] + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] arm,prefetch-drop: description: Override prefetch drop enable setting. Enable if non-zero, disable if zero. - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 0, 1 ] + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] arm,prefetch-offset: description: Override prefetch offset value. - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 0, 1, 2, 3, 4, 5, 6, 7, 15, 23, 31 ] + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1, 2, 3, 4, 5, 6, 7, 15, 23, 31] arm,shared-override: description: The default behavior of the L220 or PL310 cache @@ -193,35 +184,31 @@ properties: description: | Data prefetch. Value: <0> (forcibly disable), <1> (forcibly enable), property absent (retain settings set by firmware) - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 0, 1 ] + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] prefetch-instr: description: | Instruction prefetch. Value: <0> (forcibly disable), <1> (forcibly enable), property absent (retain settings set by firmware) - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 0, 1 ] + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] arm,dynamic-clock-gating: description: | L2 dynamic clock gating. Value: <0> (forcibly disable), <1> (forcibly enable), property absent (OS specific behavior, preferably retain firmware settings) - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 0, 1 ] + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] arm,standby-mode: description: L2 standby mode enable. Value <0> (forcibly disable), <1> (forcibly enable), property absent (OS specific behavior, preferably retain firmware settings) - allOf: - - $ref: /schemas/types.yaml#/definitions/uint32 - - enum: [ 0, 1 ] + $ref: /schemas/types.yaml#/definitions/uint32 + enum: [0, 1] arm,early-bresp-disable: description: Disable the CA9 optimization Early BRESP (PL310) Modified: vendor/device-tree/dist/Bindings/arm/mediatek.yaml ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek.yaml Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/mediatek.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -84,6 +84,28 @@ properties: - enum: - mediatek,mt8135-evbp1 - const: mediatek,mt8135 + - description: Google Elm (Acer Chromebook R13) + items: + - const: google,elm-rev8 + - const: google,elm-rev7 + - const: google,elm-rev6 + - const: google,elm-rev5 + - const: google,elm-rev4 + - const: google,elm-rev3 + - const: google,elm + - const: mediatek,mt8173 + - description: Google Hana (Lenovo Chromebook N23 Yoga, C330, 300e,...) + items: + - const: google,hana-rev6 + - const: google,hana-rev5 + - const: google,hana-rev4 + - const: google,hana-rev3 + - const: google,hana + - const: mediatek,mt8173 + - description: Google Hana rev7 (Poin2 Chromebook 11C) + items: + - const: google,hana-rev7 + - const: mediatek,mt8173 - items: - enum: - mediatek,mt8173-evb Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,apmixedsys.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -8,6 +8,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-apmixedsys" - "mediatek,mt2712-apmixedsys", "syscon" + - "mediatek,mt6765-apmixedsys", "syscon" - "mediatek,mt6779-apmixedsys", "syscon" - "mediatek,mt6797-apmixedsys" - "mediatek,mt7622-apmixedsys" Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,audsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,audsys.txt Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,audsys.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -7,6 +7,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-audsys", "syscon" + - "mediatek,mt6765-audsys", "syscon" - "mediatek,mt6779-audio", "syscon" - "mediatek,mt7622-audsys", "syscon" - "mediatek,mt7623-audsys", "mediatek,mt2701-audsys", "syscon" Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,camsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,camsys.txt Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,camsys.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -6,6 +6,7 @@ The MediaTek camsys controller provides various clocks Required Properties: - compatible: Should be one of: + - "mediatek,mt6765-camsys", "syscon" - "mediatek,mt6779-camsys", "syscon" - "mediatek,mt8183-camsys", "syscon" - #clock-cells: Must be 1 Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,imgsys.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -8,6 +8,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-imgsys", "syscon" - "mediatek,mt2712-imgsys", "syscon" + - "mediatek,mt6765-imgsys", "syscon" - "mediatek,mt6779-imgsys", "syscon" - "mediatek,mt6797-imgsys", "syscon" - "mediatek,mt7623-imgsys", "mediatek,mt2701-imgsys", "syscon" Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,infracfg.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -9,6 +9,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-infracfg", "syscon" - "mediatek,mt2712-infracfg", "syscon" + - "mediatek,mt6765-infracfg", "syscon" - "mediatek,mt6779-infracfg_ao", "syscon" - "mediatek,mt6797-infracfg", "syscon" - "mediatek,mt7622-infracfg", "syscon" Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mipi0a.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mipi0a.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -0,0 +1,28 @@ +Mediatek mipi0a (mipi_rx_ana_csi0a) controller +============================ + +The Mediatek mipi0a controller provides various clocks +to the system. + +Required Properties: + +- compatible: Should be one of: + - "mediatek,mt6765-mipi0a", "syscon" +- #clock-cells: Must be 1 + +The mipi0a controller uses the common clk binding from +Documentation/devicetree/bindings/clock/clock-bindings.txt +The available clocks are defined in dt-bindings/clock/mt*-clk.h. + +The mipi0a controller also uses the common power domain from +Documentation/devicetree/bindings/soc/mediatek/scpsys.txt +The available power doamins are defined in dt-bindings/power/mt*-power.h. + +Example: + +mipi0a: clock-controller@11c10000 { + compatible = "mediatek,mt6765-mipi0a", "syscon"; + reg = <0 0x11c10000 0 0x1000>; + power-domains = <&scpsys MT6765_POWER_DOMAIN_CAM>; + #clock-cells = <1>; +}; Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,mmsys.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -1,13 +1,15 @@ Mediatek mmsys controller ============================ -The Mediatek mmsys controller provides various clocks to the system. +The Mediatek mmsys system controller provides clock control, routing control, +and miscellaneous control in mmsys partition. Required Properties: - compatible: Should be one of: - "mediatek,mt2701-mmsys", "syscon" - "mediatek,mt2712-mmsys", "syscon" + - "mediatek,mt6765-mmsys", "syscon" - "mediatek,mt6779-mmsys", "syscon" - "mediatek,mt6797-mmsys", "syscon" - "mediatek,mt7623-mmsys", "mediatek,mt2701-mmsys", "syscon" @@ -15,13 +17,13 @@ Required Properties: - "mediatek,mt8183-mmsys", "syscon" - #clock-cells: Must be 1 -The mmsys controller uses the common clk binding from +For the clock control, the mmsys controller uses the common clk binding from Documentation/devicetree/bindings/clock/clock-bindings.txt The available clocks are defined in dt-bindings/clock/mt*-clk.h. Example: -mmsys: clock-controller@14000000 { +mmsys: syscon@14000000 { compatible = "mediatek,mt8173-mmsys", "syscon"; reg = <0 0x14000000 0 0x1000>; #clock-cells = <1>; Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pericfg.yaml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,pericfg.yaml Tue Aug 4 19:05:45 2020 (r363850) @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/arm/mediatek/mediatek,pericfg.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: MediaTek Peripheral Configuration Controller + +maintainers: + - Bartosz Golaszewski + +description: + The Mediatek pericfg controller provides various clocks and reset outputs + to the system. + +properties: + compatible: + oneOf: + - items: + - enum: + - mediatek,mt2701-pericfg + - mediatek,mt2712-pericfg + - mediatek,mt6765-pericfg + - mediatek,mt7622-pericfg + - mediatek,mt7629-pericfg + - mediatek,mt8135-pericfg + - mediatek,mt8173-pericfg + - mediatek,mt8183-pericfg + - mediatek,mt8516-pericfg + - const: syscon + - items: + # Special case for mt7623 for backward compatibility + - const: mediatek,mt7623-pericfg + - const: mediatek,mt2701-pericfg + - const: syscon + + reg: + maxItems: 1 + + '#clock-cells': + const: 1 + + '#reset-cells': + const: 1 + +required: + - compatible + - reg + +examples: + - | + pericfg@10003000 { + compatible = "mediatek,mt8173-pericfg", "syscon"; + reg = <0x10003000 0x1000>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + - | + pericfg@10003000 { + compatible = "mediatek,mt7623-pericfg", "mediatek,mt2701-pericfg", "syscon"; + reg = <0x10003000 0x1000>; + #clock-cells = <1>; + #reset-cells = <1>; + }; Modified: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt ============================================================================== --- vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt Tue Aug 4 18:24:46 2020 (r363849) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,topckgen.txt Tue Aug 4 19:05:45 2020 (r363850) @@ -8,6 +8,7 @@ Required Properties: - compatible: Should be one of: - "mediatek,mt2701-topckgen" - "mediatek,mt2712-topckgen", "syscon" + - "mediatek,mt6765-topckgen", "syscon" - "mediatek,mt6779-topckgen", "syscon" - "mediatek,mt6797-topckgen" - "mediatek,mt7622-topckgen" Added: vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vcodecsys.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/device-tree/dist/Bindings/arm/mediatek/mediatek,vcodecsys.txt Tue Aug 4 19:05:45 2020 (r363850) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Aug 4 19:06:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37A8837CB8B; Tue, 4 Aug 2020 19:06:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLkkV0QRpz3VK6; Tue, 4 Aug 2020 19:06:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEFC5A30F; Tue, 4 Aug 2020 19:06:25 +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 074J6PE3078841; Tue, 4 Aug 2020 19:06:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074J6PfA078840; Tue, 4 Aug 2020 19:06:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041906.074J6PfA078840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 19:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363851 - vendor/device-tree/5.8 X-SVN-Group: vendor X-SVN-Commit-Author: manu X-SVN-Commit-Paths: vendor/device-tree/5.8 X-SVN-Commit-Revision: 363851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:06:26 -0000 Author: manu Date: Tue Aug 4 19:06:25 2020 New Revision: 363851 URL: https://svnweb.freebsd.org/changeset/base/363851 Log: Tag import for DTS files Added: vendor/device-tree/5.8/ - copied from r363850, vendor/device-tree/dist/ From owner-svn-src-all@freebsd.org Tue Aug 4 19:27:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5886337D0ED; Tue, 4 Aug 2020 19:27:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlBJ1f7Vz3WG4; Tue, 4 Aug 2020 19:27:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B3A7A655; Tue, 4 Aug 2020 19:27:04 +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 074JR3GE091268; Tue, 4 Aug 2020 19:27:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JR3NV091267; Tue, 4 Aug 2020 19:27:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202008041927.074JR3NV091267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 4 Aug 2020 19:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363852 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 363852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:27:04 -0000 Author: mav Date: Tue Aug 4 19:27:03 2020 New Revision: 363852 URL: https://svnweb.freebsd.org/changeset/base/363852 Log: Remove extra memset() left after r342388. This memset() wiped MPI2_FUNCTION_SCSI_TASK_MGMT set by mprsas_alloc_tm(), that broke target reset on device removal, making later re-insertion into the same slot impossible, since firmware was still waiting for the driver to finish with the removed device. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mps/mps_sas.c Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Tue Aug 4 19:06:25 2020 (r363851) +++ head/sys/dev/mpr/mpr_sas.c Tue Aug 4 19:27:03 2020 (r363852) @@ -515,7 +515,6 @@ mprsas_prepare_remove(struct mprsas_softc *sassc, uint mprsas_rescan_target(sc, targ); req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; - memset(req, 0, sizeof(*req)); req->DevHandle = htole16(targ->handle); req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Tue Aug 4 19:06:25 2020 (r363851) +++ head/sys/dev/mps/mps_sas.c Tue Aug 4 19:27:03 2020 (r363852) @@ -515,7 +515,6 @@ mpssas_prepare_remove(struct mpssas_softc *sassc, uint mpssas_rescan_target(sc, targ); req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; - memset(req, 0, sizeof(*req)); req->DevHandle = htole16(targ->handle); req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; From owner-svn-src-all@freebsd.org Tue Aug 4 19:44:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B15137D5F0; Tue, 4 Aug 2020 19:44:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlZn1Y01z3X6L; Tue, 4 Aug 2020 19:44:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14760A4E2; Tue, 4 Aug 2020 19:44:49 +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 074JinDq003568; Tue, 4 Aug 2020 19:44:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Jii4l003541; Tue, 4 Aug 2020 19:44:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008041944.074Jii4l003541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 19:44:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363853 - in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/freescale arm64/hisilicon arm64/intel arm64/marvell arm64/mediatek arm64/nvidia arm64/qcom ... X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys/gnu/dts: arm arm64/allwinner arm64/altera arm64/amlogic arm64/arm arm64/freescale arm64/hisilicon arm64/intel arm64/marvell arm64/mediatek arm64/nvidia arm64/qcom arm64/realtek arm64/renes... X-SVN-Commit-Revision: 363853 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:44:49 -0000 Author: manu Date: Tue Aug 4 19:44:43 2020 New Revision: 363853 URL: https://svnweb.freebsd.org/changeset/base/363853 Log: Import DTS files for arm, arm64, riscv from Linux 5.8 MFC after: 2 months Added: head/sys/gnu/dts/arm/am5729-beagleboneai.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/am5729-beagleboneai.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-yosemitev2.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/aspeed-bmc-facebook-yosemitev2.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-nicole.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/aspeed-bmc-opp-nicole.dts head/sys/gnu/dts/arm/at91-sama5d2_icp.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/at91-sama5d2_icp.dts head/sys/gnu/dts/arm/bcm2835-rpi-common.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/bcm2835-rpi-common.dtsi head/sys/gnu/dts/arm/dra7-ipu-dsp-common.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/dra7-ipu-dsp-common.dtsi head/sys/gnu/dts/arm/dra74-ipu-dsp-common.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/dra74-ipu-dsp-common.dtsi head/sys/gnu/dts/arm/exynos4210-i9100.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/exynos4210-i9100.dts head/sys/gnu/dts/arm/imx6dl-colibri-v1_1-eval-v3.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/imx6dl-colibri-v1_1-eval-v3.dts head/sys/gnu/dts/arm/imx6qdl-colibri-v1_1-uhs.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/imx6qdl-colibri-v1_1-uhs.dtsi head/sys/gnu/dts/arm/integratorap-im-pd1.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/integratorap-im-pd1.dts head/sys/gnu/dts/arm/kirkwood-l-50.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/kirkwood-l-50.dts head/sys/gnu/dts/arm/r8a7742-iwg21d-q7.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/r8a7742-iwg21d-q7.dts head/sys/gnu/dts/arm/r8a7742-iwg21m.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/r8a7742-iwg21m.dtsi head/sys/gnu/dts/arm/r8a7742.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/r8a7742.dtsi head/sys/gnu/dts/arm/rtd1195-horseradish.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/rtd1195-horseradish.dts head/sys/gnu/dts/arm/rtd1195-mele-x1000.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/rtd1195-mele-x1000.dts head/sys/gnu/dts/arm/rtd1195.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/rtd1195.dtsi head/sys/gnu/dts/arm/stm32mp157a-dhcor-avenger96.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157a-dhcor-avenger96.dts head/sys/gnu/dts/arm/stm32mp157a-iot-box.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157a-iot-box.dts head/sys/gnu/dts/arm/stm32mp157a-stinger96.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157a-stinger96.dts head/sys/gnu/dts/arm/stm32mp157a-stinger96.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157a-stinger96.dtsi head/sys/gnu/dts/arm/stm32mp157c-lxa-mc1.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp157c-lxa-mc1.dts head/sys/gnu/dts/arm/stm32mp15xx-dhcom-pdk2.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcom-pdk2.dtsi head/sys/gnu/dts/arm/stm32mp15xx-dhcom-som.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcom-som.dtsi head/sys/gnu/dts/arm/stm32mp15xx-dhcor-avenger96.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcor-avenger96.dtsi head/sys/gnu/dts/arm/stm32mp15xx-dhcor-io1v8.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcor-io1v8.dtsi head/sys/gnu/dts/arm/stm32mp15xx-dhcor-som.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-dhcor-som.dtsi head/sys/gnu/dts/arm/stm32mp15xx-osd32.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm/stm32mp15xx-osd32.dtsi head/sys/gnu/dts/arm/sun7i-a20-olinuxino-lime-emmc.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm/sun7i-a20-olinuxino-lime-emmc.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-cpu-opp.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/allwinner/sun50i-h6-cpu-opp.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-gtking-pro.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-gtking-pro.dts head/sys/gnu/dts/arm64/amlogic/meson-g12b-gtking.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-gtking.dts head/sys/gnu/dts/arm64/amlogic/meson-g12b-w400.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-g12b-w400.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s805x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-sml5442tw.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-gxl-s905d-sml5442tw.dts head/sys/gnu/dts/arm64/amlogic/meson-sm1-odroid-c4.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/amlogic/meson-sm1-odroid-c4.dts head/sys/gnu/dts/arm64/freescale/imx8mm-beacon-baseboard.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/freescale/imx8mm-beacon-baseboard.dtsi head/sys/gnu/dts/arm64/freescale/imx8mm-beacon-kit.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/freescale/imx8mm-beacon-kit.dts head/sys/gnu/dts/arm64/freescale/imx8mm-beacon-som.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/freescale/imx8mm-beacon-som.dtsi head/sys/gnu/dts/arm64/mediatek/mt6358.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt6358.dtsi head/sys/gnu/dts/arm64/mediatek/mt8173-elm-hana-rev7.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm-hana-rev7.dts head/sys/gnu/dts/arm64/mediatek/mt8173-elm-hana.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm-hana.dts head/sys/gnu/dts/arm64/mediatek/mt8173-elm-hana.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm-hana.dtsi head/sys/gnu/dts/arm64/mediatek/mt8173-elm.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm.dts head/sys/gnu/dts/arm64/mediatek/mt8173-elm.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/mediatek/mt8173-elm.dtsi head/sys/gnu/dts/arm64/qcom/sdm660-xiaomi-lavender.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/qcom/sdm660-xiaomi-lavender.dts head/sys/gnu/dts/arm64/qcom/sdm660.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/qcom/sdm660.dtsi head/sys/gnu/dts/arm64/realtek/rtd1295-xnano-x5.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1295-xnano-x5.dts head/sys/gnu/dts/arm64/realtek/rtd1395-bpi-m4.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1395-bpi-m4.dts head/sys/gnu/dts/arm64/realtek/rtd1395-lionskin.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1395-lionskin.dts head/sys/gnu/dts/arm64/realtek/rtd1395.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1395.dtsi head/sys/gnu/dts/arm64/realtek/rtd139x.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd139x.dtsi head/sys/gnu/dts/arm64/realtek/rtd1619-mjolnir.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1619-mjolnir.dts head/sys/gnu/dts/arm64/realtek/rtd1619.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd1619.dtsi head/sys/gnu/dts/arm64/realtek/rtd16xx.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/realtek/rtd16xx.dtsi head/sys/gnu/dts/arm64/renesas/aistarvision-mipi-adapter-2.1.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/renesas/aistarvision-mipi-adapter-2.1.dtsi head/sys/gnu/dts/arm64/renesas/r8a774c0-ek874-mipi-2.1.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/renesas/r8a774c0-ek874-mipi-2.1.dts head/sys/gnu/dts/arm64/rockchip/rk3326-odroid-go2.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/rockchip/rk3326-odroid-go2.dts head/sys/gnu/dts/arm64/rockchip/rk3326.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/rockchip/rk3326.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-ld20-akebi96.dts - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/socionext/uniphier-ld20-akebi96.dts head/sys/gnu/dts/arm64/ti/k3-am654-industrial-thermal.dtsi - copied unchanged from r363850, vendor/device-tree/dist/src/arm64/ti/k3-am654-industrial-thermal.dtsi head/sys/gnu/dts/include/dt-bindings/clock/agilex-clock.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/agilex-clock.h head/sys/gnu/dts/include/dt-bindings/clock/bt1-ccu.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/bt1-ccu.h head/sys/gnu/dts/include/dt-bindings/clock/intel,lgm-clk.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/intel,lgm-clk.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2-audio.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/marvell,mmp2-audio.h head/sys/gnu/dts/include/dt-bindings/clock/mt6765-clk.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/mt6765-clk.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8939.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/qcom,gcc-msm8939.h head/sys/gnu/dts/include/dt-bindings/clock/r8a7742-cpg-mssr.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/r8a7742-cpg-mssr.h head/sys/gnu/dts/include/dt-bindings/clock/x1830-cgu.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/clock/x1830-cgu.h head/sys/gnu/dts/include/dt-bindings/interconnect/imx8mm.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/interconnect/imx8mm.h head/sys/gnu/dts/include/dt-bindings/interconnect/imx8mn.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/interconnect/imx8mn.h head/sys/gnu/dts/include/dt-bindings/interconnect/imx8mq.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/interconnect/imx8mq.h head/sys/gnu/dts/include/dt-bindings/mailbox/qcom-ipcc.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/mailbox/qcom-ipcc.h head/sys/gnu/dts/include/dt-bindings/pinctrl/pads-imx8dxl.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/pinctrl/pads-imx8dxl.h head/sys/gnu/dts/include/dt-bindings/power/marvell,mmp2.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/power/marvell,mmp2.h head/sys/gnu/dts/include/dt-bindings/power/meson-gxbb-power.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/power/meson-gxbb-power.h head/sys/gnu/dts/include/dt-bindings/power/meson8-power.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/power/meson8-power.h head/sys/gnu/dts/include/dt-bindings/power/r8a7742-sysc.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/power/r8a7742-sysc.h head/sys/gnu/dts/include/dt-bindings/reset/bt1-ccu.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/reset/bt1-ccu.h head/sys/gnu/dts/include/dt-bindings/reset/imx8mp-reset.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/reset/imx8mp-reset.h head/sys/gnu/dts/include/dt-bindings/reset/qcom,gcc-msm8939.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/reset/qcom,gcc-msm8939.h head/sys/gnu/dts/include/dt-bindings/reset/realtek,rtd1195.h - copied unchanged from r363850, vendor/device-tree/dist/include/dt-bindings/reset/realtek,rtd1195.h Deleted: head/sys/gnu/dts/arm/stm32mp157c-dhcom-som.dtsi head/sys/gnu/dts/arm64/qcom/apq8016-sbc-pmic-pins.dtsi head/sys/gnu/dts/arm64/qcom/apq8016-sbc-soc-pins.dtsi Modified: head/sys/gnu/dts/arm/am335x-baltos.dtsi head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts head/sys/gnu/dts/arm/am335x-boneblue.dts head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts head/sys/gnu/dts/arm/am335x-evm.dts head/sys/gnu/dts/arm/am335x-evmsk.dts head/sys/gnu/dts/arm/am335x-guardian.dts head/sys/gnu/dts/arm/am335x-lxm.dts head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts head/sys/gnu/dts/arm/am335x-pepper.dts head/sys/gnu/dts/arm/am335x-phycore-som.dtsi head/sys/gnu/dts/arm/am335x-pocketbeagle.dts head/sys/gnu/dts/arm/am33xx-l4.dtsi head/sys/gnu/dts/arm/am33xx.dtsi head/sys/gnu/dts/arm/am3517-evm.dts head/sys/gnu/dts/arm/am3517.dtsi head/sys/gnu/dts/arm/am4372.dtsi head/sys/gnu/dts/arm/am437x-cm-t43.dts head/sys/gnu/dts/arm/am437x-gp-evm.dts head/sys/gnu/dts/arm/am437x-l4.dtsi head/sys/gnu/dts/arm/am437x-sk-evm.dts head/sys/gnu/dts/arm/am43x-epos-evm.dts head/sys/gnu/dts/arm/am571x-idk.dts head/sys/gnu/dts/arm/am572x-idk-common.dtsi head/sys/gnu/dts/arm/am57xx-beagle-x15-common.dtsi head/sys/gnu/dts/arm/am57xx-idk-common.dtsi head/sys/gnu/dts/arm/armada-370-xp.dtsi head/sys/gnu/dts/arm/armada-375.dtsi head/sys/gnu/dts/arm/armada-38x.dtsi head/sys/gnu/dts/arm/armada-39x.dtsi head/sys/gnu/dts/arm/aspeed-ast2600-evb.dts head/sys/gnu/dts/arm/aspeed-bmc-facebook-tiogapass.dts head/sys/gnu/dts/arm/aspeed-bmc-ibm-rainier.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-mihawk.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-romulus.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-tacoma.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-witherspoon.dts head/sys/gnu/dts/arm/aspeed-bmc-opp-zaius.dts head/sys/gnu/dts/arm/aspeed-g4.dtsi head/sys/gnu/dts/arm/aspeed-g5.dtsi head/sys/gnu/dts/arm/aspeed-g6.dtsi head/sys/gnu/dts/arm/at91-dvk_su60_somc.dtsi head/sys/gnu/dts/arm/at91-kizbox3-hs.dts head/sys/gnu/dts/arm/at91-kizbox3_common.dtsi head/sys/gnu/dts/arm/at91-sam9x60ek.dts head/sys/gnu/dts/arm/at91-sama5d27_som1.dtsi head/sys/gnu/dts/arm/at91-sama5d27_som1_ek.dts head/sys/gnu/dts/arm/at91-sama5d27_wlsom1.dtsi head/sys/gnu/dts/arm/at91-sama5d27_wlsom1_ek.dts head/sys/gnu/dts/arm/at91-sama5d2_ptc_ek.dts head/sys/gnu/dts/arm/at91-sama5d2_xplained.dts head/sys/gnu/dts/arm/at91-wb50n.dtsi head/sys/gnu/dts/arm/at91rm9200.dtsi head/sys/gnu/dts/arm/at91sam9g45.dtsi head/sys/gnu/dts/arm/at91sam9m10g45ek.dts head/sys/gnu/dts/arm/at91sam9n12.dtsi head/sys/gnu/dts/arm/at91sam9n12ek.dts head/sys/gnu/dts/arm/at91sam9rl.dtsi head/sys/gnu/dts/arm/at91sam9x5.dtsi head/sys/gnu/dts/arm/bcm-nsp.dtsi head/sys/gnu/dts/arm/bcm2711-rpi-4-b.dts head/sys/gnu/dts/arm/bcm2835-common.dtsi head/sys/gnu/dts/arm/bcm2835.dtsi head/sys/gnu/dts/arm/bcm2836.dtsi head/sys/gnu/dts/arm/bcm2837.dtsi head/sys/gnu/dts/arm/bcm47094-luxul-xwc-2000.dts head/sys/gnu/dts/arm/bcm958522er.dts head/sys/gnu/dts/arm/bcm958525er.dts head/sys/gnu/dts/arm/bcm958525xmc.dts head/sys/gnu/dts/arm/bcm958622hr.dts head/sys/gnu/dts/arm/bcm958623hr.dts head/sys/gnu/dts/arm/bcm958625hr.dts head/sys/gnu/dts/arm/bcm958625k.dts head/sys/gnu/dts/arm/berlin2.dtsi head/sys/gnu/dts/arm/berlin2cd.dtsi head/sys/gnu/dts/arm/berlin2q.dtsi head/sys/gnu/dts/arm/dm814x.dtsi head/sys/gnu/dts/arm/dm816x.dtsi head/sys/gnu/dts/arm/dove.dtsi head/sys/gnu/dts/arm/dra7-evm-common.dtsi head/sys/gnu/dts/arm/dra7-evm.dts head/sys/gnu/dts/arm/dra7-l4.dtsi head/sys/gnu/dts/arm/dra7.dtsi head/sys/gnu/dts/arm/dra71-evm.dts head/sys/gnu/dts/arm/dra72-evm-common.dtsi head/sys/gnu/dts/arm/dra72-evm-revc.dts head/sys/gnu/dts/arm/dra72-evm.dts head/sys/gnu/dts/arm/dra72x.dtsi head/sys/gnu/dts/arm/dra74x.dtsi head/sys/gnu/dts/arm/dra76-evm.dts head/sys/gnu/dts/arm/e60k02.dtsi head/sys/gnu/dts/arm/exynos3250-monk.dts head/sys/gnu/dts/arm/exynos3250-rinato.dts head/sys/gnu/dts/arm/exynos4210-origen.dts head/sys/gnu/dts/arm/exynos4210-trats.dts head/sys/gnu/dts/arm/exynos4210-universal_c210.dts head/sys/gnu/dts/arm/exynos4412-galaxy-s3.dtsi head/sys/gnu/dts/arm/exynos4412-midas.dtsi head/sys/gnu/dts/arm/exynos4412-odroid-common.dtsi head/sys/gnu/dts/arm/exynos4412-origen.dts head/sys/gnu/dts/arm/exynos5250-arndale.dts head/sys/gnu/dts/arm/exynos5420-arndale-octa.dts head/sys/gnu/dts/arm/imx50.dtsi head/sys/gnu/dts/arm/imx51.dtsi head/sys/gnu/dts/arm/imx53-cx9020.dts head/sys/gnu/dts/arm/imx53.dtsi head/sys/gnu/dts/arm/imx6q-dhcom-pdk2.dts head/sys/gnu/dts/arm/imx6qdl-colibri.dtsi head/sys/gnu/dts/arm/imx6qdl-gw551x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw552x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw560x.dtsi head/sys/gnu/dts/arm/imx6qdl-gw5904.dtsi head/sys/gnu/dts/arm/imx6qdl-gw5910.dtsi head/sys/gnu/dts/arm/imx6qdl-icore.dtsi head/sys/gnu/dts/arm/imx6qdl-sabresd.dtsi head/sys/gnu/dts/arm/imx6qdl-sr-som.dtsi head/sys/gnu/dts/arm/imx6qdl.dtsi head/sys/gnu/dts/arm/imx6sl.dtsi head/sys/gnu/dts/arm/imx6sx-sabreauto.dts head/sys/gnu/dts/arm/imx6sx-sdb.dtsi head/sys/gnu/dts/arm/imx6sx.dtsi head/sys/gnu/dts/arm/imx6ul-kontron-n6x1x-s.dtsi head/sys/gnu/dts/arm/imx6ul-kontron-n6x1x-som-common.dtsi head/sys/gnu/dts/arm/imx6ul.dtsi head/sys/gnu/dts/arm/imx7-tqma7.dtsi head/sys/gnu/dts/arm/imx7d-cl-som-imx7.dts head/sys/gnu/dts/arm/imx7d-colibri.dtsi head/sys/gnu/dts/arm/imx7d-nitrogen7.dts head/sys/gnu/dts/arm/imx7d-pinfunc.h head/sys/gnu/dts/arm/imx7d-sdb.dts head/sys/gnu/dts/arm/imx7d-tqma7.dtsi head/sys/gnu/dts/arm/imx7d-zii-rmu2.dts head/sys/gnu/dts/arm/imx7d-zii-rpu2.dts head/sys/gnu/dts/arm/imx7d.dtsi head/sys/gnu/dts/arm/imx7s.dtsi head/sys/gnu/dts/arm/integratorap.dts head/sys/gnu/dts/arm/keystone-k2e.dtsi head/sys/gnu/dts/arm/keystone-k2g-evm.dts head/sys/gnu/dts/arm/keystone-k2g.dtsi head/sys/gnu/dts/arm/keystone-k2hk.dtsi head/sys/gnu/dts/arm/keystone-k2l.dtsi head/sys/gnu/dts/arm/kirkwood-netgear_readynas_nv+_v2.dts head/sys/gnu/dts/arm/kirkwood.dtsi head/sys/gnu/dts/arm/logicpd-torpedo-baseboard.dtsi head/sys/gnu/dts/arm/ls1021a-twr.dts head/sys/gnu/dts/arm/meson.dtsi head/sys/gnu/dts/arm/meson8b-odroidc1.dts head/sys/gnu/dts/arm/meson8b.dtsi head/sys/gnu/dts/arm/meson8m2-mxiii-plus.dts head/sys/gnu/dts/arm/meson8m2.dtsi head/sys/gnu/dts/arm/mmp2.dtsi head/sys/gnu/dts/arm/mmp3.dtsi head/sys/gnu/dts/arm/motorola-cpcap-mapphone.dtsi head/sys/gnu/dts/arm/mt2701-evb.dts head/sys/gnu/dts/arm/mt2701.dtsi head/sys/gnu/dts/arm/mt7623.dtsi head/sys/gnu/dts/arm/mt7623n-rfb-emmc.dts head/sys/gnu/dts/arm/omap2.dtsi head/sys/gnu/dts/arm/omap2420.dtsi head/sys/gnu/dts/arm/omap2430.dtsi head/sys/gnu/dts/arm/omap3-beagle.dts head/sys/gnu/dts/arm/omap3-devkit8000.dts head/sys/gnu/dts/arm/omap3-gta04.dtsi head/sys/gnu/dts/arm/omap3-n900.dts head/sys/gnu/dts/arm/omap3.dtsi head/sys/gnu/dts/arm/omap4-duovero-parlor.dts head/sys/gnu/dts/arm/omap4-l4.dtsi head/sys/gnu/dts/arm/omap4.dtsi head/sys/gnu/dts/arm/omap5-l4.dtsi head/sys/gnu/dts/arm/omap5.dtsi head/sys/gnu/dts/arm/pxa168.dtsi head/sys/gnu/dts/arm/pxa3xx.dtsi head/sys/gnu/dts/arm/pxa910.dtsi head/sys/gnu/dts/arm/qcom-ipq4019.dtsi head/sys/gnu/dts/arm/qcom-ipq8064.dtsi head/sys/gnu/dts/arm/qcom-msm8974-samsung-klte.dts head/sys/gnu/dts/arm/qcom-msm8974.dtsi head/sys/gnu/dts/arm/r8a7740.dtsi head/sys/gnu/dts/arm/r8a7743.dtsi head/sys/gnu/dts/arm/r8a7744.dtsi head/sys/gnu/dts/arm/r8a7745.dtsi head/sys/gnu/dts/arm/r8a7790.dtsi head/sys/gnu/dts/arm/r8a7791.dtsi head/sys/gnu/dts/arm/r8a7793.dtsi head/sys/gnu/dts/arm/r8a7794.dtsi head/sys/gnu/dts/arm/rk3036-kylin.dts head/sys/gnu/dts/arm/rk3066a-mk808.dts head/sys/gnu/dts/arm/rk3188-radxarock.dts head/sys/gnu/dts/arm/rk3229-xms6.dts head/sys/gnu/dts/arm/rk322x.dtsi head/sys/gnu/dts/arm/rk3288-firefly-reload.dts head/sys/gnu/dts/arm/rk3288-firefly.dtsi head/sys/gnu/dts/arm/rk3288-miqi.dts head/sys/gnu/dts/arm/rk3288-phycore-som.dtsi head/sys/gnu/dts/arm/rk3288-rock2-square.dts head/sys/gnu/dts/arm/rk3288-tinker.dtsi head/sys/gnu/dts/arm/rk3288.dtsi head/sys/gnu/dts/arm/s5pv210-aries.dtsi head/sys/gnu/dts/arm/s5pv210-fascinate4g.dts head/sys/gnu/dts/arm/s5pv210-galaxys.dts head/sys/gnu/dts/arm/s5pv210-pinctrl.dtsi head/sys/gnu/dts/arm/s5pv210.dtsi head/sys/gnu/dts/arm/sama5d2.dtsi head/sys/gnu/dts/arm/sama5d3.dtsi head/sys/gnu/dts/arm/sama5d3_can.dtsi head/sys/gnu/dts/arm/sama5d3_emac.dtsi head/sys/gnu/dts/arm/sama5d3_gmac.dtsi head/sys/gnu/dts/arm/sama5d3_lcd.dtsi head/sys/gnu/dts/arm/sama5d3_mci2.dtsi head/sys/gnu/dts/arm/sama5d3_tcb1.dtsi head/sys/gnu/dts/arm/sama5d3_uart.dtsi head/sys/gnu/dts/arm/sama5d3xmb.dtsi head/sys/gnu/dts/arm/sama5d3xmb_cmp.dtsi head/sys/gnu/dts/arm/sama5d4.dtsi head/sys/gnu/dts/arm/sh73a0.dtsi head/sys/gnu/dts/arm/socfpga.dtsi head/sys/gnu/dts/arm/socfpga_arria10.dtsi head/sys/gnu/dts/arm/ste-ux500-samsung-golden.dts head/sys/gnu/dts/arm/ste-ux500-samsung-skomer.dts head/sys/gnu/dts/arm/stih407-family.dtsi head/sys/gnu/dts/arm/stih418.dtsi head/sys/gnu/dts/arm/stm32f429.dtsi head/sys/gnu/dts/arm/stm32h743.dtsi head/sys/gnu/dts/arm/stm32mp15-pinctrl.dtsi head/sys/gnu/dts/arm/stm32mp151.dtsi head/sys/gnu/dts/arm/stm32mp157.dtsi head/sys/gnu/dts/arm/stm32mp157a-avenger96.dts head/sys/gnu/dts/arm/stm32mp157c-dhcom-pdk2.dts head/sys/gnu/dts/arm/stm32mp157c-dk2.dts head/sys/gnu/dts/arm/stm32mp157c-ed1.dts head/sys/gnu/dts/arm/stm32mp157c-ev1.dts head/sys/gnu/dts/arm/stm32mp15xx-dkx.dtsi head/sys/gnu/dts/arm/sun4i-a10.dtsi head/sys/gnu/dts/arm/sun5i.dtsi head/sys/gnu/dts/arm/sun7i-a20.dtsi head/sys/gnu/dts/arm/sun8i-a83t.dtsi head/sys/gnu/dts/arm/sun8i-h2-plus-bananapi-m2-zero.dts head/sys/gnu/dts/arm/sun8i-h3.dtsi head/sys/gnu/dts/arm/sunxi-h3-h5.dtsi head/sys/gnu/dts/arm/tegra114-dalmore.dts head/sys/gnu/dts/arm/tegra124-venice2.dts head/sys/gnu/dts/arm/tegra20-colibri-eval-v3.dts head/sys/gnu/dts/arm/tegra20-colibri-iris.dts head/sys/gnu/dts/arm/tegra20-harmony.dts head/sys/gnu/dts/arm/tegra20-medcom-wide.dts head/sys/gnu/dts/arm/tegra20-paz00.dts head/sys/gnu/dts/arm/tegra20-seaboard.dts head/sys/gnu/dts/arm/tegra20-ventana.dts head/sys/gnu/dts/arm/tegra30-apalis-eval.dts head/sys/gnu/dts/arm/tegra30-apalis-v1.1-eval.dts head/sys/gnu/dts/arm/tegra30-beaver.dts head/sys/gnu/dts/arm/tegra30-cardhu.dtsi head/sys/gnu/dts/arm/tegra30-colibri-eval-v3.dts head/sys/gnu/dts/arm/uniphier-ld4.dtsi head/sys/gnu/dts/arm/uniphier-ld6b-ref.dts head/sys/gnu/dts/arm/uniphier-pro4-ace.dts head/sys/gnu/dts/arm/uniphier-pro4-ref.dts head/sys/gnu/dts/arm/uniphier-pro4-sanji.dts head/sys/gnu/dts/arm/uniphier-pro4.dtsi head/sys/gnu/dts/arm/uniphier-pro5.dtsi head/sys/gnu/dts/arm/uniphier-pxs2-gentil.dts head/sys/gnu/dts/arm/uniphier-pxs2-vodka.dts head/sys/gnu/dts/arm/uniphier-pxs2.dtsi head/sys/gnu/dts/arm/uniphier-sld8.dtsi head/sys/gnu/dts/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-a64-olinuxino.dts head/sys/gnu/dts/arm64/allwinner/sun50i-a64.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h6-beelink-gs1.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-3.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi-lite2.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-orangepi.dtsi head/sys/gnu/dts/arm64/allwinner/sun50i-h6-pine-h64.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6-tanix-tx6.dts head/sys/gnu/dts/arm64/allwinner/sun50i-h6.dtsi head/sys/gnu/dts/arm64/altera/socfpga_stratix10.dtsi head/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk.dts head/sys/gnu/dts/arm64/altera/socfpga_stratix10_socdk_nand.dts head/sys/gnu/dts/arm64/amlogic/meson-axg.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12-common.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-khadas-vim3.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-s922x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-g12b-ugoos-am6.dts head/sys/gnu/dts/arm64/amlogic/meson-g12b.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gx-libretech-pc.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gx-p23x-q20x.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gx.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb-kii-pro.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nanopi-k2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-nexbox-a95x.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-odroidc2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-vega-s95.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek-play2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxbb-wetek.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxbb.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-libretech-ac.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s805x-p241.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905d-phicomm-n1.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-p281.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905w-tx3-mini.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-khadas-vim.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-libretech-cc.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-nexbox-a95x.dts head/sys/gnu/dts/arm64/amlogic/meson-gxl-s905x-p212.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxl.dtsi head/sys/gnu/dts/arm64/amlogic/meson-gxm-khadas-vim2.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-nexbox-a1.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-rbox-pro.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm-vega-s96.dts head/sys/gnu/dts/arm64/amlogic/meson-gxm.dtsi head/sys/gnu/dts/arm64/amlogic/meson-khadas-vim3.dtsi head/sys/gnu/dts/arm64/amlogic/meson-sm1-sei610.dts head/sys/gnu/dts/arm64/amlogic/meson-sm1.dtsi head/sys/gnu/dts/arm64/arm/foundation-v8-gicv2.dtsi head/sys/gnu/dts/arm64/arm/foundation-v8-gicv3.dtsi head/sys/gnu/dts/arm64/arm/foundation-v8.dtsi head/sys/gnu/dts/arm64/arm/fvp-base-revc.dts head/sys/gnu/dts/arm64/arm/juno-base.dtsi head/sys/gnu/dts/arm64/arm/juno-motherboard.dtsi head/sys/gnu/dts/arm64/arm/rtsm_ve-aemv8a.dts head/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard-rs2.dtsi head/sys/gnu/dts/arm64/arm/rtsm_ve-motherboard.dtsi head/sys/gnu/dts/arm64/arm/vexpress-v2m-rs1.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frdm.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-frwy.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-qds.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1012a-rdb.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1012a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-kontron-sl28-var2.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a-kontron-sl28.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1028a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-ls1043a-rdb.dts head/sys/gnu/dts/arm64/freescale/fsl-ls1043a.dtsi head/sys/gnu/dts/arm64/freescale/fsl-lx2160a.dtsi head/sys/gnu/dts/arm64/freescale/imx8mm-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mm.dtsi head/sys/gnu/dts/arm64/freescale/imx8mn-ddr4-evk.dts head/sys/gnu/dts/arm64/freescale/imx8mn.dtsi head/sys/gnu/dts/arm64/freescale/imx8mp.dtsi head/sys/gnu/dts/arm64/freescale/imx8mq-librem5-devkit.dts head/sys/gnu/dts/arm64/freescale/imx8mq.dtsi head/sys/gnu/dts/arm64/freescale/imx8qxp-mek.dts head/sys/gnu/dts/arm64/freescale/imx8qxp.dtsi head/sys/gnu/dts/arm64/freescale/qoriq-fman3-0.dtsi head/sys/gnu/dts/arm64/hisilicon/hi3660.dtsi head/sys/gnu/dts/arm64/hisilicon/hi6220-coresight.dtsi head/sys/gnu/dts/arm64/hisilicon/hikey960-pinctrl.dtsi head/sys/gnu/dts/arm64/intel/socfpga_agilex.dtsi head/sys/gnu/dts/arm64/intel/socfpga_agilex_socdk.dts head/sys/gnu/dts/arm64/marvell/armada-3720-db.dts head/sys/gnu/dts/arm64/marvell/armada-3720-espressobin.dtsi head/sys/gnu/dts/arm64/marvell/armada-3720-turris-mox.dts head/sys/gnu/dts/arm64/marvell/armada-3720-uDPU.dts head/sys/gnu/dts/arm64/marvell/armada-37xx.dtsi head/sys/gnu/dts/arm64/marvell/armada-8040-clearfog-gt-8k.dts head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin-singleshot.dts head/sys/gnu/dts/arm64/marvell/armada-8040-mcbin.dts head/sys/gnu/dts/arm64/marvell/armada-ap80x.dtsi head/sys/gnu/dts/arm64/mediatek/mt2712-evb.dts head/sys/gnu/dts/arm64/mediatek/mt2712e.dtsi head/sys/gnu/dts/arm64/mediatek/mt6797-x20-dev.dts head/sys/gnu/dts/arm64/mediatek/mt6797.dtsi head/sys/gnu/dts/arm64/mediatek/mt7622-bananapi-bpi-r64.dts head/sys/gnu/dts/arm64/mediatek/mt7622-rfb1.dts head/sys/gnu/dts/arm64/mediatek/mt7622.dtsi head/sys/gnu/dts/arm64/mediatek/mt8173.dtsi head/sys/gnu/dts/arm64/mediatek/mt8183-evb.dts head/sys/gnu/dts/arm64/mediatek/mt8183.dtsi head/sys/gnu/dts/arm64/mediatek/mt8516.dtsi head/sys/gnu/dts/arm64/mediatek/pumpkin-common.dtsi head/sys/gnu/dts/arm64/nvidia/tegra132-norrin.dts head/sys/gnu/dts/arm64/nvidia/tegra186-p3310.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194-p2888.dtsi head/sys/gnu/dts/arm64/nvidia/tegra194.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p2180.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p2597.dtsi head/sys/gnu/dts/arm64/nvidia/tegra210-p3450-0000.dts head/sys/gnu/dts/arm64/nvidia/tegra210.dtsi head/sys/gnu/dts/arm64/qcom/apq8016-sbc.dtsi head/sys/gnu/dts/arm64/qcom/apq8096-db820c.dtsi head/sys/gnu/dts/arm64/qcom/ipq8074-hk01.dts head/sys/gnu/dts/arm64/qcom/ipq8074.dtsi head/sys/gnu/dts/arm64/qcom/msm8916-longcheer-l8150.dts head/sys/gnu/dts/arm64/qcom/msm8916-pins.dtsi head/sys/gnu/dts/arm64/qcom/msm8916-samsung-a2015-common.dtsi head/sys/gnu/dts/arm64/qcom/msm8916-samsung-a3u-eur.dts head/sys/gnu/dts/arm64/qcom/msm8916-samsung-a5u-eur.dts head/sys/gnu/dts/arm64/qcom/msm8916.dtsi head/sys/gnu/dts/arm64/qcom/msm8996.dtsi head/sys/gnu/dts/arm64/qcom/msm8998.dtsi head/sys/gnu/dts/arm64/qcom/pm8150.dtsi head/sys/gnu/dts/arm64/qcom/pm8150b.dtsi head/sys/gnu/dts/arm64/qcom/pm8150l.dtsi head/sys/gnu/dts/arm64/qcom/pmi8994.dtsi head/sys/gnu/dts/arm64/qcom/qcs404-evb.dtsi head/sys/gnu/dts/arm64/qcom/qcs404.dtsi head/sys/gnu/dts/arm64/qcom/sc7180-idp.dts head/sys/gnu/dts/arm64/qcom/sc7180.dtsi head/sys/gnu/dts/arm64/qcom/sdm845-cheza.dtsi head/sys/gnu/dts/arm64/qcom/sdm845-db845c.dts head/sys/gnu/dts/arm64/qcom/sdm845-mtp.dts head/sys/gnu/dts/arm64/qcom/sdm845.dtsi head/sys/gnu/dts/arm64/qcom/sdm850-lenovo-yoga-c630.dts head/sys/gnu/dts/arm64/qcom/sm8250-mtp.dts head/sys/gnu/dts/arm64/qcom/sm8250.dtsi head/sys/gnu/dts/arm64/realtek/rtd1293-ds418j.dts head/sys/gnu/dts/arm64/realtek/rtd1293.dtsi head/sys/gnu/dts/arm64/realtek/rtd1295-mele-v9.dts head/sys/gnu/dts/arm64/realtek/rtd1295-probox2-ava.dts head/sys/gnu/dts/arm64/realtek/rtd1295-zidoo-x9s.dts head/sys/gnu/dts/arm64/realtek/rtd1295.dtsi head/sys/gnu/dts/arm64/realtek/rtd1296-ds418.dts head/sys/gnu/dts/arm64/realtek/rtd1296.dtsi head/sys/gnu/dts/arm64/realtek/rtd129x.dtsi head/sys/gnu/dts/arm64/renesas/r8a774a1.dtsi head/sys/gnu/dts/arm64/renesas/r8a774b1.dtsi head/sys/gnu/dts/arm64/renesas/r8a774c0.dtsi head/sys/gnu/dts/arm64/renesas/r8a77950.dtsi head/sys/gnu/dts/arm64/renesas/r8a77951.dtsi head/sys/gnu/dts/arm64/renesas/r8a77960.dtsi head/sys/gnu/dts/arm64/renesas/r8a77961.dtsi head/sys/gnu/dts/arm64/renesas/r8a77965.dtsi head/sys/gnu/dts/arm64/renesas/r8a77970.dtsi head/sys/gnu/dts/arm64/renesas/r8a77980.dtsi head/sys/gnu/dts/arm64/renesas/r8a77990.dtsi head/sys/gnu/dts/arm64/renesas/r8a77995.dtsi head/sys/gnu/dts/arm64/rockchip/px30.dtsi head/sys/gnu/dts/arm64/rockchip/rk3308-roc-cc.dts head/sys/gnu/dts/arm64/rockchip/rk3328-a1.dts head/sys/gnu/dts/arm64/rockchip/rk3328-roc-cc.dts head/sys/gnu/dts/arm64/rockchip/rk3328-rock64.dts head/sys/gnu/dts/arm64/rockchip/rk3328.dtsi head/sys/gnu/dts/arm64/rockchip/rk3368-geekbox.dts head/sys/gnu/dts/arm64/rockchip/rk3368-orion-r68-meta.dts head/sys/gnu/dts/arm64/rockchip/rk3368-r88.dts head/sys/gnu/dts/arm64/rockchip/rk3399-ficus.dts head/sys/gnu/dts/arm64/rockchip/rk3399-firefly.dts head/sys/gnu/dts/arm64/rockchip/rk3399-hugsun-x99.dts head/sys/gnu/dts/arm64/rockchip/rk3399-nanopi4.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399-orangepi.dts head/sys/gnu/dts/arm64/rockchip/rk3399-pinebook-pro.dts head/sys/gnu/dts/arm64/rockchip/rk3399-rock960.dts head/sys/gnu/dts/arm64/rockchip/rk3399-rockpro64.dtsi head/sys/gnu/dts/arm64/rockchip/rk3399.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-ld11-global.dts head/sys/gnu/dts/arm64/socionext/uniphier-ld11-ref.dts head/sys/gnu/dts/arm64/socionext/uniphier-ld11.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-ld20-global.dts head/sys/gnu/dts/arm64/socionext/uniphier-ld20-ref.dts head/sys/gnu/dts/arm64/socionext/uniphier-ld20.dtsi head/sys/gnu/dts/arm64/socionext/uniphier-pxs3-ref.dts head/sys/gnu/dts/arm64/socionext/uniphier-pxs3.dtsi head/sys/gnu/dts/arm64/sprd/sc9863a.dtsi head/sys/gnu/dts/arm64/sprd/sharkl3.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-main.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-mcu.dtsi head/sys/gnu/dts/arm64/ti/k3-am65-wakeup.dtsi head/sys/gnu/dts/arm64/ti/k3-j721e-common-proc-board.dts head/sys/gnu/dts/arm64/ti/k3-j721e-main.dtsi head/sys/gnu/dts/arm64/ti/k3-j721e-mcu-wakeup.dtsi head/sys/gnu/dts/arm64/xilinx/zynqmp.dtsi head/sys/gnu/dts/include/dt-bindings/clock/at91.h head/sys/gnu/dts/include/dt-bindings/clock/imx7ulp-clock.h head/sys/gnu/dts/include/dt-bindings/clock/imx8mp-clock.h head/sys/gnu/dts/include/dt-bindings/clock/marvell,mmp2.h head/sys/gnu/dts/include/dt-bindings/clock/meson8b-clkc.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-msm8998.h head/sys/gnu/dts/include/dt-bindings/clock/qcom,gcc-sc7180.h head/sys/gnu/dts/include/dt-bindings/clock/sprd,sc9863a-clk.h head/sys/gnu/dts/include/dt-bindings/clock/tegra114-car.h head/sys/gnu/dts/include/dt-bindings/clock/tegra124-car-common.h head/sys/gnu/dts/include/dt-bindings/clock/tegra20-car.h head/sys/gnu/dts/include/dt-bindings/clock/tegra210-car.h head/sys/gnu/dts/include/dt-bindings/clock/tegra30-car.h head/sys/gnu/dts/include/dt-bindings/clock/x1000-cgu.h head/sys/gnu/dts/include/dt-bindings/firmware/imx/rsrc.h head/sys/gnu/dts/include/dt-bindings/input/linux-event-codes.h head/sys/gnu/dts/include/dt-bindings/phy/phy.h head/sys/gnu/dts/include/dt-bindings/pinctrl/rockchip.h head/sys/gnu/dts/include/dt-bindings/power/qcom-rpmpd.h head/sys/gnu/dts/include/dt-bindings/reset/amlogic,meson-gxbb-reset.h head/sys/gnu/dts/include/dt-bindings/reset/imx8mq-reset.h head/sys/gnu/dts/include/dt-bindings/reset/realtek,rtd1295.h Directory Properties: head/sys/gnu/dts/arm/ (props changed) head/sys/gnu/dts/arm64/ (props changed) head/sys/gnu/dts/include/ (props changed) head/sys/gnu/dts/riscv/ (props changed) Modified: head/sys/gnu/dts/arm/am335x-baltos.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-baltos.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-baltos.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -369,7 +369,7 @@ &mmc2 { status = "okay"; vmmc-supply = <&wl12xx_vmmc>; - ti,non-removable; + non-removable; bus-width = <4>; cap-power-off-card; pinctrl-names = "default"; Modified: head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-boneblack-common.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -22,6 +22,7 @@ pinctrl-0 = <&emmc_pins>; bus-width = <8>; status = "okay"; + non-removable; }; &am33xx_pinmux { Modified: head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-boneblack-wireless.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -75,7 +75,6 @@ bus-width = <4>; non-removable; cap-power-off-card; - ti,needs-special-hs-handling; keep-power-in-suspend; pinctrl-names = "default"; pinctrl-0 = <&mmc3_pins &wl18xx_pins>; Modified: head/sys/gnu/dts/arm/am335x-boneblue.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-boneblue.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-boneblue.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -367,7 +367,6 @@ bus-width = <4>; non-removable; cap-power-off-card; - ti,needs-special-hs-handling; keep-power-in-suspend; pinctrl-names = "default"; pinctrl-0 = <&mmc3_pins &wl18xx_pins>; Modified: head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-bonegreen-wireless.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -75,7 +75,6 @@ bus-width = <4>; non-removable; cap-power-off-card; - ti,needs-special-hs-handling; keep-power-in-suspend; pinctrl-names = "default"; pinctrl-0 = <&mmc3_pins &wl18xx_pins>; Modified: head/sys/gnu/dts/arm/am335x-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -743,8 +743,7 @@ bus-width = <4>; pinctrl-names = "default"; pinctrl-0 = <&mmc3_pins &wlan_pins>; - ti,non-removable; - ti,needs-special-hs-handling; + non-removable; cap-power-off-card; keep-power-in-suspend; Modified: head/sys/gnu/dts/arm/am335x-evmsk.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-evmsk.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-evmsk.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -655,7 +655,7 @@ &mmc2 { status = "okay"; vmmc-supply = <&wl12xx_vmmc>; - ti,non-removable; + non-removable; bus-width = <4>; cap-power-off-card; keep-power-in-suspend; Modified: head/sys/gnu/dts/arm/am335x-guardian.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-guardian.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-guardian.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -105,6 +105,7 @@ ti,timers = <&timer7>; pinctrl-names = "default"; pinctrl-0 = <&dmtimer7_pins>; + ti,clock-source = <0x01>; }; vmmcsd_fixed: regulator-3v3 { Modified: head/sys/gnu/dts/arm/am335x-lxm.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-lxm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-lxm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -339,7 +339,7 @@ pinctrl-0 = <&emmc_pins>; vmmc-supply = <&vmmcsd_fixed>; bus-width = <8>; - ti,non-removable; + non-removable; status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-moxa-uc-2100-common.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -159,7 +159,7 @@ vmmc-supply = <&vmmcsd_fixed>; bus-width = <8>; pinctrl-0 = <&mmc1_pins_default>; - ti,non-removable; + non-removable; status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-moxa-uc-8100-me-t.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -451,7 +451,7 @@ vmmc-supply = <&vmmcsd_fixed>; bus-width = <8>; pinctrl-0 = <&mmc2_pins_default>; - ti,non-removable; + non-removable; status = "okay"; }; Modified: head/sys/gnu/dts/arm/am335x-pepper.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-pepper.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-pepper.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -341,7 +341,7 @@ pinctrl-0 = <&emmc_pins>; vmmc-supply = <&ldo3_reg>; bus-width = <8>; - ti,non-removable; + non-removable; }; &mmc3 { @@ -351,7 +351,7 @@ pinctrl-0 = <&wireless_pins>; vmmmc-supply = <&v3v3c_reg>; bus-width = <4>; - ti,non-removable; + non-removable; dmas = <&edma_xbar 12 0 1 &edma_xbar 13 0 2>; dma-names = "tx", "rx"; Modified: head/sys/gnu/dts/arm/am335x-phycore-som.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-phycore-som.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -69,7 +69,7 @@ pinctrl-0 = <&emmc_pins>; vmmc-supply = <&vmmc_reg>; bus-width = <8>; - ti,non-removable; + non-removable; status = "disabled"; }; Modified: head/sys/gnu/dts/arm/am335x-pocketbeagle.dts ============================================================================== --- head/sys/gnu/dts/arm/am335x-pocketbeagle.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am335x-pocketbeagle.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -88,7 +88,6 @@ AM33XX_PADCONF(AM335X_PIN_MMC0_DAT3, PIN_INPUT_PULLUP, MUX_MODE0) AM33XX_PADCONF(AM335X_PIN_MMC0_CMD, PIN_INPUT_PULLUP, MUX_MODE0) AM33XX_PADCONF(AM335X_PIN_MMC0_CLK, PIN_INPUT_PULLUP, MUX_MODE0) - AM33XX_PADCONF(AM335X_PIN_MCASP0_ACLKR, PIN_INPUT, MUX_MODE4) /* (B12) mcasp0_aclkr.mmc0_sdwp */ >; }; Modified: head/sys/gnu/dts/arm/am33xx-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx-l4.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am33xx-l4.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -330,9 +330,8 @@ }; }; - target-module@31000 { /* 0x44e31000, ap 25 40.0 */ + timer1_target: target-module@31000 { /* 0x44e31000, ap 25 40.0 */ compatible = "ti,sysc-omap2-timer", "ti,sysc"; - ti,hwmods = "timer1"; reg = <0x31000 0x4>, <0x31010 0x4>, <0x31014 0x4>; @@ -1117,9 +1116,8 @@ }; }; - target-module@40000 { /* 0x48040000, ap 22 1e.0 */ + timer2_target: target-module@40000 { /* 0x48040000, ap 22 1e.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer2"; reg = <0x40000 0x4>, <0x40010 0x4>, <0x40014 0x4>; @@ -1347,10 +1345,8 @@ ranges = <0x0 0x60000 0x1000>; mmc1: mmc@0 { - compatible = "ti,omap4-hsmmc"; - ti,dual-volt; + compatible = "ti,am335-sdhci"; ti,needs-special-reset; - ti,needs-special-hs-handling; dmas = <&edma_xbar 24 0 0 &edma_xbar 25 0 0>; dma-names = "tx", "rx"; @@ -1828,7 +1824,7 @@ ranges = <0x0 0xd8000 0x1000>; mmc2: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am335-sdhci"; ti,needs-special-reset; dmas = <&edma 2 0 &edma 3 0>; Modified: head/sys/gnu/dts/arm/am33xx.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am33xx.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am33xx.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -322,7 +322,7 @@ ranges = <0x0 0x47810000 0x1000>; mmc3: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am335-sdhci"; ti,needs-special-reset; interrupts = <29>; reg = <0x0 0x1000>; @@ -618,5 +618,25 @@ compatible = "ti,am3-prm-inst", "ti,omap-prm-inst"; reg = <0x1100 0x100>; #reset-cells = <1>; + }; +}; + +/* Preferred always-on timer for clocksource */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&timer1_fck>; + assigned-clock-parents = <&sys_clkin_ck>; + }; +}; + +/* Preferred timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&timer2_fck>; + assigned-clock-parents = <&sys_clkin_ck>; }; }; Modified: head/sys/gnu/dts/arm/am3517-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am3517-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am3517-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -156,6 +156,7 @@ pinctrl-0 = <&pwm_pins>; ti,timers = <&timer11>; #pwm-cells = <3>; + ti,clock-source = <0x01>; }; /* HS USB Host PHY on PORT 1 */ Modified: head/sys/gnu/dts/arm/am3517.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am3517.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am3517.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -169,5 +169,25 @@ status = "disabled"; }; -/include/ "am35xx-clocks.dtsi" -/include/ "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" +#include "am35xx-clocks.dtsi" +#include "omap36xx-am35xx-omap3430es2plus-clocks.dtsi" + +/* Preferred always-on timer for clocksource */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&gpt1_fck>; + assigned-clock-parents = <&sys_ck>; + }; +}; + +/* Preferred timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&gpt2_fck>; + assigned-clock-parents = <&sys_ck>; + }; +}; Modified: head/sys/gnu/dts/arm/am4372.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am4372.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am4372.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -316,10 +316,11 @@ ranges = <0x0 0x47810000 0x1000>; mmc3: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am437-sdhci"; ti,needs-special-reset; interrupts = ; reg = <0x0 0x1000>; + status = "disabled"; }; }; @@ -551,5 +552,25 @@ compatible = "ti,am4-prm-inst", "ti,omap-prm-inst"; reg = <0x4000 0x100>; #reset-cells = <1>; + }; +}; + +/* Preferred always-on timer for clocksource */ +&timer1_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&timer1_fck>; + assigned-clock-parents = <&sys_clkin_ck>; + }; +}; + +/* Preferred timer for clockevent */ +&timer2_target { + ti,no-reset-on-init; + ti,no-idle; + timer@0 { + assigned-clocks = <&timer2_fck>; + assigned-clock-parents = <&sys_clkin_ck>; }; }; Modified: head/sys/gnu/dts/arm/am437x-cm-t43.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-cm-t43.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am437x-cm-t43.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -291,7 +291,7 @@ pinctrl-0 = <&emmc_pins>; vmmc-supply = <&vmmc_3v3>; bus-width = <8>; - ti,non-removable; + non-removable; }; &spi0 { Modified: head/sys/gnu/dts/arm/am437x-gp-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-gp-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am437x-gp-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -91,22 +91,6 @@ backlight = <&lcd_bl>; - panel-timing { - clock-frequency = <33000000>; - hactive = <800>; - vactive = <480>; - hfront-porch = <210>; - hback-porch = <16>; - hsync-len = <30>; - vback-porch = <10>; - vfront-porch = <22>; - vsync-len = <13>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <1>; - }; - port { lcd_in: endpoint { remote-endpoint = <&dpi_out>; @@ -869,7 +853,7 @@ pinctrl-names = "default", "sleep"; pinctrl-0 = <&emmc_pins_default>; pinctrl-1 = <&emmc_pins_sleep>; - ti,non-removable; + non-removable; }; &mmc3 { @@ -886,7 +870,7 @@ pinctrl-1 = <&mmc3_pins_sleep>; cap-power-off-card; keep-power-in-suspend; - ti,non-removable; + non-removable; #address-cells = <1>; #size-cells = <0>; Modified: head/sys/gnu/dts/arm/am437x-l4.dtsi ============================================================================== --- head/sys/gnu/dts/arm/am437x-l4.dtsi Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am437x-l4.dtsi Tue Aug 4 19:44:43 2020 (r363853) @@ -328,9 +328,8 @@ }; }; - target-module@31000 { /* 0x44e31000, ap 24 40.0 */ + timer1_target: target-module@31000 { /* 0x44e31000, ap 24 40.0 */ compatible = "ti,sysc-omap2-timer", "ti,sysc"; - ti,hwmods = "timer1"; reg = <0x31000 0x4>, <0x31010 0x4>, <0x31014 0x4>; @@ -450,7 +449,6 @@ target-module@86000 { /* 0x44e86000, ap 40 70.0 */ compatible = "ti,sysc-omap2", "ti,sysc"; - ti,hwmods = "counter_32k"; reg = <0x86000 0x4>, <0x86004 0x4>; reg-names = "rev", "sysc"; @@ -868,9 +866,8 @@ }; }; - target-module@40000 { /* 0x48040000, ap 18 1e.0 */ + timer2_target: target-module@40000 { /* 0x48040000, ap 18 1e.0 */ compatible = "ti,sysc-omap4-timer", "ti,sysc"; - ti,hwmods = "timer2"; reg = <0x40000 0x4>, <0x40010 0x4>, <0x40014 0x4>; @@ -1086,9 +1083,8 @@ ranges = <0x0 0x60000 0x1000>; mmc1: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am437-sdhci"; reg = <0x0 0x1000>; - ti,dual-volt; ti,needs-special-reset; dmas = <&edma 24 0>, <&edma 25 0>; @@ -1544,8 +1540,9 @@ reg = <0xcc020 0x4>; reg-names = "rev"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ - clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>; - clock-names = "fck"; + clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN0_CLKCTRL 0>, + <&dcan0_fck>; + clock-names = "fck", "osc"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0xcc000 0x2000>; @@ -1553,6 +1550,8 @@ dcan0: can@0 { compatible = "ti,am4372-d_can", "ti,am3352-d_can"; reg = <0x0 0x2000>; + clocks = <&dcan0_fck>; + clock-names = "fck"; syscon-raminit = <&scm_conf 0x644 0>; interrupts = ; status = "disabled"; @@ -1564,8 +1563,9 @@ reg = <0xd0020 0x4>; reg-names = "rev"; /* Domains (P, C): per_pwrdm, l4ls_clkdm */ - clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>; - clock-names = "fck"; + clocks = <&l4ls_clkctrl AM4_L4LS_D_CAN1_CLKCTRL 0>, + <&dcan1_fck>; + clock-names = "fck", "osc"; #address-cells = <1>; #size-cells = <1>; ranges = <0x0 0xd0000 0x2000>; @@ -1573,6 +1573,8 @@ dcan1: can@0 { compatible = "ti,am4372-d_can", "ti,am3352-d_can"; reg = <0x0 0x2000>; + clocks = <&dcan1_fck>; + clock-name = "fck"; syscon-raminit = <&scm_conf 0x644 1>; interrupts = ; status = "disabled"; @@ -1601,7 +1603,7 @@ ranges = <0x0 0xd8000 0x1000>; mmc2: mmc@0 { - compatible = "ti,omap4-hsmmc"; + compatible = "ti,am437-sdhci"; reg = <0x0 0x1000>; ti,needs-special-reset; dmas = <&edma 2 0>, Modified: head/sys/gnu/dts/arm/am437x-sk-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am437x-sk-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am437x-sk-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -134,22 +134,6 @@ enable-gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>; - panel-timing { - clock-frequency = <9000000>; - hactive = <480>; - vactive = <272>; - hfront-porch = <2>; - hback-porch = <2>; - hsync-len = <41>; - vfront-porch = <2>; - vback-porch = <2>; - vsync-len = <10>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <1>; - }; - port { lcd_in: endpoint { remote-endpoint = <&dpi_out>; @@ -719,7 +703,7 @@ pinctrl-1 = <&mmc3_pins_sleep>; cap-power-off-card; keep-power-in-suspend; - ti,non-removable; + non-removable; #address-cells = <1>; #size-cells = <0>; Modified: head/sys/gnu/dts/arm/am43x-epos-evm.dts ============================================================================== --- head/sys/gnu/dts/arm/am43x-epos-evm.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am43x-epos-evm.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -47,22 +47,6 @@ backlight = <&lcd_bl>; - panel-timing { - clock-frequency = <33000000>; - hactive = <800>; - vactive = <480>; - hfront-porch = <210>; - hback-porch = <16>; - hsync-len = <30>; - vback-porch = <10>; - vfront-porch = <22>; - vsync-len = <13>; - hsync-active = <0>; - vsync-active = <0>; - de-active = <1>; - pixelclk-active = <1>; - }; - port { lcd_in: endpoint { remote-endpoint = <&dpi_out>; Modified: head/sys/gnu/dts/arm/am571x-idk.dts ============================================================================== --- head/sys/gnu/dts/arm/am571x-idk.dts Tue Aug 4 19:27:03 2020 (r363852) +++ head/sys/gnu/dts/arm/am571x-idk.dts Tue Aug 4 19:44:43 2020 (r363853) @@ -10,6 +10,7 @@ #include "dra7-mmc-iodelay.dtsi" #include "dra72x-mmc-iodelay.dtsi" #include "am57xx-idk-common.dtsi" +#include "dra7-ipu-dsp-common.dtsi" / { model = "TI AM5718 IDK"; @@ -20,6 +21,33 @@ reg = <0x0 0x80000000 0x0 0x40000000>; }; + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + ipu2_memory_region: ipu2-memory@95800000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x95800000 0x0 0x3800000>; + reusable; + status = "okay"; + }; + + dsp1_memory_region: dsp1-memory@99000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x99000000 0x0 0x4000000>; + reusable; + status = "okay"; + }; + + ipu1_memory_region: ipu1-memory@9d000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x9d000000 0x0 0x2000000>; + reusable; + status = "okay"; + }; + }; + leds { compatible = "gpio-leds"; cpu0-led { @@ -148,21 +176,19 @@ load-gpios = <&gpio2 23 GPIO_ACTIVE_LOW>; }; -&mailbox5 { +&ipu2 { status = "okay"; - mbox_ipu1_ipc3x: mbox_ipu1_ipc3x { - status = "okay"; - }; - mbox_dsp1_ipc3x: mbox_dsp1_ipc3x { - status = "okay"; - }; + memory-region = <&ipu2_memory_region>; }; -&mailbox6 { +&ipu1 { status = "okay"; - mbox_ipu2_ipc3x: mbox_ipu2_ipc3x { - status = "okay"; - }; + memory-region = <&ipu1_memory_region>; +}; + +&dsp1 { + status = "okay"; + memory-region = <&dsp1_memory_region>; }; &pcie1_rc { Copied: head/sys/gnu/dts/arm/am5729-beagleboneai.dts (from r363850, vendor/device-tree/dist/src/arm/am5729-beagleboneai.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/gnu/dts/arm/am5729-beagleboneai.dts Tue Aug 4 19:44:43 2020 (r363853, copy of r363850, vendor/device-tree/dist/src/arm/am5729-beagleboneai.dts) @@ -0,0 +1,731 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2014-2019 Texas Instruments Incorporated - http://www.ti.com/ + */ + +/dts-v1/; + +#include "dra74x.dtsi" +#include "am57xx-commercial-grade.dtsi" +#include "dra74x-mmc-iodelay.dtsi" +#include +#include +#include + +/ { + model = "BeagleBoard.org BeagleBone AI"; + compatible = "beagle,am5729-beagleboneai", "ti,am5728", + "ti,dra742", "ti,dra74", "ti,dra7"; + + aliases { + rtc0 = &tps659038_rtc; + rtc1 = &rtc; + display0 = &hdmi_conn; + }; + + chosen { + stdout-path = &uart1; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x80000000 0x0 0x40000000>; + }; + + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + ipu2_memory_region: ipu2-memory@95800000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x95800000 0x0 0x3800000>; + reusable; + status = "okay"; + }; + + dsp1_memory_region: dsp1-memory@99000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x99000000 0x0 0x4000000>; + reusable; + status = "okay"; + }; + + ipu1_memory_region: ipu1-memory@9d000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x9d000000 0x0 0x2000000>; + reusable; + status = "okay"; + }; + + dsp2_memory_region: dsp2-memory@9f000000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x9f000000 0x0 0x800000>; + reusable; + status = "okay"; + }; + + }; + + vdd_adc: gpioregulator-vdd_adc { + compatible = "regulator-gpio"; + regulator-name = "vdd_adc"; + vin-supply = <&vdd_5v>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + gpios = <&gpio3 27 GPIO_ACTIVE_HIGH>; + states = <1800000 0 + 3300000 1>; + }; + + vdd_5v: fixedregulator-vdd_5v { + compatible = "regulator-fixed"; + regulator-name = "vdd_5v"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-always-on; + regulator-boot-on; + }; + + vtt_fixed: fixedregulator-vtt { + /* TPS51200 */ + compatible = "regulator-fixed"; + regulator-name = "vtt_fixed"; + vin-supply = <&vdd_ddr>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; + + leds { + compatible = "gpio-leds"; + + led0 { + label = "beaglebone:green:usr0"; + gpios = <&gpio3 17 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "heartbeat"; + default-state = "off"; + }; + + led1 { + label = "beaglebone:green:usr1"; + gpios = <&gpio5 5 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc0"; + default-state = "off"; + }; + + led2 { + label = "beaglebone:green:usr2"; + gpios = <&gpio3 15 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "cpu"; + default-state = "off"; + }; + + led3 { + label = "beaglebone:green:usr3"; + gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "mmc1"; + default-state = "off"; + }; + + led4 { + label = "beaglebone:green:usr4"; + gpios = <&gpio3 7 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "netdev"; + default-state = "off"; + }; + }; + + hdmi_conn: connector@0 { + compatible = "hdmi-connector"; + label = "hdmi"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&hdmi_encoder_out>; + }; + }; + }; + + hdmi_enc: encoder@0 { + /* "ti,tpd12s016" software compatible with "ti,tpd12s015" + * no need for individual driver + */ + compatible = "ti,tpd12s015"; + gpios = <0>, + <0>, + <&gpio7 12 GPIO_ACTIVE_HIGH>; + + ports { + #address-cells = <0x1>; + #size-cells = <0x0>; + + port@0 { + reg = <0x0>; + + hdmi_encoder_in: endpoint@0 { + remote-endpoint = <&hdmi_out>; + }; + }; + + port@1 { + reg = <0x1>; + + hdmi_encoder_out: endpoint@0 { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; + + emmc_pwrseq: emmc_pwrseq { + compatible = "mmc-pwrseq-emmc"; + reset-gpios = <&gpio5 7 GPIO_ACTIVE_LOW>; + }; + + brcmf_pwrseq: brcmf_pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>, /* BT-REG-ON */ + <&gpio3 18 GPIO_ACTIVE_LOW>; /* WL-REG-ON */ + }; + + extcon_usb1: extcon_usb1 { + compatible = "linux,extcon-usb-gpio"; + ti,enable-id-detection; + id-gpio = <&gpio3 13 GPIO_ACTIVE_HIGH>; + }; +}; + +&i2c1 { + status = "okay"; + clock-frequency = <400000>; + + tps659038: tps659038@58 { + compatible = "ti,tps659038"; + reg = <0x58>; + interrupt-parent = <&gpio6>; + interrupts = <16 IRQ_TYPE_LEVEL_LOW>; + + #interrupt-cells = <2>; + interrupt-controller; + + ti,system-power-controller; + ti,palmas-override-powerhold; + + tps659038_pmic { + compatible = "ti,tps659038-pmic"; + + smps12-in-supply = <&vdd_5v>; + smps3-in-supply = <&vdd_5v>; + smps45-in-supply = <&vdd_5v>; + smps6-in-supply = <&vdd_5v>; + smps7-in-supply = <&vdd_5v>; + mps3-in-supply = <&vdd_5v>; + smps8-in-supply = <&vdd_5v>; + smps9-in-supply = <&vdd_5v>; + ldo1-in-supply = <&vdd_5v>; + ldo2-in-supply = <&vdd_5v>; + ldo3-in-supply = <&vdd_5v>; + ldo4-in-supply = <&vdd_5v>; + ldo9-in-supply = <&vdd_5v>; + ldoln-in-supply = <&vdd_5v>; + ldousb-in-supply = <&vdd_5v>; + ldortc-in-supply = <&vdd_5v>; + + regulators { + vdd_mpu: smps12 { + /* VDD_MPU */ + regulator-name = "smps12"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_ddr: smps3 { + /* VDD_DDR EMIF1 EMIF2 */ + regulator-name = "smps3"; + regulator-min-microvolt = <1350000>; + regulator-max-microvolt = <1350000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_dspeve: smps45 { + /* VDD_DSPEVE on AM572 */ + regulator-name = "smps45"; + regulator-min-microvolt = < 850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_gpu: smps6 { + /* VDD_GPU */ + regulator-name = "smps6"; + regulator-min-microvolt = < 850000>; + regulator-max-microvolt = <1250000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_core: smps7 { + /* VDD_CORE */ + regulator-name = "smps7"; + regulator-min-microvolt = < 850000>; /*** 1.15V */ + regulator-max-microvolt = <1150000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_iva: smps8 { + /* VDD_IVAHD */ /*** 1.06V */ + regulator-name = "smps8"; + }; + + vdd_3v3: smps9 { + /* VDD_3V3 */ + regulator-name = "smps9"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_sd: ldo1 { + /* VDDSHV8 - VSDMMC */ + regulator-name = "ldo1"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + regulator-always-on; + }; + + vdd_1v8: ldo2 { + /* VDDSH18V */ + regulator-name = "ldo2"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_1v8_phy_ldo3: ldo3 { + /* R1.3a 572x V1_8PHY_LDO3: USB, SATA */ + regulator-name = "ldo3"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_1v8_phy_ldo4: ldo4 { + /* R1.3a 572x V1_8PHY_LDO4: PCIE, HDMI*/ + regulator-name = "ldo4"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + /* LDO5-8 unused */ + + vdd_rtc: ldo9 { + /* VDD_RTC */ + regulator-name = "ldo9"; + regulator-min-microvolt = < 840000>; + regulator-max-microvolt = <1160000>; + regulator-always-on; + regulator-boot-on; + }; + + vdd_1v8_pll: ldoln { + /* VDDA_1V8_PLL */ + regulator-name = "ldoln"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + ldousb_reg: ldousb { + /* VDDA_3V_USB: VDDA_USBHS33 */ + regulator-name = "ldousb"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + regulator-boot-on; + }; + + ldortc_reg: ldortc { + /* VDDA_RTC */ + regulator-name = "ldortc"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + regulator-boot-on; + }; + + regen1: regen1 { + /* VDD_3V3_ON */ + regulator-name = "regen1"; + regulator-boot-on; + regulator-always-on; + }; + + regen2: regen2 { + /* Needed for PMIC internal resource */ + regulator-name = "regen2"; + regulator-boot-on; + regulator-always-on; + }; + }; + }; + + tps659038_rtc: tps659038_rtc { + compatible = "ti,palmas-rtc"; + interrupt-parent = <&tps659038>; + interrupts = <8 IRQ_TYPE_EDGE_FALLING>; + wakeup-source; + }; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Aug 4 19:52:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A75A637DA15; Tue, 4 Aug 2020 19:52:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLllP3shwz3XV6; Tue, 4 Aug 2020 19:52:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68383AC05; Tue, 4 Aug 2020 19:52:17 +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 074JqHs0009592; Tue, 4 Aug 2020 19:52:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JqHt5009591; Tue, 4 Aug 2020 19:52:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041952.074JqHt5009591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363854 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363854 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:52:17 -0000 Author: mjg Date: Tue Aug 4 19:52:16 2020 New Revision: 363854 URL: https://svnweb.freebsd.org/changeset/base/363854 Log: rms: add a comment explaining performance deficiencies of write locking Modified: head/sys/kern/kern_rmlock.c Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Tue Aug 4 19:44:43 2020 (r363853) +++ head/sys/kern/kern_rmlock.c Tue Aug 4 19:52:16 2020 (r363854) @@ -872,6 +872,10 @@ db_show_rm(const struct lock_object *lock) * Neither rms_rlock nor rms_runlock use fences. Instead compiler barriers are * inserted to prevert reordering of generated code. Execution ordering is * provided with the use of an IPI handler. + * + * No attempt is made to track which CPUs read locked at least once, + * consequently write locking sends IPIs to all of them. This will become a + * problem at some point. The easiest way to lessen it is to provide a bitmamp. */ void From owner-svn-src-all@freebsd.org Tue Aug 4 19:52:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0F4337D770; Tue, 4 Aug 2020 19:52:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlm44gnnz3XMg; Tue, 4 Aug 2020 19:52: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 851B4AC0C; Tue, 4 Aug 2020 19:52: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 074JqqaB009660; Tue, 4 Aug 2020 19:52:52 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JqqEe009659; Tue, 4 Aug 2020 19:52:52 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041952.074JqqEe009659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:52:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363855 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363855 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:52:52 -0000 Author: mjg Date: Tue Aug 4 19:52:52 2020 New Revision: 363855 URL: https://svnweb.freebsd.org/changeset/base/363855 Log: cache: add missing numcache detrement on insertion failure Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:52:16 2020 (r363854) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:52:52 2020 (r363855) @@ -2001,6 +2001,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, return; out_unlock_free: cache_enter_unlock(&cel); + atomic_add_long(&numcache, -1); cache_free(ncp); return; } From owner-svn-src-all@freebsd.org Tue Aug 4 19:54:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C6EC537DC90; Tue, 4 Aug 2020 19:54:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlnb4yFsz3Xr9; Tue, 4 Aug 2020 19:54:11 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D4E4A7D3; Tue, 4 Aug 2020 19:54:11 +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 074JsBg3009764; Tue, 4 Aug 2020 19:54:11 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JsBEP009762; Tue, 4 Aug 2020 19:54:11 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041954.074JsBEP009762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363856 - 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: 363856 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:54:11 -0000 Author: mjg Date: Tue Aug 4 19:54:10 2020 New Revision: 363856 URL: https://svnweb.freebsd.org/changeset/base/363856 Log: vfs: add vfs_op_thread_enter/exit _crit variants and employ them in the namecache. Eliminates all spurious checks for preemption. Modified: head/sys/kern/vfs_cache.c head/sys/sys/mount.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:52:52 2020 (r363855) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:54:10 2020 (r363856) @@ -3484,29 +3484,29 @@ cache_fplookup_climb_mount(struct cache_fpl *fpl) prev_mp = NULL; for (;;) { - if (!vfs_op_thread_enter(mp)) { + if (!vfs_op_thread_enter_crit(mp)) { if (prev_mp != NULL) - vfs_op_thread_exit(prev_mp); + vfs_op_thread_exit_crit(prev_mp); return (cache_fpl_partial(fpl)); } if (prev_mp != NULL) - vfs_op_thread_exit(prev_mp); + vfs_op_thread_exit_crit(prev_mp); if (!vn_seqc_consistent(vp, vp_seqc)) { - vfs_op_thread_exit(mp); + vfs_op_thread_exit_crit(mp); return (cache_fpl_partial(fpl)); } if (!cache_fplookup_mp_supported(mp)) { - vfs_op_thread_exit(mp); + vfs_op_thread_exit_crit(mp); return (cache_fpl_partial(fpl)); } vp = atomic_load_ptr(&mp->mnt_rootvnode); if (vp == NULL || VN_IS_DOOMED(vp)) { - vfs_op_thread_exit(mp); + vfs_op_thread_exit_crit(mp); return (cache_fpl_partial(fpl)); } vp_seqc = vn_seqc_read_any(vp); if (seqc_in_modify(vp_seqc)) { - vfs_op_thread_exit(mp); + vfs_op_thread_exit_crit(mp); return (cache_fpl_partial(fpl)); } prev_mp = mp; @@ -3515,7 +3515,7 @@ cache_fplookup_climb_mount(struct cache_fpl *fpl) break; } - vfs_op_thread_exit(prev_mp); + vfs_op_thread_exit_crit(prev_mp); fpl->tvp = vp; fpl->tvp_seqc = vp_seqc; return (0); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Tue Aug 4 19:52:52 2020 (r363855) +++ head/sys/sys/mount.h Tue Aug 4 19:54:10 2020 (r363856) @@ -1023,23 +1023,36 @@ int vfs_mount_fetch_counter(struct mount *, enum mount *zpcpu_get(mp->mnt_thread_in_ops_pcpu) == 1; \ }) -#define vfs_op_thread_enter(mp) ({ \ - bool _retval = true; \ - critical_enter(); \ +#define vfs_op_thread_enter_crit(mp) ({ \ + bool _retval_crit = true; \ + MPASS(curthread->td_critnest > 0); \ MPASS(!vfs_op_thread_entered(mp)); \ zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 1); \ __compiler_membar(); \ if (__predict_false(mp->mnt_vfs_ops > 0)) { \ - vfs_op_thread_exit(mp); \ - _retval = false; \ + vfs_op_thread_exit_crit(mp); \ + _retval_crit = false; \ } \ + _retval_crit; \ +}) + +#define vfs_op_thread_enter(mp) ({ \ + bool _retval; \ + critical_enter(); \ + _retval = vfs_op_thread_enter_crit(mp); \ + if (__predict_false(!_retval)) \ + critical_exit(); \ _retval; \ }) -#define vfs_op_thread_exit(mp) do { \ +#define vfs_op_thread_exit_crit(mp) do { \ MPASS(vfs_op_thread_entered(mp)); \ __compiler_membar(); \ zpcpu_set_protected(mp->mnt_thread_in_ops_pcpu, 0); \ +} while (0) + +#define vfs_op_thread_exit(mp) do { \ + vfs_op_thread_exit_crit(mp); \ critical_exit(); \ } while (0) From owner-svn-src-all@freebsd.org Tue Aug 4 19:54:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 965FF37DD1B; Tue, 4 Aug 2020 19:54:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlp63Tt6z3Y2Q; Tue, 4 Aug 2020 19:54:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A8C4AC86; Tue, 4 Aug 2020 19:54:38 +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 074JsccW009831; Tue, 4 Aug 2020 19:54:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JscfS009830; Tue, 4 Aug 2020 19:54:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041954.074JscfS009830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363857 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363857 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:54:38 -0000 Author: mjg Date: Tue Aug 4 19:54:37 2020 New Revision: 363857 URL: https://svnweb.freebsd.org/changeset/base/363857 Log: cache: factor away lockless dot lookup and add missing stat + sdt probe Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:54:10 2020 (r363856) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:54:37 2020 (r363857) @@ -3356,6 +3356,25 @@ cache_fplookup_final(struct cache_fpl *fpl) return (cache_fplookup_final_child(fpl, tvs)); } +static int __noinline +cache_fplookup_dot(struct cache_fpl *fpl) +{ + struct vnode *dvp; + + dvp = fpl->dvp; + + fpl->tvp = dvp; + fpl->tvp_seqc = vn_seqc_read_any(dvp); + if (seqc_in_modify(fpl->tvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + + counter_u64_add(dothits, 1); + SDT_PROBE3(vfs, namecache, lookup, hit, dvp, ".", dvp); + + return (0); +} + static int cache_fplookup_next(struct cache_fpl *fpl) { @@ -3371,12 +3390,7 @@ cache_fplookup_next(struct cache_fpl *fpl) dvp = fpl->dvp; if (__predict_false(cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.')) { - fpl->tvp = dvp; - fpl->tvp_seqc = vn_seqc_read_any(dvp); - if (seqc_in_modify(fpl->tvp_seqc)) { - return (cache_fpl_aborted(fpl)); - } - return (0); + return (cache_fplookup_dot(fpl)); } hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); From owner-svn-src-all@freebsd.org Tue Aug 4 19:55:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FBEF37D948; Tue, 4 Aug 2020 19:55:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlpY0rS6z3Y3B; Tue, 4 Aug 2020 19:55:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA75EAD02; Tue, 4 Aug 2020 19:55:00 +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 074Jt0Co009932; Tue, 4 Aug 2020 19:55:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Jt0tD009931; Tue, 4 Aug 2020 19:55:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041955.074Jt0tD009931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363858 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363858 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:55:01 -0000 Author: mjg Date: Tue Aug 4 19:55:00 2020 New Revision: 363858 URL: https://svnweb.freebsd.org/changeset/base/363858 Log: cache: assorted tidy ups Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:54:37 2020 (r363857) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:55:00 2020 (r363858) @@ -1513,7 +1513,7 @@ success: } vs = vget_prep_smr(*vpp); vfs_smr_exit(); - if (vs == VGET_NONE) { + if (__predict_false(vs == VGET_NONE)) { *vpp = NULL; goto retry; } @@ -3199,7 +3199,7 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) dvp_seqc = fpl->dvp_seqc; dvs = vget_prep_smr(dvp); - if (dvs == VGET_NONE) { + if (__predict_false(dvs == VGET_NONE)) { cache_fpl_smr_exit(fpl); return (cache_fpl_aborted(fpl)); } @@ -3220,6 +3220,7 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) } fpl->ndp->ni_startdir = dvp; + return (0); } @@ -3258,8 +3259,8 @@ cache_fplookup_final_child(struct cache_fpl *fpl, enum static int __noinline cache_fplookup_final_withparent(struct cache_fpl *fpl) { - enum vgetstate dvs, tvs; struct componentname *cnp; + enum vgetstate dvs, tvs; struct vnode *dvp, *tvp; seqc_t dvp_seqc, tvp_seqc; int error; @@ -3276,11 +3277,11 @@ cache_fplookup_final_withparent(struct cache_fpl *fpl) * This is less efficient than it can be for simplicity. */ dvs = vget_prep_smr(dvp); - if (dvs == VGET_NONE) { + if (__predict_false(dvs == VGET_NONE)) { return (cache_fpl_aborted(fpl)); } tvs = vget_prep_smr(tvp); - if (tvs == VGET_NONE) { + if (__predict_false(tvs == VGET_NONE)) { cache_fpl_smr_exit(fpl); vget_abort(dvp, dvs); return (cache_fpl_aborted(fpl)); @@ -3342,7 +3343,7 @@ cache_fplookup_final(struct cache_fpl *fpl) return (cache_fplookup_final_withparent(fpl)); tvs = vget_prep_smr(tvp); - if (tvs == VGET_NONE) { + if (__predict_false(tvs == VGET_NONE)) { return (cache_fpl_partial(fpl)); } @@ -3586,7 +3587,7 @@ cache_fplookup_parse(struct cache_fpl *fpl) for (cp = cnp->cn_nameptr; *cp != 0 && *cp != '/'; cp++) continue; cnp->cn_namelen = cp - cnp->cn_nameptr; - if (cnp->cn_namelen > NAME_MAX) { + if (__predict_false(cnp->cn_namelen > NAME_MAX)) { cache_fpl_smr_exit(fpl); return (cache_fpl_handled(fpl, ENAMETOOLONG)); } @@ -3779,6 +3780,7 @@ out: cache_fpl_smr_exit(fpl); return (CACHE_FPL_FAILED); case CACHE_FPL_STATUS_HANDLED: + MPASS(error != CACHE_FPL_FAILED); cache_fpl_smr_assert_not_entered(fpl); if (__predict_false(error != 0)) { ndp->ni_dvp = NULL; From owner-svn-src-all@freebsd.org Tue Aug 4 19:55:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 089A537DE32; Tue, 4 Aug 2020 19:55:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlq26XTzz3YMl; Tue, 4 Aug 2020 19:55:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4C42A7D5; Tue, 4 Aug 2020 19:55:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074JtQlD009999; Tue, 4 Aug 2020 19:55:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074JtQkk009998; Tue, 4 Aug 2020 19:55:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008041955.074JtQkk009998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 19:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363859 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363859 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 19:55:27 -0000 Author: mjg Date: Tue Aug 4 19:55:26 2020 New Revision: 363859 URL: https://svnweb.freebsd.org/changeset/base/363859 Log: cache: factor away failed vexec handling Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 19:55:00 2020 (r363858) +++ head/sys/kern/vfs_cache.c Tue Aug 4 19:55:26 2020 (r363859) @@ -3668,6 +3668,33 @@ cache_fplookup_parse_advance(struct cache_fpl *fpl) } } +static int __noinline +cache_fplookup_failed_vexec(struct cache_fpl *fpl, int error) +{ + + switch (error) { + case EAGAIN: + /* + * Can happen when racing against vgone. + * */ + case EOPNOTSUPP: + cache_fpl_partial(fpl); + break; + default: + /* + * See the API contract for VOP_FPLOOKUP_VEXEC. + */ + if (!vn_seqc_consistent(fpl->dvp, fpl->dvp_seqc)) { + error = cache_fpl_aborted(fpl); + } else { + cache_fpl_smr_exit(fpl); + cache_fpl_handled(fpl, error); + } + break; + } + return (error); +} + static int cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) { @@ -3715,23 +3742,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp error = VOP_FPLOOKUP_VEXEC(fpl->dvp, cnp->cn_cred, cnp->cn_thread); if (__predict_false(error != 0)) { - switch (error) { - case EAGAIN: - case EOPNOTSUPP: /* can happen when racing against vgone */ - cache_fpl_partial(fpl); - break; - default: - /* - * See the API contract for VOP_FPLOOKUP_VEXEC. - */ - if (!vn_seqc_consistent(fpl->dvp, fpl->dvp_seqc)) { - error = cache_fpl_aborted(fpl); - } else { - cache_fpl_smr_exit(fpl); - cache_fpl_handled(fpl, error); - } - break; - } + error = cache_fplookup_failed_vexec(fpl, error); break; } From owner-svn-src-all@freebsd.org Tue Aug 4 20:00:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB8BF37DCEB; Tue, 4 Aug 2020 20:00:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlwj53mgz3YTZ; Tue, 4 Aug 2020 20:00:21 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 911D9AA22; Tue, 4 Aug 2020 20:00:21 +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 074K0LRw010323; Tue, 4 Aug 2020 20:00:21 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074K0L43010322; Tue, 4 Aug 2020 20:00:21 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008042000.074K0L43010322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 20:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363860 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363860 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 20:00:21 -0000 Author: manu Date: Tue Aug 4 20:00:21 2020 New Revision: 363860 URL: https://svnweb.freebsd.org/changeset/base/363860 Log: mmccam: mmc_xpt: We're only interested about losing the device Remove all the uneeded printfs Reviewed by: imp, kibab Differential Revision: https://reviews.freebsd.org/D25948 Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 19:55:26 2020 (r363859) +++ head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 20:00:21 2020 (r363860) @@ -199,11 +199,6 @@ mmc_dev_async(u_int32_t async_code, struct cam_eb *bus struct cam_ed *device, void *async_arg) { - printf("mmc_dev_async(async_code=0x%x, path_id=%d, target_id=%x, lun_id=%" SCNx64 "\n", - async_code, - bus->path_id, - target->target_id, - device->lun_id); /* * We only need to handle events for real devices. */ @@ -211,24 +206,11 @@ mmc_dev_async(u_int32_t async_code, struct cam_eb *bus || device->lun_id == CAM_LUN_WILDCARD) return; - if (async_code == AC_LOST_DEVICE) { - if ((device->flags & CAM_DEV_UNCONFIGURED) == 0) { - printf("AC_LOST_DEVICE -> set to unconfigured\n"); - device->flags |= CAM_DEV_UNCONFIGURED; - xpt_release_device(device); - } else { - printf("AC_LOST_DEVICE on unconfigured device\n"); - } - } else if (async_code == AC_FOUND_DEVICE) { - printf("Got AC_FOUND_DEVICE -- whatever...\n"); - } else if (async_code == AC_PATH_REGISTERED) { - printf("Got AC_PATH_REGISTERED -- whatever...\n"); - } else if (async_code == AC_PATH_DEREGISTERED ) { - printf("Got AC_PATH_DEREGISTERED -- whatever...\n"); - } else if (async_code == AC_UNIT_ATTENTION) { - printf("Got interrupt generated by the card and ignored it\n"); - } else - panic("Unknown async code\n"); + if (async_code == AC_LOST_DEVICE && + (device->flags & CAM_DEV_UNCONFIGURED) == 0) { + device->flags |= CAM_DEV_UNCONFIGURED; + xpt_release_device(device); + } } /* Taken from nvme_scan_lun, thanks to bsdimp@ */ From owner-svn-src-all@freebsd.org Tue Aug 4 20:02:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2417E37E118; Tue, 4 Aug 2020 20:02:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLlz40DY2z3Z1R; Tue, 4 Aug 2020 20:02:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C892DAB3A; Tue, 4 Aug 2020 20:02:23 +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 074K2NUD016075; Tue, 4 Aug 2020 20:02:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074K2NOu016073; Tue, 4 Aug 2020 20:02:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008042002.074K2NOu016073@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 20:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363861 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 20:02:24 -0000 Author: manu Date: Tue Aug 4 20:02:23 2020 New Revision: 363861 URL: https://svnweb.freebsd.org/changeset/base/363861 Log: mmcam: Use a static length sbuf buffer We cannot sleep during cam proto_announce and sbuf sleeps so use a static length buffer like nvme(4) Reviewed by: kibab Differential Revision: https://reviews.freebsd.org/D25949 Modified: head/sys/cam/mmc/mmc_all.h head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_all.h ============================================================================== --- head/sys/cam/mmc/mmc_all.h Tue Aug 4 20:00:21 2020 (r363860) +++ head/sys/cam/mmc/mmc_all.h Tue Aug 4 20:02:23 2020 (r363861) @@ -68,7 +68,6 @@ #include #include -void mmc_print_ident(struct mmc_params *ident_data); struct ccb_pathinq; struct cam_sim; void mmc_path_inq(struct ccb_pathinq *cpi, const char *hba, Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 20:00:21 2020 (r363860) +++ head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 20:02:23 2020 (r363861) @@ -411,13 +411,11 @@ mmccam_start_discovery(struct cam_sim *sim) { } /* This func is called per attached device :-( */ -void -mmc_print_ident(struct mmc_params *ident_data) +static void +mmc_print_ident(struct mmc_params *ident_data, struct sbuf *sb) { - struct sbuf *sb; bool space = false; - sb = sbuf_new_auto(); sbuf_printf(sb, "Relative addr: %08x\n", ident_data->card_rca); sbuf_printf(sb, "Card features: <"); if (ident_data->card_features & CARD_FEATURE_MMC) { @@ -463,13 +461,20 @@ mmc_print_ident(struct mmc_params *ident_data) static void mmc_proto_announce(struct cam_ed *device) { - mmc_print_ident(&device->mmc_ident_data); + struct sbuf sb; + char buffer[256]; + + sbuf_new(&sb, buffer, sizeof(buffer), SBUF_FIXEDLEN); + mmc_print_ident(&device->mmc_ident_data, &sb); + sbuf_finish(&sb); + sbuf_putbuf(&sb); } static void mmc_proto_denounce(struct cam_ed *device) { - mmc_print_ident(&device->mmc_ident_data); + + mmc_proto_announce(device); } static void From owner-svn-src-all@freebsd.org Tue Aug 4 20:04:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF7D337DF5E; Tue, 4 Aug 2020 20:04:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLm0w5ZkXz3Z98; Tue, 4 Aug 2020 20:04:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2AD7AE1B; Tue, 4 Aug 2020 20:04:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074K40Om016194; Tue, 4 Aug 2020 20:04:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074K40ls016193; Tue, 4 Aug 2020 20:04:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008042004.074K40ls016193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 4 Aug 2020 20:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363862 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 20:04:00 -0000 Author: manu Date: Tue Aug 4 20:04:00 2020 New Revision: 363862 URL: https://svnweb.freebsd.org/changeset/base/363862 Log: mmccam: Hold the periph during init We need to sleep during this routine so acquire the cam hold too. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D25946 Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Aug 4 20:02:23 2020 (r363861) +++ head/sys/cam/mmc/mmc_da.c Tue Aug 4 20:04:00 2020 (r363862) @@ -1109,7 +1109,9 @@ sdda_start_init_task(void *context, int pending) { CAM_PRIORITY_NONE); cam_periph_lock(periph); + cam_periph_hold(periph, PRIBIO|PCATCH); sdda_start_init(context, new_ccb); + cam_periph_unhold(periph); cam_periph_unlock(periph); xpt_free_ccb(new_ccb); } From owner-svn-src-all@freebsd.org Tue Aug 4 20:31:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF84237E66C; Tue, 4 Aug 2020 20:31:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLmc75F7Hz3b12; Tue, 4 Aug 2020 20:31:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 98EDAB197; Tue, 4 Aug 2020 20:31:03 +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 074KV37b029582; Tue, 4 Aug 2020 20:31:03 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074KV3kW029581; Tue, 4 Aug 2020 20:31:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042031.074KV3kW029581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 20:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363863 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 20:31:03 -0000 Author: mjg Date: Tue Aug 4 20:31:03 2020 New Revision: 363863 URL: https://svnweb.freebsd.org/changeset/base/363863 Log: rms: fix typo: bitmamp -> bitmap Reported by: kib Modified: head/sys/kern/kern_rmlock.c Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Tue Aug 4 20:04:00 2020 (r363862) +++ head/sys/kern/kern_rmlock.c Tue Aug 4 20:31:03 2020 (r363863) @@ -875,7 +875,7 @@ db_show_rm(const struct lock_object *lock) * * No attempt is made to track which CPUs read locked at least once, * consequently write locking sends IPIs to all of them. This will become a - * problem at some point. The easiest way to lessen it is to provide a bitmamp. + * problem at some point. The easiest way to lessen it is to provide a bitmap. */ void From owner-svn-src-all@freebsd.org Tue Aug 4 20:51:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 066E637EDC4; Tue, 4 Aug 2020 20:51:07 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLn3G6Jmjz3cBG; Tue, 4 Aug 2020 20:51:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A373BB60D; Tue, 4 Aug 2020 20:51:06 +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 074Kp6kL041364; Tue, 4 Aug 2020 20:51:06 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Kp5Sw041359; Tue, 4 Aug 2020 20:51:05 GMT (envelope-from br@FreeBSD.org) Message-Id: <202008042051.074Kp5Sw041359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Aug 2020 20:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363864 - head/sys/x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/x86/iommu X-SVN-Commit-Revision: 363864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 20:51:07 -0000 Author: br Date: Tue Aug 4 20:51:05 2020 New Revision: 363864 URL: https://svnweb.freebsd.org/changeset/base/363864 Log: Add a few macroses for conversion between DMAR unit, domain, ctx and IOMMU unit, domain, ctx. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D25926 Modified: head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h head/sys/x86/iommu/intel_drv.c head/sys/x86/iommu/intel_idpgtbl.c head/sys/x86/iommu/intel_quirks.c Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_ctx.c Tue Aug 4 20:51:05 2020 (r363864) @@ -117,7 +117,7 @@ dmar_map_ctx_entry(struct dmar_ctx *ctx, struct sf_buf struct dmar_unit *dmar; dmar_ctx_entry_t *ctxp; - dmar = (struct dmar_unit *)ctx->context.domain->iommu; + dmar = CTX2DMAR(ctx); ctxp = dmar_map_pgtbl(dmar->ctx_obj, 1 + PCI_RID2BUS(ctx->rid), IOMMU_PGF_NOALLOC | IOMMU_PGF_WAITOK, sfp); @@ -131,7 +131,7 @@ device_tag_init(struct dmar_ctx *ctx, device_t dev) struct dmar_domain *domain; bus_addr_t maxaddr; - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); maxaddr = MIN(domain->iodom.end, BUS_SPACE_MAXADDR); ctx->context.tag->common.ref_count = 1; /* Prevent free */ ctx->context.tag->common.impl = &bus_dma_iommu_impl; @@ -141,7 +141,7 @@ device_tag_init(struct dmar_ctx *ctx, device_t dev) ctx->context.tag->common.maxsize = maxaddr; ctx->context.tag->common.nsegments = BUS_SPACE_UNRESTRICTED; ctx->context.tag->common.maxsegsz = maxaddr; - ctx->context.tag->ctx = (struct iommu_ctx *)ctx; + ctx->context.tag->ctx = CTX2IOCTX(ctx); ctx->context.tag->owner = dev; } @@ -178,8 +178,8 @@ ctx_id_entry_init(struct dmar_ctx *ctx, dmar_ctx_entry vm_page_t ctx_root; int i; - domain = (struct dmar_domain *)ctx->context.domain; - unit = (struct dmar_unit *)domain->iodom.iommu; + domain = CTX2DOM(ctx); + unit = DOM2DMAR(domain); KASSERT(move || (ctxp->ctx1 == 0 && ctxp->ctx2 == 0), ("dmar%d: initialized ctx entry %d:%d:%d 0x%jx 0x%jx", unit->iommu.unit, busno, pci_get_slot(ctx->context.tag->owner), @@ -196,7 +196,7 @@ ctx_id_entry_init(struct dmar_ctx *ctx, dmar_ctx_entry IOMMU_PGF_NOALLOC); } - if (iommu_is_buswide_ctx((struct iommu_unit *)unit, busno)) { + if (iommu_is_buswide_ctx(DMAR2IOMMU(unit), busno)) { MPASS(!move); for (i = 0; i <= PCI_BUSMAX; i++) { ctx_id_entry_init_one(&ctxp[i], domain, ctx_root); @@ -283,8 +283,7 @@ domain_init_rmrr(struct dmar_domain *domain, device_t ma[i] = vm_page_getfake(entry->start + PAGE_SIZE * i, VM_MEMATTR_DEFAULT); } - error1 = iommu_gas_map_region((struct iommu_domain *)domain, - entry, + error1 = iommu_gas_map_region(DOM2IODOM(domain), entry, IOMMU_MAP_ENTRY_READ | IOMMU_MAP_ENTRY_WRITE, IOMMU_MF_CANWAIT | IOMMU_MF_RMRR, ma); /* @@ -310,8 +309,7 @@ domain_init_rmrr(struct dmar_domain *domain, device_t error = error1; } TAILQ_REMOVE(&rmrr_entries, entry, unroll_link); - iommu_gas_free_entry((struct iommu_domain *)domain, - entry); + iommu_gas_free_entry(DOM2IODOM(domain), entry); } for (i = 0; i < size; i++) vm_page_putfake(ma[i]); @@ -331,7 +329,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp if (id == -1) return (NULL); domain = malloc(sizeof(*domain), M_DMAR_DOMAIN, M_WAITOK | M_ZERO); - iodom = (struct iommu_domain *)domain; + iodom = DOM2IODOM(domain); domain->domain = id; LIST_INIT(&domain->contexts); RB_INIT(&domain->iodom.rb_root); @@ -358,7 +356,7 @@ dmar_domain_alloc(struct dmar_unit *dmar, bool id_mapp /* Use all supported address space for remapping. */ domain->iodom.end = 1ULL << (domain->agaw - 1); - iommu_gas_init_domain((struct iommu_domain *)domain); + iommu_gas_init_domain(DOM2IODOM(domain)); if (id_mapped) { if ((dmar->hw_ecap & DMAR_ECAP_PT) == 0) { @@ -389,7 +387,7 @@ dmar_ctx_alloc(struct dmar_domain *domain, uint16_t ri struct dmar_ctx *ctx; ctx = malloc(sizeof(*ctx), M_DMAR_CTX, M_WAITOK | M_ZERO); - ctx->context.domain = (struct iommu_domain *)domain; + ctx->context.domain = DOM2IODOM(domain); ctx->context.tag = malloc(sizeof(struct bus_dma_tag_iommu), M_DMAR_CTX, M_WAITOK | M_ZERO); ctx->rid = rid; @@ -402,7 +400,7 @@ dmar_ctx_link(struct dmar_ctx *ctx) { struct dmar_domain *domain; - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); IOMMU_ASSERT_LOCKED(domain->iodom.iommu); KASSERT(domain->refs >= domain->ctx_cnt, ("dom %p ref underflow %d %d", domain, domain->refs, @@ -417,7 +415,7 @@ dmar_ctx_unlink(struct dmar_ctx *ctx) { struct dmar_domain *domain; - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); IOMMU_ASSERT_LOCKED(domain->iodom.iommu); KASSERT(domain->refs > 0, ("domain %p ctx dtr refs %d", domain, domain->refs)); @@ -444,7 +442,7 @@ dmar_domain_destroy(struct dmar_domain *domain) ("destroying dom %p with refs %d", domain, domain->refs)); if ((domain->iodom.flags & IOMMU_DOMAIN_GAS_INITED) != 0) { DMAR_DOMAIN_LOCK(domain); - iommu_gas_fini_domain((struct iommu_domain *)domain); + iommu_gas_fini_domain(DOM2IODOM(domain)); DMAR_DOMAIN_UNLOCK(domain); } if ((domain->iodom.flags & IOMMU_DOMAIN_PGTBL_INITED) != 0) { @@ -453,7 +451,7 @@ dmar_domain_destroy(struct dmar_domain *domain) domain_free_pgtbl(domain); } mtx_destroy(&domain->iodom.lock); - dmar = (struct dmar_unit *)domain->iodom.iommu; + dmar = DOM2DMAR(domain); free_unr(dmar->domids, domain->domain); free(domain, M_DMAR_DOMAIN); } @@ -482,7 +480,7 @@ dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t } enable = false; TD_PREP_PINNED_ASSERT; - unit = (struct iommu_unit *)dmar; + unit = DMAR2IOMMU(dmar); DMAR_LOCK(dmar); KASSERT(!iommu_is_buswide_ctx(unit, bus) || (slot == 0 && func == 0), ("iommu%d pci%d:%d:%d get_ctx for buswide", dmar->iommu.unit, bus, @@ -550,11 +548,11 @@ dmar_get_ctx_for_dev1(struct dmar_unit *dmar, device_t dmar_domain_destroy(domain1); /* Nothing needs to be done to destroy ctx1. */ free(ctx1, M_DMAR_CTX); - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); ctx->refs++; /* tag referenced us */ } } else { - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); if (ctx->context.tag->owner == NULL) ctx->context.tag->owner = dev; ctx->refs++; /* tag referenced us */ @@ -627,7 +625,7 @@ dmar_move_ctx_to_domain(struct dmar_domain *domain, st int error; dmar = domain->dmar; - old_domain = (struct dmar_domain *)ctx->context.domain; + old_domain = CTX2DOM(ctx); if (domain == old_domain) return (0); KASSERT(old_domain->iodom.iommu == domain->iodom.iommu, @@ -748,7 +746,7 @@ dmar_free_ctx_locked(struct dmar_unit *dmar, struct dm dmar_inv_iotlb_glob(dmar); } dmar_unmap_pgtbl(sf); - domain = (struct dmar_domain *)ctx->context.domain; + domain = CTX2DOM(ctx); dmar_ctx_unlink(ctx); free(ctx->context.tag, M_DMAR_CTX); free(ctx, M_DMAR_CTX); @@ -761,7 +759,7 @@ dmar_free_ctx(struct dmar_ctx *ctx) { struct dmar_unit *dmar; - dmar = (struct dmar_unit *)ctx->context.domain->iommu; + dmar = CTX2DMAR(ctx); DMAR_LOCK(dmar); dmar_free_ctx_locked(dmar, ctx); } @@ -810,11 +808,11 @@ dmar_domain_unload_entry(struct iommu_map_entry *entry struct dmar_domain *domain; struct dmar_unit *unit; - domain = (struct dmar_domain *)entry->domain; - unit = (struct dmar_unit *)domain->iodom.iommu; + domain = IODOM2DOM(entry->domain); + unit = DOM2DMAR(domain); if (unit->qi_enabled) { DMAR_LOCK(unit); - dmar_qi_invalidate_locked((struct dmar_domain *)entry->domain, + dmar_qi_invalidate_locked(IODOM2DOM(entry->domain), entry->start, entry->end - entry->start, &entry->gseq, true); if (!free) @@ -822,7 +820,7 @@ dmar_domain_unload_entry(struct iommu_map_entry *entry TAILQ_INSERT_TAIL(&unit->tlb_flush_entries, entry, dmamap_link); DMAR_UNLOCK(unit); } else { - domain_flush_iotlb_sync((struct dmar_domain *)entry->domain, + domain_flush_iotlb_sync(IODOM2DOM(entry->domain), entry->start, entry->end - entry->start); dmar_domain_free_entry(entry, free); } @@ -847,8 +845,8 @@ dmar_domain_unload(struct dmar_domain *domain, struct iommu_map_entry *entry, *entry1; int error; - iodom = (struct iommu_domain *)domain; - unit = (struct dmar_unit *)domain->iodom.iommu; + iodom = DOM2IODOM(domain); + unit = DOM2DMAR(domain); TAILQ_FOREACH_SAFE(entry, entries, dmamap_link, entry1) { KASSERT((entry->flags & IOMMU_MAP_ENTRY_MAP) != 0, @@ -904,11 +902,11 @@ iommu_get_ctx(struct iommu_unit *iommu, device_t dev, struct dmar_unit *dmar; struct dmar_ctx *ret; - dmar = (struct dmar_unit *)iommu; + dmar = IOMMU2DMAR(iommu); ret = dmar_get_ctx_for_dev(dmar, dev, rid, id_mapped, rmrr_init); - return ((struct iommu_ctx *)ret); + return (CTX2IOCTX(ret)); } void @@ -917,8 +915,8 @@ iommu_free_ctx_locked(struct iommu_unit *iommu, struct struct dmar_unit *dmar; struct dmar_ctx *ctx; - dmar = (struct dmar_unit *)iommu; - ctx = (struct dmar_ctx *)context; + dmar = IOMMU2DMAR(iommu); + ctx = IOCTX2CTX(context); dmar_free_ctx_locked(dmar, ctx); } @@ -926,11 +924,9 @@ iommu_free_ctx_locked(struct iommu_unit *iommu, struct void iommu_free_ctx(struct iommu_ctx *context) { - struct dmar_unit *dmar; struct dmar_ctx *ctx; - ctx = (struct dmar_ctx *)context; - dmar = (struct dmar_unit *)ctx->context.domain->iommu; + ctx = IOCTX2CTX(context); dmar_free_ctx(ctx); } @@ -948,7 +944,7 @@ iommu_domain_unload(struct iommu_domain *iodom, { struct dmar_domain *domain; - domain = (struct dmar_domain *)iodom; + domain = IODOM2DOM(iodom); dmar_domain_unload(domain, entries, cansleep); } Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_dmar.h Tue Aug 4 20:51:05 2020 (r363864) @@ -91,6 +91,22 @@ struct dmar_ctx { #define DMAR_DOMAIN_UNLOCK(dom) mtx_unlock(&(dom)->iodom.lock) #define DMAR_DOMAIN_ASSERT_LOCKED(dom) mtx_assert(&(dom)->iodom.lock, MA_OWNED) +#define DMAR2IOMMU(dmar) &((dmar)->iommu) +#define IOMMU2DMAR(dmar) \ + __containerof((dmar), struct dmar_unit, iommu) + +#define DOM2IODOM(domain) &((domain)->iodom) +#define IODOM2DOM(domain) \ + __containerof((domain), struct dmar_domain, iodom) + +#define CTX2IOCTX(ctx) &((ctx)->context) +#define IOCTX2CTX(ctx) \ + __containerof((ctx), struct dmar_ctx, context) + +#define CTX2DOM(ctx) IODOM2DOM((ctx)->context.domain) +#define CTX2DMAR(ctx) (CTX2DOM(ctx)->dmar) +#define DOM2DMAR(domain) ((domain)->dmar) + struct dmar_msi_data { int irq; int irq_rid; Modified: head/sys/x86/iommu/intel_drv.c ============================================================================== --- head/sys/x86/iommu/intel_drv.c Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_drv.c Tue Aug 4 20:51:05 2020 (r363864) @@ -919,8 +919,7 @@ dmar_rmrr_iter(ACPI_DMAR_HEADER *dmarh, void *arg) match = dmar_match_devscope(devscope, ria->dev_busno, ria->dev_path, ria->dev_path_len); if (match == 1) { - entry = iommu_gas_alloc_entry( - (struct iommu_domain *)ria->domain, + entry = iommu_gas_alloc_entry(DOM2IODOM(ria->domain), IOMMU_PGF_WAITOK); entry->start = resmem->BaseAddress; /* The RMRR entry end address is inclusive. */ @@ -1056,7 +1055,7 @@ dmar_instantiate_rmrr_ctxs(struct iommu_unit *unit) struct inst_rmrr_iter_args iria; int error; - dmar = (struct dmar_unit *)unit; + dmar = IOMMU2DMAR(unit); if (!dmar_barrier_enter(dmar, DMAR_BARRIER_RMRR)) return (0); @@ -1131,7 +1130,7 @@ dmar_print_domain(struct dmar_domain *domain, bool sho struct iommu_map_entry *entry; struct dmar_ctx *ctx; - iodom = (struct iommu_domain *)domain; + iodom = DOM2IODOM(domain); db_printf( " @%p dom %d mgaw %d agaw %d pglvl %d end %jx refs %d\n" Modified: head/sys/x86/iommu/intel_idpgtbl.c ============================================================================== --- head/sys/x86/iommu/intel_idpgtbl.c Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_idpgtbl.c Tue Aug 4 20:51:05 2020 (r363864) @@ -512,7 +512,7 @@ domain_map_buf(struct iommu_domain *iodom, iommu_gaddr ((eflags & IOMMU_MAP_ENTRY_SNOOP) != 0 ? DMAR_PTE_SNP : 0) | ((eflags & IOMMU_MAP_ENTRY_TM) != 0 ? DMAR_PTE_TM : 0); - domain = (struct dmar_domain *)iodom; + domain = IODOM2DOM(iodom); unit = domain->dmar; KASSERT((domain->iodom.flags & IOMMU_DOMAIN_IDMAP) == 0, @@ -691,7 +691,7 @@ domain_unmap_buf(struct iommu_domain *iodom, iommu_gad struct dmar_domain *domain; int error; - domain = (struct dmar_domain *)iodom; + domain = IODOM2DOM(iodom); DMAR_DOMAIN_PGLOCK(domain); error = domain_unmap_buf_locked(domain, base, size, flags); @@ -823,6 +823,6 @@ domain_pgtbl_init(struct dmar_domain *domain) { struct iommu_domain *iodom; - iodom = (struct iommu_domain *)domain; + iodom = DOM2IODOM(domain); iodom->ops = &dmar_domain_map_ops; } Modified: head/sys/x86/iommu/intel_quirks.c ============================================================================== --- head/sys/x86/iommu/intel_quirks.c Tue Aug 4 20:31:03 2020 (r363863) +++ head/sys/x86/iommu/intel_quirks.c Tue Aug 4 20:51:05 2020 (r363864) @@ -226,7 +226,7 @@ dmar_quirks_pre_use(struct iommu_unit *unit) { struct dmar_unit *dmar; - dmar = (struct dmar_unit *)unit; + dmar = IOMMU2DMAR(unit); if (!dmar_barrier_enter(dmar, DMAR_BARRIER_USEQ)) return; From owner-svn-src-all@freebsd.org Tue Aug 4 20:54:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C55637F21E; Tue, 4 Aug 2020 20:54:13 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLn6r62pMz3cJM; Tue, 4 Aug 2020 20:54:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2A64B371; Tue, 4 Aug 2020 20:54:12 +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 074KsC2I047094; Tue, 4 Aug 2020 20:54:12 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074KsCLL047093; Tue, 4 Aug 2020 20:54:12 GMT (envelope-from br@FreeBSD.org) Message-Id: <202008042054.074KsCLL047093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 4 Aug 2020 20:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363865 - head/sys/dev/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/dev/iommu X-SVN-Commit-Revision: 363865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 20:54:13 -0000 Author: br Date: Tue Aug 4 20:54:12 2020 New Revision: 363865 URL: https://svnweb.freebsd.org/changeset/base/363865 Log: Remove unneeded cast to struct iommu_domain *. Sponsored by: DARPA, AFRL Modified: head/sys/dev/iommu/iommu_gas.c Modified: head/sys/dev/iommu/iommu_gas.c ============================================================================== --- head/sys/dev/iommu/iommu_gas.c Tue Aug 4 20:51:05 2020 (r363864) +++ head/sys/dev/iommu/iommu_gas.c Tue Aug 4 20:54:12 2020 (r363865) @@ -111,7 +111,7 @@ void iommu_gas_free_entry(struct iommu_domain *domain, struct iommu_map_entry *entry) { - KASSERT(domain == (struct iommu_domain *)entry->domain, + KASSERT(domain == entry->domain, ("mismatched free domain %p entry %p entry->domain %p", domain, entry, entry->domain)); atomic_subtract_int(&domain->entries_cnt, 1); @@ -174,7 +174,7 @@ iommu_gas_check_free(struct iommu_domain *domain) iommu_gaddr_t v; RB_FOREACH(entry, iommu_gas_entries_tree, &domain->rb_root) { - KASSERT(domain == (struct iommu_domain *)entry->domain, + KASSERT(domain == entry->domain, ("mismatched free domain %p entry %p entry->domain %p", domain, entry, entry->domain)); l = RB_LEFT(entry, rb_entry); From owner-svn-src-all@freebsd.org Tue Aug 4 21:05:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B33A737F176; Tue, 4 Aug 2020 21:05:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLnNK4HTRz3d40; Tue, 4 Aug 2020 21:05:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 765EFB53F; Tue, 4 Aug 2020 21:05:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074L5rcb053401; Tue, 4 Aug 2020 21:05:53 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074L5rIh053400; Tue, 4 Aug 2020 21:05:53 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202008042105.074L5rIh053400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 4 Aug 2020 21:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363866 - head/lib/libdevinfo X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/lib/libdevinfo X-SVN-Commit-Revision: 363866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 21:05:53 -0000 Author: vangyzen Date: Tue Aug 4 21:05:53 2020 New Revision: 363866 URL: https://svnweb.freebsd.org/changeset/base/363866 Log: devinfo: fix memory leak on error paths Refactor to create devinfo_free_dev(). Call it to plug a memory leak on two error paths in devinfo_init_devices(). Reported by: Coverity MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libdevinfo/devinfo.c Modified: head/lib/libdevinfo/devinfo.c ============================================================================== --- head/lib/libdevinfo/devinfo.c Tue Aug 4 20:54:12 2020 (r363865) +++ head/lib/libdevinfo/devinfo.c Tue Aug 4 21:05:53 2020 (r363866) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); static int devinfo_init_devices(int generation); static int devinfo_init_resources(int generation); +static void devinfo_free_dev(struct devinfo_i_dev *dd); TAILQ_HEAD(,devinfo_i_dev) devinfo_dev; TAILQ_HEAD(,devinfo_i_rman) devinfo_rman; @@ -225,7 +226,7 @@ devinfo_init_devices(int generation) rlen, sizeof(udev)); return (EINVAL); } - if ((dd = malloc(sizeof(*dd))) == NULL) + if ((dd = calloc(1, sizeof(*dd))) == NULL) return(ENOMEM); dd->dd_dev.dd_handle = udev.dv_handle; dd->dd_dev.dd_parent = udev.dv_parent; @@ -242,10 +243,14 @@ devinfo_init_devices(int generation) dd->dd_location = NULL; #define UNPACK(x) \ dd->dd_dev.x = dd->x = strdup(walker); \ - if (dd->x == NULL) \ + if (dd->x == NULL) { \ + devinfo_free_dev(dd); \ return(ENOMEM); \ - if (walker + strnlen(walker, ep - walker) >= ep) \ + } \ + if (walker + strnlen(walker, ep - walker) >= ep) { \ + devinfo_free_dev(dd); \ return(EINVAL); \ + } \ walker += strlen(walker) + 1; UNPACK(dd_name); @@ -365,6 +370,20 @@ devinfo_init_resources(int generation) } /* + * Free an individual dev. + */ +static void +devinfo_free_dev(struct devinfo_i_dev *dd) +{ + free(dd->dd_name); + free(dd->dd_desc); + free(dd->dd_drivername); + free(dd->dd_pnpinfo); + free(dd->dd_location); + free(dd); +} + +/* * Free the list contents. */ void @@ -376,12 +395,7 @@ devinfo_free(void) while ((dd = TAILQ_FIRST(&devinfo_dev)) != NULL) { TAILQ_REMOVE(&devinfo_dev, dd, dd_link); - free(dd->dd_name); - free(dd->dd_desc); - free(dd->dd_drivername); - free(dd->dd_pnpinfo); - free(dd->dd_location); - free(dd); + devinfo_free_dev(dd); } while ((dm = TAILQ_FIRST(&devinfo_rman)) != NULL) { TAILQ_REMOVE(&devinfo_rman, dm, dm_link); From owner-svn-src-all@freebsd.org Tue Aug 4 21:09:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF5A437F569; Tue, 4 Aug 2020 21:09:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLnSc4Bbkz3dPm; Tue, 4 Aug 2020 21:09:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7350EB541; Tue, 4 Aug 2020 21:09:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074L9aLu053637; Tue, 4 Aug 2020 21:09:36 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074L9adU053636; Tue, 4 Aug 2020 21:09:36 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202008042109.074L9adU053636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 4 Aug 2020 21:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363867 - head/lib/libdevinfo X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/lib/libdevinfo X-SVN-Commit-Revision: 363867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 21:09:36 -0000 Author: vangyzen Date: Tue Aug 4 21:09:36 2020 New Revision: 363867 URL: https://svnweb.freebsd.org/changeset/base/363867 Log: devinfo: add man page links Add man page links for all functions in devinfo(3). Reported by: vim MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libdevinfo/Makefile Modified: head/lib/libdevinfo/Makefile ============================================================================== --- head/lib/libdevinfo/Makefile Tue Aug 4 21:05:53 2020 (r363866) +++ head/lib/libdevinfo/Makefile Tue Aug 4 21:09:36 2020 (r363867) @@ -5,6 +5,16 @@ SRCS= devinfo.c INCS= devinfo.h MAN= devinfo.3 +MLINKS+=devinfo.3 devinfo_init.3 +MLINKS+=devinfo.3 devinfo_free.3 +MLINKS+=devinfo.3 devinfo_handle_to_device.3 +MLINKS+=devinfo.3 devinfo_handle_to_resource.3 +MLINKS+=devinfo.3 devinfo_handle_to_rman.3 +MLINKS+=devinfo.3 devinfo_foreach_device_child.3 +MLINKS+=devinfo.3 devinfo_foreach_device_resource.3 +MLINKS+=devinfo.3 devinfo_foreach_rman_resource.3 +MLINKS+=devinfo.3 devinfo_foreach_rman.3 + SHLIB_MAJOR= 6 WARNS?= 3 From owner-svn-src-all@freebsd.org Tue Aug 4 21:34:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8E1F3A110D; Tue, 4 Aug 2020 21:34:13 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLp114WT7z3fYs; Tue, 4 Aug 2020 21:34:13 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E651BB43; Tue, 4 Aug 2020 21:34:13 +0000 (UTC) (envelope-from olivier@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074LYDDp071798; Tue, 4 Aug 2020 21:34:13 GMT (envelope-from olivier@FreeBSD.org) Received: (from olivier@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074LYDkj071797; Tue, 4 Aug 2020 21:34:13 GMT (envelope-from olivier@FreeBSD.org) Message-Id: <202008042134.074LYDkj071797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: olivier set sender to olivier@FreeBSD.org using -f From: Olivier Cochard Date: Tue, 4 Aug 2020 21:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363868 - head/sbin/route/tests X-SVN-Group: head X-SVN-Commit-Author: olivier X-SVN-Commit-Paths: head/sbin/route/tests X-SVN-Commit-Revision: 363868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 21:34:13 -0000 Author: olivier (ports committer) Date: Tue Aug 4 21:34:13 2020 New Revision: 363868 URL: https://svnweb.freebsd.org/changeset/base/363868 Log: Skip sbin/route tests if jail not installed (WITHOUT_JAIL). Approved by: kp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D25935 Modified: head/sbin/route/tests/basic.sh Modified: head/sbin/route/tests/basic.sh ============================================================================== --- head/sbin/route/tests/basic.sh Tue Aug 4 21:09:36 2020 (r363867) +++ head/sbin/route/tests/basic.sh Tue Aug 4 21:34:13 2020 (r363868) @@ -34,7 +34,7 @@ basic_v4_head() { atf_set descr 'add/change/delete route test for v4' atf_set require.user root - atf_set require.progs jq + atf_set require.progs jail jq } basic_v4_body() @@ -79,7 +79,7 @@ basic_v6_head() { atf_set descr 'add/change/delete route test for v6' atf_set require.user root - atf_set require.progs jq + atf_set require.progs jail jq } basic_v6_body() From owner-svn-src-all@freebsd.org Tue Aug 4 21:49:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74AC33A16AC; Tue, 4 Aug 2020 21:49:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLpLL2BzWz3gWD; Tue, 4 Aug 2020 21:49:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EC34BBCF; Tue, 4 Aug 2020 21:49:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074LnE4p078306; Tue, 4 Aug 2020 21:49:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074LnESw078305; Tue, 4 Aug 2020 21:49:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008042149.074LnESw078305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 4 Aug 2020 21:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363869 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 363869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 21:49:14 -0000 Author: kevans Date: Tue Aug 4 21:49:13 2020 New Revision: 363869 URL: https://svnweb.freebsd.org/changeset/base/363869 Log: makesyscalls.lua: improve syscall ordering validation There were two separate issues here: 1.) #if/#else wasn't taken into account at all for maxsyscall figures, but 2.) We didn't validate contiguous syscall numbers anyways... This kind of inconsistency is bad as we don't currently ensure explicit indexing of, e.g., the sysent array if one syscall is unimplemented/missing. This could be fixed and might be more robust, but it's also good to have the "documentation" that comes from being explicit as to what the missing syscalls are. The new version looks much like the awk version; stash off the current 'last highest syscall seen' if we hit an #if, restore to that if we hit an #else, and make sure that we're explicitly always defining the next syscall. The logic at the tail end of process_syscall_def that moves maxsyscall has been 'cleaned up' a little since we're now ensuring that it's monotonically increasing earlier in the function. At the moment I think it's unlikely we'd see range-definitions that are not UNIMPL, but there's no reason to specifically handle that case for bumping maxsyscall there. This change was provoked by reading the commit message for r363832 and realizing that this validation hadn't been included in the initial rewrite to lua. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D25945 Modified: head/sys/tools/makesyscalls.lua Modified: head/sys/tools/makesyscalls.lua ============================================================================== --- head/sys/tools/makesyscalls.lua Tue Aug 4 21:34:13 2020 (r363868) +++ head/sys/tools/makesyscalls.lua Tue Aug 4 21:49:13 2020 (r363869) @@ -35,7 +35,8 @@ local lfs = require("lfs") local unistd = require("posix.unistd") -local maxsyscall = 0 +local savesyscall = -1 +local maxsyscall = -1 local generated_tag = "@" .. "generated" -- Default configuration; any of these may get replaced by a configuration file @@ -442,6 +443,11 @@ local pattern_table = { dump_prevline = true, pattern = "^#", process = function(line) + if line:find("^#%s*if") then + savesyscall = maxsyscall + elseif line:find("^#%s*else") then + maxsyscall = savesyscall + end line = line .. "\n" write_line('sysent', line) write_line('sysdcl', line) @@ -916,6 +922,16 @@ process_syscall_def = function(line) sysnum = nil sysstart = tonumber(sysstart) sysend = tonumber(sysend) + if sysstart ~= maxsyscall + 1 then + abort(1, "syscall number out of sync, missing " .. + maxsyscall + 1) + end + else + sysnum = tonumber(sysnum) + if sysnum ~= maxsyscall + 1 then + abort(1, "syscall number out of sync, missing " .. + maxsyscall + 1) + end end -- Split flags @@ -1093,15 +1109,14 @@ process_syscall_def = function(line) handle_obsol(sysnum, funcname, funcomment) elseif flags & known_flags["UNIMPL"] ~= 0 then handle_unimpl(sysnum, sysstart, sysend, funcomment) - if sysend ~= nil and sysend > maxsyscall then - maxsyscall = sysend - end else abort(1, "Bad flags? " .. line) end - if sysnum ~= nil and tonumber(sysnum) > maxsyscall then - maxsyscall = tonumber(sysnum) + if sysend ~= nil then + maxsyscall = sysend + elseif sysnum ~= nil then + maxsyscall = sysnum end end From owner-svn-src-all@freebsd.org Tue Aug 4 21:58:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF01A3A1BBE; Tue, 4 Aug 2020 21:58:43 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLpYH4zRPz3gh0; Tue, 4 Aug 2020 21:58:43 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A924C04C; Tue, 4 Aug 2020 21:58:43 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074LwhZd084278; Tue, 4 Aug 2020 21:58:43 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074Lwhqm084277; Tue, 4 Aug 2020 21:58:43 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <202008042158.074Lwhqm084277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Tue, 4 Aug 2020 21:58:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363870 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 363870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 21:58:43 -0000 Author: kibab Date: Tue Aug 4 21:58:43 2020 New Revision: 363870 URL: https://svnweb.freebsd.org/changeset/base/363870 Log: Minor cleanups in mmc_xpt.c * Downgrade some CAM debug messages from _INFO to _DEBUG level; * Add KASSERT for the case when we suspect incorrect CAM SIM initialization (using cam_sim_alloc() instead of cam_sim_alloc_dev()); * Use waiting version of xpt_alloc_ccb(), we are not in hurry; * With the waiting version we cannot get NULL return, so remove the NULL check; * In some csses, the name of mmcprobe_done has been written as mmc_probedone(); * Send AC_LOST_DEVICE if we, well, lost the device; * Misc style(9) fixes. Reviewed by: manu Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D25843 Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 21:49:13 2020 (r363869) +++ head/sys/cam/mmc/mmc_xpt.c Tue Aug 4 21:58:43 2020 (r363870) @@ -374,8 +374,7 @@ mmc_announce_periph(struct cam_periph *periph) cam_periph_assert(periph, MA_OWNED); - CAM_DEBUG(periph->path, CAM_DEBUG_INFO, - ("mmc_announce_periph: called\n")); + CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("mmc_announce_periph")); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; @@ -388,15 +387,15 @@ mmc_announce_periph(struct cam_periph *periph) } void -mmccam_start_discovery(struct cam_sim *sim) { +mmccam_start_discovery(struct cam_sim *sim) +{ union ccb *ccb; uint32_t pathid; + KASSERT(sim->sim_dev != NULL, ("mmccam_start_discovery(%s): sim_dev is not initialized," + " has cam_sim_alloc_dev() been used?", cam_sim_name(sim))); pathid = cam_sim_path(sim); - ccb = xpt_alloc_ccb_nowait(); - if (ccb == NULL) { - return; - } + ccb = xpt_alloc_ccb(); /* * We create a rescan request for BUS:0:0, since the card @@ -806,7 +805,7 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do struct ccb_mmcio *mmcio; u_int32_t priority; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("mmcprobe_done\n")); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("mmcprobe_done\n")); softc = (mmcprobe_softc *)periph->softc; path = done_ccb->ccb_h.path; priority = done_ccb->ccb_h.pinfo.priority; @@ -827,6 +826,9 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do /* There was a device there, but now it's gone... */ if ((path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("Device lost!\n")); + xpt_async(AC_LOST_DEVICE, path, NULL); } PROBE_SET_ACTION(softc, PROBE_INVALID); @@ -896,7 +898,7 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do ("SDIO card: %d functions\n", mmcp->sdio_func_count)); if (io_ocr == 0) { CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("SDIO OCR invalid?!\n")); + ("SDIO OCR invalid, retrying\n")); break; /* Retry */ } @@ -1120,22 +1122,21 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do } default: CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("mmc_probedone: invalid action state 0x%x\n", softc->action)); + ("mmcprobe_done: invalid action state 0x%x\n", softc->action)); panic("default: case in mmc_probe_done()"); } - if (softc->action == PROBE_INVALID && - (path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, - ("mmc_probedone: Should send AC_LOST_DEVICE but won't for now\n")); - //xpt_async(AC_LOST_DEVICE, path, NULL); - } + if (softc->action == PROBE_INVALID && + (path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { + xpt_async(AC_LOST_DEVICE, path, NULL); + } - if (softc->action != PROBE_INVALID) - xpt_schedule(periph, priority); + if (softc->action != PROBE_INVALID) + xpt_schedule(periph, priority); /* Drop freeze taken due to CAM_DEV_QFREEZE flag set. */ int frozen = cam_release_devq(path, 0, 0, 0, FALSE); - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("mmc_probedone: remaining freezecnt %d\n", frozen)); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("mmcprobe_done: remaining freeze count %d\n", frozen)); if (softc->action == PROBE_DONE) { /* Notify the system that the device is found! */ @@ -1148,10 +1149,10 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do } } xpt_release_ccb(done_ccb); - if (softc->action == PROBE_DONE || softc->action == PROBE_INVALID) { - cam_periph_invalidate(periph); - cam_periph_release_locked(periph); - } + if (softc->action == PROBE_DONE || softc->action == PROBE_INVALID) { + cam_periph_invalidate(periph); + cam_periph_release_locked(periph); + } } void From owner-svn-src-all@freebsd.org Tue Aug 4 23:00:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A0093A29DD; Tue, 4 Aug 2020 23:00:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLqw06q9zz411c; Tue, 4 Aug 2020 23:00:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE82BCAFC; Tue, 4 Aug 2020 23:00:00 +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 074N00nd021198; Tue, 4 Aug 2020 23:00:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N00Do021197; Tue, 4 Aug 2020 23:00:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042300.074N00Do021197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363871 - 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: 363871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 23:00:01 -0000 Author: mjg Date: Tue Aug 4 23:00:00 2020 New Revision: 363871 URL: https://svnweb.freebsd.org/changeset/base/363871 Log: mtx: add mtx_wait_unlocked Modified: head/sys/kern/kern_mutex.c head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Tue Aug 4 21:58:43 2020 (r363870) +++ head/sys/kern/kern_mutex.c Tue Aug 4 23:00:00 2020 (r363871) @@ -1275,6 +1275,35 @@ mtx_spin_wait_unlocked(struct mtx *m) } } +void +mtx_wait_unlocked(struct mtx *m) +{ + struct thread *owner; + uintptr_t v; + + KASSERT(m->mtx_lock != MTX_DESTROYED, + ("%s() of destroyed mutex %p", __func__, m)); + KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_sleep, + ("%s() not a sleep mutex %p (%s)", __func__, m, + m->lock_object.lo_name)); + KASSERT(!mtx_owned(m), ("%s() waiting on myself on lock %p (%s)", __func__, m, + m->lock_object.lo_name)); + + for (;;) { + v = atomic_load_acq_ptr(&m->mtx_lock); + if (v == MTX_UNOWNED) { + break; + } + owner = lv_mtx_owner(v); + if (!TD_IS_RUNNING(owner)) { + mtx_lock(m); + mtx_unlock(m); + break; + } + cpu_spinwait(); + } +} + #ifdef DDB void db_show_mtx(const struct lock_object *lock) Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Tue Aug 4 21:58:43 2020 (r363870) +++ head/sys/sys/mutex.h Tue Aug 4 23:00:00 2020 (r363871) @@ -106,6 +106,7 @@ void __mtx_unlock_sleep(volatile uintptr_t *c, uintptr void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v); void __mtx_unlock_sleep(volatile uintptr_t *c, uintptr_t v); #endif +void mtx_wait_unlocked(struct mtx *m); #ifdef SMP #if LOCK_DEBUG > 0 From owner-svn-src-all@freebsd.org Tue Aug 4 23:04:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C90C73A2FAD; Tue, 4 Aug 2020 23:04:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLr1B4xhvz41D0; Tue, 4 Aug 2020 23:04:30 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DE9DCB50; Tue, 4 Aug 2020 23:04:30 +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 074N4Upm026726; Tue, 4 Aug 2020 23:04:30 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N4UN0026724; Tue, 4 Aug 2020 23:04:30 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042304.074N4UN0026724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:04:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363872 - 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: 363872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 23:04:30 -0000 Author: mjg Date: Tue Aug 4 23:04:29 2020 New Revision: 363872 URL: https://svnweb.freebsd.org/changeset/base/363872 Log: cache: add cache_purge_vgone cache_purge locklessly checks whether the vnode at hand has any namecache entries. This can race with a concurrent purge which managed to remove the last entry, but may not be done touching the vnode. Make sure we observe the relevant vnode lock as not taken before proceeding with vgone. Paired with the fact that doomed vnodes cannnot receive entries this restores the invariant that there are no namecache-related writing users past cache_purge in vgone. Reported by: pho Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 23:00:00 2020 (r363871) +++ head/sys/kern/vfs_cache.c Tue Aug 4 23:04:29 2020 (r363872) @@ -2138,22 +2138,17 @@ cache_changesize(u_long newmaxvnodes) /* * Invalidate all entries from and to a particular vnode. */ -void -cache_purge(struct vnode *vp) +static void +cache_purge_impl(struct vnode *vp) { TAILQ_HEAD(, namecache) ncps; struct namecache *ncp, *nnp; struct mtx *vlp, *vlp2; - CTR1(KTR_VFS, "cache_purge(%p)", vp); - SDT_PROBE1(vfs, namecache, purge, done, vp); - if (LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && - vp->v_cache_dd == NULL) - return; TAILQ_INIT(&ncps); vlp = VP2VNODELOCK(vp); vlp2 = NULL; - mtx_lock(vlp); + mtx_assert(vlp, MA_OWNED); retry: while (!LIST_EMPTY(&vp->v_cache_src)) { ncp = LIST_FIRST(&vp->v_cache_src); @@ -2182,6 +2177,53 @@ retry: TAILQ_FOREACH_SAFE(ncp, &ncps, nc_dst, nnp) { cache_free(ncp); } +} + +void +cache_purge(struct vnode *vp) +{ + struct mtx *vlp; + + SDT_PROBE1(vfs, namecache, purge, done, vp); + if (LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && + vp->v_cache_dd == NULL) + return; + vlp = VP2VNODELOCK(vp); + mtx_lock(vlp); + cache_purge_impl(vp); +} + +/* + * Only to be used by vgone. + */ +void +cache_purge_vgone(struct vnode *vp) +{ + struct mtx *vlp; + + VNPASS(VN_IS_DOOMED(vp), vp); + vlp = VP2VNODELOCK(vp); + if (!(LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && + vp->v_cache_dd == NULL)) { + mtx_lock(vlp); + cache_purge_impl(vp); + mtx_assert(vlp, MA_NOTOWNED); + return; + } + + /* + * All the NULL pointer state we found above may be transient. + * Serialize against a possible thread doing cache_purge. + */ + mtx_wait_unlocked(vlp); + if (!(LIST_EMPTY(&vp->v_cache_src) && TAILQ_EMPTY(&vp->v_cache_dst) && + vp->v_cache_dd == NULL)) { + mtx_lock(vlp); + cache_purge_impl(vp); + mtx_assert(vlp, MA_NOTOWNED); + return; + } + return; } /* Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Aug 4 23:00:00 2020 (r363871) +++ head/sys/kern/vfs_subr.c Tue Aug 4 23:04:29 2020 (r363872) @@ -4146,7 +4146,7 @@ vgonel(struct vnode *vp) * Delete from old mount point vnode list. */ delmntque(vp); - cache_purge(vp); + cache_purge_vgone(vp); /* * Done with purge, reset to the standard lock and invalidate * the vnode. Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Aug 4 23:00:00 2020 (r363871) +++ head/sys/sys/vnode.h Tue Aug 4 23:04:29 2020 (r363872) @@ -638,6 +638,7 @@ int cache_lookup(struct vnode *dvp, struct vnode **vpp struct componentname *cnp, struct timespec *tsp, int *ticksp); void cache_vnode_init(struct vnode *vp); void cache_purge(struct vnode *vp); +void cache_purge_vgone(struct vnode *vp); void cache_purge_negative(struct vnode *vp); void cache_purgevfs(struct mount *mp, bool force); int change_dir(struct vnode *vp, struct thread *td); From owner-svn-src-all@freebsd.org Tue Aug 4 23:07:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 490F83A2FBA; Tue, 4 Aug 2020 23:07:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLr451Fy0z41SB; Tue, 4 Aug 2020 23:07:01 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 084B1CF99; Tue, 4 Aug 2020 23:07:01 +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 074N70vG026905; Tue, 4 Aug 2020 23:07:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N70r0026904; Tue, 4 Aug 2020 23:07:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042307.074N70r0026904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363873 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 23:07:01 -0000 Author: mjg Date: Tue Aug 4 23:07:00 2020 New Revision: 363873 URL: https://svnweb.freebsd.org/changeset/base/363873 Log: cache: add NCF_WIP flag This allows making half-constructed entries visible to the lockless lookup, which now can check for either "not yet fully constructed" and "no longer valid" state. This will be used for .. lookup. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 23:04:29 2020 (r363872) +++ head/sys/kern/vfs_cache.c Tue Aug 4 23:07:00 2020 (r363873) @@ -162,6 +162,7 @@ struct namecache_ts { #define NCF_DVDROP 0x10 #define NCF_NEGATIVE 0x20 #define NCF_INVALID 0x40 +#define NCF_WIP 0x80 /* * Flags in negstate.neg_flag @@ -179,22 +180,22 @@ cache_ncp_invalidate(struct namecache *ncp) KASSERT((ncp->nc_flag & NCF_INVALID) == 0, ("%s: entry %p already invalid", __func__, ncp)); - ncp->nc_flag |= NCF_INVALID; + atomic_store_char(&ncp->nc_flag, ncp->nc_flag | NCF_INVALID); atomic_thread_fence_rel(); } /* - * Verify validity of an entry. + * Check whether the entry can be safely used. * * All places which elide locks are supposed to call this after they are * done with reading from an entry. */ static bool -cache_ncp_invalid(struct namecache *ncp) +cache_ncp_canuse(struct namecache *ncp) { atomic_thread_fence_acq(); - return ((ncp->nc_flag & NCF_INVALID) != 0); + return ((atomic_load_char(&ncp->nc_flag) & (NCF_INVALID | NCF_WIP)) == 0); } /* @@ -1506,7 +1507,7 @@ success: VOP_UNLOCK(dvp); } if (doing_smr) { - if (cache_ncp_invalid(ncp)) { + if (!cache_ncp_canuse(ncp)) { vfs_smr_exit(); *vpp = NULL; goto retry; @@ -1560,7 +1561,7 @@ negative_success: */ negstate = NCP2NEGSTATE(ncp); if ((negstate->neg_flag & NEG_HOT) == 0 || - cache_ncp_invalid(ncp)) { + !cache_ncp_canuse(ncp)) { vfs_smr_exit(); doing_smr = false; goto retry_hashed; @@ -1884,7 +1885,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * namecache entry as possible before acquiring the lock. */ ncp = cache_alloc(cnp->cn_namelen, tsp != NULL); - ncp->nc_flag = flag; + ncp->nc_flag = flag | NCF_WIP; ncp->nc_vp = vp; if (vp == NULL) cache_negative_init(ncp); @@ -1987,13 +1988,19 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ncp->nc_name); } - atomic_thread_fence_rel(); /* * Insert the new namecache entry into the appropriate chain * within the cache entries table. */ CK_LIST_INSERT_HEAD(ncpp, ncp, nc_hash); + atomic_thread_fence_rel(); + /* + * Mark the entry as fully constructed. + * It is immutable past this point until its removal. + */ + atomic_store_char(&ncp->nc_flag, ncp->nc_flag & ~NCF_WIP); + cache_enter_unlock(&cel); if (numneg * ncnegfactor > lnumcache) cache_negative_zap_one(); @@ -3197,7 +3204,7 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, goto out_abort; } - if (__predict_false(cache_ncp_invalid(ncp))) { + if (__predict_false(!cache_ncp_canuse(ncp))) { goto out_abort; } @@ -3458,7 +3465,7 @@ cache_fplookup_next(struct cache_fpl *fpl) if ((nc_flag & NCF_NEGATIVE) != 0) { negstate = NCP2NEGSTATE(ncp); neg_hot = ((negstate->neg_flag & NEG_HOT) != 0); - if (__predict_false(cache_ncp_invalid(ncp))) { + if (__predict_false(!cache_ncp_canuse(ncp))) { return (cache_fpl_partial(fpl)); } if (__predict_false((nc_flag & NCF_WHITE) != 0)) { @@ -3474,7 +3481,7 @@ cache_fplookup_next(struct cache_fpl *fpl) return (cache_fpl_handled(fpl, ENOENT)); } - if (__predict_false(cache_ncp_invalid(ncp))) { + if (__predict_false(!cache_ncp_canuse(ncp))) { return (cache_fpl_partial(fpl)); } From owner-svn-src-all@freebsd.org Tue Aug 4 23:07:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FE8B3A3103; Tue, 4 Aug 2020 23:07:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLr4v3l69z41Sx; Tue, 4 Aug 2020 23:07:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 636B4CDA5; Tue, 4 Aug 2020 23:07:43 +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 074N7h3Z026988; Tue, 4 Aug 2020 23:07:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N7gdI026985; Tue, 4 Aug 2020 23:07:42 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042307.074N7gdI026985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:07:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363874 - 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: 363874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 23:07:43 -0000 Author: mjg Date: Tue Aug 4 23:07:42 2020 New Revision: 363874 URL: https://svnweb.freebsd.org/changeset/base/363874 Log: vfs: support lockless dotdot lookup Tested by: pho Modified: head/sys/kern/vfs_cache.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Aug 4 23:07:00 2020 (r363873) +++ head/sys/kern/vfs_cache.c Tue Aug 4 23:07:42 2020 (r363874) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -957,16 +958,22 @@ cache_zap_locked(struct namecache *ncp) SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, ncp->nc_name, ncp->nc_vp); TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst); - if (ncp == ncp->nc_vp->v_cache_dd) + if (ncp == ncp->nc_vp->v_cache_dd) { + vn_seqc_write_begin_unheld(ncp->nc_vp); ncp->nc_vp->v_cache_dd = NULL; + vn_seqc_write_end(ncp->nc_vp); + } } else { SDT_PROBE2(vfs, namecache, zap_negative, done, ncp->nc_dvp, ncp->nc_name); cache_negative_remove(ncp); } if (ncp->nc_flag & NCF_ISDOTDOT) { - if (ncp == ncp->nc_dvp->v_cache_dd) + if (ncp == ncp->nc_dvp->v_cache_dd) { + vn_seqc_write_begin_unheld(ncp->nc_dvp); ncp->nc_dvp->v_cache_dd = NULL; + vn_seqc_write_end(ncp->nc_dvp); + } } else { LIST_REMOVE(ncp, nc_src); if (LIST_EMPTY(&ncp->nc_dvp->v_cache_src)) { @@ -1306,7 +1313,9 @@ retry_dotdot: mtx_unlock(dvlp2); cache_free(ncp); } else { + vn_seqc_write_begin(dvp); dvp->v_cache_dd = NULL; + vn_seqc_write_end(dvp); mtx_unlock(dvlp); if (dvlp2 != NULL) mtx_unlock(dvlp2); @@ -1817,6 +1826,7 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnod cache_celockstate_init(&cel); hash = cache_get_hash(cnp->cn_nameptr, len, dvp); cache_enter_lock_dd(&cel, dvp, vp, hash); + vn_seqc_write_begin(dvp); ncp = dvp->v_cache_dd; if (ncp != NULL && (ncp->nc_flag & NCF_ISDOTDOT)) { KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent")); @@ -1825,6 +1835,7 @@ cache_enter_dotdot_prep(struct vnode *dvp, struct vnod ncp = NULL; } dvp->v_cache_dd = NULL; + vn_seqc_write_end(dvp); cache_enter_unlock(&cel); cache_free(ncp); } @@ -1939,7 +1950,9 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, goto out_unlock_free; KASSERT(vp == NULL || vp->v_type == VDIR, ("wrong vnode type %p", vp)); + vn_seqc_write_begin(dvp); dvp->v_cache_dd = ncp; + vn_seqc_write_end(dvp); } if (vp != NULL) { @@ -1950,6 +1963,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * directory name in it and the name ".." for the * directory's parent. */ + vn_seqc_write_begin(vp); if ((ndd = vp->v_cache_dd) != NULL) { if ((ndd->nc_flag & NCF_ISDOTDOT) != 0) cache_zap_locked(ndd); @@ -1957,9 +1971,14 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, ndd = NULL; } vp->v_cache_dd = ncp; + vn_seqc_write_end(vp); } } else { - vp->v_cache_dd = NULL; + if (vp->v_cache_dd != NULL) { + vn_seqc_write_begin(vp); + vp->v_cache_dd = NULL; + vn_seqc_write_end(vp); + } } } @@ -3425,6 +3444,75 @@ cache_fplookup_dot(struct cache_fpl *fpl) return (0); } +static int __noinline +cache_fplookup_dotdot(struct cache_fpl *fpl) +{ + struct nameidata *ndp; + struct componentname *cnp; + struct namecache *ncp; + struct vnode *dvp; + struct prison *pr; + u_char nc_flag; + + ndp = fpl->ndp; + cnp = fpl->cnp; + dvp = fpl->dvp; + + /* + * XXX this is racy the same way regular lookup is + */ + for (pr = cnp->cn_cred->cr_prison; pr != NULL; + pr = pr->pr_parent) + if (dvp == pr->pr_root) + break; + + if (dvp == ndp->ni_rootdir || + dvp == ndp->ni_topdir || + dvp == rootvnode || + pr != NULL) { + fpl->tvp = dvp; + fpl->tvp_seqc = vn_seqc_read_any(dvp); + if (seqc_in_modify(fpl->tvp_seqc)) { + return (cache_fpl_aborted(fpl)); + } + return (0); + } + + if ((dvp->v_vflag & VV_ROOT) != 0) { + /* + * TODO + * The opposite of climb mount is needed here. + */ + return (cache_fpl_aborted(fpl)); + } + + ncp = atomic_load_ptr(&dvp->v_cache_dd); + if (ncp == NULL) { + return (cache_fpl_aborted(fpl)); + } + + nc_flag = atomic_load_char(&ncp->nc_flag); + if ((nc_flag & NCF_ISDOTDOT) != 0) { + if ((nc_flag & NCF_NEGATIVE) != 0) + return (cache_fpl_aborted(fpl)); + fpl->tvp = ncp->nc_vp; + } else { + fpl->tvp = ncp->nc_dvp; + } + + if (__predict_false(!cache_ncp_canuse(ncp))) { + return (cache_fpl_aborted(fpl)); + } + + fpl->tvp_seqc = vn_seqc_read_any(fpl->tvp); + if (seqc_in_modify(fpl->tvp_seqc)) { + return (cache_fpl_partial(fpl)); + } + + counter_u64_add(dotdothits, 1); + return (0); +} + static int cache_fplookup_next(struct cache_fpl *fpl) { @@ -3782,11 +3870,6 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp break; } - if (cnp->cn_flags & ISDOTDOT) { - error = cache_fpl_partial(fpl); - break; - } - VNPASS(cache_fplookup_vnode_supported(fpl->dvp), fpl->dvp); error = VOP_FPLOOKUP_VEXEC(fpl->dvp, cnp->cn_cred, cnp->cn_thread); @@ -3795,17 +3878,24 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp break; } - error = cache_fplookup_next(fpl); - if (__predict_false(error != 0)) { - break; - } - - VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); - - if (cache_fplookup_need_climb_mount(fpl)) { - error = cache_fplookup_climb_mount(fpl); + if (__predict_false(cnp->cn_flags & ISDOTDOT)) { + error = cache_fplookup_dotdot(fpl); if (__predict_false(error != 0)) { break; + } + } else { + error = cache_fplookup_next(fpl); + if (__predict_false(error != 0)) { + break; + } + + VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); + + if (cache_fplookup_need_climb_mount(fpl)) { + error = cache_fplookup_climb_mount(fpl); + if (__predict_false(error != 0)) { + break; + } } } Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Aug 4 23:07:00 2020 (r363873) +++ head/sys/kern/vfs_subr.c Tue Aug 4 23:07:42 2020 (r363874) @@ -6881,12 +6881,15 @@ vn_dir_check_exec(struct vnode *vp, struct componentna return (VOP_ACCESS(vp, VEXEC, cnp->cn_cred, cnp->cn_thread)); } +/* + * Do not use this variant unless you have means other than the hold count + * to prevent the vnode from getting freed. + */ void -vn_seqc_write_begin_locked(struct vnode *vp) +vn_seqc_write_begin_unheld_locked(struct vnode *vp) { ASSERT_VI_LOCKED(vp, __func__); - VNPASS(vp->v_holdcnt > 0, vp); VNPASS(vp->v_seqc_users >= 0, vp); vp->v_seqc_users++; if (vp->v_seqc_users == 1) @@ -6894,11 +6897,29 @@ vn_seqc_write_begin_locked(struct vnode *vp) } void +vn_seqc_write_begin_locked(struct vnode *vp) +{ + + ASSERT_VI_LOCKED(vp, __func__); + VNPASS(vp->v_holdcnt > 0, vp); + vn_seqc_write_begin_unheld_locked(vp); +} + +void vn_seqc_write_begin(struct vnode *vp) { VI_LOCK(vp); vn_seqc_write_begin_locked(vp); + VI_UNLOCK(vp); +} + +void +vn_seqc_write_begin_unheld(struct vnode *vp) +{ + + VI_LOCK(vp); + vn_seqc_write_begin_unheld_locked(vp); VI_UNLOCK(vp); } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Tue Aug 4 23:07:00 2020 (r363873) +++ head/sys/sys/vnode.h Tue Aug 4 23:07:42 2020 (r363874) @@ -764,6 +764,8 @@ int vn_io_fault_uiomove(char *data, int xfersize, stru int vn_io_fault_pgmove(vm_page_t ma[], vm_offset_t offset, int xfersize, struct uio *uio); +void vn_seqc_write_begin_unheld_locked(struct vnode *vp); +void vn_seqc_write_begin_unheld(struct vnode *vp); void vn_seqc_write_begin_locked(struct vnode *vp); void vn_seqc_write_begin(struct vnode *vp); void vn_seqc_write_end_locked(struct vnode *vp); From owner-svn-src-all@freebsd.org Tue Aug 4 23:09:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A6CB3A2CFD; Tue, 4 Aug 2020 23:09:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLr6h29myz41g4; Tue, 4 Aug 2020 23:09:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E105CDA6; Tue, 4 Aug 2020 23:09:16 +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 074N9Gcx027103; Tue, 4 Aug 2020 23:09:16 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074N9Gao027102; Tue, 4 Aug 2020 23:09:16 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008042309.074N9Gao027102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 4 Aug 2020 23:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363875 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 363875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 23:09:16 -0000 Author: mjg Date: Tue Aug 4 23:09:15 2020 New Revision: 363875 URL: https://svnweb.freebsd.org/changeset/base/363875 Log: ufs: only pass LK_ADAPTIVE if LK_NODDLKTREAT is set This restores the pre-adaptive spinning state for SU which livelocks otherwise. Note this is a bug in SU. Reported by: pho Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Tue Aug 4 23:07:42 2020 (r363874) +++ head/sys/ufs/ffs/ffs_vnops.c Tue Aug 4 23:09:15 2020 (r363875) @@ -445,7 +445,13 @@ ffs_lock(ap) struct lock *lkp; int result; - ap->a_flags |= LK_ADAPTIVE; + /* + * Adaptive spinning mixed with SU leads to trouble. use a giant hammer + * and only use it when LK_NODDLKTREAT is set. Currently this means it + * is only used during path lookup. + */ + if ((ap->a_flags & LK_NODDLKTREAT) != 0) + ap->a_flags |= LK_ADAPTIVE; switch (ap->a_flags & LK_TYPE_MASK) { case LK_SHARED: case LK_UPGRADE: @@ -483,7 +489,11 @@ ffs_lock(ap) } return (result); #else - ap->a_flags |= LK_ADAPTIVE; + /* + * See above for an explanation. + */ + if ((ap->a_flags & LK_NODDLKTREAT) != 0) + ap->a_flags |= LK_ADAPTIVE; return (VOP_LOCK1_APV(&ufs_vnodeops, ap)); #endif } From owner-svn-src-all@freebsd.org Tue Aug 4 23:30:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B34673A2EA9; Tue, 4 Aug 2020 23:30:11 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLrZq4WJ5z42X3; Tue, 4 Aug 2020 23:30:11 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61C58CDD1; Tue, 4 Aug 2020 23:30:11 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 074NUBPK039710; Tue, 4 Aug 2020 23:30:11 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 074NUAvl039703; Tue, 4 Aug 2020 23:30:10 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202008042330.074NUAvl039703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 4 Aug 2020 23:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363876 - in stable/12/sys: conf dev/ixl modules/ixl X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in stable/12/sys: conf dev/ixl modules/ixl X-SVN-Commit-Revision: 363876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Aug 2020 23:30:11 -0000 Author: erj Date: Tue Aug 4 23:30:10 2020 New Revision: 363876 URL: https://svnweb.freebsd.org/changeset/base/363876 Log: MFC r361992: ixl(4): Add FW recovery mode support and other things Update the iflib version of ixl driver based on the OOT version ixl-1.11.29. Major changes: - Extract iflib specific functions from ixl_pf_main.c to ixl_pf_iflib.c to simplify code sharing between legacy and iflib version of driver - Add support for most recent FW API version (1.10), which extends FW LLDP Agent control by user to X722 devices - Improve handling of device global reset - Add support for the FW recovery mode - Use virtchnl function to validate virtual channel messages instead of using separate checks - Fix MAC/VLAN filters accounting Relnotes: yes Sponsored by: Intel Corporation Added: stable/12/sys/dev/ixl/ixl_pf_iflib.c - copied unchanged from r361992, head/sys/dev/ixl/ixl_pf_iflib.c Modified: stable/12/sys/conf/files.amd64 stable/12/sys/conf/files.powerpc stable/12/sys/dev/ixl/i40e_adminq.c stable/12/sys/dev/ixl/i40e_adminq_cmd.h stable/12/sys/dev/ixl/i40e_common.c stable/12/sys/dev/ixl/i40e_dcb.c stable/12/sys/dev/ixl/i40e_dcb.h stable/12/sys/dev/ixl/i40e_devids.h stable/12/sys/dev/ixl/i40e_lan_hmc.c stable/12/sys/dev/ixl/i40e_nvm.c stable/12/sys/dev/ixl/i40e_osdep.c stable/12/sys/dev/ixl/i40e_prototype.h stable/12/sys/dev/ixl/i40e_register.h stable/12/sys/dev/ixl/i40e_type.h stable/12/sys/dev/ixl/if_iavf.c stable/12/sys/dev/ixl/if_ixl.c stable/12/sys/dev/ixl/ixl.h stable/12/sys/dev/ixl/ixl_pf.h stable/12/sys/dev/ixl/ixl_pf_i2c.c stable/12/sys/dev/ixl/ixl_pf_iov.c stable/12/sys/dev/ixl/ixl_pf_main.c stable/12/sys/dev/ixl/ixl_txrx.c stable/12/sys/modules/ixl/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Tue Aug 4 23:09:15 2020 (r363875) +++ stable/12/sys/conf/files.amd64 Tue Aug 4 23:30:10 2020 (r363876) @@ -272,6 +272,8 @@ dev/ixl/if_ixl.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_main.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/ixl_pf_iflib.c optional ixl pci \ + compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_qmgr.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_iov.c optional ixl pci pci_iov \ Modified: stable/12/sys/conf/files.powerpc ============================================================================== --- stable/12/sys/conf/files.powerpc Tue Aug 4 23:09:15 2020 (r363875) +++ stable/12/sys/conf/files.powerpc Tue Aug 4 23:30:10 2020 (r363876) @@ -47,6 +47,8 @@ dev/ixl/if_ixl.c optional ixl pci powerpc64 \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_main.c optional ixl pci powerpc64 \ compile-with "${NORMAL_C} -I$S/dev/ixl" +dev/ixl/ixl_pf_iflib.c optional ixl pci powerpc64 \ + compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_qmgr.c optional ixl pci powerpc64 \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_iov.c optional ixl pci pci_iov powerpc64 \ Modified: stable/12/sys/dev/ixl/i40e_adminq.c ============================================================================== --- stable/12/sys/dev/ixl/i40e_adminq.c Tue Aug 4 23:09:15 2020 (r363875) +++ stable/12/sys/dev/ixl/i40e_adminq.c Tue Aug 4 23:30:10 2020 (r363876) @@ -125,6 +125,7 @@ enum i40e_status_code i40e_alloc_adminq_arq_ring(struc **/ void i40e_free_adminq_asq(struct i40e_hw *hw) { + i40e_free_virt_mem(hw, &hw->aq.asq.cmd_buf); i40e_free_dma_mem(hw, &hw->aq.asq.desc_buf); } @@ -404,7 +405,7 @@ enum i40e_status_code i40e_init_asq(struct i40e_hw *hw /* initialize base registers */ ret_code = i40e_config_asq_regs(hw); if (ret_code != I40E_SUCCESS) - goto init_adminq_free_rings; + goto init_config_regs; /* success! */ hw->aq.asq.count = hw->aq.num_asq_entries; @@ -412,7 +413,11 @@ enum i40e_status_code i40e_init_asq(struct i40e_hw *hw init_adminq_free_rings: i40e_free_adminq_asq(hw); + return ret_code; +init_config_regs: + i40e_free_asq_bufs(hw); + init_adminq_exit: return ret_code; } @@ -563,6 +568,70 @@ static void i40e_resume_aq(struct i40e_hw *hw) } /** + * i40e_set_hw_flags - set HW flags + * @hw: pointer to the hardware structure + **/ +static void i40e_set_hw_flags(struct i40e_hw *hw) +{ + struct i40e_adminq_info *aq = &hw->aq; + + hw->flags = 0; + + switch (hw->mac.type) { + case I40E_MAC_XL710: + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710)) { + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; + /* The ability to RX (not drop) 802.1ad frames */ + hw->flags |= I40E_HW_FLAG_802_1AD_CAPABLE; + } + break; + case I40E_MAC_X722: + hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE | + I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; + + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722)) + hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE; + + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722)) + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; + + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= I40E_MINOR_VER_FW_REQUEST_FEC_X722)) + hw->flags |= I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE; + + /* fall through */ + default: + break; + } + + /* Newer versions of firmware require lock when reading the NVM */ + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= 5)) + hw->flags |= I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; + + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= 8)) { + hw->flags |= I40E_HW_FLAG_FW_LLDP_PERSISTENT; + hw->flags |= I40E_HW_FLAG_DROP_MODE; + } + + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= 9)) + hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_EXTENDED; +} + +/** * i40e_init_adminq - main initialization routine for Admin Queue * @hw: pointer to the hardware structure * @@ -575,21 +644,22 @@ static void i40e_resume_aq(struct i40e_hw *hw) **/ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) { + struct i40e_adminq_info *aq = &hw->aq; + enum i40e_status_code ret_code; u16 cfg_ptr, oem_hi, oem_lo; u16 eetrack_lo, eetrack_hi; - enum i40e_status_code ret_code; int retry = 0; /* verify input for valid configuration */ - if ((hw->aq.num_arq_entries == 0) || - (hw->aq.num_asq_entries == 0) || - (hw->aq.arq_buf_size == 0) || - (hw->aq.asq_buf_size == 0)) { + if (aq->num_arq_entries == 0 || + aq->num_asq_entries == 0 || + aq->arq_buf_size == 0 || + aq->asq_buf_size == 0) { ret_code = I40E_ERR_CONFIG; goto init_adminq_exit; } - i40e_init_spinlock(&hw->aq.asq_spinlock); - i40e_init_spinlock(&hw->aq.arq_spinlock); + i40e_init_spinlock(&aq->asq_spinlock); + i40e_init_spinlock(&aq->arq_spinlock); /* Set up register offsets */ i40e_adminq_init_regs(hw); @@ -616,11 +686,11 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw */ do { ret_code = i40e_aq_get_firmware_version(hw, - &hw->aq.fw_maj_ver, - &hw->aq.fw_min_ver, - &hw->aq.fw_build, - &hw->aq.api_maj_ver, - &hw->aq.api_min_ver, + &aq->fw_maj_ver, + &aq->fw_min_ver, + &aq->fw_build, + &aq->api_maj_ver, + &aq->api_min_ver, NULL); if (ret_code != I40E_ERR_ADMIN_QUEUE_TIMEOUT) break; @@ -631,6 +701,12 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw if (ret_code != I40E_SUCCESS) goto init_adminq_free_arq; + /* + * Some features were introduced in different FW API version + * for different MAC type. + */ + i40e_set_hw_flags(hw); + /* get the NVM version info */ i40e_read_nvm_word(hw, I40E_SR_NVM_DEV_STARTER_VERSION, &hw->nvm.version); @@ -644,25 +720,7 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw &oem_lo); hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo; - /* The ability to RX (not drop) 802.1ad frames was added in API 1.7 */ - if ((hw->aq.api_maj_ver > 1) || - ((hw->aq.api_maj_ver == 1) && - (hw->aq.api_min_ver >= 7))) - hw->flags |= I40E_HW_FLAG_802_1AD_CAPABLE; - - if (hw->mac.type == I40E_MAC_XL710 && - hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && - hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) { - hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; - } - - /* Newer versions of firmware require lock when reading the NVM */ - if ((hw->aq.api_maj_ver > 1) || - ((hw->aq.api_maj_ver == 1) && - (hw->aq.api_min_ver >= 5))) - hw->flags |= I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; - - if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) { + if (aq->api_maj_ver > I40E_FW_API_VERSION_MAJOR) { ret_code = I40E_ERR_FIRMWARE_API_VERSION; goto init_adminq_free_arq; } @@ -682,8 +740,8 @@ init_adminq_free_arq: init_adminq_free_asq: i40e_shutdown_asq(hw); init_adminq_destroy_spinlocks: - i40e_destroy_spinlock(&hw->aq.asq_spinlock); - i40e_destroy_spinlock(&hw->aq.arq_spinlock); + i40e_destroy_spinlock(&aq->asq_spinlock); + i40e_destroy_spinlock(&aq->arq_spinlock); init_adminq_exit: return ret_code; @@ -728,7 +786,7 @@ u16 i40e_clean_asq(struct i40e_hw *hw) desc = I40E_ADMINQ_DESC(*asq, ntc); details = I40E_ADMINQ_DETAILS(*asq, ntc); while (rd32(hw, hw->aq.asq.head) != ntc) { - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); if (details->callback) { @@ -808,7 +866,7 @@ enum i40e_status_code i40e_asq_send_command(struct i40 if (val >= hw->aq.num_asq_entries) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: head overrun at %d\n", val); - status = I40E_ERR_QUEUE_EMPTY; + status = I40E_ERR_ADMIN_QUEUE_FULL; goto asq_send_command_error; } @@ -896,7 +954,7 @@ enum i40e_status_code i40e_asq_send_command(struct i40 } /* bump the tail */ - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: desc and buffer:\n"); + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQTX: desc and buffer:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc_on_ring, buff, buff_size); (hw->aq.asq.next_to_use)++; @@ -942,12 +1000,14 @@ enum i40e_status_code i40e_asq_send_command(struct i40 cmd_completed = TRUE; if ((enum i40e_admin_queue_err)retval == I40E_AQ_RC_OK) status = I40E_SUCCESS; + else if ((enum i40e_admin_queue_err)retval == I40E_AQ_RC_EBUSY) + status = I40E_ERR_NOT_READY; else status = I40E_ERR_ADMIN_QUEUE_ERROR; hw->aq.asq_last_status = (enum i40e_admin_queue_err)retval; } - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQTX: desc and buffer writeback:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size); @@ -1063,7 +1123,7 @@ enum i40e_status_code i40e_clean_arq_element(struct i4 hw->aq.arq.r.arq_bi[desc_idx].va, e->msg_len, I40E_DMA_TO_NONDMA); - i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n"); + i40e_debug(hw, I40E_DEBUG_AQ_COMMAND, "AQRX: desc and buffer:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf, hw->aq.arq_buf_size); Modified: stable/12/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- stable/12/sys/dev/ixl/i40e_adminq_cmd.h Tue Aug 4 23:09:15 2020 (r363875) +++ stable/12/sys/dev/ixl/i40e_adminq_cmd.h Tue Aug 4 23:30:10 2020 (r363876) @@ -43,8 +43,8 @@ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x0005 -#define I40E_FW_API_VERSION_MINOR_X710 0x0007 +#define I40E_FW_API_VERSION_MINOR_X722 0x000A +#define I40E_FW_API_VERSION_MINOR_X710 0x000A #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \ @@ -52,6 +52,12 @@ /* API version 1.7 implements additional link and PHY-specific APIs */ #define I40E_MINOR_VER_GET_LINK_INFO_XL710 0x0007 +/* API version 1.9 for X722 implements additional link and PHY-specific APIs */ +#define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009 +/* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */ +#define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006 +/* API version 1.10 for X722 devices adds ability to request FEC encoding */ +#define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A struct i40e_aq_desc { __le16 flags; @@ -204,6 +210,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_add_cloud_filters = 0x025C, i40e_aqc_opc_remove_cloud_filters = 0x025D, i40e_aqc_opc_clear_wol_switch_filters = 0x025E, + i40e_aqc_opc_replace_cloud_filters = 0x025F, i40e_aqc_opc_add_mirror_rule = 0x0260, i40e_aqc_opc_delete_mirror_rule = 0x0261, @@ -289,6 +296,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_get_cee_dcb_cfg = 0x0A07, i40e_aqc_opc_lldp_set_local_mib = 0x0A08, i40e_aqc_opc_lldp_stop_start_spec_agent = 0x0A09, + i40e_aqc_opc_lldp_restore = 0x0A0A, /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, @@ -1382,14 +1390,17 @@ struct i40e_aqc_add_remove_cloud_filters { #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT 0 #define I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_MASK (0x3FF << \ I40E_AQC_ADD_CLOUD_CMD_SEID_NUM_SHIFT) - u8 reserved2[4]; + u8 big_buffer_flag; +#define I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER 1 +#define I40E_AQC_ADD_CLOUD_CMD_BB 1 + u8 reserved2[3]; __le32 addr_high; __le32 addr_low; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_add_remove_cloud_filters); -struct i40e_aqc_add_remove_cloud_filters_element_data { +struct i40e_aqc_cloud_filters_element_data { u8 outer_mac[6]; u8 inner_mac[6]; __le16 inner_vlan; @@ -1401,13 +1412,16 @@ struct i40e_aqc_add_remove_cloud_filters_element_data struct { u8 data[16]; } v6; + struct { + __le16 data[8]; + } raw_v6; } ipaddr; __le16 flags; #define I40E_AQC_ADD_CLOUD_FILTER_SHIFT 0 #define I40E_AQC_ADD_CLOUD_FILTER_MASK (0x3F << \ I40E_AQC_ADD_CLOUD_FILTER_SHIFT) /* 0x0000 reserved */ -#define I40E_AQC_ADD_CLOUD_FILTER_OIP 0x0001 +/* 0x0001 reserved */ /* 0x0002 reserved */ #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN 0x0003 #define I40E_AQC_ADD_CLOUD_FILTER_IMAC_IVLAN_TEN_ID 0x0004 @@ -1419,6 +1433,13 @@ struct i40e_aqc_add_remove_cloud_filters_element_data #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +/* 0x000D reserved */ +/* 0x000E reserved */ +/* 0x000F reserved */ +/* 0x0010 to 0x0017 is for custom filters */ +#define I40E_AQC_ADD_CLOUD_FILTER_IP_PORT 0x0010 /* Dest IP + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_PORT 0x0011 /* Dest MAC + L4 Port */ +#define I40E_AQC_ADD_CLOUD_FILTER_MAC_VLAN_PORT 0x0012 /* Dest MAC + VLAN + L4 Port */ #define I40E_AQC_ADD_CLOUD_FLAGS_TO_QUEUE 0x0080 #define I40E_AQC_ADD_CLOUD_VNK_SHIFT 6 @@ -1453,6 +1474,88 @@ struct i40e_aqc_add_remove_cloud_filters_element_data u8 response_reserved[7]; }; +/* i40e_aqc_add_rm_cloud_filt_elem_ext is used when + * I40E_AQC_ADD_REM_CLOUD_CMD_BIG_BUFFER flag is set. + */ +struct i40e_aqc_add_rm_cloud_filt_elem_ext { + struct i40e_aqc_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; + +I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_cloud_filters_element_data); + +/* i40e_aqc_cloud_filters_element_bb is used when + * I40E_AQC_CLOUD_CMD_BB flag is set. + */ +struct i40e_aqc_cloud_filters_element_bb { + struct i40e_aqc_cloud_filters_element_data element; + u16 general_fields[32]; +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD0 0 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD1 1 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X10_WORD2 2 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD0 3 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD1 4 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X11_WORD2 5 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD0 6 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD1 7 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X12_WORD2 8 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD0 9 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD1 10 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X13_WORD2 11 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD0 12 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD1 13 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X14_WORD2 14 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD0 15 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD1 16 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD2 17 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD3 18 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD4 19 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD5 20 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD6 21 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X16_WORD7 22 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD0 23 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD1 24 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD2 25 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD3 26 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD4 27 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD5 28 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD6 29 +#define I40E_AQC_ADD_CLOUD_FV_FLU_0X17_WORD7 30 +}; + +I40E_CHECK_STRUCT_LEN(0x80, i40e_aqc_cloud_filters_element_bb); + struct i40e_aqc_remove_cloud_filters_completion { __le16 perfect_ovlan_used; __le16 perfect_ovlan_free; @@ -1464,6 +1567,61 @@ struct i40e_aqc_remove_cloud_filters_completion { I40E_CHECK_CMD_LENGTH(i40e_aqc_remove_cloud_filters_completion); +/* Replace filter Command 0x025F + * uses the i40e_aqc_replace_cloud_filters, + * and the generic indirect completion structure + */ +struct i40e_filter_data { + u8 filter_type; + u8 input[3]; +}; + +I40E_CHECK_STRUCT_LEN(4, i40e_filter_data); + +struct i40e_aqc_replace_cloud_filters_cmd { + u8 valid_flags; +#define I40E_AQC_REPLACE_L1_FILTER 0x0 +#define I40E_AQC_REPLACE_CLOUD_FILTER 0x1 +#define I40E_AQC_GET_CLOUD_FILTERS 0x2 +#define I40E_AQC_MIRROR_CLOUD_FILTER 0x4 +#define I40E_AQC_HIGH_PRIORITY_CLOUD_FILTER 0x8 + u8 old_filter_type; + u8 new_filter_type; + u8 tr_bit; + u8 tr_bit2; + u8 reserved[3]; + __le32 addr_high; + __le32 addr_low; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_replace_cloud_filters_cmd); + +struct i40e_aqc_replace_cloud_filters_cmd_buf { + u8 data[32]; +/* Filter type INPUT codes*/ +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_ENTRIES_MAX 3 +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_VALIDATED (1 << 7UL) + +/* Field Vector offsets */ +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_MAC_DA 0 +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_STAG_ETH 6 +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_STAG 7 +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_VLAN 8 +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_STAG_OVLAN 9 +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_STAG_IVLAN 10 +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_TUNNLE_KEY 11 +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_IMAC 12 +/* big FLU */ +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_IP_DA 14 +/* big FLU */ +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_OIP_DA 15 + +#define I40E_AQC_REPLACE_CLOUD_CMD_INPUT_FV_INNER_VLAN 37 + struct i40e_filter_data filters[8]; +}; + +I40E_CHECK_STRUCT_LEN(0x40, i40e_aqc_replace_cloud_filters_cmd_buf); + /* Add Mirror Rule (indirect or direct 0x0260) * Delete Mirror Rule (indirect or direct 0x0261) * note: some rule types (4,5) do not use an external buffer. @@ -1865,6 +2023,7 @@ struct i40e_aq_get_phy_abilities_resp { #define I40E_AQ_PHY_FEC_ABILITY_KR 0x40 #define I40E_AQ_PHY_FEC_ABILITY_RS 0x80 __le16 eee_capability; +#define I40E_AQ_EEE_AUTO 0x0001 #define I40E_AQ_EEE_100BASE_TX 0x0002 #define I40E_AQ_EEE_1000BASE_T 0x0004 #define I40E_AQ_EEE_10GBASE_T 0x0008 @@ -1931,20 +2090,21 @@ I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config); struct i40e_aq_set_mac_config { __le16 max_frame_size; u8 params; -#define I40E_AQ_SET_MAC_CONFIG_CRC_EN 0x04 -#define I40E_AQ_SET_MAC_CONFIG_PACING_MASK 0x78 -#define I40E_AQ_SET_MAC_CONFIG_PACING_SHIFT 3 -#define I40E_AQ_SET_MAC_CONFIG_PACING_NONE 0x0 -#define I40E_AQ_SET_MAC_CONFIG_PACING_1B_13TX 0xF -#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_9TX 0x9 -#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_4TX 0x8 -#define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_7TX 0x7 -#define I40E_AQ_SET_MAC_CONFIG_PACING_2DW_3TX 0x6 -#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_1TX 0x5 -#define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_2TX 0x4 -#define I40E_AQ_SET_MAC_CONFIG_PACING_7DW_3TX 0x3 -#define I40E_AQ_SET_MAC_CONFIG_PACING_4DW_1TX 0x2 -#define I40E_AQ_SET_MAC_CONFIG_PACING_9DW_1TX 0x1 +#define I40E_AQ_SET_MAC_CONFIG_CRC_EN 0x04 +#define I40E_AQ_SET_MAC_CONFIG_PACING_MASK 0x78 +#define I40E_AQ_SET_MAC_CONFIG_PACING_SHIFT 3 +#define I40E_AQ_SET_MAC_CONFIG_PACING_NONE 0x0 +#define I40E_AQ_SET_MAC_CONFIG_PACING_1B_13TX 0xF +#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_9TX 0x9 +#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_4TX 0x8 +#define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_7TX 0x7 +#define I40E_AQ_SET_MAC_CONFIG_PACING_2DW_3TX 0x6 +#define I40E_AQ_SET_MAC_CONFIG_PACING_1DW_1TX 0x5 +#define I40E_AQ_SET_MAC_CONFIG_PACING_3DW_2TX 0x4 +#define I40E_AQ_SET_MAC_CONFIG_PACING_7DW_3TX 0x3 +#define I40E_AQ_SET_MAC_CONFIG_PACING_4DW_1TX 0x2 +#define I40E_AQ_SET_MAC_CONFIG_PACING_9DW_1TX 0x1 +#define I40E_AQ_SET_MAC_CONFIG_DROP_BLOCKING_PACKET_EN 0x80 u8 tx_timer_priority; /* bitmap */ __le16 tx_timer_value; __le16 fc_refresh_threshold; @@ -2077,8 +2237,8 @@ struct i40e_aqc_set_lb_mode { #define I40E_AQ_LB_SERDES 2 #define I40E_AQ_LB_PHY_INT 3 #define I40E_AQ_LB_PHY_EXT 4 -#define I40E_AQ_LB_CPVL_PCS 5 -#define I40E_AQ_LB_CPVL_EXT 6 +#define I40E_AQ_LB_BASE_T_PCS 5 +#define I40E_AQ_LB_BASE_T_EXT 6 #define I40E_AQ_LB_PHY_LOCAL 0x01 #define I40E_AQ_LB_PHY_REMOTE 0x02 #define I40E_AQ_LB_MAC_LOCAL 0x04 @@ -2142,7 +2302,13 @@ struct i40e_aqc_phy_register_access { #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL 1 #define I40E_AQ_PHY_REG_ACCESS_EXTERNAL_MODULE 2 u8 dev_addres; - u8 reserved1[2]; + u8 cmd_flags; +#define I40E_AQ_PHY_REG_ACCESS_DONT_CHANGE_QSFP_PAGE 0x01 +#define I40E_AQ_PHY_REG_ACCESS_SET_MDIO_IF_NUMBER 0x02 +#define I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_SHIFT 2 +#define I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_MASK (0x3 << \ + I40E_AQ_PHY_REG_ACCESS_MDIO_IF_NUMBER_SHIFT) + u8 reserved1; __le32 reg_address; __le32 reg_value; u8 reserved2[4]; @@ -2157,6 +2323,8 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_phy_register_access); struct i40e_aqc_nvm_update { u8 command_flags; #define I40E_AQ_NVM_LAST_CMD 0x01 +#define I40E_AQ_NVM_REARRANGE_TO_FLAT 0x20 +#define I40E_AQ_NVM_REARRANGE_TO_STRUCT 0x40 #define I40E_AQ_NVM_FLASH_ONLY 0x80 #define I40E_AQ_NVM_PRESERVATION_FLAGS_SHIFT 1 #define I40E_AQ_NVM_PRESERVATION_FLAGS_MASK 0x03 @@ -2404,18 +2572,19 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_update_tlv); /* Stop LLDP (direct 0x0A05) */ struct i40e_aqc_lldp_stop { u8 command; -#define I40E_AQ_LLDP_AGENT_STOP 0x0 -#define I40E_AQ_LLDP_AGENT_SHUTDOWN 0x1 +#define I40E_AQ_LLDP_AGENT_STOP 0x0 +#define I40E_AQ_LLDP_AGENT_SHUTDOWN 0x1 +#define I40E_AQ_LLDP_AGENT_STOP_PERSIST 0x2 u8 reserved[15]; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop); /* Start LLDP (direct 0x0A06) */ - struct i40e_aqc_lldp_start { u8 command; -#define I40E_AQ_LLDP_AGENT_START 0x1 +#define I40E_AQ_LLDP_AGENT_START 0x1 +#define I40E_AQ_LLDP_AGENT_START_PERSIST 0x2 u8 reserved[15]; }; @@ -2534,6 +2703,16 @@ struct i40e_aqc_lldp_stop_start_specific_agent { }; I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_stop_start_specific_agent); + +/* Restore LLDP Agent factory settings (direct 0x0A0A) */ +struct i40e_aqc_lldp_restore { + u8 command; +#define I40E_AQ_LLDP_AGENT_RESTORE_NOT 0x0 +#define I40E_AQ_LLDP_AGENT_RESTORE 0x1 + u8 reserved[15]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_restore); /* Add Udp Tunnel command and completion (direct 0x0B00) */ struct i40e_aqc_add_udp_tunnel { Modified: stable/12/sys/dev/ixl/i40e_common.c ============================================================================== --- stable/12/sys/dev/ixl/i40e_common.c Tue Aug 4 23:09:15 2020 (r363875) +++ stable/12/sys/dev/ixl/i40e_common.c Tue Aug 4 23:30:10 2020 (r363876) @@ -66,6 +66,8 @@ enum i40e_status_code i40e_set_mac_type(struct i40e_hw case I40E_DEV_ID_20G_KR2_A: case I40E_DEV_ID_25G_B: case I40E_DEV_ID_25G_SFP28: + case I40E_DEV_ID_X710_N3000: + case I40E_DEV_ID_XXV710_N3000: hw->mac.type = I40E_MAC_XL710; break; case I40E_DEV_ID_KX_X722: @@ -319,32 +321,37 @@ void i40e_debug_aq(struct i40e_hw *hw, enum i40e_debug void *buffer, u16 buf_len) { struct i40e_aq_desc *aq_desc = (struct i40e_aq_desc *)desc; + u32 effective_mask = hw->debug_mask & mask; u8 *buf = (u8 *)buffer; u16 len; - u16 i = 0; + u16 i; - if ((!(mask & hw->debug_mask)) || (desc == NULL)) + if (!effective_mask || !desc) return; len = LE16_TO_CPU(aq_desc->datalen); - i40e_debug(hw, mask, + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, "AQ CMD: opcode 0x%04X, flags 0x%04X, datalen 0x%04X, retval 0x%04X\n", LE16_TO_CPU(aq_desc->opcode), LE16_TO_CPU(aq_desc->flags), LE16_TO_CPU(aq_desc->datalen), LE16_TO_CPU(aq_desc->retval)); - i40e_debug(hw, mask, "\tcookie (h,l) 0x%08X 0x%08X\n", + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, + "\tcookie (h,l) 0x%08X 0x%08X\n", LE32_TO_CPU(aq_desc->cookie_high), LE32_TO_CPU(aq_desc->cookie_low)); - i40e_debug(hw, mask, "\tparam (0,1) 0x%08X 0x%08X\n", + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, + "\tparam (0,1) 0x%08X 0x%08X\n", LE32_TO_CPU(aq_desc->params.internal.param0), LE32_TO_CPU(aq_desc->params.internal.param1)); - i40e_debug(hw, mask, "\taddr (h,l) 0x%08X 0x%08X\n", + i40e_debug(hw, mask & I40E_DEBUG_AQ_DESCRIPTOR, + "\taddr (h,l) 0x%08X 0x%08X\n", LE32_TO_CPU(aq_desc->params.external.addr_high), LE32_TO_CPU(aq_desc->params.external.addr_low)); - if ((buffer != NULL) && (aq_desc->datalen != 0)) { + if (buffer && (buf_len != 0) && (len != 0) && + (effective_mask & I40E_DEBUG_AQ_DESC_BUFFER)) { i40e_debug(hw, mask, "AQ CMD Buffer:\n"); if (buf_len < len) len = buf_len; @@ -1011,10 +1018,18 @@ enum i40e_status_code i40e_init_shared_code(struct i40 else hw->pf_id = (u8)(func_rid & 0x7); - if (hw->mac.type == I40E_MAC_X722) - hw->flags |= I40E_HW_FLAG_AQ_SRCTL_ACCESS_ENABLE | - I40E_HW_FLAG_NVM_READ_REQUIRES_LOCK; + /* NVMUpdate features structure initialization */ + hw->nvmupd_features.major = I40E_NVMUPD_FEATURES_API_VER_MAJOR; + hw->nvmupd_features.minor = I40E_NVMUPD_FEATURES_API_VER_MINOR; + hw->nvmupd_features.size = sizeof(hw->nvmupd_features); + i40e_memset(hw->nvmupd_features.features, 0x0, + I40E_NVMUPD_FEATURES_API_FEATURES_ARRAY_LEN * + sizeof(*hw->nvmupd_features.features), + I40E_NONDMA_MEM); + /* No features supported at the moment */ + hw->nvmupd_features.features[0] = 0; + status = i40e_init_nvm(hw); return status; } @@ -1272,6 +1287,29 @@ static enum i40e_media_type i40e_get_media_type(struct return media; } +/** + * i40e_poll_globr - Poll for Global Reset completion + * @hw: pointer to the hardware structure + * @retry_limit: how many times to retry before failure + **/ +static enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw, + u32 retry_limit) +{ + u32 cnt, reg = 0; + + for (cnt = 0; cnt < retry_limit; cnt++) { + reg = rd32(hw, I40E_GLGEN_RSTAT); + if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) + return I40E_SUCCESS; + i40e_msec_delay(100); + } + + DEBUGOUT("Global reset failed.\n"); + DEBUGOUT1("I40E_GLGEN_RSTAT = 0x%x\n", reg); + + return I40E_ERR_RESET_FAILED; +} + #define I40E_PF_RESET_WAIT_COUNT 200 /** * i40e_pf_reset - Reset the PF @@ -1295,7 +1333,7 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >> I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT; - grst_del = grst_del * 20; + grst_del = min(grst_del * 20, 160U); for (cnt = 0; cnt < grst_del; cnt++) { reg = rd32(hw, I40E_GLGEN_RSTAT); @@ -1341,14 +1379,14 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK)) break; reg2 = rd32(hw, I40E_GLGEN_RSTAT); - if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) { - DEBUGOUT("Core reset upcoming. Skipping PF reset request.\n"); - DEBUGOUT1("I40E_GLGEN_RSTAT = 0x%x\n", reg2); - return I40E_ERR_NOT_READY; - } + if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) + break; i40e_msec_delay(1); } - if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { + if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) { + if (i40e_poll_globr(hw, grst_del) != I40E_SUCCESS) + return I40E_ERR_RESET_FAILED; + } else if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { DEBUGOUT("PF reset polling failed to complete.\n"); return I40E_ERR_RESET_FAILED; } @@ -1480,7 +1518,6 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int id if (!hw->func_caps.led[idx]) return 0; - gpio_val = rd32(hw, I40E_GLGEN_GPIO_CTL(idx)); port = (gpio_val & I40E_GLGEN_GPIO_CTL_PRT_NUM_MASK) >> I40E_GLGEN_GPIO_CTL_PRT_NUM_SHIFT; @@ -1499,8 +1536,15 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int id #define I40E_FILTER_ACTIVITY 0xE #define I40E_LINK_ACTIVITY 0xC #define I40E_MAC_ACTIVITY 0xD +#define I40E_FW_LED BIT(4) +#define I40E_LED_MODE_VALID (I40E_GLGEN_GPIO_CTL_LED_MODE_MASK >> \ + I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT) + #define I40E_LED0 22 +#define I40E_PIN_FUNC_SDP 0x0 +#define I40E_PIN_FUNC_LED 0x1 + /** * i40e_led_get - return current on/off mode * @hw: pointer to the hw struct @@ -1562,8 +1606,10 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool b u32 current_mode = 0; int i; - if (mode & 0xfffffff0) + if (mode & ~I40E_LED_MODE_VALID) { DEBUGOUT1("invalid mode passed in %X\n", mode); + return; + } /* as per the documentation GPIO 22-29 are the LED * GPIO pins named LED0..LED7 @@ -1648,20 +1694,23 @@ enum i40e_status_code i40e_aq_get_phy_capabilities(str status = i40e_asq_send_command(hw, &desc, abilities, abilities_size, cmd_details); - if (status != I40E_SUCCESS) - break; - - if (hw->aq.asq_last_status == I40E_AQ_RC_EIO) { + switch (hw->aq.asq_last_status) { + case I40E_AQ_RC_EIO: status = I40E_ERR_UNKNOWN_PHY; break; - } else if (hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) { + case I40E_AQ_RC_EAGAIN: i40e_msec_delay(1); total_delay++; status = I40E_ERR_TIMEOUT; + break; + /* also covers I40E_AQ_RC_OK */ + default: + break; } - } while ((hw->aq.asq_last_status != I40E_AQ_RC_OK) && - (total_delay < max_delay)); + } while ((hw->aq.asq_last_status == I40E_AQ_RC_EAGAIN) && + (total_delay < max_delay)); + if (status != I40E_SUCCESS) return status; @@ -1803,6 +1852,7 @@ enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, * @max_frame_size: Maximum Frame Size to be supported by the port * @crc_en: Tell HW to append a CRC to outgoing frames * @pacing: Pacing configurations + * @auto_drop_blocking_packets: Tell HW to drop packets if TC queue is blocked * @cmd_details: pointer to command details structure or NULL * * Configure MAC settings for frame size, jumbo frame support and the @@ -1811,6 +1861,7 @@ enum i40e_status_code i40e_set_fc(struct i40e_hw *hw, enum i40e_status_code i40e_aq_set_mac_config(struct i40e_hw *hw, u16 max_frame_size, bool crc_en, u16 pacing, + bool auto_drop_blocking_packets, struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; @@ -1829,6 +1880,19 @@ enum i40e_status_code i40e_aq_set_mac_config(struct i4 if (crc_en) cmd->params |= I40E_AQ_SET_MAC_CONFIG_CRC_EN; + if (auto_drop_blocking_packets) { + if (hw->flags & I40E_HW_FLAG_DROP_MODE) + cmd->params |= + I40E_AQ_SET_MAC_CONFIG_DROP_BLOCKING_PACKET_EN; + else + i40e_debug(hw, I40E_DEBUG_ALL, + "This FW api version does not support drop mode.\n"); + } + +#define I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD 0x7FFF + cmd->fc_refresh_threshold = + CPU_TO_LE16(I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD); + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); return status; @@ -1969,8 +2033,8 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40 hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; - if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR && - hw->aq.api_min_ver >= 7) { + if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE && + hw->mac.type != I40E_MAC_X722) { __le32 tmp; i40e_memcpy(&tmp, resp->link_type, sizeof(tmp), @@ -2198,7 +2262,7 @@ enum i40e_status_code i40e_aq_add_vsi(struct i40e_hw * desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, - sizeof(vsi_ctx->info), cmd_details); + sizeof(vsi_ctx->info), cmd_details); if (status != I40E_SUCCESS) goto aq_add_vsi_exit; @@ -2615,7 +2679,7 @@ enum i40e_status_code i40e_aq_update_vsi_params(struct desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); status = i40e_asq_send_command(hw, &desc, &vsi_ctx->info, - sizeof(vsi_ctx->info), cmd_details); + sizeof(vsi_ctx->info), cmd_details); vsi_ctx->vsis_allocated = LE16_TO_CPU(resp->vsi_used); vsi_ctx->vsis_unallocated = LE16_TO_CPU(resp->vsi_free); @@ -2830,9 +2894,16 @@ enum i40e_status_code i40e_update_link_info(struct i40 if (status) return status; - hw->phy.link_info.req_fec_info = - abilities.fec_cfg_curr_mod_ext_info & - (I40E_AQ_REQUEST_FEC_KR | I40E_AQ_REQUEST_FEC_RS); + if (abilities.fec_cfg_curr_mod_ext_info & + I40E_AQ_ENABLE_FEC_AUTO) + hw->phy.link_info.req_fec_info = + (I40E_AQ_REQUEST_FEC_KR | + I40E_AQ_REQUEST_FEC_RS); + else + hw->phy.link_info.req_fec_info = + abilities.fec_cfg_curr_mod_ext_info & + (I40E_AQ_REQUEST_FEC_KR | + I40E_AQ_REQUEST_FEC_RS); i40e_memcpy(hw->phy.link_info.module_type, &abilities.module_type, sizeof(hw->phy.link_info.module_type), I40E_NONDMA_TO_NONDMA); @@ -4209,7 +4280,7 @@ enum i40e_status_code i40e_aq_set_lldp_mib(struct i40e cmd->type = mib_type; cmd->length = CPU_TO_LE16(buff_size); - cmd->address_high = CPU_TO_LE32(I40E_HI_WORD((u64)buff)); + cmd->address_high = CPU_TO_LE32(I40E_HI_DWORD((u64)buff)); cmd->address_low = CPU_TO_LE32(I40E_LO_DWORD((u64)buff)); status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); @@ -4245,164 +4316,54 @@ enum i40e_status_code i40e_aq_cfg_lldp_mib_change_even } /** - * i40e_aq_add_lldp_tlv + * i40e_aq_restore_lldp * @hw: pointer to the hw struct - * @bridge_type: type of bridge - * @buff: buffer with TLV to add - * @buff_size: length of the buffer - * @tlv_len: length of the TLV to be added - * @mib_len: length of the LLDP MIB returned in response + * @setting: pointer to factory setting variable or NULL + * @restore: True if factory settings should be restored * @cmd_details: pointer to command details structure or NULL * - * Add the specified TLV to LLDP Local MIB for the given bridge type, - * it is responsibility of the caller to make sure that the TLV is not - * already present in the LLDPDU. - * In return firmware will write the complete LLDP MIB with the newly - * added TLV in the response buffer. + * Restore LLDP Agent factory settings if @restore set to True. In other case + * only returns factory setting in AQ response. **/ -enum i40e_status_code i40e_aq_add_lldp_tlv(struct i40e_hw *hw, u8 bridge_type, - void *buff, u16 buff_size, u16 tlv_len, - u16 *mib_len, - struct i40e_asq_cmd_details *cmd_details) +enum i40e_status_code +i40e_aq_restore_lldp(struct i40e_hw *hw, u8 *setting, bool restore, + struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; - struct i40e_aqc_lldp_add_tlv *cmd = - (struct i40e_aqc_lldp_add_tlv *)&desc.params.raw; + struct i40e_aqc_lldp_restore *cmd = + (struct i40e_aqc_lldp_restore *)&desc.params.raw; enum i40e_status_code status; - if (buff_size == 0 || !buff || tlv_len == 0) - return I40E_ERR_PARAM; - - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_add_tlv); - - /* Indirect Command */ - desc.flags |= CPU_TO_LE16((u16)(I40E_AQ_FLAG_BUF | I40E_AQ_FLAG_RD)); - if (buff_size > I40E_AQ_LARGE_BUF) - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); - desc.datalen = CPU_TO_LE16(buff_size); - - cmd->type = ((bridge_type << I40E_AQ_LLDP_BRIDGE_TYPE_SHIFT) & - I40E_AQ_LLDP_BRIDGE_TYPE_MASK); - cmd->len = CPU_TO_LE16(tlv_len); - - status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); - if (!status) { - if (mib_len != NULL) - *mib_len = LE16_TO_CPU(desc.datalen); + if (!(hw->flags & I40E_HW_FLAG_FW_LLDP_PERSISTENT)) { + i40e_debug(hw, I40E_DEBUG_ALL, + "Restore LLDP not supported by current FW version.\n"); + return I40E_ERR_DEVICE_NOT_SUPPORTED; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 5 01:43:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E13D53A5843; Wed, 5 Aug 2020 01:43:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLvXr5g56z47b2; Wed, 5 Aug 2020 01:43:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A638DEC0E; Wed, 5 Aug 2020 01:43:40 +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 0751heav024929; Wed, 5 Aug 2020 01:43:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0751hePL024928; Wed, 5 Aug 2020 01:43:40 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202008050143.0751hePL024928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 5 Aug 2020 01:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363877 - in stable/12/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 363877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 01:43:40 -0000 Author: mav Date: Wed Aug 5 01:43:40 2020 New Revision: 363877 URL: https://svnweb.freebsd.org/changeset/base/363877 Log: MFC r363431: Untie nmi_handle_intr() from DEV_ISA. The only part of nmi_handle_intr() depending on ISA is isa_nmi(), which is already wrapped. Entering debugger on NMI does not really depend on ISA. Modified: stable/12/sys/amd64/amd64/trap.c stable/12/sys/i386/i386/trap.c Modified: stable/12/sys/amd64/amd64/trap.c ============================================================================== --- stable/12/sys/amd64/amd64/trap.c Tue Aug 4 23:30:10 2020 (r363876) +++ stable/12/sys/amd64/amd64/trap.c Wed Aug 5 01:43:40 2020 (r363877) @@ -357,11 +357,9 @@ trap(struct trapframe *frame) signo = SIGFPE; break; -#ifdef DEV_ISA case T_NMI: nmi_handle_intr(type, frame); return; -#endif case T_OFLOW: /* integer overflow fault */ ucode = FPE_INTOVF; @@ -587,11 +585,9 @@ trap(struct trapframe *frame) #endif break; -#ifdef DEV_ISA case T_NMI: nmi_handle_intr(type, frame); return; -#endif } trap_fatal(frame, 0); Modified: stable/12/sys/i386/i386/trap.c ============================================================================== --- stable/12/sys/i386/i386/trap.c Tue Aug 4 23:30:10 2020 (r363876) +++ stable/12/sys/i386/i386/trap.c Wed Aug 5 01:43:40 2020 (r363877) @@ -413,7 +413,6 @@ user_trctrap_out: signo = SIGFPE; break; -#ifdef DEV_ISA case T_NMI: #ifdef POWERFAIL_NMI #ifndef TIMER_FREQ @@ -429,7 +428,6 @@ user_trctrap_out: nmi_handle_intr(type, frame); return; #endif /* POWERFAIL_NMI */ -#endif /* DEV_ISA */ case T_OFLOW: /* integer overflow fault */ ucode = FPE_INTOVF; @@ -675,7 +673,6 @@ kernel_trctrap: #endif break; -#ifdef DEV_ISA case T_NMI: #ifdef POWERFAIL_NMI if (time_second - lastalert > 10) { @@ -688,7 +685,6 @@ kernel_trctrap: nmi_handle_intr(type, frame); return; #endif /* POWERFAIL_NMI */ -#endif /* DEV_ISA */ } trap_fatal(frame, eva); From owner-svn-src-all@freebsd.org Wed Aug 5 03:30:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 87F6D3A8B42; Wed, 5 Aug 2020 03:30:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLxvc2vs0z4F0t; Wed, 5 Aug 2020 03:30:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 472F0FD92; Wed, 5 Aug 2020 03:30:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0753U4hl088147; Wed, 5 Aug 2020 03:30:04 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0753U4p0088146; Wed, 5 Aug 2020 03:30:04 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008050330.0753U4p0088146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Aug 2020 03:30:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363878 - stable/12/sys/bsm X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/bsm X-SVN-Commit-Revision: 363878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 03:30:04 -0000 Author: kevans Date: Wed Aug 5 03:30:03 2020 New Revision: 363878 URL: https://svnweb.freebsd.org/changeset/base/363878 Log: MFC r360235: bsm: add AUE_CLOSERANGE Modified: stable/12/sys/bsm/audit_kevents.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/bsm/audit_kevents.h ============================================================================== --- stable/12/sys/bsm/audit_kevents.h Wed Aug 5 01:43:40 2020 (r363877) +++ stable/12/sys/bsm/audit_kevents.h Wed Aug 5 03:30:03 2020 (r363878) @@ -644,6 +644,7 @@ #define AUE_SETLOGINCLASS 43238 /* FreeBSD-specific. */ #define AUE_POSIX_FADVISE 43239 /* FreeBSD-specific. */ #define AUE_SCTP_GENERIC_SENDMSG_IOV 43240 /* FreeBSD-specific. */ +#define AUE_CLOSERANGE 43265 /* FreeBSD-specific. */ /* * Darwin BSM uses a number of AUE_O_* definitions, which are aliased to the From owner-svn-src-all@freebsd.org Wed Aug 5 03:54:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 805DE3A9524; Wed, 5 Aug 2020 03:54:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BLyRG39N1z4GLg; Wed, 5 Aug 2020 03:54:02 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4FF58104E9; Wed, 5 Aug 2020 03:54:02 +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 0753s2X9006358; Wed, 5 Aug 2020 03:54:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0753rv6L006334; Wed, 5 Aug 2020 03:53:57 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008050353.0753rv6L006334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Aug 2020 03:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363879 - in stable/12: include lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/file X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: include lib/libc/sys sys/compat/freebsd32 sys/kern sys/sys tests/sys/file X-SVN-Commit-Revision: 363879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 03:54:02 -0000 Author: kevans Date: Wed Aug 5 03:53:57 2020 New Revision: 363879 URL: https://svnweb.freebsd.org/changeset/base/363879 Log: MFC r359836-r359837, r359891, r360236-r360237: close_range(2) This commit diverges from our usual procedure of committing generated files separately because the original commit, r359836, conflated userland use (in tests) with the implementation. __FreeBSD_version was already bumped ~15 hours prior to this MFC, 1201522 marks the introduction of close_range. CPython will use this syscall for some pretty sizable performance gains. r359836: Implement a close_range(2) syscall close_range(min, max, flags) allows for a range of descriptors to be closed. The Python folk have indicated that they would much prefer this interface to closefrom(2), as the case may be that they/someone have special fds dup'd to higher in the range and they can't necessarily closefrom(min) because they don't want to hit the upper range, but relocating them to lower isn't necessarily feasible. sys_closefrom has been rewritten to use kern_close_range() using ~0U to indicate closing to the end of the range. This was chosen rather than requiring callers of kern_close_range() to hold FILEDESC_SLOCK across the call to kern_close_range for simplicity. The flags argument of close_range(2) is currently unused, so any flags set is currently EINVAL. It was added to the interface in Linux so that future flags could be added for, e.g., "halt on first error" and things of this nature. This patch is based on a syscall of the same design that is expected to be merged into Linux. r359837: sysent: re-roll after introduction of close_range in r359836 r359891: close_range/closefrom: fix regression from close_range introduction close_range will clamp the range between [0, fdp->fd_lastfile], but failed to take into account that fdp->fd_lastfile can become -1 if all fds are closed. =-( In this scenario, just return because there's nothing further we can do at the moment. Add a test case for this, fork() and simply closefrom(0) twice in the child; on the second invocation, fdp->fd_lastfile == -1 and will trigger a panic before this change. r360236: close_range(2): use newly assigned AUE_CLOSERANGE r360237: sysent: re-roll after 360236 (AUE_CLOSERANGE used) Modified: stable/12/include/unistd.h stable/12/lib/libc/sys/Makefile.inc stable/12/lib/libc/sys/Symbol.map stable/12/lib/libc/sys/closefrom.2 stable/12/sys/compat/freebsd32/freebsd32_syscall.h stable/12/sys/compat/freebsd32/freebsd32_syscalls.c stable/12/sys/compat/freebsd32/freebsd32_sysent.c stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c stable/12/sys/compat/freebsd32/syscalls.master stable/12/sys/kern/capabilities.conf stable/12/sys/kern/init_sysent.c stable/12/sys/kern/kern_descrip.c stable/12/sys/kern/syscalls.c stable/12/sys/kern/syscalls.master stable/12/sys/kern/systrace_args.c stable/12/sys/sys/syscall.h stable/12/sys/sys/syscall.mk stable/12/sys/sys/syscallsubr.h stable/12/sys/sys/sysproto.h stable/12/tests/sys/file/closefrom_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/include/unistd.h ============================================================================== --- stable/12/include/unistd.h Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/include/unistd.h Wed Aug 5 03:53:57 2020 (r363879) @@ -494,6 +494,7 @@ struct crypt_data { int acct(const char *); int async_daemon(void); int check_utility_compat(const char *); +int close_range(unsigned int, unsigned int, int); const char * crypt_get_format(void); char *crypt_r(const char *, const char *, struct crypt_data *); Modified: stable/12/lib/libc/sys/Makefile.inc ============================================================================== --- stable/12/lib/libc/sys/Makefile.inc Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/lib/libc/sys/Makefile.inc Wed Aug 5 03:53:57 2020 (r363879) @@ -372,6 +372,7 @@ MLINKS+=chown.2 fchown.2 \ chown.2 lchown.2 MLINKS+=clock_gettime.2 clock_getres.2 \ clock_gettime.2 clock_settime.2 +MLINKS+=closefrom.2 close_range.2 MLINKS+=nanosleep.2 clock_nanosleep.2 MLINKS+=cpuset.2 cpuset_getid.2 \ cpuset.2 cpuset_setid.2 Modified: stable/12/lib/libc/sys/Symbol.map ============================================================================== --- stable/12/lib/libc/sys/Symbol.map Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/lib/libc/sys/Symbol.map Wed Aug 5 03:53:57 2020 (r363879) @@ -402,6 +402,7 @@ FBSD_1.5 { }; FBSD_1.6 { + close_range; fhlink; fhlinkat; fhreadlink; Modified: stable/12/lib/libc/sys/closefrom.2 ============================================================================== --- stable/12/lib/libc/sys/closefrom.2 Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/lib/libc/sys/closefrom.2 Wed Aug 5 03:53:57 2020 (r363879) @@ -25,11 +25,12 @@ .\" .\" $FreeBSD$ .\" -.Dd June 12, 2009 +.Dd April 12, 2020 .Dt CLOSEFROM 2 .Os .Sh NAME -.Nm closefrom +.Nm closefrom , +.Nm close_range .Nd delete open file descriptors .Sh LIBRARY .Lb libc @@ -37,6 +38,8 @@ .In unistd.h .Ft void .Fn closefrom "int lowfd" +.Ft int +.Fn close_range "u_int lowfd" "u_int highfd" "int flags" .Sh DESCRIPTION The .Fn closefrom @@ -44,6 +47,40 @@ system call deletes all open file descriptors greater .Fa lowfd from the per-process object reference table. Any errors encountered while closing file descriptors are ignored. +.Pp +The +.Fn close_range +system call deletes all open file descriptors between +.Fa lowfd +and +.Fa highfd +inclusive, clamped to the range of open file descriptors. +Any errors encountered while closing file descriptors are ignored. +There are currently no defined +.Fa flags . +.Sh RETURN VALUES +Upon successful completion, +.Fn close_range +returns a value +of 0. +Otherwise, a value of -1 is returned and the global variable +.Va errno +is set to indicate the error. +.Sh ERRORS +The +.Fn close_range +system call +will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa highfd +argument is lower than the +.Fa lowfd +argument. +.It Bq Er EINVAL +An invalid flag was set. +.El .Sh SEE ALSO .Xr close 2 .Sh HISTORY Modified: stable/12/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_syscall.h Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/compat/freebsd32/freebsd32_syscall.h Wed Aug 5 03:53:57 2020 (r363879) @@ -495,4 +495,5 @@ #define FREEBSD32_SYS_fhlinkat 566 #define FREEBSD32_SYS_fhreadlink 567 #define FREEBSD32_SYS_freebsd32___sysctlbyname 570 -#define FREEBSD32_SYS_MAXSYSCALL 571 +#define FREEBSD32_SYS_close_range 575 +#define FREEBSD32_SYS_MAXSYSCALL 576 Modified: stable/12/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_syscalls.c Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/compat/freebsd32/freebsd32_syscalls.c Wed Aug 5 03:53:57 2020 (r363879) @@ -607,4 +607,9 @@ const char *freebsd32_syscallnames[] = { "#568", /* 568 = funlinkat */ "#569", /* 569 = copy_file_range */ "freebsd32___sysctlbyname", /* 570 = freebsd32___sysctlbyname */ + "#571", /* 571 = shm_open2 */ + "#572", /* 572 = shm_rename */ + "#573", /* 573 = sigfastblock */ + "#574", /* 574 = __realpathat */ + "close_range", /* 575 = close_range */ }; Modified: stable/12/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_sysent.c Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/compat/freebsd32/freebsd32_sysent.c Wed Aug 5 03:53:57 2020 (r363879) @@ -654,4 +654,9 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 568 = funlinkat */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 569 = copy_file_range */ { AS(freebsd32___sysctlbyname_args), (sy_call_t *)freebsd32___sysctlbyname, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 570 = freebsd32___sysctlbyname */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 571 = shm_open2 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 572 = shm_rename */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 573 = sigfastblock */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 574 = __realpathat */ + { AS(close_range_args), (sy_call_t *)sys_close_range, AUE_CLOSERANGE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 575 = close_range */ }; Modified: stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Aug 5 03:53:57 2020 (r363879) @@ -3322,6 +3322,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 6; break; } + /* close_range */ + case 575: { + struct close_range_args *p = params; + uarg[0] = p->lowfd; /* u_int */ + uarg[1] = p->highfd; /* u_int */ + iarg[2] = p->flags; /* int */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -8942,6 +8951,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* close_range */ + case 575: + switch(ndx) { + case 0: + p = "u_int"; + break; + case 1: + p = "u_int"; + break; + case 2: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10813,6 +10838,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* freebsd32___sysctlbyname */ case 570: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* close_range */ + case 575: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: stable/12/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/12/sys/compat/freebsd32/syscalls.master Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/compat/freebsd32/syscalls.master Wed Aug 5 03:53:57 2020 (r363879) @@ -1132,5 +1132,11 @@ 570 AUE_SYSCTL STD { int freebsd32___sysctlbyname(const char *name, \ size_t namelen, void *old, uint32_t *oldlenp, \ void *new, size_t newlen); } +571 AUE_NULL UNIMPL shm_open2 +572 AUE_NULL UNIMPL shm_rename +573 AUE_NULL UNIMPL sigfastblock +574 AUE_NULL UNIMPL __realpathat +575 AUE_CLOSERANGE NOPROTO { int close_range(u_int lowfd, u_int highfd, \ + int flags); } ; vim: syntax=off Modified: stable/12/sys/kern/capabilities.conf ============================================================================== --- stable/12/sys/kern/capabilities.conf Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/kern/capabilities.conf Wed Aug 5 03:53:57 2020 (r363879) @@ -131,6 +131,7 @@ clock_gettime ## Always allow file descriptor close(2). ## close +close_range closefrom ## Modified: stable/12/sys/kern/init_sysent.c ============================================================================== --- stable/12/sys/kern/init_sysent.c Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/kern/init_sysent.c Wed Aug 5 03:53:57 2020 (r363879) @@ -620,4 +620,9 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 568 = funlinkat */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 569 = copy_file_range */ { AS(__sysctlbyname_args), (sy_call_t *)sys___sysctlbyname, AUE_SYSCTL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 570 = __sysctlbyname */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 571 = shm_open2 */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 572 = shm_rename */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 573 = sigfastblock */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 574 = __realpathat */ + { AS(close_range_args), (sy_call_t *)sys_close_range, AUE_CLOSERANGE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 575 = close_range */ }; Modified: stable/12/sys/kern/kern_descrip.c ============================================================================== --- stable/12/sys/kern/kern_descrip.c Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/kern/kern_descrip.c Wed Aug 5 03:53:57 2020 (r363879) @@ -1263,6 +1263,65 @@ kern_close(struct thread *td, int fd) return (closefp(fdp, fd, fp, td, 1)); } +int +kern_close_range(struct thread *td, u_int lowfd, u_int highfd) +{ + struct filedesc *fdp; + int fd, ret; + + ret = 0; + fdp = td->td_proc->p_fd; + FILEDESC_SLOCK(fdp); + + /* + * Check this prior to clamping; closefrom(3) with only fd 0, 1, and 2 + * open should not be a usage error. From a close_range() perspective, + * close_range(3, ~0U, 0) in the same scenario should also likely not + * be a usage error as all fd above 3 are in-fact already closed. + */ + if (highfd < lowfd) { + ret = EINVAL; + goto out; + } + + /* + * If fdp->fd_lastfile == -1, we're dealing with either a fresh file + * table or one in which every fd has been closed. Just return + * successful; there's nothing left to do. + */ + if (fdp->fd_lastfile == -1) + goto out; + /* Clamped to [lowfd, fd_lastfile] */ + highfd = MIN(highfd, fdp->fd_lastfile); + for (fd = lowfd; fd <= highfd; fd++) { + if (fdp->fd_ofiles[fd].fde_file != NULL) { + FILEDESC_SUNLOCK(fdp); + (void)kern_close(td, fd); + FILEDESC_SLOCK(fdp); + } + } +out: + FILEDESC_SUNLOCK(fdp); + return (ret); +} + +#ifndef _SYS_SYSPROTO_H_ +struct close_range_args { + u_int lowfd; + u_int highfd; + int flags; +}; +#endif +int +sys_close_range(struct thread *td, struct close_range_args *uap) +{ + + /* No flags currently defined */ + if (uap->flags != 0) + return (EINVAL); + return (kern_close_range(td, uap->lowfd, uap->highfd)); +} + /* * Close open file descriptors. */ @@ -1275,28 +1334,16 @@ struct closefrom_args { int sys_closefrom(struct thread *td, struct closefrom_args *uap) { - struct filedesc *fdp; - int fd; + u_int lowfd; - fdp = td->td_proc->p_fd; AUDIT_ARG_FD(uap->lowfd); /* * Treat negative starting file descriptor values identical to * closefrom(0) which closes all files. */ - if (uap->lowfd < 0) - uap->lowfd = 0; - FILEDESC_SLOCK(fdp); - for (fd = uap->lowfd; fd <= fdp->fd_lastfile; fd++) { - if (fdp->fd_ofiles[fd].fde_file != NULL) { - FILEDESC_SUNLOCK(fdp); - (void)kern_close(td, fd); - FILEDESC_SLOCK(fdp); - } - } - FILEDESC_SUNLOCK(fdp); - return (0); + lowfd = MAX(0, uap->lowfd); + return (kern_close_range(td, lowfd, ~0U)); } #if defined(COMPAT_43) Modified: stable/12/sys/kern/syscalls.c ============================================================================== --- stable/12/sys/kern/syscalls.c Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/kern/syscalls.c Wed Aug 5 03:53:57 2020 (r363879) @@ -577,4 +577,9 @@ const char *syscallnames[] = { "#568", /* 568 = funlinkat */ "#569", /* 569 = copy_file_range */ "__sysctlbyname", /* 570 = __sysctlbyname */ + "#571", /* 571 = shm_open2 */ + "#572", /* 572 = shm_rename */ + "#573", /* 573 = sigfastblock */ + "#574", /* 574 = __realpathat */ + "close_range", /* 575 = close_range */ }; Modified: stable/12/sys/kern/syscalls.master ============================================================================== --- stable/12/sys/kern/syscalls.master Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/kern/syscalls.master Wed Aug 5 03:53:57 2020 (r363879) @@ -1380,6 +1380,17 @@ size_t newlen \ ); \ } +571 AUE_NULL UNIMPL shm_open2 +572 AUE_NULL UNIMPL shm_rename +573 AUE_NULL UNIMPL sigfastblock +574 AUE_NULL UNIMPL __realpathat +575 AUE_CLOSERANGE STD { \ + int close_range( \ + u_int lowfd, \ + u_int highfd, \ + int flags \ + ); \ + } ; Please copy any additions and changes to the following compatability tables: Modified: stable/12/sys/kern/systrace_args.c ============================================================================== --- stable/12/sys/kern/systrace_args.c Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/kern/systrace_args.c Wed Aug 5 03:53:57 2020 (r363879) @@ -3314,6 +3314,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 6; break; } + /* close_range */ + case 575: { + struct close_range_args *p = params; + uarg[0] = p->lowfd; /* u_int */ + uarg[1] = p->highfd; /* u_int */ + iarg[2] = p->flags; /* int */ + *n_args = 3; + break; + } default: *n_args = 0; break; @@ -8847,6 +8856,22 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* close_range */ + case 575: + switch(ndx) { + case 0: + p = "u_int"; + break; + case 1: + p = "u_int"; + break; + case 2: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10745,6 +10770,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* __sysctlbyname */ case 570: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* close_range */ + case 575: if (ndx == 0 || ndx == 1) p = "int"; break; Modified: stable/12/sys/sys/syscall.h ============================================================================== --- stable/12/sys/sys/syscall.h Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/sys/syscall.h Wed Aug 5 03:53:57 2020 (r363879) @@ -504,4 +504,5 @@ #define SYS_fhlinkat 566 #define SYS_fhreadlink 567 #define SYS___sysctlbyname 570 -#define SYS_MAXSYSCALL 571 +#define SYS_close_range 575 +#define SYS_MAXSYSCALL 576 Modified: stable/12/sys/sys/syscall.mk ============================================================================== --- stable/12/sys/sys/syscall.mk Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/sys/syscall.mk Wed Aug 5 03:53:57 2020 (r363879) @@ -409,4 +409,5 @@ MIASM = \ fhlink.o \ fhlinkat.o \ fhreadlink.o \ - __sysctlbyname.o + __sysctlbyname.o \ + close_range.o Modified: stable/12/sys/sys/syscallsubr.h ============================================================================== --- stable/12/sys/sys/syscallsubr.h Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/sys/syscallsubr.h Wed Aug 5 03:53:57 2020 (r363879) @@ -93,6 +93,7 @@ int kern_clock_nanosleep(struct thread *td, clockid_t const struct timespec *rqtp, struct timespec *rmtp); int kern_clock_settime(struct thread *td, clockid_t clock_id, struct timespec *ats); +int kern_close_range(struct thread *td, u_int lowfd, u_int highfd); int kern_close(struct thread *td, int fd); int kern_connectat(struct thread *td, int dirfd, int fd, struct sockaddr *sa); Modified: stable/12/sys/sys/sysproto.h ============================================================================== --- stable/12/sys/sys/sysproto.h Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/sys/sys/sysproto.h Wed Aug 5 03:53:57 2020 (r363879) @@ -1798,6 +1798,11 @@ struct __sysctlbyname_args { char new_l_[PADL_(void *)]; void * new; char new_r_[PADR_(void *)]; char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)]; }; +struct close_range_args { + char lowfd_l_[PADL_(u_int)]; u_int lowfd; char lowfd_r_[PADR_(u_int)]; + char highfd_l_[PADL_(u_int)]; u_int highfd; char highfd_r_[PADR_(u_int)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2183,6 +2188,7 @@ int sys_fhlink(struct thread *, struct fhlink_args *); int sys_fhlinkat(struct thread *, struct fhlinkat_args *); int sys_fhreadlink(struct thread *, struct fhreadlink_args *); int sys___sysctlbyname(struct thread *, struct __sysctlbyname_args *); +int sys_close_range(struct thread *, struct close_range_args *); #ifdef COMPAT_43 @@ -3085,6 +3091,7 @@ int freebsd11_mknodat(struct thread *, struct freebsd1 #define SYS_AUE_fhlinkat AUE_NULL #define SYS_AUE_fhreadlink AUE_NULL #define SYS_AUE___sysctlbyname AUE_SYSCTL +#define SYS_AUE_close_range AUE_CLOSERANGE #undef PAD_ #undef PADL_ Modified: stable/12/tests/sys/file/closefrom_test.c ============================================================================== --- stable/12/tests/sys/file/closefrom_test.c Wed Aug 5 03:30:03 2020 (r363878) +++ stable/12/tests/sys/file/closefrom_test.c Wed Aug 5 03:53:57 2020 (r363879) @@ -146,7 +146,7 @@ main(void) pid_t pid; int fd, i, start; - printf("1..15\n"); + printf("1..20\n"); /* We better start up with fd's 0, 1, and 2 open. */ start = devnull(); @@ -270,6 +270,60 @@ main(void) if (fd != 3) fail("closefrom", "highest fd %d", fd); ok("closefrom"); + + /* Chew up another 8 fd */ + for (i = 0; i < 8; i++) + (void)devnull(); + fd = highest_fd(); + start = fd - 7; + + /* close_range() a hole in the middle */ + close_range(start + 3, start + 5, 0); + for (i = start + 3; i < start + 6; ++i) { + if (close(i) == 0 || errno != EBADF) { + --i; + break; + } + } + if (i != start + 6) + fail("close_range", "failed to close at %d in %d - %d", i + 1, + start + 3, start + 6); + ok("close_range"); + + /* close_range from the middle of the hole */ + close_range(start + 4, start + 6, 0); + if ((i = highest_fd()) != fd) + fail("close_range", "highest fd %d", i); + ok("close_range"); + + /* close_range to the end; effectively closefrom(2) */ + close_range(start + 3, ~0L, 0); + if ((i = highest_fd()) != start + 2) + fail("close_range", "highest fd %d", i); + ok("close_range"); + + /* Now close the rest */ + close_range(start, start + 4, 0); + fd = highest_fd(); + if (fd != 3) + fail("close_range", "highest fd %d", fd); + ok("close_range"); + + /* Fork a child process to test closefrom(0) twice. */ + pid = fork(); + if (pid < 0) + fail_err("fork"); + if (pid == 0) { + /* Child. */ + closefrom(0); + closefrom(0); + cok(info, "closefrom(0)"); + } + if (wait(NULL) < 0) + fail_err("wait"); + if (info->failed) + fail(info->tag, "%s", info->message); + ok(info->tag); return (0); } From owner-svn-src-all@freebsd.org Wed Aug 5 05:58:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 39FA03AB522; Wed, 5 Aug 2020 05:58:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM1Bp0D40z4Ml8; Wed, 5 Aug 2020 05:58:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF585112F0; Wed, 5 Aug 2020 05:58:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0755wP2H080570; Wed, 5 Aug 2020 05:58:25 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0755wPJ6080569; Wed, 5 Aug 2020 05:58:25 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202008050558.0755wPJ6080569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 5 Aug 2020 05:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363880 - head/sys/dev/safexcel X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/dev/safexcel X-SVN-Commit-Revision: 363880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 05:58:26 -0000 Author: lwhsu Date: Wed Aug 5 05:58:25 2020 New Revision: 363880 URL: https://svnweb.freebsd.org/changeset/base/363880 Log: Appease gcc's -Wparentheses (and -Werror) Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/safexcel/safexcel.c Modified: head/sys/dev/safexcel/safexcel.c ============================================================================== --- head/sys/dev/safexcel/safexcel.c Wed Aug 5 03:53:57 2020 (r363879) +++ head/sys/dev/safexcel/safexcel.c Wed Aug 5 05:58:25 2020 (r363880) @@ -1635,7 +1635,7 @@ safexcel_instr_ccm(struct safexcel_request *req, struc b0 = (uint8_t *)instr; memset(b0, 0, blen); b0[0] = - L - 1 | /* payload length size */ + (L - 1) | /* payload length size */ ((CCM_CBC_MAX_DIGEST_LEN - 2) / 2) << 3 /* digest length */ | (crp->crp_aad_length > 0 ? 1 : 0) << 6 /* AAD present bit */; memcpy(&b0[1], req->iv, AES_CCM_IV_LEN); From owner-svn-src-all@freebsd.org Wed Aug 5 07:28:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68EF23ACD32; Wed, 5 Aug 2020 07:28:52 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3C81cXpz4RxF; Wed, 5 Aug 2020 07:28: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A82312A98; Wed, 5 Aug 2020 07:28: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 0757Sp3u037449; Wed, 5 Aug 2020 07:28:51 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757Spr9037448; Wed, 5 Aug 2020 07:28:51 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050728.0757Spr9037448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363881 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 07:28:52 -0000 Author: mjg Date: Wed Aug 5 07:28:51 2020 New Revision: 363881 URL: https://svnweb.freebsd.org/changeset/base/363881 Log: vfs: prefill nameidata with garbage on debug kernels Modified: head/sys/sys/namei.h Modified: head/sys/sys/namei.h ============================================================================== --- head/sys/sys/namei.h Wed Aug 5 05:58:25 2020 (r363880) +++ head/sys/sys/namei.h Wed Aug 5 07:28:51 2020 (r363881) @@ -196,11 +196,21 @@ int cache_fplookup(struct nameidata *ndp, enum cache_f #define NDINIT_ATVP(ndp, op, flags, segflg, namep, vp, td) \ NDINIT_ALL(ndp, op, flags, segflg, namep, AT_FDCWD, vp, &cap_no_rights, td) +/* + * Note the constant pattern may *hide* bugs. + */ +#ifdef INVARIANTS +#define NDINIT_PREFILL(arg) memset(arg, 0xff, sizeof(*arg)) +#else +#define NDINIT_PREFILL(arg) do { } while (0) +#endif + #define NDINIT_ALL(ndp, op, flags, segflg, namep, dirfd, startdir, rightsp, td) \ do { \ struct nameidata *_ndp = (ndp); \ cap_rights_t *_rightsp = (rightsp); \ MPASS(_rightsp != NULL); \ + NDINIT_PREFILL(_ndp); \ _ndp->ni_cnd.cn_nameiop = op; \ _ndp->ni_cnd.cn_flags = flags; \ _ndp->ni_segflg = segflg; \ From owner-svn-src-all@freebsd.org Wed Aug 5 07:30:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE0F93ACDF1; Wed, 5 Aug 2020 07:30:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3Dn5cmGz4S1Z; Wed, 5 Aug 2020 07:30:17 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A42A8127DD; Wed, 5 Aug 2020 07:30:17 +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 0757UHpZ037606; Wed, 5 Aug 2020 07:30:17 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757UHIh037605; Wed, 5 Aug 2020 07:30:17 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050730.0757UHIh037605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363882 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 07:30:17 -0000 Author: mjg Date: Wed Aug 5 07:30:17 2020 New Revision: 363882 URL: https://svnweb.freebsd.org/changeset/base/363882 Log: cache: stop messing with cn_flags This removes flag setting/unsetting carried over from regular lookup. Flags still get for compatibility when falling back. Note .. and . handling can get partially folded together. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 07:28:51 2020 (r363881) +++ head/sys/kern/vfs_cache.c Wed Aug 5 07:30:17 2020 (r363882) @@ -3098,7 +3098,30 @@ cache_fpl_handled_impl(struct cache_fpl *fpl, int erro (LOCKLEAF | LOCKPARENT | WANTPARENT | FOLLOW | LOCKSHARED | SAVENAME | \ ISOPEN | NOMACCHECK | AUDITVNODE1 | AUDITVNODE2) +#define CACHE_FPL_INTERNAL_CN_FLAGS \ + (ISDOTDOT | MAKEENTRY | ISLASTCN) + +_Static_assert((CACHE_FPL_SUPPORTED_CN_FLAGS & CACHE_FPL_INTERNAL_CN_FLAGS) == 0, + "supported and internal flags overlap"); + static bool +cache_fpl_islastcn(struct nameidata *ndp) +{ + + return (*ndp->ni_next == 0); +} + +static bool +cache_fpl_isdotdot(struct componentname *cnp) +{ + + if (cnp->cn_namelen == 2 && + cnp->cn_nameptr[1] == '.' && cnp->cn_nameptr[0] == '.') + return (true); + return (false); +} + +static bool cache_can_fplookup(struct cache_fpl *fpl) { struct nameidata *ndp; @@ -3253,15 +3276,17 @@ out_abort: /* * The target vnode is not supported, prepare for the slow path to take over. */ -static int +static int __noinline cache_fplookup_partial_setup(struct cache_fpl *fpl) { + struct nameidata *ndp; struct componentname *cnp; enum vgetstate dvs; struct vnode *dvp; struct pwd *pwd; seqc_t dvp_seqc; + ndp = fpl->ndp; cnp = fpl->cnp; dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; @@ -3287,8 +3312,15 @@ cache_fplookup_partial_setup(struct cache_fpl *fpl) return (cache_fpl_aborted(fpl)); } - fpl->ndp->ni_startdir = dvp; + cache_fpl_restore(fpl, &fpl->snd); + ndp->ni_startdir = dvp; + cnp->cn_flags |= MAKEENTRY; + if (cache_fpl_islastcn(ndp)) + cnp->cn_flags |= ISLASTCN; + if (cache_fpl_isdotdot(cnp)) + cnp->cn_flags |= ISDOTDOT; + return (0); } @@ -3763,18 +3795,6 @@ cache_fplookup_parse(struct cache_fpl *fpl) } ndp->ni_next = cp; - cnp->cn_flags |= MAKEENTRY; - - if (cnp->cn_namelen == 2 && - cnp->cn_nameptr[1] == '.' && cnp->cn_nameptr[0] == '.') - cnp->cn_flags |= ISDOTDOT; - else - cnp->cn_flags &= ~ISDOTDOT; - if (*ndp->ni_next == 0) - cnp->cn_flags |= ISLASTCN; - else - cnp->cn_flags &= ~ISLASTCN; - /* * Check for degenerate name (e.g. / or "") * which is a way of talking about a directory, @@ -3878,7 +3898,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp break; } - if (__predict_false(cnp->cn_flags & ISDOTDOT)) { + if (__predict_false(cache_fpl_isdotdot(cnp))) { error = cache_fplookup_dotdot(fpl); if (__predict_false(error != 0)) { break; @@ -3901,7 +3921,7 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp VNPASS(!seqc_in_modify(fpl->tvp_seqc), fpl->tvp); - if (cnp->cn_flags & ISLASTCN) { + if (cache_fpl_islastcn(ndp)) { error = cache_fplookup_final(fpl); break; } @@ -4082,7 +4102,9 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_s break; case CACHE_FPL_STATUS_PARTIAL: *pwdp = fpl.pwd; - cache_fpl_restore(&fpl, &fpl.snd); + /* + * Status restored by cache_fplookup_partial_setup. + */ break; case CACHE_FPL_STATUS_ABORTED: cache_fpl_restore(&fpl, &orig); From owner-svn-src-all@freebsd.org Wed Aug 5 07:30:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C88713ACCFC; Wed, 5 Aug 2020 07:30:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3FY51xWz4SFM; Wed, 5 Aug 2020 07:30:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 912B912A9D; Wed, 5 Aug 2020 07:30:57 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0757UvWq038415; Wed, 5 Aug 2020 07:30:57 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757UvPf038414; Wed, 5 Aug 2020 07:30:57 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050730.0757UvPf038414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363883 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363883 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 07:30:57 -0000 Author: mjg Date: Wed Aug 5 07:30:57 2020 New Revision: 363883 URL: https://svnweb.freebsd.org/changeset/base/363883 Log: cache: stop messing with cn_lkflags See r363882. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 07:30:17 2020 (r363882) +++ head/sys/kern/vfs_cache.c Wed Aug 5 07:30:57 2020 (r363883) @@ -3330,14 +3330,17 @@ cache_fplookup_final_child(struct cache_fpl *fpl, enum struct componentname *cnp; struct vnode *tvp; seqc_t tvp_seqc; - int error; + int error, lkflags; cnp = fpl->cnp; tvp = fpl->tvp; tvp_seqc = fpl->tvp_seqc; if ((cnp->cn_flags & LOCKLEAF) != 0) { - error = vget_finish(tvp, cnp->cn_lkflags, tvs); + lkflags = LK_SHARED; + if ((cnp->cn_flags & LOCKSHARED) == 0) + lkflags = LK_EXCLUSIVE; + error = vget_finish(tvp, lkflags, tvs); if (error != 0) { return (cache_fpl_aborted(fpl)); } @@ -3864,9 +3867,6 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp ndp = fpl->ndp; ndp->ni_lcf = 0; cnp = fpl->cnp; - cnp->cn_lkflags = LK_SHARED; - if ((cnp->cn_flags & LOCKSHARED) == 0) - cnp->cn_lkflags = LK_EXCLUSIVE; cache_fpl_checkpoint(fpl, &fpl->snd); From owner-svn-src-all@freebsd.org Wed Aug 5 07:32:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 022AE3ACFEB; Wed, 5 Aug 2020 07:32:27 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3HG6MBXz4SfK; Wed, 5 Aug 2020 07:32:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD7D112ABD; Wed, 5 Aug 2020 07:32:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0757WQbh043211; Wed, 5 Aug 2020 07:32:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757WQsS043210; Wed, 5 Aug 2020 07:32:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050732.0757WQsS043210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:32:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363884 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363884 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 07:32:27 -0000 Author: mjg Date: Wed Aug 5 07:32:26 2020 New Revision: 363884 URL: https://svnweb.freebsd.org/changeset/base/363884 Log: cache: cleanup lockless entry point - remove spurious bzero - assert ni_lcf, it has to be set by namei by this point Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 07:30:57 2020 (r363883) +++ head/sys/kern/vfs_cache.c Wed Aug 5 07:32:26 2020 (r363884) @@ -3033,6 +3033,12 @@ cache_fpl_restore(struct cache_fpl *fpl, struct nameid #define cache_fpl_smr_assert_not_entered(fpl) do { } while (0) #endif +#define cache_fpl_smr_enter_initial(fpl) ({ \ + struct cache_fpl *_fpl = (fpl); \ + vfs_smr_enter(); \ + _fpl->in_smr = true; \ +}) + #define cache_fpl_smr_enter(fpl) ({ \ struct cache_fpl *_fpl = (fpl); \ MPASS(_fpl->in_smr == false); \ @@ -3865,7 +3871,6 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fp error = CACHE_FPL_FAILED; ndp = fpl->ndp; - ndp->ni_lcf = 0; cnp = fpl->cnp; cache_fpl_checkpoint(fpl, &fpl->snd); @@ -4055,8 +4060,8 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_s struct nameidata_saved orig; int error; - *status = CACHE_FPL_STATUS_UNSET; - bzero(&fpl, sizeof(fpl)); + MPASS(ndp->ni_lcf == 0); + fpl.status = CACHE_FPL_STATUS_UNSET; fpl.ndp = ndp; fpl.cnp = &ndp->ni_cnd; @@ -4070,7 +4075,7 @@ cache_fplookup(struct nameidata *ndp, enum cache_fpl_s cache_fpl_checkpoint(&fpl, &orig); - cache_fpl_smr_enter(&fpl); + cache_fpl_smr_enter_initial(&fpl); pwd = pwd_get_smr(); fpl.pwd = pwd; ndp->ni_rootdir = pwd->pwd_rdir; From owner-svn-src-all@freebsd.org Wed Aug 5 07:33:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B5423AD25B; Wed, 5 Aug 2020 07:33:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3Jh2dhRz4Spr; Wed, 5 Aug 2020 07:33:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E7CF12D06; Wed, 5 Aug 2020 07:33:40 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0757XeVS043344; Wed, 5 Aug 2020 07:33:40 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757Xem6043343; Wed, 5 Aug 2020 07:33:40 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050733.0757Xem6043343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:33:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363885 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 07:33:40 -0000 Author: mjg Date: Wed Aug 5 07:33:39 2020 New Revision: 363885 URL: https://svnweb.freebsd.org/changeset/base/363885 Log: vfs: tidy up namei entry point - predict for string copy errors - reshuffle inititalistion of vars which are not needed Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Wed Aug 5 07:32:26 2020 (r363884) +++ head/sys/kern/vfs_lookup.c Wed Aug 5 07:33:39 2020 (r363885) @@ -297,6 +297,7 @@ namei_setup(struct nameidata *ndp, struct vnode **dpp, startdir_used = false; *pwdp = NULL; + *dpp = NULL; #ifdef CAPABILITY_MODE /* @@ -470,7 +471,6 @@ namei(struct nameidata *ndp) struct iovec aiov; /* uio for reading symbolic links */ struct componentname *cnp; struct thread *td; - struct proc *p; struct pwd *pwd; struct uio auio; int error, linklen; @@ -478,23 +478,19 @@ namei(struct nameidata *ndp) cnp = &ndp->ni_cnd; td = cnp->cn_thread; - p = td->td_proc; ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_thread->td_ucred; - KASSERT(cnp->cn_cred && p, ("namei: bad cred/proc")); + KASSERT(cnp->cn_cred && td->td_proc, ("namei: bad cred/proc")); KASSERT((cnp->cn_nameiop & (~OPMASK)) == 0, ("namei: nameiop contaminated with flags")); KASSERT((cnp->cn_flags & OPMASK) == 0, ("namei: flags contaminated with nameiops")); MPASS(ndp->ni_startdir == NULL || ndp->ni_startdir->v_type == VDIR || ndp->ni_startdir->v_type == VBAD); - TAILQ_INIT(&ndp->ni_cap_tracker); - ndp->ni_lcf = 0; - ndp->ni_loopcnt = 0; - dp = NULL; /* We will set this ourselves if we need it. */ cnp->cn_flags &= ~TRAILINGSLASH; + ndp->ni_lcf = 0; ndp->ni_vp = NULL; /* @@ -510,17 +506,15 @@ namei(struct nameidata *ndp) error = copyinstr(ndp->ni_dirp, cnp->cn_pnbuf, MAXPATHLEN, &ndp->ni_pathlen); - if (error != 0) { + if (__predict_false(error != 0)) { namei_cleanup_cnp(cnp); return (error); } - cnp->cn_nameptr = cnp->cn_pnbuf; - /* * Don't allow empty pathnames. */ - if (*cnp->cn_pnbuf == '\0') { + if (__predict_false(*cnp->cn_pnbuf == '\0')) { namei_cleanup_cnp(cnp); return (ENOENT); } @@ -533,6 +527,8 @@ namei(struct nameidata *ndp) } #endif + cnp->cn_nameptr = cnp->cn_pnbuf; + /* * First try looking up the target without locking any vnodes. * @@ -546,9 +542,11 @@ namei(struct nameidata *ndp) case CACHE_FPL_STATUS_HANDLED: return (error); case CACHE_FPL_STATUS_PARTIAL: + TAILQ_INIT(&ndp->ni_cap_tracker); dp = ndp->ni_startdir; break; case CACHE_FPL_STATUS_ABORTED: + TAILQ_INIT(&ndp->ni_cap_tracker); error = namei_setup(ndp, &dp, &pwd); if (error != 0) { namei_cleanup_cnp(cnp); @@ -556,6 +554,8 @@ namei(struct nameidata *ndp) } break; } + + ndp->ni_loopcnt = 0; /* * Locked lookup. From owner-svn-src-all@freebsd.org Wed Aug 5 07:34:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 38BF23AD2C2; Wed, 5 Aug 2020 07:34:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM3Ky0qpVz4SpM; Wed, 5 Aug 2020 07:34: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3E9912D07; Wed, 5 Aug 2020 07:34:45 +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 0757YjfR043439; Wed, 5 Aug 2020 07:34:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0757Yjl9043437; Wed, 5 Aug 2020 07:34:45 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050734.0757Yjl9043437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 07:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363886 - head/sys/security/mac X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/security/mac X-SVN-Commit-Revision: 363886 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 07:34:46 -0000 Author: mjg Date: Wed Aug 5 07:34:45 2020 New Revision: 363886 URL: https://svnweb.freebsd.org/changeset/base/363886 Log: vfs: add a cheaper entry for mac_vnode_check_access Modified: head/sys/security/mac/mac_framework.c head/sys/security/mac/mac_framework.h head/sys/security/mac/mac_vfs.c Modified: head/sys/security/mac/mac_framework.c ============================================================================== --- head/sys/security/mac/mac_framework.c Wed Aug 5 07:33:39 2020 (r363885) +++ head/sys/security/mac/mac_framework.c Wed Aug 5 07:34:45 2020 (r363886) @@ -140,6 +140,7 @@ FPFLAG(vnode_check_write); FPFLAG(vnode_check_mmap); FPFLAG_RARE(vnode_check_poll); FPFLAG_RARE(vnode_check_rename_from); +FPFLAG_RARE(vnode_check_access); #undef FPFLAG #undef FPFLAG_RARE @@ -430,6 +431,8 @@ struct mac_policy_fastpath_elem mac_policy_fastpath_ar .flag = &mac_vnode_check_poll_fp_flag }, { .offset = FPO(vnode_check_rename_from), .flag = &mac_vnode_check_rename_from_fp_flag }, + { .offset = FPO(vnode_check_access), + .flag = &mac_vnode_check_access_fp_flag }, }; static void Modified: head/sys/security/mac/mac_framework.h ============================================================================== --- head/sys/security/mac/mac_framework.h Wed Aug 5 07:33:39 2020 (r363885) +++ head/sys/security/mac/mac_framework.h Wed Aug 5 07:34:45 2020 (r363886) @@ -406,8 +406,20 @@ void mac_vnode_assert_locked(struct vnode *vp, const c int mac_vnode_associate_extattr(struct mount *mp, struct vnode *vp); void mac_vnode_associate_singlelabel(struct mount *mp, struct vnode *vp); -int mac_vnode_check_access(struct ucred *cred, struct vnode *vp, +int mac_vnode_check_access_impl(struct ucred *cred, struct vnode *dvp, accmode_t accmode); +extern bool mac_vnode_check_access_fp_flag; +#define mac_vnode_check_access_enabled() __predict_false(mac_vnode_check_access_fp_flag) +static inline int +mac_vnode_check_access(struct ucred *cred, struct vnode *dvp, + accmode_t accmode) +{ + + mac_vnode_assert_locked(dvp, "mac_vnode_check_access"); + if (mac_vnode_check_access_enabled()) + return (mac_vnode_check_access_impl(cred, dvp, accmode)); + return (0); +} int mac_vnode_check_chdir(struct ucred *cred, struct vnode *dvp); int mac_vnode_check_chroot(struct ucred *cred, struct vnode *dvp); int mac_vnode_check_create(struct ucred *cred, struct vnode *dvp, Modified: head/sys/security/mac/mac_vfs.c ============================================================================== --- head/sys/security/mac/mac_vfs.c Wed Aug 5 07:33:39 2020 (r363885) +++ head/sys/security/mac/mac_vfs.c Wed Aug 5 07:34:45 2020 (r363886) @@ -372,7 +372,7 @@ MAC_CHECK_PROBE_DEFINE3(vnode_check_access, "struct uc "struct vnode *", "accmode_t"); int -mac_vnode_check_access(struct ucred *cred, struct vnode *vp, accmode_t accmode) +mac_vnode_check_access_impl(struct ucred *cred, struct vnode *vp, accmode_t accmode) { int error; From owner-svn-src-all@freebsd.org Wed Aug 5 08:31:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A2173AE44F; Wed, 5 Aug 2020 08:31:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM4bM20X3z4WVB; Wed, 5 Aug 2020 08:31:27 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1401813621; Wed, 5 Aug 2020 08:31:27 +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 0758VQIg078931; Wed, 5 Aug 2020 08:31:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0758VQae078930; Wed, 5 Aug 2020 08:31:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202008050831.0758VQae078930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 5 Aug 2020 08:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363887 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 363887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 08:31:27 -0000 Author: manu Date: Wed Aug 5 08:31:26 2020 New Revision: 363887 URL: https://svnweb.freebsd.org/changeset/base/363887 Log: allwinner: clk: Fix nm clock calculation Use the right factor when finding the best frequency and compare the absolute value of the result. Submitted by: kibab MFC after: 3 days Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Wed Aug 5 07:34:45 2020 (r363886) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Wed Aug 5 08:31:26 2020 (r363887) @@ -151,7 +151,7 @@ aw_clk_nm_find_best(struct aw_clk_nm_sc *sc, uint64_t min_n = aw_clk_factor_get_min(&sc->n); for (m = min_m; m <= max_m; ) { - for (n = min_m; n <= max_n; ) { + for (n = min_n; n <= max_n; ) { cur = fparent / n / m; if (abs(*fout - cur) < abs(*fout - best)) { best = cur; @@ -196,7 +196,7 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare clknode_get_freq(p_clk, &fparent); cur = aw_clk_nm_find_best(sc, fparent, fout, &n, &m); - if ((*fout - cur) < (*fout - best)) { + if (abs((*fout - cur)) < abs((*fout - best))) { best = cur; best_parent = p_idx; best_n = n; From owner-svn-src-all@freebsd.org Wed Aug 5 09:16:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C4C63AF341; Wed, 5 Aug 2020 09:16:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5bS0wLvz4YtJ; Wed, 5 Aug 2020 09:16:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 043AF13D9B; Wed, 5 Aug 2020 09:16:36 +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 0759GZwI004790; Wed, 5 Aug 2020 09:16:35 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759GZBG004789; Wed, 5 Aug 2020 09:16:35 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008050916.0759GZBG004789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 09:16:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363888 - head/sys/netpfil/ipfw/nat64 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 363888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 09:16:36 -0000 Author: ae Date: Wed Aug 5 09:16:35 2020 New Revision: 363888 URL: https://svnweb.freebsd.org/changeset/base/363888 Log: Handle delayed checksums if needed in NAT64. Upper level protocols defer checksums calculation in hope we have checksums offloading in a network card. CSUM_DELAY_DATA flag is used to determine that checksum calculation was deferred. And IP output routine checks for this flag before pass mbuf to lower layer. Forwarded packets have not this flag. NAT64 uses checksums adjustment when it translates IP headers. In most cases NAT64 is used for forwarded packets, but in case when it handles locally originated packets we need to finish checksum calculation that was deferred to correctly adjust it. Add check for presence of CSUM_DELAY_DATA flag and finish checksum calculation before adjustment. Reported and tested by: Evgeniy Khramtsov MFC after: 1 week Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.c Wed Aug 5 08:31:26 2020 (r363887) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.c Wed Aug 5 09:16:35 2020 (r363888) @@ -1294,6 +1294,12 @@ nat64_do_handle_ip4(struct mbuf *m, struct in6_addr *s ip6.ip6_hlim -= IPTTLDEC; ip6.ip6_plen = htons(plen); ip6.ip6_nxt = (proto == IPPROTO_ICMP) ? IPPROTO_ICMPV6: proto; + + /* Handle delayed checksums if needed. */ + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { + in_delayed_cksum(m); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; + } /* Convert checksums. */ switch (proto) { case IPPROTO_TCP: @@ -1665,6 +1671,12 @@ nat64_do_handle_ip6(struct mbuf *m, uint32_t aaddr, ui return (NAT64RETURN); } nat64_init_ip4hdr(ip6, frag, plen, proto, &ip); + + /* Handle delayed checksums if needed. */ + if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA_IPV6) { + in6_delayed_cksum(m, plen, hlen); + m->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA_IPV6; + } /* Convert checksums. */ switch (proto) { case IPPROTO_TCP: From owner-svn-src-all@freebsd.org Wed Aug 5 09:19:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F5673AF573; Wed, 5 Aug 2020 09:19:42 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5g202Yyz4Z3b; Wed, 5 Aug 2020 09:19:42 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D496A13BC6; Wed, 5 Aug 2020 09:19:41 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0759Jfnl005112; Wed, 5 Aug 2020 09:19:41 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759JfU5005111; Wed, 5 Aug 2020 09:19:41 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202008050919.0759JfU5005111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Wed, 5 Aug 2020 09:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363889 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Commit-Revision: 363889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 09:19:42 -0000 Author: eugen Date: Wed Aug 5 09:19:41 2020 New Revision: 363889 URL: https://svnweb.freebsd.org/changeset/base/363889 Log: bsnmptools: make it print protocol errors to stderr instead of stdout Reviewed by: syrinx, bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25911 Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Aug 5 09:16:35 2020 (r363888) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Wed Aug 5 09:19:41 2020 (r363889) @@ -1828,11 +1828,11 @@ snmp_output_numval(struct snmp_toolinfo *snmptoolctx, break; case SNMP_SYNTAX_NOSUCHOBJECT: - fprintf(stdout, "No Such Object\n"); + fprintf(stderr, "No Such Object\n"); return (val->syntax); case SNMP_SYNTAX_NOSUCHINSTANCE: - fprintf(stdout, "No Such Instance\n"); + fprintf(stderr, "No Such Instance\n"); return (val->syntax); case SNMP_SYNTAX_ENDOFMIBVIEW: @@ -1841,12 +1841,12 @@ snmp_output_numval(struct snmp_toolinfo *snmptoolctx, case SNMP_SYNTAX_NULL: /* NOTREACHED */ - fprintf(stdout, "agent returned NULL Syntax\n"); + fprintf(stderr, "agent returned NULL Syntax\n"); return (val->syntax); default: /* NOTREACHED - If here - then all went completely wrong. */ - fprintf(stdout, "agent returned unknown syntax\n"); + fprintf(stderr, "agent returned unknown syntax\n"); return (-1); } From owner-svn-src-all@freebsd.org Wed Aug 5 09:24:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8FB83AF367; Wed, 5 Aug 2020 09:24:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5m05vPhz4ZXV; Wed, 5 Aug 2020 09:24:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADB5413E60; Wed, 5 Aug 2020 09:24:00 +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 0759O0Mg010837; Wed, 5 Aug 2020 09:24:00 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759O0nY010836; Wed, 5 Aug 2020 09:24:00 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050924.0759O0nY010836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363890 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 09:24:01 -0000 Author: mjg Date: Wed Aug 5 09:24:00 2020 New Revision: 363890 URL: https://svnweb.freebsd.org/changeset/base/363890 Log: cache: convert ncnegnash into a macro It is a read-only var with value known at compilation time. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 09:19:41 2020 (r363889) +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:24:00 2020 (r363890) @@ -284,8 +284,8 @@ static struct neglist __read_mostly *neglists; static struct neglist ncneg_hot; static u_long numhotneg; -#define numneglists (ncneghash + 1) -static u_int __read_mostly ncneghash; +#define ncneghash 3 +#define numneglists (ncneghash + 1) static inline struct neglist * NCP2NEGLIST(struct namecache *ncp) { @@ -2091,7 +2091,6 @@ nchinit(void *dummy __unused) mtx_init(&vnodelocks[i], "ncvn", NULL, MTX_DUPOK | MTX_RECURSE); ncpurgeminvnodes = numbucketlocks * 2; - ncneghash = 3; neglists = malloc(sizeof(*neglists) * numneglists, M_VFSCACHE, M_WAITOK | M_ZERO); for (i = 0; i < numneglists; i++) { From owner-svn-src-all@freebsd.org Wed Aug 5 09:24:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C7A03AF999; Wed, 5 Aug 2020 09:24:39 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5mk745Xz4ZYY; Wed, 5 Aug 2020 09:24:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD0CB13E61; Wed, 5 Aug 2020 09:24:38 +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 0759OcrW010910; Wed, 5 Aug 2020 09:24:38 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759Oc3H010909; Wed, 5 Aug 2020 09:24:38 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050924.0759Oc3H010909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363891 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 09:24:39 -0000 Author: mjg Date: Wed Aug 5 09:24:38 2020 New Revision: 363891 URL: https://svnweb.freebsd.org/changeset/base/363891 Log: cache: reduce zone alignment to 8 bytes It used to be sizeof of the given struct to accomodate for 32 bit mips doing 64 bit loads, but the same can be achieved with requireing just 64 bit alignment. While here reorder struct namecache so that most commonly used fields are closer. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 09:24:00 2020 (r363890) +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:24:38 2020 (r363891) @@ -122,9 +122,9 @@ _Static_assert(sizeof(struct negstate) <= sizeof(struc "the state must fit in a union with a pointer without growing it"); struct namecache { - CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ + CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ struct vnode *nc_dvp; /* vnode of parent of name */ union { struct vnode *nu_vp; /* vnode the name refers to */ @@ -142,6 +142,8 @@ struct namecache { * to be stored. The nc_dotdottime field is used when a cache entry is mapping * both a non-dotdot directory name plus dotdot for the directory's * parent. + * + * See below for alignment requirement. */ struct namecache_ts { struct timespec nc_time; /* timespec provided by fs */ @@ -150,6 +152,14 @@ struct namecache_ts { struct namecache nc_nc; }; +/* + * At least mips n32 performs 64-bit accesses to timespec as found + * in namecache_ts and requires them to be aligned. Since others + * may be in the same spot suffer a little bit and enforce the + * alignment for everyone. Note this is a nop for 64-bit platforms. + */ +#define CACHE_ZONE_ALIGNMENT UMA_ALIGNOF(time_t) + #define nc_vp n_un.nu_vp #define nc_neg n_un.nu_neg @@ -2053,19 +2063,19 @@ nchinit(void *dummy __unused) cache_zone_small = uma_zcreate("S VFS Cache", sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1, - NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache), + NULL, NULL, NULL, NULL, CACHE_ZONE_ALIGNMENT, UMA_ZONE_ZINIT); cache_zone_small_ts = uma_zcreate("STS VFS Cache", sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1, - NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), + NULL, NULL, NULL, NULL, CACHE_ZONE_ALIGNMENT, UMA_ZONE_ZINIT); cache_zone_large = uma_zcreate("L VFS Cache", sizeof(struct namecache) + NAME_MAX + 1, - NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache), + NULL, NULL, NULL, NULL, CACHE_ZONE_ALIGNMENT, UMA_ZONE_ZINIT); cache_zone_large_ts = uma_zcreate("LTS VFS Cache", sizeof(struct namecache_ts) + NAME_MAX + 1, - NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts), + NULL, NULL, NULL, NULL, CACHE_ZONE_ALIGNMENT, UMA_ZONE_ZINIT); VFS_SMR_ZONE_SET(cache_zone_small); From owner-svn-src-all@freebsd.org Wed Aug 5 09:25:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F06123AFA8B; Wed, 5 Aug 2020 09:25:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5pH66bzz4Znf; Wed, 5 Aug 2020 09:25:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4F1413D4F; Wed, 5 Aug 2020 09:25:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0759Pxeo011022; Wed, 5 Aug 2020 09:25:59 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759Px4U011021; Wed, 5 Aug 2020 09:25:59 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050925.0759Px4U011021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363892 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 09:26:00 -0000 Author: mjg Date: Wed Aug 5 09:25:59 2020 New Revision: 363892 URL: https://svnweb.freebsd.org/changeset/base/363892 Log: cache: convert the hash from LIST to SLIST This reduces struct namecache by sizeof(void *). Negative side is that we have to find the previous element (if any) when removing an entry, but since we normally don't expect collisions it should be fine. Note this adds cache_get_hash calls which can be eliminated. Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 09:24:38 2020 (r363891) +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:25:59 2020 (r363892) @@ -124,7 +124,7 @@ _Static_assert(sizeof(struct negstate) <= sizeof(struc struct namecache { LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ - CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ + CK_SLIST_ENTRY(namecache) nc_hash;/* hash chain */ struct vnode *nc_dvp; /* vnode of parent of name */ union { struct vnode *nu_vp; /* vnode the name refers to */ @@ -264,7 +264,7 @@ VFS_SMR_DECLARE; */ #define NCHHASH(hash) \ (&nchashtbl[(hash) & nchash]) -static __read_mostly CK_LIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table */ +static __read_mostly CK_SLIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table */ static u_long __read_mostly nchash; /* size of hash table */ SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, &nchash, 0, "Size of namecache hash table"); @@ -520,6 +520,15 @@ cache_get_hash(char *name, u_char len, struct vnode *d return (fnv_32_buf(name, len, dvp->v_nchash)); } +static inline struct nchashhead * +NCP2BUCKET(struct namecache *ncp) +{ + uint32_t hash; + + hash = cache_get_hash(ncp->nc_name, ncp->nc_nlen, ncp->nc_dvp); + return (NCHHASH(hash)); +} + static inline struct rwlock * NCP2BUCKETLOCK(struct namecache *ncp) { @@ -687,7 +696,7 @@ retry: } /* Scan hash tables counting entries */ for (ncpp = nchashtbl, i = 0; i < n_nchash; ncpp++, i++) - CK_LIST_FOREACH(ncp, ncpp, nc_hash) + CK_SLIST_FOREACH(ncp, ncpp, nc_hash) cntbuf[i]++; cache_unlock_all_buckets(); for (error = 0, i = 0; i < n_nchash; i++) @@ -720,7 +729,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HANDLER_ARGS) /* Scan hash tables for applicable entries */ for (ncpp = nchashtbl; n_nchash > 0; n_nchash--, ncpp++) { count = 0; - CK_LIST_FOREACH(ncp, ncpp, nc_hash) { + CK_SLIST_FOREACH(ncp, ncpp, nc_hash) { count++; } if (count) @@ -952,6 +961,7 @@ cache_negative_zap_one(void) static void cache_zap_locked(struct namecache *ncp) { + struct nchashhead *ncpp; if (!(ncp->nc_flag & NCF_NEGATIVE)) cache_assert_vnode_locked(ncp->nc_vp); @@ -963,7 +973,8 @@ cache_zap_locked(struct namecache *ncp) cache_ncp_invalidate(ncp); - CK_LIST_REMOVE(ncp, nc_hash); + ncpp = NCP2BUCKET(ncp); + CK_SLIST_REMOVE(ncpp, ncp, namecache, nc_hash); if (!(ncp->nc_flag & NCF_NEGATIVE)) { SDT_PROBE3(vfs, namecache, zap, done, ncp->nc_dvp, ncp->nc_name, ncp->nc_vp); @@ -1122,7 +1133,7 @@ cache_zap_unlocked_bucket(struct namecache *ncp, struc cache_sort_vnodes(&dvlp, &vlp); cache_lock_vnodes(dvlp, vlp); rw_wlock(blp); - CK_LIST_FOREACH(rncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(rncp, (NCHHASH(hash)), nc_hash) { if (rncp == ncp && rncp->nc_dvp == dvp && rncp->nc_nlen == cnp->cn_namelen && !bcmp(rncp->nc_name, cnp->cn_nameptr, rncp->nc_nlen)) @@ -1336,12 +1347,12 @@ retry_dotdot: hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); blp = HASH2BUCKETLOCK(hash); retry: - if (CK_LIST_EMPTY(NCHHASH(hash))) + if (CK_SLIST_EMPTY(NCHHASH(hash))) goto out_no_entry; rw_wlock(blp); - CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) break; @@ -1485,7 +1496,7 @@ retry_hashed: rw_rlock(blp); } - CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) break; @@ -1932,7 +1943,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * the same path name. */ ncpp = NCHHASH(hash); - CK_LIST_FOREACH(n2, ncpp, nc_hash) { + CK_SLIST_FOREACH(n2, ncpp, nc_hash) { if (n2->nc_dvp == dvp && n2->nc_nlen == cnp->cn_namelen && !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { @@ -2021,7 +2032,7 @@ cache_enter_time(struct vnode *dvp, struct vnode *vp, * Insert the new namecache entry into the appropriate chain * within the cache entries table. */ - CK_LIST_INSERT_HEAD(ncpp, ncp, nc_hash); + CK_SLIST_INSERT_HEAD(ncpp, ncp, nc_hash); atomic_thread_fence_rel(); /* @@ -2053,6 +2064,28 @@ cache_roundup_2(u_int val) return (res); } +static struct nchashhead * +nchinittbl(u_long elements, u_long *hashmask) +{ + struct nchashhead *hashtbl; + u_long hashsize, i; + + hashsize = cache_roundup_2(desiredvnodes * 2) / 2; + + hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), M_VFSCACHE, M_WAITOK); + for (i = 0; i < hashsize; i++) + CK_SLIST_INIT(&hashtbl[i]); + *hashmask = hashsize - 1; + return (hashtbl); +} + +static void +ncfreetbl(struct nchashhead *hashtbl) +{ + + free(hashtbl, M_VFSCACHE); +} + /* * Name cache initialization, from vfs_init() when we are booting */ @@ -2084,7 +2117,7 @@ nchinit(void *dummy __unused) VFS_SMR_ZONE_SET(cache_zone_large_ts); ncsize = desiredvnodes * ncsizefactor; - nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); + nchashtbl = nchinittbl(desiredvnodes * 2, &nchash); ncbuckethash = cache_roundup_2(mp_ncpus * mp_ncpus) - 1; if (ncbuckethash < 7) /* arbitrarily chosen to avoid having one lock */ ncbuckethash = 7; @@ -2139,10 +2172,10 @@ cache_changesize(u_long newmaxvnodes) if (newmaxvnodes < numbucketlocks) newmaxvnodes = numbucketlocks; - new_nchashtbl = hashinit(newmaxvnodes, M_VFSCACHE, &new_nchash); + new_nchashtbl = nchinittbl(newmaxvnodes, &new_nchash); /* If same hash table size, nothing to do */ if (nchash == new_nchash) { - free(new_nchashtbl, M_VFSCACHE); + ncfreetbl(new_nchashtbl); return; } /* @@ -2157,17 +2190,17 @@ cache_changesize(u_long newmaxvnodes) nchashtbl = new_nchashtbl; nchash = new_nchash; for (i = 0; i <= old_nchash; i++) { - while ((ncp = CK_LIST_FIRST(&old_nchashtbl[i])) != NULL) { + while ((ncp = CK_SLIST_FIRST(&old_nchashtbl[i])) != NULL) { hash = cache_get_hash(ncp->nc_name, ncp->nc_nlen, ncp->nc_dvp); - CK_LIST_REMOVE(ncp, nc_hash); - CK_LIST_INSERT_HEAD(NCHHASH(hash), ncp, nc_hash); + CK_SLIST_REMOVE(&old_nchashtbl[i], ncp, namecache, nc_hash); + CK_SLIST_INSERT_HEAD(NCHHASH(hash), ncp, nc_hash); } } ncsize = newncsize; cache_unlock_all_buckets(); cache_unlock_all_vnodes(); - free(old_nchashtbl, M_VFSCACHE); + ncfreetbl(old_nchashtbl); } /* @@ -2317,7 +2350,7 @@ cache_purgevfs(struct mount *mp, bool force) for (j = i; j < n_nchash; j += numbucketlocks) { retry: bucket = &nchashtbl[j]; - CK_LIST_FOREACH_SAFE(ncp, bucket, nc_hash, nnp) { + CK_SLIST_FOREACH_SAFE(ncp, bucket, nc_hash, nnp) { cache_assert_bucket_locked(ncp, RA_WLOCKED); if (ncp->nc_dvp->v_mount != mp) continue; @@ -3233,7 +3266,7 @@ cache_fplookup_negative_promote(struct cache_fpl *fpl, * In particular at this point there can be a new ncp which matches the * search but hashes to a different neglist. */ - CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp == oncp) break; } @@ -3583,7 +3616,7 @@ cache_fplookup_next(struct cache_fpl *fpl) hash = cache_get_hash(cnp->cn_nameptr, cnp->cn_namelen, dvp); - CK_LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { + CK_SLIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) break; From owner-svn-src-all@freebsd.org Wed Aug 5 09:27:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4EE643AF839; Wed, 5 Aug 2020 09:27:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5qb1nS3z4ZxT; Wed, 5 Aug 2020 09:27:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2093413BEE; Wed, 5 Aug 2020 09:27:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0759R7CU011135; Wed, 5 Aug 2020 09:27:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759R3FN011116; Wed, 5 Aug 2020 09:27:03 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050927.0759R3FN011116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363893 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient fs/pseudofs fs/smbfs fs/tmpfs fs/udf kern sys ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/devfs fs/ext2fs fs/fuse fs/msdosfs fs/nfsclient fs/pseudofs fs/smbfs fs/tmpfs fs/udf kern sys ufs/ufs X-SVN-Commit-Revision: 363893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 09:27:07 -0000 Author: mjg Date: Wed Aug 5 09:27:03 2020 New Revision: 363893 URL: https://svnweb.freebsd.org/changeset/base/363893 Log: vfs: remove the obsolete privused argument from vaccess This brings argument count down to 6, which is passable without the stack on amd64. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/cd9660/cd9660_vnops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/fuse/fuse_internal.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/pseudofs/pseudofs_vnops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/udf/udf_vnops.c head/sys/kern/subr_acl_nfs4.c head/sys/kern/subr_acl_posix1e.c head/sys/kern/uipc_mqueue.c head/sys/kern/uipc_sem.c head/sys/kern/uipc_shm.c head/sys/kern/vfs_subr.c head/sys/sys/vnode.h head/sys/ufs/ufs/ufs_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 Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -4941,7 +4941,7 @@ zfs_freebsd_access(ap) accmode = ap->a_accmode & ~(VREAD|VWRITE|VEXEC|VAPPEND); if (accmode != 0) { error = vaccess(vp->v_type, zp->z_mode, zp->z_uid, - zp->z_gid, accmode, ap->a_cred, NULL); + zp->z_gid, accmode, ap->a_cred); } } Modified: head/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- head/sys/fs/cd9660/cd9660_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/cd9660/cd9660_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -158,7 +158,7 @@ cd9660_access(ap) } return (vaccess(vp->v_type, ip->inode.iso_mode, ip->inode.iso_uid, - ip->inode.iso_gid, ap->a_accmode, ap->a_cred, NULL)); + ip->inode.iso_gid, ap->a_accmode, ap->a_cred)); } static int Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/devfs/devfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -533,7 +533,7 @@ devfs_access(struct vop_access_args *ap) de = de->de_dir; error = vaccess(vp->v_type, de->de_mode, de->de_uid, de->de_gid, - ap->a_accmode, ap->a_cred, NULL); + ap->a_accmode, ap->a_cred); if (error == 0) return (0); if (error != EACCES) Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/ext2fs/ext2_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -348,7 +348,7 @@ ext2_access(struct vop_access_args *ap) return (EPERM); error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid, - ap->a_accmode, ap->a_cred, NULL); + ap->a_accmode, ap->a_cred); return (error); } Modified: head/sys/fs/fuse/fuse_internal.c ============================================================================== --- head/sys/fs/fuse/fuse_internal.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/fuse/fuse_internal.c Wed Aug 5 09:27:03 2020 (r363893) @@ -208,7 +208,7 @@ fuse_internal_access(struct vnode *vp, fuse_internal_getattr(vp, &va, cred, td); return vaccess(vp->v_type, va.va_mode, va.va_uid, - va.va_gid, mode, cred, NULL); + va.va_gid, mode, cred); } if (mode & VADMIN) { Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -250,7 +250,7 @@ msdosfs_access(struct vop_access_args *ap) } return (vaccess(vp->v_type, file_mode, pmp->pm_uid, pmp->pm_gid, - ap->a_accmode, ap->a_cred, NULL)); + ap->a_accmode, ap->a_cred)); } static int Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -3393,8 +3393,8 @@ nfsspec_access(struct vop_access_args *ap) error = VOP_GETATTR(vp, vap, cred); if (error) goto out; - error = vaccess(vp->v_type, vap->va_mode, vap->va_uid, vap->va_gid, - accmode, cred, NULL); + error = vaccess(vp->v_type, vap->va_mode, vap->va_uid, vap->va_gid, + accmode, cred); out: return error; } Modified: head/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- head/sys/fs/pseudofs/pseudofs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/pseudofs/pseudofs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -167,8 +167,8 @@ pfs_access(struct vop_access_args *va) error = VOP_GETATTR(vn, &vattr, va->a_cred); if (error) PFS_RETURN (error); - error = vaccess(vn->v_type, vattr.va_mode, vattr.va_uid, - vattr.va_gid, va->a_accmode, va->a_cred, NULL); + error = vaccess(vn->v_type, vattr.va_mode, vattr.va_uid, vattr.va_gid, + va->a_accmode, va->a_cred); PFS_RETURN (error); } Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/smbfs/smbfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -141,7 +141,7 @@ smbfs_access(ap) } mpmode = vp->v_type == VREG ? smp->sm_file_mode : smp->sm_dir_mode; return (vaccess(vp->v_type, mpmode, smp->sm_uid, - smp->sm_gid, ap->a_accmode, ap->a_cred, NULL)); + smp->sm_gid, ap->a_accmode, ap->a_cred)); } /* ARGSUSED */ Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -396,8 +396,8 @@ tmpfs_access(struct vop_access_args *v) goto out; } - error = vaccess(vp->v_type, node->tn_mode, node->tn_uid, - node->tn_gid, accmode, cred, NULL); + error = vaccess(vp->v_type, node->tn_mode, node->tn_uid, node->tn_gid, + accmode, cred); out: MPASS(VOP_ISLOCKED(vp)); Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/fs/udf/udf_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -180,7 +180,7 @@ udf_access(struct vop_access_args *a) mode = udf_permtomode(node); return (vaccess(vp->v_type, mode, node->fentry->uid, node->fentry->gid, - accmode, a->a_cred, NULL)); + accmode, a->a_cred)); } static int Modified: head/sys/kern/subr_acl_nfs4.c ============================================================================== --- head/sys/kern/subr_acl_nfs4.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/subr_acl_nfs4.c Wed Aug 5 09:27:03 2020 (r363893) @@ -172,7 +172,7 @@ _acl_denies(const struct acl *aclp, int access_mask, s int vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_t file_gid, - struct acl *aclp, accmode_t accmode, struct ucred *cred, int *privused) + struct acl *aclp, accmode_t accmode, struct ucred *cred) { accmode_t priv_granted = 0; int denied, explicitly_denied, access_mask, is_directory, @@ -187,9 +187,6 @@ vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_ KASSERT((accmode & VAPPEND) == 0 || (accmode & VWRITE), ("VAPPEND without VWRITE")); - if (privused != NULL) - *privused = 0; - if (accmode & VADMIN) must_be_owner = 1; @@ -289,9 +286,6 @@ vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_ priv_granted |= VSTAT_PERMS; if ((accmode & priv_granted) == accmode) { - if (privused != NULL) - *privused = 1; - return (0); } Modified: head/sys/kern/subr_acl_posix1e.c ============================================================================== --- head/sys/kern/subr_acl_posix1e.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/subr_acl_posix1e.c Wed Aug 5 09:27:03 2020 (r363893) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); */ int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, gid_t file_gid, - struct acl *acl, accmode_t accmode, struct ucred *cred, int *privused) + struct acl *acl, accmode_t accmode, struct ucred *cred) { struct acl_entry *acl_other, *acl_mask; accmode_t dac_granted; @@ -77,8 +77,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g * privileges to use may be ambiguous due to "best match", in which * case fall back on first match for the time being. */ - if (privused != NULL) - *privused = 0; /* * Determine privileges now, but don't apply until we've found a DAC @@ -142,8 +140,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g */ if ((accmode & (dac_granted | priv_granted)) == accmode) { - if (privused != NULL) - *privused = 1; return (0); } goto error; @@ -220,8 +216,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g accmode) goto error; - if (privused != NULL) - *privused = 1; return (0); } } @@ -303,8 +297,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g != accmode) break; - if (privused != NULL) - *privused = 1; return (0); case ACL_GROUP: @@ -327,8 +319,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g != accmode) break; - if (privused != NULL) - *privused = 1; return (0); default: @@ -359,8 +349,6 @@ vaccess_acl_posix1e(enum vtype type, uid_t file_uid, g * XXXRW: Do privilege lookup here. */ if ((accmode & (dac_granted | priv_granted)) == accmode) { - if (privused != NULL) - *privused = 1; return (0); } Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/uipc_mqueue.c Wed Aug 5 09:27:03 2020 (r363893) @@ -1178,8 +1178,8 @@ mqfs_access(struct vop_access_args *ap) error = VOP_GETATTR(vp, &vattr, ap->a_cred); if (error) return (error); - error = vaccess(vp->v_type, vattr.va_mode, vattr.va_uid, - vattr.va_gid, ap->a_accmode, ap->a_cred, NULL); + error = vaccess(vp->v_type, vattr.va_mode, vattr.va_uid, vattr.va_gid, + ap->a_accmode, ap->a_cred); return (error); } @@ -2088,7 +2088,7 @@ kern_kmq_open(struct thread *td, const char *upath, in if (flags & FWRITE) accmode |= VWRITE; error = vaccess(VREG, pn->mn_mode, pn->mn_uid, - pn->mn_gid, accmode, td->td_ucred, NULL); + pn->mn_gid, accmode, td->td_ucred); } } @@ -2566,7 +2566,7 @@ mqf_chmod(struct file *fp, mode_t mode, struct ucred * pn = fp->f_data; sx_xlock(&mqfs_data.mi_lock); error = vaccess(VREG, pn->mn_mode, pn->mn_uid, pn->mn_gid, VADMIN, - active_cred, NULL); + active_cred); if (error != 0) goto out; pn->mn_mode = mode & ACCESSPERMS; Modified: head/sys/kern/uipc_sem.c ============================================================================== --- head/sys/kern/uipc_sem.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/uipc_sem.c Wed Aug 5 09:27:03 2020 (r363893) @@ -212,7 +212,7 @@ ksem_chmod(struct file *fp, mode_t mode, struct ucred goto out; #endif error = vaccess(VREG, ks->ks_mode, ks->ks_uid, ks->ks_gid, VADMIN, - active_cred, NULL); + active_cred); if (error != 0) goto out; ks->ks_mode = mode & ACCESSPERMS; @@ -362,7 +362,7 @@ ksem_access(struct ksem *ks, struct ucred *ucred) int error; error = vaccess(VREG, ks->ks_mode, ks->ks_uid, ks->ks_gid, - VREAD | VWRITE, ucred, NULL); + VREAD | VWRITE, ucred); if (error) error = priv_check_cred(ucred, PRIV_SEM_WRITE); return (error); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/uipc_shm.c Wed Aug 5 09:27:03 2020 (r363893) @@ -679,7 +679,7 @@ shm_access(struct shmfd *shmfd, struct ucred *ucred, i accmode |= VWRITE; mtx_lock(&shm_timestamp_lock); error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, shmfd->shm_gid, - accmode, ucred, NULL); + accmode, ucred); mtx_unlock(&shm_timestamp_lock); return (error); } @@ -1240,8 +1240,8 @@ shm_chmod(struct file *fp, mode_t mode, struct ucred * if (error != 0) goto out; #endif - error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, - shmfd->shm_gid, VADMIN, active_cred, NULL); + error = vaccess(VREG, shmfd->shm_mode, shmfd->shm_uid, shmfd->shm_gid, + VADMIN, active_cred); if (error != 0) goto out; shmfd->shm_mode = mode & ACCESSPERMS; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/kern/vfs_subr.c Wed Aug 5 09:27:03 2020 (r363893) @@ -5299,14 +5299,12 @@ vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gi /* * Common filesystem object access control check routine. Accepts a - * vnode's type, "mode", uid and gid, requested access mode, credentials, - * and optional call-by-reference privused argument allowing vaccess() - * to indicate to the caller whether privilege was used to satisfy the - * request (obsoleted). Returns 0 on success, or an errno on failure. + * vnode's type, "mode", uid and gid, requested access mode, and credentials. + * Returns 0 on success, or an errno on failure. */ int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, - accmode_t accmode, struct ucred *cred, int *privused) + accmode_t accmode, struct ucred *cred) { accmode_t dac_granted; accmode_t priv_granted; @@ -5321,9 +5319,6 @@ vaccess(enum vtype type, mode_t file_mode, uid_t file_ * as requested. If it exists, go with that. */ - if (privused != NULL) - *privused = 0; - dac_granted = 0; /* Check the owner. */ @@ -5409,9 +5404,6 @@ privcheck: priv_granted |= VADMIN; if ((accmode & (priv_granted | dac_granted)) == accmode) { - /* XXX audit: privilege used */ - if (privused != NULL) - *privused = 1; return (0); } Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/sys/vnode.h Wed Aug 5 09:27:03 2020 (r363893) @@ -667,16 +667,14 @@ int vn_commname(struct vnode *vn, char *buf, u_int buf int vn_path_to_global_path(struct thread *td, struct vnode *vp, char *path, u_int pathlen); int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, - gid_t file_gid, accmode_t accmode, struct ucred *cred, - int *privused); + gid_t file_gid, accmode_t accmode, struct ucred *cred); int vaccess_vexec_smr(mode_t file_mode, uid_t file_uid, gid_t file_gid, struct ucred *cred); int vaccess_acl_nfs4(enum vtype type, uid_t file_uid, gid_t file_gid, - struct acl *aclp, accmode_t accmode, struct ucred *cred, - int *privused); + struct acl *aclp, accmode_t accmode, struct ucred *cred); int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, gid_t file_gid, struct acl *acl, accmode_t accmode, - struct ucred *cred, int *privused); + struct ucred *cred); void vattr_null(struct vattr *vap); int vcount(struct vnode *vp); void vlazy(struct vnode *); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Wed Aug 5 09:25:59 2020 (r363892) +++ head/sys/ufs/ufs/ufs_vnops.c Wed Aug 5 09:27:03 2020 (r363893) @@ -390,12 +390,12 @@ ufs_accessx(ap) case 0: if (type == ACL_TYPE_NFS4) { error = vaccess_acl_nfs4(vp->v_type, ip->i_uid, - ip->i_gid, acl, accmode, ap->a_cred, NULL); + ip->i_gid, acl, accmode, ap->a_cred); } else { error = vfs_unixify_accmode(&accmode); if (error == 0) error = vaccess_acl_posix1e(vp->v_type, ip->i_uid, - ip->i_gid, acl, accmode, ap->a_cred, NULL); + ip->i_gid, acl, accmode, ap->a_cred); } break; default: @@ -410,8 +410,8 @@ ufs_accessx(ap) */ error = vfs_unixify_accmode(&accmode); if (error == 0) - error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, - ip->i_gid, accmode, ap->a_cred, NULL); + error = vaccess(vp->v_type, ip->i_mode, + ip->i_uid, ip->i_gid, accmode, ap->a_cred); } acl_free(acl); @@ -421,7 +421,7 @@ ufs_accessx(ap) error = vfs_unixify_accmode(&accmode); if (error == 0) error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid, - accmode, ap->a_cred, NULL); + accmode, ap->a_cred); return (error); } From owner-svn-src-all@freebsd.org Wed Aug 5 09:27:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 332643AFC2B; Wed, 5 Aug 2020 09:27:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM5rV0Vnsz4b1T; Wed, 5 Aug 2020 09:27:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E905C1418D; Wed, 5 Aug 2020 09:27:53 +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 0759Rrj8011209; Wed, 5 Aug 2020 09:27:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759RrBG011208; Wed, 5 Aug 2020 09:27:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050927.0759RrBG011208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363894 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 363894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 09:27:54 -0000 Author: mjg Date: Wed Aug 5 09:27:53 2020 New Revision: 363894 URL: https://svnweb.freebsd.org/changeset/base/363894 Log: Bump __FreeBSD_version after vaccess() change Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Aug 5 09:27:03 2020 (r363893) +++ head/sys/sys/param.h Wed Aug 5 09:27:53 2020 (r363894) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300104 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300105 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Wed Aug 5 09:38:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 560F7370033; Wed, 5 Aug 2020 09:38:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM64C1g7Rz4bkH; Wed, 5 Aug 2020 09:38:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CEA9141A1; Wed, 5 Aug 2020 09:38:03 +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 0759c28h017833; Wed, 5 Aug 2020 09:38:02 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0759c2HH017832; Wed, 5 Aug 2020 09:38:02 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202008050938.0759c2HH017832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 5 Aug 2020 09:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363895 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 363895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 09:38:03 -0000 Author: mjg Date: Wed Aug 5 09:38:02 2020 New Revision: 363895 URL: https://svnweb.freebsd.org/changeset/base/363895 Log: cache: don't ignore size passed to nchinittbl Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Aug 5 09:27:53 2020 (r363894) +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:38:02 2020 (r363895) @@ -2070,7 +2070,7 @@ nchinittbl(u_long elements, u_long *hashmask) struct nchashhead *hashtbl; u_long hashsize, i; - hashsize = cache_roundup_2(desiredvnodes * 2) / 2; + hashsize = cache_roundup_2(elements) / 2; hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), M_VFSCACHE, M_WAITOK); for (i = 0; i < hashsize; i++) From owner-svn-src-all@freebsd.org Wed Aug 5 10:06:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0B0837067C; Wed, 5 Aug 2020 10:06:53 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM6jT65ybz4dHs; Wed, 5 Aug 2020 10:06:53 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B2AE1455C; Wed, 5 Aug 2020 10:06:53 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075A6rIl035895; Wed, 5 Aug 2020 10:06:53 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075A6rCw035894; Wed, 5 Aug 2020 10:06:53 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008051006.075A6rCw035894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Wed, 5 Aug 2020 10:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363896 - vendor/bc/3.1.5 X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: vendor/bc/3.1.5 X-SVN-Commit-Revision: 363896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 10:06:54 -0000 Author: se Date: Wed Aug 5 10:06:53 2020 New Revision: 363896 URL: https://svnweb.freebsd.org/changeset/base/363896 Log: Tag version 3.1.5 Added: vendor/bc/3.1.5/ - copied from r363895, vendor/bc/dist/ From owner-svn-src-all@freebsd.org Wed Aug 5 10:07:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A7FA370A19; Wed, 5 Aug 2020 10:07:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM6kT0tMnz4d9m; Wed, 5 Aug 2020 10:07:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01ADB14792; Wed, 5 Aug 2020 10:07:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075A7iAj035988; Wed, 5 Aug 2020 10:07:44 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075A7iZB035982; Wed, 5 Aug 2020 10:07:44 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008051007.075A7iZB035982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Wed, 5 Aug 2020 10:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363897 - in vendor/bc/dist: . locales src X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: in vendor/bc/dist: . locales src X-SVN-Commit-Revision: 363897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 10:07:45 -0000 Author: se Date: Wed Aug 5 10:07:43 2020 New Revision: 363897 URL: https://svnweb.freebsd.org/changeset/base/363897 Log: Upgrade to version 3.1.5 This version fixes a bug that only occurs when with chinese locale settings. Modified: vendor/bc/dist/Makefile.in vendor/bc/dist/NEWS.md vendor/bc/dist/locales/zh_CN.GB18030.msg vendor/bc/dist/locales/zh_CN.GB2312.msg vendor/bc/dist/locales/zh_CN.GBK.msg vendor/bc/dist/locales/zh_CN.UTF-8.msg vendor/bc/dist/locales/zh_CN.eucCN.msg vendor/bc/dist/src/program.c vendor/bc/dist/src/vm.c Modified: vendor/bc/dist/Makefile.in ============================================================================== --- vendor/bc/dist/Makefile.in Wed Aug 5 10:06:53 2020 (r363896) +++ vendor/bc/dist/Makefile.in Wed Aug 5 10:07:43 2020 (r363897) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.4 +VERSION = 3.1.5 SRC = %%SRC%% OBJ = %%OBJ%% Modified: vendor/bc/dist/NEWS.md ============================================================================== --- vendor/bc/dist/NEWS.md Wed Aug 5 10:06:53 2020 (r363896) +++ vendor/bc/dist/NEWS.md Wed Aug 5 10:07:43 2020 (r363897) @@ -1,5 +1,13 @@ # News +## 3.1.5 + +This is a production release that fixes the Chinese locales (which caused `bc` +to crash) and a crash caused by `bc` executing code when it should not have been +able to. + +***ALL USERS SHOULD UPGRADE.*** + ## 3.1.4 This is a production release that fixes one bug, changes two behaviors, and Modified: vendor/bc/dist/locales/zh_CN.GB18030.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/bc/dist/locales/zh_CN.GB2312.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/bc/dist/locales/zh_CN.GBK.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/bc/dist/locales/zh_CN.UTF-8.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/bc/dist/locales/zh_CN.eucCN.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/bc/dist/src/program.c ============================================================================== --- vendor/bc/dist/src/program.c Wed Aug 5 10:06:53 2020 (r363896) +++ vendor/bc/dist/src/program.c Wed Aug 5 10:07:43 2020 (r363897) @@ -1271,11 +1271,12 @@ static void bc_program_divmod(BcProgram *p) { BcNum *n1, *n2; size_t req; + bc_vec_expand(&p->results, p->results.len + 2); + + // We don't need to update the pointer because + // the capacity is enough due to the line above. res2 = bc_program_prepResult(p); res = bc_program_prepResult(p); - - // Update the pointer, just in case. - res2 = bc_vec_item_rev(&p->results, 1); bc_program_binOpPrep(p, &opd1, &n1, &opd2, &n2, 2); Modified: vendor/bc/dist/src/vm.c ============================================================================== --- vendor/bc/dist/src/vm.c Wed Aug 5 10:06:53 2020 (r363896) +++ vendor/bc/dist/src/vm.c Wed Aug 5 10:07:43 2020 (r363897) @@ -464,7 +464,7 @@ static void bc_vm_process(const char *text) { while (BC_PARSE_CAN_PARSE(vm.prs)) vm.parse(&vm.prs); - bc_program_exec(&vm.prog); + if(BC_IS_DC || !BC_PARSE_NO_EXEC(&vm.prs)) bc_program_exec(&vm.prog); assert(BC_IS_DC || vm.prog.results.len == 0); From owner-svn-src-all@freebsd.org Wed Aug 5 10:10:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5B04370A47; Wed, 5 Aug 2020 10:10:41 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM6ns4Qbsz4dH8; Wed, 5 Aug 2020 10:10:41 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6345614365; Wed, 5 Aug 2020 10:10:41 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075AAfvD036191; Wed, 5 Aug 2020 10:10:41 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075AAfrv036190; Wed, 5 Aug 2020 10:10:41 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008051010.075AAfrv036190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Wed, 5 Aug 2020 10:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363898 - vendor/bc/3.1.5 X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: vendor/bc/3.1.5 X-SVN-Commit-Revision: 363898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 10:10:41 -0000 Author: se Date: Wed Aug 5 10:10:40 2020 New Revision: 363898 URL: https://svnweb.freebsd.org/changeset/base/363898 Log: Revert copy from dist directory - I had forgotten to commit to dist first. Deleted: vendor/bc/3.1.5/ From owner-svn-src-all@freebsd.org Wed Aug 5 10:12:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE486370A6B; Wed, 5 Aug 2020 10:12:19 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM6ql4hkLz4dxt; Wed, 5 Aug 2020 10:12:19 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C5AB14176; Wed, 5 Aug 2020 10:12:19 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075ACJlS042111; Wed, 5 Aug 2020 10:12:19 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075ACJLR042110; Wed, 5 Aug 2020 10:12:19 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008051012.075ACJLR042110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Wed, 5 Aug 2020 10:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r363899 - vendor/bc/3.1.5 X-SVN-Group: vendor X-SVN-Commit-Author: se X-SVN-Commit-Paths: vendor/bc/3.1.5 X-SVN-Commit-Revision: 363899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 10:12:19 -0000 Author: se Date: Wed Aug 5 10:12:19 2020 New Revision: 363899 URL: https://svnweb.freebsd.org/changeset/base/363899 Log: Tag version 3.1.5 Repeat previous SVN copy from dist directory with updates files. Added: vendor/bc/3.1.5/ - copied from r363898, vendor/bc/dist/ From owner-svn-src-all@freebsd.org Wed Aug 5 10:27:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11E49370C4D; Wed, 5 Aug 2020 10:27:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM78v6X59z4fDq; Wed, 5 Aug 2020 10:27:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEF59148E6; Wed, 5 Aug 2020 10:27:11 +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 075ARBRi048324; Wed, 5 Aug 2020 10:27:11 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075ARB4Y048323; Wed, 5 Aug 2020 10:27:11 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008051027.075ARB4Y048323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 10:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363900 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 363900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 10:27:12 -0000 Author: ae Date: Wed Aug 5 10:27:11 2020 New Revision: 363900 URL: https://svnweb.freebsd.org/changeset/base/363900 Log: Fix typo. Submitted by: Evgeniy Khramtsov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25932 Modified: head/sys/netinet6/in6_proto.c Modified: head/sys/netinet6/in6_proto.c ============================================================================== --- head/sys/netinet6/in6_proto.c Wed Aug 5 10:12:19 2020 (r363899) +++ head/sys/netinet6/in6_proto.c Wed Aug 5 10:27:11 2020 (r363900) @@ -586,7 +586,7 @@ SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK "Create a loopback route when configuring an IPv6 address"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO, nodeinfo, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_nodeinfo), 0, - "Mask of enabled RF4620 node information query types"); + "Mask of enabled RFC4620 node information query types"); SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO_OLDMCPREFIX, nodeinfo_oldmcprefix, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmp6_nodeinfo_oldmcprefix), 0, From owner-svn-src-all@freebsd.org Wed Aug 5 11:26:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9888D3727AF; Wed, 5 Aug 2020 11:26:15 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8T33XgSz4jKS; Wed, 5 Aug 2020 11:26:15 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CED21545D; Wed, 5 Aug 2020 11:26:15 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075BQFoR085307; Wed, 5 Aug 2020 11:26:15 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075BQF6W085306; Wed, 5 Aug 2020 11:26:15 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <202008051126.075BQF6W085306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Wed, 5 Aug 2020 11:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363903 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 363903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 11:26:15 -0000 Author: 0mp (doc,ports committer) Date: Wed Aug 5 11:26:14 2020 New Revision: 363903 URL: https://svnweb.freebsd.org/changeset/base/363903 Log: Do not describe portsnap(8) as a way to manage /usr/ports Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Wed Aug 5 11:11:31 2020 (r363902) +++ head/share/man/man7/build.7 Wed Aug 5 11:26:14 2020 (r363903) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 3, 2020 +.Dd August 5, 2020 .Dt BUILD 7 .Os .Sh NAME @@ -41,10 +41,8 @@ and .Pa /usr/ports . These directories may be initially empty or non-existent until updated with .Xr svn 1 -or -.Xr svnlite 1 -or -.Xr portsnap 8 . +(or +.Xr svnlite 1 ) . Directory .Pa /usr/src contains the @@ -852,7 +850,6 @@ manpage first appeared in .Xr tests 7 , .Xr config 8 , .Xr mergemaster 8 , -.Xr portsnap 8 , .Xr reboot 8 , .Xr shutdown 8 .Sh AUTHORS From owner-svn-src-all@freebsd.org Wed Aug 5 11:26:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 379BA372882; Wed, 5 Aug 2020 11:26:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8Tk0l39z4jN1; Wed, 5 Aug 2020 11:26:50 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0F3915717; Wed, 5 Aug 2020 11:26:49 +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 075BQnQP085386; Wed, 5 Aug 2020 11:26:49 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075BQnMi085384; Wed, 5 Aug 2020 11:26:49 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008051126.075BQnMi085384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 11:26:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363904 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 363904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 11:26:50 -0000 Author: ae Date: Wed Aug 5 11:26:49 2020 New Revision: 363904 URL: https://svnweb.freebsd.org/changeset/base/363904 Log: Fix SIGSEGV in ipfw(8) when NAT64 prefix length is omitted. Submitted by: Evgeniy Khramtsov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25734 Modified: head/sbin/ipfw/nat64clat.c head/sbin/ipfw/nat64stl.c Modified: head/sbin/ipfw/nat64clat.c ============================================================================== --- head/sbin/ipfw/nat64clat.c Wed Aug 5 11:26:14 2020 (r363903) +++ head/sbin/ipfw/nat64clat.c Wed Aug 5 11:26:49 2020 (r363904) @@ -303,6 +303,9 @@ nat64clat_config(const char *name, uint8_t set, int ac if ((p = strchr(*av, '/')) != NULL) *p++ = '\0'; + else + errx(EX_USAGE, + "Prefix length required: %s", *av); if (inet_pton(AF_INET6, *av, &prefix) != 1) errx(EX_USAGE, "Bad prefix: %s", *av); Modified: head/sbin/ipfw/nat64stl.c ============================================================================== --- head/sbin/ipfw/nat64stl.c Wed Aug 5 11:26:14 2020 (r363903) +++ head/sbin/ipfw/nat64stl.c Wed Aug 5 11:26:49 2020 (r363904) @@ -249,6 +249,9 @@ nat64stl_create(const char *name, uint8_t set, int ac, NEED1("IPv6 prefix6 required"); if ((p = strchr(*av, '/')) != NULL) *p++ = '\0'; + else + errx(EX_USAGE, + "Prefix length required: %s", *av); if (inet_pton(AF_INET6, *av, &cfg->prefix6) != 1) errx(EX_USAGE, "Bad prefix: %s", *av); From owner-svn-src-all@freebsd.org Wed Aug 5 11:38:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8FC313728F8; Wed, 5 Aug 2020 11:38:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8lG39kBz4jw3; Wed, 5 Aug 2020 11:38: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C4A51586E; Wed, 5 Aug 2020 11:38: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 075BcY49091714; Wed, 5 Aug 2020 11:38:34 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075BcYeh091713; Wed, 5 Aug 2020 11:38:34 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202008051138.075BcYeh091713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 5 Aug 2020 11:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363905 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 363905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 11:38:34 -0000 Author: avg Date: Wed Aug 5 11:38:33 2020 New Revision: 363905 URL: https://svnweb.freebsd.org/changeset/base/363905 Log: gpiokeys: add a basic manual page Reviewed by: manu, bjk, 0mp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25939 Added: head/share/man/man4/gpiokeys.4 (contents, props changed) Added: head/share/man/man4/gpiokeys.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/gpiokeys.4 Wed Aug 5 11:38:33 2020 (r363905) @@ -0,0 +1,152 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Andriy Gapon +.\" +.\" 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 August 5, 2020 +.Dt GPIOKEYS 4 +.Os +.Sh NAME +.Nm gpiokeys +.Nd GPIO keys device driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "options FDT" +.Cd "device gpio" +.Cd "device gpiokeys" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +gpiokeys_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides a way to represent a set of general purpose inputs as a +.Xr keyboard 4 +device. +At the moment the driver supports only +.Xr FDT 4 +based systems. +The DTS determines what pins are mapped to buttons and what key codes are +generated for each virtual button. +The +.Xr keyboard 4 +device can be used from userland to monitor for input changes. +.Pp +On an +.Xr FDT 4 +based system +the DTS part for a +.Nm +device usually looks like: +.Bd -literal +/ { + + ... + + gpio_keys { + compatible = "gpio-keys"; + + btn1 { + label = "button1"; + linux,code = ; + gpios = <&gpio 0 3 GPIO_ACTIVE_LOW> + }; + + btn2 { + label = "button2"; + linux,code = ; + gpios = <&gpio 0 4 GPIO_ACTIVE_LOW> + }; + }; +}; +.Ed +.Pp +For more details about the +.Va gpios +property, please consult +.Pa /usr/src/sys/dts/bindings-gpio.txt . +.Pp +The +.Nm +driver supports two properties for specifying a key code. +.Pp +The property +.Va freebsd,code +specifies a +.Fx +native scancode compatible with +.Xr kbdmap 5 +keyboard maps. +.Pp +The property +.Va linux,code +specifies an evdev scancode. +That scancode is internally translated to a native scancode. +Note that not all evdev scancodes have corresponding native scancodes. +If a scancode cannot be translated, then a diagnostic message is printed +and the input is ignored. +.Pp +The property +.Va label +is a descriptive name of a button. +It is used for diagnostic messages only. +This property is optional. +If not set, the node name is used in its place. +.Pp +The property +.Va autorepeat +determines whether autorepeat is enabled for a button. +.Pp +The property +.Va debounce-interval +defines debouncing interval time in milliseconds. +If not specified the interval defaults to 5. +.Sh SEE ALSO +.Xr fdt 4 , +.Xr gpio 4 , +.Xr keyboard 4 , +.Xr kbdmap 5 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 12.2 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . +This +manual page was written by +.An Andriy Gapon Aq Mt avg@FreeBSD.org . From owner-svn-src-all@freebsd.org Wed Aug 5 11:39:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DD33372A3B; Wed, 5 Aug 2020 11:39:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8ly1pb4z4k0F; Wed, 5 Aug 2020 11:39:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2136615655; Wed, 5 Aug 2020 11:39:10 +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 075Bd9sF091788; Wed, 5 Aug 2020 11:39:09 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075Bd9Be091785; Wed, 5 Aug 2020 11:39:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008051139.075Bd9Be091785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 11:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363906 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 363906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 11:39:10 -0000 Author: ae Date: Wed Aug 5 11:39:09 2020 New Revision: 363906 URL: https://svnweb.freebsd.org/changeset/base/363906 Log: Add m__getjcl SDT probe. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c head/sys/sys/mbuf.h Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Wed Aug 5 11:38:33 2020 (r363905) +++ head/sys/kern/kern_mbuf.c Wed Aug 5 11:39:09 2020 (r363906) @@ -1397,6 +1397,7 @@ m_getjcl(int how, short type, int flags, int size) uma_zfree(zone_mbuf, m); return (NULL); } + MBUF_PROBE5(m__getjcl, how, type, flags, size, m); return (m); } Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Wed Aug 5 11:38:33 2020 (r363905) +++ head/sys/kern/uipc_mbuf.c Wed Aug 5 11:39:09 2020 (r363906) @@ -78,6 +78,13 @@ SDT_PROBE_DEFINE4_XLATE(sdt, , , m__getcl, "uint32_t", "uint32_t", "struct mbuf *", "mbufinfo_t *"); +SDT_PROBE_DEFINE5_XLATE(sdt, , , m__getjcl, + "uint32_t", "uint32_t", + "uint16_t", "uint16_t", + "uint32_t", "uint32_t", + "uint32_t", "uint32_t", + "struct mbuf *", "mbufinfo_t *"); + SDT_PROBE_DEFINE3_XLATE(sdt, , , m__clget, "struct mbuf *", "mbufinfo_t *", "uint32_t", "uint32_t", Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Aug 5 11:38:33 2020 (r363905) +++ head/sys/sys/mbuf.h Wed Aug 5 11:39:09 2020 (r363906) @@ -65,6 +65,7 @@ SDT_PROBE_DECLARE(sdt, , , m__init); SDT_PROBE_DECLARE(sdt, , , m__gethdr); SDT_PROBE_DECLARE(sdt, , , m__get); SDT_PROBE_DECLARE(sdt, , , m__getcl); +SDT_PROBE_DECLARE(sdt, , , m__getjcl); SDT_PROBE_DECLARE(sdt, , , m__clget); SDT_PROBE_DECLARE(sdt, , , m__cljget); SDT_PROBE_DECLARE(sdt, , , m__cljset); From owner-svn-src-all@freebsd.org Wed Aug 5 11:41:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9BB86372A66; Wed, 5 Aug 2020 11:41:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM8pt3jWFz4kLR; Wed, 5 Aug 2020 11:41:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62B0E1587C; Wed, 5 Aug 2020 11:41:42 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075BfgZB094953; Wed, 5 Aug 2020 11:41:42 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075BfgT2094952; Wed, 5 Aug 2020 11:41:42 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202008051141.075BfgT2094952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Wed, 5 Aug 2020 11:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363907 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 363907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 11:41:42 -0000 Author: gbe (doc committer) Date: Wed Aug 5 11:41:41 2020 New Revision: 363907 URL: https://svnweb.freebsd.org/changeset/base/363907 Log: environ(7): Update the description and include some more environment variables - Add a better introduction to the DESCRIPTION section - Add a description for MANPATH and POSIXLY_CORRECT - Asorted improvements for the usage of some macros PR: 43823 Submitted by: Lyndon Nerenberg Reviewed by: 0mp, bcr Approved by: 0mp, bcr MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25912 Modified: head/share/man/man7/environ.7 Modified: head/share/man/man7/environ.7 ============================================================================== --- head/share/man/man7/environ.7 Wed Aug 5 11:39:09 2020 (r363906) +++ head/share/man/man7/environ.7 Wed Aug 5 11:41:41 2020 (r363907) @@ -28,7 +28,7 @@ .\" @(#)environ.7 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 14, 2020 +.Dd August 5, 2020 .Dt ENVIRON 7 .Os .Sh NAME @@ -37,21 +37,59 @@ .Sh SYNOPSIS .Ar extern char **environ ; .Sh DESCRIPTION -An array of strings called the +An array of strings, called the .Ar environment -is made available by +is made available to each process by .Xr execve 2 when a process begins. By convention these strings have the form -.Dq Ar name=value . -The following names are used by various commands: -.Bl -tag -width LC_MONETARY +.Va name Ns No = Ns Ar value , +and are referred to as +.Dq environment variables . +A process can query, update, and delete these strings using the +.Xr getenv 3 , +.Xr setenv 3 , +and +.Xr unsetenv 3 +functions, respectively. +The shells also provide commands to manipulate the environment; +they are described in the respective shell manual pages. +.Pp +What follows is a list of environment variables typically +seen on a +.Ux +system. +It includes only those variables that a user can expect to see during their +day-to-day use of the system, and is far from complete. +Environment variables specific to a particular program or library function +are documented in the +.Sx ENVIRONMENT +section of the appropriate manual page. +.Sh ENVIRONMENT +.Bl -tag -width LD_LIBRARY_PATH .It Ev BLOCKSIZE -The size of the block units used by several commands, most notably +The size of the block units used by several disk-related commands, +most notably .Xr df 1 , .Xr du 1 and .Xr ls 1 . +.Ev BLOCKSIZE +may be specified in units of a byte by specifying a number, +in units of a kilobyte by specifying a number followed by +.Ql K +or +.Ql k , +in units of a megabyte by specifying a number followed by +.Ql M +or +.Ql m , +and in units of a gigabyte by specifying a number followed +by +.Ql G +or +.Ql g . +Sizes less than 512 bytes or greater than a gigabyte are ignored. This variable is processed by the .Xr getbsize 3 function. @@ -117,6 +155,10 @@ used by .Xr mail 1 , .Xr sh 1 , and many other mail clients. +.It Ev MANPATH +The sequence of directories, separated by colons, searched by +.Xr man 1 +when looking for manual pages. .It Ev NLSPATH List of directories to be searched for the message catalog referred to by .Ev LC_MESSAGES . @@ -139,6 +181,9 @@ etc, when looking for an executable file. .Ev PATH is set to ``/usr/bin:/bin'' initially by .Xr login 1 . +.It Ev POSIXLY_CORRECT +When set to any value, this environment variable modifies the behaviour +of certain commands to (mostly) execute in a strictly POSIX-compliant manner. .It Ev PRINTER The name of the default printer to be used by .Xr lpr 1 , @@ -178,7 +223,7 @@ no is equivalent to a .Ev TERMPATH of -.Dq Pa $HOME/.termcap:/etc/termcap . +.Pa $HOME/.termcap:/etc/termcap . .Ev TERMPATH is ignored if .Ev TERMCAP @@ -186,22 +231,27 @@ contains a full pathname. .It Ev TMPDIR The directory in which to store temporary files. Most applications use either -.Dq /tmp +.Pa /tmp or -.Dq /var/tmp . +.Pa /var/tmp . Setting this variable will make them use another directory. .It Ev TZ The timezone to use when displaying dates. The normal format is a pathname relative to -.Dq Pa /usr/share/zoneinfo . +.Pa /usr/share/zoneinfo . For example, the command -.Dq env TZ=America/Los_Angeles date +.Pp +.Dl env TZ=America/Los_Angeles date +.Pp displays the current time in California. See .Xr tzset 3 for more information. .It Ev USER The login name of the user. +It is recommended that portable applications use +.Ev LOGNAME +instead. .El .Pp Further names may be placed in the environment by the From owner-svn-src-all@freebsd.org Wed Aug 5 11:54:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF92C3731DA; Wed, 5 Aug 2020 11:54:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM95648Ntz4lJm; Wed, 5 Aug 2020 11:54:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71346158C0; Wed, 5 Aug 2020 11:54:02 +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 075Bs2mP004010; Wed, 5 Aug 2020 11:54:02 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075Bs2pj004009; Wed, 5 Aug 2020 11:54:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202008051154.075Bs2pj004009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 5 Aug 2020 11:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363908 - head/share/dtrace X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/share/dtrace X-SVN-Commit-Revision: 363908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 11:54:02 -0000 Author: ae Date: Wed Aug 5 11:54:02 2020 New Revision: 363908 URL: https://svnweb.freebsd.org/changeset/base/363908 Log: Synchronize definitions in mbuf.d with values from mbuf.h Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: head/share/dtrace/mbuf.d Modified: head/share/dtrace/mbuf.d ============================================================================== --- head/share/dtrace/mbuf.d Wed Aug 5 11:41:41 2020 (r363907) +++ head/share/dtrace/mbuf.d Wed Aug 5 11:54:02 2020 (r363908) @@ -53,37 +53,41 @@ inline int M_MCAST = 0x00000020; /* send/received as l inline int M_PROMISC = 0x00000040; /* packet was not for us */ #pragma D binding "1.6.3" M_VLANTAG inline int M_VLANTAG = 0x00000080; /* ether_vtag is valid */ -#pragma D binding "1.6.3" M_UNUSED_8 -inline int M_UNUSED_8 = 0x00000100; /* --available-- */ +#pragma D binding "1.13" M_EXTPG +inline int M_EXTPG = 0x00000100; /* has array of unmapped pages and TLS */ #pragma D binding "1.6.3" M_NOFREE inline int M_NOFREE = 0x00000200; /* do not free mbuf, embedded in cluster */ +#pragma D binding "1.13" M_TSTMP +inline int M_TSTMP = 0x00000400; /* rcv_tstmp field is valid */ +#pragma D binding "1.13" M_TSTMP_HPREC +inline int M_TSTMP_HPREC = 0x00000800; /* rcv_tstmp is high-prec */ +#pragma D binding "1.13" M_TSTMP_LRO +inline int M_TSTMP_LRO = 0x00001000; /* Time LRO pushed in pkt is valid */ + +#pragma D binding "1.13" M_PROTO1 +inline int M_PROTO1 = 0x00002000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO2 +inline int M_PROTO2 = 0x00004000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO3 +inline int M_PROTO3 = 0x00008000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO4 +inline int M_PROTO4 = 0x00010000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO5 +inline int M_PROTO5 = 0x00020000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO6 +inline int M_PROTO6 = 0x00040000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO7 +inline int M_PROTO7 = 0x00080000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO8 +inline int M_PROTO8 = 0x00100000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO9 +inline int M_PROTO9 = 0x00200000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO10 +inline int M_PROTO10 = 0x00400000; /* protocol-specific */ +#pragma D binding "1.13" M_PROTO11 +inline int M_PROTO11 = 0x00800000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO1 -inline int M_PROTO1 = 0x00001000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO2 -inline int M_PROTO2 = 0x00002000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO3 -inline int M_PROTO3 = 0x00004000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO4 -inline int M_PROTO4 = 0x00008000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO5 -inline int M_PROTO5 = 0x00010000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO6 -inline int M_PROTO6 = 0x00020000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO7 -inline int M_PROTO7 = 0x00040000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO8 -inline int M_PROTO8 = 0x00080000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO9 -inline int M_PROTO9 = 0x00100000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO10 -inline int M_PROTO10 = 0x00200000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO11 -inline int M_PROTO11 = 0x00400000; /* protocol-specific */ -#pragma D binding "1.6.3" M_PROTO12 -inline int M_PROTO12 = 0x00800000; /* protocol-specific */ - -#pragma D binding "1.6.3" mbufflags_string +#pragma D binding "1.13" mbufflags_string inline string mbufflags_string[uint32_t flags] = flags & M_EXT ? "M_EXT" : flags & M_PKTHDR ? "M_PKTHDR" : @@ -93,8 +97,11 @@ inline string mbufflags_string[uint32_t flags] = flags & M_MCAST ? "M_MCAST" : flags & M_PROMISC ? "M_PROMISC" : flags & M_VLANTAG ? "M_VLANTAG" : - flags & M_UNUSED_8 ? "M_UNUSED_8" : - flags & M_NOFREE ? "M_NOFREE" : + flags & M_EXTPG ? "M_EXTPG" : + flags & M_NOFREE ? "M_NOFREE" : + flags & M_TSTMP ? "M_TSTMP" : + flags & M_TSTMP_HPREC ? "M_TSTMP_HPREC" : + flags & M_TSTMP_LRO ? "M_TSTMP_LRO" : flags & M_PROTO1 ? "M_PROTO1" : flags & M_PROTO2 ? "M_PROTO2" : flags & M_PROTO3 ? "M_PROTO3" : @@ -106,7 +113,6 @@ inline string mbufflags_string[uint32_t flags] = flags & M_PROTO9 ? "M_PROTO9" : flags & M_PROTO10 ? "M_PROTO10" : flags & M_PROTO11 ? "M_PROTO11" : - flags & M_PROTO12 ? "M_PROTO12" : "none" ; typedef struct mbufinfo { From owner-svn-src-all@freebsd.org Wed Aug 5 11:54:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58FC6373614; Wed, 5 Aug 2020 11:54:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BM9641h8xz4lkp; Wed, 5 Aug 2020 11:54:52 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CE9B15A53; Wed, 5 Aug 2020 11:54:52 +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 075BsqX8004101; Wed, 5 Aug 2020 11:54:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075Bsp0f004100; Wed, 5 Aug 2020 11:54:51 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202008051154.075Bsp0f004100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 5 Aug 2020 11:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363909 - in head/sys: arm64/conf riscv/conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/conf riscv/conf X-SVN-Commit-Revision: 363909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 11:54:52 -0000 Author: andrew Date: Wed Aug 5 11:54:51 2020 New Revision: 363909 URL: https://svnweb.freebsd.org/changeset/base/363909 Log: Add DDB_CTF to the arm64 and riscv kernel configs This allows DTrace fbt probes to find arguments. Sponsored by: Innovate UK Modified: head/sys/arm64/conf/GENERIC head/sys/riscv/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Aug 5 11:54:02 2020 (r363908) +++ head/sys/arm64/conf/GENERIC Wed Aug 5 11:54:51 2020 (r363909) @@ -72,6 +72,7 @@ options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework options KDTRACE_FRAME # Ensure frames are compiled in options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # Kernel ELF linker loads CTF data options VFP # Floating-point support options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed Aug 5 11:54:02 2020 (r363908) +++ head/sys/riscv/conf/GENERIC Wed Aug 5 11:54:51 2020 (r363909) @@ -67,6 +67,7 @@ options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework options KDTRACE_FRAME # Ensure frames are compiled in options KDTRACE_HOOKS # Kernel DTrace hooks +options DDB_CTF # Kernel ELF linker loads CTF data options FPE # Floating-point extension support options RACCT # Resource accounting framework options RACCT_DEFAULT_TO_DISABLED # Set kern.racct.enable=0 by default From owner-svn-src-all@freebsd.org Wed Aug 5 14:08:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4938B3773F3; Wed, 5 Aug 2020 14:08:45 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMD4Y18DVz4sPC; Wed, 5 Aug 2020 14:08:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B89A16EDA; Wed, 5 Aug 2020 14:08:45 +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 075E8i7B083447; Wed, 5 Aug 2020 14:08:44 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075E8iG6083446; Wed, 5 Aug 2020 14:08:44 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202008051408.075E8iG6083446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 5 Aug 2020 14:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363910 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 363910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 14:08:45 -0000 Author: tsoome Date: Wed Aug 5 14:08:44 2020 New Revision: 363910 URL: https://svnweb.freebsd.org/changeset/base/363910 Log: zfs_keys_nextboot array is missing ZPOOL_CONFIG_POOL_GUID and ZPOOL_CONFIG_GUID As we do check the incomint nvlist, we either need to list all possible keys or use wildcard. PR: 248462 Reported by: larafercue@gmail.com Sponsored by: Netflix, Klara Inc. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Aug 5 11:54:51 2020 (r363909) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Aug 5 14:08:44 2020 (r363910) @@ -3656,7 +3656,9 @@ zfs_ioc_log_history(const char *unused, nvlist_t *innv #ifdef __FreeBSD__ static const zfs_ioc_key_t zfs_keys_nextboot[] = { - {"command", DATA_TYPE_STRING, 0}, + {"command", DATA_TYPE_STRING, 0}, + {ZPOOL_CONFIG_POOL_GUID, DATA_TYPE_UINT64, 0}, + {ZPOOL_CONFIG_GUID, DATA_TYPE_UINT64, 0} }; static int From owner-svn-src-all@freebsd.org Wed Aug 5 14:32:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 463C2377EDC; Wed, 5 Aug 2020 14:32:23 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMDbq1Wj9z4ts3; Wed, 5 Aug 2020 14:32:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 18D4F1775F; Wed, 5 Aug 2020 14:32:23 +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 075EWN2q001387; Wed, 5 Aug 2020 14:32:23 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075EWK8Y001375; Wed, 5 Aug 2020 14:32:20 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202008051432.075EWK8Y001375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 5 Aug 2020 14:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363911 - in head: cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/commo... X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zinject cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib... X-SVN-Commit-Revision: 363911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 14:32:23 -0000 Author: tsoome Date: Wed Aug 5 14:32:20 2020 New Revision: 363911 URL: https://svnweb.freebsd.org/changeset/base/363911 Log: MFOpenZFS: Add support for boot environment data to be stored in the label We are building new bootonce mechanism (previously zfs bootnext) and it is based on this OpenZFS change. Since this patch is nicely self contained, I am commiting it as is, and we can stack our changes. Original patch description follows: Modern bootloaders leverage data stored in the root filesystem to enable some of their powerful features. GRUB specifically has a grubenv file which can store large amounts of configuration data that can be read and written at boot time and during normal operation. This allows sysadmins to configure useful features like automated failover after failed boot attempts. Unfortunately, due to the Copy-on-Write nature of ZFS, the standard behavior of these tools cannot handle writing to ZFS files safely at boot time. We need an alternative way to store data that allows the bootloader to make changes to the data. This work is very similar to work that was done on Illumos to enable similar functionality in the FreeBSD bootloader. This patch is different in that the data being stored is a raw grubenv file; this file can store arbitrary variables and values, and the scripting provided by grub is powerful enough that special structures are not required to implement advanced behavior. We repurpose the second padding area in each label to store the grubenv file, protected by an embedded checksum. We add two ioctls to get and set this data, and libzfs_core and libzfs functions to access them more easily. There are no direct command line interfaces to these functions; these will be added directly to the bootloader utilities. Reviewed-by: Pavel Zakharov Reviewed-by: Matthew Ahrens Reviewed-by: Brian Behlendorf Signed-off-by: Paul Dagnelie Closes #10009 Obtained from: OpenZFS Sponsored by: Netflix, Klara Inc. Modified: head/cddl/contrib/opensolaris/cmd/zinject/translate.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Modified: head/cddl/contrib/opensolaris/cmd/zinject/translate.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zinject/translate.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/cmd/zinject/translate.c Wed Aug 5 14:32:20 2020 (r363911) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2020 by Delphix. All rights reserved. */ #include @@ -484,7 +484,7 @@ translate_device(const char *pool, const char *device, record->zi_end = record->zi_start + VDEV_PAD_SIZE - 1; break; case TYPE_LABEL_PAD2: - record->zi_start = offsetof(vdev_label_t, vl_pad2); + record->zi_start = offsetof(vdev_label_t, vl_be); record->zi_end = record->zi_start + VDEV_PAD_SIZE - 1; break; } Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Wed Aug 5 14:32:20 2020 (r363911) @@ -837,6 +837,8 @@ extern int zpool_in_use(libzfs_handle_t *, int, pool_s extern int zpool_read_label(int, nvlist_t **); extern int zpool_read_all_labels(int, nvlist_t **); extern int zpool_clear_label(int); +extern int zpool_set_bootenv(zpool_handle_t *, const char *); +extern int zpool_get_bootenv(zpool_handle_t *, char *, size_t, off_t); /* is this zvol valid for use as a dump device? */ extern int zvol_check_dump_config(char *); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Wed Aug 5 14:32:20 2020 (r363911) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2016 Nexenta Systems, Inc. * Copyright 2016 Igor Kozhukhov @@ -395,7 +395,7 @@ zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, * Assuming bootfs is a valid dataset name. */ static boolean_t -bootfs_name_valid(const char *pool, char *bootfs) +bootfs_name_valid(const char *pool, const char *bootfs) { int len = strlen(pool); @@ -4231,6 +4231,42 @@ zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, (void) snprintf(pathname, len, "%s:<0x%llx>", dsname, obj); } free(mntpnt); +} + +int +zpool_set_bootenv(zpool_handle_t *zhp, const char *envmap) +{ + int error = lzc_set_bootenv(zhp->zpool_name, envmap); + if (error != 0) { + (void) zpool_standard_error_fmt(zhp->zpool_hdl, error, + dgettext(TEXT_DOMAIN, + "error setting bootenv in pool '%s'"), zhp->zpool_name); + } + + return (error); +} + +int +zpool_get_bootenv(zpool_handle_t *zhp, char *outbuf, size_t size, off_t offset) +{ + nvlist_t *nvl; + int error = lzc_get_bootenv(zhp->zpool_name, &nvl);; + if (error != 0) { + (void) zpool_standard_error_fmt(zhp->zpool_hdl, error, + dgettext(TEXT_DOMAIN, + "error getting bootenv in pool '%s'"), zhp->zpool_name); + return (-1); + } + char *envmap = fnvlist_lookup_string(nvl, "envmap"); + if (offset >= strlen(envmap)) { + fnvlist_free(nvl); + return (0); + } + + strlcpy(outbuf, envmap + offset, size); + int bytes = MIN(strlen(envmap + offset), size); + fnvlist_free(nvl); + return (bytes); } #ifdef illumos Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Aug 5 14:32:20 2020 (r363911) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012, 2018 by Delphix. All rights reserved. + * Copyright (c) 2012, 2020 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Integros [integros.com] * Copyright 2017 RackTop Systems. @@ -1209,4 +1209,26 @@ lzc_initialize(const char *poolname, pool_initialize_f fnvlist_free(args); return (error); +} + +/* + * Set the bootenv contents for the given pool. + */ +int +lzc_set_bootenv(const char *pool, const char *env) +{ + nvlist_t *args = fnvlist_alloc(); + fnvlist_add_string(args, "envmap", env); + int error = lzc_ioctl(ZFS_IOC_SET_BOOTENV, pool, args, NULL); + fnvlist_free(args); + return (error); +} + +/* + * Get the contents of the bootenv of the given pool. + */ +int +lzc_get_bootenv(const char *pool, nvlist_t **outnvl) +{ + return (lzc_ioctl(ZFS_IOC_GET_BOOTENV, pool, NULL, outnvl)); } Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Aug 5 14:32:20 2020 (r363911) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2012, 2020 by Delphix. All rights reserved. * Copyright (c) 2013 by Martin Matuska . All rights reserved. * Copyright 2017 RackTop Systems. * Copyright (c) 2017 Datto Inc. @@ -105,6 +105,8 @@ int lzc_channel_program_nosync(const char *, const cha int lzc_pool_checkpoint(const char *); int lzc_pool_checkpoint_discard(const char *); +int lzc_set_bootenv(const char *, const char *); +int lzc_get_bootenv(const char *, nvlist_t **); #ifdef __cplusplus } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Wed Aug 5 14:32:20 2020 (r363911) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2017 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright (c) 2017, Intel Corporation. */ @@ -173,6 +173,8 @@ extern nvlist_t *vdev_label_read_config(vdev_t *vd, ui extern void vdev_uberblock_load(vdev_t *, struct uberblock *, nvlist_t **); extern void vdev_label_write(zio_t *zio, vdev_t *vd, int l, abd_t *buf, uint64_t offset, uint64_t size, zio_done_func_t *done, void *priv, int flags); +extern int vdev_label_read_bootenv(vdev_t *, nvlist_t *); +extern int vdev_label_write_bootenv(vdev_t *, char *); typedef enum { VDEV_LABEL_CREATE, /* create/add a new device */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Wed Aug 5 14:32:20 2020 (r363911) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2018 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright (c) 2017, Intel Corporation. */ @@ -392,7 +392,7 @@ struct vdev { #define VDEV_RAIDZ_MAXPARITY 3 #define VDEV_PAD_SIZE (8 << 10) -/* 2 padding areas (vl_pad1 and vl_pad2) to skip */ +/* 2 padding areas (vl_pad1 and vl_be) to skip */ #define VDEV_SKIP_SIZE VDEV_PAD_SIZE * 2 #define VDEV_PHYS_SIZE (112 << 10) #define VDEV_UBERBLOCK_RING (128 << 10) @@ -419,9 +419,29 @@ typedef struct vdev_phys { zio_eck_t vp_zbt; } vdev_phys_t; +typedef enum vbe_vers { + /* The bootenv file is stored as ascii text in the envblock */ + VB_RAW = 0, + + /* + * The bootenv file is converted to an nvlist and then packed into the + * envblock. + */ + VB_NVLIST = 1 +} vbe_vers_t; + +typedef struct vdev_boot_envblock { + uint64_t vbe_version; + char vbe_bootenv[VDEV_PAD_SIZE - sizeof (uint64_t) - + sizeof (zio_eck_t)]; + zio_eck_t vbe_zbt; +} vdev_boot_envblock_t; + +CTASSERT(sizeof (vdev_boot_envblock_t) == VDEV_PAD_SIZE); + typedef struct vdev_label { char vl_pad1[VDEV_PAD_SIZE]; /* 8K */ - char vl_pad2[VDEV_PAD_SIZE]; /* 8K */ + vdev_boot_envblock_t vl_be; /* 8K */ vdev_phys_t vl_vdev_phys; /* 112K */ char vl_uberblock[VDEV_UBERBLOCK_RING]; /* 128K */ } vdev_label_t; /* 256K total */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Wed Aug 5 14:32:20 2020 (r363911) @@ -1566,7 +1566,7 @@ vdev_probe(vdev_t *vd, zio_t *zio) for (int l = 1; l < VDEV_LABELS; l++) { zio_nowait(zio_read_phys(pio, vd, vdev_label_offset(vd->vdev_psize, l, - offsetof(vdev_label_t, vl_pad2)), VDEV_PAD_SIZE, + offsetof(vdev_label_t, vl_be)), VDEV_PAD_SIZE, abd_alloc_for_io(VDEV_PAD_SIZE, B_TRUE), ZIO_CHECKSUM_OFF, vdev_probe_done, vps, ZIO_PRIORITY_SYNC_READ, vps->vps_flags, B_TRUE)); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Wed Aug 5 14:32:20 2020 (r363911) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2018 by Delphix. All rights reserved. + * Copyright (c) 2012, 2020 by Delphix. All rights reserved. * Copyright (c) 2017, Intel Corporation. * Copyright 2019 Joyent, Inc. */ @@ -781,7 +781,7 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_label nvlist_t *label; vdev_phys_t *vp; abd_t *vp_abd; - abd_t *pad2; + abd_t *bootenv; uberblock_t *ub; abd_t *ub_abd; zio_t *zio; @@ -956,8 +956,8 @@ vdev_label_init(vdev_t *vd, uint64_t crtxg, vdev_label ub->ub_txg = 0; /* Initialize the 2nd padding area. */ - pad2 = abd_alloc_for_io(VDEV_PAD_SIZE, B_TRUE); - abd_zero(pad2, VDEV_PAD_SIZE); + bootenv = abd_alloc_for_io(VDEV_PAD_SIZE, B_TRUE); + abd_zero(bootenv, VDEV_PAD_SIZE); /* * Write everything in parallel. @@ -976,8 +976,8 @@ retry: * Zero out the 2nd padding area where it might have * left over data from previous filesystem format. */ - vdev_label_write(zio, vd, l, pad2, - offsetof(vdev_label_t, vl_pad2), + vdev_label_write(zio, vd, l, bootenv, + offsetof(vdev_label_t, vl_be), VDEV_PAD_SIZE, NULL, NULL, flags); vdev_label_write(zio, vd, l, ub_abd, @@ -993,7 +993,7 @@ retry: } nvlist_free(label); - abd_free(pad2); + abd_free(bootenv); abd_free(ub_abd); abd_free(vp_abd); @@ -1016,7 +1016,149 @@ retry: return (error); } +/* + * Done callback for vdev_label_read_bootenv_impl. If this is the first + * callback to finish, store our abd in the callback pointer. Otherwise, we + * just free our abd and return. + */ +static void +vdev_label_read_bootenv_done(zio_t *zio) +{ + zio_t *rio = zio->io_private; + abd_t **cbp = rio->io_private; + + ASSERT3U(zio->io_size, ==, VDEV_PAD_SIZE); + + if (zio->io_error == 0) { + mutex_enter(&rio->io_lock); + if (*cbp == NULL) { + /* Will free this buffer in vdev_label_read_bootenv. */ + *cbp = zio->io_abd; + } else { + abd_free(zio->io_abd); + } + mutex_exit(&rio->io_lock); + } else { + abd_free(zio->io_abd); + } +} + +static void +vdev_label_read_bootenv_impl(zio_t *zio, vdev_t *vd, int flags) +{ + for (int c = 0; c < vd->vdev_children; c++) + vdev_label_read_bootenv_impl(zio, vd->vdev_child[c], flags); + + /* + * We just use the first label that has a correct checksum; the + * bootloader should have rewritten them all to be the same on boot, + * and any changes we made since boot have been the same across all + * labels. + * + * While grub supports writing to all four labels, other bootloaders + * don't, so we only use the first two labels to store boot + * information. + */ + if (vd->vdev_ops->vdev_op_leaf && vdev_readable(vd)) { + for (int l = 0; l < VDEV_LABELS / 2; l++) { + vdev_label_read(zio, vd, l, + abd_alloc_linear(VDEV_PAD_SIZE, B_FALSE), + offsetof(vdev_label_t, vl_be), VDEV_PAD_SIZE, + vdev_label_read_bootenv_done, zio, flags); + } + } +} + int +vdev_label_read_bootenv(vdev_t *rvd, nvlist_t *command) +{ + spa_t *spa = rvd->vdev_spa; + abd_t *abd = NULL; + int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL | + ZIO_FLAG_SPECULATIVE | ZIO_FLAG_TRYHARD; + + ASSERT(command); + ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL); + + zio_t *zio = zio_root(spa, NULL, &abd, flags); + vdev_label_read_bootenv_impl(zio, rvd, flags); + int err = zio_wait(zio); + + if (abd != NULL) { + vdev_boot_envblock_t *vbe = abd_to_buf(abd); + if (vbe->vbe_version != VB_RAW) { + abd_free(abd); + return (SET_ERROR(ENOTSUP)); + } + vbe->vbe_bootenv[sizeof (vbe->vbe_bootenv) - 1] = '\0'; + fnvlist_add_string(command, "envmap", vbe->vbe_bootenv); + /* abd was allocated in vdev_label_read_bootenv_impl() */ + abd_free(abd); + /* If we managed to read any successfully, return success. */ + return (0); + } + return (err); +} + +int +vdev_label_write_bootenv(vdev_t *vd, char *envmap) +{ + zio_t *zio; + spa_t *spa = vd->vdev_spa; + vdev_boot_envblock_t *bootenv; + int flags = ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_CANFAIL; + int error = ENXIO; + + if (strlen(envmap) >= sizeof (bootenv->vbe_bootenv)) { + return (SET_ERROR(E2BIG)); + } + + ASSERT(spa_config_held(spa, SCL_ALL, RW_WRITER) == SCL_ALL); + + for (int c = 0; c < vd->vdev_children; c++) { + int child_err = vdev_label_write_bootenv(vd->vdev_child[c], + envmap); + /* + * As long as any of the disks managed to write all of their + * labels successfully, return success. + */ + if (child_err == 0) + error = child_err; + } + + if (!vd->vdev_ops->vdev_op_leaf || vdev_is_dead(vd) || + !vdev_writeable(vd)) { + return (error); + } + ASSERT3U(sizeof (*bootenv), ==, VDEV_PAD_SIZE); + abd_t *abd = abd_alloc_for_io(VDEV_PAD_SIZE, B_TRUE); + abd_zero(abd, VDEV_PAD_SIZE); + bootenv = abd_borrow_buf_copy(abd, VDEV_PAD_SIZE); + + char *buf = bootenv->vbe_bootenv; + (void) strlcpy(buf, envmap, sizeof (bootenv->vbe_bootenv)); + bootenv->vbe_version = VB_RAW; + abd_return_buf_copy(abd, bootenv, VDEV_PAD_SIZE); + +retry: + zio = zio_root(spa, NULL, NULL, flags); + for (int l = 0; l < VDEV_LABELS / 2; l++) { + vdev_label_write(zio, vd, l, abd, + offsetof(vdev_label_t, vl_be), + VDEV_PAD_SIZE, NULL, NULL, flags); + } + + error = zio_wait(zio); + if (error != 0 && !(flags & ZIO_FLAG_TRYHARD)) { + flags |= ZIO_FLAG_TRYHARD; + goto retry; + } + + abd_free(abd); + return (error); +} + +int vdev_label_write_pad2(vdev_t *vd, const char *buf, size_t size) { spa_t *spa = vd->vdev_spa; @@ -1042,7 +1184,7 @@ vdev_label_write_pad2(vdev_t *vd, const char *buf, siz retry: zio = zio_root(spa, NULL, NULL, flags); vdev_label_write(zio, vd, 0, pad2, - offsetof(vdev_label_t, vl_pad2), + offsetof(vdev_label_t, vl_be), VDEV_PAD_SIZE, NULL, NULL, flags); error = zio_wait(zio); if (error != 0 && !(flags & ZIO_FLAG_TRYHARD)) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Aug 5 14:32:20 2020 (r363911) @@ -3654,6 +3654,58 @@ zfs_ioc_log_history(const char *unused, nvlist_t *innv return (error); } +/* + * This ioctl is used to set the bootenv configuration on the current + * pool. This configuration is stored in the second padding area of the label, + * and it is used by the GRUB bootloader used on Linux to store the contents + * of the grubenv file. The file is stored as raw ASCII, and is protected by + * an embedded checksum. By default, GRUB will check if the boot filesystem + * supports storing the environment data in a special location, and if so, + * will invoke filesystem specific logic to retrieve it. This can be overriden + * by a variable, should the user so desire. + */ +/* ARGSUSED */ +static const zfs_ioc_key_t zfs_keys_set_bootenv[] = { + {"envmap", DATA_TYPE_STRING, 0}, +}; + +static int +zfs_ioc_set_bootenv(const char *name, nvlist_t *innvl, nvlist_t *outnvl) +{ + char *envmap; + int error; + spa_t *spa; + + envmap = fnvlist_lookup_string(innvl, "envmap"); + if ((error = spa_open(name, &spa, FTAG)) != 0) + return (error); + spa_vdev_state_enter(spa, SCL_ALL); + error = vdev_label_write_bootenv(spa->spa_root_vdev, envmap); + (void) spa_vdev_state_exit(spa, NULL, 0); + spa_close(spa, FTAG); + return (error); +} + +static const zfs_ioc_key_t zfs_keys_get_bootenv[] = { + /* no nvl keys */ +}; + + /* ARGSUSED */ +static int +zfs_ioc_get_bootenv(const char *name, nvlist_t *innvl, nvlist_t *outnvl) +{ + spa_t *spa; + int error; + + if ((error = spa_open(name, &spa, FTAG)) != 0) + return (error); + spa_vdev_state_enter(spa, SCL_ALL); + error = vdev_label_read_bootenv(spa->spa_root_vdev, outnvl); + (void) spa_vdev_state_exit(spa, NULL, 0); + spa_close(spa, FTAG); + return (error); +} + #ifdef __FreeBSD__ static const zfs_ioc_key_t zfs_keys_nextboot[] = { {"command", DATA_TYPE_STRING, 0}, @@ -6566,6 +6618,16 @@ zfs_ioctl_init(void) zfs_ioctl_register("reopen", ZFS_IOC_POOL_REOPEN, zfs_ioc_pool_reopen, zfs_secpolicy_config, POOL_NAME, POOL_CHECK_SUSPENDED, B_TRUE, B_TRUE, zfs_keys_pool_reopen, ARRAY_SIZE(zfs_keys_pool_reopen)); + + zfs_ioctl_register("set_bootenv", ZFS_IOC_SET_BOOTENV, + zfs_ioc_set_bootenv, zfs_secpolicy_config, POOL_NAME, + POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY, B_FALSE, B_TRUE, + zfs_keys_set_bootenv, ARRAY_SIZE(zfs_keys_set_bootenv)); + + zfs_ioctl_register("get_bootenv", ZFS_IOC_GET_BOOTENV, + zfs_ioc_get_bootenv, zfs_secpolicy_none, POOL_NAME, + POOL_CHECK_SUSPENDED, B_FALSE, B_TRUE, + zfs_keys_get_bootenv, ARRAY_SIZE(zfs_keys_get_bootenv)); /* IOCTLS that use the legacy function signature */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed Aug 5 14:08:44 2020 (r363910) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed Aug 5 14:32:20 2020 (r363911) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2018 by Delphix. All rights reserved. + * Copyright (c) 2011, 2020 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -1057,6 +1057,8 @@ typedef enum zfs_ioc { ZFS_IOC_POOL_DISCARD_CHECKPOINT, ZFS_IOC_POOL_INITIALIZE, ZFS_IOC_POOL_SYNC, + ZFS_IOC_SET_BOOTENV, + ZFS_IOC_GET_BOOTENV, ZFS_IOC_LAST } zfs_ioc_t; From owner-svn-src-all@freebsd.org Wed Aug 5 14:38:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F316F37860C; Wed, 5 Aug 2020 14:38:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMDlL6Fhsz4v15; Wed, 5 Aug 2020 14:38:54 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9DE117822; Wed, 5 Aug 2020 14:38:54 +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 075EcsIG001787; Wed, 5 Aug 2020 14:38:54 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075EcsZq001786; Wed, 5 Aug 2020 14:38:54 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008051438.075EcsZq001786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Aug 2020 14:38:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363912 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 363912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 14:38:55 -0000 Author: kevans Date: Wed Aug 5 14:38:54 2020 New Revision: 363912 URL: https://svnweb.freebsd.org/changeset/base/363912 Log: MFC r360833, r360882, r361149: installworld certctl nop The last one reverts the other two, but here are the commit messages: r360833: installworld: attempt a certctl rehash at the tail end This can be run as root or normal user with no problem; if they hadn't twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL + WITH_CAROOT with a populated /etc/ssl that they can then use with an appropriate *ssl from somewhere else. Cross-builds are fine because this will always use the host certctl, or just nag if it's missing and it wasn't a WITHOUT_CAROOT build. r360882: buildworld: add back in missing semicolon if foo; then blah else blah; fi has a drastically different meaning than if foo; then blah; else blah; fi. Fix it. r361149: Revert r360833, r360882: certctl rehash in installworld This was solving the correct-ish problem in the wrong place. Noted by brooks; while he didn't request a prompt revert, doing so now will facilitate proper testing for the revised version of this. Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-all@freebsd.org Wed Aug 5 14:40:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED24F378880; Wed, 5 Aug 2020 14:40:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMDmn4kw6z4vK9; Wed, 5 Aug 2020 14:40:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85DB117768; Wed, 5 Aug 2020 14:40:09 +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 075Ee9br001939; Wed, 5 Aug 2020 14:40:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075Ee9pL001938; Wed, 5 Aug 2020 14:40:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008051440.075Ee9pL001938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Aug 2020 14:40:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363913 - stable/12/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 363913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 14:40:10 -0000 Author: kevans Date: Wed Aug 5 14:40:09 2020 New Revision: 363913 URL: https://svnweb.freebsd.org/changeset/base/363913 Log: MFC r361257: bsdinstall: do a `certctl rehash` upon installation of config If certctl is installed on the system we're configuring, do a certctl rehash. Note that certctl may not be present if the world we've installed was built either WITHOUT_OPENSSL or WITHOUT_CAROOT. In this scenario, we don't currently see if the host has a certctl as this may be an indication that the system *shouldn't* have certs installed into /etc/ssl. Modified: stable/12/usr.sbin/bsdinstall/scripts/config Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/scripts/config ============================================================================== --- stable/12/usr.sbin/bsdinstall/scripts/config Wed Aug 5 14:38:54 2020 (r363912) +++ stable/12/usr.sbin/bsdinstall/scripts/config Wed Aug 5 14:40:09 2020 (r363913) @@ -55,6 +55,9 @@ cp $BSDINSTALL_TMPBOOT/* $BSDINSTALL_CHROOT/boot # Set up other things from installed config chroot $BSDINSTALL_CHROOT /usr/bin/newaliases > /dev/null 2>&1 +if [ -x $BSDINSTALL_CHROOT/usr/sbin/certctl ]; then + chroot $BSDINSTALL_CHROOT /usr/sbin/certctl rehash +fi exit 0 From owner-svn-src-all@freebsd.org Wed Aug 5 14:42:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C85683786D6; Wed, 5 Aug 2020 14:42:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMDqp4xmmz4vRh; Wed, 5 Aug 2020 14:42:46 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C78817BC7; Wed, 5 Aug 2020 14:42: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 075EgkAw008011; Wed, 5 Aug 2020 14:42:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075EgkPS008009; Wed, 5 Aug 2020 14:42:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202008051442.075EgkPS008009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 5 Aug 2020 14:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363914 - in stable/12/stand: common efi/include efi/libefi X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12/stand: common efi/include efi/libefi X-SVN-Commit-Revision: 363914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 14:42:46 -0000 Author: kevans Date: Wed Aug 5 14:42:45 2020 New Revision: 363914 URL: https://svnweb.freebsd.org/changeset/base/363914 Log: MFC r362564: stand: remove redundant declarations These are picked out by the amd64-gcc6 build; time() is declared in and delay() is declared in . These are the correct places for these in stand/, so remove the duplicate declarations and make sure the delay() consumer in libefi that depended on the extra delay() declaration includes . Modified: stable/12/stand/common/bootstrap.h stable/12/stand/efi/include/efilib.h stable/12/stand/efi/libefi/efihttp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/common/bootstrap.h ============================================================================== --- stable/12/stand/common/bootstrap.h Wed Aug 5 14:40:09 2020 (r363913) +++ stable/12/stand/common/bootstrap.h Wed Aug 5 14:42:45 2020 (r363914) @@ -345,8 +345,6 @@ void delay(int delay); void dev_cleanup(void); -time_t time(time_t *tloc); - #ifndef CTASSERT #define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") #endif Modified: stable/12/stand/efi/include/efilib.h ============================================================================== --- stable/12/stand/efi/include/efilib.h Wed Aug 5 14:40:09 2020 (r363913) +++ stable/12/stand/efi/include/efilib.h Wed Aug 5 14:42:45 2020 (r363914) @@ -111,7 +111,6 @@ EFI_STATUS efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABL EFI_STATUS main(int argc, CHAR16 *argv[]); void efi_exit(EFI_STATUS status) __dead2; -void delay(int usecs); /* EFI environment initialization. */ void efi_init_environment(void); Modified: stable/12/stand/efi/libefi/efihttp.c ============================================================================== --- stable/12/stand/efi/libefi/efihttp.c Wed Aug 5 14:40:09 2020 (r363913) +++ stable/12/stand/efi/libefi/efihttp.c Wed Aug 5 14:42:45 2020 (r363914) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include From owner-svn-src-all@freebsd.org Wed Aug 5 15:15:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB2F03796AA; Wed, 5 Aug 2020 15:15:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMFZ536Qtz3T63; Wed, 5 Aug 2020 15:15:57 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x729.google.com with SMTP id b14so40262807qkn.4; Wed, 05 Aug 2020 08:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=5qSL6iIb27vI/AJnoR0FGEu/hyTM6yGlnF6Amoxmdfg=; b=hGxwBe1kv4nNaZ7FFPJXQOVcU+FtvXeX7LR31rgrFwoAyckg4Ql3CcmLdZ7+RRtFqq oGvNX0FlQcX2HaqQN4QKo8F/HKMarSHWxEDWjR2qWFgzEcpgol1SNwcP9hKKVVZ6y5Re J76inQnLDHh5T5eSV0xw9rn+c5jWQROfNFRfFB8ZG7dLq6dLQoAT8+O1mehGtxvySxW8 u9flbXaN5veZj+BnCaZZwS+MbNriCzutB4DXh/4UzlvZYXraYwSk2QsK+nHEUCEojNN3 l2zr13D7QTdlwBPoROj5EqkhAVHqtLtMRkFXGyy5enYINtvAZE8X1utAZoFruiEN4KoH Dzqw== 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; bh=5qSL6iIb27vI/AJnoR0FGEu/hyTM6yGlnF6Amoxmdfg=; b=iWGQ9GqEDNgsmd75p4tfwSn0LQsKupdXgEFZsioblA6fpLXfzgpmDFN7xt08Sq95d5 D4oGp0jc9w8LKaH0XHpqwe3y0vuhJv7tLmzLJi4E4JWMnllnxlLuU/TmImMC6eOaBQg4 vvGHxGuBb252AxqOAFyTtEPQPVv64mP2YNTIRYBDxTm+dweAfZnnFlkTlgGIR2Ku7L33 Tdt2hbe82woIdBnEaFnIsTJrU2RS5m4ovlCa/YkSRQxMQUs8vRQEBxoZ/xEtnuC/fidY xrCYcM7+dUvi0BBDZ0UOEhjMHOlwTp+bYbEFglb+/G2bfmZVm903t6WlfdQBDFvWJWgG XpVw== X-Gm-Message-State: AOAM530L+DUZqWXcHhvWYDz8pnUZtRk4mPYmuQBHnN56IUo+xKp38Px1 XigWHJl3uVcuK9QxV9xxpZnw8kCNlXA= X-Google-Smtp-Source: ABdhPJyXJfT8FFa9ADuLerkeOy/isn5ZcP8pjb053HK9hwfH6GYvEuinAsMqbqUvGxVve3rXdZFiGA== X-Received: by 2002:a37:d4c:: with SMTP id 73mr3553685qkn.445.1596640556032; Wed, 05 Aug 2020 08:15:56 -0700 (PDT) Received: from raichu (toroon0560w-lp130-08-67-71-176-35.dsl.bell.ca. [67.71.176.35]) by smtp.gmail.com with ESMTPSA id o17sm2241298qtr.13.2020.08.05.08.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 08:15:55 -0700 (PDT) Sender: Mark Johnston Date: Wed, 5 Aug 2020 11:15:53 -0400 From: Mark Johnston To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r363875 - head/sys/ufs/ffs Message-ID: <20200805151553.GC75799@raichu> References: <202008042309.074N9Gao027102@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202008042309.074N9Gao027102@repo.freebsd.org> X-Rspamd-Queue-Id: 4BMFZ536Qtz3T63 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 15:15:57 -0000 On Tue, Aug 04, 2020 at 11:09:16PM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Tue Aug 4 23:09:15 2020 > New Revision: 363875 > URL: https://svnweb.freebsd.org/changeset/base/363875 > > Log: > ufs: only pass LK_ADAPTIVE if LK_NODDLKTREAT is set > > This restores the pre-adaptive spinning state for SU which livelocks > otherwise. Note this is a bug in SU. > > Reported by: pho What is the bug? From owner-svn-src-all@freebsd.org Wed Aug 5 15:20:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF8D3379852; Wed, 5 Aug 2020 15:20:08 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMFfw5dwFz3TNp; Wed, 5 Aug 2020 15:20:08 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5E471825E; Wed, 5 Aug 2020 15:20:08 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075FK8s9026740; Wed, 5 Aug 2020 15:20:08 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075FK7ho026737; Wed, 5 Aug 2020 15:20:07 GMT (envelope-from se@FreeBSD.org) Message-Id: <202008051520.075FK7ho026737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Wed, 5 Aug 2020 15:20:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363915 - in head/contrib/bc: . locales src X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/contrib/bc: . locales src X-SVN-Commit-Revision: 363915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 15:20:08 -0000 Author: se Date: Wed Aug 5 15:20:07 2020 New Revision: 363915 URL: https://svnweb.freebsd.org/changeset/base/363915 Log: Upgrade to version 3.1.5 This version fixes some entries in the chinese message catalogs which could lead to program crashes when used. Modified: head/contrib/bc/Makefile.in head/contrib/bc/NEWS.md head/contrib/bc/locales/zh_CN.GB18030.msg head/contrib/bc/locales/zh_CN.GB2312.msg head/contrib/bc/locales/zh_CN.GBK.msg head/contrib/bc/locales/zh_CN.UTF-8.msg head/contrib/bc/locales/zh_CN.eucCN.msg head/contrib/bc/src/program.c head/contrib/bc/src/vm.c Directory Properties: head/contrib/bc/ (props changed) Modified: head/contrib/bc/Makefile.in ============================================================================== --- head/contrib/bc/Makefile.in Wed Aug 5 14:42:45 2020 (r363914) +++ head/contrib/bc/Makefile.in Wed Aug 5 15:20:07 2020 (r363915) @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.1.4 +VERSION = 3.1.5 SRC = %%SRC%% OBJ = %%OBJ%% Modified: head/contrib/bc/NEWS.md ============================================================================== --- head/contrib/bc/NEWS.md Wed Aug 5 14:42:45 2020 (r363914) +++ head/contrib/bc/NEWS.md Wed Aug 5 15:20:07 2020 (r363915) @@ -1,5 +1,13 @@ # News +## 3.1.5 + +This is a production release that fixes the Chinese locales (which caused `bc` +to crash) and a crash caused by `bc` executing code when it should not have been +able to. + +***ALL USERS SHOULD UPGRADE.*** + ## 3.1.4 This is a production release that fixes one bug, changes two behaviors, and Modified: head/contrib/bc/locales/zh_CN.GB18030.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.GB2312.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.GBK.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.UTF-8.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/locales/zh_CN.eucCN.msg ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bc/src/program.c ============================================================================== --- head/contrib/bc/src/program.c Wed Aug 5 14:42:45 2020 (r363914) +++ head/contrib/bc/src/program.c Wed Aug 5 15:20:07 2020 (r363915) @@ -1271,11 +1271,12 @@ static void bc_program_divmod(BcProgram *p) { BcNum *n1, *n2; size_t req; + bc_vec_expand(&p->results, p->results.len + 2); + + // We don't need to update the pointer because + // the capacity is enough due to the line above. res2 = bc_program_prepResult(p); res = bc_program_prepResult(p); - - // Update the pointer, just in case. - res2 = bc_vec_item_rev(&p->results, 1); bc_program_binOpPrep(p, &opd1, &n1, &opd2, &n2, 2); Modified: head/contrib/bc/src/vm.c ============================================================================== --- head/contrib/bc/src/vm.c Wed Aug 5 14:42:45 2020 (r363914) +++ head/contrib/bc/src/vm.c Wed Aug 5 15:20:07 2020 (r363915) @@ -464,7 +464,7 @@ static void bc_vm_process(const char *text) { while (BC_PARSE_CAN_PARSE(vm.prs)) vm.parse(&vm.prs); - bc_program_exec(&vm.prog); + if(BC_IS_DC || !BC_PARSE_NO_EXEC(&vm.prs)) bc_program_exec(&vm.prog); assert(BC_IS_DC || vm.prog.results.len == 0); From owner-svn-src-all@freebsd.org Wed Aug 5 15:33:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0ABB6379B5B; Wed, 5 Aug 2020 15:33:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMFyN6Y3Pz3V3R; Wed, 5 Aug 2020 15:33:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3F34182C0; Wed, 5 Aug 2020 15:33:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075FXW6E038625; Wed, 5 Aug 2020 15:33:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075FXWfB038624; Wed, 5 Aug 2020 15:33:32 GMT (envelope-from cy@FreeBSD.org) Message-Id: <202008051533.075FXWfB038624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 5 Aug 2020 15:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363916 - head/contrib/ipfilter/iplang X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter/iplang X-SVN-Commit-Revision: 363916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 15:33:33 -0000 Author: cy Date: Wed Aug 5 15:33:32 2020 New Revision: 363916 URL: https://svnweb.freebsd.org/changeset/base/363916 Log: Continued ipfilter #ifdef cleanup. The r343701 log entry contains a complete description. MFC after: 1 week Modified: head/contrib/ipfilter/iplang/iplang_y.y Modified: head/contrib/ipfilter/iplang/iplang_y.y ============================================================================== --- head/contrib/ipfilter/iplang/iplang_y.y Wed Aug 5 15:20:07 2020 (r363915) +++ head/contrib/ipfilter/iplang/iplang_y.y Wed Aug 5 15:33:32 2020 (r363916) @@ -30,11 +30,9 @@ #include #include #include -#ifndef linux # include # include # include -#endif #include #include #include @@ -589,29 +587,7 @@ struct statetoopt tosecopts[] = { { 0, 0 } }; -#ifdef bsdi -struct ether_addr * -ether_aton(s) - char *s; -{ - static struct ether_addr n; - u_int i[6]; - if (sscanf(s, " %x:%x:%x:%x:%x:%x ", &i[0], &i[1], - &i[2], &i[3], &i[4], &i[5]) == 6) { - n.ether_addr_octet[0] = (u_char)i[0]; - n.ether_addr_octet[1] = (u_char)i[1]; - n.ether_addr_octet[2] = (u_char)i[2]; - n.ether_addr_octet[3] = (u_char)i[3]; - n.ether_addr_octet[4] = (u_char)i[4]; - n.ether_addr_octet[5] = (u_char)i[5]; - return &n; - } - return NULL; -} -#endif - - struct in_addr getipv4addr(arg) char *arg; { @@ -645,7 +621,6 @@ struct ether_addr *buf; { struct ether_addr *e; -#if !defined(hpux) && !defined(linux) e = ether_aton(arg); if (!e) fprintf(stderr, "Invalid ethernet address: %s\n", arg); @@ -657,9 +632,6 @@ struct ether_addr *buf; sizeof(e->ether_addr_octet)); # endif return e; -#else - return NULL; -#endif } @@ -1584,9 +1556,7 @@ int arg; void set_icmpmtu(arg) int arg; { -#if BSD >= 199306 icmp->icmp_nextmtu = htons(arg); -#endif } From owner-svn-src-all@freebsd.org Wed Aug 5 16:36:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE03C37B0C5; Wed, 5 Aug 2020 16:36:54 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMHMV4sG1z3YQS; Wed, 5 Aug 2020 16:36:54 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from mousie.catspoiler.org (unknown [76.212.85.177]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: truckman) by smtp.freebsd.org (Postfix) with ESMTPSA id EB5D820610; Wed, 5 Aug 2020 16:36:53 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Date: Wed, 5 Aug 2020 09:36:52 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r363891 - head/sys/kern To: Mateusz Guzik cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <202008050924.0759Oc3H010909@repo.freebsd.org> Message-ID: References: <202008050924.0759Oc3H010909@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-Disposition: INLINE X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 16:36:54 -0000 On 5 Aug, Mateusz Guzik wrote: > Author: mjg > Date: Wed Aug 5 09:24:38 2020 > New Revision: 363891 > URL: https://svnweb.freebsd.org/changeset/base/363891 > > Log: > cache: reduce zone alignment to 8 bytes > > It used to be sizeof of the given struct to accomodate for 32 bit mips > doing 64 bit loads, but the same can be achieved with requireing just > 64 bit alignment. > > While here reorder struct namecache so that most commonly used fields > are closer. > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > ============================================================================== > --- head/sys/kern/vfs_cache.c Wed Aug 5 09:24:00 2020 (r363890) > +++ head/sys/kern/vfs_cache.c Wed Aug 5 09:24:38 2020 (r363891) > @@ -122,9 +122,9 @@ _Static_assert(sizeof(struct negstate) <= sizeof(struc > "the state must fit in a union with a pointer without growing it"); > > struct namecache { > - CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ > LIST_ENTRY(namecache) nc_src; /* source vnode list */ > TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ > + CK_LIST_ENTRY(namecache) nc_hash;/* hash chain */ > struct vnode *nc_dvp; /* vnode of parent of name */ > union { > struct vnode *nu_vp; /* vnode the name refers to */ > @@ -142,6 +142,8 @@ struct namecache { > * to be stored. The nc_dotdottime field is used when a cache entry is mapping > * both a non-dotdot directory name plus dotdot for the directory's > * parent. > + * > + * See below for alignment requirement. > */ > struct namecache_ts { > struct timespec nc_time; /* timespec provided by fs */ > @@ -150,6 +152,14 @@ struct namecache_ts { > struct namecache nc_nc; > }; > > +/* > + * At least mips n32 performs 64-bit accesses to timespec as found > + * in namecache_ts and requires them to be aligned. Since others > + * may be in the same spot suffer a little bit and enforce the > + * alignment for everyone. Note this is a nop for 64-bit platforms. > + */ > +#define CACHE_ZONE_ALIGNMENT UMA_ALIGNOF(time_t) time_t is only 32 bits on i386 From owner-svn-src-all@freebsd.org Wed Aug 5 17:06:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D7F237BA30; Wed, 5 Aug 2020 17:06:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ1L74Fxz3ZgT; Wed, 5 Aug 2020 17:06:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D204219714; Wed, 5 Aug 2020 17:06: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 075H6EGe094161; Wed, 5 Aug 2020 17:06:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075H6EBo094160; Wed, 5 Aug 2020 17:06:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008051706.075H6EBo094160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Aug 2020 17:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r363917 - head/sys/compat/freebsd32 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/compat/freebsd32 X-SVN-Commit-Revision: 363917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 17:06:15 -0000 Author: markj Date: Wed Aug 5 17:06:14 2020 New Revision: 363917 URL: https://svnweb.freebsd.org/changeset/base/363917 Log: Fix a TOCTOU vulnerability in freebsd32_copyin_control(). PR: 248257 Reported by: m00nbsd working with Trend Micro Zero Day Initiative Reviewed by: kib Security: SA-20:23.sendmsg Security: CVE-2020-7460 Security: ZDI-CAN-11543 Modified: head/sys/compat/freebsd32/freebsd32_misc.c Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 5 15:33:32 2020 (r363916) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 5 17:06:14 2020 (r363917) @@ -1449,78 +1449,90 @@ freebsd32_recvmsg(td, uap) static int freebsd32_copyin_control(struct mbuf **mp, caddr_t buf, u_int buflen) { + struct cmsghdr *cm; struct mbuf *m; - void *md; - u_int idx, len, msglen; + void *in, *in1, *md; + u_int msglen, outlen; int error; - buflen = FREEBSD32_ALIGN(buflen); - if (buflen > MCLBYTES) return (EINVAL); + in = malloc(buflen, M_TEMP, M_WAITOK); + error = copyin(buf, in, buflen); + if (error != 0) + goto out; + /* - * Iterate over the buffer and get the length of each message - * in there. This has 32-bit alignment and padding. Use it to - * determine the length of these messages when using 64-bit - * alignment and padding. + * Make a pass over the input buffer to determine the amount of space + * required for 64 bit-aligned copies of the control messages. */ - idx = 0; - len = 0; - while (idx < buflen) { - error = copyin(buf + idx, &msglen, sizeof(msglen)); - if (error) - return (error); - if (msglen < sizeof(struct cmsghdr)) - return (EINVAL); - msglen = FREEBSD32_ALIGN(msglen); - if (idx + msglen > buflen) - return (EINVAL); - idx += msglen; - msglen += CMSG_ALIGN(sizeof(struct cmsghdr)) - - FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - len += CMSG_ALIGN(msglen); - } - - if (len > MCLBYTES) - return (EINVAL); - - m = m_get(M_WAITOK, MT_CONTROL); - if (len > MLEN) - MCLGET(m, M_WAITOK); - m->m_len = len; - - md = mtod(m, void *); + in1 = in; + outlen = 0; while (buflen > 0) { - error = copyin(buf, md, sizeof(struct cmsghdr)); - if (error) + if (buflen < sizeof(*cm)) { + error = EINVAL; break; - msglen = *(u_int *)md; - msglen = FREEBSD32_ALIGN(msglen); + } + cm = (struct cmsghdr *)in1; + if (cm->cmsg_len < FREEBSD32_ALIGN(sizeof(*cm))) { + error = EINVAL; + break; + } + msglen = FREEBSD32_ALIGN(cm->cmsg_len); + if (msglen > buflen || msglen < cm->cmsg_len) { + error = EINVAL; + break; + } + buflen -= msglen; - /* Modify the message length to account for alignment. */ - *(u_int *)md = msglen + CMSG_ALIGN(sizeof(struct cmsghdr)) - - FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + in1 = (char *)in1 + msglen; + outlen += CMSG_ALIGN(sizeof(*cm)) + + CMSG_ALIGN(msglen - FREEBSD32_ALIGN(sizeof(*cm))); + } + if (error == 0 && outlen > MCLBYTES) { + /* + * XXXMJ This implies that the upper limit on 32-bit aligned + * control messages is less than MCLBYTES, and so we are not + * perfectly compatible. However, there is no platform + * guarantee that mbuf clusters larger than MCLBYTES can be + * allocated. + */ + error = EINVAL; + } + if (error != 0) + goto out; - md = (char *)md + CMSG_ALIGN(sizeof(struct cmsghdr)); - buf += FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - buflen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + m = m_get2(outlen, M_WAITOK, MT_CONTROL, 0); + m->m_len = outlen; + md = mtod(m, void *); - msglen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - if (msglen > 0) { - error = copyin(buf, md, msglen); - if (error) - break; - md = (char *)md + CMSG_ALIGN(msglen); - buf += msglen; - buflen -= msglen; - } + /* + * Make a second pass over input messages, copying them into the output + * buffer. + */ + in1 = in; + while (outlen > 0) { + /* Copy the message header and align the length field. */ + cm = md; + memcpy(cm, in1, sizeof(*cm)); + msglen = cm->cmsg_len - FREEBSD32_ALIGN(sizeof(*cm)); + cm->cmsg_len = CMSG_ALIGN(sizeof(*cm)) + msglen; + + /* Copy the message body. */ + in1 = (char *)in1 + FREEBSD32_ALIGN(sizeof(*cm)); + md = (char *)md + CMSG_ALIGN(sizeof(*cm)); + memcpy(md, in1, msglen); + in1 = (char *)in1 + FREEBSD32_ALIGN(msglen); + md = (char *)md + CMSG_ALIGN(msglen); + KASSERT(outlen >= CMSG_ALIGN(sizeof(*cm)) + CMSG_ALIGN(msglen), + ("outlen %u underflow, msglen %u", outlen, msglen)); + outlen -= CMSG_ALIGN(sizeof(*cm)) + CMSG_ALIGN(msglen); } - if (error) - m_free(m); - else - *mp = m; + *mp = m; +out: + free(in, M_TEMP); return (error); } From owner-svn-src-all@freebsd.org Wed Aug 5 17:07:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07E2037BE19; Wed, 5 Aug 2020 17:07:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ2T6Rpcz3ZqT; Wed, 5 Aug 2020 17:07:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1DFD1943A; Wed, 5 Aug 2020 17:07:13 +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 075H7DkG094276; Wed, 5 Aug 2020 17:07:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075H7Dc9094275; Wed, 5 Aug 2020 17:07:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008051707.075H7Dc9094275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Aug 2020 17:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r363918 - stable/12/sys/compat/freebsd32 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/compat/freebsd32 X-SVN-Commit-Revision: 363918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 17:07:14 -0000 Author: markj Date: Wed Aug 5 17:07:13 2020 New Revision: 363918 URL: https://svnweb.freebsd.org/changeset/base/363918 Log: MFC r363917: Fix a TOCTOU vulnerability in freebsd32_copyin_control(). PR: 248257 Reported by: m00nbsd working with Trend Micro Zero Day Initiative Reviewed by: kib Security: SA-20:23.sendmsg Security: CVE-2020-7460 Security: ZDI-CAN-11543 Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/12/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 5 17:06:14 2020 (r363917) +++ stable/12/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 5 17:07:13 2020 (r363918) @@ -1260,78 +1260,90 @@ freebsd32_recvmsg(td, uap) static int freebsd32_copyin_control(struct mbuf **mp, caddr_t buf, u_int buflen) { + struct cmsghdr *cm; struct mbuf *m; - void *md; - u_int idx, len, msglen; + void *in, *in1, *md; + u_int msglen, outlen; int error; - buflen = FREEBSD32_ALIGN(buflen); - if (buflen > MCLBYTES) return (EINVAL); + in = malloc(buflen, M_TEMP, M_WAITOK); + error = copyin(buf, in, buflen); + if (error != 0) + goto out; + /* - * Iterate over the buffer and get the length of each message - * in there. This has 32-bit alignment and padding. Use it to - * determine the length of these messages when using 64-bit - * alignment and padding. + * Make a pass over the input buffer to determine the amount of space + * required for 64 bit-aligned copies of the control messages. */ - idx = 0; - len = 0; - while (idx < buflen) { - error = copyin(buf + idx, &msglen, sizeof(msglen)); - if (error) - return (error); - if (msglen < sizeof(struct cmsghdr)) - return (EINVAL); - msglen = FREEBSD32_ALIGN(msglen); - if (idx + msglen > buflen) - return (EINVAL); - idx += msglen; - msglen += CMSG_ALIGN(sizeof(struct cmsghdr)) - - FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - len += CMSG_ALIGN(msglen); - } - - if (len > MCLBYTES) - return (EINVAL); - - m = m_get(M_WAITOK, MT_CONTROL); - if (len > MLEN) - MCLGET(m, M_WAITOK); - m->m_len = len; - - md = mtod(m, void *); + in1 = in; + outlen = 0; while (buflen > 0) { - error = copyin(buf, md, sizeof(struct cmsghdr)); - if (error) + if (buflen < sizeof(*cm)) { + error = EINVAL; break; - msglen = *(u_int *)md; - msglen = FREEBSD32_ALIGN(msglen); + } + cm = (struct cmsghdr *)in1; + if (cm->cmsg_len < FREEBSD32_ALIGN(sizeof(*cm))) { + error = EINVAL; + break; + } + msglen = FREEBSD32_ALIGN(cm->cmsg_len); + if (msglen > buflen || msglen < cm->cmsg_len) { + error = EINVAL; + break; + } + buflen -= msglen; - /* Modify the message length to account for alignment. */ - *(u_int *)md = msglen + CMSG_ALIGN(sizeof(struct cmsghdr)) - - FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + in1 = (char *)in1 + msglen; + outlen += CMSG_ALIGN(sizeof(*cm)) + + CMSG_ALIGN(msglen - FREEBSD32_ALIGN(sizeof(*cm))); + } + if (error == 0 && outlen > MCLBYTES) { + /* + * XXXMJ This implies that the upper limit on 32-bit aligned + * control messages is less than MCLBYTES, and so we are not + * perfectly compatible. However, there is no platform + * guarantee that mbuf clusters larger than MCLBYTES can be + * allocated. + */ + error = EINVAL; + } + if (error != 0) + goto out; - md = (char *)md + CMSG_ALIGN(sizeof(struct cmsghdr)); - buf += FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - buflen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + m = m_get2(outlen, M_WAITOK, MT_CONTROL, 0); + m->m_len = outlen; + md = mtod(m, void *); - msglen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - if (msglen > 0) { - error = copyin(buf, md, msglen); - if (error) - break; - md = (char *)md + CMSG_ALIGN(msglen); - buf += msglen; - buflen -= msglen; - } + /* + * Make a second pass over input messages, copying them into the output + * buffer. + */ + in1 = in; + while (outlen > 0) { + /* Copy the message header and align the length field. */ + cm = md; + memcpy(cm, in1, sizeof(*cm)); + msglen = cm->cmsg_len - FREEBSD32_ALIGN(sizeof(*cm)); + cm->cmsg_len = CMSG_ALIGN(sizeof(*cm)) + msglen; + + /* Copy the message body. */ + in1 = (char *)in1 + FREEBSD32_ALIGN(sizeof(*cm)); + md = (char *)md + CMSG_ALIGN(sizeof(*cm)); + memcpy(md, in1, msglen); + in1 = (char *)in1 + FREEBSD32_ALIGN(msglen); + md = (char *)md + CMSG_ALIGN(msglen); + KASSERT(outlen >= CMSG_ALIGN(sizeof(*cm)) + CMSG_ALIGN(msglen), + ("outlen %u underflow, msglen %u", outlen, msglen)); + outlen -= CMSG_ALIGN(sizeof(*cm)) + CMSG_ALIGN(msglen); } - if (error) - m_free(m); - else - *mp = m; + *mp = m; +out: + free(in, M_TEMP); return (error); } From owner-svn-src-all@freebsd.org Wed Aug 5 17:08:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B99E37BE23; Wed, 5 Aug 2020 17:08:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ3R2CY8z3b4y; Wed, 5 Aug 2020 17:08:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F35F1969E; Wed, 5 Aug 2020 17:08:03 +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 075H82aU094371; Wed, 5 Aug 2020 17:08:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075H82SU094370; Wed, 5 Aug 2020 17:08:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202008051708.075H82SU094370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 5 Aug 2020 17:08:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r363919 - stable/11/sys/compat/freebsd32 X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/compat/freebsd32 X-SVN-Commit-Revision: 363919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 17:08:03 -0000 Author: markj Date: Wed Aug 5 17:08:02 2020 New Revision: 363919 URL: https://svnweb.freebsd.org/changeset/base/363919 Log: MFC r363917: Fix a TOCTOU vulnerability in freebsd32_copyin_control(). PR: 248257 Reported by: m00nbsd working with Trend Micro Zero Day Initiative Reviewed by: kib Security: SA-20:23.sendmsg Security: CVE-2020-7460 Security: ZDI-CAN-11543 Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 5 17:07:13 2020 (r363918) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Wed Aug 5 17:08:02 2020 (r363919) @@ -1112,78 +1112,90 @@ freebsd32_recvmsg(td, uap) static int freebsd32_copyin_control(struct mbuf **mp, caddr_t buf, u_int buflen) { + struct cmsghdr *cm; struct mbuf *m; - void *md; - u_int idx, len, msglen; + void *in, *in1, *md; + u_int msglen, outlen; int error; - buflen = FREEBSD32_ALIGN(buflen); - if (buflen > MCLBYTES) return (EINVAL); + in = malloc(buflen, M_TEMP, M_WAITOK); + error = copyin(buf, in, buflen); + if (error != 0) + goto out; + /* - * Iterate over the buffer and get the length of each message - * in there. This has 32-bit alignment and padding. Use it to - * determine the length of these messages when using 64-bit - * alignment and padding. + * Make a pass over the input buffer to determine the amount of space + * required for 64 bit-aligned copies of the control messages. */ - idx = 0; - len = 0; - while (idx < buflen) { - error = copyin(buf + idx, &msglen, sizeof(msglen)); - if (error) - return (error); - if (msglen < sizeof(struct cmsghdr)) - return (EINVAL); - msglen = FREEBSD32_ALIGN(msglen); - if (idx + msglen > buflen) - return (EINVAL); - idx += msglen; - msglen += CMSG_ALIGN(sizeof(struct cmsghdr)) - - FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - len += CMSG_ALIGN(msglen); - } - - if (len > MCLBYTES) - return (EINVAL); - - m = m_get(M_WAITOK, MT_CONTROL); - if (len > MLEN) - MCLGET(m, M_WAITOK); - m->m_len = len; - - md = mtod(m, void *); + in1 = in; + outlen = 0; while (buflen > 0) { - error = copyin(buf, md, sizeof(struct cmsghdr)); - if (error) + if (buflen < sizeof(*cm)) { + error = EINVAL; break; - msglen = *(u_int *)md; - msglen = FREEBSD32_ALIGN(msglen); + } + cm = (struct cmsghdr *)in1; + if (cm->cmsg_len < FREEBSD32_ALIGN(sizeof(*cm))) { + error = EINVAL; + break; + } + msglen = FREEBSD32_ALIGN(cm->cmsg_len); + if (msglen > buflen || msglen < cm->cmsg_len) { + error = EINVAL; + break; + } + buflen -= msglen; - /* Modify the message length to account for alignment. */ - *(u_int *)md = msglen + CMSG_ALIGN(sizeof(struct cmsghdr)) - - FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + in1 = (char *)in1 + msglen; + outlen += CMSG_ALIGN(sizeof(*cm)) + + CMSG_ALIGN(msglen - FREEBSD32_ALIGN(sizeof(*cm))); + } + if (error == 0 && outlen > MCLBYTES) { + /* + * XXXMJ This implies that the upper limit on 32-bit aligned + * control messages is less than MCLBYTES, and so we are not + * perfectly compatible. However, there is no platform + * guarantee that mbuf clusters larger than MCLBYTES can be + * allocated. + */ + error = EINVAL; + } + if (error != 0) + goto out; - md = (char *)md + CMSG_ALIGN(sizeof(struct cmsghdr)); - buf += FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - buflen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); + m = m_get2(outlen, M_WAITOK, MT_CONTROL, 0); + m->m_len = outlen; + md = mtod(m, void *); - msglen -= FREEBSD32_ALIGN(sizeof(struct cmsghdr)); - if (msglen > 0) { - error = copyin(buf, md, msglen); - if (error) - break; - md = (char *)md + CMSG_ALIGN(msglen); - buf += msglen; - buflen -= msglen; - } + /* + * Make a second pass over input messages, copying them into the output + * buffer. + */ + in1 = in; + while (outlen > 0) { + /* Copy the message header and align the length field. */ + cm = md; + memcpy(cm, in1, sizeof(*cm)); + msglen = cm->cmsg_len - FREEBSD32_ALIGN(sizeof(*cm)); + cm->cmsg_len = CMSG_ALIGN(sizeof(*cm)) + msglen; + + /* Copy the message body. */ + in1 = (char *)in1 + FREEBSD32_ALIGN(sizeof(*cm)); + md = (char *)md + CMSG_ALIGN(sizeof(*cm)); + memcpy(md, in1, msglen); + in1 = (char *)in1 + FREEBSD32_ALIGN(msglen); + md = (char *)md + CMSG_ALIGN(msglen); + KASSERT(outlen >= CMSG_ALIGN(sizeof(*cm)) + CMSG_ALIGN(msglen), + ("outlen %u underflow, msglen %u", outlen, msglen)); + outlen -= CMSG_ALIGN(sizeof(*cm)) + CMSG_ALIGN(msglen); } - if (error) - m_free(m); - else - *mp = m; + *mp = m; +out: + free(in, M_TEMP); return (error); } From owner-svn-src-all@freebsd.org Wed Aug 5 17:09:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E4C937BBF5; Wed, 5 Aug 2020 17:09:55 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ5b1tsTz3bRH; Wed, 5 Aug 2020 17:09:55 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 241AB1943E; Wed, 5 Aug 2020 17:09:55 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075H9tHA094507; Wed, 5 Aug 2020 17:09:55 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075H9tGP094506; Wed, 5 Aug 2020 17:09:55 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202008051709.075H9tGP094506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 5 Aug 2020 17:09:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r363920 - releng/12.1/sys/dev/vmware/vmxnet3 X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: releng/12.1/sys/dev/vmware/vmxnet3 X-SVN-Commit-Revision: 363920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 17:09:55 -0000 Author: gordon Date: Wed Aug 5 17:09:54 2020 New Revision: 363920 URL: https://svnweb.freebsd.org/changeset/base/363920 Log: Fix vmx driver packet loss and degraded performance. Approved by: so Security: FreeBSD-EN-20:16.vmx Modified: releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Modified: releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Wed Aug 5 17:08:02 2020 (r363919) +++ releng/12.1/sys/dev/vmware/vmxnet3/if_vmx.c Wed Aug 5 17:09:54 2020 (r363920) @@ -1320,7 +1320,7 @@ vmxnet3_isc_txd_encap(void *vsc, if_pkt_info_t pi) hdrlen = pi->ipi_ehdrlen + pi->ipi_ip_hlen; if (pi->ipi_csum_flags & CSUM_TSO) { sop->offload_mode = VMXNET3_OM_TSO; - sop->hlen = hdrlen; + sop->hlen = hdrlen + pi->ipi_tcp_hlen; sop->offload_pos = pi->ipi_tso_segsz; } else if (pi->ipi_csum_flags & (VMXNET3_CSUM_OFFLOAD | VMXNET3_CSUM_OFFLOAD_IPV6)) { From owner-svn-src-all@freebsd.org Wed Aug 5 17:11:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7D2137BF12; Wed, 5 Aug 2020 17:11:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ7C4TFrz3bT6; Wed, 5 Aug 2020 17:11:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D1601934F; Wed, 5 Aug 2020 17:11:19 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075HBJST096498; Wed, 5 Aug 2020 17:11:19 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075HBIgl096493; Wed, 5 Aug 2020 17:11:18 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202008051711.075HBIgl096493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 5 Aug 2020 17:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r363921 - in releng: 11.3/sys/dev/usb/net 11.4/sys/dev/usb/net 12.1/sys/dev/usb/net X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/dev/usb/net 11.4/sys/dev/usb/net 12.1/sys/dev/usb/net X-SVN-Commit-Revision: 363921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 17:11:19 -0000 Author: gordon Date: Wed Aug 5 17:11:18 2020 New Revision: 363921 URL: https://svnweb.freebsd.org/changeset/base/363921 Log: Fix memory corruption in USB network device drivers. Approved by: so Security: FreeBSD-SA-20:21.usb_net Security: CVE-2020-7459 Modified: releng/11.3/sys/dev/usb/net/if_smsc.c releng/11.4/sys/dev/usb/net/if_smsc.c releng/12.1/sys/dev/usb/net/if_cdceem.c releng/12.1/sys/dev/usb/net/if_muge.c releng/12.1/sys/dev/usb/net/if_smsc.c Modified: releng/11.3/sys/dev/usb/net/if_smsc.c ============================================================================== --- releng/11.3/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/11.3/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:11:18 2020 (r363921) @@ -970,7 +970,7 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err struct mbuf *m; struct usb_page_cache *pc; uint32_t rxhdr; - uint16_t pktlen; + int pktlen; int off; int actlen; @@ -996,6 +996,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err /* The frame header is always aligned on a 4 byte boundary */ off = ((off + 0x3) & ~0x3); + if ((off + sizeof(rxhdr)) > actlen) + goto tr_setup; + usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); @@ -1024,7 +1027,13 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto tr_setup; } - + if (pktlen > m->m_len) { + smsc_dbg_printf(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); /* Check if RX TCP/UDP checksumming is being offloaded */ Modified: releng/11.4/sys/dev/usb/net/if_smsc.c ============================================================================== --- releng/11.4/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/11.4/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:11:18 2020 (r363921) @@ -970,7 +970,7 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err struct mbuf *m; struct usb_page_cache *pc; uint32_t rxhdr; - uint16_t pktlen; + int pktlen; int off; int actlen; @@ -996,6 +996,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err /* The frame header is always aligned on a 4 byte boundary */ off = ((off + 0x3) & ~0x3); + if ((off + sizeof(rxhdr)) > actlen) + goto tr_setup; + usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); @@ -1024,7 +1027,13 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto tr_setup; } - + if (pktlen > m->m_len) { + smsc_dbg_printf(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); /* Check if RX TCP/UDP checksumming is being offloaded */ Modified: releng/12.1/sys/dev/usb/net/if_cdceem.c ============================================================================== --- releng/12.1/sys/dev/usb/net/if_cdceem.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/12.1/sys/dev/usb/net/if_cdceem.c Wed Aug 5 17:11:18 2020 (r363921) @@ -426,9 +426,10 @@ cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr struct usb_ether *ue; struct ifnet *ifp; struct mbuf *m; - int actlen, off; uint32_t computed_crc, received_crc; - uint16_t pktlen; + int pktlen; + int actlen; + int off; off = *offp; sc = usbd_xfer_softc(xfer); @@ -442,7 +443,7 @@ cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr (hdr & CDCEEM_DATA_CRC) ? "valid" : "absent", pktlen); - if (pktlen < ETHER_HDR_LEN) { + if (pktlen < (ETHER_HDR_LEN + 4)) { CDCEEM_WARN(sc, "bad ethernet frame length %d, should be at least %d", pktlen, ETHER_HDR_LEN); @@ -466,6 +467,14 @@ cdceem_handle_data(struct usb_xfer *xfer, uint16_t hdr } pktlen -= 4; /* Subtract the CRC. */ + + if (pktlen > m->m_len) { + CDCEEM_WARN(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + return; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); off += pktlen; @@ -512,7 +521,7 @@ cdceem_bulk_read_callback(struct usb_xfer *xfer, usb_e pc = usbd_xfer_get_frame(xfer, 0); off = 0; - while (off < actlen) { + while ((off + sizeof(hdr)) <= actlen) { usbd_copy_out(pc, off, &hdr, sizeof(hdr)); CDCEEM_DEBUG(sc, "hdr = %#x", hdr); off += sizeof(hdr); Modified: releng/12.1/sys/dev/usb/net/if_muge.c ============================================================================== --- releng/12.1/sys/dev/usb/net/if_muge.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/12.1/sys/dev/usb/net/if_muge.c Wed Aug 5 17:11:18 2020 (r363921) @@ -1167,9 +1167,9 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err struct ifnet *ifp = uether_getifp(ue); struct mbuf *m; struct usb_page_cache *pc; - uint16_t pktlen; uint32_t rx_cmd_a, rx_cmd_b; uint16_t rx_cmd_c; + int pktlen; int off; int actlen; @@ -1251,7 +1251,14 @@ muge_bulk_read_callback(struct usb_xfer *xfer, usb_err 1); goto tr_setup; } - + if (pktlen > m->m_len) { + muge_dbg_printf(sc, + "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); Modified: releng/12.1/sys/dev/usb/net/if_smsc.c ============================================================================== --- releng/12.1/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:09:54 2020 (r363920) +++ releng/12.1/sys/dev/usb/net/if_smsc.c Wed Aug 5 17:11:18 2020 (r363921) @@ -973,7 +973,7 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err struct mbuf *m; struct usb_page_cache *pc; uint32_t rxhdr; - uint16_t pktlen; + int pktlen; int off; int actlen; @@ -999,6 +999,9 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err /* The frame header is always aligned on a 4 byte boundary */ off = ((off + 0x3) & ~0x3); + if ((off + sizeof(rxhdr)) > actlen) + goto tr_setup; + usbd_copy_out(pc, off, &rxhdr, sizeof(rxhdr)); off += (sizeof(rxhdr) + ETHER_ALIGN); rxhdr = le32toh(rxhdr); @@ -1027,7 +1030,13 @@ smsc_bulk_read_callback(struct usb_xfer *xfer, usb_err if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); goto tr_setup; } - + if (pktlen > m->m_len) { + smsc_dbg_printf(sc, "buffer too small %d vs %d bytes", + pktlen, m->m_len); + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + m_freem(m); + goto tr_setup; + } usbd_copy_out(pc, off, mtod(m, uint8_t *), pktlen); /* Check if RX TCP/UDP checksumming is being offloaded */ From owner-svn-src-all@freebsd.org Wed Aug 5 17:13:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA81337BDF1; Wed, 5 Aug 2020 17:13:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BMJ9M4Pflz3bsm; Wed, 5 Aug 2020 17:13:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A27E1979D; Wed, 5 Aug 2020 17:13:11 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 075HDBR7000441; Wed, 5 Aug 2020 17:13:11 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 075HDAPq000436; Wed, 5 Aug 2020 17:13:10 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202008051713.075HDAPq000436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Wed, 5 Aug 2020 17:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r363922 - in releng: 11.3/contrib/sqlite3 11.3/contrib/sqlite3/tea 11.3/contrib/sqlite3/tea/generic 11.3/contrib/sqlite3/tea/win 11.4/contrib/sqlite3 11.4/contrib/sqlite3/tea 11.4/contr... X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/contrib/sqlite3 11.3/contrib/sqlite3/tea 11.3/contrib/sqlite3/tea/generic 11.3/contrib/sqlite3/tea/win 11.4/contrib/sqlite3 11.4/contrib/sqlite3/tea 11.4/contrib/sqlite3/tea/generic 11... X-SVN-Commit-Revision: 363922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2020 17:13:11 -0000 Author: gordon Date: Wed Aug 5 17:13:08 2020 New Revision: 363922 URL: https://svnweb.freebsd.org/changeset/base/363922 Log: Fix multiple vulnerabilities in sqlite3. Approved by: so Security: FreeBSD-SA-20:22.sqlite Security: CVE-2020-11655 Security: CVE-2020-11656 Security: CVE-2020-13434 Security: CVE-2020-13435 Security: CVE-2020-13630 Security: CVE-2020-13631 Security: CVE-2020-13632 Modified: releng/11.3/contrib/sqlite3/Makefile.msc releng/11.3/contrib/sqlite3/configure releng/11.3/contrib/sqlite3/configure.ac releng/11.3/contrib/sqlite3/shell.c releng/11.3/contrib/sqlite3/sqlite3.c releng/11.3/contrib/sqlite3/sqlite3.h releng/11.3/contrib/sqlite3/sqlite3ext.h releng/11.3/contrib/sqlite3/tea/configure releng/11.3/contrib/sqlite3/tea/configure.ac releng/11.3/contrib/sqlite3/tea/generic/tclsqlite3.c releng/11.3/contrib/sqlite3/tea/win/makefile.vc releng/11.4/contrib/sqlite3/Makefile.msc releng/11.4/contrib/sqlite3/configure releng/11.4/contrib/sqlite3/configure.ac releng/11.4/contrib/sqlite3/shell.c releng/11.4/contrib/sqlite3/sqlite3.c releng/11.4/contrib/sqlite3/sqlite3.h releng/11.4/contrib/sqlite3/sqlite3ext.h releng/11.4/contrib/sqlite3/tea/configure releng/11.4/contrib/sqlite3/tea/configure.ac releng/11.4/contrib/sqlite3/tea/generic/tclsqlite3.c releng/11.4/contrib/sqlite3/tea/win/makefile.vc releng/12.1/contrib/sqlite3/Makefile.msc releng/12.1/contrib/sqlite3/configure releng/12.1/contrib/sqlite3/configure.ac releng/12.1/contrib/sqlite3/shell.c releng/12.1/contrib/sqlite3/sqlite3.c releng/12.1/contrib/sqlite3/sqlite3.h releng/12.1/contrib/sqlite3/sqlite3ext.h releng/12.1/contrib/sqlite3/tea/configure releng/12.1/contrib/sqlite3/tea/configure.ac releng/12.1/contrib/sqlite3/tea/generic/tclsqlite3.c releng/12.1/contrib/sqlite3/tea/win/makefile.vc Modified: releng/11.3/contrib/sqlite3/Makefile.msc ============================================================================== --- releng/11.3/contrib/sqlite3/Makefile.msc Wed Aug 5 17:11:18 2020 (r363921) +++ releng/11.3/contrib/sqlite3/Makefile.msc Wed Aug 5 17:13:08 2020 (r363922) @@ -73,7 +73,7 @@ API_ARMOR = 0 !IFNDEF NO_WARN !IF $(USE_FULLWARN)!=0 NO_WARN = -wd4054 -wd4055 -wd4100 -wd4127 -wd4130 -wd4152 -wd4189 -wd4206 -NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4305 -wd4306 -wd4702 -wd4706 +NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706 !ENDIF !ENDIF @@ -196,6 +196,7 @@ OSTRACE = 0 DEBUG = 0 !ENDIF + # Enable use of available compiler optimizations? Normally, this should be # non-zero. Setting this to zero, thus disabling all compiler optimizations, # can be useful for testing. @@ -210,6 +211,12 @@ OPTIMIZATIONS = 2 SESSION = 0 !ENDIF +# Set this to non-0 to enable support for the rbu extension. +# +!IFNDEF RBU +RBU = 0 +!ENDIF + # Set the source code file to be used by executables and libraries when # they need the amalgamation. # @@ -282,7 +289,7 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DESERIALIZE=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 @@ -296,6 +303,13 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENAB OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1 !ENDIF +# Should the rbu extension be enabled? If so, add compilation options +# to enable it. +# +!IF $(RBU)!=0 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RBU=1 +!ENDIF + # These are the "extended" SQLite compilation options used when compiling for # the Windows 10 platform. # @@ -978,7 +992,7 @@ Replace.exe: sqlite3.def: Replace.exe $(LIBOBJ) echo EXPORTS > sqlite3.def dumpbin /all $(LIBOBJ) \ - | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser|rbu)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ | sort >> sqlite3.def $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) Modified: releng/11.3/contrib/sqlite3/configure ============================================================================== --- releng/11.3/contrib/sqlite3/configure Wed Aug 5 17:11:18 2020 (r363921) +++ releng/11.3/contrib/sqlite3/configure Wed Aug 5 17:13:08 2020 (r363922) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.28.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.32.2. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.28.0' -PACKAGE_STRING='sqlite 3.28.0' +PACKAGE_VERSION='3.32.2' +PACKAGE_STRING='sqlite 3.32.2' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.28.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.32.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1412,7 +1412,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.28.0:";; + short | recursive ) echo "Configuration of sqlite 3.32.2:";; esac cat <<\_ACEOF @@ -1537,7 +1537,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.28.0 +sqlite configure 3.32.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1952,7 +1952,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.28.0, which was +It was created by sqlite $as_me 3.32.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2818,7 +2818,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.28.0' + VERSION='3.32.2' cat >>confdefs.h <<_ACEOF @@ -13653,7 +13653,7 @@ else fi if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- @@ -14438,7 +14438,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.28.0, which was +This file was extended by sqlite $as_me 3.32.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14495,7 +14495,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.28.0 +sqlite config.status 3.32.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: releng/11.3/contrib/sqlite3/configure.ac ============================================================================== --- releng/11.3/contrib/sqlite3/configure.ac Wed Aug 5 17:11:18 2020 (r363921) +++ releng/11.3/contrib/sqlite3/configure.ac Wed Aug 5 17:13:08 2020 (r363922) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.28.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.32.2, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -161,7 +161,7 @@ AC_ARG_ENABLE(rtree, [AS_HELP_STRING( [--enable-rtree], [include rtree support [default=yes]])], [], [enable_rtree=yes]) if test x"$enable_rtree" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY" fi #----------------------------------------------------------------------- Modified: releng/11.3/contrib/sqlite3/shell.c ============================================================================== --- releng/11.3/contrib/sqlite3/shell.c Wed Aug 5 17:11:18 2020 (r363921) +++ releng/11.3/contrib/sqlite3/shell.c Wed Aug 5 17:13:08 2020 (r363922) @@ -36,6 +36,14 @@ #endif /* +** Determine if we are dealing with WinRT, which provides only a subset of +** the full Win32 API. +*/ +#if !defined(SQLITE_OS_WINRT) +# define SQLITE_OS_WINRT 0 +#endif + +/* ** Warning pragmas copied from msvc.h in the core. */ #if defined(_MSC_VER) @@ -147,22 +155,26 @@ typedef unsigned char u8; #if defined(_WIN32) || defined(WIN32) -# include -# include -# define isatty(h) _isatty(h) -# ifndef access -# define access(f,m) _access((f),(m)) +# if SQLITE_OS_WINRT +# define SQLITE_OMIT_POPEN 1 +# else +# include +# include +# define isatty(h) _isatty(h) +# ifndef access +# define access(f,m) _access((f),(m)) +# endif +# ifndef unlink +# define unlink _unlink +# endif +# ifndef strdup +# define strdup _strdup +# endif +# undef popen +# define popen _popen +# undef pclose +# define pclose _pclose # endif -# ifndef unlink -# define unlink _unlink -# endif -# ifndef strdup -# define strdup _strdup -# endif -# undef popen -# define popen _popen -# undef pclose -# define pclose _pclose #else /* Make sure isatty() has a prototype. */ extern int isatty(int); @@ -191,6 +203,9 @@ typedef unsigned char u8; #define ToLower(X) (char)tolower((unsigned char)X) #if defined(_WIN32) || defined(WIN32) +#if SQLITE_OS_WINRT +#include +#endif #include /* string conversion routines only needed on Win32 */ @@ -206,7 +221,7 @@ extern LPWSTR sqlite3_win32_utf8_to_unicode(const char ** rendering quoted strings that contain \n characters). The following ** routines take care of that. */ -#if defined(_WIN32) || defined(WIN32) +#if (defined(_WIN32) || defined(WIN32)) && !SQLITE_OS_WINRT static void setBinaryMode(FILE *file, int isOutput){ if( isOutput ) fflush(file); _setmode(_fileno(file), _O_BINARY); @@ -310,6 +325,7 @@ static int hasTimer(void){ if( getProcessTimesAddr ){ return 1; } else { +#if !SQLITE_OS_WINRT /* GetProcessTimes() isn't supported in WIN95 and some other Windows ** versions. See if the version we are running on has it, and if it ** does, save off a pointer to it and the current process handle. @@ -326,6 +342,7 @@ static int hasTimer(void){ FreeLibrary(hinstLib); } } +#endif } return 0; } @@ -415,7 +432,16 @@ static sqlite3 *globalDb = 0; */ static volatile int seenInterrupt = 0; +#ifdef SQLITE_DEBUG /* +** Out-of-memory simulator variables +*/ +static unsigned int oomCounter = 0; /* Simulate OOM when equals 1 */ +static unsigned int oomRepeat = 0; /* Number of OOMs in a row */ +static void*(*defaultMalloc)(int) = 0; /* The low-level malloc routine */ +#endif /* SQLITE_DEBUG */ + +/* ** This is the name of our program. It is set in main(), used ** in a number of other places, mostly for error messages. */ @@ -466,6 +492,49 @@ static void shell_out_of_memory(void){ exit(1); } +#ifdef SQLITE_DEBUG +/* This routine is called when a simulated OOM occurs. It is broken +** out as a separate routine to make it easy to set a breakpoint on +** the OOM +*/ +void shellOomFault(void){ + if( oomRepeat>0 ){ + oomRepeat--; + }else{ + oomCounter--; + } +} +#endif /* SQLITE_DEBUG */ + +#ifdef SQLITE_DEBUG +/* This routine is a replacement malloc() that is used to simulate +** Out-Of-Memory (OOM) errors for testing purposes. +*/ +static void *oomMalloc(int nByte){ + if( oomCounter ){ + if( oomCounter==1 ){ + shellOomFault(); + return 0; + }else{ + oomCounter--; + } + } + return defaultMalloc(nByte); +} +#endif /* SQLITE_DEBUG */ + +#ifdef SQLITE_DEBUG +/* Register the OOM simulator. This must occur before any memory +** allocations */ +static void registerOomSimulator(void){ + sqlite3_mem_methods mem; + sqlite3_config(SQLITE_CONFIG_GETMALLOC, &mem); + defaultMalloc = mem.xMalloc; + mem.xMalloc = oomMalloc; + sqlite3_config(SQLITE_CONFIG_MALLOC, &mem); +} +#endif + /* ** Write I/O traces to the following stream. */ @@ -983,6 +1052,7 @@ static void shellAddSchemaName( ** We need several support functions from the SQLite core. */ +/* #include "sqlite3.h" */ /* ** We need several things from the ANSI and MSVCRT headers. @@ -1336,6 +1406,7 @@ INT closedir( ** is used. If SIZE is included it must be one of the integers 224, 256, ** 384, or 512, to determine SHA3 hash variant that is computed. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -2005,19 +2076,23 @@ int sqlite3_shathree_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sha3", 1, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 1, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3", 2, SQLITE_UTF8, 0, - sha3Func, 0, 0); + rc = sqlite3_create_function(db, "sha3", 2, + SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, + 0, sha3Func, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 1, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 1, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sha3_query", 2, SQLITE_UTF8, 0, - sha3QueryFunc, 0, 0); + rc = sqlite3_create_function(db, "sha3_query", 2, + SQLITE_UTF8 | SQLITE_DIRECTONLY, + 0, sha3QueryFunc, 0, 0); } return rc; } @@ -2099,6 +2174,7 @@ int sqlite3_shathree_init( ** And the paths returned in the "name" column of the table are also ** relative to directory $dir. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -2419,6 +2495,7 @@ static int writeFile( if( mtime>=0 ){ #if defined(_WIN32) +#if !SQLITE_OS_WINRT /* Windows */ FILETIME lastAccess; FILETIME lastWrite; @@ -2449,6 +2526,7 @@ static int writeFile( }else{ return 1; } +#endif #elif defined(AT_FDCWD) && 0 /* utimensat() is not universally available */ /* Recent unix */ struct timespec times[2]; @@ -2610,6 +2688,7 @@ static int fsdirConnect( pNew = (fsdir_tab*)sqlite3_malloc( sizeof(*pNew) ); if( pNew==0 ) return SQLITE_NOMEM; memset(pNew, 0, sizeof(*pNew)); + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); } *ppVtab = (sqlite3_vtab*)pNew; return rc; @@ -3003,10 +3082,12 @@ int sqlite3_fileio_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "readfile", 1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, readfileFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "writefile", -1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "writefile", -1, + SQLITE_UTF8|SQLITE_DIRECTONLY, 0, writefileFunc, 0, 0); } if( rc==SQLITE_OK ){ @@ -3056,6 +3137,7 @@ int sqlite3_fileio_init( ** faster than any human can type. ** */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -3140,6 +3222,7 @@ static int completionConnect( #define COMPLETION_COLUMN_WHOLELINE 2 /* Entire line seen so far */ #define COMPLETION_COLUMN_PHASE 3 /* ePhase - used for debugging only */ + sqlite3_vtab_config(db, SQLITE_VTAB_INNOCUOUS); rc = sqlite3_declare_vtab(db, "CREATE TABLE x(" " candidate TEXT," @@ -3572,6 +3655,7 @@ int sqlite3_completion_init( ** If the file being opened is not an appended database, then this shim is ** a pass-through into the default underlying VFS. **/ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include #include @@ -4200,6 +4284,101 @@ int sqlite3MemTraceDeactivate(void){ } /************************* End ../ext/misc/memtrace.c ********************/ +/************************* Begin ../ext/misc/uint.c ******************/ +/* +** 2020-04-14 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +****************************************************************************** +** +** This SQLite extension implements the UINT collating sequence. +** +** UINT works like BINARY for text, except that embedded strings +** of digits compare in numeric order. +** +** * Leading zeros are handled properly, in the sense that +** they do not mess of the maginitude comparison of embedded +** strings of digits. "x00123y" is equal to "x123y". +** +** * Only unsigned integers are recognized. Plus and minus +** signs are ignored. Decimal points and exponential notation +** are ignored. +** +** * Embedded integers can be of arbitrary length. Comparison +** is *not* limited integers that can be expressed as a +** 64-bit machine integer. +*/ +/* #include "sqlite3ext.h" */ +SQLITE_EXTENSION_INIT1 +#include +#include +#include + +/* +** Compare text in lexicographic order, except strings of digits +** compare in numeric order. +*/ +static int uintCollFunc( + void *notUsed, + int nKey1, const void *pKey1, + int nKey2, const void *pKey2 +){ + const unsigned char *zA = (const unsigned char*)pKey1; + const unsigned char *zB = (const unsigned char*)pKey2; + int i=0, j=0, x; + (void)notUsed; + while( i #include @@ -4572,6 +4752,7 @@ static int zipfileConnect( zipfileDequote(pNew->zFile); } } + sqlite3_vtab_config(db, SQLITE_VTAB_DIRECTONLY); *ppVtab = (sqlite3_vtab*)pNew; return rc; } @@ -5184,25 +5365,25 @@ static int zipfileDeflate( u8 **ppOut, int *pnOut, /* Output */ char **pzErr /* OUT: Error message */ ){ - sqlite3_int64 nAlloc = compressBound(nIn); - u8 *aOut; int rc = SQLITE_OK; + sqlite3_int64 nAlloc; + z_stream str; + u8 *aOut; + memset(&str, 0, sizeof(str)); + str.next_in = (Bytef*)aIn; + str.avail_in = nIn; + deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); + + nAlloc = deflateBound(&str, nIn); aOut = (u8*)sqlite3_malloc64(nAlloc); if( aOut==0 ){ rc = SQLITE_NOMEM; }else{ int res; - z_stream str; - memset(&str, 0, sizeof(str)); - str.next_in = (Bytef*)aIn; - str.avail_in = nIn; str.next_out = aOut; str.avail_out = nAlloc; - - deflateInit2(&str, 9, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY); res = deflate(&str, Z_FINISH); - if( res==Z_STREAM_END ){ *ppOut = aOut; *pnOut = (int)str.total_out; @@ -5511,10 +5692,10 @@ static int zipfileBestIndex( idx = i; } } + pIdxInfo->estimatedCost = 1000.0; if( idx>=0 ){ pIdxInfo->aConstraintUsage[idx].argvIndex = 1; pIdxInfo->aConstraintUsage[idx].omit = 1; - pIdxInfo->estimatedCost = 1000.0; pIdxInfo->idxNum = 1; }else if( unusable ){ return SQLITE_CONSTRAINT; @@ -5636,8 +5817,8 @@ static int zipfileGetMode( ** identical, ignoring any trailing '/' character in either path. */ static int zipfileComparePath(const char *zA, const char *zB, int nB){ int nA = (int)strlen(zA); - if( zA[nA-1]=='/' ) nA--; - if( zB[nB-1]=='/' ) nB--; + if( nA>0 && zA[nA-1]=='/' ) nA--; + if( nB>0 && zB[nB-1]=='/' ) nB--; if( nA==nB && memcmp(zA, zB, nA)==0 ) return 0; return 1; } @@ -5647,6 +5828,10 @@ static int zipfileBegin(sqlite3_vtab *pVtab){ int rc = SQLITE_OK; assert( pTab->pWriteFd==0 ); + if( pTab->zFile==0 || pTab->zFile[0]==0 ){ + pTab->base.zErrMsg = sqlite3_mprintf("zipfile: missing filename"); + return SQLITE_ERROR; + } /* Open a write fd on the file. Also load the entire central directory ** structure into memory. During the transaction any new file data is @@ -5821,6 +6006,7 @@ static int zipfileUpdate( if( rc==SQLITE_OK ){ zPath = (const char*)sqlite3_value_text(apVal[2]); + if( zPath==0 ) zPath = ""; nPath = (int)strlen(zPath); mTime = zipfileGetTime(apVal[4]); } @@ -5830,11 +6016,15 @@ static int zipfileUpdate( ** '/'. This appears to be required for compatibility with info-zip ** (the unzip command on unix). It does not create directories ** otherwise. */ - if( zPath[nPath-1]!='/' ){ + if( nPath<=0 || zPath[nPath-1]!='/' ){ zFree = sqlite3_mprintf("%s/", zPath); - if( zFree==0 ){ rc = SQLITE_NOMEM; } zPath = (const char*)zFree; - nPath++; + if( zFree==0 ){ + rc = SQLITE_NOMEM; + nPath = 0; + }else{ + nPath = (int)strlen(zPath); + } } } @@ -6227,19 +6417,19 @@ void zipfileStep(sqlite3_context *pCtx, int nVal, sqli ** at the end of the path. Or, if this is not a directory and the path ** ends in '/' it is an error. */ if( bIsDir==0 ){ - if( zName[nName-1]=='/' ){ + if( nName>0 && zName[nName-1]=='/' ){ zErr = sqlite3_mprintf("non-directory name must not end with /"); rc = SQLITE_ERROR; goto zipfile_step_out; } }else{ - if( zName[nName-1]!='/' ){ + if( nName==0 || zName[nName-1]!='/' ){ zName = zFree = sqlite3_mprintf("%s/", zName); - nName++; if( zName==0 ){ rc = SQLITE_NOMEM; goto zipfile_step_out; } + nName = (int)strlen(zName); }else{ while( nName>1 && zName[nName-2]=='/' ) nName--; } @@ -6398,8 +6588,10 @@ int sqlite3_zipfile_init( ** for working with sqlar archives and used by the shell tool's built-in ** sqlar support. */ +/* #include "sqlite3ext.h" */ SQLITE_EXTENSION_INIT1 #include +#include /* ** Implementation of the "sqlar_compress(X)" SQL function. @@ -6494,10 +6686,12 @@ int sqlite3_sqlar_init( int rc = SQLITE_OK; SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ - rc = sqlite3_create_function(db, "sqlar_compress", 1, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_compress", 1, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarCompressFunc, 0, 0); if( rc==SQLITE_OK ){ - rc = sqlite3_create_function(db, "sqlar_uncompress", 2, SQLITE_UTF8, 0, + rc = sqlite3_create_function(db, "sqlar_uncompress", 2, + SQLITE_UTF8|SQLITE_INNOCUOUS, 0, sqlarUncompressFunc, 0, 0); } return rc; @@ -6518,9 +6712,10 @@ int sqlite3_sqlar_init( ** ************************************************************************* */ +#if !defined(SQLITEEXPERT_H) +#define SQLITEEXPERT_H 1 +/* #include "sqlite3.h" */ - - typedef struct sqlite3expert sqlite3expert; /* @@ -6672,8 +6867,8 @@ const char *sqlite3_expert_report(sqlite3expert*, int */ void sqlite3_expert_destroy(sqlite3expert*); +#endif /* !defined(SQLITEEXPERT_H) */ - /************************* End ../ext/expert/sqlite3expert.h ********************/ /************************* Begin ../ext/expert/sqlite3expert.c ******************/ /* @@ -6688,6 +6883,7 @@ void sqlite3_expert_destroy(sqlite3expert*); ** ************************************************************************* */ +/* #include "sqlite3expert.h" */ #include #include #include @@ -7805,14 +8001,19 @@ int idxFindIndexes( /* int iParent = sqlite3_column_int(pExplain, 1); */ /* int iNotUsed = sqlite3_column_int(pExplain, 2); */ const char *zDetail = (const char*)sqlite3_column_text(pExplain, 3); - int nDetail = STRLEN(zDetail); + int nDetail; int i; + if( !zDetail ) continue; + nDetail = STRLEN(zDetail); + for(i=0; i