From owner-svn-src-head@freebsd.org Sun Dec 23 01:05:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 220E713413CD; Sun, 23 Dec 2018 01:05:55 +0000 (UTC) (envelope-from sjg@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) server-signature RSA-PSS (4096 bits) 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 B4C1A8125D; Sun, 23 Dec 2018 01:05:54 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9D23537B; Sun, 23 Dec 2018 01:05:54 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBN15sm5023156; Sun, 23 Dec 2018 01:05:54 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBN15rPK023149; Sun, 23 Dec 2018 01:05:53 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201812230105.wBN15rPK023149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Sun, 23 Dec 2018 01:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342376 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake X-SVN-Group: head X-SVN-Commit-Author: sjg X-SVN-Commit-Paths: in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake X-SVN-Commit-Revision: 342376 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B4C1A8125D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2018 01:05:55 -0000 Author: sjg Date: Sun Dec 23 01:05:52 2018 New Revision: 342376 URL: https://svnweb.freebsd.org/changeset/base/342376 Log: Merge bmake-20181221 Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/VERSION head/contrib/bmake/dirname.c head/contrib/bmake/mk/mk-files.txt head/contrib/bmake/parse.c head/contrib/bmake/unit-tests/varquote.mk head/contrib/bmake/var.c head/usr.bin/bmake/Makefile.config Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Sat Dec 22 22:59:11 2018 (r342375) +++ head/contrib/bmake/ChangeLog Sun Dec 23 01:05:52 2018 (r342376) @@ -1,3 +1,26 @@ +2018-12-21 Simon J Gerraty + + * VERSION: 20181221 + Merge with NetBSD make, pick up + o parse.c: ParseVErrorInternal use .PARSEDIR + and apply if relative, and then use .PARSEFILE + for consistent result. + +2018-12-20 Simon J Gerraty + + * VERSION: 20181220 + Merge with NetBSD make, pick up + o parse.c: ParseVErrorInternal use .CURDIR if .PARSEDIR + is relative + o var.c: avoid SEGFAULT in .unexport-env + when MAKELEVEL is not set + +2018-12-16 Simon J Gerraty + + * VERSION: 20181216 + Merge with NetBSD make, pick up + o fix for unit-tests/varquote.mk on Debian + 2018-09-21 Simon J. Gerraty * VERSION: 20180919 Modified: head/contrib/bmake/VERSION ============================================================================== --- head/contrib/bmake/VERSION Sat Dec 22 22:59:11 2018 (r342375) +++ head/contrib/bmake/VERSION Sun Dec 23 01:05:52 2018 (r342376) @@ -1,2 +1,2 @@ # keep this compatible with sh and make -_MAKE_VERSION=20180919 +_MAKE_VERSION=20181221 Modified: head/contrib/bmake/dirname.c ============================================================================== --- head/contrib/bmake/dirname.c Sat Dec 22 22:59:11 2018 (r342375) +++ head/contrib/bmake/dirname.c Sun Dec 23 01:05:52 2018 (r342376) @@ -1,4 +1,4 @@ -/* $NetBSD: dirname.c,v 1.13 2014/07/16 10:52:26 christos Exp $ */ +/* $NetBSD: dirname.c,v 1.14 2018/09/27 00:45:34 kre Exp $ */ /*- * Copyright (c) 1997, 2002 The NetBSD Foundation, Inc. @@ -35,6 +35,11 @@ #ifndef HAVE_DIRNAME #include +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: dirname.c,v 1.14 2018/09/27 00:45:34 kre Exp $"); +#endif /* !LIBC_SCCS && !lint */ + +#include "namespace.h" #include #ifdef HAVE_LIBGEN_H #include @@ -92,7 +97,8 @@ xdirname_r(const char *path, char *buf, size_t buflen) out: if (buf != NULL && buflen != 0) { buflen = MIN(len, buflen - 1); - memcpy(buf, path, buflen); + if (buf != path) + memcpy(buf, path, buflen); buf[buflen] = '\0'; } return len; Modified: head/contrib/bmake/mk/mk-files.txt ============================================================================== --- head/contrib/bmake/mk/mk-files.txt Sat Dec 22 22:59:11 2018 (r342375) +++ head/contrib/bmake/mk/mk-files.txt Sun Dec 23 01:05:52 2018 (r342376) @@ -25,7 +25,8 @@ of mk-files (mk.tar.gz_). NetBSD provided much of the Since then I've added a lot of features to NetBSD's make and hence to bmake which is kept closely in sync. The mk-files however have -diverged quite a bit, though ideas are still picked up from NetBSD. +diverged quite a bit, though ideas are still picked up from NetBSD +and FreeBSD. Basics ------ @@ -399,6 +400,20 @@ to avoid possible conflicts during parallel builds. This precludes the use of suffix rules to drive ``make depend``, so dep.mk_ handles that if specifically requested. +options.mk +---------- + +Inspired by FreeBSD's ``bsd.own.mk`` more flexible. +FreeBSD now have similar functionality in ``bsd.mkopt.mk``. + +It allows users to express their intent with respect to options +``MK_*`` by setting ``WITH_*`` or ``WITHOUT_*``. + +Note: ``WITHOUT_*`` wins if both are set, and makefiles can set +``NO_*`` to say they cannot handle that option, or even ``MK_*`` if +they really need to. + + own.mk ------ @@ -407,6 +422,13 @@ Normally included by ``init.mk`` (included by ``lib.mk It includes ``${MAKECONF}`` if it is defined and exists. +ldorder.mk +---------- + +Leverages ``bmake`` to compute optimal link order for libraries. +This works nicely and makes refactoring a breeze - so long as you +have not (or few) cicular dependencies between libraries. + man.mk ------ @@ -477,5 +499,5 @@ where you unpacked the tar file, you can:: .. _mk.tar.gz: http://www.crufty.net/ftp/pub/sjg/mk.tar.gz :Author: sjg@crufty.net -:Revision: $Id: mk-files.txt,v 1.16 2014/09/05 04:41:16 sjg Exp $ +:Revision: $Id: mk-files.txt,v 1.18 2018/12/08 07:27:15 sjg Exp $ :Copyright: Crufty.NET Modified: head/contrib/bmake/parse.c ============================================================================== --- head/contrib/bmake/parse.c Sat Dec 22 22:59:11 2018 (r342375) +++ head/contrib/bmake/parse.c Sun Dec 23 01:05:52 2018 (r342376) @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $ */ +/* $NetBSD: parse.c,v 1.231 2018/12/22 00:36:32 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.231 2018/12/22 00:36:32 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.229 2018/04/05 16:31:54 christos Exp $"); +__RCSID("$NetBSD: parse.c,v 1.231 2018/12/22 00:36:32 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -691,21 +691,32 @@ ParseVErrorInternal(FILE *f, const char *cfname, size_ if (cfname != NULL) { (void)fprintf(f, "\""); if (*cfname != '/' && strcmp(cfname, "(stdin)") != 0) { - char *cp; - const char *dir; + char *cp, *cp2; + const char *dir, *fname; /* * Nothing is more annoying than not knowing - * which Makefile is the culprit. + * which Makefile is the culprit; we try ${.PARSEDIR} + * and apply realpath(3) if not absolute. */ dir = Var_Value(".PARSEDIR", VAR_GLOBAL, &cp); - if (dir == NULL || *dir == '\0' || - (*dir == '.' && dir[1] == '\0')) - dir = Var_Value(".CURDIR", VAR_GLOBAL, &cp); if (dir == NULL) dir = "."; - - (void)fprintf(f, "%s/%s", dir, cfname); + if (*dir != '/') { + dir = cp2 = realpath(dir, NULL); + free(cp); + cp = cp2; /* cp2 set to NULL by Var_Value */ + } + fname = Var_Value(".PARSEFILE", VAR_GLOBAL, &cp2); + if (fname == NULL) { + if ((fname = strrchr(cfname, '/'))) + fname++; + else + fname = cfname; + } + (void)fprintf(f, "%s/%s", dir, fname); + free(cp2); + free(cp); } else (void)fprintf(f, "%s", cfname); Modified: head/contrib/bmake/unit-tests/varquote.mk ============================================================================== --- head/contrib/bmake/unit-tests/varquote.mk Sat Dec 22 22:59:11 2018 (r342375) +++ head/contrib/bmake/unit-tests/varquote.mk Sun Dec 23 01:05:52 2018 (r342376) @@ -1,4 +1,4 @@ -# $NetBSD: varquote.mk,v 1.2 2018/05/27 01:14:51 christos Exp $ +# $NetBSD: varquote.mk,v 1.4 2018/12/16 18:53:34 christos Exp $ # # Test VAR:q modifier @@ -10,5 +10,5 @@ all: @${MAKE} -f ${MAKEFILE} REPROFLAGS=${REPROFLAGS:q} .else all: - @echo ${REPROFLAGS} + @printf "%s %s\n" ${REPROFLAGS} .endif Modified: head/contrib/bmake/var.c ============================================================================== --- head/contrib/bmake/var.c Sat Dec 22 22:59:11 2018 (r342375) +++ head/contrib/bmake/var.c Sun Dec 23 01:05:52 2018 (r342376) @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.220 2018/05/27 01:14:51 christos Exp $ */ +/* $NetBSD: var.c,v 1.221 2018/12/21 05:50:19 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.220 2018/05/27 01:14:51 christos Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.221 2018/12/21 05:50:19 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.220 2018/05/27 01:14:51 christos Exp $"); +__RCSID("$NetBSD: var.c,v 1.221 2018/12/21 05:50:19 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -835,7 +835,8 @@ Var_UnExport(char *str) environ = savedEnv = newenv; newenv[0] = NULL; newenv[1] = NULL; - setenv(MAKE_LEVEL_ENV, cp, 1); + if (cp && *cp) + setenv(MAKE_LEVEL_ENV, cp, 1); } else { for (; *str != '\n' && isspace((unsigned char) *str); str++) continue; Modified: head/usr.bin/bmake/Makefile.config ============================================================================== --- head/usr.bin/bmake/Makefile.config Sat Dec 22 22:59:11 2018 (r342375) +++ head/usr.bin/bmake/Makefile.config Sun Dec 23 01:05:52 2018 (r342376) @@ -7,7 +7,7 @@ SRCTOP?= ${.CURDIR:H:H} # things set by configure -_MAKE_VERSION?=20180919 +_MAKE_VERSION?=20181221 prefix?= /usr srcdir= ${SRCTOP}/contrib/bmake From owner-svn-src-head@freebsd.org Sun Dec 23 05:10:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16900134BA44; Sun, 23 Dec 2018 05:10: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) server-signature RSA-PSS (4096 bits) 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 AB8618A1CC; Sun, 23 Dec 2018 05:10:37 +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 A23C68428; Sun, 23 Dec 2018 05:10:37 +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 wBN5Abtk048563; Sun, 23 Dec 2018 05:10:37 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBN5AbZS048560; Sun, 23 Dec 2018 05:10:37 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812230510.wBN5AbZS048560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 23 Dec 2018 05:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342377 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342377 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AB8618A1CC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2018 05:10:38 -0000 Author: cy Date: Sun Dec 23 05:10:36 2018 New Revision: 342377 URL: https://svnweb.freebsd.org/changeset/base/342377 Log: Remove NETBSD_PF. NETBSD_PF is a flag that defines whether the pfil(9) framework is available. pfil(9) has been in FreeBSD since FreeBSD 5 and according to svn log was first committed to HEAD in 2000, therefore it is safe to say the check is no longer needed in FreeBSD. pfil(9) first appeared in NetBSD 1.3 (hence the name NETBSD_PF). Therefore it is safe to say that it is supported by every NetBSD system today. The framework also exists in illumos. As ipfilter code is shared and exchanged between FreeBSD and NetBSD, and at some point in the future illumos too, and as all three platforms have pfil(9), the redundant NETBSD_PF #defines and #ifdefs are removed. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h head/sys/contrib/ipfilter/netinet/ip_fil.h head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 23 01:05:52 2018 (r342376) +++ head/sys/contrib/ipfilter/netinet/ip_compat.h Sun Dec 23 05:10:36 2018 (r342377) @@ -146,7 +146,6 @@ struct ether_addr { # define COPYIN(a,b,c) copyin((caddr_t)(a), (caddr_t)(b), (c)) # define COPYOUT(a,b,c) copyout((caddr_t)(a), (caddr_t)(b), (c)) -# define NETBSD_PF # else # include # endif /* _KERNEL */ Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 23 01:05:52 2018 (r342376) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Sun Dec 23 05:10:36 2018 (r342377) @@ -1435,22 +1435,6 @@ typedef struct ipftune { # define CDEV_MAJOR 79 #endif -/* - * Post NetBSD 1.2 has the PFIL interface for packet filters. This turns - * on those hooks. We don't need any special mods in non-IP Filter code - * with this! - */ -#if (defined(NetBSD) && (NetBSD > 199609) && (NetBSD <= 1991011)) || \ - (defined(NetBSD1_2) && NetBSD1_2 > 1) || \ - (defined(__FreeBSD__) && (__FreeBSD_version >= 500043)) -# if (defined(NetBSD) && NetBSD >= 199905) -# define PFIL_HOOKS -# endif -# ifdef PFIL_HOOKS -# define NETBSD_PF -# endif -#endif - #ifdef _KERNEL # define FR_VERBOSE(verb_pr) # define FR_DEBUG(verb_pr) Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 23 01:05:52 2018 (r342376) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sun Dec 23 05:10:36 2018 (r342377) @@ -97,9 +97,7 @@ VNET_DEFINE(ipf_main_softc_t, ipfmain) = { #define V_ipfmain VNET(ipfmain) # include -# if defined(NETBSD_PF) # include -# endif /* NETBSD_PF */ static eventhandler_tag ipf_arrivetag, ipf_departtag; #if 0 @@ -1336,14 +1334,11 @@ ipf_inject(fin, m) } int ipf_pfil_unhook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -#ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); if (ph_inet != NULL) pfil_remove_hook((void *)ipf_check_wrapper, NULL, @@ -1354,20 +1349,16 @@ int ipf_pfil_unhook(void) { pfil_remove_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -#endif return (0); } int ipf_pfil_hook(void) { -#if defined(NETBSD_PF) && (__FreeBSD_version >= 500011) struct pfil_head *ph_inet; -# ifdef USE_INET6 +#ifdef USE_INET6 struct pfil_head *ph_inet6; -# endif #endif -# ifdef NETBSD_PF ph_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET); # ifdef USE_INET6 ph_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6); @@ -1388,7 +1379,6 @@ int ipf_pfil_hook(void) { pfil_add_hook((void *)ipf_check_wrapper6, NULL, PFIL_IN|PFIL_OUT|PFIL_WAITOK, ph_inet6); # endif -# endif return (0); } From owner-svn-src-head@freebsd.org Sun Dec 23 18:54:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0BDB13427FA; Sun, 23 Dec 2018 18:54:10 +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) server-signature RSA-PSS (4096 bits) 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 5D4AF88D91; Sun, 23 Dec 2018 18:54:10 +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 5235619434; Sun, 23 Dec 2018 18:54:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBNIsAa6090999; Sun, 23 Dec 2018 18:54:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBNIsAC3090998; Sun, 23 Dec 2018 18:54:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812231854.wBNIsAC3090998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Dec 2018 18:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342381 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 342381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D4AF88D91 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2018 18:54:10 -0000 Author: kib Date: Sun Dec 23 18:54:09 2018 New Revision: 342381 URL: https://svnweb.freebsd.org/changeset/base/342381 Log: Allocate v_object for the new snapshot vnode. The vnode is not opened, so it ends up with the malloced buffers otherwise. Reported and tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sun Dec 23 18:52:02 2018 (r342380) +++ head/sys/ufs/ffs/ffs_snapshot.c Sun Dec 23 18:54:09 2018 (r342381) @@ -302,6 +302,7 @@ restart: return (error); } vp = nd.ni_vp; + vnode_create_vobject(nd.ni_vp, fs->fs_size, td); vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp); devvp = ITODEVVP(ip); From owner-svn-src-head@freebsd.org Sun Dec 23 19:14:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4A6C13438C2; Sun, 23 Dec 2018 19:14:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 56A0389DE2; Sun, 23 Dec 2018 19:14:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B8ED19788; Sun, 23 Dec 2018 19:14:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBNJEW69001406; Sun, 23 Dec 2018 19:14:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBNJEWVh001405; Sun, 23 Dec 2018 19:14:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812231914.wBNJEWVh001405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Dec 2018 19:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342382 - head/sys/dev/nvdimm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/nvdimm X-SVN-Commit-Revision: 342382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56A0389DE2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2018 19:14:32 -0000 Author: kib Date: Sun Dec 23 19:14:31 2018 New Revision: 342382 URL: https://svnweb.freebsd.org/changeset/base/342382 Log: nvdimm SPA geom: Update bio fields needed for devstat_end_transaction_bio(). Reported by: bde MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/nvdimm/nvdimm_spa.c Modified: head/sys/dev/nvdimm/nvdimm_spa.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm_spa.c Sun Dec 23 18:54:09 2018 (r342381) +++ head/sys/dev/nvdimm/nvdimm_spa.c Sun Dec 23 19:14:31 2018 (r342382) @@ -337,8 +337,10 @@ nvdimm_spa_g_thread(void *arg) auio.uio_td = curthread; error = uiomove_fromphys(bp->bio_ma, bp->bio_ma_offset, bp->bio_length, &auio); + bp->bio_resid = auio.uio_resid; } else { nvdimm_spa_g_all_unmapped(spa, bp, bp->bio_cmd); + bp->bio_resid = bp->bio_length; error = 0; } } else { @@ -353,7 +355,9 @@ nvdimm_spa_g_thread(void *arg) UIO_WRITE; auio.uio_td = curthread; error = nvdimm_spa_uio(spa, &auio); + bp->bio_resid = auio.uio_resid; } + bp->bio_bcount = bp->bio_length; devstat_end_transaction_bio(spa->spa_g_devstat, bp); completed: bp->bio_completed = bp->bio_length; From owner-svn-src-head@freebsd.org Sun Dec 23 18:52:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 887AD134264A; Sun, 23 Dec 2018 18:52:03 +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) server-signature RSA-PSS (4096 bits) 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 2A85F88B50; Sun, 23 Dec 2018 18:52: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 20485192FF; Sun, 23 Dec 2018 18:52: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 wBNIq2nC090861; Sun, 23 Dec 2018 18:52:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBNIq2Mk090860; Sun, 23 Dec 2018 18:52:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812231852.wBNIq2Mk090860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 23 Dec 2018 18:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342380 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A85F88B50 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2018 18:52:03 -0000 Author: kib Date: Sun Dec 23 18:52:02 2018 New Revision: 342380 URL: https://svnweb.freebsd.org/changeset/base/342380 Log: Properly test for vmio buffer in bnoreuselist(). The presence of allocated v_object does not imply that the buffer is necessary VMIO kind. Buffer might has been allocated before the object created, then the buffer is malloced. Although we try to avoid such situation, it seems to be still legitimate. Reported and tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Sun Dec 23 18:15:48 2018 (r342379) +++ head/sys/kern/vfs_subr.c Sun Dec 23 18:52:02 2018 (r342380) @@ -1840,7 +1840,7 @@ again: * reused. Dirty buffers will have the hint applied once * they've been written. */ - if (bp->b_vp->v_object != NULL) + if ((bp->b_flags & B_VMIO) != 0) bp->b_flags |= B_NOREUSE; brelse(bp); BO_RLOCK(bo); From owner-svn-src-head@freebsd.org Sun Dec 23 18:15:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA02B1340BA1; Sun, 23 Dec 2018 18:15:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 5FDA887011; Sun, 23 Dec 2018 18:15:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 552D018CDF; Sun, 23 Dec 2018 18:15:49 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBNIFn5M070338; Sun, 23 Dec 2018 18:15:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBNIFmu3070335; Sun, 23 Dec 2018 18:15:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201812231815.wBNIFmu3070335@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 23 Dec 2018 18:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342379 - in head: include lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: include lib/libc/net X-SVN-Commit-Revision: 342379 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FDA887011 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2018 18:15:50 -0000 Author: pfg Date: Sun Dec 23 18:15:48 2018 New Revision: 342379 URL: https://svnweb.freebsd.org/changeset/base/342379 Log: gai_strerror() - Update string error messages according to RFC 3493. Error messages in gai_strerror(3) vary largely among OSs. For new software we largely replaced the obsoleted EAI_NONAME and with EAI_NODATA but we never updated the corresponding message to better match the intended use. We also have references to ai_flags and ai_family which are not very descriptive for non-developer end users. Bring new new error messages based on informational RFC 3493, which has obsoleted RFC 2553, and make them consistent among the header adn manpage. MFC after: 1 month Differentical Revision: D18630 Modified: head/include/netdb.h head/lib/libc/net/gai_strerror.3 head/lib/libc/net/gai_strerror.c Modified: head/include/netdb.h ============================================================================== --- head/include/netdb.h Sun Dec 23 09:48:36 2018 (r342378) +++ head/include/netdb.h Sun Dec 23 18:15:48 2018 (r342379) @@ -159,24 +159,24 @@ struct addrinfo { #define NO_ADDRESS NO_DATA /* no address, look for MX record */ /* - * Error return codes from getaddrinfo() + * Error return codes from gai_strerror(3), see RFC 3493. */ #if 0 -/* obsoleted */ +/* Obsoleted on RFC 2553bis-02 */ #define EAI_ADDRFAMILY 1 /* address family for hostname not supported */ #endif -#define EAI_AGAIN 2 /* temporary failure in name resolution */ -#define EAI_BADFLAGS 3 /* invalid value for ai_flags */ +#define EAI_AGAIN 2 /* name could not be resolved at this time */ +#define EAI_BADFLAGS 3 /* flags parameter had an invalid value */ #define EAI_FAIL 4 /* non-recoverable failure in name resolution */ -#define EAI_FAMILY 5 /* ai_family not supported */ +#define EAI_FAMILY 5 /* address family was recognized */ #define EAI_MEMORY 6 /* memory allocation failure */ #if 0 -/* obsoleted */ +/* Obsoleted on RFC 2553bis-02 */ #define EAI_NODATA 7 /* no address associated with hostname */ #endif -#define EAI_NONAME 8 /* hostname nor servname provided, or not known */ -#define EAI_SERVICE 9 /* servname not supported for ai_socktype */ -#define EAI_SOCKTYPE 10 /* ai_socktype not supported */ +#define EAI_NONAME 8 /* name does not resolve */ +#define EAI_SERVICE 9 /* service not recognized for socket type */ +#define EAI_SOCKTYPE 10 /* intended socket type was not recognized */ #define EAI_SYSTEM 11 /* system error returned in errno */ #define EAI_BADHINTS 12 /* invalid value for hints */ #define EAI_PROTOCOL 13 /* resolved protocol is unknown */ Modified: head/lib/libc/net/gai_strerror.3 ============================================================================== --- head/lib/libc/net/gai_strerror.3 Sun Dec 23 09:48:36 2018 (r342378) +++ head/lib/libc/net/gai_strerror.3 Sun Dec 23 18:15:48 2018 (r342379) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 21, 2006 +.Dd December 23, 2018 .Dt GAI_STRERROR 3 .Os .Sh NAME @@ -44,38 +44,30 @@ The following error codes and their meaning are define .Pp .Bl -tag -width ".Dv EAI_BADFLAGS" -offset indent -compact .It Dv EAI_AGAIN -temporary failure in name resolution +Name could not be resolved at this time .It Dv EAI_BADFLAGS -invalid value for -.Fa ai_flags +flags parameter had an invalid value .It Dv EAI_BADHINTS invalid value for .Fa hints .It Dv EAI_FAIL -non-recoverable failure in name resolution +Non-recoverable failure in name resolution .It Dv EAI_FAMILY -.Fa ai_family -not supported +Address family was not recognized .It Dv EAI_MEMORY -memory allocation failure +Memory allocation failure .It Dv EAI_NONAME -.Fa hostname -or -.Fa servname -not provided, or not known +Name does not resolve .It Dv EAI_OVERFLOW argument buffer overflow .It Dv EAI_PROTOCOL -resolved protocol is unknown +Resolved protocol is unknown .It Dv EAI_SERVICE -.Fa servname -not supported for -.Fa ai_socktype +Service was not recognized for socket type .It Dv EAI_SOCKTYPE -.Fa ai_socktype -not supported +Intended socket type was not recognized .It Dv EAI_SYSTEM -system error returned in +System error returned in .Va errno .El .Sh RETURN VALUES @@ -90,3 +82,8 @@ is out of range, an implementation-specific error mess .Sh SEE ALSO .Xr getaddrinfo 3 , .Xr getnameinfo 3 +.Sh STANDARDS +.Bl -tag -width ".It RFC 2743" +.It RFC 3493 +Basic Socket Interface Extensions for IPv6 +.El Modified: head/lib/libc/net/gai_strerror.c ============================================================================== --- head/lib/libc/net/gai_strerror.c Sun Dec 23 09:48:36 2018 (r342378) +++ head/lib/libc/net/gai_strerror.c Sun Dec 23 18:15:48 2018 (r342379) @@ -45,19 +45,19 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" /* Entries EAI_ADDRFAMILY (1) and EAI_NODATA (7) are obsoleted, but left */ -/* for backward compatibility with userland code prior to 2553bis-02 */ +/* for backwards compatibility with userland code prior to RFC2553bis-02 */ static const char *ai_errlist[] = { "Success", /* 0 */ - "Address family for hostname not supported", /* 1 */ - "Temporary failure in name resolution", /* EAI_AGAIN */ - "Invalid value for ai_flags", /* EAI_BADFLAGS */ + "Address family for hostname not supported", /* 1: Obsolete */ + "Name could not be resolved at this time", /* EAI_AGAIN */ + "Flags parameter had an invalid value", /* EAI_BADFLAGS */ "Non-recoverable failure in name resolution", /* EAI_FAIL */ - "ai_family not supported", /* EAI_FAMILY */ + "Address family not recognized", /* EAI_FAMILY */ "Memory allocation failure", /* EAI_MEMORY */ - "No address associated with hostname", /* 7 */ - "hostname nor servname provided, or not known", /* EAI_NONAME */ - "servname not supported for ai_socktype", /* EAI_SERVICE */ - "ai_socktype not supported", /* EAI_SOCKTYPE */ + "No address associated with hostname", /* 7: Obsolete*/ + "Name does not resolve", /* EAI_NONAME */ + "Service was not recognized for socket type", /* EAI_SERVICE */ + "Intended socket type was not recognized", /* EAI_SOCKTYPE */ "System error returned in errno", /* EAI_SYSTEM */ "Invalid value for hints", /* EAI_BADHINTS */ "Resolved protocol is unknown", /* EAI_PROTOCOL */ From owner-svn-src-head@freebsd.org Sun Dec 23 20:51:14 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35F0513475C4; Sun, 23 Dec 2018 20:51:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 D038B8D716; Sun, 23 Dec 2018 20:51:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5B801A72E; Sun, 23 Dec 2018 20:51:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBNKpDch050539; Sun, 23 Dec 2018 20:51:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBNKpDNx050538; Sun, 23 Dec 2018 20:51:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201812232051.wBNKpDNx050538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 23 Dec 2018 20:51:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342383 - head/include X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 342383 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D038B8D716 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Dec 2018 20:51:14 -0000 Author: pfg Date: Sun Dec 23 20:51:13 2018 New Revision: 342383 URL: https://svnweb.freebsd.org/changeset/base/342383 Log: Fix mismatch from r342379. Modified: head/include/netdb.h Modified: head/include/netdb.h ============================================================================== --- head/include/netdb.h Sun Dec 23 19:14:31 2018 (r342382) +++ head/include/netdb.h Sun Dec 23 20:51:13 2018 (r342383) @@ -168,7 +168,7 @@ struct addrinfo { #define EAI_AGAIN 2 /* name could not be resolved at this time */ #define EAI_BADFLAGS 3 /* flags parameter had an invalid value */ #define EAI_FAIL 4 /* non-recoverable failure in name resolution */ -#define EAI_FAMILY 5 /* address family was recognized */ +#define EAI_FAMILY 5 /* address family not recognized */ #define EAI_MEMORY 6 /* memory allocation failure */ #if 0 /* Obsoleted on RFC 2553bis-02 */ From owner-svn-src-head@freebsd.org Mon Dec 24 01:12:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E190F13519DA; Mon, 24 Dec 2018 01:12:22 +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) server-signature RSA-PSS (4096 bits) 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 87C78977FE; Mon, 24 Dec 2018 01:12:22 +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 7D6561D47F; Mon, 24 Dec 2018 01:12:22 +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 wBO1CMLN092646; Mon, 24 Dec 2018 01:12:22 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBO1CMTo092645; Mon, 24 Dec 2018 01:12:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812240112.wBO1CMTo092645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 24 Dec 2018 01:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342384 - head X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 342384 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 87C78977FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 01:12:23 -0000 Author: cy Date: Mon Dec 24 01:12:22 2018 New Revision: 342384 URL: https://svnweb.freebsd.org/changeset/base/342384 Log: Register a pre-commit review for ipfilter. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Sun Dec 23 20:51:13 2018 (r342383) +++ head/MAINTAINERS Mon Dec 24 01:12:22 2018 (r342384) @@ -38,6 +38,7 @@ subsystem login notes atf freebsd-testing,jmmv,ngie Pre-commit review requested. ath(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org contrib/compiler-rt dim Pre-commit review preferred. +contrib/ipfilter cy Pre-commit review requested. contrib/libc++ dim Pre-commit review preferred. contrib/libcxxrt dim Pre-commit review preferred. contrib/llvm dim Pre-commit review preferred. @@ -88,6 +89,7 @@ share/mk/*.test.mk freebsd-testing,ngie (same list as stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested sys/compat/linuxkpi hselasky If in doubt, ask. +sys/contrib/ipfilter cy Pre-commit review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. sys/dev/ixl erj Pre-commit phabricator review requested. From owner-svn-src-head@freebsd.org Mon Dec 24 01:12:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D6C91351B69; Mon, 24 Dec 2018 01:12:44 +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) server-signature RSA-PSS (4096 bits) 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 105339794E; Mon, 24 Dec 2018 01:12:44 +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 04E4F1D48A; Mon, 24 Dec 2018 01:12:44 +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 wBO1ChWR092709; Mon, 24 Dec 2018 01:12:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBO1ChpI092708; Mon, 24 Dec 2018 01:12:43 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812240112.wBO1ChpI092708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 24 Dec 2018 01:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342385 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342385 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 105339794E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 01:12:44 -0000 Author: cy Date: Mon Dec 24 01:12:43 2018 New Revision: 342385 URL: https://svnweb.freebsd.org/changeset/base/342385 Log: Remove an empty #if block. The interesting thing is that looking through Darren's commit logs, the line containing an extern ppsratecheck() definition was removed from the v5-1-RELEASE branch but not from HEAD (I have taken his CVS tree and converted it to GIT). There is a commit adding an additional #if defined to the empty block. I can only assume that this was intentional for something later. Looking through HEAD the extern ppsratecheck() is there. However if we put it back it would conflict with a static ppsratecheck() definition in fil.c when building ipftest. Therefore we remove this empty block. ppsratecheck() is a function in the FreeBSD kernel. However ipftest cannot call the ppsratecheck() in the kernel. Therefore one exists in fil.c for use when building the userland ipftest utility which approximates the packet filter in userland for testing of ipfilter rules against packets captured with tcpdump. MFC after: 1 week Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h Modified: head/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 24 01:12:22 2018 (r342384) +++ head/sys/contrib/ipfilter/netinet/ip_fil.h Mon Dec 24 01:12:43 2018 (r342385) @@ -1813,9 +1813,6 @@ extern int ipf_resolvefunc __P((ipf_main_softc_t *, vo extern void *ipf_resolvenic __P((ipf_main_softc_t *, char *, int)); extern int ipf_send_icmp_err __P((int, fr_info_t *, int)); extern int ipf_send_reset __P((fr_info_t *)); -#if (defined(__FreeBSD_version) && (__FreeBSD_version < 501000)) || \ - !defined(_KERNEL) || defined(linux) -#endif extern void ipf_apply_timeout __P((ipftq_t *, u_int)); extern ipftq_t *ipf_addtimeoutqueue __P((ipf_main_softc_t *, ipftq_t **, u_int)); From owner-svn-src-head@freebsd.org Mon Dec 24 02:53:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 933DC1353D44; Mon, 24 Dec 2018 02:53:51 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from mail01.asahi-net.or.jp (mail01.asahi-net.or.jp [202.224.55.13]) by mx1.freebsd.org (Postfix) with ESMTP id 595C06B980; Mon, 24 Dec 2018 02:53:49 +0000 (UTC) (envelope-from ota@j.email.ne.jp) Received: from rv515.advok.com (pool-72-76-119-135.nwrknj.fios.verizon.net [72.76.119.135]) (Authenticated sender: NR2Y-OOT) by mail01.asahi-net.or.jp (Postfix) with ESMTPSA id 30C21100B12; Mon, 24 Dec 2018 11:53:37 +0900 (JST) Date: Sun, 23 Dec 2018 21:53:33 -0500 From: Yoshihiro Ota To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342375 - head/sys/dev/md Message-Id: <20181223215333.5b0065776ba8cc162f0f7799@j.email.ne.jp> In-Reply-To: <201812222259.wBMMxB1c053909@repo.freebsd.org> References: <201812222259.wBMMxB1c053909@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i386-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 595C06B980 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of ota@j.email.ne.jp designates 202.224.55.13 as permitted sender) smtp.mailfrom=ota@j.email.ne.jp X-Spamd-Result: default: False [0.60 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:202.224.55.0/24]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[email.ne.jp]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.13)[-0.127,0]; NEURAL_SPAM_MEDIUM(0.41)[0.412,0]; IP_SCORE(-0.02)[country: JP(-0.09)]; NEURAL_SPAM_SHORT(0.14)[0.142,0]; MX_GOOD(-0.01)[cached: sbmx.asahi-net.or.jp]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[13.55.224.202.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:4685, ipnet:202.224.32.0/19, country:JP]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[135.119.76.72.zen.spamhaus.org : 127.0.0.10] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 02:53:51 -0000 Thanks. I noticed when this was broken upon a new release long time ago but couldn't get any clue nor when this was broken (since I hadn't started following trunk/stable back then.) Was that 7.0-RELEASE or 8.0-RELEASE....? Anyway, good news and I will try to bring this to local 12.0-RELEASE. Regards, Hiro On Sat, 22 Dec 2018 22:59:11 +0000 (UTC) Bruce Evans wrote: > Author: bde > Date: Sat Dec 22 22:59:11 2018 > New Revision: 342375 > URL: https://svnweb.freebsd.org/changeset/base/342375 > > Log: > Fix devstat on md devices, second attempt. r341765 depends on > g_io_deliver() finishing initialization of the bio, but g_io_deliver() > actually destroys the bio. INVARIANTS makes the bug obvious by > overwriting the bio with garbage. > > Restore the old order for calling devstat (except don't restore not calling > it for the error case), and translate to the devstat KPI so that this order > works. > > Reviewed by: kib > > Modified: > head/sys/dev/md/md.c > > Modified: head/sys/dev/md/md.c > ============================================================================== > --- head/sys/dev/md/md.c Sat Dec 22 21:49:25 2018 (r342374) > +++ head/sys/dev/md/md.c Sat Dec 22 22:59:11 2018 (r342375) > @@ -1241,12 +1241,22 @@ md_kthread(void *arg) > error = sc->start(sc, bp); > } > > + if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { > + /* > + * Devstat uses (bio_bcount, bio_resid) for > + * determining the length of the completed part of > + * the i/o. g_io_deliver() will translate from > + * bio_completed to that, but it also destroys the > + * bio so we must do our own translation. > + */ > + bp->bio_bcount = bp->bio_length; > + bp->bio_resid = (error == -1 ? bp->bio_bcount : 0); > + devstat_end_transaction_bio(sc->devstat, bp); > + } > if (error != -1) { > bp->bio_completed = bp->bio_length; > g_io_deliver(bp, error); > } > - if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) > - devstat_end_transaction_bio(sc->devstat, bp); > } > } > > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon Dec 24 05:05:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 492AF1356F68; Mon, 24 Dec 2018 05:05:41 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 8BEE16F97F; Mon, 24 Dec 2018 05:05:40 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 805C51FC01; Mon, 24 Dec 2018 05:05:40 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBO55ewl015437; Mon, 24 Dec 2018 05:05:40 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBO55dPL015431; Mon, 24 Dec 2018 05:05:39 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201812240505.wBO55dPL015431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 24 Dec 2018 05:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342386 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 342386 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8BEE16F97F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 05:05:41 -0000 Author: scottl Date: Mon Dec 24 05:05:38 2018 New Revision: 342386 URL: https://svnweb.freebsd.org/changeset/base/342386 Log: First step in refactoring and fixing the error recovery and task management code in the mpr and mps drivers. Eliminate duplicated code and fix some comments. Modified: head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mpr/mprvar.h head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Mon Dec 24 01:12:43 2018 (r342385) +++ head/sys/dev/mpr/mpr_sas.c Mon Dec 24 05:05:38 2018 (r342386) @@ -229,9 +229,12 @@ mprsas_startup_decrement(struct mprsas_softc *sassc) } } -/* The firmware requires us to stop sending commands when we're doing task - * management, so refcount the TMs and keep the simq frozen when any are in +/* + * The firmware requires us to stop sending commands when we're doing task + * management. * use. + * XXX The logic for serializing the device has been made lazy and moved to + * mprsas_prepare_for_tm(). */ struct mpr_command * mprsas_alloc_tm(struct mpr_softc *sc) @@ -467,8 +470,6 @@ mprsas_prepare_volume_remove(struct mprsas_softc *sass cm->cm_targ = targ; cm->cm_data = NULL; - cm->cm_desc.HighPriority.RequestFlags = - MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; cm->cm_complete = mprsas_remove_volume; cm->cm_complete_data = (void *)(uintptr_t)handle; @@ -531,8 +532,6 @@ mprsas_prepare_remove(struct mprsas_softc *sassc, uint cm->cm_targ = targ; cm->cm_data = NULL; - cm->cm_desc.HighPriority.RequestFlags = - MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; cm->cm_complete = mprsas_remove_device; cm->cm_complete_data = (void *)(uintptr_t)handle; @@ -1494,8 +1493,6 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_com } tm->cm_data = NULL; - tm->cm_desc.HighPriority.RequestFlags = - MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete_data = (void *)tm; callout_reset(&tm->cm_callout, MPR_RESET_TIMEOUT * hz, @@ -1623,8 +1620,6 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_com req->TaskMID = htole16(cm->cm_desc.Default.SMID); tm->cm_data = NULL; - tm->cm_desc.HighPriority.RequestFlags = - MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete = mprsas_abort_complete; tm->cm_complete_data = (void *)tm; tm->cm_targ = cm->cm_targ; @@ -3336,8 +3331,6 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, uni req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; tm->cm_data = NULL; - tm->cm_desc.HighPriority.RequestFlags = - MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete = mprsas_resetdev_complete; tm->cm_complete_data = ccb; @@ -3750,6 +3743,13 @@ mprsas_read_cap_done(struct cam_periph *periph, union #endif /* (__FreeBSD_version < 901503) || \ ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) */ +/* + * Set the INRESET flag for this target so that no I/O will be sent to + * the target until the reset has completed. If an I/O request does + * happen, the devq will be frozen. The CCB holds the path which is + * used to release the devq. The devq is released and the CCB is freed + * when the TM completes. + */ void mprsas_prepare_for_tm(struct mpr_softc *sc, struct mpr_command *tm, struct mprsas_target *target, lun_id_t lun_id) @@ -3757,13 +3757,6 @@ mprsas_prepare_for_tm(struct mpr_softc *sc, struct mpr union ccb *ccb; path_id_t path_id; - /* - * Set the INRESET flag for this target so that no I/O will be sent to - * the target until the reset has completed. If an I/O request does - * happen, the devq will be frozen. The CCB holds the path which is - * used to release the devq. The devq is released and the CCB is freed - * when the TM completes. - */ ccb = xpt_alloc_ccb_nowait(); if (ccb) { path_id = cam_sim_path(sc->sassc->sim); Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Mon Dec 24 01:12:43 2018 (r342385) +++ head/sys/dev/mpr/mpr_user.c Mon Dec 24 05:05:38 2018 (r342386) @@ -835,8 +835,6 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru task->TaskMID = cm->cm_desc.Default.SMID; cm->cm_data = NULL; - cm->cm_desc.HighPriority.RequestFlags = - MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; cm->cm_complete = NULL; cm->cm_complete_data = NULL; Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Mon Dec 24 01:12:43 2018 (r342385) +++ head/sys/dev/mpr/mprvar.h Mon Dec 24 05:05:38 2018 (r342386) @@ -657,6 +657,8 @@ mpr_alloc_high_priority_command(struct mpr_softc *sc) TAILQ_REMOVE(&sc->high_priority_req_list, cm, cm_link); cm->cm_state = MPR_CM_STATE_BUSY; cm->cm_timeout_handler = NULL; + cm->cm_desc.HighPriority.RequestFlags = + MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; return (cm); } Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Dec 24 01:12:43 2018 (r342385) +++ head/sys/dev/mps/mps_sas.c Mon Dec 24 05:05:38 2018 (r342386) @@ -227,9 +227,11 @@ mpssas_startup_decrement(struct mpssas_softc *sassc) } } -/* The firmware requires us to stop sending commands when we're doing task - * management, so refcount the TMs and keep the simq frozen when any are in - * use. +/* + * The firmware requires us to stop sending commands when we're doing task + * management. + * XXX The logic for serializing the device has been made lazy and moved to + * mpssas_prepare_for_tm(). */ struct mps_command * mpssas_alloc_tm(struct mps_softc *sc) @@ -472,8 +474,6 @@ mpssas_prepare_volume_remove(struct mpssas_softc *sass cm->cm_targ = targ; cm->cm_data = NULL; - cm->cm_desc.HighPriority.RequestFlags = - MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; cm->cm_complete = mpssas_remove_volume; cm->cm_complete_data = (void *)(uintptr_t)handle; @@ -536,7 +536,6 @@ mpssas_prepare_remove(struct mpssas_softc *sassc, uint cm->cm_targ = targ; cm->cm_data = NULL; - cm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; cm->cm_complete = mpssas_remove_device; cm->cm_complete_data = (void *)(uintptr_t)handle; @@ -1428,7 +1427,6 @@ mpssas_send_reset(struct mps_softc *sc, struct mps_com } tm->cm_data = NULL; - tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete_data = (void *)tm; callout_reset(&tm->cm_callout, MPS_RESET_TIMEOUT * hz, @@ -1557,7 +1555,6 @@ mpssas_send_abort(struct mps_softc *sc, struct mps_com req->TaskMID = htole16(cm->cm_desc.Default.SMID); tm->cm_data = NULL; - tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete = mpssas_abort_complete; tm->cm_complete_data = (void *)tm; tm->cm_targ = cm->cm_targ; @@ -3079,7 +3076,6 @@ mpssas_action_resetdev(struct mpssas_softc *sassc, uni req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; tm->cm_data = NULL; - tm->cm_desc.HighPriority.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; tm->cm_complete = mpssas_resetdev_complete; tm->cm_complete_data = ccb; tm->cm_targ = targ; @@ -3475,6 +3471,13 @@ mpssas_read_cap_done(struct cam_periph *periph, union #endif /* (__FreeBSD_version < 901503) || \ ((__FreeBSD_version >= 1000000) && (__FreeBSD_version < 1000006)) */ +/* + * Set the INRESET flag for this target so that no I/O will be sent to + * the target until the reset has completed. If an I/O request does + * happen, the devq will be frozen. The CCB holds the path which is + * used to release the devq. The devq is released and the CCB is freed + * when the TM completes. + */ void mpssas_prepare_for_tm(struct mps_softc *sc, struct mps_command *tm, struct mpssas_target *target, lun_id_t lun_id) @@ -3482,13 +3485,6 @@ mpssas_prepare_for_tm(struct mps_softc *sc, struct mps union ccb *ccb; path_id_t path_id; - /* - * Set the INRESET flag for this target so that no I/O will be sent to - * the target until the reset has completed. If an I/O request does - * happen, the devq will be frozen. The CCB holds the path which is - * used to release the devq. The devq is released and the CCB is freed - * when the TM completes. - */ ccb = xpt_alloc_ccb_nowait(); if (ccb) { path_id = cam_sim_path(sc->sassc->sim); Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Dec 24 01:12:43 2018 (r342385) +++ head/sys/dev/mps/mps_user.c Mon Dec 24 05:05:38 2018 (r342386) @@ -847,8 +847,6 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru task->TaskMID = cm->cm_desc.Default.SMID; cm->cm_data = NULL; - cm->cm_desc.HighPriority.RequestFlags = - MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; cm->cm_complete = NULL; cm->cm_complete_data = NULL; Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Mon Dec 24 01:12:43 2018 (r342385) +++ head/sys/dev/mps/mpsvar.h Mon Dec 24 05:05:38 2018 (r342386) @@ -625,6 +625,8 @@ mps_alloc_high_priority_command(struct mps_softc *sc) TAILQ_REMOVE(&sc->high_priority_req_list, cm, cm_link); cm->cm_state = MPS_CM_STATE_BUSY; cm->cm_timeout_handler = NULL; + cm->cm_desc.HighPriority.RequestFlags = + MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; return (cm); } From owner-svn-src-head@freebsd.org Mon Dec 24 05:54:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 632101357E2D; Mon, 24 Dec 2018 05:54:38 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 A5F1670BB7; Mon, 24 Dec 2018 05:54:37 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99C602046F; Mon, 24 Dec 2018 05:54:37 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBO5sbQ5041042; Mon, 24 Dec 2018 05:54:37 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBO5sbRs041040; Mon, 24 Dec 2018 05:54:37 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201812240554.wBO5sbRs041040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 24 Dec 2018 05:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342387 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 342387 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5F1670BB7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 05:54:38 -0000 Author: scottl Date: Mon Dec 24 05:54:36 2018 New Revision: 342387 URL: https://svnweb.freebsd.org/changeset/base/342387 Log: Commands for user-initated device resets should come from the high-priority allocator. Prior to this change, they would leak from the normal allocator. 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 Mon Dec 24 05:05:38 2018 (r342386) +++ head/sys/dev/mpr/mpr_sas.c Mon Dec 24 05:54:36 2018 (r342387) @@ -3312,7 +3312,7 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, uni KASSERT(ccb->ccb_h.target_id < sassc->maxtargets, ("Target %d out of " "bounds in XPT_RESET_DEV\n", ccb->ccb_h.target_id)); sc = sassc->sc; - tm = mpr_alloc_command(sc); + tm = mprsas_alloc_tm(sc); if (tm == NULL) { mpr_dprint(sc, MPR_ERROR, "command alloc failure in " "mprsas_action_resetdev\n"); @@ -3337,8 +3337,8 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, uni mpr_dprint(sc, MPR_INFO, "%s: Sending reset for target ID %d\n", __func__, targ->tid); tm->cm_targ = targ; - targ->flags |= MPRSAS_TARGET_INRESET; + mprsas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD); mpr_map_command(sc, tm); } Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Dec 24 05:05:38 2018 (r342386) +++ head/sys/dev/mps/mps_sas.c Mon Dec 24 05:54:36 2018 (r342387) @@ -3057,7 +3057,7 @@ mpssas_action_resetdev(struct mpssas_softc *sassc, uni ("Target %d out of bounds in XPT_RESET_DEV\n", ccb->ccb_h.target_id)); sc = sassc->sc; - tm = mps_alloc_command(sc); + tm = mpssas_alloc_tm(sc); if (tm == NULL) { mps_dprint(sc, MPS_ERROR, "command alloc failure in mpssas_action_resetdev\n"); @@ -3079,8 +3079,8 @@ mpssas_action_resetdev(struct mpssas_softc *sassc, uni tm->cm_complete = mpssas_resetdev_complete; tm->cm_complete_data = ccb; tm->cm_targ = targ; - targ->flags |= MPSSAS_TARGET_INRESET; + mpssas_prepare_for_tm(sc, tm, targ, CAM_LUN_WILDCARD); mps_map_command(sc, tm); } From owner-svn-src-head@freebsd.org Mon Dec 24 06:14:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F7D2135841D; Mon, 24 Dec 2018 06:14:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 42B72715A0; Mon, 24 Dec 2018 06:14:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3247E207C3; Mon, 24 Dec 2018 06:14:33 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBO6EXnE052020; Mon, 24 Dec 2018 06:14:33 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBO6EWKs052018; Mon, 24 Dec 2018 06:14:32 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201812240614.wBO6EWKs052018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 24 Dec 2018 06:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342388 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 342388 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 42B72715A0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 06:14:34 -0000 Author: scottl Date: Mon Dec 24 06:14:32 2018 New Revision: 342388 URL: https://svnweb.freebsd.org/changeset/base/342388 Log: Further refactoring for task management commands. Also fix a related typo from the previous commit. 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 Mon Dec 24 05:54:36 2018 (r342387) +++ head/sys/dev/mpr/mpr_sas.c Mon Dec 24 06:14:32 2018 (r342388) @@ -239,10 +239,16 @@ mprsas_startup_decrement(struct mprsas_softc *sassc) struct mpr_command * mprsas_alloc_tm(struct mpr_softc *sc) { + MPI2_SCSI_TASK_MANAGE_REQUEST *req; struct mpr_command *tm; MPR_FUNCTRACE(sc); tm = mpr_alloc_high_priority_command(sc); + if (tm == NULL) + return (NULL); + + req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; + req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; return tm; } @@ -462,7 +468,6 @@ mprsas_prepare_volume_remove(struct mprsas_softc *sass req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; req->DevHandle = targ->handle; - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; /* SAS Hard Link Reset / SATA Link Reset */ @@ -494,7 +499,7 @@ mprsas_prepare_remove(struct mprsas_softc *sassc, uint { MPI2_SCSI_TASK_MANAGE_REQUEST *req; struct mpr_softc *sc; - struct mpr_command *cm; + struct mpr_command *tm; struct mprsas_target *targ = NULL; MPR_FUNCTRACE(sassc->sc); @@ -512,8 +517,8 @@ mprsas_prepare_remove(struct mprsas_softc *sassc, uint targ->flags |= MPRSAS_TARGET_INREMOVAL; - cm = mprsas_alloc_tm(sc); - if (cm == NULL) { + tm = mprsas_alloc_tm(sc); + if (tm == NULL) { mpr_dprint(sc, MPR_ERROR, "%s: command alloc failure\n", __func__); return; @@ -521,25 +526,24 @@ mprsas_prepare_remove(struct mprsas_softc *sassc, uint mprsas_rescan_target(sc, targ); - req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; + req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; memset(req, 0, sizeof(*req)); req->DevHandle = htole16(targ->handle); - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; /* SAS Hard Link Reset / SATA Link Reset */ req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; - cm->cm_targ = targ; - cm->cm_data = NULL; - cm->cm_complete = mprsas_remove_device; - cm->cm_complete_data = (void *)(uintptr_t)handle; + tm->cm_targ = targ; + tm->cm_data = NULL; + tm->cm_complete = mprsas_remove_device; + tm->cm_complete_data = (void *)(uintptr_t)handle; mpr_dprint(sc, MPR_INFO, "%s: Sending reset for target ID %d\n", __func__, targ->tid); - mprsas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD); + mprsas_prepare_for_tm(sc, tm, targ, CAM_LUN_WILDCARD); - mpr_map_command(sc, cm); + mpr_map_command(sc, tm); } static void @@ -1456,7 +1460,6 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_com req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; req->DevHandle = htole16(target->handle); - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = type; if (type == MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET) { @@ -1611,7 +1614,6 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_com req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; req->DevHandle = htole16(targ->handle); - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK; /* XXX Need to handle invalid LUNs */ @@ -3324,7 +3326,6 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, uni targ = &sassc->targets[ccb->ccb_h.target_id]; req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; req->DevHandle = htole16(targ->handle); - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; /* SAS Hard Link Reset / SATA Link Reset */ @@ -3338,7 +3339,7 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, uni __func__, targ->tid); tm->cm_targ = targ; - mprsas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD); + mprsas_prepare_for_tm(sc, tm, targ, CAM_LUN_WILDCARD); mpr_map_command(sc, tm); } Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Dec 24 05:54:36 2018 (r342387) +++ head/sys/dev/mps/mps_sas.c Mon Dec 24 06:14:32 2018 (r342388) @@ -236,9 +236,15 @@ mpssas_startup_decrement(struct mpssas_softc *sassc) struct mps_command * mpssas_alloc_tm(struct mps_softc *sc) { + MPI2_SCSI_TASK_MANAGE_REQUEST *req; struct mps_command *tm; tm = mps_alloc_high_priority_command(sc); + if (tm == NULL) + return (NULL); + + req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; + req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; return tm; } @@ -426,7 +432,7 @@ mpssas_prepare_volume_remove(struct mpssas_softc *sass { MPI2_SCSI_TASK_MANAGE_REQUEST *req; struct mps_softc *sc; - struct mps_command *cm; + struct mps_command *tm; struct mpssas_target *targ = NULL; MPS_FUNCTRACE(sassc->sc); @@ -455,8 +461,8 @@ mpssas_prepare_volume_remove(struct mpssas_softc *sass targ->flags |= MPSSAS_TARGET_INREMOVAL; - cm = mpssas_alloc_tm(sc); - if (cm == NULL) { + tm = mpssas_alloc_tm(sc); + if (tm == NULL) { mps_dprint(sc, MPS_ERROR, "%s: command alloc failure\n", __func__); return; @@ -464,24 +470,23 @@ mpssas_prepare_volume_remove(struct mpssas_softc *sass mpssas_rescan_target(sc, targ); - req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; + req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; req->DevHandle = targ->handle; - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; /* SAS Hard Link Reset / SATA Link Reset */ req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; - cm->cm_targ = targ; - cm->cm_data = NULL; - cm->cm_complete = mpssas_remove_volume; - cm->cm_complete_data = (void *)(uintptr_t)handle; + tm->cm_targ = targ; + tm->cm_data = NULL; + tm->cm_complete = mpssas_remove_volume; + tm->cm_complete_data = (void *)(uintptr_t)handle; mps_dprint(sc, MPS_INFO, "%s: Sending reset for target ID %d\n", __func__, targ->tid); - mpssas_prepare_for_tm(sc, cm, targ, CAM_LUN_WILDCARD); + mpssas_prepare_for_tm(sc, tm, targ, CAM_LUN_WILDCARD); - mps_map_command(sc, cm); + mps_map_command(sc, tm); } /* @@ -528,7 +533,6 @@ mpssas_prepare_remove(struct mpssas_softc *sassc, uint req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; memset(req, 0, sizeof(*req)); req->DevHandle = htole16(targ->handle); - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; /* SAS Hard Link Reset / SATA Link Reset */ @@ -1398,7 +1402,6 @@ mpssas_send_reset(struct mps_softc *sc, struct mps_com req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; req->DevHandle = htole16(target->handle); - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = type; if (type == MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET) { @@ -1546,7 +1549,6 @@ mpssas_send_abort(struct mps_softc *sc, struct mps_com req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; req->DevHandle = htole16(targ->handle); - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK; /* XXX Need to handle invalid LUNs */ @@ -3069,7 +3071,6 @@ mpssas_action_resetdev(struct mpssas_softc *sassc, uni targ = &sassc->targets[ccb->ccb_h.target_id]; req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)tm->cm_req; req->DevHandle = htole16(targ->handle); - req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; /* SAS Hard Link Reset / SATA Link Reset */ From owner-svn-src-head@freebsd.org Mon Dec 24 10:47:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84B34133E565; Mon, 24 Dec 2018 10:47:49 +0000 (UTC) (envelope-from crees@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) server-signature RSA-PSS (4096 bits) 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 2905881488; Mon, 24 Dec 2018 10:47:49 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19650234F3; Mon, 24 Dec 2018 10:47:49 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBOAlmEi092762; Mon, 24 Dec 2018 10:47:48 GMT (envelope-from crees@FreeBSD.org) Received: (from crees@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBOAlmwc092761; Mon, 24 Dec 2018 10:47:48 GMT (envelope-from crees@FreeBSD.org) Message-Id: <201812241047.wBOAlmwc092761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: crees set sender to crees@FreeBSD.org using -f From: Chris Rees Date: Mon, 24 Dec 2018 10:47:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342389 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: crees X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 342389 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2905881488 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 10:47:49 -0000 Author: crees (doc,ports committer) Date: Mon Dec 24 10:47:48 2018 New Revision: 342389 URL: https://svnweb.freebsd.org/changeset/base/342389 Log: Clarify kld_list format PR: docs/234248 Submitted by: David Fiander Submitted by: Miroslav Lachman Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 (r342388) +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 (r342389) @@ -248,12 +248,14 @@ Default .Pa /etc/ddb.conf . .It Va kld_list .Pq Vt str -A list of kernel modules to load right after the local -disks are mounted. +A whitespace-separated list of kernel modules to load right after +the local disks are mounted, without any +.Pa .ko +extension or path. Loading modules at this point in the boot process is much faster than doing it via .Pa /boot/loader.conf -for those modules not necessary for mounting local disk. +for those modules not necessary for mounting local disks. .It Va kldxref_enable .Pq Vt bool Set to From owner-svn-src-head@freebsd.org Mon Dec 24 11:17:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF1EA13404F6; Mon, 24 Dec 2018 11:17:08 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0457A825C0; Mon, 24 Dec 2018 11:17:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wBOBH0L4070739 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 24 Dec 2018 13:17:03 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wBOBH0L4070739 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wBOBH0QU070737; Mon, 24 Dec 2018 13:17:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 24 Dec 2018 13:17:00 +0200 From: Konstantin Belousov To: Chris Rees Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342389 - head/share/man/man5 Message-ID: <20181224111700.GV60291@kib.kiev.ua> References: <201812241047.wBOAlmwc092761@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201812241047.wBOAlmwc092761@repo.freebsd.org> User-Agent: Mutt/1.11.1 (2018-12-01) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 11:17:09 -0000 On Mon, Dec 24, 2018 at 10:47:48AM +0000, Chris Rees wrote: > Author: crees (doc,ports committer) > Date: Mon Dec 24 10:47:48 2018 > New Revision: 342389 > URL: https://svnweb.freebsd.org/changeset/base/342389 > > Log: > Clarify kld_list format > > PR: docs/234248 > Submitted by: David Fiander > Submitted by: Miroslav Lachman > > Modified: > head/share/man/man5/rc.conf.5 > > Modified: head/share/man/man5/rc.conf.5 > ============================================================================== > --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 (r342388) > +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 (r342389) > @@ -248,12 +248,14 @@ Default > .Pa /etc/ddb.conf . > .It Va kld_list > .Pq Vt str > -A list of kernel modules to load right after the local > -disks are mounted. > +A whitespace-separated list of kernel modules to load right after > +the local disks are mounted, without any > +.Pa .ko > +extension or path. I think both extension and path are accepted if supplied. It is the behaviour described in kldload(8). > Loading modules at this point in the boot process is > much faster than doing it via > .Pa /boot/loader.conf > -for those modules not necessary for mounting local disk. > +for those modules not necessary for mounting local disks. > .It Va kldxref_enable > .Pq Vt bool > Set to From owner-svn-src-head@freebsd.org Mon Dec 24 11:23:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A61D413408D0; Mon, 24 Dec 2018 11:23:17 +0000 (UTC) (envelope-from crees@bayofrum.net) Received: from mail50c50.megamailservers.eu (mail166c50.megamailservers.eu [91.136.10.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D82EE82B48; Mon, 24 Dec 2018 11:23:16 +0000 (UTC) (envelope-from crees@bayofrum.net) X-Authenticated-User: bayofrum@uwclub.net Received: from pegasus.bayofrum.net (host-80-41-58-105.as13285.net [80.41.58.105]) (authenticated bits=0) by mail50c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id wBOBN7lf005433; Mon, 24 Dec 2018 11:23:09 +0000 Received: from [192.168.1.75] (Galaxy-Tab-A-2016.bayofrum.net [192.168.1.75]) by pegasus.bayofrum.net (Postfix) with ESMTPSA id 096C42008F; Mon, 24 Dec 2018 11:23:06 +0000 (GMT) Date: Mon, 24 Dec 2018 11:23:07 +0000 Subject: Re: svn commit: r342389 - head/share/man/man5 Message-ID: <9f786428-7fea-4fa4-a29e-ed91997a87fd@email.android.com> X-Android-Message-ID: <9f786428-7fea-4fa4-a29e-ed91997a87fd@email.android.com> In-Reply-To: <20181224111700.GV60291@kib.kiev.ua> From: Chris Rees To: Konstantin Belousov CC: Chris Rees , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Importance: Normal X-Priority: 3 X-Msmail-Priority: Normal X-bayofrum-MailScanner-Information: Please contact the ISP for more information X-bayofrum-MailScanner-ID: 096C42008F.AAFC5 X-bayofrum-MailScanner: Found to be clean X-bayofrum-MailScanner-From: crees@bayofrum.net X-Spam-Status: No X-CTCH-RefID: str=0001.0A0B0205.5C20C19D.002E, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=H6v1PdQi c=1 sm=1 tr=0 a=EuuEpbt/dLJjUk3psnl2FQ==:117 a=EuuEpbt/dLJjUk3psnl2FQ==:17 a=IkcTkHD0fZMA:10 a=2ur7OfE09M0A:10 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=P0S6o3SJAAAA:8 a=3O3vGmC9_PZHiGeDRJgA:9 a=RRtYY_up5ckRmB3q:21 a=QEXdDO2ut3YA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=IjZwj45LgO3ly-622nXo:22 a=WH_0ghv6r2uJcVQkXlWi:22 X-Rspamd-Queue-Id: D82EE82B48 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 11:23:18 -0000 From owner-svn-src-head@freebsd.org Mon Dec 24 13:09:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03869134420C; Mon, 24 Dec 2018 13:09:18 +0000 (UTC) (envelope-from chris@rees.space) Received: from mail56c50.megamailservers.eu (mail168c50.megamailservers.eu [91.136.10.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D32B86198; Mon, 24 Dec 2018 13:09:16 +0000 (UTC) (envelope-from chris@rees.space) X-Authenticated-User: bayofrum@uwclub.net Received: from pegasus.bayofrum.net (host-80-41-58-105.as13285.net [80.41.58.105]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id wBOD97Wl017565; Mon, 24 Dec 2018 13:09:08 +0000 Received: from [192.168.1.121] (POSEIDON.bayofrum.net [192.168.1.121]) by pegasus.bayofrum.net (Postfix) with ESMTPSA id 63A4420438; Mon, 24 Dec 2018 13:08:25 +0000 (GMT) Subject: Re: svn commit: r342389 - head/share/man/man5 To: Chris Rees , Konstantin Belousov , freebsd-rc@freebsd.org CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <9f786428-7fea-4fa4-a29e-ed91997a87fd@email.android.com> From: Chris Rees Message-ID: Date: Mon, 24 Dec 2018 13:07:54 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <9f786428-7fea-4fa4-a29e-ed91997a87fd@email.android.com> Content-Language: en-GB X-bayofrum-MailScanner-Information: Please contact the ISP for more information X-bayofrum-MailScanner-ID: 63A4420438.AE546 X-bayofrum-MailScanner: Found to be clean X-bayofrum-MailScanner-From: chris@rees.space X-Spam-Status: No X-CTCH-RefID: str=0001.0A0B020F.5C20DA75.0009, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Oo5hNR3t c=1 sm=1 tr=0 a=EuuEpbt/dLJjUk3psnl2FQ==:117 a=EuuEpbt/dLJjUk3psnl2FQ==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=2ur7OfE09M0A:10 a=Y8a21bOVD5kA:10 a=ZZnuYtJkoWoA:10 a=r77TgQKjGQsHNAKrUKIA:9 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=ZB5LerlCAAAA:8 a=ZBJCuEuiVagEuX3wvkgA:9 a=QEXdDO2ut3YA:10 a=n8i27M1mAAAA:8 a=P0S6o3SJAAAA:8 a=Sa6a89b31NSX6V2mWewA:9 a=o8gQYmje7EoaxaXp:21 a=_W_S_7VecoQA:10 a=-FEs8UIgK8oA:10 a=NWVoK91CQyQA:10 a=IjZwj45LgO3ly-622nXo:22 a=YKPTzOroS2oaEK2QgPcx:22 a=WH_0ghv6r2uJcVQkXlWi:22 X-Rspamd-Queue-Id: 2D32B86198 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 13:09:18 -0000 Hi again, On 24/12/2018 11:23, Chris Rees wrote: > Hi Konstantin, > > On 24 Dec 2018 11:17, Konstantin Belousov wrote: > > On Mon, Dec 24, 2018 at 10:47:48AM +0000, Chris Rees wrote: > > Author: crees (doc,ports committer) > > Date: Mon Dec 24 10:47:48 2018 > > New Revision: 342389 > > URL: https://svnweb.freebsd.org/changeset/base/342389 > > > > Log: > >   Clarify kld_list format > >   > >   PR: docs/234248 > >   Submitted by: David Fiander > >   Submitted by: Miroslav Lachman > > > > Modified: > >   head/share/man/man5/rc.conf.5 > > > > Modified: head/share/man/man5/rc.conf.5 > > > ============================================================================== > > --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 > (r342388) > > +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 > (r342389) > > @@ -248,12 +248,14 @@ Default > >  .Pa /etc/ddb.conf . > >  .It Va kld_list > >  .Pq Vt str > > -A list of kernel modules to load right after the local > > -disks are mounted. > > +A whitespace-separated list of kernel modules to load right after > > +the local disks are mounted, without any > > +.Pa .ko > > +extension or path. > I think both extension and path are accepted if supplied. > It is the behaviour described in kldload(8). > > > That's true, but the kld rc script adds .ko, so providing the > extension will probably break, and it checks for existing modules > using the provided name as a regex, so that will also fail. > > I don't think that'd be hard to fix though, so I'll fix that and put a > patch up for review later. Having looked again, rc.subr uses kldstat -v, so the path is indeed not a problem, but the extension is-- removing any extension from _kld will ensure that it will always match correctly.  At the moment it is fragile, because it will load correctly the first time but hit an error if the user has put the extension in and the module is already loaded. @RC people, does this look acceptable (I'll need approval please)? https://www.bayofrum.net/~crees/patches/rc-kld_list-extension.diff Chris -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From owner-svn-src-head@freebsd.org Mon Dec 24 13:37:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 529771344B9E; Mon, 24 Dec 2018 13:37:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BD4586DBA; Mon, 24 Dec 2018 13:37:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wBODbLsn002670 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 24 Dec 2018 15:37:24 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wBODbLsn002670 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wBODbLco002669; Mon, 24 Dec 2018 15:37:21 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 24 Dec 2018 15:37:21 +0200 From: Konstantin Belousov To: Chris Rees Cc: Chris Rees , freebsd-rc@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342389 - head/share/man/man5 Message-ID: <20181224133721.GW60291@kib.kiev.ua> References: <9f786428-7fea-4fa4-a29e-ed91997a87fd@email.android.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 13:37:36 -0000 On Mon, Dec 24, 2018 at 01:07:54PM +0000, Chris Rees wrote: > Hi again, > > On 24/12/2018 11:23, Chris Rees wrote: > > Hi Konstantin, > > > > On 24 Dec 2018 11:17, Konstantin Belousov wrote: > > > > On Mon, Dec 24, 2018 at 10:47:48AM +0000, Chris Rees wrote: > > > Author: crees (doc,ports committer) > > > Date: Mon Dec 24 10:47:48 2018 > > > New Revision: 342389 > > > URL: https://svnweb.freebsd.org/changeset/base/342389 > > > > > > Log: > > >   Clarify kld_list format > > >   > > >   PR: docs/234248 > > >   Submitted by: David Fiander > > >   Submitted by: Miroslav Lachman > > > > > > Modified: > > >   head/share/man/man5/rc.conf.5 > > > > > > Modified: head/share/man/man5/rc.conf.5 > > > > > ============================================================================== > > > --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 > > (r342388) > > > +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 > > (r342389) > > > @@ -248,12 +248,14 @@ Default > > >  .Pa /etc/ddb.conf . > > >  .It Va kld_list > > >  .Pq Vt str > > > -A list of kernel modules to load right after the local > > > -disks are mounted. > > > +A whitespace-separated list of kernel modules to load right after > > > +the local disks are mounted, without any > > > +.Pa .ko > > > +extension or path. > > I think both extension and path are accepted if supplied. > > It is the behaviour described in kldload(8). > > > > > > That's true, but the kld rc script adds .ko, so providing the > > extension will probably break, and it checks for existing modules > > using the provided name as a regex, so that will also fail. > > > > I don't think that'd be hard to fix though, so I'll fix that and put a > > patch up for review later. > > Having looked again, rc.subr uses kldstat -v, so the path is indeed not > a problem, but the extension is-- removing any extension from _kld will > ensure that it will always match correctly.  At the moment it is > fragile, because it will load correctly the first time but hit an error > if the user has put the extension in and the module is already loaded. > > @RC people, does this look acceptable (I'll need approval please)? > > https://www.bayofrum.net/~crees/patches/rc-kld_list-extension.diff I do not quite see a point in the check for the module presence. Kernel already rejects already loaded modules (by module name). From owner-svn-src-head@freebsd.org Mon Dec 24 15:35:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD501346FE4; Mon, 24 Dec 2018 15:35:36 +0000 (UTC) (envelope-from chris@rees.space) Received: from mail56c50.megamailservers.eu (mail168c50.megamailservers.eu [91.136.10.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4906F8A2D9; Mon, 24 Dec 2018 15:35:34 +0000 (UTC) (envelope-from chris@rees.space) X-Authenticated-User: bayofrum@uwclub.net Received: from pegasus.bayofrum.net (host-80-41-58-105.as13285.net [80.41.58.105]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id wBOFZU4C019571; Mon, 24 Dec 2018 15:35:31 +0000 Received: from [192.168.1.121] (POSEIDON.bayofrum.net [192.168.1.121]) by pegasus.bayofrum.net (Postfix) with ESMTPSA id 4AD26208EC; Mon, 24 Dec 2018 15:35:27 +0000 (GMT) Subject: Re: svn commit: r342389 - head/share/man/man5 To: Konstantin Belousov CC: Chris Rees , freebsd-rc@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <9f786428-7fea-4fa4-a29e-ed91997a87fd@email.android.com> <20181224133721.GW60291@kib.kiev.ua> From: Chris Rees Message-ID: Date: Mon, 24 Dec 2018 15:34:57 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181224133721.GW60291@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-GB X-bayofrum-MailScanner-Information: Please contact the ISP for more information X-bayofrum-MailScanner-ID: 4AD26208EC.AFEFC X-bayofrum-MailScanner: Found to be clean X-bayofrum-MailScanner-From: chris@rees.space X-Spam-Status: No X-CTCH-RefID: str=0001.0A0B0213.5C20FCC4.0019, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Oo5hNR3t c=1 sm=1 tr=0 a=EuuEpbt/dLJjUk3psnl2FQ==:117 a=EuuEpbt/dLJjUk3psnl2FQ==:17 a=IkcTkHD0fZMA:10 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=2ur7OfE09M0A:10 a=Y8a21bOVD5kA:10 a=ZZnuYtJkoWoA:10 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=ZB5LerlCAAAA:8 a=x1EnRVAJerIUp9-uv3kA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=YKPTzOroS2oaEK2QgPcx:22 X-Rspamd-Queue-Id: 4906F8A2D9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.990,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 15:35:36 -0000 On 24/12/2018 13:37, Konstantin Belousov wrote: > On Mon, Dec 24, 2018 at 01:07:54PM +0000, Chris Rees wrote: >> On 24/12/2018 11:23, Chris Rees wrote: >>> On 24 Dec 2018 11:17, Konstantin Belousov wrote: >>> >>> On Mon, Dec 24, 2018 at 10:47:48AM +0000, Chris Rees wrote: >>> > Author: crees (doc,ports committer) >>> > Date: Mon Dec 24 10:47:48 2018 >>> > New Revision: 342389 >>> > URL: https://svnweb.freebsd.org/changeset/base/342389 >>> > >>> > Log: >>> >   Clarify kld_list format >>> >   >>> >   PR: docs/234248 >>> >   Submitted by: David Fiander >>> >   Submitted by: Miroslav Lachman >>> > >>> > Modified: >>> >   head/share/man/man5/rc.conf.5 >>> > >>> > Modified: head/share/man/man5/rc.conf.5 >>> > >>> ============================================================================== >>> > --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 >>> (r342388) >>> > +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 >>> (r342389) >>> > @@ -248,12 +248,14 @@ Default >>> >  .Pa /etc/ddb.conf . >>> >  .It Va kld_list >>> >  .Pq Vt str >>> > -A list of kernel modules to load right after the local >>> > -disks are mounted. >>> > +A whitespace-separated list of kernel modules to load right after >>> > +the local disks are mounted, without any >>> > +.Pa .ko >>> > +extension or path. >>> I think both extension and path are accepted if supplied. >>> It is the behaviour described in kldload(8). >>> >>> >>> That's true, but the kld rc script adds .ko, so providing the >>> extension will probably break, and it checks for existing modules >>> using the provided name as a regex, so that will also fail. >>> >>> I don't think that'd be hard to fix though, so I'll fix that and put a >>> patch up for review later. >> Having looked again, rc.subr uses kldstat -v, so the path is indeed not >> a problem, but the extension is-- removing any extension from _kld will >> ensure that it will always match correctly.  At the moment it is >> fragile, because it will load correctly the first time but hit an error >> if the user has put the extension in and the module is already loaded. >> >> @RC people, does this look acceptable (I'll need approval please)? >> >> https://www.bayofrum.net/~crees/patches/rc-kld_list-extension.diff > I do not quite see a point in the check for the module presence. > Kernel already rejects already loaded modules (by module name). True; this code predates the -n option to kldload.  Using that makes the whole checking unnecessary. How about this one? https://www.bayofrum.net/~crees/patches/rc-kld_list-extension-2.diff Chris -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From owner-svn-src-head@freebsd.org Mon Dec 24 15:38:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A1913470F6; Mon, 24 Dec 2018 15:38:37 +0000 (UTC) (envelope-from bcran@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) server-signature RSA-PSS (4096 bits) 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 7B17F8A477; Mon, 24 Dec 2018 15:38:37 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 648BC265BA; Mon, 24 Dec 2018 15:38:37 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBOFcb7W043160; Mon, 24 Dec 2018 15:38:37 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBOFcbZG043159; Mon, 24 Dec 2018 15:38:37 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812241538.wBOFcbZG043159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 24 Dec 2018 15:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342396 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 342396 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7B17F8A477 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.987,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 15:38:38 -0000 Author: bcran Date: Mon Dec 24 15:38:36 2018 New Revision: 342396 URL: https://svnweb.freebsd.org/changeset/base/342396 Log: Activate support for efibootmgr(8) -b --bootnum parameter Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18647 Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Mon Dec 24 15:08:19 2018 (r342395) +++ head/usr.sbin/efibootmgr/efibootmgr.c Mon Dec 24 15:38:36 2018 (r342396) @@ -96,6 +96,7 @@ typedef struct _bmgr_opts { static struct option lopts[] = { {"activate", required_argument, NULL, 'a'}, {"bootnext", required_argument, NULL, 'n'}, /* set bootnext */ + {"bootnum", required_argument, NULL, 'b'}, {"bootorder", required_argument, NULL, 'o'}, /* set order */ {"copy", required_argument, NULL, 'C'}, /* Copy boot method */ {"create", no_argument, NULL, 'c'}, @@ -191,7 +192,7 @@ parse_args(int argc, char *argv[]) { int ch; - while ((ch = getopt_long(argc, argv, "A:a:B:C:cDe:hk:L:l:Nn:Oo:Tt:v", + while ((ch = getopt_long(argc, argv, "A:a:B:b:C:cDe:hk:L:l:Nn:Oo:Tt:v", lopts, NULL)) != -1) { switch (ch) { case 'A': From owner-svn-src-head@freebsd.org Mon Dec 24 16:36:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8271C1348C42; Mon, 24 Dec 2018 16:36:41 +0000 (UTC) (envelope-from maxim@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) server-signature RSA-PSS (4096 bits) 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 843B58C1AE; Mon, 24 Dec 2018 16:36:40 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7366D26FA8; Mon, 24 Dec 2018 16:36:40 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBOGae3s074680; Mon, 24 Dec 2018 16:36:40 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBOGaejE074679; Mon, 24 Dec 2018 16:36:40 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201812241636.wBOGaejE074679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Mon, 24 Dec 2018 16:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342397 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: maxim X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 342397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 843B58C1AE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 16:36:41 -0000 Author: maxim Date: Mon Dec 24 16:36:39 2018 New Revision: 342397 URL: https://svnweb.freebsd.org/changeset/base/342397 Log: DragonFly 5.4.0, 5.4.1 and FreeBSD 12.0 releases added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Mon Dec 24 15:38:36 2018 (r342396) +++ head/share/misc/bsd-family-tree Mon Dec 24 16:36:39 2018 (r342397) @@ -363,23 +363,25 @@ FreeBSD 5.2 | | | | 11.1 FreeBSD | | | | | | | 10.4 | | | OpenBSD 6.2 DragonFly 5.0.1 | | | | | | | - | | | | NetBSD 7.1.1 | DragonFly 5.0.2 - | | | | | | | - | | | | NetBSD 7.1.2 | | - | | | | | | | - | | | | | OpenBSD 6.3 | - | | | NetBSD | | DragonFly 5.2.0 - | | | 8.0 | | | - | | | | | | DragonFly 5.2.1 - | | | | | | | - | | | | | | DragonFly 5.2.2 - | FreeBSD | | NetBSD 7.2 | | - | 11.2 | | | | | - | | | | | OpenBSD 6.4 | - | v | | | | | - | | | v | | -FreeBSD 12 -current | NetBSD -current OpenBSD -current DragonFly -current + | `------. | | NetBSD 7.1.1 | DragonFly 5.0.2 + | | | | | | | + | | | | NetBSD 7.1.2 | | + | | | | | | | + | | | | | OpenBSD 6.3 | + | | | NetBSD | | DragonFly 5.2.0 + | | | 8.0 | | | + | | | | | | DragonFly 5.2.1 + | | | | | | | + | | | | | | DragonFly 5.2.2 + | FreeBSD | | NetBSD 7.2 | | + | 11.2 | | | | | + | | | | OpenBSD 6.4 | + | | | | | DragonFly 5.4.0 + *--FreeBSD | | v | | + | 12.0 | | | DragonFly 5.4.1 | | | | | +FreeBSD 13 -current | NetBSD -current OpenBSD -current DragonFly -current + | | | | | v v v v v Time @@ -755,6 +757,9 @@ FreeBSD 11.2 2018-06-27 [FBD] NetBSD 8.0 2018-07-17 [NBD] NetBSD 7.2 2018-08-29 [NBD] OpenBSD 6.4 2018-10-18 [OBD] +DragonFly 5.4.0 2018-12-03 [DFB] +FreeBSD 12.0 2018-12-11 [FBD] +DragonFly 5.4.1 2018-12-24 [DFB] Bibliography ------------------------ From owner-svn-src-head@freebsd.org Mon Dec 24 16:50:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17BFF134917E; Mon, 24 Dec 2018 16:50:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E61988C92D; Mon, 24 Dec 2018 16:50:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wBOGoO7r048303 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 24 Dec 2018 18:50:27 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wBOGoO7r048303 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wBOGoN7X048296; Mon, 24 Dec 2018 18:50:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 24 Dec 2018 18:50:23 +0200 From: Konstantin Belousov To: Chris Rees Cc: Chris Rees , freebsd-rc@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342389 - head/share/man/man5 Message-ID: <20181224165023.GY60291@kib.kiev.ua> References: <9f786428-7fea-4fa4-a29e-ed91997a87fd@email.android.com> <20181224133721.GW60291@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 16:50:34 -0000 On Mon, Dec 24, 2018 at 03:34:57PM +0000, Chris Rees wrote: > On 24/12/2018 13:37, Konstantin Belousov wrote: > > On Mon, Dec 24, 2018 at 01:07:54PM +0000, Chris Rees wrote: > >> On 24/12/2018 11:23, Chris Rees wrote: > >>> On 24 Dec 2018 11:17, Konstantin Belousov wrote: > >>> > >>> On Mon, Dec 24, 2018 at 10:47:48AM +0000, Chris Rees wrote: > >>> > Author: crees (doc,ports committer) > >>> > Date: Mon Dec 24 10:47:48 2018 > >>> > New Revision: 342389 > >>> > URL: https://svnweb.freebsd.org/changeset/base/342389 > >>> > > >>> > Log: > >>> >   Clarify kld_list format > >>> >   > >>> >   PR: docs/234248 > >>> >   Submitted by: David Fiander > >>> >   Submitted by: Miroslav Lachman > >>> > > >>> > Modified: > >>> >   head/share/man/man5/rc.conf.5 > >>> > > >>> > Modified: head/share/man/man5/rc.conf.5 > >>> > > >>> ============================================================================== > >>> > --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 > >>> (r342388) > >>> > +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 > >>> (r342389) > >>> > @@ -248,12 +248,14 @@ Default > >>> >  .Pa /etc/ddb.conf . > >>> >  .It Va kld_list > >>> >  .Pq Vt str > >>> > -A list of kernel modules to load right after the local > >>> > -disks are mounted. > >>> > +A whitespace-separated list of kernel modules to load right after > >>> > +the local disks are mounted, without any > >>> > +.Pa .ko > >>> > +extension or path. > >>> I think both extension and path are accepted if supplied. > >>> It is the behaviour described in kldload(8). > >>> > >>> > >>> That's true, but the kld rc script adds .ko, so providing the > >>> extension will probably break, and it checks for existing modules > >>> using the provided name as a regex, so that will also fail. > >>> > >>> I don't think that'd be hard to fix though, so I'll fix that and put a > >>> patch up for review later. > >> Having looked again, rc.subr uses kldstat -v, so the path is indeed not > >> a problem, but the extension is-- removing any extension from _kld will > >> ensure that it will always match correctly.  At the moment it is > >> fragile, because it will load correctly the first time but hit an error > >> if the user has put the extension in and the module is already loaded. > >> > >> @RC people, does this look acceptable (I'll need approval please)? > >> > >> https://www.bayofrum.net/~crees/patches/rc-kld_list-extension.diff > > I do not quite see a point in the check for the module presence. > > Kernel already rejects already loaded modules (by module name). > > True; this code predates the -n option to kldload.  Using that makes the > whole checking unnecessary. > > How about this one? > > https://www.bayofrum.net/~crees/patches/rc-kld_list-extension-2.diff It looks reasonable to me. I am not sure if we want to keep the options for load_kld for benefit of the third-party scripts, or not. E.g. we can silently ignore them. How was this tested ? From owner-svn-src-head@freebsd.org Mon Dec 24 19:10:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 203C6134BF35; Mon, 24 Dec 2018 19:10:32 +0000 (UTC) (envelope-from chris@rees.space) Received: from mail37c50.megamailservers.eu (mail161c50.megamailservers.eu [91.136.10.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DDB88FF56; Mon, 24 Dec 2018 19:10:30 +0000 (UTC) (envelope-from chris@rees.space) X-Authenticated-User: bayofrum@uwclub.net Received: from pegasus.bayofrum.net (host-80-41-58-105.as13285.net [80.41.58.105]) (authenticated bits=0) by mail37c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id wBOIvCUB008265; Mon, 24 Dec 2018 18:57:14 +0000 Received: from [192.168.1.121] (POSEIDON.bayofrum.net [192.168.1.121]) by pegasus.bayofrum.net (Postfix) with ESMTPSA id 8CF3E20F12; Mon, 24 Dec 2018 18:57:10 +0000 (GMT) Subject: Re: svn commit: r342389 - head/share/man/man5 To: Konstantin Belousov CC: Chris Rees , freebsd-rc@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <9f786428-7fea-4fa4-a29e-ed91997a87fd@email.android.com> <20181224133721.GW60291@kib.kiev.ua> <20181224165023.GY60291@kib.kiev.ua> From: Chris Rees Message-ID: Date: Mon, 24 Dec 2018 18:56:40 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181224165023.GY60291@kib.kiev.ua> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-GB X-bayofrum-MailScanner-Information: Please contact the ISP for more information X-bayofrum-MailScanner-ID: 8CF3E20F12.A115D X-bayofrum-MailScanner: Found to be clean X-bayofrum-MailScanner-From: chris@rees.space X-Spam-Status: No X-CTCH-RefID: str=0001.0A0B020C.5C212C0A.001F, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=POghB8iC c=1 sm=1 tr=0 a=EuuEpbt/dLJjUk3psnl2FQ==:117 a=EuuEpbt/dLJjUk3psnl2FQ==:17 a=IkcTkHD0fZMA:10 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=2ur7OfE09M0A:10 a=Y8a21bOVD5kA:10 a=ZZnuYtJkoWoA:10 a=pGLkceISAAAA:8 a=6I5d2MoRAAAA:8 a=ZB5LerlCAAAA:8 a=3-IN03I_HsmVaqBs_CAA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 a=YKPTzOroS2oaEK2QgPcx:22 X-Rspamd-Queue-Id: 3DDB88FF56 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.985,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 19:10:32 -0000 On 24/12/2018 16:50, Konstantin Belousov wrote: > On Mon, Dec 24, 2018 at 03:34:57PM +0000, Chris Rees wrote: >> On 24/12/2018 13:37, Konstantin Belousov wrote: >>> On Mon, Dec 24, 2018 at 01:07:54PM +0000, Chris Rees wrote: >>>> On 24/12/2018 11:23, Chris Rees wrote: >>>>> On 24 Dec 2018 11:17, Konstantin Belousov wrote: >>>>> >>>>> On Mon, Dec 24, 2018 at 10:47:48AM +0000, Chris Rees wrote: >>>>> > Author: crees (doc,ports committer) >>>>> > Date: Mon Dec 24 10:47:48 2018 >>>>> > New Revision: 342389 >>>>> > URL: https://svnweb.freebsd.org/changeset/base/342389 >>>>> > >>>>> > Log: >>>>> >   Clarify kld_list format >>>>> >   >>>>> >   PR: docs/234248 >>>>> >   Submitted by: David Fiander >>>>> >   Submitted by: Miroslav Lachman >>>>> > >>>>> > Modified: >>>>> >   head/share/man/man5/rc.conf.5 >>>>> > >>>>> > Modified: head/share/man/man5/rc.conf.5 >>>>> > >>>>> ============================================================================== >>>>> > --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 >>>>> (r342388) >>>>> > +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 >>>>> (r342389) >>>>> > @@ -248,12 +248,14 @@ Default >>>>> >  .Pa /etc/ddb.conf . >>>>> >  .It Va kld_list >>>>> >  .Pq Vt str >>>>> > -A list of kernel modules to load right after the local >>>>> > -disks are mounted. >>>>> > +A whitespace-separated list of kernel modules to load right after >>>>> > +the local disks are mounted, without any >>>>> > +.Pa .ko >>>>> > +extension or path. >>>>> I think both extension and path are accepted if supplied. >>>>> It is the behaviour described in kldload(8). >>>>> >>>>> >>>>> That's true, but the kld rc script adds .ko, so providing the >>>>> extension will probably break, and it checks for existing modules >>>>> using the provided name as a regex, so that will also fail. >>>>> >>>>> I don't think that'd be hard to fix though, so I'll fix that and put a >>>>> patch up for review later. >>>> Having looked again, rc.subr uses kldstat -v, so the path is indeed not >>>> a problem, but the extension is-- removing any extension from _kld will >>>> ensure that it will always match correctly.  At the moment it is >>>> fragile, because it will load correctly the first time but hit an error >>>> if the user has put the extension in and the module is already loaded. >>>> >>>> @RC people, does this look acceptable (I'll need approval please)? >>>> >>>> https://www.bayofrum.net/~crees/patches/rc-kld_list-extension.diff >>> I do not quite see a point in the check for the module presence. >>> Kernel already rejects already loaded modules (by module name). >> True; this code predates the -n option to kldload.  Using that makes the >> whole checking unnecessary. >> >> How about this one? >> >> https://www.bayofrum.net/~crees/patches/rc-kld_list-extension-2.diff > It looks reasonable to me. I am not sure if we want to keep the options > for load_kld for benefit of the third-party scripts, or not. E.g. we can > silently ignore them. Yeah, my patch ignores them silently.  It has the added bonus of not needing to sweep the ports tree, with all the version issues that entails as the behaviour has slightly changed if the options are necessary at that point. > How was this tested ? [crees@pegasus]~/workspace/src/head% sudo sh # . libexec/rc/rc.subr # kldstat |grep cuse # load_kld cuse4bsd # kldstat |grep cuse 15    1 0xffffffff818c3000 40a0     cuse.ko # load_kld cuse4bsd # load_kld doesntexist kldload: can't load doesntexist: No such file or directory sh: WARNING: Unable to load kernel module doesntexist # kldunload cuse # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko # kldstat |grep cuse 15    1 0xffffffff818c3000 4c80     cuse4bsd.ko # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko # kldstat |grep cuse 15    1 0xffffffff818c3000 4c80     cuse4bsd.ko # It's rather a curiosity for me that cuse4bsd only loads as itself if called by path, but it doesn't happen with any other modules-- this was just to prove that full paths and extensions work correctly as intended.  My machine also boots fine. Can you think of any other behaviour I'd need to check? Chris -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From owner-svn-src-head@freebsd.org Mon Dec 24 19:37:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38788134CD2C; Mon, 24 Dec 2018 19:37:11 +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) server-signature RSA-PSS (4096 bits) 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 D376C6A324; Mon, 24 Dec 2018 19:37:10 +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 B88BEE0C; Mon, 24 Dec 2018 19:37:10 +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 wBOJbA7r068155; Mon, 24 Dec 2018 19:37:10 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBOJbAvo068153; Mon, 24 Dec 2018 19:37:10 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201812241937.wBOJbAvo068153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 24 Dec 2018 19:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342398 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 342398 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D376C6A324 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 19:37:11 -0000 Author: cem Date: Mon Dec 24 19:37:10 2018 New Revision: 342398 URL: https://svnweb.freebsd.org/changeset/base/342398 Log: Enable sys/random.h #include from C++ And bump __FreeBSD_version, just in case. PR: 234180 Submitted by: Ralf van der Enden MFC after: 5 days Modified: head/sys/sys/param.h head/sys/sys/random.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Dec 24 16:36:39 2018 (r342397) +++ head/sys/sys/param.h Mon Dec 24 19:37:10 2018 (r342398) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300005 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300006 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Mon Dec 24 16:36:39 2018 (r342397) +++ head/sys/sys/random.h Mon Dec 24 19:37:10 2018 (r342398) @@ -153,6 +153,9 @@ void random_harvest_deregister_source(enum random_entr #define GRND_NONBLOCK 0x1 #define GRND_RANDOM 0x2 + +__BEGIN_DECLS ssize_t getrandom(void *buf, size_t buflen, unsigned int flags); +__END_DECLS #endif /* _SYS_RANDOM_H_ */ From owner-svn-src-head@freebsd.org Mon Dec 24 23:28:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF4C7135270F; Mon, 24 Dec 2018 23:28:11 +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) server-signature RSA-PSS (4096 bits) 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 91A6570D98; Mon, 24 Dec 2018 23:28:11 +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 7C0883494; Mon, 24 Dec 2018 23:28:11 +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 wBONSBVO088888; Mon, 24 Dec 2018 23:28:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBONSBuK088887; Mon, 24 Dec 2018 23:28:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201812242328.wBONSBuK088887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 24 Dec 2018 23:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342399 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 342399 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 91A6570D98 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 23:28:12 -0000 Author: mav Date: Mon Dec 24 23:28:11 2018 New Revision: 342399 URL: https://svnweb.freebsd.org/changeset/base/342399 Log: Remove CAM SIM lock from NVMe SIM. CAM does not require SIM lock since FreeBSD 10.4, and NVMe code never required it at all, using per-queue locks instead. This formally allows parallel request submission in CAM mode as much as single per-device and per-queue locks of CAM allow. MFC after: 1 month Modified: head/sys/dev/nvme/nvme_sim.c Modified: head/sys/dev/nvme/nvme_sim.c ============================================================================== --- head/sys/dev/nvme/nvme_sim.c Mon Dec 24 19:37:10 2018 (r342398) +++ head/sys/dev/nvme/nvme_sim.c Mon Dec 24 23:28:11 2018 (r342399) @@ -150,8 +150,6 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) ctrlr = sim2ctrlr(sim); - mtx_assert(&ctrlr->lock, MA_OWNED); - switch (ccb->ccb_h.func_code) { case XPT_CALC_GEOMETRY: /* Calculate Geometry Totally nuts ? XXX */ /* @@ -289,7 +287,7 @@ nvme_sim_new_controller(struct nvme_controller *ctrlr) sc->s_sim = cam_sim_alloc(nvme_sim_action, nvme_sim_poll, "nvme", sc, device_get_unit(ctrlr->dev), - &ctrlr->lock, max_trans, max_trans, devq); + NULL, max_trans, max_trans, devq); if (sc->s_sim == NULL) { printf("Failed to allocate a sim\n"); cam_simq_free(devq); @@ -320,11 +318,8 @@ static void * nvme_sim_new_ns(struct nvme_namespace *ns, void *sc_arg) { struct nvme_sim_softc *sc = sc_arg; - struct nvme_controller *ctrlr = sc->s_ctrlr; union ccb *ccb; - mtx_lock(&ctrlr->lock); - ccb = xpt_alloc_ccb_nowait(); if (ccb == NULL) { printf("unable to alloc CCB for rescan\n"); @@ -340,8 +335,6 @@ nvme_sim_new_ns(struct nvme_namespace *ns, void *sc_ar xpt_rescan(ccb); - mtx_unlock(&ctrlr->lock); - return (ns); } @@ -349,14 +342,11 @@ static void nvme_sim_controller_fail(void *ctrlr_arg) { struct nvme_sim_softc *sc = ctrlr_arg; - struct nvme_controller *ctrlr = sc->s_ctrlr; - mtx_lock(&ctrlr->lock); xpt_async(AC_LOST_DEVICE, sc->s_path, NULL); xpt_free_path(sc->s_path); xpt_bus_deregister(cam_sim_path(sc->s_sim)); cam_sim_free(sc->s_sim, /*free_devq*/TRUE); - mtx_unlock(&ctrlr->lock); free(sc, M_NVME); } From owner-svn-src-head@freebsd.org Mon Dec 24 23:52:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E2501353174; Mon, 24 Dec 2018 23:52:36 +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) server-signature RSA-PSS (4096 bits) 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 B7B4F71DF2; Mon, 24 Dec 2018 23:52:35 +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 9ECCA3C01; Mon, 24 Dec 2018 23:52:35 +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 wBONqZov005805; Mon, 24 Dec 2018 23:52:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBONqZ5h005804; Mon, 24 Dec 2018 23:52:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201812242352.wBONqZ5h005804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 24 Dec 2018 23:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342400 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342400 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7B4F71DF2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Dec 2018 23:52:36 -0000 Author: mav Date: Mon Dec 24 23:52:35 2018 New Revision: 342400 URL: https://svnweb.freebsd.org/changeset/base/342400 Log: Increase MTX_POOL_SLEEP_SIZE from 128 to 1024. This value remained unchanged for 15 years, and now this bump reduces lock spinning in GEOM and BIO layers while doing ~1.6M IOPS to 4 NVMe on 72-core system from ~25% to ~5% by the cost of additional 28KB RAM. While there, align struct mtx_pool fields to cache lines. MFC after: 1 month Modified: head/sys/kern/kern_mtxpool.c Modified: head/sys/kern/kern_mtxpool.c ============================================================================== --- head/sys/kern/kern_mtxpool.c Mon Dec 24 23:28:11 2018 (r342399) +++ head/sys/kern/kern_mtxpool.c Mon Dec 24 23:52:35 2018 (r342400) @@ -62,14 +62,14 @@ static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex poo /* Pool sizes must be a power of two */ #ifndef MTX_POOL_SLEEP_SIZE -#define MTX_POOL_SLEEP_SIZE 128 +#define MTX_POOL_SLEEP_SIZE 1024 #endif struct mtxpool_header { int mtxpool_size; int mtxpool_mask; int mtxpool_shift; - int mtxpool_next; + int mtxpool_next __aligned(CACHE_LINE_SIZE); }; struct mtx_pool { From owner-svn-src-head@freebsd.org Tue Dec 25 07:41:58 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EAC41345547; Tue, 25 Dec 2018 07:41:58 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBCA58FC06; Tue, 25 Dec 2018 07:41:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wBP7fkFt050136 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 25 Dec 2018 09:41:49 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wBP7fkFt050136 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wBP7fjvI050134; Tue, 25 Dec 2018 09:41:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 25 Dec 2018 09:41:45 +0200 From: Konstantin Belousov To: Chris Rees Cc: Chris Rees , freebsd-rc@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342389 - head/share/man/man5 Message-ID: <20181225074145.GA60291@kib.kiev.ua> References: <9f786428-7fea-4fa4-a29e-ed91997a87fd@email.android.com> <20181224133721.GW60291@kib.kiev.ua> <20181224165023.GY60291@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Dec 2018 07:41:58 -0000 On Mon, Dec 24, 2018 at 06:56:40PM +0000, Chris Rees wrote: > On 24/12/2018 16:50, Konstantin Belousov wrote: > > On Mon, Dec 24, 2018 at 03:34:57PM +0000, Chris Rees wrote: > >> On 24/12/2018 13:37, Konstantin Belousov wrote: > >>> On Mon, Dec 24, 2018 at 01:07:54PM +0000, Chris Rees wrote: > >>>> On 24/12/2018 11:23, Chris Rees wrote: > >>>>> On 24 Dec 2018 11:17, Konstantin Belousov wrote: > >>>>> > >>>>> On Mon, Dec 24, 2018 at 10:47:48AM +0000, Chris Rees wrote: > >>>>> > Author: crees (doc,ports committer) > >>>>> > Date: Mon Dec 24 10:47:48 2018 > >>>>> > New Revision: 342389 > >>>>> > URL: https://svnweb.freebsd.org/changeset/base/342389 > >>>>> > > >>>>> > Log: > >>>>> >   Clarify kld_list format > >>>>> >   > >>>>> >   PR: docs/234248 > >>>>> >   Submitted by: David Fiander > >>>>> >   Submitted by: Miroslav Lachman > >>>>> > > >>>>> > Modified: > >>>>> >   head/share/man/man5/rc.conf.5 > >>>>> > > >>>>> > Modified: head/share/man/man5/rc.conf.5 > >>>>> > > >>>>> ============================================================================== > >>>>> > --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 > >>>>> (r342388) > >>>>> > +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 > >>>>> (r342389) > >>>>> > @@ -248,12 +248,14 @@ Default > >>>>> >  .Pa /etc/ddb.conf . > >>>>> >  .It Va kld_list > >>>>> >  .Pq Vt str > >>>>> > -A list of kernel modules to load right after the local > >>>>> > -disks are mounted. > >>>>> > +A whitespace-separated list of kernel modules to load right after > >>>>> > +the local disks are mounted, without any > >>>>> > +.Pa .ko > >>>>> > +extension or path. > >>>>> I think both extension and path are accepted if supplied. > >>>>> It is the behaviour described in kldload(8). > >>>>> > >>>>> > >>>>> That's true, but the kld rc script adds .ko, so providing the > >>>>> extension will probably break, and it checks for existing modules > >>>>> using the provided name as a regex, so that will also fail. > >>>>> > >>>>> I don't think that'd be hard to fix though, so I'll fix that and put a > >>>>> patch up for review later. > >>>> Having looked again, rc.subr uses kldstat -v, so the path is indeed not > >>>> a problem, but the extension is-- removing any extension from _kld will > >>>> ensure that it will always match correctly.  At the moment it is > >>>> fragile, because it will load correctly the first time but hit an error > >>>> if the user has put the extension in and the module is already loaded. > >>>> > >>>> @RC people, does this look acceptable (I'll need approval please)? > >>>> > >>>> https://www.bayofrum.net/~crees/patches/rc-kld_list-extension.diff > >>> I do not quite see a point in the check for the module presence. > >>> Kernel already rejects already loaded modules (by module name). > >> True; this code predates the -n option to kldload.  Using that makes the > >> whole checking unnecessary. > >> > >> How about this one? > >> > >> https://www.bayofrum.net/~crees/patches/rc-kld_list-extension-2.diff > > It looks reasonable to me. I am not sure if we want to keep the options > > for load_kld for benefit of the third-party scripts, or not. E.g. we can > > silently ignore them. > > Yeah, my patch ignores them silently.  It has the added bonus of not > needing to sweep the ports tree, with all the version issues that > entails as the behaviour has slightly changed if the options are > necessary at that point. > > > How was this tested ? > [crees@pegasus]~/workspace/src/head% sudo sh > # . libexec/rc/rc.subr > # kldstat |grep cuse > # load_kld cuse4bsd > # kldstat |grep cuse > 15    1 0xffffffff818c3000 40a0     cuse.ko > # load_kld cuse4bsd > # load_kld doesntexist > kldload: can't load doesntexist: No such file or directory > sh: WARNING: Unable to load kernel module doesntexist > # kldunload cuse > # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko > # kldstat |grep cuse > 15    1 0xffffffff818c3000 4c80     cuse4bsd.ko > # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko > # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko > # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko > # kldstat |grep cuse > 15    1 0xffffffff818c3000 4c80     cuse4bsd.ko I suppose escapes are something that your mail agent inserted and not the actual system output. The script looks fine to me, but I am not the right person to stamp the approval on the rc changes. > # > > It's rather a curiosity for me that cuse4bsd only loads as itself if > called by path, but it doesn't happen with any other modules-- this was > just to prove that full paths and extensions work correctly as > intended.  My machine also boots fine. > > Can you think of any other behaviour I'd need to check? No, for me it looks good enough. From owner-svn-src-head@freebsd.org Tue Dec 25 10:15:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C9F8134CB93; Tue, 25 Dec 2018 10:15:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 F3B5C6F0D3; Tue, 25 Dec 2018 10:15:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8237AD96; Tue, 25 Dec 2018 10:15:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBPAFmGs037059; Tue, 25 Dec 2018 10:15:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBPAFmd5037058; Tue, 25 Dec 2018 10:15:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201812251015.wBPAFmd5037058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 25 Dec 2018 10:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342456 - head/sys/dev/sound/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/sound/usb X-SVN-Commit-Revision: 342456 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3B5C6F0D3 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Dec 2018 10:15:49 -0000 Author: hselasky Date: Tue Dec 25 10:15:48 2018 New Revision: 342456 URL: https://svnweb.freebsd.org/changeset/base/342456 Log: Fix reading of USB sample rate descriptor for SPL Crimson Rev 1. Read first one entry, then try to read the full rate descriptor table. PR: 234380 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue Dec 25 07:39:34 2018 (r342455) +++ head/sys/dev/sound/usb/uaudio.c Tue Dec 25 10:15:48 2018 (r342456) @@ -1520,7 +1520,8 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i { struct usb_device_request req; usb_error_t error; - uint8_t data[255]; +#define UAUDIO20_MAX_RATES 32 /* we support at maxium 32 rates */ + uint8_t data[2 + UAUDIO20_MAX_RATES * 12]; uint16_t actlen; uint16_t rates; uint16_t x; @@ -1532,19 +1533,57 @@ uaudio20_check_rate(struct usb_device *udev, uint8_t i req.bRequest = UA20_CS_RANGE; USETW2(req.wValue, UA20_CS_SAM_FREQ_CONTROL, 0); USETW2(req.wIndex, clockid, iface_no); - USETW(req.wLength, 255); + /* + * Assume there is at least one rate to begin with, else some + * devices might refuse to return the USB descriptor: + */ + USETW(req.wLength, (2 + 1 * 12)); - error = usbd_do_request_flags(udev, NULL, &req, data, + error = usbd_do_request_flags(udev, NULL, &req, data, USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); - if (error != 0 || actlen < 2) - return (USB_ERR_INVAL); + if (error != 0 || actlen < 2) { + /* + * Likely the descriptor doesn't fit into the supplied + * buffer. Try using a larger buffer and see if that + * helps: + */ + rates = MIN(UAUDIO20_MAX_RATES, (255 - 2) / 12); + error = USB_ERR_INVAL; + } else { + rates = UGETW(data); - rates = data[0] | (data[1] << 8); + if (rates > UAUDIO20_MAX_RATES) { + DPRINTF("Too many rates truncating to %d\n", UAUDIO20_MAX_RATES); + rates = UAUDIO20_MAX_RATES; + error = USB_ERR_INVAL; + } else if (rates > 1) { + DPRINTF("Need to read full rate descriptor\n"); + error = USB_ERR_INVAL; + } + } + + if (error != 0) { + /* + * Try to read full rate descriptor. + */ + actlen = (2 + rates * 12); + + USETW(req.wLength, actlen); + + error = usbd_do_request_flags(udev, NULL, &req, data, + USB_SHORT_XFER_OK, &actlen, USB_DEFAULT_TIMEOUT); + + if (error != 0 || actlen < 2) + return (USB_ERR_INVAL); + + rates = UGETW(data); + } + actlen = (actlen - 2) / 12; if (rates > actlen) { - DPRINTF("Too many rates\n"); + DPRINTF("Too many rates truncating to %d\n", actlen); rates = actlen; } From owner-svn-src-head@freebsd.org Tue Dec 25 15:18:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1967E1354F56; Tue, 25 Dec 2018 15:18:43 +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) server-signature RSA-PSS (4096 bits) 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 B54B380AB6; Tue, 25 Dec 2018 15:18:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B949E1D9; Tue, 25 Dec 2018 15:18:42 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBPFIgVu095770; Tue, 25 Dec 2018 15:18:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBPFIgos095766; Tue, 25 Dec 2018 15:18:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201812251518.wBPFIgos095766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 25 Dec 2018 15:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342466 - in head/sbin/bectl: . tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sbin/bectl: . tests X-SVN-Commit-Revision: 342466 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B54B380AB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Dec 2018 15:18:43 -0000 Author: kevans Date: Tue Dec 25 15:18:41 2018 New Revision: 342466 URL: https://svnweb.freebsd.org/changeset/base/342466 Log: bectl: use jail id as the default jail name for a boot environment By default, bectl is setting the jail 'name' parameter to the boot environment name, which causes an error when the boot environment name is not a valid jail name. With the attached fix, when no name is supplied, the default jail name will be the jail id - this is is the same behavior as the jail command. Additionally, this commit addresses two other bugs that prevented unjailing in scenarios where the jail name does not match the boot environment name: 1. In 'bectl_locate_jail', 'mountpoint' is used to resolve the boot environment path, but really 'mounted' should be used. 'mountpoint' is the path where the zfs dataset will be mounted. 'mounted' is the path where the dataset is actually mounted. 2. in 'bectl_search_jail_paths', 'jail_getv' would fail after the first call. Which is fine, if the boot environment you're unjailing is the next one up. According to 'man jail_getv', it's expecting name and value strings. 'jail_getv' is being passed an integer for the lastjid, so amend that to use a string instead. Test cases have been amended to reflect the bugs found. PR: 233637 Submitted by: Rob MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18607 Modified: head/sbin/bectl/bectl.8 head/sbin/bectl/bectl_jail.c head/sbin/bectl/tests/bectl_test.sh Modified: head/sbin/bectl/bectl.8 ============================================================================== --- head/sbin/bectl/bectl.8 Tue Dec 25 14:06:52 2018 (r342465) +++ head/sbin/bectl/bectl.8 Tue Dec 25 15:18:41 2018 (r342466) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2018 +.Dd December 25, 2018 .Dt BECTL 8 .Os .Sh NAME @@ -52,7 +52,6 @@ .Cm jail .Brq Fl b | Fl U .Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ... -.Brq Ar jailID | jailName .Ar bootenv .Op Ar utility Op Ar argument ... .Nm @@ -153,7 +152,6 @@ from .Cm jail .Brq Fl b | Fl U .Oo Bro Fl o Ar key Ns = Ns Ar value | Fl u Ar key Brc Oc Ns ... -.Brq Ar jailID | jailName .Ao Ar bootenv Ac .Op Ar utility Op Ar argument ... .Xc @@ -193,10 +191,7 @@ The .Va host.hostname , and .Va path -may not actually be unset. -Attempts to unset any of these will revert them to the default values specified -below, if they have been overwritten by -.Fl o . +must be set, the default values are specified below. .Pp All .Ar key Ns = Ns Ar value @@ -207,7 +202,7 @@ The following default parameters are provided: .It Va allow.mount Ta Cm true .It Va allow.mount.devfs Ta Cm true .It Va enforce_statfs Ta Cm 1 -.It Va name Ta Va bootenv +.It Va name Ta jail id .It Va host.hostname Ta Va bootenv .It Va path Ta Set to a path in /tmp generated by .Xr libbe 3 . Modified: head/sbin/bectl/bectl_jail.c ============================================================================== --- head/sbin/bectl/bectl_jail.c Tue Dec 25 14:06:52 2018 (r342465) +++ head/sbin/bectl/bectl_jail.c Tue Dec 25 15:18:41 2018 (r342466) @@ -181,10 +181,10 @@ bectl_cmd_jail(int argc, char *argv[]) { char *bootenv, *mountpoint; int jid, opt, ret; - bool default_hostname, default_name, interactive, unjail; + bool default_hostname, interactive, unjail; pid_t pid; - default_hostname = default_name = interactive = unjail = true; + default_hostname = interactive = unjail = true; jpcnt = INIT_PARAMCOUNT; jp = malloc(jpcnt * sizeof(*jp)); if (jp == NULL) @@ -206,8 +206,6 @@ bectl_cmd_jail(int argc, char *argv[]) * optarg has been modified to null terminate * at the assignment operator. */ - if (strcmp(optarg, "name") == 0) - default_name = false; if (strcmp(optarg, "host.hostname") == 0) default_hostname = false; } @@ -217,8 +215,6 @@ bectl_cmd_jail(int argc, char *argv[]) break; case 'u': if ((ret = jailparam_delarg(optarg)) == 0) { - if (strcmp(optarg, "name") == 0) - default_name = true; if (strcmp(optarg, "host.hostname") == 0) default_hostname = true; } else if (ret != ENOENT) { @@ -259,8 +255,6 @@ bectl_cmd_jail(int argc, char *argv[]) return (1); } - if (default_name) - jailparam_add("name", bootenv); if (default_hostname) jailparam_add("host.hostname", bootenv); @@ -316,15 +310,23 @@ bectl_cmd_jail(int argc, char *argv[]) static int bectl_search_jail_paths(const char *mnt) { - char jailpath[MAXPATHLEN]; int jid; + char lastjid[16]; + char jailpath[MAXPATHLEN]; + /* jail_getv expects name/value strings */ + snprintf(lastjid, sizeof(lastjid), "%d", 0); + jid = 0; - (void)mnt; - while ((jid = jail_getv(0, "lastjid", &jid, "path", &jailpath, + while ((jid = jail_getv(0, "lastjid", lastjid, "path", &jailpath, NULL)) != -1) { + + /* the jail we've been looking for */ if (strcmp(jailpath, mnt) == 0) return (jid); + + /* update lastjid and keep on looking */ + snprintf(lastjid, sizeof(lastjid), "%d", jid); } return (-1); @@ -354,8 +356,11 @@ bectl_locate_jail(const char *ident) return (-1); if (nvlist_lookup_nvlist(belist, ident, &props) == 0) { - /* We'll attempt to resolve the jid by way of mountpoint */ - if (nvlist_lookup_string(props, "mountpoint", &mnt) == 0) { + + /* path where a boot environment is mounted */ + if (nvlist_lookup_string(props, "mounted", &mnt) == 0) { + + /* looking for a jail that matches our bootenv path */ jid = bectl_search_jail_paths(mnt); be_prop_list_free(belist); return (jid); Modified: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Tue Dec 25 14:06:52 2018 (r342465) +++ head/sbin/bectl/tests/bectl_test.sh Tue Dec 25 15:18:41 2018 (r342466) @@ -254,6 +254,14 @@ bectl_jail_body() atf_check cp /rescue/rescue ${root}/rescue/rescue atf_check bectl -r ${zpool}/ROOT umount default + # Prepare a second boot environment + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT create -e default target + + # When a jail name is not explicit, it should match the jail id. + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT jail -b -o jid=233637 default + atf_check -o inline:"233637\n" -s exit:0 -x "jls -j 233637 name" + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT unjail default + # Basic command-mode tests, with and without jail cleanup atf_check -o inline:"rescue\n" bectl -r ${zpool}/ROOT \ jail default /rescue/rescue ls -1 @@ -271,6 +279,11 @@ bectl_jail_body() atf_check bectl -r ${zpool}/ROOT jail -b default atf_check bectl -r ${zpool}/ROOT unjail default atf_check -s not-exit:0 -x "jls | grep -F \"${root}\"" + # 'unjail' by BE name. Force bectl to lookup jail id by the BE name. + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT jail -b default + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT jail -b -o name=bectl_test target + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT unjail target + atf_check -o empty -s exit:0 bectl -r ${zpool}/ROOT unjail default # cannot unjail an unjailed BE (by either command name) atf_check -e ignore -s not-exit:0 bectl -r ${zpool}/ROOT ujail default atf_check -e ignore -s not-exit:0 bectl -r ${zpool}/ROOT unjail default @@ -281,8 +294,24 @@ bectl_jail_body() atf_check -s not-exit:0 -x "mount | grep -F '${root}'" atf_check bectl -r ${zpool}/ROOT ujail default } + +# If a test has failed, it's possible that the boot environment hasn't +# been 'unjail'ed. We want to remove the jail before 'bectl_cleanup' +# attempts to destroy the zpool. bectl_jail_cleanup() { + for bootenv in "default" "target"; do + # mountpoint of the boot environment + mountpoint="$(bectl -r bectl_test/ROOT list -H | grep ${bootenv} | awk '{print $3}')" + + # see if any jail paths match the boot environment mountpoint + jailid="$(jls | grep ${mountpoint} | awk '{print $1}')" + + if [ -z "$jailid" ]; then + continue; + fi + jail -r ${jailid} + done; bectl_cleanup bectl_test } From owner-svn-src-head@freebsd.org Wed Dec 26 10:37:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C301134C17F; Wed, 26 Dec 2018 10:37:43 +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) server-signature RSA-PSS (4096 bits) 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 228D373AE1; Wed, 26 Dec 2018 10:37:43 +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 161D6225CD; Wed, 26 Dec 2018 10:37:43 +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 wBQAbgEb035221; Wed, 26 Dec 2018 10:37:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAbgH9035213; Wed, 26 Dec 2018 10:37:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201812261037.wBQAbgH9035213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 26 Dec 2018 10:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342525 - in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzfs_core/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 342525 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 228D373AE1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:37:43 -0000 Author: avg Date: Wed Dec 26 10:37:41 2018 New Revision: 342525 URL: https://svnweb.freebsd.org/changeset/base/342525 Log: MFV r342469: 9630 add lzc_rename and lzc_destroy to libzfs_core illumos/illumos-gate@049ba636fa37a2892809192fc671bff9158a01cd https://github.com/illumos/illumos-gate/commit/049ba636fa37a2892809192fc671bff9158a01cd https://www.illumos.org/issues/9630 Rename and destroy are very useful operations that deserve to be in libzfs_core. And they are not hard to implement too. MFC after: 2 weeks Relnotes: maybe Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.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/zfs_ioctl.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Dec 26 10:37:06 2018 (r342524) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Wed Dec 26 10:37:41 2018 (r342525) @@ -3647,32 +3647,34 @@ zfs_create(libzfs_handle_t *hdl, const char *path, zfs int zfs_destroy(zfs_handle_t *zhp, boolean_t defer) { - zfs_cmd_t zc = { 0 }; + int error; + if (zhp->zfs_type != ZFS_TYPE_SNAPSHOT && defer) + return (EINVAL); + if (zhp->zfs_type == ZFS_TYPE_BOOKMARK) { nvlist_t *nv = fnvlist_alloc(); fnvlist_add_boolean(nv, zhp->zfs_name); - int error = lzc_destroy_bookmarks(nv, NULL); + error = lzc_destroy_bookmarks(nv, NULL); fnvlist_free(nv); if (error != 0) { - return (zfs_standard_error_fmt(zhp->zfs_hdl, errno, + return (zfs_standard_error_fmt(zhp->zfs_hdl, error, dgettext(TEXT_DOMAIN, "cannot destroy '%s'"), zhp->zfs_name)); } return (0); } - (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); - - if (ZFS_IS_VOLUME(zhp)) { - zc.zc_objset_type = DMU_OST_ZVOL; + if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) { + nvlist_t *nv = fnvlist_alloc(); + fnvlist_add_boolean(nv, zhp->zfs_name); + error = lzc_destroy_snaps(nv, defer, NULL); + fnvlist_free(nv); } else { - zc.zc_objset_type = DMU_OST_ZFS; + error = lzc_destroy(zhp->zfs_name); } - zc.zc_defer_destroy = defer; - if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_DESTROY, &zc) != 0 && - errno != ENOENT) { + if (error != 0 && error != ENOENT) { return (zfs_standard_error_fmt(zhp->zfs_hdl, errno, dgettext(TEXT_DOMAIN, "cannot destroy '%s'"), zhp->zfs_name)); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Wed Dec 26 10:37:06 2018 (r342524) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Wed Dec 26 10:37:41 2018 (r342525) @@ -2140,7 +2140,6 @@ recv_rename(libzfs_handle_t *hdl, const char *name, co int baselen, char *newname, recvflags_t *flags) { static int seq; - zfs_cmd_t zc = { 0 }; int err; prop_changelist_t *clp; zfs_handle_t *zhp; @@ -2157,19 +2156,13 @@ recv_rename(libzfs_handle_t *hdl, const char *name, co if (err) return (err); - zc.zc_objset_type = DMU_OST_ZFS; - (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name)); - if (tryname) { (void) strcpy(newname, tryname); - - (void) strlcpy(zc.zc_value, tryname, sizeof (zc.zc_value)); - if (flags->verbose) { (void) printf("attempting rename %s to %s\n", - zc.zc_name, zc.zc_value); + name, newname); } - err = ioctl(hdl->libzfs_fd, ZFS_IOC_RENAME, &zc); + err = lzc_rename(name, newname); if (err == 0) changelist_rename(clp, name, tryname); } else { @@ -2181,13 +2174,11 @@ recv_rename(libzfs_handle_t *hdl, const char *name, co (void) snprintf(newname, ZFS_MAX_DATASET_NAME_LEN, "%.*srecv-%u-%u", baselen, name, getpid(), seq); - (void) strlcpy(zc.zc_value, newname, sizeof (zc.zc_value)); - if (flags->verbose) { (void) printf("failed - trying rename %s to %s\n", - zc.zc_name, zc.zc_value); + name, newname); } - err = ioctl(hdl->libzfs_fd, ZFS_IOC_RENAME, &zc); + err = lzc_rename(name, newname); if (err == 0) changelist_rename(clp, name, newname); if (err && flags->verbose) { @@ -2212,7 +2203,6 @@ static int recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen, char *newname, recvflags_t *flags) { - zfs_cmd_t zc = { 0 }; int err = 0; prop_changelist_t *clp; zfs_handle_t *zhp; @@ -2235,17 +2225,20 @@ recv_destroy(libzfs_handle_t *hdl, const char *name, i if (err) return (err); - zc.zc_objset_type = DMU_OST_ZFS; - zc.zc_defer_destroy = defer; - (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name)); - if (flags->verbose) - (void) printf("attempting destroy %s\n", zc.zc_name); - err = ioctl(hdl->libzfs_fd, ZFS_IOC_DESTROY, &zc); + (void) printf("attempting destroy %s\n", name); + if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) { + nvlist_t *nv = fnvlist_alloc(); + fnvlist_add_boolean(nv, name); + err = lzc_destroy_snaps(nv, defer, NULL); + fnvlist_free(nv); + } else { + err = lzc_destroy(name); + } if (err == 0) { if (flags->verbose) (void) printf("success\n"); - changelist_remove(clp, zc.zc_name); + changelist_remove(clp, name); } (void) changelist_postfix(clp); Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Dec 26 10:37:06 2018 (r342524) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Wed Dec 26 10:37:41 2018 (r342525) @@ -296,6 +296,34 @@ lzc_remap(const char *fsname) return (error); } +int +lzc_rename(const char *source, const char *target) +{ + zfs_cmd_t zc = { 0 }; + int error; + + ASSERT3S(g_refcount, >, 0); + VERIFY3S(g_fd, !=, -1); + + (void) strlcpy(zc.zc_name, source, sizeof (zc.zc_name)); + (void) strlcpy(zc.zc_value, target, sizeof (zc.zc_value)); + error = ioctl(g_fd, ZFS_IOC_RENAME, &zc); + if (error != 0) + error = errno; + return (error); +} + +int +lzc_destroy(const char *fsname) +{ + int error; + + nvlist_t *args = fnvlist_alloc(); + error = lzc_ioctl(ZFS_IOC_DESTROY, fsname, args, NULL); + nvlist_free(args); + return (error); +} + /* * Creates snapshots. * Modified: head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Dec 26 10:37:06 2018 (r342524) +++ head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h Wed Dec 26 10:37:41 2018 (r342525) @@ -91,6 +91,9 @@ boolean_t lzc_exists(const char *); int lzc_rollback(const char *, char *, int); int lzc_rollback_to(const char *, const char *); +int lzc_rename(const char *, const char *); +int lzc_destroy(const char *); + int lzc_channel_program(const char *, const char *, uint64_t, uint64_t, nvlist_t *, nvlist_t **); int lzc_channel_program_nosync(const char *, const char *, uint64_t, 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 Dec 26 10:37:06 2018 (r342524) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Wed Dec 26 10:37:41 2018 (r342525) @@ -3840,7 +3840,6 @@ zfs_ioc_pool_discard_checkpoint(const char *poolname, /* * inputs: * zc_name name of dataset to destroy - * zc_objset_type type of objset * zc_defer_destroy mark for deferred destroy * * outputs: none @@ -3848,16 +3847,24 @@ zfs_ioc_pool_discard_checkpoint(const char *poolname, static int zfs_ioc_destroy(zfs_cmd_t *zc) { + objset_t *os; + dmu_objset_type_t ost; int err; - if (zc->zc_objset_type == DMU_OST_ZFS) + err = dmu_objset_hold(zc->zc_name, FTAG, &os); + if (err != 0) + return (err); + ost = dmu_objset_type(os); + dmu_objset_rele(os, FTAG); + + if (ost == DMU_OST_ZFS) zfs_unmount_snap(zc->zc_name); if (strchr(zc->zc_name, '@')) err = dsl_destroy_snapshot(zc->zc_name, zc->zc_defer_destroy); else err = dsl_destroy_head(zc->zc_name); - if (zc->zc_objset_type == DMU_OST_ZVOL && err == 0) + if (ost == DMU_OST_ZVOL && err == 0) #ifdef __FreeBSD__ zvol_remove_minors(zc->zc_name); #else @@ -4016,9 +4023,12 @@ recursive_unmount(const char *fsname, void *arg) static int zfs_ioc_rename(zfs_cmd_t *zc) { + objset_t *os; + dmu_objset_type_t ost; boolean_t recursive = zc->zc_cookie & 1; char *at; boolean_t allow_mounted = B_TRUE; + int err; #ifdef __FreeBSD__ allow_mounted = (zc->zc_cookie & 2) != 0; @@ -4032,6 +4042,12 @@ zfs_ioc_rename(zfs_cmd_t *zc) strchr(zc->zc_name, '%') || strchr(zc->zc_value, '%')) return (SET_ERROR(EINVAL)); + err = dmu_objset_hold(zc->zc_name, FTAG, &os); + if (err != 0) + return (err); + ost = dmu_objset_type(os); + dmu_objset_rele(os, FTAG); + at = strchr(zc->zc_name, '@'); if (at != NULL) { /* snaps must be in same fs */ @@ -4040,7 +4056,7 @@ zfs_ioc_rename(zfs_cmd_t *zc) if (strncmp(zc->zc_name, zc->zc_value, at - zc->zc_name + 1)) return (SET_ERROR(EXDEV)); *at = '\0'; - if (zc->zc_objset_type == DMU_OST_ZFS && !allow_mounted) { + if (ost == DMU_OST_ZFS && !allow_mounted) { error = dmu_objset_find(zc->zc_name, recursive_unmount, at + 1, recursive ? DS_FIND_CHILDREN : 0); @@ -4056,7 +4072,7 @@ zfs_ioc_rename(zfs_cmd_t *zc) return (error); } else { #ifdef illumos - if (zc->zc_objset_type == DMU_OST_ZVOL) + if (ost == DMU_OST_ZVOL) (void) zvol_remove_minor(zc->zc_name); #endif return (dsl_dir_rename(zc->zc_name, zc->zc_value)); From owner-svn-src-head@freebsd.org Wed Dec 26 10:38:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE430134C1DD; Wed, 26 Dec 2018 10:38:14 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 8201E73BEA; Wed, 26 Dec 2018 10:38:14 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75228225CE; Wed, 26 Dec 2018 10:38:14 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAcEIS035308; Wed, 26 Dec 2018 10:38:14 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAcCur035296; Wed, 26 Dec 2018 10:38:12 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261038.wBQAcCur035296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342526 - head/sys/dev/mpr/mpi X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mpr/mpi X-SVN-Commit-Revision: 342526 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8201E73BEA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:38:15 -0000 Author: kadesai Date: Wed Dec 26 10:38:12 2018 New Revision: 342526 URL: https://svnweb.freebsd.org/changeset/base/342526 Log: Update MPI header files version to 2.00.52 from 2.00.48 Submitted by: Sreekanth Reddy Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mpi/mpi2.h head/sys/dev/mpr/mpi/mpi2_cnfg.h head/sys/dev/mpr/mpi/mpi2_hbd.h head/sys/dev/mpr/mpi/mpi2_history.txt head/sys/dev/mpr/mpi/mpi2_init.h head/sys/dev/mpr/mpi/mpi2_ioc.h head/sys/dev/mpr/mpi/mpi2_pci.h head/sys/dev/mpr/mpi/mpi2_ra.h head/sys/dev/mpr/mpi/mpi2_raid.h head/sys/dev/mpr/mpi/mpi2_sas.h head/sys/dev/mpr/mpi/mpi2_targ.h head/sys/dev/mpr/mpi/mpi2_tool.h head/sys/dev/mpr/mpi/mpi2_type.h Modified: head/sys/dev/mpr/mpi/mpi2.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2.h Wed Dec 26 10:37:41 2018 (r342525) +++ head/sys/dev/mpr/mpi/mpi2.h Wed Dec 26 10:38:12 2018 (r342526) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,15 +25,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * * Name: mpi2.h @@ -44,7 +40,7 @@ * scatter/gather formats. * Creation Date: June 21, 2006 * - * mpi2.h Version: 02.00.48 + * mpi2.h Version: 02.00.52 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -153,6 +149,11 @@ * 09-02-16 02.00.46 Bumped MPI2_HEADER_VERSION_UNIT. * 11-23-16 02.00.47 Bumped MPI2_HEADER_VERSION_UNIT. * 02-03-17 02.00.48 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-13-17 02.00.49 Bumped MPI2_HEADER_VERSION_UNIT. + * 09-29-17 02.00.50 Bumped MPI2_HEADER_VERSION_UNIT. + * 07-22-18 02.00.51 Added SECURE_BOOT define. + * Bumped MPI2_HEADER_VERSION_UNIT + * 08-15-18 02.00.52 Bumped MPI2_HEADER_VERSION_UNIT. * -------------------------------------------------------------------------- */ @@ -196,7 +197,7 @@ /* Unit and Dev versioning for this MPI header set */ -#define MPI2_HEADER_VERSION_UNIT (0x30) +#define MPI2_HEADER_VERSION_UNIT (0x34) #define MPI2_HEADER_VERSION_DEV (0x00) #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) @@ -297,6 +298,8 @@ typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS * Defines for the HostDiagnostic register */ #define MPI2_HOST_DIAGNOSTIC_OFFSET (0x00000008) + +#define MPI26_DIAG_SECURE_BOOT (0x80000000) #define MPI2_DIAG_SBR_RELOAD (0x00002000) Modified: head/sys/dev/mpr/mpi/mpi2_cnfg.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_cnfg.h Wed Dec 26 10:37:41 2018 (r342525) +++ head/sys/dev/mpr/mpi/mpi2_cnfg.h Wed Dec 26 10:38:12 2018 (r342526) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,22 +25,20 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * * Name: mpi2_cnfg.h * Title: MPI Configuration messages and pages * Creation Date: November 10, 2006 * - * mpi2_cnfg.h Version: 02.00.40 + * mpi2_cnfg.h Version: 02.00.45 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -259,6 +255,27 @@ * Added ChassisSlot field to SAS Enclosure Page 0. * Added ChassisSlot Valid bit (bit 5) to the Flags field * in SAS Enclosure Page 0. + * 06-13-17 02.00.41 Added MPI26_MFGPAGE_DEVID_SAS3816 and + * MPI26_MFGPAGE_DEVID_SAS3916 defines. + * Removed MPI26_MFGPAGE_DEVID_SAS4008 define. + * Added MPI26_PCIEIOUNIT1_LINKFLAGS_SRNS_EN define. + * Renamed PI26_PCIEIOUNIT1_LINKFLAGS_EN_SRIS to + * PI26_PCIEIOUNIT1_LINKFLAGS_SRIS_EN. + * Renamed MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SRIS to + * MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SEPARATE_REFCLK. + * 09-29-17 02.00.42 Added ControllerResetTO field to PCIe Device Page 2. + * Added NOIOB field to PCIe Device Page 2. + * Added MPI26_PCIEDEV2_CAP_DATA_BLK_ALIGN_AND_GRAN to + * the Capabilities field of PCIe Device Page 2. + * 07-22-18 02.00.43 Added defines for SAS3916 and SAS3816. + * Added WRiteCache defines to IO Unit Page 1. + * Added MaxEnclosureLevel to BIOS Page 1. + * Added OEMRD to SAS Enclosure Page 1. + * Added DMDReportPCIe to PCIe IO Unit Page 1. + * Added Flags field and flags for Retimers to + * PCIe Switch Page 1. + * 08-02-18 02.00.44 Added Slotx2, Slotx4 to ManPage 7. + * 08-15-18 02.00.45 Added ProductSpecific field at end of IOC Page 1 * -------------------------------------------------------------------------- */ @@ -601,9 +618,19 @@ typedef struct _MPI2_CONFIG_REPLY #define MPI26_MFGPAGE_DEVID_SAS3616 (0x00D1) #define MPI26_MFGPAGE_DEVID_SAS3708 (0x00D2) -#define MPI26_MFGPAGE_DEVID_SAS4008 (0x00A1) +#define MPI26_MFGPAGE_DEVID_SEC_MASK_SAS3916 (0x0003) +#define MPI26_MFGPAGE_DEVID_INVALID0_SAS3916 (0x00E0) +#define MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3916 (0x00E1) +#define MPI26_MFGPAGE_DEVID_HARD_SEC_SAS3916 (0x00E2) +#define MPI26_MFGPAGE_DEVID_INVALID1_SAS3916 (0x00E3) +#define MPI26_MFGPAGE_DEVID_SEC_MASK_SAS3816 (0x0003) +#define MPI26_MFGPAGE_DEVID_INVALID0_SAS3816 (0x00E4) +#define MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3816 (0x00E5) +#define MPI26_MFGPAGE_DEVID_HARD_SEC_SAS3816 (0x00E6) +#define MPI26_MFGPAGE_DEVID_INVALID1_SAS3816 (0x00E7) + /* Manufacturing Page 0 */ typedef struct _MPI2_CONFIG_PAGE_MAN_0 @@ -818,7 +845,8 @@ typedef struct _MPI2_MANPAGE7_CONNECTOR_INFO U8 Location; /* 0x14 */ U8 ReceptacleID; /* 0x15 */ U16 Slot; /* 0x16 */ - U32 Reserved2; /* 0x18 */ + U16 Slotx4; /* 0x18 */ + U16 Slotx2; /* 0x1A */ } MPI2_MANPAGE7_CONNECTOR_INFO, MPI2_POINTER PTR_MPI2_MANPAGE7_CONNECTOR_INFO, Mpi2ManPage7ConnectorInfo_t, MPI2_POINTER pMpi2ManPage7ConnectorInfo_t; @@ -960,6 +988,10 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT_1 #define MPI2_IOUNITPAGE1_PAGEVERSION (0x04) /* IO Unit Page 1 Flags defines */ +#define MPI26_IOUNITPAGE1_NVME_WRITE_CACHE_MASK (0x00030000) +#define MPI26_IOUNITPAGE1_NVME_WRITE_CACHE_ENABLE (0x00000000) +#define MPI26_IOUNITPAGE1_NVME_WRITE_CACHE_DISABLE (0x00010000) +#define MPI26_IOUNITPAGE1_NVME_WRITE_CACHE_NO_CHANGE (0x00020000) #define MPI2_IOUNITPAGE1_ATA_SECURITY_FREEZE_LOCK (0x00004000) #define MPI25_IOUNITPAGE1_NEW_DEVICE_FAST_PATH_DISABLE (0x00002000) #define MPI25_IOUNITPAGE1_DISABLE_FAST_PATH (0x00001000) @@ -1384,7 +1416,7 @@ typedef struct _MPI2_CONFIG_PAGE_IOC_1 U8 PCIBusNum; /* 0x0E */ U8 PCIDomainSegment; /* 0x0F */ U32 Reserved1; /* 0x10 */ - U32 Reserved2; /* 0x14 */ + U32 ProductSpecific; /* 0x14 */ } MPI2_CONFIG_PAGE_IOC_1, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_IOC_1, Mpi2IOCPage1_t, MPI2_POINTER pMpi2IOCPage1_t; @@ -1510,7 +1542,7 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_1 U32 BiosOptions; /* 0x04 */ U32 IOCSettings; /* 0x08 */ U8 SSUTimeout; /* 0x0C */ - U8 Reserved1; /* 0x0D */ + U8 MaxEnclosureLevel; /* 0x0D */ U16 Reserved2; /* 0x0E */ U32 DeviceSettings; /* 0x10 */ U16 NumberOfDevices; /* 0x14 */ @@ -3102,7 +3134,9 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0 U8 ChassisSlot; /* 0x1C */ U8 EnclosureLevel; /* 0x1D */ U16 SEPDevHandle; /* 0x1E */ - U32 Reserved2; /* 0x20 */ + U8 OEMRD; /* 0x20 */ + U8 Reserved1a; /* 0x21 */ + U16 Reserved2; /* 0x22 */ U32 Reserved3; /* 0x24 */ } MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0, @@ -3114,6 +3148,8 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0 #define MPI2_SASENCLOSURE0_PAGEVERSION (0x04) /* values for SAS Enclosure Page 0 Flags field */ +#define MPI26_SAS_ENCLS0_FLAGS_OEMRD_VALID (0x0080) +#define MPI26_SAS_ENCLS0_FLAGS_OEMRD_COLLECTING (0x0040) #define MPI2_SAS_ENCLS0_FLAGS_CHASSIS_SLOT_VALID (0x0020) #define MPI2_SAS_ENCLS0_FLAGS_ENCL_LEVEL_VALID (0x0010) #define MPI2_SAS_ENCLS0_FLAGS_MNG_MASK (0x000F) @@ -3127,6 +3163,8 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENCLOSURE_0 #define MPI26_ENCLOSURE0_PAGEVERSION (0x04) /* Values for Enclosure Page 0 Flags field */ +#define MPI26_ENCLS0_FLAGS_OEMRD_VALID (0x0080) +#define MPI26_ENCLS0_FLAGS_OEMRD_COLLECTING (0x0040) #define MPI26_ENCLS0_FLAGS_CHASSIS_SLOT_VALID (0x0020) #define MPI26_ENCLS0_FLAGS_ENCL_LEVEL_VALID (0x0010) #define MPI26_ENCLS0_FLAGS_MNG_MASK (0x000F) @@ -3502,8 +3540,9 @@ typedef struct _MPI26_PCIE_IO_UNIT1_PHY_DATA Mpi26PCIeIOUnit1PhyData_t, MPI2_POINTER pMpi26PCIeIOUnit1PhyData_t; /* values for LinkFlags */ -#define MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SRIS (0x00) -#define MPI26_PCIEIOUNIT1_LINKFLAGS_EN_SRIS (0x01) +#define MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SEPARATE_REFCLK (0x00) +#define MPI26_PCIEIOUNIT1_LINKFLAGS_SRIS_EN (0x01) +#define MPI26_PCIEIOUNIT1_LINKFLAGS_SRNS_EN (0x02) /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to @@ -3521,7 +3560,7 @@ typedef struct _MPI26_CONFIG_PAGE_PIOUNIT_1 U16 AdditionalControlFlags; /* 0x0C */ U16 NVMeMaxQueueDepth; /* 0x0E */ U8 NumPhys; /* 0x10 */ - U8 Reserved1; /* 0x11 */ + U8 DMDReportPCIe; /* 0x11 */ U16 Reserved2; /* 0x12 */ MPI26_PCIE_IO_UNIT1_PHY_DATA PhyData[MPI26_PCIE_IOUNIT1_PHY_MAX];/* 0x14 */ } MPI26_CONFIG_PAGE_PIOUNIT_1, @@ -3542,6 +3581,13 @@ typedef struct _MPI26_CONFIG_PAGE_PIOUNIT_1 #define MPI26_PCIEIOUNIT1_MAX_RATE_8_0 (0x40) #define MPI26_PCIEIOUNIT1_MAX_RATE_16_0 (0x50) +/* values for PCIe IO Unit Page 1 DMDReportPCIe */ +#define MPI26_PCIEIOUNIT1_DMD_REPORT_UNITS_MASK (0x80) +#define MPI26_PCIEIOUNIT1_DMD_REPORT_UNITS_1_SEC (0x00) +#define MPI26_PCIEIOUNIT1_DMD_REPORT_UNITS_16_SEC (0x80) +#define MPI26_PCIEIOUNIT1_DMD_REPORT_DELAY_TIME_MASK (0x7F) + + /* see mpi2_pci.h for values for PCIe IO Unit Page 0 ControllerPhyDeviceInfo values */ @@ -3585,16 +3631,22 @@ typedef struct _MPI26_CONFIG_PAGE_PSWITCH_1 U16 SwitchDevHandle; /* 0x10 */ U8 NegotiatedPortWidth; /* 0x12 */ U8 NegotiatedLinkRate; /* 0x13 */ - U32 Reserved4; /* 0x14 */ + U16 Flags; /* 0x14 */ + U16 Reserved4; /* 0x16 */ U32 Reserved5; /* 0x18 */ } MPI26_CONFIG_PAGE_PSWITCH_1, MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PSWITCH_1, Mpi26PCIeSwitchPage1_t, MPI2_POINTER pMpi26PCIeSwitchPage1_t; -#define MPI26_PCIESWITCH1_PAGEVERSION (0x00) +#define MPI26_PCIESWITCH1_PAGEVERSION (0x00) /* use MPI26_PCIE_NEG_LINK_RATE_ defines for the NegotiatedLinkRate field */ +/* defines for the Flags field */ +#define MPI26_PCIESWITCH1_2_RETIMER_PRESENCE (0x0002) +#define MPI26_PCIESWITCH1_RETIMER_PRESENCE (0x0001) + + /**************************************************************************** * PCIe Device Config Pages (MPI v2.6 and later) ****************************************************************************/ @@ -3655,18 +3707,20 @@ typedef struct _MPI26_CONFIG_PAGE_PCIEDEV_0 /* see mpi2_pci.h for the MPI26_PCIE_DEVINFO_ defines used for the DeviceInfo field */ /* values for PCIe Device Page 0 Flags field */ -#define MPI26_PCIEDEV0_FLAGS_UNAUTHORIZED_DEVICE (0x8000) -#define MPI26_PCIEDEV0_FLAGS_ENABLED_FAST_PATH (0x4000) -#define MPI26_PCIEDEV0_FLAGS_FAST_PATH_CAPABLE (0x2000) -#define MPI26_PCIEDEV0_FLAGS_ASYNCHRONOUS_NOTIFICATION (0x0400) -#define MPI26_PCIEDEV0_FLAGS_ATA_SW_PRESERVATION (0x0200) -#define MPI26_PCIEDEV0_FLAGS_UNSUPPORTED_DEVICE (0x0100) -#define MPI26_PCIEDEV0_FLAGS_ATA_48BIT_LBA_SUPPORTED (0x0080) -#define MPI26_PCIEDEV0_FLAGS_ATA_SMART_SUPPORTED (0x0040) -#define MPI26_PCIEDEV0_FLAGS_ATA_NCQ_SUPPORTED (0x0020) -#define MPI26_PCIEDEV0_FLAGS_ATA_FUA_SUPPORTED (0x0010) -#define MPI26_PCIEDEV0_FLAGS_ENCL_LEVEL_VALID (0x0002) -#define MPI26_PCIEDEV0_FLAGS_DEVICE_PRESENT (0x0001) +#define MPI26_PCIEDEV0_FLAGS_2_RETIMER_PRESENCE (0x00020000) +#define MPI26_PCIEDEV0_FLAGS_RETIMER_PRESENCE (0x00010000) +#define MPI26_PCIEDEV0_FLAGS_UNAUTHORIZED_DEVICE (0x00008000) +#define MPI26_PCIEDEV0_FLAGS_ENABLED_FAST_PATH (0x00004000) +#define MPI26_PCIEDEV0_FLAGS_FAST_PATH_CAPABLE (0x00002000) +#define MPI26_PCIEDEV0_FLAGS_ASYNCHRONOUS_NOTIFICATION (0x00000400) +#define MPI26_PCIEDEV0_FLAGS_ATA_SW_PRESERVATION (0x00000200) +#define MPI26_PCIEDEV0_FLAGS_UNSUPPORTED_DEVICE (0x00000100) +#define MPI26_PCIEDEV0_FLAGS_ATA_48BIT_LBA_SUPPORTED (0x00000080) +#define MPI26_PCIEDEV0_FLAGS_ATA_SMART_SUPPORTED (0x00000040) +#define MPI26_PCIEDEV0_FLAGS_ATA_NCQ_SUPPORTED (0x00000020) +#define MPI26_PCIEDEV0_FLAGS_ATA_FUA_SUPPORTED (0x00000010) +#define MPI26_PCIEDEV0_FLAGS_ENCL_LEVEL_VALID (0x00000002) +#define MPI26_PCIEDEV0_FLAGS_DEVICE_PRESENT (0x00000001) /* values for PCIe Device Page 0 SupportedLinkRates field */ #define MPI26_PCIEDEV0_LINK_RATE_16_0_SUPPORTED (0x08) @@ -3683,19 +3737,25 @@ typedef struct _MPI26_CONFIG_PAGE_PCIEDEV_2 { MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ U16 DevHandle; /* 0x08 */ - U16 Reserved1; /* 0x0A */ + U8 ControllerResetTO; /* 0x0A */ + U8 Reserved1; /* 0x0B */ U32 MaximumDataTransferSize;/* 0x0C */ U32 Capabilities; /* 0x10 */ - U32 Reserved2; /* 0x14 */ + U16 NOIOB; /* 0x14 */ + U16 Reserved2; /* 0x16 */ } MPI26_CONFIG_PAGE_PCIEDEV_2, MPI2_POINTER PTR_MPI26_CONFIG_PAGE_PCIEDEV_2, Mpi26PCIeDevicePage2_t, MPI2_POINTER pMpi26PCIeDevicePage2_t; -#define MPI26_PCIEDEVICE2_PAGEVERSION (0x00) +#define MPI26_PCIEDEVICE2_PAGEVERSION (0x01) /* defines for PCIe Device Page 2 Capabilities field */ -#define MPI26_PCIEDEV2_CAP_SGL_FORMAT (0x00000004) -#define MPI26_PCIEDEV2_CAP_BIT_BUCKET_SUPPORT (0x00000002) -#define MPI26_PCIEDEV2_CAP_SGL_SUPPORT (0x00000001) +#define MPI26_PCIEDEV2_CAP_DATA_BLK_ALIGN_AND_GRAN (0x00000008) +#define MPI26_PCIEDEV2_CAP_SGL_FORMAT (0x00000004) +#define MPI26_PCIEDEV2_CAP_BIT_BUCKET_SUPPORT (0x00000002) +#define MPI26_PCIEDEV2_CAP_SGL_SUPPORT (0x00000001) + +/* Defines for the NOIOB field */ +#define MPI26_PCIEDEV2_NOIOB_UNSUPPORTED (0x0000) /**************************************************************************** Modified: head/sys/dev/mpr/mpi/mpi2_hbd.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_hbd.h Wed Dec 26 10:37:41 2018 (r342525) +++ head/sys/dev/mpr/mpi/mpi2_hbd.h Wed Dec 26 10:38:12 2018 (r342526) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,15 +25,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2009-2015 LSI Corporation. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * * Name: mpi2_hbd.h Modified: head/sys/dev/mpr/mpi/mpi2_history.txt ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_history.txt Wed Dec 26 10:37:41 2018 (r342525) +++ head/sys/dev/mpr/mpi/mpi2_history.txt Wed Dec 26 10:38:12 2018 (r342526) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ @@ -36,21 +34,19 @@ Fusion-MPT MPI 2.0 / 2.5 Header File Change History ============================== - Copyright (c) 2000-2015 LSI Corporation. - Copyright (c) 2013-2016 Avago Technologies - All rights reserved. + Copyright 2000-2020 Broadcom Inc. All rights reserved. --------------------------------------- - Header Set Release Version: 02.00.48 - Header Set Release Date: 02-03-17 + Header Set Release Version: 02.00.50 + Header Set Release Date: 09-29-17 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi2.h 02.00.48 02.00.47 - mpi2_cnfg.h 02.00.40 02.00.39 + mpi2.h 02.00.50 02.00.49 + mpi2_cnfg.h 02.00.42 02.00.41 mpi2_init.h 02.00.21 02.00.21 - mpi2_ioc.h 02.00.32 02.00.31 + mpi2_ioc.h 02.00.34 02.00.33 mpi2_raid.h 02.00.11 02.00.11 mpi2_sas.h 02.00.10 02.00.10 mpi2_targ.h 02.00.09 02.00.09 @@ -59,7 +55,7 @@ mpi2_ra.h 02.00.01 02.00.01 mpi2_hbd.h 02.00.04 02.00.04 mpi2_pci.h 02.00.02 02.00.02 - mpi2_history.txt 02.00.45 02.00.44 + mpi2_history.txt 02.00.46 02.00.45 * Date Version Description @@ -163,6 +159,8 @@ mpi2.h * 09-02-16 02.00.46 Bumped MPI2_HEADER_VERSION_UNIT. * 11-23-16 02.00.47 Bumped MPI2_HEADER_VERSION_UNIT. * 02-03-17 02.00.48 Bumped MPI2_HEADER_VERSION_UNIT. + * 06-13-17 02.00.49 Bumped MPI2_HEADER_VERSION_UNIT. + * 09-29-17 02.00.50 Bumped MPI2_HEADER_VERSION_UNIT. * -------------------------------------------------------------------------- mpi2_cnfg.h @@ -371,6 +369,18 @@ mpi2_cnfg.h * Added ChassisSlot field to SAS Enclosure Page 0. * Added ChassisSlot Valid bit (bit 5) to the Flags field * in SAS Enclosure Page 0. + * 06-13-17 02.00.41 Added MPI26_MFGPAGE_DEVID_SAS3816 and + * MPI26_MFGPAGE_DEVID_SAS3916 defines. + * Removed MPI26_MFGPAGE_DEVID_SAS4008 define. + * Added MPI26_PCIEIOUNIT1_LINKFLAGS_SRNS_EN define. + * Renamed MPI26_PCIEIOUNIT1_LINKFLAGS_EN_SRIS to + * MPI26_PCIEIOUNIT1_LINKFLAGS_SRIS_EN. + * Renamed MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SRIS to + * MPI26_PCIEIOUNIT1_LINKFLAGS_DIS_SEPARATE_REFCLK. + * 09-29-17 02.00.42 Added ControllerResetTO field to PCIe Device Page 2. + * Added NOIOB field to PCIe Device Page 2. + * Added MPI26_PCIEDEV2_CAP_DATA_BLK_ALIGN_AND_GRAN to + * the Capabilities field of PCIe Device Page 2. * -------------------------------------------------------------------------- mpi2_init.h @@ -566,6 +576,10 @@ mpi2_ioc.h * 02-02-17 02.00.32 Added MPI2_FW_DOWNLOAD_ITYPE_CBB_BACKUP. * Added MPI25_EVENT_DATA_ACTIVE_CABLE_EXCEPT and related * defines for the ReasonCode field. + * 06-13-17 02.00.33 Added MPI2_FW_DOWNLOAD_ITYPE_CPLD. + * 09-29-17 02.00.34 Added MPI26_EVENT_PCIDEV_STAT_RC_PCIE_HOT_RESET_FAILED + * to the ReasonCode field in PCIe Device Status Change + * Event Data. * -------------------------------------------------------------------------- mpi2_raid.h @@ -687,20 +701,20 @@ mpi2_pci.h mpi2_history.txt Parts list history -Filename 02.00.48 ----------- -------- -mpi2.h 02.00.48 -mpi2_cnfg.h 02.00.40 -mpi2_init.h 02.00.21 -mpi2_ioc.h 02.00.32 -mpi2_raid.h 02.00.11 -mpi2_sas.h 02.00.10 -mpi2_targ.h 02.00.09 -mpi2_tool.h 02.00.14 -mpi2_type.h 02.00.01 -mpi2_ra.h 02.00.01 -mpi2_hbd.h 02.00.04 -mpi2_pci.h 02.00.02 +Filename 02.00.50 02.00.49 02.00.48 +---------- -------- -------- -------- +mpi2.h 02.00.50 02.00.49 02.00.48 +mpi2_cnfg.h 02.00.42 02.00.41 02.00.40 +mpi2_init.h 02.00.21 02.00.21 02.00.21 +mpi2_ioc.h 02.00.34 02.00.33 02.00.32 +mpi2_raid.h 02.00.11 02.00.11 02.00.11 +mpi2_sas.h 02.00.10 02.00.10 02.00.10 +mpi2_targ.h 02.00.09 02.00.09 02.00.09 +mpi2_tool.h 02.00.14 02.00.14 02.00.14 +mpi2_type.h 02.00.01 02.00.01 02.00.01 +mpi2_ra.h 02.00.01 02.00.01 02.00.01 +mpi2_hbd.h 02.00.04 02.00.04 02.00.04 +mpi2_pci.h 02.00.02 02.00.02 02.00.02 Filename 02.00.47 02.00.46 02.00.45 02.00.44 02.00.43 02.00.42 ---------- -------- -------- -------- -------- -------- -------- Modified: head/sys/dev/mpr/mpi/mpi2_init.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_init.h Wed Dec 26 10:37:41 2018 (r342525) +++ head/sys/dev/mpr/mpi/mpi2_init.h Wed Dec 26 10:38:12 2018 (r342526) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,15 +25,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * * Name: mpi2_init.h @@ -62,7 +58,7 @@ * 05-21-08 02.00.05 Fixed typo in name of Mpi2SepRequest_t. * 10-02-08 02.00.06 Removed Untagged and No Disconnect values from SCSI IO * Control field Task Attribute flags. - * Moved LUN field defines to mpi2.h because they are + * Moved LUN field defines to mpi2.h becasue they are * common to many structures. * 05-06-09 02.00.07 Changed task management type of Query Unit Attention to * Query Asynchronous Event. Modified: head/sys/dev/mpr/mpi/mpi2_ioc.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_ioc.h Wed Dec 26 10:37:41 2018 (r342525) +++ head/sys/dev/mpr/mpi/mpi2_ioc.h Wed Dec 26 10:38:12 2018 (r342526) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,22 +25,20 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ /* - * Copyright (c) 2000-2015 LSI Corporation. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * * Name: mpi2_ioc.h * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages * Creation Date: October 11, 2006 * - * mpi2_ioc.h Version: 02.00.32 + * mpi2_ioc.h Version: 02.00.36 * * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 * prefix are for use only on MPI v2.5 products, and must not be used @@ -205,6 +201,13 @@ * 02-02-17 02.00.32 Added MPI2_FW_DOWNLOAD_ITYPE_CBB_BACKUP. * Added MPI25_EVENT_DATA_ACTIVE_CABLE_EXCEPT and related * defines for the ReasonCode field. + * 06-13-17 02.00.33 Added MPI2_FW_DOWNLOAD_ITYPE_CPLD. + * 09-29-17 02.00.34 Added MPI26_EVENT_PCIDEV_STAT_RC_PCIE_HOT_RESET_FAILED + * to the ReasonCode field in PCIe Device Status Change + * Event Data. + * 07-22-18 02.00.35 Added FW_DOWNLOAD_ITYPE_CPLD and _PSOC. + * Moved FW image definitions ionto new mpi2_image,h + * 08-14-18 02.00.36 Fixed definition of MPI2_FW_DOWNLOAD_ITYPE_PSOC (0x16) * -------------------------------------------------------------------------- */ @@ -1270,6 +1273,7 @@ typedef struct _MPI26_EVENT_DATA_PCIE_DEVICE_STATUS_CH #define MPI26_EVENT_PCIDEV_STAT_RC_CMP_INTERNAL_DEV_RESET (0x0E) #define MPI26_EVENT_PCIDEV_STAT_RC_CMP_TASK_ABORT_INTERNAL (0x0F) #define MPI26_EVENT_PCIDEV_STAT_RC_DEV_INIT_FAILURE (0x10) +#define MPI26_EVENT_PCIDEV_STAT_RC_PCIE_HOT_RESET_FAILED (0x11) /* PCIe Enumeration Event data (MPI v2.6 and later) */ @@ -1534,8 +1538,12 @@ typedef struct _MPI2_FW_DOWNLOAD_REQUEST #define MPI2_FW_DOWNLOAD_ITYPE_CTLR (0x12) #define MPI2_FW_DOWNLOAD_ITYPE_IMR_FIRMWARE (0x13) #define MPI2_FW_DOWNLOAD_ITYPE_MR_NVDATA (0x14) +#define MPI2_FW_DOWNLOAD_ITYPE_CPLD (0x15) /* MPI v2.6 and newer */ +#define MPI2_FW_DOWNLOAD_ITYPE_PSOC (0x16) /* MPI v2.6 and newer */ #define MPI2_FW_DOWNLOAD_ITYPE_MIN_PRODUCT_SPECIFIC (0xF0) +#define MPI2_FW_DOWNLOAD_ITYPE_TERMINATE (0xFF) /* MPI v2.6 and newer */ + /* MPI v2.0 FWDownload TransactionContext Element */ typedef struct _MPI2_FW_DOWNLOAD_TCSGE { @@ -1692,367 +1700,6 @@ typedef struct _MPI2_FW_UPLOAD_REPLY } MPI2_FW_UPLOAD_REPLY, MPI2_POINTER PTR_MPI2_FW_UPLOAD_REPLY, Mpi2FWUploadReply_t, MPI2_POINTER pMPi2FWUploadReply_t; - -/* FW Image Header */ -typedef struct _MPI2_FW_IMAGE_HEADER -{ - U32 Signature; /* 0x00 */ - U32 Signature0; /* 0x04 */ - U32 Signature1; /* 0x08 */ - U32 Signature2; /* 0x0C */ - MPI2_VERSION_UNION MPIVersion; /* 0x10 */ - MPI2_VERSION_UNION FWVersion; /* 0x14 */ - MPI2_VERSION_UNION NVDATAVersion; /* 0x18 */ - MPI2_VERSION_UNION PackageVersion; /* 0x1C */ - U16 VendorID; /* 0x20 */ - U16 ProductID; /* 0x22 */ - U16 ProtocolFlags; /* 0x24 */ - U16 Reserved26; /* 0x26 */ - U32 IOCCapabilities; /* 0x28 */ - U32 ImageSize; /* 0x2C */ - U32 NextImageHeaderOffset; /* 0x30 */ - U32 Checksum; /* 0x34 */ - U32 Reserved38; /* 0x38 */ - U32 Reserved3C; /* 0x3C */ - U32 Reserved40; /* 0x40 */ - U32 Reserved44; /* 0x44 */ - U32 Reserved48; /* 0x48 */ - U32 Reserved4C; /* 0x4C */ - U32 Reserved50; /* 0x50 */ - U32 Reserved54; /* 0x54 */ - U32 Reserved58; /* 0x58 */ - U32 Reserved5C; /* 0x5C */ - U32 BootFlags; /* 0x60 */ /* reserved in MPI v2.5 and earlier */ - U32 FirmwareVersionNameWhat; /* 0x64 */ - U8 FirmwareVersionName[32]; /* 0x68 */ - U32 VendorNameWhat; /* 0x88 */ - U8 VendorName[32]; /* 0x8C */ - U32 PackageNameWhat; /* 0x88 */ - U8 PackageName[32]; /* 0x8C */ - U32 ReservedD0; /* 0xD0 */ - U32 ReservedD4; /* 0xD4 */ - U32 ReservedD8; /* 0xD8 */ - U32 ReservedDC; /* 0xDC */ - U32 ReservedE0; /* 0xE0 */ - U32 ReservedE4; /* 0xE4 */ - U32 ReservedE8; /* 0xE8 */ - U32 ReservedEC; /* 0xEC */ - U32 ReservedF0; /* 0xF0 */ - U32 ReservedF4; /* 0xF4 */ - U32 ReservedF8; /* 0xF8 */ - U32 ReservedFC; /* 0xFC */ -} MPI2_FW_IMAGE_HEADER, MPI2_POINTER PTR_MPI2_FW_IMAGE_HEADER, - Mpi2FWImageHeader_t, MPI2_POINTER pMpi2FWImageHeader_t; - -/* Signature field */ -#define MPI2_FW_HEADER_SIGNATURE_OFFSET (0x00) -#define MPI2_FW_HEADER_SIGNATURE_MASK (0xFF000000) -#define MPI2_FW_HEADER_SIGNATURE (0xEA000000) -#define MPI26_FW_HEADER_SIGNATURE (0xEB000000) - -/* Signature0 field */ -#define MPI2_FW_HEADER_SIGNATURE0_OFFSET (0x04) -#define MPI2_FW_HEADER_SIGNATURE0 (0x5AFAA55A) -#define MPI26_FW_HEADER_SIGNATURE0_BASE (0x5AEAA500) /* Last byte is defined by architecture */ -#define MPI26_FW_HEADER_SIGNATURE0_ARC_0 (0x5A) -#define MPI26_FW_HEADER_SIGNATURE0_ARC_1 (0x00) -#define MPI26_FW_HEADER_SIGNATURE0_ARC_2 (0x01) -#define MPI26_FW_HEADER_SIGNATURE0_ARC_3 (0x02) -#define MPI26_FW_HEADER_SIGNATURE0 (MPI26_FW_HEADER_SIGNATURE0_BASE+MPI26_FW_HEADER_SIGNATURE0_ARC_0) // legacy (0x5AEAA55A) -#define MPI26_FW_HEADER_SIGNATURE0_3516 (MPI26_FW_HEADER_SIGNATURE0_BASE+MPI26_FW_HEADER_SIGNATURE0_ARC_1) -#define MPI26_FW_HEADER_SIGNATURE0_4008 (MPI26_FW_HEADER_SIGNATURE0_BASE+MPI26_FW_HEADER_SIGNATURE0_ARC_3) - -/* Signature1 field */ -#define MPI2_FW_HEADER_SIGNATURE1_OFFSET (0x08) -#define MPI2_FW_HEADER_SIGNATURE1 (0xA55AFAA5) -#define MPI26_FW_HEADER_SIGNATURE1 (0xA55AEAA5) - -/* Signature2 field */ -#define MPI2_FW_HEADER_SIGNATURE2_OFFSET (0x0C) -#define MPI2_FW_HEADER_SIGNATURE2 (0x5AA55AFA) -#define MPI26_FW_HEADER_SIGNATURE2 (0x5AA55AEA) - - -/* defines for using the ProductID field */ -#define MPI2_FW_HEADER_PID_TYPE_MASK (0xF000) -#define MPI2_FW_HEADER_PID_TYPE_SAS (0x2000) - -#define MPI2_FW_HEADER_PID_PROD_MASK (0x0F00) -#define MPI2_FW_HEADER_PID_PROD_A (0x0000) -#define MPI2_FW_HEADER_PID_PROD_TARGET_INITIATOR_SCSI (0x0200) -#define MPI2_FW_HEADER_PID_PROD_IR_SCSI (0x0700) - - -#define MPI2_FW_HEADER_PID_FAMILY_MASK (0x00FF) -/* SAS ProductID Family bits */ -#define MPI2_FW_HEADER_PID_FAMILY_2108_SAS (0x0013) -#define MPI2_FW_HEADER_PID_FAMILY_2208_SAS (0x0014) -#define MPI25_FW_HEADER_PID_FAMILY_3108_SAS (0x0021) -#define MPI26_FW_HEADER_PID_FAMILY_3324_SAS (0x0028) -#define MPI26_FW_HEADER_PID_FAMILY_3516_SAS (0x0031) - -/* use MPI2_IOCFACTS_PROTOCOL_ defines for ProtocolFlags field */ - -/* use MPI2_IOCFACTS_CAPABILITY_ defines for IOCCapabilities field */ - - -#define MPI2_FW_HEADER_IMAGESIZE_OFFSET (0x2C) -#define MPI2_FW_HEADER_NEXTIMAGE_OFFSET (0x30) -#define MPI26_FW_HEADER_BOOTFLAGS_OFFSET (0x60) -#define MPI2_FW_HEADER_VERNMHWAT_OFFSET (0x64) - -#define MPI2_FW_HEADER_WHAT_SIGNATURE (0x29232840) - -#define MPI2_FW_HEADER_SIZE (0x100) - - -/* Extended Image Header */ -typedef struct _MPI2_EXT_IMAGE_HEADER - -{ - U8 ImageType; /* 0x00 */ - U8 Reserved1; /* 0x01 */ - U16 Reserved2; /* 0x02 */ - U32 Checksum; /* 0x04 */ - U32 ImageSize; /* 0x08 */ - U32 NextImageHeaderOffset; /* 0x0C */ - U32 PackageVersion; /* 0x10 */ - U32 Reserved3; /* 0x14 */ - U32 Reserved4; /* 0x18 */ - U32 Reserved5; /* 0x1C */ - U8 IdentifyString[32]; /* 0x20 */ -} MPI2_EXT_IMAGE_HEADER, MPI2_POINTER PTR_MPI2_EXT_IMAGE_HEADER, - Mpi2ExtImageHeader_t, MPI2_POINTER pMpi2ExtImageHeader_t; - -/* useful offsets */ -#define MPI2_EXT_IMAGE_IMAGETYPE_OFFSET (0x00) -#define MPI2_EXT_IMAGE_IMAGESIZE_OFFSET (0x08) -#define MPI2_EXT_IMAGE_NEXTIMAGE_OFFSET (0x0C) - -#define MPI2_EXT_IMAGE_HEADER_SIZE (0x40) - -/* defines for the ImageType field */ -#define MPI2_EXT_IMAGE_TYPE_UNSPECIFIED (0x00) -#define MPI2_EXT_IMAGE_TYPE_FW (0x01) -#define MPI2_EXT_IMAGE_TYPE_NVDATA (0x03) -#define MPI2_EXT_IMAGE_TYPE_BOOTLOADER (0x04) -#define MPI2_EXT_IMAGE_TYPE_INITIALIZATION (0x05) -#define MPI2_EXT_IMAGE_TYPE_FLASH_LAYOUT (0x06) -#define MPI2_EXT_IMAGE_TYPE_SUPPORTED_DEVICES (0x07) -#define MPI2_EXT_IMAGE_TYPE_MEGARAID (0x08) -#define MPI2_EXT_IMAGE_TYPE_ENCRYPTED_HASH (0x09) /* MPI v2.5 and newer */ -#define MPI2_EXT_IMAGE_TYPE_MIN_PRODUCT_SPECIFIC (0x80) -#define MPI2_EXT_IMAGE_TYPE_MAX_PRODUCT_SPECIFIC (0xFF) - -#define MPI2_EXT_IMAGE_TYPE_MAX (MPI2_EXT_IMAGE_TYPE_MAX_PRODUCT_SPECIFIC) /* deprecated */ - - - -/* FLASH Layout Extended Image Data */ - -/* - * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check RegionsPerLayout at runtime. - */ -#ifndef MPI2_FLASH_NUMBER_OF_REGIONS -#define MPI2_FLASH_NUMBER_OF_REGIONS (1) -#endif - -/* - * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check NumberOfLayouts at runtime. - */ -#ifndef MPI2_FLASH_NUMBER_OF_LAYOUTS -#define MPI2_FLASH_NUMBER_OF_LAYOUTS (1) -#endif - -typedef struct _MPI2_FLASH_REGION -{ - U8 RegionType; /* 0x00 */ - U8 Reserved1; /* 0x01 */ - U16 Reserved2; /* 0x02 */ - U32 RegionOffset; /* 0x04 */ - U32 RegionSize; /* 0x08 */ - U32 Reserved3; /* 0x0C */ -} MPI2_FLASH_REGION, MPI2_POINTER PTR_MPI2_FLASH_REGION, - Mpi2FlashRegion_t, MPI2_POINTER pMpi2FlashRegion_t; - -typedef struct _MPI2_FLASH_LAYOUT -{ - U32 FlashSize; /* 0x00 */ - U32 Reserved1; /* 0x04 */ - U32 Reserved2; /* 0x08 */ - U32 Reserved3; /* 0x0C */ - MPI2_FLASH_REGION Region[MPI2_FLASH_NUMBER_OF_REGIONS];/* 0x10 */ -} MPI2_FLASH_LAYOUT, MPI2_POINTER PTR_MPI2_FLASH_LAYOUT, - Mpi2FlashLayout_t, MPI2_POINTER pMpi2FlashLayout_t; - -typedef struct _MPI2_FLASH_LAYOUT_DATA -{ - U8 ImageRevision; /* 0x00 */ - U8 Reserved1; /* 0x01 */ - U8 SizeOfRegion; /* 0x02 */ - U8 Reserved2; /* 0x03 */ - U16 NumberOfLayouts; /* 0x04 */ - U16 RegionsPerLayout; /* 0x06 */ - U16 MinimumSectorAlignment; /* 0x08 */ - U16 Reserved3; /* 0x0A */ - U32 Reserved4; /* 0x0C */ - MPI2_FLASH_LAYOUT Layout[MPI2_FLASH_NUMBER_OF_LAYOUTS];/* 0x10 */ -} MPI2_FLASH_LAYOUT_DATA, MPI2_POINTER PTR_MPI2_FLASH_LAYOUT_DATA, - Mpi2FlashLayoutData_t, MPI2_POINTER pMpi2FlashLayoutData_t; - -/* defines for the RegionType field */ -#define MPI2_FLASH_REGION_UNUSED (0x00) -#define MPI2_FLASH_REGION_FIRMWARE (0x01) -#define MPI2_FLASH_REGION_BIOS (0x02) -#define MPI2_FLASH_REGION_NVDATA (0x03) -#define MPI2_FLASH_REGION_FIRMWARE_BACKUP (0x05) -#define MPI2_FLASH_REGION_MFG_INFORMATION (0x06) -#define MPI2_FLASH_REGION_CONFIG_1 (0x07) -#define MPI2_FLASH_REGION_CONFIG_2 (0x08) -#define MPI2_FLASH_REGION_MEGARAID (0x09) -#define MPI2_FLASH_REGION_COMMON_BOOT_BLOCK (0x0A) -#define MPI2_FLASH_REGION_INIT (MPI2_FLASH_REGION_COMMON_BOOT_BLOCK) /* older name */ -#define MPI2_FLASH_REGION_CBB_BACKUP (0x0D) -#define MPI2_FLASH_REGION_SBR (0x0E) -#define MPI2_FLASH_REGION_SBR_BACKUP (0x0F) -#define MPI2_FLASH_REGION_HIIM (0x10) -#define MPI2_FLASH_REGION_HIIA (0x11) -#define MPI2_FLASH_REGION_CTLR (0x12) -#define MPI2_FLASH_REGION_IMR_FIRMWARE (0x13) -#define MPI2_FLASH_REGION_MR_NVDATA (0x14) - -/* ImageRevision */ -#define MPI2_FLASH_LAYOUT_IMAGE_REVISION (0x00) - - - -/* Supported Devices Extended Image Data */ - -/* - * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check NumberOfDevices at runtime. - */ -#ifndef MPI2_SUPPORTED_DEVICES_IMAGE_NUM_DEVICES -#define MPI2_SUPPORTED_DEVICES_IMAGE_NUM_DEVICES (1) -#endif - -typedef struct _MPI2_SUPPORTED_DEVICE -{ - U16 DeviceID; /* 0x00 */ - U16 VendorID; /* 0x02 */ - U16 DeviceIDMask; /* 0x04 */ - U16 Reserved1; /* 0x06 */ - U8 LowPCIRev; /* 0x08 */ - U8 HighPCIRev; /* 0x09 */ - U16 Reserved2; /* 0x0A */ - U32 Reserved3; /* 0x0C */ -} MPI2_SUPPORTED_DEVICE, MPI2_POINTER PTR_MPI2_SUPPORTED_DEVICE, - Mpi2SupportedDevice_t, MPI2_POINTER pMpi2SupportedDevice_t; - -typedef struct _MPI2_SUPPORTED_DEVICES_DATA -{ - U8 ImageRevision; /* 0x00 */ - U8 Reserved1; /* 0x01 */ - U8 NumberOfDevices; /* 0x02 */ - U8 Reserved2; /* 0x03 */ - U32 Reserved3; /* 0x04 */ - MPI2_SUPPORTED_DEVICE SupportedDevice[MPI2_SUPPORTED_DEVICES_IMAGE_NUM_DEVICES]; /* 0x08 */ -} MPI2_SUPPORTED_DEVICES_DATA, MPI2_POINTER PTR_MPI2_SUPPORTED_DEVICES_DATA, - Mpi2SupportedDevicesData_t, MPI2_POINTER pMpi2SupportedDevicesData_t; - -/* ImageRevision */ -#define MPI2_SUPPORTED_DEVICES_IMAGE_REVISION (0x00) - - -/* Init Extended Image Data */ - -typedef struct _MPI2_INIT_IMAGE_FOOTER - -{ - U32 BootFlags; /* 0x00 */ - U32 ImageSize; /* 0x04 */ - U32 Signature0; /* 0x08 */ - U32 Signature1; /* 0x0C */ - U32 Signature2; /* 0x10 */ - U32 ResetVector; /* 0x14 */ -} MPI2_INIT_IMAGE_FOOTER, MPI2_POINTER PTR_MPI2_INIT_IMAGE_FOOTER, - Mpi2InitImageFooter_t, MPI2_POINTER pMpi2InitImageFooter_t; - -/* defines for the BootFlags field */ -#define MPI2_INIT_IMAGE_BOOTFLAGS_OFFSET (0x00) - -/* defines for the ImageSize field */ -#define MPI2_INIT_IMAGE_IMAGESIZE_OFFSET (0x04) - -/* defines for the Signature0 field */ -#define MPI2_INIT_IMAGE_SIGNATURE0_OFFSET (0x08) -#define MPI2_INIT_IMAGE_SIGNATURE0 (0x5AA55AEA) - -/* defines for the Signature1 field */ -#define MPI2_INIT_IMAGE_SIGNATURE1_OFFSET (0x0C) -#define MPI2_INIT_IMAGE_SIGNATURE1 (0xA55AEAA5) - -/* defines for the Signature2 field */ -#define MPI2_INIT_IMAGE_SIGNATURE2_OFFSET (0x10) -#define MPI2_INIT_IMAGE_SIGNATURE2 (0x5AEAA55A) - -/* Signature fields as individual bytes */ -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_0 (0xEA) -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_1 (0x5A) -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_2 (0xA5) -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_3 (0x5A) - -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_4 (0xA5) -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_5 (0xEA) -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_6 (0x5A) -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_7 (0xA5) - -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_8 (0x5A) -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_9 (0xA5) -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_A (0xEA) -#define MPI2_INIT_IMAGE_SIGNATURE_BYTE_B (0x5A) - -/* defines for the ResetVector field */ -#define MPI2_INIT_IMAGE_RESETVECTOR_OFFSET (0x14) - - -/* Encrypted Hash Extended Image Data */ - -typedef struct _MPI25_ENCRYPTED_HASH_ENTRY -{ - U8 HashImageType; /* 0x00 */ - U8 HashAlgorithm; /* 0x01 */ - U8 EncryptionAlgorithm; /* 0x02 */ - U8 Reserved1; /* 0x03 */ - U32 Reserved2; /* 0x04 */ - U32 EncryptedHash[1]; /* 0x08 */ /* variable length */ -} MPI25_ENCRYPTED_HASH_ENTRY, MPI2_POINTER PTR_MPI25_ENCRYPTED_HASH_ENTRY, - Mpi25EncryptedHashEntry_t, MPI2_POINTER pMpi25EncryptedHashEntry_t; - -/* values for HashImageType */ -#define MPI25_HASH_IMAGE_TYPE_UNUSED (0x00) -#define MPI25_HASH_IMAGE_TYPE_FIRMWARE (0x01) -#define MPI25_HASH_IMAGE_TYPE_BIOS (0x02) - -/* values for HashAlgorithm */ -#define MPI25_HASH_ALGORITHM_UNUSED (0x00) -#define MPI25_HASH_ALGORITHM_SHA256 (0x01) - -/* values for EncryptionAlgorithm */ -#define MPI25_ENCRYPTION_ALG_UNUSED (0x00) -#define MPI25_ENCRYPTION_ALG_RSA256 (0x01) - -typedef struct _MPI25_ENCRYPTED_HASH_DATA -{ - U8 ImageVersion; /* 0x00 */ - U8 NumHash; /* 0x01 */ - U16 Reserved1; /* 0x02 */ - U32 Reserved2; /* 0x04 */ - MPI25_ENCRYPTED_HASH_ENTRY EncryptedHashEntry[1]; /* 0x08 */ /* variable number of entries */ -} MPI25_ENCRYPTED_HASH_DATA, MPI2_POINTER PTR_MPI25_ENCRYPTED_HASH_DATA, - Mpi25EncryptedHashData_t, MPI2_POINTER pMpi25EncryptedHashData_t; /**************************************************************************** * PowerManagementControl message Modified: head/sys/dev/mpr/mpi/mpi2_pci.h ============================================================================== --- head/sys/dev/mpr/mpi/mpi2_pci.h Wed Dec 26 10:37:41 2018 (r342525) +++ head/sys/dev/mpr/mpi/mpi2_pci.h Wed Dec 26 10:38:12 2018 (r342526) @@ -1,7 +1,5 @@ /*- - * Copyright (c) 2012-2015 LSI Corp. - * Copyright (c) 2013-2016 Avago Technologies - * All rights reserved. + * Copyright 2000-2020 Broadcom Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,22 +25,20 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Dec 26 10:39:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7818E134C2FA; Wed, 26 Dec 2018 10:39:23 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 1FCB77431C; Wed, 26 Dec 2018 10:39:23 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 127CF225D2; Wed, 26 Dec 2018 10:39:23 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAdM5p035476; Wed, 26 Dec 2018 10:39:22 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAdMPP035475; Wed, 26 Dec 2018 10:39:22 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261039.wBQAdMPP035475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:39:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342528 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1FCB77431C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:39:23 -0000 Author: kadesai Date: Wed Dec 26 10:39:22 2018 New Revision: 342528 URL: https://svnweb.freebsd.org/changeset/base/342528 Log: Copy back the Sense data at proper location expected by the application typedef struct mps_pass_thru { uint64_t PtrRequest; uint64_t PtrReply; uint64_t PtrData; uint32_t RequestSize; uint32_t ReplySize; uint32_t DataSize; uint32_t DataDirection; uint64_t PtrDataOut; uint32_t DataOutSize; uint32_t Timeout; } mps_pass_thru_t, * ptrmpssas_pass_thru_t; In the above mps_pass_thru structure; Application expects PrtReply buffer should contain both MPI reply followed by sense data. So, updated driver to copy sense data at PtrReply + sizeof(MPI2 reply) location where application wants the driver to copy back the sense data info. Submitted by: Sreekanth Reddy Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mpr_user.c Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:38:51 2018 (r342527) +++ head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:39:22 2018 (r342528) @@ -1106,7 +1106,8 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru SenseCount)), sizeof(struct scsi_sense_data)); mpr_unlock(sc); - copyout(cm->cm_sense, cm->cm_req + 64, + copyout(cm->cm_sense, + (PTRIN(data->PtrReply + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mpr_lock(sc); } @@ -1140,7 +1141,9 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru sz = MIN(le32toh(nvme_error_reply->ErrorResponseCount), NVME_ERROR_RESPONSE_SIZE); mpr_unlock(sc); - copyout(cm->cm_sense, cm->nvme_error_response, sz); + copyout(cm->cm_sense, + (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sz); mpr_lock(sc); } } From owner-svn-src-head@freebsd.org Wed Dec 26 10:40:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06CA6134C475; Wed, 26 Dec 2018 10:40:29 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 ADB6C745EF; Wed, 26 Dec 2018 10:40:28 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FD43225DA; Wed, 26 Dec 2018 10:40:28 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAeSth035646; Wed, 26 Dec 2018 10:40:28 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAeRTQ035641; Wed, 26 Dec 2018 10:40:27 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261040.wBQAeRTQ035641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342530 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADB6C745EF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:40:29 -0000 Author: kadesai Date: Wed Dec 26 10:40:27 2018 New Revision: 342530 URL: https://svnweb.freebsd.org/changeset/base/342530 Log: Added support for NVMe Task Management Following list of changes done in the driver as a part of TM handling on the NVMe drives. Below changes are only applicable on NVMe drives and only when custom NVMe TM handling bit is set to zero by IOC. 1. Issue LUN reset & Target reset TMs with Target reset method field set to Protocol Level reset (0x3), 2. For LUN & target reset TMs use the timeout value as ControllerResetTO value provided by firmware using PCie Device Page 0, 3. If LUN reset fails to terminates the IO then directly escalate to host reset instead of going for target reset TM, 4. For Abort TM use the timeout value as NVMeAbortTO value given by the IOC using Manufacturing Page 11, 5. Log message "PCie Host Reset failed" message up on receiving P Submitted by: Sreekanth Reddy Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mpr_config.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_sas.h head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mpr/mprvar.h Modified: head/sys/dev/mpr/mpr_config.c ============================================================================== --- head/sys/dev/mpr/mpr_config.c Wed Dec 26 10:39:34 2018 (r342529) +++ head/sys/dev/mpr/mpr_config.c Wed Dec 26 10:40:27 2018 (r342530) @@ -324,6 +324,137 @@ out: } /** + * mpr_config_get_man_pg11 - obtain manufacturing page 11 + * @sc: per adapter object + * @mpi_reply: reply mf payload returned from firmware + * @config_page: contents of the config page + * Context: sleep. + * + * Returns 0 for success, non-zero for failure. + */ +int +mpr_config_get_man_pg11(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, + Mpi2ManufacturingPage11_t *config_page) +{ + MPI2_CONFIG_REQUEST *request; + MPI2_CONFIG_REPLY *reply; + struct mpr_command *cm; + MPI2_CONFIG_PAGE_MAN_11 *page = NULL; + int error = 0; + u16 ioc_status; + + mpr_dprint(sc, MPR_TRACE, "%s\n", __func__); + + if ((cm = mpr_alloc_command(sc)) == NULL) { + printf("%s: command alloc failed @ line %d\n", __func__, + __LINE__); + error = EBUSY; + goto out; + } + request = (MPI2_CONFIG_REQUEST *)cm->cm_req; + bzero(request, sizeof(MPI2_CONFIG_REQUEST)); + request->Function = MPI2_FUNCTION_CONFIG; + request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; + request->Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING; + request->Header.PageNumber = 11; + request->Header.PageLength = request->Header.PageVersion = 0; + cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; + cm->cm_data = NULL; + error = mpr_wait_command(sc, &cm, 60, CAN_SLEEP); + reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; + if (error || (reply == NULL)) { + /* FIXME */ + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for header completed with error %d", + __func__, error); + error = ENXIO; + goto out; + } + ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; + bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); + if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { + /* FIXME */ + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: header read with error; iocstatus = 0x%x\n", + __func__, ioc_status); + error = ENXIO; + goto out; + } + /* We have to do free and alloc for the reply-free and reply-post + * counters to match - Need to review the reply FIFO handling. + */ + mpr_free_command(sc, cm); + + if ((cm = mpr_alloc_command(sc)) == NULL) { + printf("%s: command alloc failed @ line %d\n", __func__, + __LINE__); + error = EBUSY; + goto out; + } + request = (MPI2_CONFIG_REQUEST *)cm->cm_req; + bzero(request, sizeof(MPI2_CONFIG_REQUEST)); + request->Function = MPI2_FUNCTION_CONFIG; + request->Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; + request->Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING; + request->Header.PageNumber = 11; + request->Header.PageVersion = mpi_reply->Header.PageVersion; + request->Header.PageLength = mpi_reply->Header.PageLength; + cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; + cm->cm_sge = &request->PageBufferSGE; + cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); + cm->cm_flags = MPR_CM_FLAGS_SGE_SIMPLE | MPR_CM_FLAGS_DATAIN; + cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; + page = malloc((cm->cm_length), M_MPR, M_ZERO | M_NOWAIT); + if (!page) { + printf("%s: page alloc failed\n", __func__); + error = ENOMEM; + goto out; + } + cm->cm_data = page; + + error = mpr_wait_command(sc, &cm, 60, CAN_SLEEP); + reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; + if (error || (reply == NULL)) { + /* FIXME */ + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: request for page completed with error %d", + __func__, error); + error = ENXIO; + goto out; + } + ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; + bcopy(reply, mpi_reply, sizeof(MPI2_CONFIG_REPLY)); + if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { + /* FIXME */ + /* + * If the request returns an error then we need to do a diag + * reset + */ + printf("%s: page read with error; iocstatus = 0x%x\n", + __func__, ioc_status); + error = ENXIO; + goto out; + } + bcopy(page, config_page, MIN(cm->cm_length, + (sizeof(Mpi2ManufacturingPage11_t)))); + +out: + free(page, M_MPR); + if (cm) + mpr_free_command(sc, cm); + return (error); +} + +/** * mpr_base_static_config_pages - static start of day config pages. * @sc: per adapter object * @@ -332,8 +463,9 @@ out: void mpr_base_static_config_pages(struct mpr_softc *sc) { - Mpi2ConfigReply_t mpi_reply; - int retry; + Mpi2ConfigReply_t mpi_reply; + Mpi2ManufacturingPage11_t man_pg11; + int retry, rc; retry = 0; while (mpr_config_get_ioc_pg8(sc, &mpi_reply, &sc->ioc_pg8)) { @@ -352,6 +484,29 @@ mpr_base_static_config_pages(struct mpr_softc *sc) /*FIXME*/ break; } + } + retry = 0; + while ((rc = mpr_config_get_man_pg11(sc, &mpi_reply, &man_pg11))) { + retry++; + if (retry > 5) { + /* We need to Handle this situation */ + /*FIXME*/ + break; + } + } + + if (!rc) { + sc->custom_nvme_tm_handling = (le16toh(man_pg11.AddlFlags2) & + MPI2_MAN_PG11_ADDLFLAGS2_CUSTOM_TM_HANDLING_MASK); + sc->nvme_abort_timeout = man_pg11.NVMeAbortTO; + + /* Minimum NVMe Abort timeout value should be 6 seconds & + * maximum value should be 60 seconds. + */ + if (sc->nvme_abort_timeout < 6) + sc->nvme_abort_timeout = 6; + if (sc->nvme_abort_timeout > 60) + sc->nvme_abort_timeout = 60; } } Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Wed Dec 26 10:39:34 2018 (r342529) +++ head/sys/dev/mpr/mpr_sas.c Wed Dec 26 10:40:27 2018 (r342530) @@ -470,8 +470,14 @@ mprsas_prepare_volume_remove(struct mprsas_softc *sass req->DevHandle = targ->handle; req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; - /* SAS Hard Link Reset / SATA Link Reset */ - req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; + if (!targ->is_nvme || sc->custom_nvme_tm_handling) { + /* SAS Hard Link Reset / SATA Link Reset */ + req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; + } else { + /* PCIe Protocol Level Reset*/ + req->MsgFlags = + MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE; + } cm->cm_targ = targ; cm->cm_data = NULL; @@ -1360,8 +1366,11 @@ mprsas_logical_unit_reset_complete(struct mpr_softc *s "logical unit reset complete for target %u, but still " "have %u command(s), sending target reset\n", targ->tid, cm_count); - mprsas_send_reset(sc, tm, - MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET); + if (!targ->is_nvme || sc->custom_nvme_tm_handling) + mprsas_send_reset(sc, tm, + MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET); + else + mpr_reinit(sc); } } @@ -1449,7 +1458,7 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_com { MPI2_SCSI_TASK_MANAGE_REQUEST *req; struct mprsas_target *target; - int err; + int err, timeout; target = tm->cm_targ; if (target->handle == 0) { @@ -1462,6 +1471,21 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_com req->DevHandle = htole16(target->handle); req->TaskType = type; + if (!target->is_nvme || sc->custom_nvme_tm_handling) { + timeout = MPR_RESET_TIMEOUT; + /* + * Target reset method = + * SAS Hard Link Reset / SATA Link Reset + */ + req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; + } else { + timeout = (target->controller_reset_timeout) ? ( + target->controller_reset_timeout) : (MPR_RESET_TIMEOUT); + /* PCIe Protocol Level Reset*/ + req->MsgFlags = + MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE; + } + if (type == MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET) { /* XXX Need to handle invalid LUNs */ MPR_SET_LUN(req->LUN, tm->cm_lun); @@ -1472,11 +1496,6 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_com tm->cm_complete = mprsas_logical_unit_reset_complete; mprsas_prepare_for_tm(sc, tm, target, tm->cm_lun); } else if (type == MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET) { - /* - * Target reset method = - * SAS Hard Link Reset / SATA Link Reset - */ - req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; tm->cm_targ->target_resets++; mpr_dprint(sc, MPR_RECOVERY|MPR_INFO, "Sending target reset to target %u\n", target->tid); @@ -1498,7 +1517,7 @@ mprsas_send_reset(struct mpr_softc *sc, struct mpr_com tm->cm_data = NULL; tm->cm_complete_data = (void *)tm; - callout_reset(&tm->cm_callout, MPR_RESET_TIMEOUT * hz, + callout_reset(&tm->cm_callout, timeout * hz, mprsas_tm_timeout, tm); err = mpr_map_command(sc, tm); @@ -1599,7 +1618,7 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_com { MPI2_SCSI_TASK_MANAGE_REQUEST *req; struct mprsas_target *targ; - int err; + int err, timeout; targ = cm->cm_targ; if (targ->handle == 0) { @@ -1627,7 +1646,12 @@ mprsas_send_abort(struct mpr_softc *sc, struct mpr_com tm->cm_targ = cm->cm_targ; tm->cm_lun = cm->cm_lun; - callout_reset(&tm->cm_callout, MPR_ABORT_TIMEOUT * hz, + if (!targ->is_nvme || sc->custom_nvme_tm_handling) + timeout = MPR_ABORT_TIMEOUT; + else + timeout = sc->nvme_abort_timeout; + + callout_reset(&tm->cm_callout, timeout * hz, mprsas_tm_timeout, tm); targ->aborts++; @@ -3328,8 +3352,14 @@ mprsas_action_resetdev(struct mprsas_softc *sassc, uni req->DevHandle = htole16(targ->handle); req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; - /* SAS Hard Link Reset / SATA Link Reset */ - req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; + if (!targ->is_nvme || sc->custom_nvme_tm_handling) { + /* SAS Hard Link Reset / SATA Link Reset */ + req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; + } else { + /* PCIe Protocol Level Reset*/ + req->MsgFlags = + MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE; + } tm->cm_data = NULL; tm->cm_complete = mprsas_resetdev_complete; Modified: head/sys/dev/mpr/mpr_sas.h ============================================================================== --- head/sys/dev/mpr/mpr_sas.h Wed Dec 26 10:39:34 2018 (r342529) +++ head/sys/dev/mpr/mpr_sas.h Wed Dec 26 10:40:27 2018 (r342530) @@ -82,6 +82,7 @@ struct mprsas_target { uint8_t supports_SSU; uint8_t is_nvme; uint32_t MDTS; + uint8_t controller_reset_timeout; }; struct mprsas_softc { Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Wed Dec 26 10:39:34 2018 (r342529) +++ head/sys/dev/mpr/mpr_sas_lsi.c Wed Dec 26 10:40:27 2018 (r342530) @@ -683,6 +683,24 @@ skip_fp_send: } break; } + case MPI2_EVENT_PCIE_DEVICE_STATUS_CHANGE: + { + pMpi26EventDataPCIeDeviceStatusChange_t pcie_status_event_data; + pcie_status_event_data = + (pMpi26EventDataPCIeDeviceStatusChange_t)fw_event->event_data; + + switch (pcie_status_event_data->ReasonCode) { + case MPI26_EVENT_PCIDEV_STAT_RC_PCIE_HOT_RESET_FAILED: + { + mpr_printf(sc, "PCIe Host Reset failed on DevHandle " + "0x%x\n", pcie_status_event_data->DevHandle); + break; + } + default: + break; + } + break; + } case MPI2_EVENT_SAS_DEVICE_DISCOVERY_ERROR: { pMpi25EventDataSasDeviceDiscoveryError_t discovery_error_data; @@ -1317,6 +1335,8 @@ mprsas_add_pcie_device(struct mpr_softc *sc, u16 handl targ->connector_name[3] = ((char *)&config_page.ConnectorName)[3]; targ->is_nvme = device_info & MPI26_PCIE_DEVINFO_NVME; targ->MDTS = config_page2.MaximumDataTransferSize; + if (targ->is_nvme) + targ->controller_reset_timeout = config_page2.ControllerResetTO; /* * Assume always TRUE for encl_level_valid because there is no valid * flag for PCIe. Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Wed Dec 26 10:39:34 2018 (r342529) +++ head/sys/dev/mpr/mprvar.h Wed Dec 26 10:40:27 2018 (r342530) @@ -97,6 +97,38 @@ typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; +typedef struct _MPI2_CONFIG_PAGE_MAN_11 +{ + MPI2_CONFIG_PAGE_HEADER Header; /* 0x00 */ + U8 FlashTime; /* 0x04 */ + U8 NVTime; /* 0x05 */ + U16 Flag; /* 0x06 */ + U8 RFIoTimeout; /* 0x08 */ + U8 EEDPTagMode; /* 0x09 */ + U8 AWTValue; /* 0x0A */ + U8 Reserve1; /* 0x0B */ + U8 MaxCmdFrames; /* 0x0C */ + U8 Reserve2; /* 0x0D */ + U16 AddlFlags; /* 0x0E */ + U32 SysRefClk; /* 0x10 */ + U64 Reserve3[3]; /* 0x14 */ + U16 AddlFlags2; /* 0x2C */ + U8 AddlFlags3; /* 0x2E */ + U8 Reserve4; /* 0x2F */ + U64 opDebugEnable; /* 0x30 */ + U64 PlDebugEnable; /* 0x38 */ + U64 IrDebugEnable; /* 0x40 */ + U32 BoardPowerRequirement; /* 0x48 */ + U8 NVMeAbortTO; /* 0x4C */ + U8 Reserve5; /* 0x4D */ + U16 Reserve6; /* 0x4E */ + U32 Reserve7[3]; /* 0x50 */ +} MPI2_CONFIG_PAGE_MAN_11, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_11, + Mpi2ManufacturingPage11_t, MPI2_POINTER pMpi2ManufacturingPage11_t; + +#define MPI2_MAN_PG11_ADDLFLAGS2_CUSTOM_TM_HANDLING_MASK (0x0010) + /** * struct dev_mapping_table - device mapping information * @physical_id: SAS address for drives or WWID for RAID volumes @@ -471,6 +503,8 @@ struct mpr_softc { char exclude_ids[80]; struct timeval lastfail; + uint8_t custom_nvme_tm_handling; + uint8_t nvme_abort_timeout; }; struct mpr_config_params { @@ -812,6 +846,8 @@ int mpr_config_get_volume_wwid(struct mpr_softc *sc, u int mpr_config_get_raid_pd_pg0(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, Mpi2RaidPhysDiskPage0_t *config_page, u32 page_address); +int mpr_config_get_man_pg11(struct mpr_softc *sc, Mpi2ConfigReply_t *mpi_reply, + Mpi2ManufacturingPage11_t *config_page); void mprsas_ir_shutdown(struct mpr_softc *sc, int howto); int mpr_reinit(struct mpr_softc *sc); From owner-svn-src-head@freebsd.org Wed Dec 26 10:41:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22839134C51A; Wed, 26 Dec 2018 10:41:15 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 BBAFF747F5; Wed, 26 Dec 2018 10:41:14 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B033922615; Wed, 26 Dec 2018 10:41:14 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAfEuG035730; Wed, 26 Dec 2018 10:41:14 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAfEp4035728; Wed, 26 Dec 2018 10:41:14 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261041.wBQAfEp4035728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342531 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBAFF747F5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:41:15 -0000 Author: kadesai Date: Wed Dec 26 10:41:14 2018 New Revision: 342531 URL: https://svnweb.freebsd.org/changeset/base/342531 Log: Add Sea,Aero adapter support Added deviceID's for Sea,Aero to mpr Driver Aero: 0x00E0 Invalid 0x00E1 Configurable Secure 0x00E2 Hard Secure 0x00E3 Tampered Sea: 0x00E4 Invalid 0x00E5 Configurable Secure 0x00E6 Hard Secure 0x00E7 Tampered For Tampered & Invalid type cards, driver will claim the device & quit the probe function with below error message, "HBA is in Non Secure mode" for Configurable Secure type cards, driver will display below message in .probe() callback function, "HBA is in Configurable Secure mode" Submitted by: Sreekanth Reddy Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mpr_pci.c head/sys/dev/mpr/mprvar.h Modified: head/sys/dev/mpr/mpr_pci.c ============================================================================== --- head/sys/dev/mpr/mpr_pci.c Wed Dec 26 10:40:27 2018 (r342530) +++ head/sys/dev/mpr/mpr_pci.c Wed Dec 26 10:41:14 2018 (r342531) @@ -148,6 +148,30 @@ struct mpr_ident { { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_SAS3716, 0xffff, 0xffff, MPR_FLAGS_GEN35_IOC, "Avago Technologies (LSI) SAS3716" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID0_SAS3816, + 0xffff, 0xffff, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC), + "Broadcom Inc. (LSI) INVALID0 SAS3816" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3816, + 0xffff, 0xffff, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC), + "Broadcom Inc. (LSI) CFG SEC SAS3816" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_HARD_SEC_SAS3816, + 0xffff, 0xffff, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC), + "Broadcom Inc. (LSI) HARD SEC SAS3816" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID1_SAS3816, + 0xffff, 0xffff, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC), + "Broadcom Inc. (LSI) INVALID1 SAS3816" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID0_SAS3916, + 0xffff, 0xffff, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC), + "Broadcom Inc. (LSI) INVALID0 SAS3916" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3916, + 0xffff, 0xffff, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC), + "Broadcom Inc. (LSI) CFG SEC SAS3916" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_HARD_SEC_SAS3916, + 0xffff, 0xffff, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC), + "Broadcom Inc. (LSI) HARD SEC SAS3916" }, + { MPI2_MFGPAGE_VENDORID_LSI, MPI26_MFGPAGE_DEVID_INVALID1_SAS3916, + 0xffff, 0xffff, (MPR_FLAGS_GEN35_IOC | MPR_FLAGS_SEA_IOC), + "Broadcom Inc. (LSI) INVALID1 SAS3916" }, { 0, 0, 0, 0, 0, NULL } }; @@ -205,6 +229,21 @@ mpr_pci_attach(device_t dev) sc->mpr_dev = dev; m = mpr_find_ident(dev); sc->mpr_flags = m->flags; + + switch (m->device) { + case MPI26_MFGPAGE_DEVID_INVALID0_SAS3816: + case MPI26_MFGPAGE_DEVID_INVALID1_SAS3816: + case MPI26_MFGPAGE_DEVID_INVALID0_SAS3916: + case MPI26_MFGPAGE_DEVID_INVALID1_SAS3916: + mpr_printf(sc, "HBA is in Non Secure mode\n"); + return (ENXIO); + case MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3816: + case MPI26_MFGPAGE_DEVID_CFG_SEC_SAS3916: + mpr_printf(sc, "HBA is in Configurable Secure mode\n"); + break; + default: + break; + } mpr_get_tunables(sc); Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Wed Dec 26 10:40:27 2018 (r342530) +++ head/sys/dev/mpr/mprvar.h Wed Dec 26 10:41:14 2018 (r342531) @@ -341,6 +341,7 @@ struct mpr_softc { #define MPR_FLAGS_ATTACH_DONE (1 << 5) #define MPR_FLAGS_GEN35_IOC (1 << 6) #define MPR_FLAGS_REALLOCATED (1 << 7) +#define MPR_FLAGS_SEA_IOC (1 << 8) u_int mpr_debug; int msi_msgs; u_int reqframesz; From owner-svn-src-head@freebsd.org Wed Dec 26 10:41:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E05C7134C755; Wed, 26 Dec 2018 10:41:58 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 49CBC74CCD; Wed, 26 Dec 2018 10:41:54 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 190B72275A; Wed, 26 Dec 2018 10:41:54 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAfret037771; Wed, 26 Dec 2018 10:41:53 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAfrPI037755; Wed, 26 Dec 2018 10:41:53 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261041.wBQAfrPI037755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342533 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 49CBC74CCD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:41:59 -0000 Author: kadesai Date: Wed Dec 26 10:41:53 2018 New Revision: 342533 URL: https://svnweb.freebsd.org/changeset/base/342533 Log: Enable atomic type descriptor support only for Sea & Aero cards Enable atomic type descriptor support only for Sea & Aero cards, due to HW errata this atomic descriptor support has to be disabled on Ventura cards. Submitted by: Sreekanth Reddy Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mpr.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Wed Dec 26 10:41:17 2018 (r342532) +++ head/sys/dev/mpr/mpr.c Wed Dec 26 10:41:53 2018 (r342533) @@ -624,8 +624,9 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at sc->eedp_enabled = TRUE; if (sc->facts->IOCCapabilities & MPI2_IOCFACTS_CAPABILITY_TLR) sc->control_TLR = TRUE; - if (sc->facts->IOCCapabilities & - MPI26_IOCFACTS_CAPABILITY_ATOMIC_REQ) + if ((sc->facts->IOCCapabilities & + MPI26_IOCFACTS_CAPABILITY_ATOMIC_REQ) && + (sc->mpr_flags & MPR_FLAGS_SEA_IOC)) sc->atomic_desc_capable = TRUE; mpr_resize_queues(sc); From owner-svn-src-head@freebsd.org Wed Dec 26 10:42:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25BE6134C85F; Wed, 26 Dec 2018 10:42:46 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 BE62174F44; Wed, 26 Dec 2018 10:42:45 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFDC32279A; Wed, 26 Dec 2018 10:42:45 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAgjoP040977; Wed, 26 Dec 2018 10:42:45 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAgjcx040976; Wed, 26 Dec 2018 10:42:45 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261042.wBQAgjcx040976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342534 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BE62174F44 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:42:46 -0000 Author: kadesai Date: Wed Dec 26 10:42:45 2018 New Revision: 342534 URL: https://svnweb.freebsd.org/changeset/base/342534 Log: On Aero/Sea A0 cards retry MPT Fusion registers reads for max three times Due to HW Errta on Aero/Sea A0 chipset on secure boot mode & on heavy IO load, sometimes read operation on MPT Fusion registers will give zero value, So, as a workaround driver will retry the MPT Fusion register read operation for max three times upon reading zero value form these registers. Submitted by: Sreekanth Reddy Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mprvar.h Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Wed Dec 26 10:41:53 2018 (r342533) +++ head/sys/dev/mpr/mprvar.h Wed Dec 26 10:42:45 2018 (r342534) @@ -530,7 +530,14 @@ struct scsi_read_capacity_eedp static __inline uint32_t mpr_regread(struct mpr_softc *sc, uint32_t offset) { - return (bus_space_read_4(sc->mpr_btag, sc->mpr_bhandle, offset)); + uint32_t ret_val, i = 0; + do { + ret_val = + bus_space_read_4(sc->mpr_btag, sc->mpr_bhandle, offset); + } while((sc->mpr_flags & MPR_FLAGS_SEA_IOC) && + (ret_val == 0) && (++i < 3)); + + return ret_val; } static __inline void From owner-svn-src-head@freebsd.org Wed Dec 26 10:43:34 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF7C2134C964; Wed, 26 Dec 2018 10:43:33 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 5BC33750C4; Wed, 26 Dec 2018 10:43:33 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50C67227A0; Wed, 26 Dec 2018 10:43:33 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAhXG2041069; Wed, 26 Dec 2018 10:43:33 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAhVOA041060; Wed, 26 Dec 2018 10:43:31 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261043.wBQAhVOA041060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:43:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342535 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5BC33750C4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:43:34 -0000 Author: kadesai Date: Wed Dec 26 10:43:31 2018 New Revision: 342535 URL: https://svnweb.freebsd.org/changeset/base/342535 Log: Update copyright information Submitted by: Sreekanth Reddy Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_config.c head/sys/dev/mpr/mpr_ioctl.h head/sys/dev/mpr/mpr_mapping.c head/sys/dev/mpr/mpr_mapping.h head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_sas.h head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mpr/mprvar.h Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mpr.c Wed Dec 26 10:43:31 2018 (r342535) @@ -2,6 +2,7 @@ * Copyright (c) 2009 Yahoo! Inc. * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * */ Modified: head/sys/dev/mpr/mpr_config.c ============================================================================== --- head/sys/dev/mpr/mpr_config.c Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mpr_config.c Wed Dec 26 10:43:31 2018 (r342535) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD */ #include Modified: head/sys/dev/mpr/mpr_ioctl.h ============================================================================== --- head/sys/dev/mpr/mpr_ioctl.h Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mpr_ioctl.h Wed Dec 26 10:43:31 2018 (r342535) @@ -27,13 +27,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD userland interface + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD userland interface * * $FreeBSD$ */ /*- * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +58,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ Modified: head/sys/dev/mpr/mpr_mapping.c ============================================================================== --- head/sys/dev/mpr/mpr_mapping.c Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mpr_mapping.c Wed Dec 26 10:43:31 2018 (r342535) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD */ #include Modified: head/sys/dev/mpr/mpr_mapping.h ============================================================================== --- head/sys/dev/mpr/mpr_mapping.h Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mpr_mapping.h Wed Dec 26 10:43:31 2018 (r342535) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mpr_sas.c Wed Dec 26 10:43:31 2018 (r342535) @@ -2,6 +2,7 @@ * Copyright (c) 2009 Yahoo! Inc. * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * */ Modified: head/sys/dev/mpr/mpr_sas.h ============================================================================== --- head/sys/dev/mpr/mpr_sas.h Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mpr_sas.h Wed Dec 26 10:43:31 2018 (r342535) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mpr_sas_lsi.c Wed Dec 26 10:43:31 2018 (r342535) @@ -1,6 +1,7 @@ /*- * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -24,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD */ #include Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mpr_user.c Wed Dec 26 10:43:31 2018 (r342535) @@ -27,11 +27,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD userland interface + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD userland interface */ /*- * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,7 +56,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Wed Dec 26 10:42:45 2018 (r342534) +++ head/sys/dev/mpr/mprvar.h Wed Dec 26 10:43:31 2018 (r342535) @@ -2,6 +2,7 @@ * Copyright (c) 2009 Yahoo! Inc. * Copyright (c) 2011-2015 LSI Corp. * Copyright (c) 2013-2016 Avago Technologies + * Copyright 2000-2020 Broadcom Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD + * Broadcom Inc. (LSI) MPT-Fusion Host Adapter FreeBSD * * $FreeBSD$ */ From owner-svn-src-head@freebsd.org Wed Dec 26 10:44:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8644134CA1E; Wed, 26 Dec 2018 10:44:30 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 7FE4A75267; Wed, 26 Dec 2018 10:44:30 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72A58227A3; Wed, 26 Dec 2018 10:44:30 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAiUqc041180; Wed, 26 Dec 2018 10:44:30 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAiUxP041179; Wed, 26 Dec 2018 10:44:30 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261044.wBQAiUxP041179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:44:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342536 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FE4A75267 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:44:31 -0000 Author: kadesai Date: Wed Dec 26 10:44:30 2018 New Revision: 342536 URL: https://svnweb.freebsd.org/changeset/base/342536 Log: Update mpr driver version to v23.00.00.00-fbsd Submitted by: Sreekanth Reddy Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mpr/mprvar.h Modified: head/sys/dev/mpr/mprvar.h ============================================================================== --- head/sys/dev/mpr/mprvar.h Wed Dec 26 10:43:31 2018 (r342535) +++ head/sys/dev/mpr/mprvar.h Wed Dec 26 10:44:30 2018 (r342536) @@ -34,7 +34,7 @@ #ifndef _MPRVAR_H #define _MPRVAR_H -#define MPR_DRIVER_VERSION "18.03.00.00-fbsd" +#define MPR_DRIVER_VERSION "23.00.00.00-fbsd" #define MPR_DB_MAX_WAIT 2500 From owner-svn-src-head@freebsd.org Wed Dec 26 10:46:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7637C134CB0D; Wed, 26 Dec 2018 10:46:24 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 230A4753E9; Wed, 26 Dec 2018 10:46:24 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15003227A6; Wed, 26 Dec 2018 10:46:24 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAkNI2041333; Wed, 26 Dec 2018 10:46:23 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAkNtv041329; Wed, 26 Dec 2018 10:46:23 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261046.wBQAkNtv041329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342537 - head/sys/dev/mrsas X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mrsas X-SVN-Commit-Revision: 342537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 230A4753E9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:46:24 -0000 Author: kadesai Date: Wed Dec 26 10:46:23 2018 New Revision: 342537 URL: https://svnweb.freebsd.org/changeset/base/342537 Log: This patch will add support for latest generation MegaRAID adapters- Aero(39xx). Driver will throw a warning message when a Configurable secure type controller is encountered. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed Dec 26 10:44:30 2018 (r342536) +++ head/sys/dev/mrsas/mrsas.c Wed Dec 26 10:46:23 2018 (r342537) @@ -201,6 +201,14 @@ MRSAS_CTLR_ID device_table[] = { {0x1000, MRSAS_TOMCAT, 0xffff, 0xffff, "AVAGO Tomcat SAS Controller"}, {0x1000, MRSAS_VENTURA_4PORT, 0xffff, 0xffff, "AVAGO Ventura_4Port SAS Controller"}, {0x1000, MRSAS_CRUSADER_4PORT, 0xffff, 0xffff, "AVAGO Crusader_4Port SAS Controller"}, + {0x1000, MRSAS_AERO_10E0, 0xffff, 0xffff, "BROADCOM AERO-10E0 SAS Controller"}, + {0x1000, MRSAS_AERO_10E1, 0xffff, 0xffff, "BROADCOM AERO-10E1 SAS Controller"}, + {0x1000, MRSAS_AERO_10E2, 0xffff, 0xffff, "BROADCOM AERO-10E2 SAS Controller"}, + {0x1000, MRSAS_AERO_10E3, 0xffff, 0xffff, "BROADCOM AERO-10E3 SAS Controller"}, + {0x1000, MRSAS_AERO_10E4, 0xffff, 0xffff, "BROADCOM AERO-10E4 SAS Controller"}, + {0x1000, MRSAS_AERO_10E5, 0xffff, 0xffff, "BROADCOM AERO-10E5 SAS Controller"}, + {0x1000, MRSAS_AERO_10E6, 0xffff, 0xffff, "BROADCOM AERO-10E6 SAS Controller"}, + {0x1000, MRSAS_AERO_10E7, 0xffff, 0xffff, "BROADCOM AERO-10E7 SAS Controller"}, {0, 0, 0, 0, NULL} }; @@ -845,20 +853,37 @@ mrsas_attach(device_t dev) sc->mrsas_dev = dev; sc->device_id = pci_get_device(dev); - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + switch (sc->device_id) { + case MRSAS_INVADER: + case MRSAS_FURY: + case MRSAS_INTRUDER: + case MRSAS_INTRUDER_24: + case MRSAS_CUTLASS_52: + case MRSAS_CUTLASS_53: sc->mrsas_gen3_ctrl = 1; - } else if ((sc->device_id == MRSAS_VENTURA) || - (sc->device_id == MRSAS_CRUSADER) || - (sc->device_id == MRSAS_HARPOON) || - (sc->device_id == MRSAS_TOMCAT) || - (sc->device_id == MRSAS_VENTURA_4PORT) || - (sc->device_id == MRSAS_CRUSADER_4PORT)) { + break; + case MRSAS_VENTURA: + case MRSAS_CRUSADER: + case MRSAS_HARPOON: + case MRSAS_TOMCAT: + case MRSAS_VENTURA_4PORT: + case MRSAS_CRUSADER_4PORT: sc->is_ventura = true; + break; + case MRSAS_AERO_10E1: + case MRSAS_AERO_10E5: + device_printf(dev, "Adapter is in configurable secure mode\n"); + case MRSAS_AERO_10E2: + case MRSAS_AERO_10E6: + sc->is_aero = true; + break; + case MRSAS_AERO_10E0: + case MRSAS_AERO_10E3: + case MRSAS_AERO_10E4: + case MRSAS_AERO_10E7: + device_printf(dev, "Adapter is in non-secure mode\n"); + return SUCCESS; + } mrsas_get_tunables(sc); @@ -874,8 +899,8 @@ mrsas_attach(device_t dev) cmd |= PCIM_CMD_BUSMASTEREN; pci_write_config(dev, PCIR_COMMAND, cmd, 2); - /* For Ventura system registers are mapped to BAR0 */ - if (sc->is_ventura) + /* For Ventura/Aero system registers are mapped to BAR0 */ + if (sc->is_ventura || sc->is_aero) sc->reg_res_id = PCIR_BAR(0); /* BAR0 offset */ else sc->reg_res_id = PCIR_BAR(1); /* BAR1 offset */ @@ -1099,7 +1124,7 @@ mrsas_detach(device_t dev) mrsas_shutdown_ctlr(sc, MR_DCMD_CTRL_SHUTDOWN); mrsas_disable_intr(sc); - if (sc->is_ventura && sc->streamDetectByLD) { + if ((sc->is_ventura || sc->is_aero) && sc->streamDetectByLD) { for (i = 0; i < MAX_LOGICAL_DRIVES_EXT; ++i) free(sc->streamDetectByLD[i], M_MRSAS); free(sc->streamDetectByLD, M_MRSAS); @@ -2285,7 +2310,7 @@ mrsas_init_fw(struct mrsas_softc *sc) if (ret != SUCCESS) { return (ret); } - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); #if VD_EXT_DEBUG device_printf(sc->mrsas_dev, "scratch_pad_3 0x%x\n", scratch_pad_3); @@ -2316,7 +2341,7 @@ mrsas_init_fw(struct mrsas_softc *sc) fw_msix_count = sc->msix_vectors; if ((sc->mrsas_gen3_ctrl && (sc->msix_vectors > 8)) || - (sc->is_ventura && (sc->msix_vectors > 16))) + ((sc->is_ventura || sc->is_aero) && (sc->msix_vectors > 16))) sc->msix_combined = true; /* * Save 1-15 reply post index @@ -2359,7 +2384,7 @@ mrsas_init_fw(struct mrsas_softc *sc) return (1); } - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { scratch_pad_4 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_4)); if ((scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK) >= MR_DEFAULT_NVME_PAGE_SHIFT) @@ -2424,7 +2449,7 @@ mrsas_init_fw(struct mrsas_softc *sc) return (1); } - if (sc->is_ventura && sc->drv_stream_detection) { + if ((sc->is_ventura || sc->is_aero) && sc->drv_stream_detection) { sc->streamDetectByLD = malloc(sizeof(PTR_LD_STREAM_DETECT) * MAX_LOGICAL_DRIVES_EXT, M_MRSAS, M_NOWAIT); if (!sc->streamDetectByLD) { @@ -2678,7 +2703,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -3306,7 +3331,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese megasas_setup_jbod_map(sc); - if (sc->is_ventura && sc->streamDetectByLD) { + if ((sc->is_ventura || sc->is_aero) && sc->streamDetectByLD) { for (j = 0; j < MAX_LOGICAL_DRIVES_EXT; ++j) { memset(sc->streamDetectByLD[i], 0, sizeof(LD_STREAM_DETECT)); sc->streamDetectByLD[i]->mruBitMap = MR_STREAM_BITMAP; @@ -3834,7 +3859,7 @@ mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, st io_req = mpt_cmd->io_request; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed Dec 26 10:44:30 2018 (r342536) +++ head/sys/dev/mrsas/mrsas.h Wed Dec 26 10:46:23 2018 (r342537) @@ -91,7 +91,16 @@ __FBSDID("$FreeBSD$"); #define MRSAS_TOMCAT 0x0017 #define MRSAS_VENTURA_4PORT 0x001B #define MRSAS_CRUSADER_4PORT 0x001C +#define MRSAS_AERO_10E0 0x10E0 +#define MRSAS_AERO_10E1 0x10E1 +#define MRSAS_AERO_10E2 0x10E2 +#define MRSAS_AERO_10E3 0x10E3 +#define MRSAS_AERO_10E4 0x10E4 +#define MRSAS_AERO_10E5 0x10E5 +#define MRSAS_AERO_10E6 0x10E6 +#define MRSAS_AERO_10E7 0x10E7 + /* * Firmware State Defines */ @@ -3355,6 +3364,7 @@ struct mrsas_softc { u_int32_t nvme_page_size; boolean_t is_ventura; + boolean_t is_aero; boolean_t msix_combined; u_int16_t maxRaidMapSize; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Wed Dec 26 10:44:30 2018 (r342536) +++ head/sys/dev/mrsas/mrsas_cam.c Wed Dec 26 10:46:23 2018 (r342537) @@ -867,7 +867,7 @@ mrsas_build_ldio_rw(struct mrsas_softc *sc, struct mrs "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (FAIL); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1071,7 +1071,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp cmd->request_desc->SCSIIO.MSIxIndex = sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { if (sc->streamDetectByLD) { mtx_lock(&sc->stream_lock); mrsas_stream_detect(sc, cmd, &io_info); @@ -1121,7 +1121,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp io_request->RaidContext.raid_context.regLockFlags |= (MR_RL_FLAGS_GRANT_DESTINATION_CUDA | MR_RL_FLAGS_SEQ_NUM_ENABLE); - } else if (sc->is_ventura) { + } else if (sc->is_ventura || sc->is_aero) { io_request->RaidContext.raid_context_g35.Type = MPI2_TYPE_CUDA; io_request->RaidContext.raid_context_g35.nseg = 0x1; io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; @@ -1139,14 +1139,14 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp &sc->load_balance_info[device_id], &io_info); cmd->load_balance = MRSAS_LOAD_BALANCE_FLAG; cmd->pd_r1_lb = io_info.pd_after_lb; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.spanArm = io_info.span_arm; else io_request->RaidContext.raid_context.spanArm = io_info.span_arm; } else cmd->load_balance = 0; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) cmd->r1_alt_dev_handle = io_info.r1_alt_dev_handle; else cmd->r1_alt_dev_handle = MR_DEVHANDLE_INVALID; @@ -1170,7 +1170,7 @@ mrsas_setup_io(struct mrsas_softc *sc, struct mrsas_mp (MR_RL_FLAGS_GRANT_DESTINATION_CPU0 | MR_RL_FLAGS_SEQ_NUM_ENABLE); io_request->RaidContext.raid_context.nseg = 0x1; - } else if (sc->is_ventura) { + } else if (sc->is_ventura || sc->is_aero) { io_request->RaidContext.raid_context_g35.Type = MPI2_TYPE_CUDA; io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; io_request->RaidContext.raid_context_g35.nseg = 0x1; @@ -1229,7 +1229,7 @@ mrsas_build_ldio_nonrw(struct mrsas_softc *sc, struct "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1294,7 +1294,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs device_id + 255; io_request->RaidContext.raid_context.configSeqNum = pd_sync->seq[device_id].seqNum; io_request->DevHandle = pd_sync->seq[device_id].devHandle; - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.routingFlags.bits.sqn = 1; else io_request->RaidContext.raid_context.regLockFlags |= @@ -1342,7 +1342,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs * Because the NON RW cmds will now go via FW Queue * and not the Exception queue */ - if (sc->mrsas_gen3_ctrl || sc->is_ventura) + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; cmd->request_desc->SCSIIO.RequestFlags = @@ -1359,7 +1359,7 @@ mrsas_build_syspdio(struct mrsas_softc *sc, struct mrs "max (0x%x) allowed\n", cmd->sge_count, sc->max_num_sge); return (1); } - if (sc->is_ventura) + if (sc->is_ventura || sc->is_aero) io_request->RaidContext.raid_context_g35.numSGE = cmd->sge_count; else { /* @@ -1522,7 +1522,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd io_request = cmd->io_request; sgl_ptr = (pMpi25IeeeSgeChain64_t)&io_request->SGL; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1533,7 +1533,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd sgl_ptr->Address = segs[i].ds_addr; sgl_ptr->Length = segs[i].ds_len; sgl_ptr->Flags = 0; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1543,7 +1543,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd (nseg > sc->max_sge_in_main_msg)) { pMpi25IeeeSgeChain64_t sg_chain; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) { + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1552,7 +1552,7 @@ static void mrsas_build_ieee_sgl(struct mrsas_mpt_cmd } else cmd->io_request->ChainOffset = sc->chain_offset_io_request; sg_chain = sgl_ptr; - if (sc->mrsas_gen3_ctrl || sc->is_ventura) + if (sc->mrsas_gen3_ctrl || sc->is_ventura || sc->is_aero) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Wed Dec 26 10:44:30 2018 (r342536) +++ head/sys/dev/mrsas/mrsas_fp.c Wed Dec 26 10:46:23 2018 (r342537) @@ -983,7 +983,7 @@ mr_spanset_get_phy_params(struct mrsas_softc *sc, u_in } *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { ((RAID_CONTEXT_G35 *) pRAID_Context)->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; @@ -1190,7 +1190,7 @@ MR_BuildRaidContext(struct mrsas_softc *sc, struct IO_ * if FP possible, set the SLUD bit in regLockFlags for * ventura */ - else if ((sc->is_ventura) && !isRead && + else if ((sc->is_ventura || sc->is_aero) && !isRead && (raid->writeMode == MR_RL_WRITE_BACK_MODE) && (raid->level <= 1) && raid->capability.fpCacheBypassCapable) { ((RAID_CONTEXT_G35 *) pRAID_Context)->routingFlags.bits.sld = 1; @@ -1729,7 +1729,7 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int32_t ld, } *pdBlock += stripRef + MR_LdSpanPtrGet(ld, span, map)->startBlk; - if (sc->is_ventura) { + if (sc->is_ventura || sc->is_aero) { ((RAID_CONTEXT_G35 *) pRAID_Context)->spanArm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; io_info->span_arm = (span << RAID_CTX_SPANARM_SPAN_SHIFT) | physArm; From owner-svn-src-head@freebsd.org Wed Dec 26 10:47:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04FEE134CBE9; Wed, 26 Dec 2018 10:47:10 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 9F0DF7556C; Wed, 26 Dec 2018 10:47:09 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 921CD227AA; Wed, 26 Dec 2018 10:47:09 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAl9mM041427; Wed, 26 Dec 2018 10:47:09 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAl91Z041426; Wed, 26 Dec 2018 10:47:09 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261047.wBQAl91Z041426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:47:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342538 - head/sys/dev/mrsas X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mrsas X-SVN-Commit-Revision: 342538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F0DF7556C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:47:10 -0000 Author: kadesai Date: Wed Dec 26 10:47:08 2018 New Revision: 342538 URL: https://svnweb.freebsd.org/changeset/base/342538 Log: This patch will add support for 32 bit atomic request descriptor for Aero adapters. For Aero adapters- 1. Driver will use 32 bit atomic descriptor to fire IOs and DCMDs. 2. Driver will use 64 bit request descriptor to fire IOC INIT. 3. If Aero firmware supports 32 bit atomic descriptor, then only driver will use it otherwise driver will use 64 bit request descriptor. For rest of adapters(Ventura, Invader and Thunderbolt), driver will use 64 bit request descriptors only. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed Dec 26 10:46:23 2018 (r342537) +++ head/sys/dev/mrsas/mrsas.c Wed Dec 26 10:47:08 2018 (r342538) @@ -171,6 +171,9 @@ void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); void mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, union ccb *ccb_ptr, u_int8_t status, u_int8_t extStatus, u_int32_t data_length, u_int8_t *sense); +void +mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, + u_int32_t req_desc_hi); SYSCTL_NODE(_hw, OID_AUTO, mrsas, CTLFLAG_RD, 0, "MRSAS Driver Parameters"); @@ -2728,7 +2731,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) mrsas_disable_intr(sc); mrsas_dprint(sc, MRSAS_OCR, "Issuing IOC INIT command to FW.\n"); - mrsas_fire_cmd(sc, req_desc.addr.u.low, req_desc.addr.u.high); + mrsas_write_64bit_req_desc(sc, req_desc.addr.u.low, req_desc.addr.u.high); /* * Poll response timer to wait for Firmware response. While this @@ -2754,6 +2757,15 @@ mrsas_ioc_init(struct mrsas_softc *sc) retcode = 1; } + if (sc->is_aero) { + scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_2)); + sc->atomic_desc_support = (scratch_pad_2 & + MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET) ? 1 : 0; + device_printf(sc->mrsas_dev, "FW supports atomic descriptor: %s\n", + sc->atomic_desc_support ? "Yes" : "No"); + } + mrsas_free_ioc_cmd(sc); return (retcode); } @@ -2853,16 +2865,13 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc *sc) } /* - * mrsas_fire_cmd: Sends command to FW + * mrsas_write_64bit_req_dsc: Writes 64 bit request descriptor to FW * input: Adapter softstate - * request descriptor address low - * request descriptor address high - * - * This functions fires the command to Firmware by writing to the - * inbound_low_queue_port and inbound_high_queue_port. + * request descriptor address low + * request descriptor address high */ void -mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, +mrsas_write_64bit_req_desc(struct mrsas_softc *sc, u_int32_t req_desc_lo, u_int32_t req_desc_hi) { mtx_lock(&sc->pci_lock); @@ -2871,6 +2880,26 @@ mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_d mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_high_queue_port), req_desc_hi); mtx_unlock(&sc->pci_lock); +} + +/* + * mrsas_fire_cmd: Sends command to FW + * input: Adapter softstate + * request descriptor address low + * request descriptor address high + * + * This functions fires the command to Firmware by writing to the + * inbound_low_queue_port and inbound_high_queue_port. + */ +void +mrsas_fire_cmd(struct mrsas_softc *sc, u_int32_t req_desc_lo, + u_int32_t req_desc_hi) +{ + if (sc->atomic_desc_support) + mrsas_write_reg(sc, offsetof(mrsas_reg_set, inbound_single_queue_port), + req_desc_lo); + else + mrsas_write_64bit_req_desc(sc, req_desc_lo, req_desc_hi); } /* Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed Dec 26 10:46:23 2018 (r342537) +++ head/sys/dev/mrsas/mrsas.h Wed Dec 26 10:47:08 2018 (r342538) @@ -1259,7 +1259,7 @@ typedef struct _mrsas_register_set { u_int32_t inbound_high_queue_port; /* 00C4h */ - u_int32_t reserved_5; /* 00C8h */ + u_int32_t inbound_single_queue_port; /* 00C8h */ u_int32_t res_6[11]; /* CCh */ u_int32_t host_diag; u_int32_t seq_offset; @@ -2316,6 +2316,8 @@ struct mrsas_ctrl_info { */ #define MR_CAN_HANDLE_SYNC_CACHE_OFFSET 0X01000000 +#define MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET (1 << 24) + /* * FW reports the maximum of number of commands that it can accept (maximum * commands that can be outstanding) at any time. The driver must report a @@ -3366,6 +3368,7 @@ struct mrsas_softc { boolean_t is_ventura; boolean_t is_aero; boolean_t msix_combined; + boolean_t atomic_desc_support; u_int16_t maxRaidMapSize; /* Non dma-able memory. Driver local copy. */ From owner-svn-src-head@freebsd.org Wed Dec 26 10:47:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D5B4134CC81; Wed, 26 Dec 2018 10:47:53 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 D4785756D6; Wed, 26 Dec 2018 10:47:52 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7737227AB; Wed, 26 Dec 2018 10:47:52 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAlqCq041503; Wed, 26 Dec 2018 10:47:52 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAlqU2041502; Wed, 26 Dec 2018 10:47:52 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261047.wBQAlqU2041502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342539 - head/sys/dev/mrsas X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mrsas X-SVN-Commit-Revision: 342539 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4785756D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:47:53 -0000 Author: kadesai Date: Wed Dec 26 10:47:52 2018 New Revision: 342539 URL: https://svnweb.freebsd.org/changeset/base/342539 Log: Problem statement: Due to hardware errata in Aero controllers, reads to certain fusion registers could intermittently return all zeroes. This behavior is transient in nature and subsequent reads will return valid value. Fix: For Aero controllers, any read will retry the read operations from certain registers for maximum three times, if read returns zero. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Wed Dec 26 10:47:08 2018 (r342538) +++ head/sys/dev/mrsas/mrsas.c Wed Dec 26 10:47:52 2018 (r342539) @@ -95,6 +95,8 @@ mrsas_get_pd_info(struct mrsas_softc *sc, u_int16_t de static struct mrsas_softc * mrsas_get_softc_instance(struct cdev *dev, u_long cmd, caddr_t arg); +u_int32_t +mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset); u_int32_t mrsas_read_reg(struct mrsas_softc *sc, int offset); u_int8_t mrsas_build_mptmfi_passthru(struct mrsas_softc *sc, @@ -272,6 +274,22 @@ mrsas_write(struct cdev *dev, struct uio *uio, int iof return (0); } +u_int32_t +mrsas_read_reg_with_retries(struct mrsas_softc *sc, int offset) +{ + u_int32_t i = 0, ret_val; + + if (sc->is_aero) { + do { + ret_val = mrsas_read_reg(sc, offset); + i++; + } while(ret_val == 0 && i < 3); + } else + ret_val = mrsas_read_reg(sc, offset); + + return ret_val; +} + /* * Register Read/Write Functions * @@ -332,7 +350,7 @@ mrsas_clear_intr(struct mrsas_softc *sc) u_int32_t status; /* Read received interrupt */ - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); + status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_intr_status)); /* Not our interrupt, so just return */ if (!(status & MFI_FUSION_ENABLE_INTERRUPT_MASK)) @@ -2314,7 +2332,7 @@ mrsas_init_fw(struct mrsas_softc *sc) return (ret); } if (sc->is_ventura || sc->is_aero) { - scratch_pad_3 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); + scratch_pad_3 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_3)); #if VD_EXT_DEBUG device_printf(sc->mrsas_dev, "scratch_pad_3 0x%x\n", scratch_pad_3); #endif @@ -2325,10 +2343,10 @@ mrsas_init_fw(struct mrsas_softc *sc) /* MSI-x index 0- reply post host index register */ sc->msix_reg_offset[0] = MPI2_REPLY_POST_HOST_INDEX_OFFSET; /* Check if MSI-X is supported while in ready state */ - msix_enable = (mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & 0x4000000) >> 0x1a; + msix_enable = (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & 0x4000000) >> 0x1a; if (msix_enable) { - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* Check max MSI-X vectors */ @@ -2388,7 +2406,7 @@ mrsas_init_fw(struct mrsas_softc *sc) } if (sc->is_ventura || sc->is_aero) { - scratch_pad_4 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_4 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_4)); if ((scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK) >= MR_DEFAULT_NVME_PAGE_SHIFT) sc->nvme_page_size = 1 << (scratch_pad_4 & MR_NVME_PAGE_SIZE_MASK); @@ -2529,7 +2547,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) int i = 0; /* Read FW status register */ - status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); sc->max_fw_cmds = status & MRSAS_FWSTATE_MAXCMD_MASK; @@ -2544,7 +2562,7 @@ mrsas_init_adapter(struct mrsas_softc *sc) sc->reply_alloc_sz = sizeof(MPI2_REPLY_DESCRIPTORS_UNION) * (sc->reply_q_depth); sc->io_frames_alloc_sz = MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE + (MRSAS_MPI2_RAID_DEFAULT_IO_FRAME_SIZE * (sc->max_fw_cmds + 1)); - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); /* * If scratch_pad_2 & MEGASAS_MAX_CHAIN_SIZE_UNITS_MASK is set, @@ -2682,7 +2700,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) } if (!sc->block_sync_cache) { - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); sc->fw_sync_cache_support = (scratch_pad_2 & MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0; @@ -2758,7 +2776,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) } if (sc->is_aero) { - scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + scratch_pad_2 = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad_2)); sc->atomic_desc_support = (scratch_pad_2 & MR_ATOMIC_DESCRIPTOR_SUPPORT_OFFSET) ? 1 : 0; @@ -2920,7 +2938,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int u_int32_t cur_state; u_int32_t abs_state, curr_abs_state; - val = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + val = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = val & MFI_STATE_MASK; max_wait = MRSAS_RESET_WAIT_TIME; @@ -2928,7 +2946,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int device_printf(sc->mrsas_dev, "Waiting for FW to come to ready state\n"); while (fw_state != MFI_STATE_READY) { - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); switch (fw_state) { case MFI_STATE_FAULT: device_printf(sc->mrsas_dev, "FW is in FAULT state!!\n"); @@ -2956,7 +2974,7 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int mrsas_disable_intr(sc); mrsas_write_reg(sc, offsetof(mrsas_reg_set, doorbell), MFI_RESET_FLAGS); for (i = 0; i < max_wait * 1000; i++) { - if (mrsas_read_reg(sc, offsetof(mrsas_reg_set, doorbell)) & 1) + if (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, doorbell)) & 1) DELAY(1000); else break; @@ -2994,9 +3012,9 @@ mrsas_transition_to_ready(struct mrsas_softc *sc, int * The cur_state should not last for more than max_wait secs */ for (i = 0; i < (max_wait * 1000); i++) { - fw_state = (mrsas_read_reg(sc, offsetof(mrsas_reg_set, + fw_state = (mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK); - curr_abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + curr_abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); if (abs_state == curr_abs_state) DELAY(1000); @@ -3071,7 +3089,7 @@ mrsas_ocr_thread(void *arg) "Hardware critical error", __func__); break; } - fw_status = mrsas_read_reg(sc, + fw_status = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = fw_status & MFI_STATE_MASK; if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset || @@ -3230,7 +3248,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese mtx_lock(&sc->sim_lock); - status_reg = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + status_reg = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); abs_state = status_reg & MFI_STATE_MASK; reset_adapter = status_reg & MFI_RESET_ADAPTER; @@ -3260,12 +3278,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese MPI2_WRSEQ_6TH_KEY_VALUE); /* Check that the diag write enable (DRWE) bit is on */ - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); retry = 0; while (!(host_diag & HOST_DIAG_WRITE_ENABLE)) { DELAY(100 * 1000); - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); if (retry++ == 100) { mrsas_dprint(sc, MRSAS_OCR, @@ -3282,12 +3300,12 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese DELAY(3000 * 1000); /* Make sure reset adapter bit is cleared */ - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); retry = 0; while (host_diag & HOST_DIAG_RESET_ADAPTER) { DELAY(100 * 1000); - host_diag = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + host_diag = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, fusion_host_diag)); if (retry++ == 1000) { mrsas_dprint(sc, MRSAS_OCR, @@ -3298,13 +3316,13 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t rese if (host_diag & HOST_DIAG_RESET_ADAPTER) continue; - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; retry = 0; while ((abs_state <= MFI_STATE_FW_INIT) && (retry++ < 1000)) { DELAY(100 * 1000); - abs_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + abs_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; } if (abs_state <= MFI_STATE_FW_INIT) { @@ -3479,7 +3497,7 @@ mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_i goto out; } /* Check if firmware is in fault state */ - fw_state = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + fw_state = mrsas_read_reg_with_retries(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)) & MFI_STATE_MASK; if (fw_state == MFI_STATE_FAULT) { mrsas_dprint(sc, MRSAS_OCR, From owner-svn-src-head@freebsd.org Wed Dec 26 10:48:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29746134CD28; Wed, 26 Dec 2018 10:48:40 +0000 (UTC) (envelope-from kadesai@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) server-signature RSA-PSS (4096 bits) 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 C03EB7584A; Wed, 26 Dec 2018 10:48:39 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2F1F227AD; Wed, 26 Dec 2018 10:48:39 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQAmdYK041580; Wed, 26 Dec 2018 10:48:39 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQAmdc1041579; Wed, 26 Dec 2018 10:48:39 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201812261048.wBQAmdc1041579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Wed, 26 Dec 2018 10:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342540 - head/sys/dev/mrsas X-SVN-Group: head X-SVN-Commit-Author: kadesai X-SVN-Commit-Paths: head/sys/dev/mrsas X-SVN-Commit-Revision: 342540 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C03EB7584A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 10:48:40 -0000 Author: kadesai Date: Wed Dec 26 10:48:39 2018 New Revision: 342540 URL: https://svnweb.freebsd.org/changeset/base/342540 Log: Driver version upgrade. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai Approved by: ken MFC after: 3 days Sponsored by: Broadcom Inc Modified: head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Wed Dec 26 10:47:52 2018 (r342539) +++ head/sys/dev/mrsas/mrsas.h Wed Dec 26 10:48:39 2018 (r342540) @@ -119,7 +119,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "07.708.02.00-fbsd" +#define MRSAS_VERSION "07.709.01.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 From owner-svn-src-head@freebsd.org Wed Dec 26 11:03:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DFAA134D6BB; Wed, 26 Dec 2018 11:03:15 +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) server-signature RSA-PSS (4096 bits) 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 3AD687627E; Wed, 26 Dec 2018 11:03:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24A6922B04; Wed, 26 Dec 2018 11:03:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBQB3E7t051711; Wed, 26 Dec 2018 11:03:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQB3EJO051708; Wed, 26 Dec 2018 11:03:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201812261103.wBQB3EJO051708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 26 Dec 2018 11:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342541 - in head: cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/sys/fs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zpool sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/sys/fs X-SVN-Commit-Revision: 342541 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3AD687627E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.984,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 11:03:15 -0000 Author: avg Date: Wed Dec 26 11:03:14 2018 New Revision: 342541 URL: https://svnweb.freebsd.org/changeset/base/342541 Log: MFV r342532: 5882 Temporary pool names Note that this commit brings only formatting changes that were done during the final review of the illumos change, because FreeBSD got the main changes before illumos. illumos/illumos-gate@04e56356520b98d5a93c496b10f02530bb6647e0 https://github.com/illumos/illumos-gate/commit/04e56356520b98d5a93c496b10f02530bb6647e0 https://www.illumos.org/issues/5882 This is an import of the temporary pool names functionality from ZoL: https://github.com/zfsonlinux/zfs/commit/e2282ef57edc79cdce2a4b9b7e3333c56494a807 https://github.com/zfsonlinux/zfs/commit/26b42f3f9d03f85cc7966dc2fe4dfe9216601b0e https://github.com/zfsonlinux/zfs/commit/2f3ec9006146844af6763d1fa4e823fd9047fd54 https://github.com/zfsonlinux/zfs/commit/00d2a8c92f614f49d23dea5d73f7ea7eb489ccf1 https://github.com/zfsonlinux/zfs/commit/83e9986f6eefdf0afc387f06407087bba3ead4e9 https://github.com/zfsonlinux/zfs/commit/023bbe6f017380f4a04c5060feb24dd8cdda9fce It is intended to assist the creation and management of virtual machines that have their rootfs on ZFS on hosts that also have their rootfs on ZFS. These situations cause SPA namespace collisions when the standard name rpool is used in both cases. The solution is either to give each guest pool a name unique to the host, which is not always desireable, or boot a VM environment containing an ISO image to install it, which is cumbersome. MFC after: 1 week Sponsored by: Panzura Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Dec 26 10:48:39 2018 (r342540) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Wed Dec 26 11:03:14 2018 (r342541) @@ -1273,7 +1273,7 @@ badusage: /* * zpool destroy * - * -f Forcefully unmount any datasets + * -f Forcefully unmount any datasets * * Destroy the given pool. Automatically unmounts any datasets in the pool. */ @@ -2165,8 +2165,8 @@ do_import(nvlist_t *config, const char *newname, const * zpool checkpoint * checkpoint --discard * - * -d Discard the checkpoint from a checkpointed - * --discard pool. + * -d Discard the checkpoint from a checkpointed + * --discard pool. * * Checkpoints the specified pool, by taking a "snapshot" of its * current state. A pool can only have one checkpoint at a time. @@ -2242,45 +2242,45 @@ zpool_do_checkpoint(int argc, char **argv) * [-d dir | -c cachefile] [-f] [-n] [-F] [-t] * [newpool] * - * -c Read pool information from a cachefile instead of searching + * -c Read pool information from a cachefile instead of searching * devices. * - * -d Scan in a specific directory, other than /dev/dsk. More than + * -d Scan in a specific directory, other than /dev/dsk. More than * one directory can be specified using multiple '-d' options. * - * -D Scan for previously destroyed pools or import all or only - * specified destroyed pools. + * -D Scan for previously destroyed pools or import all or only + * specified destroyed pools. * - * -R Temporarily import the pool, with all mountpoints relative to + * -R Temporarily import the pool, with all mountpoints relative to * the given root. The pool will remain exported when the machine * is rebooted. * - * -V Import even in the presence of faulted vdevs. This is an - * intentionally undocumented option for testing purposes, and - * treats the pool configuration as complete, leaving any bad + * -V Import even in the presence of faulted vdevs. This is an + * intentionally undocumented option for testing purposes, and + * treats the pool configuration as complete, leaving any bad * vdevs in the FAULTED state. In other words, it does verbatim * import. * - * -f Force import, even if it appears that the pool is active. + * -f Force import, even if it appears that the pool is active. * - * -F Attempt rewind if necessary. + * -F Attempt rewind if necessary. * - * -n See if rewind would work, but don't actually rewind. + * -n See if rewind would work, but don't actually rewind. * - * -N Import the pool but don't mount datasets. + * -N Import the pool but don't mount datasets. * - * -t Use newpool as a temporary pool name instead of renaming - * the pool. + * -t Use newpool as a temporary pool name instead of renaming + * the pool. * - * -T Specify a starting txg to use for import. This option is - * intentionally undocumented option for testing purposes. + * -T Specify a starting txg to use for import. This option is + * intentionally undocumented option for testing purposes. * - * -a Import all pools found. + * -a Import all pools found. * - * -o Set property=value and/or temporary mount options (without '='). + * -o Set property=value and/or temporary mount options (without '='). * - * --rewind-to-checkpoint - * Import the pool and revert back to the checkpoint. + * --rewind-to-checkpoint + * Import the pool and revert back to the checkpoint. * * The import command scans for pools to import, and import pools based on pool * name and GUID. The pool can also be renamed as part of the import process. @@ -3440,7 +3440,7 @@ list_callback(zpool_handle_t *zhp, void *data) * -o List of properties to display. Defaults to * "name,size,allocated,free,expandsize,fragmentation,capacity," * "dedupratio,health,altroot" - * -p Diplay values in parsable (exact) format. + * -p Diplay values in parsable (exact) format. * -T Display a timestamp in date(1) or Unix format * * List all pools in the system, whether or not they're healthy. Output space @@ -6083,7 +6083,7 @@ get_callback(zpool_handle_t *zhp, void *data) * by a single tab. * -o List of columns to display. Defaults to * "name,property,value,source". - * -p Diplay values in parsable (exact) format. + * -p Diplay values in parsable (exact) format. * * Get properties of pools in the system. Output space statistics * for each one as well as other attributes. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Wed Dec 26 10:48:39 2018 (r342540) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Wed Dec 26 11:03:14 2018 (r342541) @@ -276,8 +276,8 @@ spa_write_cachefile(spa_t *target, boolean_t removing, nvl = fnvlist_alloc(); if (spa->spa_import_flags & ZFS_IMPORT_TEMP_NAME) { - pool_name = fnvlist_lookup_string(spa->spa_config, - ZPOOL_CONFIG_POOL_NAME); + pool_name = fnvlist_lookup_string( + spa->spa_config, ZPOOL_CONFIG_POOL_NAME); } else { pool_name = spa_name(spa); } @@ -419,7 +419,7 @@ spa_config_generate(spa_t *spa, vdev_t *vd, uint64_t t */ if (spa->spa_import_flags & ZFS_IMPORT_TEMP_NAME) { pool_name = fnvlist_lookup_string(spa->spa_config, - ZPOOL_CONFIG_POOL_NAME); + ZPOOL_CONFIG_POOL_NAME); } else { pool_name = spa_name(spa); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed Dec 26 10:48:39 2018 (r342540) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Wed Dec 26 11:03:14 2018 (r342541) @@ -891,7 +891,7 @@ typedef struct vdev_stat { * is passed between kernel and userland as an nvlist uint64 array. */ typedef struct ddt_object { - uint64_t ddo_count; /* number of elments in ddt */ + uint64_t ddo_count; /* number of elments in ddt */ uint64_t ddo_dspace; /* size of ddt on disk */ uint64_t ddo_mspace; /* size of ddt in-core */ } ddt_object_t; From owner-svn-src-head@freebsd.org Wed Dec 26 23:41:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0908A1360278; Wed, 26 Dec 2018 23:41:54 +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) server-signature RSA-PSS (4096 bits) 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 A365272653; Wed, 26 Dec 2018 23:41: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 41DD02C05; Wed, 26 Dec 2018 23:41: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 wBQNfr53061545; Wed, 26 Dec 2018 23:41:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBQNfrxE061544; Wed, 26 Dec 2018 23:41:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201812262341.wBQNfrxE061544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 26 Dec 2018 23:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342546 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 342546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A365272653 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2018 23:41:54 -0000 Author: mav Date: Wed Dec 26 23:41:52 2018 New Revision: 342546 URL: https://svnweb.freebsd.org/changeset/base/342546 Log: Add descriptions to NVMe interrupts. MFC after: 1 month Modified: head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Wed Dec 26 12:56:36 2018 (r342545) +++ head/sys/dev/nvme/nvme_qpair.c Wed Dec 26 23:41:52 2018 (r342546) @@ -561,6 +561,13 @@ nvme_qpair_construct(struct nvme_qpair *qpair, uint32_ bus_setup_intr(ctrlr->dev, qpair->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, nvme_qpair_msix_handler, qpair, &qpair->tag); + if (id == 0) { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "admin"); + } else { + bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, + "io%d", id - 1); + } } mtx_init(&qpair->lock, "nvme qpair lock", NULL, MTX_DEF); From owner-svn-src-head@freebsd.org Thu Dec 27 04:53:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65F611349948; Thu, 27 Dec 2018 04:53:54 +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) server-signature RSA-PSS (4096 bits) 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 03DCF87585; Thu, 27 Dec 2018 04:53:54 +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 E9B4B695B; Thu, 27 Dec 2018 04:53:53 +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 wBR4rrHm025948; Thu, 27 Dec 2018 04:53:53 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBR4rrw1025947; Thu, 27 Dec 2018 04:53:53 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812270453.wBR4rrw1025947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 27 Dec 2018 04:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342547 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03DCF87585 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 04:53:54 -0000 Author: cy Date: Thu Dec 27 04:53:53 2018 New Revision: 342547 URL: https://svnweb.freebsd.org/changeset/base/342547 Log: Remove another empty #ifdef block. This empty block also exists in the upstream HEAD. MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/fil.c Modified: head/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/fil.c Wed Dec 26 23:41:52 2018 (r342546) +++ head/sys/contrib/ipfilter/netinet/fil.c Thu Dec 27 04:53:53 2018 (r342547) @@ -4266,8 +4266,6 @@ copyoutptr(softc, src, dst, size) } return error; } -#ifdef _KERNEL -#endif /* ------------------------------------------------------------------------ */ From owner-svn-src-head@freebsd.org Thu Dec 27 07:18:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A953134F921; Thu, 27 Dec 2018 07:18:55 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 EEEAA8C314; Thu, 27 Dec 2018 07:18:54 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4A6280B4; Thu, 27 Dec 2018 07:18:54 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBR7IsVE099301; Thu, 27 Dec 2018 07:18:54 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBR7Irve099297; Thu, 27 Dec 2018 07:18:53 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201812270718.wBR7Irve099297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 27 Dec 2018 07:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342548 - in head/sys: fs/ext2fs kern ufs/ffs ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys: fs/ext2fs kern ufs/ffs ufs/ufs X-SVN-Commit-Revision: 342548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EEEAA8C314 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 07:18:55 -0000 Author: mckusick Date: Thu Dec 27 07:18:53 2018 New Revision: 342548 URL: https://svnweb.freebsd.org/changeset/base/342548 Log: When loading an inode from disk, verify that its mode is valid. If invalid, return EINVAL. Note that inode check-hashes greatly reduce the chance that these errors will go undetected. Reported by: Christopher Krah Reported as: FS-5-UFS-2: Denial Of Service in nmount-3 (ffs_read) Reviewed by: kib MFC after: 1 week Sponsored by: Netflix M sys/fs/ext2fs/ext2_vnops.c M sys/kern/vfs_subr.c M sys/ufs/ffs/ffs_snapshot.c M sys/ufs/ufs/ufs_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c head/sys/kern/vfs_subr.c head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Thu Dec 27 04:53:53 2018 (r342547) +++ head/sys/fs/ext2fs/ext2_vnops.c Thu Dec 27 07:18:53 2018 (r342548) @@ -1920,6 +1920,11 @@ ext2_vinit(struct mount *mntp, struct vop_vector *fifo vp = *vpp; ip = VTOI(vp); vp->v_type = IFTOVT(ip->i_mode); + /* + * Only unallocated inodes should be of type VNON. + */ + if (ip->i_mode != 0 && vp->v_type == VNON) + return (EINVAL); if (vp->v_type == VFIFO) vp->v_op = fifoops; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Thu Dec 27 04:53:53 2018 (r342547) +++ head/sys/kern/vfs_subr.c Thu Dec 27 07:18:53 2018 (r342548) @@ -156,7 +156,7 @@ SYSCTL_ULONG(_vfs, OID_AUTO, mnt_free_list_batch, CTLF */ enum vtype iftovt_tab[16] = { VNON, VFIFO, VCHR, VNON, VDIR, VNON, VBLK, VNON, - VREG, VNON, VLNK, VNON, VSOCK, VNON, VNON, VBAD, + VREG, VNON, VLNK, VNON, VSOCK, VNON, VNON, VNON }; int vttoif_tab[10] = { 0, S_IFREG, S_IFDIR, S_IFBLK, S_IFCHR, S_IFLNK, Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Thu Dec 27 04:53:53 2018 (r342547) +++ head/sys/ufs/ffs/ffs_snapshot.c Thu Dec 27 07:18:53 2018 (r342548) @@ -2001,15 +2001,19 @@ ffs_snapshot_mount(mp) continue; } ip = VTOI(vp); - if (!IS_SNAPSHOT(ip) || ip->i_size == + if (vp->v_type != VREG) { + reason = "non-file snapshot"; + } else if (!IS_SNAPSHOT(ip)) { + reason = "non-snapshot"; + } else if (ip->i_size == lblktosize(fs, howmany(fs->fs_size, fs->fs_frag))) { - if (!IS_SNAPSHOT(ip)) { - reason = "non-snapshot"; - } else { - reason = "old format snapshot"; - (void)ffs_truncate(vp, (off_t)0, 0, NOCRED); - (void)ffs_syncvnode(vp, MNT_WAIT, 0); - } + reason = "old format snapshot"; + (void)ffs_truncate(vp, (off_t)0, 0, NOCRED); + (void)ffs_syncvnode(vp, MNT_WAIT, 0); + } else { + reason = NULL; + } + if (reason != NULL) { printf("ffs_snapshot_mount: %s inode %d\n", reason, fs->fs_snapinum[snaploc]); vput(vp); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Thu Dec 27 04:53:53 2018 (r342547) +++ head/sys/ufs/ufs/ufs_vnops.c Thu Dec 27 07:18:53 2018 (r342548) @@ -2517,6 +2517,11 @@ ufs_vinit(mntp, fifoops, vpp) vp = *vpp; ip = VTOI(vp); vp->v_type = IFTOVT(ip->i_mode); + /* + * Only unallocated inodes should be of type VNON. + */ + if (ip->i_mode != 0 && vp->v_type == VNON) + return (EINVAL); if (vp->v_type == VFIFO) vp->v_op = fifoops; ASSERT_VOP_LOCKED(vp, "ufs_vinit"); From owner-svn-src-head@freebsd.org Thu Dec 27 08:29:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB75713515D2; Thu, 27 Dec 2018 08:29:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 6ED818E0A0; Thu, 27 Dec 2018 08:29:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 598AF8C6F; Thu, 27 Dec 2018 08:29: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 wBR8T629035796; Thu, 27 Dec 2018 08:29:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBR8T6DD035794; Thu, 27 Dec 2018 08:29:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201812270829.wBR8T6DD035794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 27 Dec 2018 08:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342549 - in head/sys/dev/usb: . quirk X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . quirk X-SVN-Commit-Revision: 342549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6ED818E0A0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 08:29:07 -0000 Author: hselasky Date: Thu Dec 27 08:29:05 2018 New Revision: 342549 URL: https://svnweb.freebsd.org/changeset/base/342549 Log: Add USB quirk for SPL Crimson Rev 1. PR: 234380 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/quirk/usb_quirk.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Thu Dec 27 07:18:53 2018 (r342548) +++ head/sys/dev/usb/quirk/usb_quirk.c Thu Dec 27 08:29:05 2018 (r342549) @@ -526,6 +526,7 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(MAUDIO, FASTTRACKULTRA, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(MAUDIO, FASTTRACKULTRA8R, 0x0000, 0xffff, UQ_AU_VENDOR_CLASS), USB_QUIRK(CMEDIA, CM6206, 0x0000, 0xffff, UQ_AU_SET_SPDIF_CM6206), + USB_QUIRK(PLOYTEC, SPL_CRIMSON_1, 0x0000, 0xffff, UQ_CFG_INDEX_1), /* * Quirks for manufacturers which USB devices does not respond Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Dec 27 07:18:53 2018 (r342548) +++ head/sys/dev/usb/usbdevs Thu Dec 27 08:29:05 2018 (r342549) @@ -498,6 +498,7 @@ vendor ASAHIOPTICAL 0x0a17 Asahi Optical vendor BOCASYSTEMS 0x0a43 Boca Systems vendor SHANTOU 0x0a46 ShanTou vendor MEDIAGEAR 0x0a48 MediaGear +vendor PLOYTEC 0x0a4a Ploytec GmbH vendor BROADCOM 0x0a5c Broadcom vendor GREENHOUSE 0x0a6b GREENHOUSE vendor MEDELI 0x0a67 Medeli @@ -3692,6 +3693,9 @@ product PLANEX2 GWUSNANO 0xab28 GW-USNano /* Plextor Corp. */ product PLEXTOR 40_12_40U 0x0011 PlexWriter 40/12/40U + +/* Ploytec GmbH */ +product PLOYTEC SPL_CRIMSON_1 0xc150 SPL Crimson Revision 1 /* PLX products */ product PLX TESTBOARD 0x9060 test board From owner-svn-src-head@freebsd.org Thu Dec 27 08:48:55 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC1121351E0F; Thu, 27 Dec 2018 08:48:55 +0000 (UTC) (envelope-from danfe@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) server-signature RSA-PSS (4096 bits) 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 12E658EB02; Thu, 27 Dec 2018 08:48:55 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 006F58FEB; Thu, 27 Dec 2018 08:48:54 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBR8msKk046563; Thu, 27 Dec 2018 08:48:54 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBR8msE0046562; Thu, 27 Dec 2018 08:48:54 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201812270848.wBR8msE0046562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Thu, 27 Dec 2018 08:48:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342550 - head/usr.sbin/acpi/acpiconf X-SVN-Group: head X-SVN-Commit-Author: danfe X-SVN-Commit-Paths: head/usr.sbin/acpi/acpiconf X-SVN-Commit-Revision: 342550 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 12E658EB02 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 08:48:55 -0000 Author: danfe (ports committer) Date: Thu Dec 27 08:48:54 2018 New Revision: 342550 URL: https://svnweb.freebsd.org/changeset/base/342550 Log: Amend the `-i batt' option description and explain that the battery is specified by its number (index), starting with zero. Previously, sometimes users would try to literally invoke `acpiconf -i batt' in their console and become confused as to why this did not work. Approved by: bcr (manpages) Differential Revision: https://reviews.freebsd.org/D18659 Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 Modified: head/usr.sbin/acpi/acpiconf/acpiconf.8 ============================================================================== --- head/usr.sbin/acpi/acpiconf/acpiconf.8 Thu Dec 27 08:29:05 2018 (r342549) +++ head/usr.sbin/acpi/acpiconf/acpiconf.8 Thu Dec 27 08:48:54 2018 (r342550) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2018 +.Dd December 27, 2018 .Dt ACPICONF 8 .Os .Sh NAME @@ -49,7 +49,9 @@ The following command-line options are recognized: .It Fl h Displays a summary of available options. .It Fl i Ar batt -Get design information about the specified battery. +Get design information and current status of the battery specified +by its number, starting with +.Cm 0 . .It Fl k Ar ack Ack or abort a pending suspend request using the argument provided. .Sy Most users should not use this option directly. From owner-svn-src-head@freebsd.org Thu Dec 27 13:02:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51379135E779; Thu, 27 Dec 2018 13:02:17 +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) server-signature RSA-PSS (4096 bits) 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 E68CF72908; Thu, 27 Dec 2018 13:02:16 +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 AE9C0BE5B; Thu, 27 Dec 2018 13:02:16 +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 wBRD2G0W085001; Thu, 27 Dec 2018 13:02:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBRD2GjU084998; Thu, 27 Dec 2018 13:02:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812271302.wBRD2GjU084998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 27 Dec 2018 13:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342551 - in head/lib/libc: gen include string X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/lib/libc: gen include string X-SVN-Commit-Revision: 342551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E68CF72908 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 13:02:17 -0000 Author: kib Date: Thu Dec 27 13:02:15 2018 New Revision: 342551 URL: https://svnweb.freebsd.org/changeset/base/342551 Log: Bump sys_errlist size to keep ABI backward-compatible for some time. Addition of the new errno values requires adding new elements to sys_errlist array, which is actually ABI-incompatible, since ELF records the object size. Expand array in advance to 150 elements so that we have our users to go over the issue only once, at least until more than 53 new errors are added. I did not bumped the symbol version, same as it was not done for previous increases of the array size. Runtime linker only copies as much data into binary object on copy relocation as the binary'object specifies. This is not fixable for binaries which access sys_errlist directly. While there, correct comment and calculation of the temporary buffer size for the message printed for unknown error. The on-stack buffer is used only for the number and delimiter since r108603. Requested by: mckusick Reviewed by: mckusick, yuripv MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18656 Modified: head/lib/libc/gen/errlst.c head/lib/libc/include/errlst.h head/lib/libc/string/strerror.c Modified: head/lib/libc/gen/errlst.c ============================================================================== --- head/lib/libc/gen/errlst.c Thu Dec 27 08:48:54 2018 (r342550) +++ head/lib/libc/gen/errlst.c Thu Dec 27 13:02:15 2018 (r342551) @@ -33,9 +33,12 @@ __SCCSID("@(#)errlst.c 8.2 (Berkeley) 11/16/93"); __FBSDID("$FreeBSD$"); +#include #include #include "errlst.h" +const char __uprefix[] = "Unknown error"; + const char *const sys_errlist[] = { "No error: 0", /* 0 - ENOERROR */ "Operation not permitted", /* 1 - EPERM */ @@ -155,8 +158,67 @@ const char *const sys_errlist[] = { "Not permitted in capability mode", /* 94 - ECAPMODE */ "State not recoverable", /* 95 - ENOTRECOVERABLE */ "Previous owner died", /* 96 - EOWNERDEAD */ + +/* + * Reserved space in sys_errlist, take the next slot for a next error code. + * Reserve prevents the array size from changing for some time. + */ + __uprefix, /* 97 */ + __uprefix, /* 98 */ + __uprefix, /* 99 */ + __uprefix, /* 100 */ + __uprefix, /* 101 */ + __uprefix, /* 102 */ + __uprefix, /* 103 */ + __uprefix, /* 104 */ + __uprefix, /* 105 */ + __uprefix, /* 106 */ + __uprefix, /* 107 */ + __uprefix, /* 108 */ + __uprefix, /* 109 */ + __uprefix, /* 110 */ + __uprefix, /* 111 */ + __uprefix, /* 112 */ + __uprefix, /* 113 */ + __uprefix, /* 114 */ + __uprefix, /* 115 */ + __uprefix, /* 116 */ + __uprefix, /* 117 */ + __uprefix, /* 118 */ + __uprefix, /* 119 */ + __uprefix, /* 120 */ + __uprefix, /* 121 */ + __uprefix, /* 122 */ + __uprefix, /* 123 */ + __uprefix, /* 124 */ + __uprefix, /* 125 */ + __uprefix, /* 126 */ + __uprefix, /* 127 */ + __uprefix, /* 128 */ + __uprefix, /* 129 */ + __uprefix, /* 130 */ + __uprefix, /* 131 */ + __uprefix, /* 132 */ + __uprefix, /* 133 */ + __uprefix, /* 134 */ + __uprefix, /* 135 */ + __uprefix, /* 136 */ + __uprefix, /* 137 */ + __uprefix, /* 138 */ + __uprefix, /* 139 */ + __uprefix, /* 140 */ + __uprefix, /* 141 */ + __uprefix, /* 142 */ + __uprefix, /* 143 */ + __uprefix, /* 144 */ + __uprefix, /* 145 */ + __uprefix, /* 146 */ + __uprefix, /* 147 */ + __uprefix, /* 148 */ + __uprefix, /* 149 */ + __uprefix, /* 150 */ }; -const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); +const int sys_nerr = ELAST + 1; #ifdef PIC __strong_reference(sys_errlist, __hidden_sys_errlist); Modified: head/lib/libc/include/errlst.h ============================================================================== --- head/lib/libc/include/errlst.h Thu Dec 27 08:48:54 2018 (r342550) +++ head/lib/libc/include/errlst.h Thu Dec 27 13:02:15 2018 (r342551) @@ -42,4 +42,6 @@ extern const int __hidden_sys_nerr __hidden; #define __hidden_sys_nerr sys_nerr #endif +extern const char __uprefix[] __hidden; + #endif /* __ERRLST_H__ */ Modified: head/lib/libc/string/strerror.c ============================================================================== --- head/lib/libc/string/strerror.c Thu Dec 27 08:48:54 2018 (r342550) +++ head/lib/libc/string/strerror.c Thu Dec 27 13:02:15 2018 (r342551) @@ -46,15 +46,12 @@ __FBSDID("$FreeBSD$"); #include "errlst.h" -#define UPREFIX "Unknown error" - /* - * Define a buffer size big enough to describe a 64-bit signed integer - * converted to ASCII decimal (19 bytes), with an optional leading sign - * (1 byte); finally, we get the prefix, delimiter (": ") and a trailing - * NUL from UPREFIX. + * Define buffer big enough to contain delimiter (": ", 2 bytes), + * 64-bit signed integer converted to ASCII decimal (19 bytes) with + * optional leading sign (1 byte), and a trailing NUL. */ -#define EBUFSIZE (20 + 2 + sizeof(UPREFIX)) +#define EBUFSIZE (2 + 19 + 1 + 1) /* * Doing this by hand instead of linking with stdio(3) avoids bloat for @@ -94,9 +91,9 @@ strerror_r(int errnum, char *strerrbuf, size_t buflen) if (errnum < 0 || errnum >= __hidden_sys_nerr) { errstr(errnum, #if defined(NLS) - catgets(catd, 1, 0xffff, UPREFIX), + catgets(catd, 1, 0xffff, __uprefix), #else - UPREFIX, + __uprefix, #endif strerrbuf, buflen); retval = EINVAL; From owner-svn-src-head@freebsd.org Thu Dec 27 14:14:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B4371360827; Thu, 27 Dec 2018 14:14:42 +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) server-signature RSA-PSS (4096 bits) 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 0C9E27587F; Thu, 27 Dec 2018 14:14:42 +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 0004ECB85; Thu, 27 Dec 2018 14:14: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 wBREEfwe022471; Thu, 27 Dec 2018 14:14:41 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBREEfCG022470; Thu, 27 Dec 2018 14:14:41 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201812271414.wBREEfCG022470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 27 Dec 2018 14:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342552 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 342552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0C9E27587F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 14:14:42 -0000 Author: andrew Date: Thu Dec 27 14:14:41 2018 New Revision: 342552 URL: https://svnweb.freebsd.org/changeset/base/342552 Log: Pass VM_PROT_EXECUTE to vm_fault for instruction faults. We need to tell vm_fault the reason for the fault was because we tried to execute from the memory location. Without this it may return with success as we only request read-only memory, then we return to the same location and try to execute from the same memory address. This leads to an infinite loop raising the same fault and returning to the same invalid location. MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18511 Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Thu Dec 27 13:02:15 2018 (r342551) +++ head/sys/arm64/arm64/trap.c Thu Dec 27 14:14:41 2018 (r342552) @@ -149,7 +149,7 @@ svc_handler(struct thread *td, struct trapframe *frame static void data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, - uint64_t far, int lower) + uint64_t far, int lower, int exec) { struct vm_map *map; struct proc *p; @@ -229,6 +229,8 @@ no_pmap_fault: va = trunc_page(far); ftype = ((esr >> 6) & 1) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ; + if (exec) + ftype |= VM_PROT_EXECUTE; /* Fault in the page. */ error = vm_fault(map, va, ftype, VM_FAULT_NORMAL); @@ -336,7 +338,8 @@ do_el1h_sync(struct thread *td, struct trapframe *fram case EXCP_DATA_ABORT: far = READ_SPECIALREG(far_el1); intr_enable(); - data_abort(td, frame, esr, far, 0); + data_abort(td, frame, esr, far, 0, + exception == EXCP_INSN_ABORT); break; case EXCP_BRK: #ifdef KDTRACE_HOOKS @@ -433,7 +436,8 @@ do_el0_sync(struct thread *td, struct trapframe *frame case EXCP_INSN_ABORT_L: case EXCP_DATA_ABORT_L: case EXCP_DATA_ABORT: - data_abort(td, frame, esr, far, 1); + data_abort(td, frame, esr, far, 1, + exception == EXCP_INSN_ABORT_L); break; case EXCP_UNKNOWN: if (!undef_insn(0, frame)) From owner-svn-src-head@freebsd.org Thu Dec 27 14:44:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75774136163C; Thu, 27 Dec 2018 14:44:02 +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) server-signature RSA-PSS (4096 bits) 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 1782C76CAF; Thu, 27 Dec 2018 14:44:02 +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 0BD9FD0D6; Thu, 27 Dec 2018 14:44:02 +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 wBREi101038064; Thu, 27 Dec 2018 14:44:01 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBREi1C6038063; Thu, 27 Dec 2018 14:44:01 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201812271444.wBREi1C6038063@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: Thu, 27 Dec 2018 14:44:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342553 - head/usr.bin/iscsictl X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/usr.bin/iscsictl X-SVN-Commit-Revision: 342553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1782C76CAF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 14:44:02 -0000 Author: 0mp (ports committer) Date: Thu Dec 27 14:44:01 2018 New Revision: 342553 URL: https://svnweb.freebsd.org/changeset/base/342553 Log: iscsictl.8: Add missing flag parameters - Add missing parameters to flags in the description of available options. - Remove spaces between alternative parameters and "|". - Align descriptions of options to the longest option. - Use em dash instead of a hyphen. Reviewed by: bcr Approved by: doc (bcr) Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18608 Modified: head/usr.bin/iscsictl/iscsictl.8 Modified: head/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- head/usr.bin/iscsictl/iscsictl.8 Thu Dec 27 14:14:41 2018 (r342552) +++ head/usr.bin/iscsictl/iscsictl.8 Thu Dec 27 14:44:01 2018 (r342553) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 6, 2016 +.Dd December 27, 2018 .Dt ISCSICTL 8 .Os .Sh NAME @@ -40,13 +40,13 @@ .Op Fl u Ar user Fl s Ar secret .Op Fl w Ar timeout .Op Fl r -.Op Fl e Cm on | off +.Op Fl e Cm on Ns | Ns Cm off .Nm .Fl A .Fl d Ar discovery-host .Op Fl u Ar user Fl s Ar secret .Op Fl r -.Op Fl e Cm on | off +.Op Fl e Cm on Ns | Ns Cm off .Nm .Fl A .Fl a Op Fl c Ar path @@ -60,7 +60,7 @@ .Op Fl t Ar target .Op Fl u Ar user .Op Fl s Ar secret -.Op Fl e Cm on | off +.Op Fl e Cm on Ns | Ns Cm off .Nm .Fl M .Fl i Ar session-id @@ -85,7 +85,7 @@ The utility is used to configure the iSCSI initiator. .Pp The following options are available: -.Bl -tag -width ".Fl A" +.Bl -tag -width "-d discovery-host" .It Fl -libxo Generate output via .Xr libxo 3 @@ -104,38 +104,40 @@ List sessions. .It Fl a When adding, add all sessions defined in the configuration file. When removing, remove all currently established sessions. -.It Fl c +.It Fl c Ar path Path to the configuration file. The default is .Pa /etc/iscsi.conf . -.It Fl d +.It Fl d Ar discovery-host Target host name or address used for SendTargets discovery. When used, it will add a temporary discovery session. After discovery is done, sessions will be added for each discovered target, and the temporary discovery session will be removed. -.It Fl e +.It Fl e Cm on Ns | Ns Cm off Enable or disable the session. This is ignored for discovery sessions, but gets passed down to normal sessions they add. -.It Fl i +.It Fl i Ar session-id Session ID, as displayed by .Nm .Fl v . -.It Fl n -The "nickname" of session defined in the configuration file. -.It Fl p -Target portal - host name or address - for statically defined targets. +.It Fl n Ar nickname +The +.Ar nickname +of a session defined in the configuration file. +.It Fl p Ar portal +Target portal \(em host name or address \(em for statically defined targets. .It Fl r Use iSER (iSCSI over RDMA) instead of plain iSCSI over TCP/IP. -.It Fl s +.It Fl s Ar secret CHAP secret. -.It Fl t +.It Fl t Ar target Target name. -.It Fl u +.It Fl u Ar user CHAP login. .It Fl v Verbose mode. -.It Fl w +.It Fl w Ar timeout Instead of returning immediately, wait up to .Ar timeout seconds until all configured sessions are successfully established. From owner-svn-src-head@freebsd.org Thu Dec 27 16:50:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7646141A946; Thu, 27 Dec 2018 16:50:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 59F3082E06; Thu, 27 Dec 2018 16:50:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49C17E58E; Thu, 27 Dec 2018 16:50:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBRGoToU001130; Thu, 27 Dec 2018 16:50:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBRGoTin001129; Thu, 27 Dec 2018 16:50:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201812271650.wBRGoTin001129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 27 Dec 2018 16:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342554 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 342554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59F3082E06 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 16:50:29 -0000 Author: emaste Date: Thu Dec 27 16:50:28 2018 New Revision: 342554 URL: https://svnweb.freebsd.org/changeset/base/342554 Log: vnet.9: clarify VNET sponsorship The FreeBSD Foundation and NLnet Foundation sponsored the original work, and the Foundation sponsored followon work and integration efforts by bz@. Sponsored by: The FreeBSD Foundation Modified: head/share/man/man9/vnet.9 Modified: head/share/man/man9/vnet.9 ============================================================================== --- head/share/man/man9/vnet.9 Thu Dec 27 14:44:01 2018 (r342553) +++ head/share/man/man9/vnet.9 Thu Dec 27 16:50:28 2018 (r342554) @@ -506,13 +506,13 @@ The virtual network stack implementation first appeare .An -nosplit The .Nm -framework has been designed and implemented at the University of Zagreb by -.An Marko Zec , +framework was designed and implemented at the University of Zagreb by +.An Marko Zec +under sponsorship of the FreeBSD Foundation and NLnet Foundation, and later extended and refined by .An Bjoern A. Zeeb -and -.An Robert Watson , -under contract to the FreeBSD Foundation. +(also under FreeBSD Foundation sponsorship), and +.An Robert Watson . .Pp This manual page was written by .An Bjoern A. Zeeb, CK Software GmbH, From owner-svn-src-head@freebsd.org Thu Dec 27 18:28:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03DB8141EF09; Thu, 27 Dec 2018 18:28:20 +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) server-signature RSA-PSS (4096 bits) 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 A0219863C2; Thu, 27 Dec 2018 18:28:19 +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 93821F6EE; Thu, 27 Dec 2018 18:28:19 +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 wBRISJJP054434; Thu, 27 Dec 2018 18:28:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBRISJIV054433; Thu, 27 Dec 2018 18:28:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201812271828.wBRISJIV054433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 27 Dec 2018 18:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342557 - head/sys/dev/nvd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvd X-SVN-Commit-Revision: 342557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0219863C2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 18:28:20 -0000 Author: mav Date: Thu Dec 27 18:28:19 2018 New Revision: 342557 URL: https://svnweb.freebsd.org/changeset/base/342557 Log: Reimplement nvd(4) detach handling. Previous code typically crashed in case of NVMe device unplug or even clean detach while some I/Os are still in flight. To fix this the new code calls disk_gone() and waits for confirmation of all references gone before calling disk_destroy(), freeing other resources and allowing controller detach. While there, fix disk lists locking and reimplement unit numbers assignment. MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Dec 27 17:23:01 2018 (r342556) +++ head/sys/dev/nvd/nvd.c Thu Dec 27 18:28:19 2018 (r342557) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2012-2016 Intel Corporation + * Copyright (C) 2018 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,9 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include #include #include @@ -46,15 +49,16 @@ __FBSDID("$FreeBSD$"); #define NVD_STR "nvd" struct nvd_disk; +struct nvd_controller; static disk_ioctl_t nvd_ioctl; static disk_strategy_t nvd_strategy; static dumper_t nvd_dump; static void nvd_done(void *arg, const struct nvme_completion *cpl); +static void nvd_gone(struct nvd_disk *ndisk); static void *nvd_new_disk(struct nvme_namespace *ns, void *ctrlr); -static void destroy_geom_disk(struct nvd_disk *ndisk); static void *nvd_new_controller(struct nvme_controller *ctrlr); static void nvd_controller_fail(void *ctrlr); @@ -67,6 +71,7 @@ MALLOC_DEFINE(M_NVD, "nvd", "nvd(4) allocations"); struct nvme_consumer *consumer_handle; struct nvd_disk { + struct nvd_controller *ctrlr; struct bio_queue_head bioq; struct task bioqtask; @@ -78,6 +83,7 @@ struct nvd_disk { uint32_t cur_depth; uint32_t ordered_in_flight; + u_int unit; TAILQ_ENTRY(nvd_disk) global_tailq; TAILQ_ENTRY(nvd_disk) ctrlr_tailq; @@ -89,6 +95,7 @@ struct nvd_controller { TAILQ_HEAD(, nvd_disk) disk_head; }; +static struct mtx nvd_lock; static TAILQ_HEAD(, nvd_controller) ctrlr_head; static TAILQ_HEAD(disk_list, nvd_disk) disk_head; @@ -139,6 +146,7 @@ nvd_load() if (!nvme_use_nvd) return 0; + mtx_init(&nvd_lock, "nvd_lock", NULL, MTX_DEF); TAILQ_INIT(&ctrlr_head); TAILQ_INIT(&disk_head); @@ -152,25 +160,25 @@ static void nvd_unload() { struct nvd_controller *ctrlr; - struct nvd_disk *disk; + struct nvd_disk *ndisk; if (!nvme_use_nvd) return; - while (!TAILQ_EMPTY(&ctrlr_head)) { - ctrlr = TAILQ_FIRST(&ctrlr_head); + mtx_lock(&nvd_lock); + while ((ctrlr = TAILQ_FIRST(&ctrlr_head)) != NULL) { TAILQ_REMOVE(&ctrlr_head, ctrlr, tailq); + TAILQ_FOREACH(ndisk, &ctrlr->disk_head, ctrlr_tailq) + nvd_gone(ndisk); + while (!TAILQ_EMPTY(&ctrlr->disk_head)) + msleep(&ctrlr->disk_head, &nvd_lock, 0, "nvd_unload",0); free(ctrlr, M_NVD); } + mtx_unlock(&nvd_lock); - while (!TAILQ_EMPTY(&disk_head)) { - disk = TAILQ_FIRST(&disk_head); - TAILQ_REMOVE(&disk_head, disk, global_tailq); - destroy_geom_disk(disk); - free(disk, M_NVD); - } - nvme_unregister_consumer(consumer_handle); + + mtx_destroy(&nvd_lock); } static int @@ -220,6 +228,42 @@ nvd_strategy(struct bio *bp) taskqueue_enqueue(ndisk->tq, &ndisk->bioqtask); } +static void +nvd_gone(struct nvd_disk *ndisk) +{ + struct bio *bp; + + printf(NVD_STR"%u: detached\n", ndisk->unit); + mtx_lock(&ndisk->bioqlock); + disk_gone(ndisk->disk); + while ((bp = bioq_takefirst(&ndisk->bioq)) != NULL) { + if (__predict_false(bp->bio_flags & BIO_ORDERED)) + atomic_add_int(&ndisk->ordered_in_flight, -1); + bp->bio_error = ENXIO; + bp->bio_flags |= BIO_ERROR; + bp->bio_resid = bp->bio_bcount; + biodone(bp); + } + mtx_unlock(&ndisk->bioqlock); +} + +static void +nvd_gonecb(struct disk *dp) +{ + struct nvd_disk *ndisk = (struct nvd_disk *)dp->d_drv1; + + disk_destroy(ndisk->disk); + mtx_lock(&nvd_lock); + TAILQ_REMOVE(&disk_head, ndisk, global_tailq); + TAILQ_REMOVE(&ndisk->ctrlr->disk_head, ndisk, ctrlr_tailq); + if (TAILQ_EMPTY(&ndisk->ctrlr->disk_head)) + wakeup(&ndisk->ctrlr->disk_head); + mtx_unlock(&nvd_lock); + taskqueue_free(ndisk->tq); + mtx_destroy(&ndisk->bioqlock); + free(ndisk, M_NVD); +} + static int nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, int fflag, struct thread *td) @@ -304,7 +348,9 @@ nvd_new_controller(struct nvme_controller *ctrlr) M_ZERO | M_WAITOK); TAILQ_INIT(&nvd_ctrlr->disk_head); + mtx_lock(&nvd_lock); TAILQ_INSERT_TAIL(&ctrlr_head, nvd_ctrlr, tailq); + mtx_unlock(&nvd_lock); return (nvd_ctrlr); } @@ -313,46 +359,61 @@ static void * nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) { uint8_t descr[NVME_MODEL_NUMBER_LENGTH+1]; - struct nvd_disk *ndisk; + struct nvd_disk *ndisk, *tnd; struct disk *disk; struct nvd_controller *ctrlr = ctrlr_arg; + int unit; ndisk = malloc(sizeof(struct nvd_disk), M_NVD, M_ZERO | M_WAITOK); + ndisk->ctrlr = ctrlr; + ndisk->ns = ns; + ndisk->cur_depth = 0; + ndisk->ordered_in_flight = 0; + mtx_init(&ndisk->bioqlock, "nvd bioq lock", NULL, MTX_DEF); + bioq_init(&ndisk->bioq); + TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); - disk = disk_alloc(); + mtx_lock(&nvd_lock); + unit = 0; + TAILQ_FOREACH(tnd, &disk_head, global_tailq) { + if (tnd->unit > unit) + break; + unit = tnd->unit + 1; + } + ndisk->unit = unit; + if (tnd != NULL) + TAILQ_INSERT_BEFORE(tnd, ndisk, global_tailq); + else + TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq); + TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq); + mtx_unlock(&nvd_lock); + + ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, + taskqueue_thread_enqueue, &ndisk->tq); + taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); + + disk = ndisk->disk = disk_alloc(); disk->d_strategy = nvd_strategy; disk->d_ioctl = nvd_ioctl; disk->d_dump = nvd_dump; + disk->d_gone = nvd_gonecb; disk->d_name = NVD_STR; + disk->d_unit = ndisk->unit; disk->d_drv1 = ndisk; - disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); + disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); if (disk->d_delmaxsize > nvd_delete_max) disk->d_delmaxsize = nvd_delete_max; disk->d_stripesize = nvme_ns_get_stripesize(ns); - - if (TAILQ_EMPTY(&disk_head)) - disk->d_unit = 0; - else - disk->d_unit = - TAILQ_LAST(&disk_head, disk_list)->disk->d_unit + 1; - - disk->d_flags = DISKFLAG_DIRECT_COMPLETION; - + disk->d_flags = DISKFLAG_UNMAPPED_BIO | DISKFLAG_DIRECT_COMPLETION; if (nvme_ns_get_flags(ns) & NVME_NS_DEALLOCATE_SUPPORTED) disk->d_flags |= DISKFLAG_CANDELETE; - if (nvme_ns_get_flags(ns) & NVME_NS_FLUSH_SUPPORTED) disk->d_flags |= DISKFLAG_CANFLUSHCACHE; -/* ifdef used here to ease porting to stable branches at a later point. */ -#ifdef DISKFLAG_UNMAPPED_BIO - disk->d_flags |= DISKFLAG_UNMAPPED_BIO; -#endif - /* * d_ident and d_descr are both far bigger than the length of either * the serial or model number strings. @@ -365,22 +426,6 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_ar disk->d_rotation_rate = DISK_RR_NON_ROTATING; - ndisk->ns = ns; - ndisk->disk = disk; - ndisk->cur_depth = 0; - ndisk->ordered_in_flight = 0; - - mtx_init(&ndisk->bioqlock, "NVD bioq lock", NULL, MTX_DEF); - bioq_init(&ndisk->bioq); - - TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); - ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, - taskqueue_thread_enqueue, &ndisk->tq); - taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); - - TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq); - TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq); - disk_create(disk, DISK_VERSION); printf(NVD_STR"%u: <%s> NVMe namespace\n", disk->d_unit, descr); @@ -389,58 +434,22 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_ar (uintmax_t)disk->d_mediasize / disk->d_sectorsize, disk->d_sectorsize); - return (NULL); + return (ndisk); } static void -destroy_geom_disk(struct nvd_disk *ndisk) -{ - struct bio *bp; - struct disk *disk; - uint32_t unit; - int cnt = 0; - - disk = ndisk->disk; - unit = disk->d_unit; - taskqueue_free(ndisk->tq); - - disk_destroy(ndisk->disk); - - mtx_lock(&ndisk->bioqlock); - for (;;) { - bp = bioq_takefirst(&ndisk->bioq); - if (bp == NULL) - break; - bp->bio_error = EIO; - bp->bio_flags |= BIO_ERROR; - bp->bio_resid = bp->bio_bcount; - cnt++; - biodone(bp); - } - - printf(NVD_STR"%u: lost device - %d outstanding\n", unit, cnt); - printf(NVD_STR"%u: removing device entry\n", unit); - - mtx_unlock(&ndisk->bioqlock); - - mtx_destroy(&ndisk->bioqlock); -} - -static void nvd_controller_fail(void *ctrlr_arg) { struct nvd_controller *ctrlr = ctrlr_arg; - struct nvd_disk *disk; + struct nvd_disk *ndisk; - while (!TAILQ_EMPTY(&ctrlr->disk_head)) { - disk = TAILQ_FIRST(&ctrlr->disk_head); - TAILQ_REMOVE(&disk_head, disk, global_tailq); - TAILQ_REMOVE(&ctrlr->disk_head, disk, ctrlr_tailq); - destroy_geom_disk(disk); - free(disk, M_NVD); - } - + mtx_lock(&nvd_lock); TAILQ_REMOVE(&ctrlr_head, ctrlr, tailq); + TAILQ_FOREACH(ndisk, &ctrlr->disk_head, ctrlr_tailq) + nvd_gone(ndisk); + while (!TAILQ_EMPTY(&ctrlr->disk_head)) + msleep(&ctrlr->disk_head, &nvd_lock, 0, "nvd_fail", 0); + mtx_unlock(&nvd_lock); free(ctrlr, M_NVD); } From owner-svn-src-head@freebsd.org Thu Dec 27 19:15:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37CF714207F8; Thu, 27 Dec 2018 19:15:25 +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) server-signature RSA-PSS (4096 bits) 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 D187088302; Thu, 27 Dec 2018 19:15:24 +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 C4CA8FF6A; Thu, 27 Dec 2018 19:15:24 +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 wBRJFOxx080132; Thu, 27 Dec 2018 19:15:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBRJFObc080131; Thu, 27 Dec 2018 19:15:24 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201812271915.wBRJFObc080131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 27 Dec 2018 19:15:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342558 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 342558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D187088302 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 19:15:25 -0000 Author: mav Date: Thu Dec 27 19:15:24 2018 New Revision: 342558 URL: https://svnweb.freebsd.org/changeset/base/342558 Log: Switch from mutexes to atomics in GEOM_DEV I/O path. Mutexes in I/O path there were used twice per I/O to atomically access several variables to close and/or destroy the device on last request completion. I found the way to fit all required info into one integer, suitable for atomic operations. It opened race window on device close, but addition of timeout to the msleep() there should cover it. Profiling shows removal of significant spinning time on those mutexes and IOPS increase from ~600K to >800K to NVMe on 72-core systems. MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/sys/geom/geom_dev.c Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Thu Dec 27 18:28:19 2018 (r342557) +++ head/sys/geom/geom_dev.c Thu Dec 27 19:15:24 2018 (r342558) @@ -64,7 +64,10 @@ struct g_dev_softc { struct cdev *sc_dev; struct cdev *sc_alias; int sc_open; - int sc_active; + u_int sc_active; +#define SC_A_DESTROY (1 << 31) +#define SC_A_OPEN (1 << 30) +#define SC_A_ACTIVE (SC_A_OPEN - 1) }; static d_open_t g_dev_open; @@ -420,9 +423,13 @@ g_dev_open(struct cdev *dev, int flags, int fmt, struc if (error == 0) { sc = cp->private; mtx_lock(&sc->sc_mtx); - if (sc->sc_open == 0 && sc->sc_active != 0) + if (sc->sc_open == 0 && (sc->sc_active & SC_A_ACTIVE) != 0) wakeup(&sc->sc_active); sc->sc_open += r + w + e; + if (sc->sc_open == 0) + atomic_clear_int(&sc->sc_active, SC_A_OPEN); + else + atomic_set_int(&sc->sc_active, SC_A_OPEN); mtx_unlock(&sc->sc_mtx); } return (error); @@ -465,8 +472,12 @@ g_dev_close(struct cdev *dev, int flags, int fmt, stru sc = cp->private; mtx_lock(&sc->sc_mtx); sc->sc_open += r + w + e; - while (sc->sc_open == 0 && sc->sc_active != 0) - msleep(&sc->sc_active, &sc->sc_mtx, 0, "PRIBIO", 0); + if (sc->sc_open == 0) + atomic_clear_int(&sc->sc_active, SC_A_OPEN); + else + atomic_set_int(&sc->sc_active, SC_A_OPEN); + while (sc->sc_open == 0 && (sc->sc_active & SC_A_ACTIVE) != 0) + msleep(&sc->sc_active, &sc->sc_mtx, 0, "g_dev_close", hz / 10); mtx_unlock(&sc->sc_mtx); g_topology_lock(); error = g_access(cp, r, w, e); @@ -707,7 +718,7 @@ g_dev_done(struct bio *bp2) struct g_consumer *cp; struct g_dev_softc *sc; struct bio *bp; - int destroy; + int active; cp = bp2->bio_from; sc = cp->private; @@ -727,17 +738,13 @@ g_dev_done(struct bio *bp2) bp2, bp, bp2->bio_resid, (intmax_t)bp2->bio_completed); } g_destroy_bio(bp2); - destroy = 0; - mtx_lock(&sc->sc_mtx); - if ((--sc->sc_active) == 0) { - if (sc->sc_open == 0) + active = atomic_fetchadd_int(&sc->sc_active, -1) - 1; + if ((active & SC_A_ACTIVE) == 0) { + if ((active & SC_A_OPEN) == 0) wakeup(&sc->sc_active); - if (sc->sc_dev == NULL) - destroy = 1; + if (active & SC_A_DESTROY) + g_post_event(g_dev_destroy, cp, M_NOWAIT, NULL); } - mtx_unlock(&sc->sc_mtx); - if (destroy) - g_post_event(g_dev_destroy, cp, M_NOWAIT, NULL); biodone(bp); } @@ -769,10 +776,8 @@ g_dev_strategy(struct bio *bp) return; } #endif - mtx_lock(&sc->sc_mtx); KASSERT(sc->sc_open > 0, ("Closed device in g_dev_strategy")); - sc->sc_active++; - mtx_unlock(&sc->sc_mtx); + atomic_add_int(&sc->sc_active, 1); for (;;) { /* @@ -810,18 +815,16 @@ g_dev_callback(void *arg) { struct g_consumer *cp; struct g_dev_softc *sc; - int destroy; + int active; cp = arg; sc = cp->private; g_trace(G_T_TOPOLOGY, "g_dev_callback(%p(%s))", cp, cp->geom->name); - mtx_lock(&sc->sc_mtx); sc->sc_dev = NULL; sc->sc_alias = NULL; - destroy = (sc->sc_active == 0); - mtx_unlock(&sc->sc_mtx); - if (destroy) + active = atomic_fetchadd_int(&sc->sc_active, SC_A_DESTROY); + if ((active & SC_A_ACTIVE) == 0) g_post_event(g_dev_destroy, cp, M_WAITOK, NULL); } From owner-svn-src-head@freebsd.org Thu Dec 27 19:57:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCA511421947; Thu, 27 Dec 2018 19:57:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59B60898F4; Thu, 27 Dec 2018 19:57:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 7608110A87D; Thu, 27 Dec 2018 14:57:44 -0500 (EST) Subject: Re: svn commit: r342552 - head/sys/arm64/arm64 To: Andrew Turner , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812271414.wBREEfCG022470@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt 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: <5b47ea61-32d5-2e47-a713-9076eed17f8f@FreeBSD.org> Date: Thu, 27 Dec 2018 11:32:06 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201812271414.wBREEfCG022470@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 27 Dec 2018 14:57:44 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 19:57:47 -0000 On 12/27/18 6:14 AM, Andrew Turner wrote: > Author: andrew > Date: Thu Dec 27 14:14:41 2018 > New Revision: 342552 > URL: https://svnweb.freebsd.org/changeset/base/342552 > > Log: > Pass VM_PROT_EXECUTE to vm_fault for instruction faults. > > We need to tell vm_fault the reason for the fault was because we tried to > execute from the memory location. Without this it may return with success > as we only request read-only memory, then we return to the same location > and try to execute from the same memory address. This leads to an infinite > loop raising the same fault and returning to the same invalid location. Note that on other architectures, ftype isn't a mask, but is a single value (one of VM_PROT_READ/WRITE/EXECUTE) to indicate the type of faulting access. I fixed this in riscv's pmap recently (it seemed to have been copied from arm64). -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Thu Dec 27 22:37:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5583614256DA; Thu, 27 Dec 2018 22:37:17 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 272C38EF35; Thu, 27 Dec 2018 22:37:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wBRMbBtL047350; Thu, 27 Dec 2018 14:37:11 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wBRMbB6W047349; Thu, 27 Dec 2018 14:37:11 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201812272237.wBRMbB6W047349@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r342557 - head/sys/dev/nvd In-Reply-To: <201812271828.wBRISJIV054433@repo.freebsd.org> To: Alexander Motin Date: Thu, 27 Dec 2018 14:37:11 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 272C38EF35 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.95 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 22:37:17 -0000 > Author: mav > Date: Thu Dec 27 18:28:19 2018 > New Revision: 342557 > URL: https://svnweb.freebsd.org/changeset/base/342557 > > Log: > Reimplement nvd(4) detach handling. > > Previous code typically crashed in case of NVMe device unplug or even clean > detach while some I/Os are still in flight. To fix this the new code calls > disk_gone() and waits for confirmation of all references gone before calling > disk_destroy(), freeing other resources and allowing controller detach. > > While there, fix disk lists locking and reimplement unit numbers assignment. > > MFC after: 1 month > Sponsored by: iXsystems, Inc. > > Modified: > head/sys/dev/nvd/nvd.c > > Modified: head/sys/dev/nvd/nvd.c > ============================================================================== > --- head/sys/dev/nvd/nvd.c Thu Dec 27 17:23:01 2018 (r342556) > +++ head/sys/dev/nvd/nvd.c Thu Dec 27 18:28:19 2018 (r342557) > @@ -2,6 +2,7 @@ > * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > * > * Copyright (C) 2012-2016 Intel Corporation > + * Copyright (C) 2018 Alexander Motin > * All rights reserved. Please exercise great care when placing copyright statements, you have seperated Intels copyright from its All rights reserved clause, making it appear as if you are the one exercising that claim, and that they did not. (Note, if it better to not put that clause on a seperate line if possible, for the very problem that occurs here) Please correct this. Thanks, Rod > * > * Redistribution and use in source and binary forms, with or without > @@ -34,9 +35,11 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > +#include > > #include > #include > @@ -46,15 +49,16 @@ __FBSDID("$FreeBSD$"); > #define NVD_STR "nvd" > > struct nvd_disk; > +struct nvd_controller; > > static disk_ioctl_t nvd_ioctl; > static disk_strategy_t nvd_strategy; > static dumper_t nvd_dump; > > static void nvd_done(void *arg, const struct nvme_completion *cpl); > +static void nvd_gone(struct nvd_disk *ndisk); > > static void *nvd_new_disk(struct nvme_namespace *ns, void *ctrlr); > -static void destroy_geom_disk(struct nvd_disk *ndisk); > > static void *nvd_new_controller(struct nvme_controller *ctrlr); > static void nvd_controller_fail(void *ctrlr); > @@ -67,6 +71,7 @@ MALLOC_DEFINE(M_NVD, "nvd", "nvd(4) allocations"); > struct nvme_consumer *consumer_handle; > > struct nvd_disk { > + struct nvd_controller *ctrlr; > > struct bio_queue_head bioq; > struct task bioqtask; > @@ -78,6 +83,7 @@ struct nvd_disk { > > uint32_t cur_depth; > uint32_t ordered_in_flight; > + u_int unit; > > TAILQ_ENTRY(nvd_disk) global_tailq; > TAILQ_ENTRY(nvd_disk) ctrlr_tailq; > @@ -89,6 +95,7 @@ struct nvd_controller { > TAILQ_HEAD(, nvd_disk) disk_head; > }; > > +static struct mtx nvd_lock; > static TAILQ_HEAD(, nvd_controller) ctrlr_head; > static TAILQ_HEAD(disk_list, nvd_disk) disk_head; > > @@ -139,6 +146,7 @@ nvd_load() > if (!nvme_use_nvd) > return 0; > > + mtx_init(&nvd_lock, "nvd_lock", NULL, MTX_DEF); > TAILQ_INIT(&ctrlr_head); > TAILQ_INIT(&disk_head); > > @@ -152,25 +160,25 @@ static void > nvd_unload() > { > struct nvd_controller *ctrlr; > - struct nvd_disk *disk; > + struct nvd_disk *ndisk; > > if (!nvme_use_nvd) > return; > > - while (!TAILQ_EMPTY(&ctrlr_head)) { > - ctrlr = TAILQ_FIRST(&ctrlr_head); > + mtx_lock(&nvd_lock); > + while ((ctrlr = TAILQ_FIRST(&ctrlr_head)) != NULL) { > TAILQ_REMOVE(&ctrlr_head, ctrlr, tailq); > + TAILQ_FOREACH(ndisk, &ctrlr->disk_head, ctrlr_tailq) > + nvd_gone(ndisk); > + while (!TAILQ_EMPTY(&ctrlr->disk_head)) > + msleep(&ctrlr->disk_head, &nvd_lock, 0, "nvd_unload",0); > free(ctrlr, M_NVD); > } > + mtx_unlock(&nvd_lock); > > - while (!TAILQ_EMPTY(&disk_head)) { > - disk = TAILQ_FIRST(&disk_head); > - TAILQ_REMOVE(&disk_head, disk, global_tailq); > - destroy_geom_disk(disk); > - free(disk, M_NVD); > - } > - > nvme_unregister_consumer(consumer_handle); > + > + mtx_destroy(&nvd_lock); > } > > static int > @@ -220,6 +228,42 @@ nvd_strategy(struct bio *bp) > taskqueue_enqueue(ndisk->tq, &ndisk->bioqtask); > } > > +static void > +nvd_gone(struct nvd_disk *ndisk) > +{ > + struct bio *bp; > + > + printf(NVD_STR"%u: detached\n", ndisk->unit); > + mtx_lock(&ndisk->bioqlock); > + disk_gone(ndisk->disk); > + while ((bp = bioq_takefirst(&ndisk->bioq)) != NULL) { > + if (__predict_false(bp->bio_flags & BIO_ORDERED)) > + atomic_add_int(&ndisk->ordered_in_flight, -1); > + bp->bio_error = ENXIO; > + bp->bio_flags |= BIO_ERROR; > + bp->bio_resid = bp->bio_bcount; > + biodone(bp); > + } > + mtx_unlock(&ndisk->bioqlock); > +} > + > +static void > +nvd_gonecb(struct disk *dp) > +{ > + struct nvd_disk *ndisk = (struct nvd_disk *)dp->d_drv1; > + > + disk_destroy(ndisk->disk); > + mtx_lock(&nvd_lock); > + TAILQ_REMOVE(&disk_head, ndisk, global_tailq); > + TAILQ_REMOVE(&ndisk->ctrlr->disk_head, ndisk, ctrlr_tailq); > + if (TAILQ_EMPTY(&ndisk->ctrlr->disk_head)) > + wakeup(&ndisk->ctrlr->disk_head); > + mtx_unlock(&nvd_lock); > + taskqueue_free(ndisk->tq); > + mtx_destroy(&ndisk->bioqlock); > + free(ndisk, M_NVD); > +} > + > static int > nvd_ioctl(struct disk *ndisk, u_long cmd, void *data, int fflag, > struct thread *td) > @@ -304,7 +348,9 @@ nvd_new_controller(struct nvme_controller *ctrlr) > M_ZERO | M_WAITOK); > > TAILQ_INIT(&nvd_ctrlr->disk_head); > + mtx_lock(&nvd_lock); > TAILQ_INSERT_TAIL(&ctrlr_head, nvd_ctrlr, tailq); > + mtx_unlock(&nvd_lock); > > return (nvd_ctrlr); > } > @@ -313,46 +359,61 @@ static void * > nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_arg) > { > uint8_t descr[NVME_MODEL_NUMBER_LENGTH+1]; > - struct nvd_disk *ndisk; > + struct nvd_disk *ndisk, *tnd; > struct disk *disk; > struct nvd_controller *ctrlr = ctrlr_arg; > + int unit; > > ndisk = malloc(sizeof(struct nvd_disk), M_NVD, M_ZERO | M_WAITOK); > + ndisk->ctrlr = ctrlr; > + ndisk->ns = ns; > + ndisk->cur_depth = 0; > + ndisk->ordered_in_flight = 0; > + mtx_init(&ndisk->bioqlock, "nvd bioq lock", NULL, MTX_DEF); > + bioq_init(&ndisk->bioq); > + TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); > > - disk = disk_alloc(); > + mtx_lock(&nvd_lock); > + unit = 0; > + TAILQ_FOREACH(tnd, &disk_head, global_tailq) { > + if (tnd->unit > unit) > + break; > + unit = tnd->unit + 1; > + } > + ndisk->unit = unit; > + if (tnd != NULL) > + TAILQ_INSERT_BEFORE(tnd, ndisk, global_tailq); > + else > + TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq); > + TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq); > + mtx_unlock(&nvd_lock); > + > + ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, > + taskqueue_thread_enqueue, &ndisk->tq); > + taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); > + > + disk = ndisk->disk = disk_alloc(); > disk->d_strategy = nvd_strategy; > disk->d_ioctl = nvd_ioctl; > disk->d_dump = nvd_dump; > + disk->d_gone = nvd_gonecb; > disk->d_name = NVD_STR; > + disk->d_unit = ndisk->unit; > disk->d_drv1 = ndisk; > > - disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); > disk->d_sectorsize = nvme_ns_get_sector_size(ns); > disk->d_mediasize = (off_t)nvme_ns_get_size(ns); > + disk->d_maxsize = nvme_ns_get_max_io_xfer_size(ns); > disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); > if (disk->d_delmaxsize > nvd_delete_max) > disk->d_delmaxsize = nvd_delete_max; > disk->d_stripesize = nvme_ns_get_stripesize(ns); > - > - if (TAILQ_EMPTY(&disk_head)) > - disk->d_unit = 0; > - else > - disk->d_unit = > - TAILQ_LAST(&disk_head, disk_list)->disk->d_unit + 1; > - > - disk->d_flags = DISKFLAG_DIRECT_COMPLETION; > - > + disk->d_flags = DISKFLAG_UNMAPPED_BIO | DISKFLAG_DIRECT_COMPLETION; > if (nvme_ns_get_flags(ns) & NVME_NS_DEALLOCATE_SUPPORTED) > disk->d_flags |= DISKFLAG_CANDELETE; > - > if (nvme_ns_get_flags(ns) & NVME_NS_FLUSH_SUPPORTED) > disk->d_flags |= DISKFLAG_CANFLUSHCACHE; > > -/* ifdef used here to ease porting to stable branches at a later point. */ > -#ifdef DISKFLAG_UNMAPPED_BIO > - disk->d_flags |= DISKFLAG_UNMAPPED_BIO; > -#endif > - > /* > * d_ident and d_descr are both far bigger than the length of either > * the serial or model number strings. > @@ -365,22 +426,6 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_ar > > disk->d_rotation_rate = DISK_RR_NON_ROTATING; > > - ndisk->ns = ns; > - ndisk->disk = disk; > - ndisk->cur_depth = 0; > - ndisk->ordered_in_flight = 0; > - > - mtx_init(&ndisk->bioqlock, "NVD bioq lock", NULL, MTX_DEF); > - bioq_init(&ndisk->bioq); > - > - TASK_INIT(&ndisk->bioqtask, 0, nvd_bioq_process, ndisk); > - ndisk->tq = taskqueue_create("nvd_taskq", M_WAITOK, > - taskqueue_thread_enqueue, &ndisk->tq); > - taskqueue_start_threads(&ndisk->tq, 1, PI_DISK, "nvd taskq"); > - > - TAILQ_INSERT_TAIL(&disk_head, ndisk, global_tailq); > - TAILQ_INSERT_TAIL(&ctrlr->disk_head, ndisk, ctrlr_tailq); > - > disk_create(disk, DISK_VERSION); > > printf(NVD_STR"%u: <%s> NVMe namespace\n", disk->d_unit, descr); > @@ -389,58 +434,22 @@ nvd_new_disk(struct nvme_namespace *ns, void *ctrlr_ar > (uintmax_t)disk->d_mediasize / disk->d_sectorsize, > disk->d_sectorsize); > > - return (NULL); > + return (ndisk); > } > > static void > -destroy_geom_disk(struct nvd_disk *ndisk) > -{ > - struct bio *bp; > - struct disk *disk; > - uint32_t unit; > - int cnt = 0; > - > - disk = ndisk->disk; > - unit = disk->d_unit; > - taskqueue_free(ndisk->tq); > - > - disk_destroy(ndisk->disk); > - > - mtx_lock(&ndisk->bioqlock); > - for (;;) { > - bp = bioq_takefirst(&ndisk->bioq); > - if (bp == NULL) > - break; > - bp->bio_error = EIO; > - bp->bio_flags |= BIO_ERROR; > - bp->bio_resid = bp->bio_bcount; > - cnt++; > - biodone(bp); > - } > - > - printf(NVD_STR"%u: lost device - %d outstanding\n", unit, cnt); > - printf(NVD_STR"%u: removing device entry\n", unit); > - > - mtx_unlock(&ndisk->bioqlock); > - > - mtx_destroy(&ndisk->bioqlock); > -} > - > -static void > nvd_controller_fail(void *ctrlr_arg) > { > struct nvd_controller *ctrlr = ctrlr_arg; > - struct nvd_disk *disk; > + struct nvd_disk *ndisk; > > - while (!TAILQ_EMPTY(&ctrlr->disk_head)) { > - disk = TAILQ_FIRST(&ctrlr->disk_head); > - TAILQ_REMOVE(&disk_head, disk, global_tailq); > - TAILQ_REMOVE(&ctrlr->disk_head, disk, ctrlr_tailq); > - destroy_geom_disk(disk); > - free(disk, M_NVD); > - } > - > + mtx_lock(&nvd_lock); > TAILQ_REMOVE(&ctrlr_head, ctrlr, tailq); > + TAILQ_FOREACH(ndisk, &ctrlr->disk_head, ctrlr_tailq) > + nvd_gone(ndisk); > + while (!TAILQ_EMPTY(&ctrlr->disk_head)) > + msleep(&ctrlr->disk_head, &nvd_lock, 0, "nvd_fail", 0); > + mtx_unlock(&nvd_lock); > free(ctrlr, M_NVD); > } > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Dec 27 22:44:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4C1D1425981; Thu, 27 Dec 2018 22:44:08 +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) server-signature RSA-PSS (4096 bits) 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 4A8FD8F434; Thu, 27 Dec 2018 22:44:08 +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 3E8951A36C; Thu, 27 Dec 2018 22:44:08 +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 wBRMi8ge092209; Thu, 27 Dec 2018 22:44:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBRMi8QU092208; Thu, 27 Dec 2018 22:44:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201812272244.wBRMi8QU092208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 27 Dec 2018 22:44:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342559 - head/sys/dev/nvd X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: head/sys/dev/nvd X-SVN-Commit-Revision: 342559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A8FD8F434 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 22:44:08 -0000 Author: mav Date: Thu Dec 27 22:44:07 2018 New Revision: 342559 URL: https://svnweb.freebsd.org/changeset/base/342559 Log: Fix incorrectly inserted copyright in r342557. Reported by: rgrimes MFC after: 1 month Modified: head/sys/dev/nvd/nvd.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Thu Dec 27 19:15:24 2018 (r342558) +++ head/sys/dev/nvd/nvd.c Thu Dec 27 22:44:07 2018 (r342559) @@ -2,8 +2,8 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (C) 2012-2016 Intel Corporation - * Copyright (C) 2018 Alexander Motin * All rights reserved. + * Copyright (C) 2018 Alexander Motin * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-head@freebsd.org Thu Dec 27 23:27:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2887214269CA; Thu, 27 Dec 2018 23:27:49 +0000 (UTC) (envelope-from will@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) server-signature RSA-PSS (4096 bits) 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 ADE8069EFF; Thu, 27 Dec 2018 23:27:48 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AA0F1AA55; Thu, 27 Dec 2018 23:27:48 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBRNRmJc013520; Thu, 27 Dec 2018 23:27:48 GMT (envelope-from will@FreeBSD.org) Received: (from will@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBRNRmLd013519; Thu, 27 Dec 2018 23:27:48 GMT (envelope-from will@FreeBSD.org) Message-Id: <201812272327.wBRNRmLd013519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: will set sender to will@FreeBSD.org using -f From: Will Andrews Date: Thu, 27 Dec 2018 23:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342560 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: will X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 342560 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADE8069EFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Dec 2018 23:27:49 -0000 Author: will Date: Thu Dec 27 23:27:48 2018 New Revision: 342560 URL: https://svnweb.freebsd.org/changeset/base/342560 Log: beinstall: try to save progress from pkg updates. This is primarily aimed at failed updates due to package conflicts, and affects treatment of failed updates. Whereas before potentially a large number of packages would need to be synced for each attempt, they can now be persisted. Requires rsync. There may be better ways to implement this, e.g. using secondary cache path that is only used on followup attempts and then wiped on success, which avoids polluting current cache. Modified: head/tools/build/beinstall.sh Modified: head/tools/build/beinstall.sh ============================================================================== --- head/tools/build/beinstall.sh Thu Dec 27 22:44:07 2018 (r342559) +++ head/tools/build/beinstall.sh Thu Dec 27 23:27:48 2018 (r342560) @@ -82,6 +82,14 @@ unmount_be() { mount | grep " on ${BE_MNTPT}" | awk '{print $3}' | sort -r | xargs -t umount -f } +copy_pkgs() { + # Before cleaning up, try to save progress in pkg(8) updates, to + # speed up future updates. This is only called on the error path; + # no need to run on success. + echo "Rsyncing back newly saved packages..." + rsync -av --progress ${BE_MNTPT}/var/cache/pkg/. /var/cache/pkg/. +} + cleanup_be() { # Before destroying, unmount any child filesystems that may have # been mounted under the boot environment. Sort them in reverse @@ -223,6 +231,10 @@ chroot ${BE_MNTPT} make "$@" -C ${srcdir} installworld if [ -n "${CONFIG_UPDATER}" ]; then "update_${CONFIG_UPDATER}" [ $? -ne 0 ] && errx "${CONFIG_UPDATER} (post-world) failed!" +fi + +if which rsync >/dev/null 2>&1; then + cleanup_commands="copy_pkgs ${cleanup_commands}" fi BE_PKG="chroot ${BE_MNTPT} env ASSUME_ALWAYS_YES=true pkg" From owner-svn-src-head@freebsd.org Fri Dec 28 01:34:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 780DD142A3FE; Fri, 28 Dec 2018 01:34:09 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 E4EC06D99D; Fri, 28 Dec 2018 01:34:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D841F1C035; Fri, 28 Dec 2018 01:34:08 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBS1Y8nN081015; Fri, 28 Dec 2018 01:34:08 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBS1Y8VD081013; Fri, 28 Dec 2018 01:34:08 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201812280134.wBS1Y8VD081013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 28 Dec 2018 01:34:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342563 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 342563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E4EC06D99D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 01:34:09 -0000 Author: jhibbits Date: Fri Dec 28 01:34:08 2018 New Revision: 342563 URL: https://svnweb.freebsd.org/changeset/base/342563 Log: libm: Include float.h to get LDBL_MANT_DIG The long double aliases of double functions are only exposed as aliases if LDBL_MANT_DIG is 53 (same as DBL_MANT_DIG). Without float.h included these files were not exposing weak aliases as expected, leading to link failures if programs use the *l functions. This should fix editors/calligra on targets with 64-bit long double, which uses erfl and erfcl. Found on powerpc64. Reviewed by: kargl@ Modified: head/lib/msun/src/s_cbrt.c head/lib/msun/src/s_cproj.c head/lib/msun/src/s_erf.c Modified: head/lib/msun/src/s_cbrt.c ============================================================================== --- head/lib/msun/src/s_cbrt.c Fri Dec 28 00:26:19 2018 (r342562) +++ head/lib/msun/src/s_cbrt.c Fri Dec 28 01:34:08 2018 (r342563) @@ -15,6 +15,7 @@ #include __FBSDID("$FreeBSD$"); +#include #include "math.h" #include "math_private.h" Modified: head/lib/msun/src/s_cproj.c ============================================================================== --- head/lib/msun/src/s_cproj.c Fri Dec 28 00:26:19 2018 (r342562) +++ head/lib/msun/src/s_cproj.c Fri Dec 28 01:34:08 2018 (r342563) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include "math_private.h" Modified: head/lib/msun/src/s_erf.c ============================================================================== --- head/lib/msun/src/s_erf.c Fri Dec 28 00:26:19 2018 (r342562) +++ head/lib/msun/src/s_erf.c Fri Dec 28 01:34:08 2018 (r342563) @@ -107,7 +107,7 @@ __FBSDID("$FreeBSD$"); * erfc/erf(NaN) is NaN */ - +#include #include "math.h" #include "math_private.h" From owner-svn-src-head@freebsd.org Fri Dec 28 13:32:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95D6C143911A; Fri, 28 Dec 2018 13:32:15 +0000 (UTC) (envelope-from jilles@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) server-signature RSA-PSS (4096 bits) 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 3ACC38B1F5; Fri, 28 Dec 2018 13:32:15 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F5132391C; Fri, 28 Dec 2018 13:32:15 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBSDWFEr058277; Fri, 28 Dec 2018 13:32:15 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBSDWFmn058276; Fri, 28 Dec 2018 13:32:15 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201812281332.wBSDWFmn058276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Fri, 28 Dec 2018 13:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342572 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3ACC38B1F5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 13:32:15 -0000 Author: jilles Date: Fri Dec 28 13:32:14 2018 New Revision: 342572 URL: https://svnweb.freebsd.org/changeset/base/342572 Log: pfind, pfind_any: Correct zombie logic SVN r340744 erroneously changed pfind() to return any process including zombies and pfind_any() to return only non-zombie processes. In particular, this caused kill() on a zombie process to fail with [ESRCH]. There is no direct test case for this but /usr/tests/bin/sh/builtins/kill1.0 occasionally triggers it (as reported by lwhsu). Conversely, returning zombies from pfind() seems likely to violate invariants and cause panics, but I have not looked at this. PR: 233646 Reviewed by: mjg, kib, ngie Differential Revision: https://reviews.freebsd.org/D18665 Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Fri Dec 28 10:10:16 2018 (r342571) +++ head/sys/kern/kern_proc.c Fri Dec 28 13:32:14 2018 (r342572) @@ -388,7 +388,7 @@ _pfind(pid_t pid, bool zombie) if (p->p_pid == pid) { PROC_LOCK(p); if (p->p_state == PRS_NEW || - (zombie && p->p_state == PRS_ZOMBIE)) { + (!zombie && p->p_state == PRS_ZOMBIE)) { PROC_UNLOCK(p); p = NULL; } From owner-svn-src-head@freebsd.org Fri Dec 28 15:11:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74013143B6AF; Fri, 28 Dec 2018 15:11:23 +0000 (UTC) (envelope-from crees@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) server-signature RSA-PSS (4096 bits) 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 14F548E41C; Fri, 28 Dec 2018 15:11:23 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E70F9248EF; Fri, 28 Dec 2018 15:11:22 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBSFBMmv012216; Fri, 28 Dec 2018 15:11:22 GMT (envelope-from crees@FreeBSD.org) Received: (from crees@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBSFBMwD012214; Fri, 28 Dec 2018 15:11:22 GMT (envelope-from crees@FreeBSD.org) Message-Id: <201812281511.wBSFBMwD012214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: crees set sender to crees@FreeBSD.org using -f From: Chris Rees Date: Fri, 28 Dec 2018 15:11:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342573 - head/usr.sbin/autofs X-SVN-Group: head X-SVN-Commit-Author: crees X-SVN-Commit-Paths: head/usr.sbin/autofs X-SVN-Commit-Revision: 342573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 14F548E41C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 15:11:23 -0000 Author: crees (doc,ports committer) Date: Fri Dec 28 15:11:22 2018 New Revision: 342573 URL: https://svnweb.freebsd.org/changeset/base/342573 Log: There is no way of escaping literal $ signs in auto_master(5), which makes for difficulty with hidden Samba shares; shares with $ at the end of their name. This enables the use of ${DOLLAR} to work around this. Reviewed by: bcr (man page) Approved by: trasz Differential Revision: https://reviews.freebsd.org/D7048 Modified: head/usr.sbin/autofs/auto_master.5 head/usr.sbin/autofs/defined.c Modified: head/usr.sbin/autofs/auto_master.5 ============================================================================== --- head/usr.sbin/autofs/auto_master.5 Fri Dec 28 13:32:14 2018 (r342572) +++ head/usr.sbin/autofs/auto_master.5 Fri Dec 28 15:11:22 2018 (r342573) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2015 +.Dd December 28, 2018 .Dt AUTO_MASTER 5 .Os .Sh NAME @@ -187,6 +187,8 @@ Expands to the output of .Li "uname -p" . .It Li CPU Same as ARCH. +.It Li DOLLAR +A literal $ sign. .It Li HOST Expands to the output of .Li "uname -n" . Modified: head/usr.sbin/autofs/defined.c ============================================================================== --- head/usr.sbin/autofs/defined.c Fri Dec 28 13:32:14 2018 (r342572) +++ head/usr.sbin/autofs/defined.c Fri Dec 28 15:11:22 2018 (r342573) @@ -266,6 +266,7 @@ defined_init(void) defined_add("ARCH", name.machine); defined_add("CPU", name.machine); + defined_add("DOLLAR", "$"); defined_add("HOST", name.nodename); defined_add("OSNAME", name.sysname); defined_add("OSREL", name.release); From owner-svn-src-head@freebsd.org Fri Dec 28 16:08:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC5C8143CBDE; Fri, 28 Dec 2018 16:08:50 +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) server-signature RSA-PSS (4096 bits) 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 88CAA90143; Fri, 28 Dec 2018 16:08:50 +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 6E6C0252EA; Fri, 28 Dec 2018 16:08:50 +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 wBSG8oJM039066; Fri, 28 Dec 2018 16:08:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBSG8oHB039065; Fri, 28 Dec 2018 16:08:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812281608.wBSG8oHB039065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 28 Dec 2018 16:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342574 - head/lib/libc/string X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/string X-SVN-Commit-Revision: 342574 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 88CAA90143 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 16:08:51 -0000 Author: kib Date: Fri Dec 28 16:08:49 2018 New Revision: 342574 URL: https://svnweb.freebsd.org/changeset/base/342574 Log: Fix WITHOUT_NLS build after r342551. Reported by: gj MFC after: 13 days Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/string/strerror.c Modified: head/lib/libc/string/strerror.c ============================================================================== --- head/lib/libc/string/strerror.c Fri Dec 28 15:11:22 2018 (r342573) +++ head/lib/libc/string/strerror.c Fri Dec 28 16:08:49 2018 (r342574) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); * statically linked binaries. */ static void -errstr(int num, char *uprefix, char *buf, size_t len) +errstr(int num, const char *uprefix, char *buf, size_t len) { char *t; unsigned int uerr; From owner-svn-src-head@freebsd.org Fri Dec 28 17:00:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B3871419DC5; Fri, 28 Dec 2018 17:00:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 412BA919E1; Fri, 28 Dec 2018 17:00:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F7D425B3F; Fri, 28 Dec 2018 17:00:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBSH0DQ9065581; Fri, 28 Dec 2018 17:00:13 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBSH0DGr065580; Fri, 28 Dec 2018 17:00:13 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201812281700.wBSH0DGr065580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 28 Dec 2018 17:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342575 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 342575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 412BA919E1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 17:00:13 -0000 Author: emaste Date: Fri Dec 28 17:00:12 2018 New Revision: 342575 URL: https://svnweb.freebsd.org/changeset/base/342575 Log: ar: detect and error out on 32-bit symbol table overflow BSD ar currently does not support the /SYM64/ 64-bit symbol table, and previously truncated to 32-bits, silently producing corrupted archives larger than 4GB. Note that this is only a partial fix; additional checks will come. PR: 234454 Reported by: Aijaz Baig, imp MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Fri Dec 28 16:08:49 2018 (r342574) +++ head/usr.bin/ar/write.c Fri Dec 28 17:00:12 2018 (r342575) @@ -659,9 +659,13 @@ write_objs(struct bsdar *bsdar) pm_sz = _ARMAG_LEN + (_ARHDR_LEN + s_sz); if (bsdar->as != NULL) pm_sz += _ARHDR_LEN + bsdar->as_sz; - for (i = 0; (size_t)i < bsdar->s_cnt; i++) + for (i = 0; (size_t)i < bsdar->s_cnt; i++) { + if (*(bsdar->s_so + i) > UINT32_MAX - pm_sz) + bsdar_errc(bsdar, EX_SOFTWARE, 0, + "Symbol table offset overflow"); *(bsdar->s_so + i) = htobe32(*(bsdar->s_so + i) + pm_sz); + } } if ((a = archive_write_new()) == NULL) From owner-svn-src-head@freebsd.org Fri Dec 28 17:50:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2259141B464; Fri, 28 Dec 2018 17:50:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 4474393335; Fri, 28 Dec 2018 17:50:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A2F0263B3; Fri, 28 Dec 2018 17:50:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBSHofk7092543; Fri, 28 Dec 2018 17:50:41 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBSHofEt092542; Fri, 28 Dec 2018 17:50:41 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201812281750.wBSHofEt092542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 28 Dec 2018 17:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342576 - head/share/skel X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/skel X-SVN-Commit-Revision: 342576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4474393335 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 17:50:41 -0000 Author: trasz Date: Fri Dec 28 17:50:40 2018 New Revision: 342576 URL: https://svnweb.freebsd.org/changeset/base/342576 Log: Simplify the way we set the default sh(1) PS1. No functional changes. Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18662 Modified: head/share/skel/dot.shrc Modified: head/share/skel/dot.shrc ============================================================================== --- head/share/skel/dot.shrc Fri Dec 28 17:00:12 2018 (r342575) +++ head/share/skel/dot.shrc Fri Dec 28 17:50:40 2018 (r342576) @@ -33,11 +33,7 @@ alias g='egrep -i' # # set prompt: ``username@hostname$ '' -# PS1="`whoami`@`hostname | sed 's/\..*//'`" -# case `id -u` in -# 0) PS1="${PS1}# ";; -# *) PS1="${PS1}$ ";; -# esac +# PS1="`whoami`@\h\\$ " # search path for cd(1) # CDPATH=:$HOME From owner-svn-src-head@freebsd.org Fri Dec 28 17:51:41 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 638F9141B4E8; Fri, 28 Dec 2018 17:51:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 0AF7E9366B; Fri, 28 Dec 2018 17:51:41 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE3D32640C; Fri, 28 Dec 2018 17:51:40 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBSHpehu095682; Fri, 28 Dec 2018 17:51:40 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBSHpeVV095681; Fri, 28 Dec 2018 17:51:40 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201812281751.wBSHpeVV095681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 28 Dec 2018 17:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342577 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 342577 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0AF7E9366B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 17:51:41 -0000 Author: trasz Date: Fri Dec 28 17:51:40 2018 New Revision: 342577 URL: https://svnweb.freebsd.org/changeset/base/342577 Log: Make sh(1) collapse $HOME into "~" in PS1. Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18663 Modified: head/bin/sh/parser.c Modified: head/bin/sh/parser.c ============================================================================== --- head/bin/sh/parser.c Fri Dec 28 17:50:40 2018 (r342576) +++ head/bin/sh/parser.c Fri Dec 28 17:51:40 2018 (r342577) @@ -1978,7 +1978,9 @@ getprompt(void *unused __unused) { static char ps[PROMPTLEN]; const char *fmt; + const char *home; const char *pwd; + size_t homelen; int i, trim; static char internal_error[] = "??"; @@ -2039,8 +2041,24 @@ getprompt(void *unused __unused) *pwd == '/' && pwd[1] != '\0') strlcpy(&ps[i], strrchr(pwd, '/') + 1, PROMPTLEN - i); - else - strlcpy(&ps[i], pwd, PROMPTLEN - i); + else { + home = lookupvar("HOME"); + if (home != NULL) + homelen = strlen(home); + if (home != NULL && + strcmp(home, "/") != 0 && + strncmp(pwd, home, homelen) == 0 && + (pwd[homelen] == '/' || + pwd[homelen] == '\0')) { + strlcpy(&ps[i], "~", + PROMPTLEN - i); + strlcpy(&ps[i + 1], + pwd + homelen, + PROMPTLEN - i - 1); + } else { + strlcpy(&ps[i], pwd, PROMPTLEN - i); + } + } /* Skip to end of path. */ while (ps[i + 1] != '\0') i++; From owner-svn-src-head@freebsd.org Fri Dec 28 18:03:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5229141B86E; Fri, 28 Dec 2018 18:03:44 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D37C93C85; Fri, 28 Dec 2018 18:03:44 +0000 (UTC) (envelope-from john@baldwin.cx) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 9C13410AFD2; Fri, 28 Dec 2018 13:03:42 -0500 (EST) Subject: Re: svn commit: r342577 - head/bin/sh To: Edward Tomasz Napierala , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812281751.wBSHpeVV095681@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=john@baldwin.cx; 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 d2luIDxqb2huQGJhbGR3aW4uY3g+iGMEExECACMCGwMGCwkIBwMCBBUCCAMEFgIDAQIeAQIX gAUCRND5wwIZAQAKCRBy3lIGd+N/BNLXAJ9KIb6teuDL1W+FkCgvv+y8PxKTkACeIUfbn3sl cueBzqTcf09idwa8YTa5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Ds gnr31AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh +GojXlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cM SOrHYUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOF QVHOEVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq 1tqzhltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZ TwtXsNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m 7Z164yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioI AjjHaIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbU KWwxQ4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjH uW+ISQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZN wwCfafMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <7523dc7e-2fdb-bc91-40f9-ab4f760a2e3e@baldwin.cx> Date: Fri, 28 Dec 2018 10:03:41 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201812281751.wBSHpeVV095681@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 28 Dec 2018 13:03:43 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 18:03:45 -0000 On 12/28/18 9:51 AM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Fri Dec 28 17:51:40 2018 > New Revision: 342577 > URL: https://svnweb.freebsd.org/changeset/base/342577 > > Log: > Make sh(1) collapse $HOME into "~" in PS1. > > Reviewed by: jilles > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D18663 > > Modified: > head/bin/sh/parser.c > > Modified: head/bin/sh/parser.c > ============================================================================== > --- head/bin/sh/parser.c Fri Dec 28 17:50:40 2018 (r342576) > +++ head/bin/sh/parser.c Fri Dec 28 17:51:40 2018 (r342577) > @@ -1978,7 +1978,9 @@ getprompt(void *unused __unused) > { > static char ps[PROMPTLEN]; > const char *fmt; > + const char *home; > const char *pwd; > + size_t homelen; > int i, trim; > static char internal_error[] = "??"; > > @@ -2039,8 +2041,24 @@ getprompt(void *unused __unused) > *pwd == '/' && pwd[1] != '\0') > strlcpy(&ps[i], strrchr(pwd, '/') + 1, > PROMPTLEN - i); > - else > - strlcpy(&ps[i], pwd, PROMPTLEN - i); > + else { > + home = lookupvar("HOME"); > + if (home != NULL) > + homelen = strlen(home); > + if (home != NULL && > + strcmp(home, "/") != 0 && > + strncmp(pwd, home, homelen) == 0 && > + (pwd[homelen] == '/' || > + pwd[homelen] == '\0')) { > + strlcpy(&ps[i], "~", > + PROMPTLEN - i); > + strlcpy(&ps[i + 1], > + pwd + homelen, > + PROMPTLEN - i - 1); > + } else { > + strlcpy(&ps[i], pwd, PROMPTLEN - i); > + } > + } The existing code already did this, but isn't the fancy math with the size passed to strlcpy() one of the things strlcpy() tries to prevent? Using strlcat would seem to be harder to get wrong, that is: if (...) { strlcat(ps, "~", PROMPTLEN); strlcat(ps, pwd + homelen, PROMPTLEN); } else strlcat(ps, pwd, PROMPTLEN); looks simpler to read and seems less error prone. -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Fri Dec 28 18:20:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B374141E1BE; Fri, 28 Dec 2018 18:20:07 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E5FB94795; Fri, 28 Dec 2018 18:20:06 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 43RFNv1QNNzDjFY; Fri, 28 Dec 2018 18:19:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id k0beD9ejy3Rs; Fri, 28 Dec 2018 18:19:58 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:25be:edfd:c331:f8d8]) by mail.daemonic.se (Postfix) with ESMTPSA id 43RFNt49FXzDjCL; Fri, 28 Dec 2018 18:19:58 +0000 (UTC) Subject: Re: svn commit: r342389 - head/share/man/man5 To: Chris Rees , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812241047.wBOAlmwc092761@repo.freebsd.org> From: Niclas Zeising Message-ID: <1c2d5b66-42f2-63e6-9f62-aa383e9b79b9@freebsd.org> Date: Fri, 28 Dec 2018 19:19:57 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201812241047.wBOAlmwc092761@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 9E5FB94795 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:36236, ipnet:176.58.89.0/24, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 18:20:07 -0000 On 12/24/18 11:47 AM, Chris Rees wrote: > Author: crees (doc,ports committer) > Date: Mon Dec 24 10:47:48 2018 > New Revision: 342389 > URL: https://svnweb.freebsd.org/changeset/base/342389 > > Log: > Clarify kld_list format > > PR: docs/234248 > Submitted by: David Fiander > Submitted by: Miroslav Lachman > > Modified: > head/share/man/man5/rc.conf.5 > > Modified: head/share/man/man5/rc.conf.5 > ============================================================================== > --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 (r342388) > +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 (r342389) > @@ -248,12 +248,14 @@ Default > .Pa /etc/ddb.conf . > .It Va kld_list > .Pq Vt str > -A list of kernel modules to load right after the local > -disks are mounted. > +A whitespace-separated list of kernel modules to load right after > +the local disks are mounted, without any > +.Pa .ko > +extension or path. > Loading modules at this point in the boot process is > much faster than doing it via > .Pa /boot/loader.conf > -for those modules not necessary for mounting local disk. > +for those modules not necessary for mounting local disks. > .It Va kldxref_enable > .Pq Vt bool > Set to Hi! Sorry for jumping into this so late. Please please PLEASE don't break loading modules by path in kld_list. This is used by the drm-kmod files to distinguish them from the base modules, and this has been communicated in documentation all over the place, including numerous ports. Can this please be reverted, or amended to match reality. In practice, adding both the path and the extension (.ko) to a module in kld_list works and the module loads. Regards -- Niclas Zeising FreeBSD Graphics Team From owner-svn-src-head@freebsd.org Fri Dec 28 18:43:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEEE8141EAD7; Fri, 28 Dec 2018 18:43:54 +0000 (UTC) (envelope-from crees@freebsd.org) Received: from mail56c50.megamailservers.eu (mail168c50.megamailservers.eu [91.136.10.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D57B295519; Fri, 28 Dec 2018 18:43:53 +0000 (UTC) (envelope-from crees@freebsd.org) X-Authenticated-User: bayofrum@uwclub.net Received: from pegasus.bayofrum.net (host-80-41-58-105.as13285.net [80.41.58.105]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id wBSIhiwF027737; Fri, 28 Dec 2018 18:43:45 +0000 Received: from android-4497c5999ce4d9aa.bayofrum.net (android-4497c5999ce4d9aa.bayofrum.net [192.168.1.115]) by pegasus.bayofrum.net (Postfix) with ESMTPSA id B741CA201; Fri, 28 Dec 2018 18:43:42 +0000 (GMT) Date: Fri, 28 Dec 2018 18:43:39 +0000 User-Agent: K-9 Mail for Android In-Reply-To: <1c2d5b66-42f2-63e6-9f62-aa383e9b79b9@freebsd.org> References: <201812241047.wBOAlmwc092761@repo.freebsd.org> <1c2d5b66-42f2-63e6-9f62-aa383e9b79b9@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Autocrypt: addr=crees@FreeBSD.org; keydata= mQENBFA55DwBCADLmiSSORwcGwNoCi2X02jPmS2lcZXWp5uCtzx0ybPM65tIQAIIL5e8QzyrV+r/ yyNdGJIKtl4ty69aVodQ6n6Xf2BGqmm/x6jlvg2BrJgNHYfAjkIVtugkbwsMQxHkNmOlB+fURVPJ k9xub4pz9kRRdtXJ3DiImQRw5XVe2ZvBXZuu2nOzjw2zArEaBSLbjo1MlXWJvvuyA2ktaKcAjFyf z/VJ8M/RDbJdfYDB9Q78jrr4uwIMlyWSWUD8RxAvbWw0My2tr1Nu9FDvsydbKygGnZ+7oo4zvqnc GZ+0am6D3XSsOcaf/bzB8pIGJ1hsSe9JHvYpLvnWCwP+AJtKTPwFABEBAAG0HkNocmlzIFJlZXMg PGNyZWVzQEZyZWVCU0Qub3JnPokBOAQTAQIAIgUCUDnkPAIbAwYLCQgHAwIGFQgCCQoLBBYCAwEC HgECF4AACgkQkA9Fph4S6WoK/gf/eghgBaGoxfXXbNZwZNIC0NUhISasXVYnKNpKCojFl80ZGzI5 mPAFUiQm6aMh3fSrzTIB1uxxd9T9A3KN5ghf9jjtOmpU+uYEm1aW4wHYSWzKDfgfV3QlFOROBn02 V8xc1XPaZr0pqBCSJ18BDVwsI8UG9odw/vPrrcE/Gm3psKJRwaHVGTtvJYPZYB5dQM5XD0shvj7D DSdut5l7DGDGUhp6Q8R32iMkCSTbaJEQNMzUqoIIw/oPrgsVeNxG7zFrkxbdl4YLmuzy9nZhRPLZ 7lWpoRrf3lsvo7WktMEXiW+uAX23wKH3P0gSypcsJ/jbb0nfV1r13/8O8plXwo5Z9LACAAC5AQ0E VPxUlAEIALN/EYmN7OVxEUwJXAgu0xjeAAmd4p8Q0UTX0d7cQCUFo1xltQP3JaITxzAJSFbpSuAV 2b+27Ly6xmLbloJp9bgutqGSW/yWd7UNrxULA77WmSnX6rcgvRXfL75ZMg5JQ04Qffp66IM/NSAo 7rQqDOKgVTHvAomP9AORQKB8vsgSiYRPEMJrkUJH6dXVmRCNKJE27SnM2WDZ1FByQhaWQcIUTCXA FKw89W5PwF10GpIf8JDxlV1gGRyGUuPKjYqCencFvpSZF0PISdSoINDey2D3g5K8epcwIhpfO2Y9 Qti5pzSc9G+2CmFN7oihOhDsIW8WodsBGmJgyRrdzu/woZ8AEQEAAYkBJQQYAQIADwUCVPxUlAIb DAUJCWYBgAAKCRCQD0WmHhLpatS6B/9T7y/L1XRyqopmq3n2Wx05qWZEh6mSqw/BxiunwL7OK9TJ OrxIykpkrcmKGElNKFUJpcLFLGJE+wid6ys0c1EvyQnmp3OPSpaiE+YdRR9xPRCtLUF1ibp2CeKW LOLs6WN+tURAE0GLCqX8K5OyeRvAD2j3aJLcmZbcOFDUEK3Gq00X8bx4kw4LxRW0l/DZdYj/TMoF Ub1FzrdvIvw9L7gbso5xwA1N5YXN8GCIRAg0hIV5t1prFcfx+q2JhijP+vYc3UIjTvpTo+F1KBnI A9NHLxTtREKsGPEuErGG46eyvZ7THl44SkdxWrwvs7Wal6qy7qxz59OOAuu0f0T3ZtHq Subject: Re: svn commit: r342389 - head/share/man/man5 To: Niclas Zeising , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Chris Rees Message-ID: <5766D4AE-C093-4B48-9570-E4FC84E63CF2@FreeBSD.org> X-bayofrum-MailScanner-Information: Please contact the ISP for more information X-bayofrum-MailScanner-ID: B741CA201.A6ECF X-bayofrum-MailScanner: Found to be clean X-bayofrum-MailScanner-From: crees@freebsd.org X-Spam-Status: No X-CTCH-RefID: str=0001.0A0B0211.5C266EE1.0058, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Oo5hNR3t c=1 sm=1 tr=0 a=EuuEpbt/dLJjUk3psnl2FQ==:117 a=EuuEpbt/dLJjUk3psnl2FQ==:17 a=IkcTkHD0fZMA:10 a=2ur7OfE09M0A:10 a=6I5d2MoRAAAA:8 a=JHp-HFoaR3e_a1nUbhwA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: D57B295519 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.97)[-0.974,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 18:43:54 -0000 Hey, On 28 December 2018 18:19:57 GMT+00:00, Niclas Zeising wrote: >On 12/24/18 11:47 AM, Chris Rees wrote: >> Author: crees (doc,ports committer) >> Date: Mon Dec 24 10:47:48 2018 >> New Revision: 342389 >> URL: https://svnweb.freebsd.org/changeset/base/342389 >>=20 >> Log: >> Clarify kld_list format >>=20=20=20=20 >> PR: docs/234248 >> Submitted by: David Fiander >> Submitted by: Miroslav Lachman >>=20 >> Modified: >> head/share/man/man5/rc.conf.5 >>=20 >> Modified: head/share/man/man5/rc.conf.5 >> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 (r342388) >> +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 (r342389) >> @@ -248,12 +248,14 @@ Default >> .Pa /etc/ddb.conf . >> .It Va kld_list >> .Pq Vt str >> -A list of kernel modules to load right after the local >> -disks are mounted. >> +A whitespace-separated list of kernel modules to load right after >> +the local disks are mounted, without any >> +.Pa .ko >> +extension or path. >> Loading modules at this point in the boot process is >> much faster than doing it via >> .Pa /boot/loader.conf >> -for those modules not necessary for mounting local disk. >> +for those modules not necessary for mounting local disks. >> .It Va kldxref_enable >> .Pq Vt bool >> Set to > > >Hi! >Sorry for jumping into this so late. >Please please PLEASE don't break loading modules by path in kld_list.=20 >This is used by the drm-kmod files to distinguish them from the base=20 >modules, and this has been communicated in documentation all over the=20 >place, including numerous ports. > >Can this please be reverted, or amended to match reality. > >In practice, adding both the path and the extension (.ko) to a module >in=20 >kld_list works and the module loads. As the code itself stands, it works for loading, but throws an error if you= try to load an already loaded module adding a .ko extension. In other wor= ds, it works but is wrong. The path actually still does work, which was my= mistake. I'm awaiting approval for this, which correctly handles all cases: https://reviews.freebsd.org/D18670 Konstantin has reviewed, but doesn't feel comfortable giving approval as it= 's not his area, which is fair enough. Chris --=20 This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From owner-svn-src-head@freebsd.org Fri Dec 28 19:02:17 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C431141F1BF; Fri, 28 Dec 2018 19:02:17 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F17FE96075; Fri, 28 Dec 2018 19:02:16 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 43RGKg4kDKzDjFf; Fri, 28 Dec 2018 19:02:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id hyhiu73-pgvA; Fri, 28 Dec 2018 19:02:15 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:25be:edfd:c331:f8d8]) by mail.daemonic.se (Postfix) with ESMTPSA id 43RGKf7065zDjFd; Fri, 28 Dec 2018 19:02:14 +0000 (UTC) Subject: Re: svn commit: r342389 - head/share/man/man5 To: Chris Rees , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812241047.wBOAlmwc092761@repo.freebsd.org> <1c2d5b66-42f2-63e6-9f62-aa383e9b79b9@freebsd.org> <5766D4AE-C093-4B48-9570-E4FC84E63CF2@FreeBSD.org> From: Niclas Zeising Message-ID: Date: Fri, 28 Dec 2018 20:02:14 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <5766D4AE-C093-4B48-9570-E4FC84E63CF2@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: F17FE96075 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 19:02:17 -0000 On 12/28/18 7:43 PM, Chris Rees wrote: > Hey, > > On 28 December 2018 18:19:57 GMT+00:00, Niclas Zeising wrote: >> On 12/24/18 11:47 AM, Chris Rees wrote: >>> Author: crees (doc,ports committer) >>> Date: Mon Dec 24 10:47:48 2018 >>> New Revision: 342389 >>> URL: https://svnweb.freebsd.org/changeset/base/342389 >>> >>> Log: >>> Clarify kld_list format >>> >>> PR: docs/234248 >>> Submitted by: David Fiander >>> Submitted by: Miroslav Lachman >>> >>> Modified: >>> head/share/man/man5/rc.conf.5 >>> >>> Modified: head/share/man/man5/rc.conf.5 >>> >> ============================================================================== >>> --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 2018 (r342388) >>> +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 2018 (r342389) >>> @@ -248,12 +248,14 @@ Default >>> .Pa /etc/ddb.conf . >>> .It Va kld_list >>> .Pq Vt str >>> -A list of kernel modules to load right after the local >>> -disks are mounted. >>> +A whitespace-separated list of kernel modules to load right after >>> +the local disks are mounted, without any >>> +.Pa .ko >>> +extension or path. >>> Loading modules at this point in the boot process is >>> much faster than doing it via >>> .Pa /boot/loader.conf >>> -for those modules not necessary for mounting local disk. >>> +for those modules not necessary for mounting local disks. >>> .It Va kldxref_enable >>> .Pq Vt bool >>> Set to >> >> >> Hi! >> Sorry for jumping into this so late. >> Please please PLEASE don't break loading modules by path in kld_list. >> This is used by the drm-kmod files to distinguish them from the base >> modules, and this has been communicated in documentation all over the >> place, including numerous ports. >> >> Can this please be reverted, or amended to match reality. >> >> In practice, adding both the path and the extension (.ko) to a module >> in >> kld_list works and the module loads. > > As the code itself stands, it works for loading, but throws an error if you try to load an already loaded module adding a .ko extension. In other words, it works but is wrong. The path actually still does work, which was my mistake. > > I'm awaiting approval for this, which correctly handles all cases: > > https://reviews.freebsd.org/D18670 > > Konstantin has reviewed, but doesn't feel comfortable giving approval as it's not his area, which is fair enough. > > Chris > Ok. Will this continue to work when loading /path/to/foo.ko rather than path/to/foo? (I assume it will) Regards -- Niclas Zeising From owner-svn-src-head@freebsd.org Fri Dec 28 19:08:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37863141F304; Fri, 28 Dec 2018 19:08:51 +0000 (UTC) (envelope-from crees@freebsd.org) Received: from mail56c50.megamailservers.eu (mail168c50.megamailservers.eu [91.136.10.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EFF396366; Fri, 28 Dec 2018 19:08:50 +0000 (UTC) (envelope-from crees@freebsd.org) X-Authenticated-User: bayofrum@uwclub.net Received: from pegasus.bayofrum.net (host-80-41-58-105.as13285.net [80.41.58.105]) (authenticated bits=0) by mail56c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id wBSJ8kSj013950; Fri, 28 Dec 2018 19:08:47 +0000 Received: from android-4497c5999ce4d9aa.bayofrum.net (android-4497c5999ce4d9aa.bayofrum.net [192.168.1.115]) by pegasus.bayofrum.net (Postfix) with ESMTPSA id 7F1F6A308; Fri, 28 Dec 2018 19:08:41 +0000 (GMT) Date: Fri, 28 Dec 2018 19:08:38 +0000 User-Agent: K-9 Mail for Android In-Reply-To: References: <201812241047.wBOAlmwc092761@repo.freebsd.org> <1c2d5b66-42f2-63e6-9f62-aa383e9b79b9@freebsd.org> <5766D4AE-C093-4B48-9570-E4FC84E63CF2@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Autocrypt: addr=crees@FreeBSD.org; keydata= mQENBFA55DwBCADLmiSSORwcGwNoCi2X02jPmS2lcZXWp5uCtzx0ybPM65tIQAIIL5e8QzyrV+r/ yyNdGJIKtl4ty69aVodQ6n6Xf2BGqmm/x6jlvg2BrJgNHYfAjkIVtugkbwsMQxHkNmOlB+fURVPJ k9xub4pz9kRRdtXJ3DiImQRw5XVe2ZvBXZuu2nOzjw2zArEaBSLbjo1MlXWJvvuyA2ktaKcAjFyf z/VJ8M/RDbJdfYDB9Q78jrr4uwIMlyWSWUD8RxAvbWw0My2tr1Nu9FDvsydbKygGnZ+7oo4zvqnc GZ+0am6D3XSsOcaf/bzB8pIGJ1hsSe9JHvYpLvnWCwP+AJtKTPwFABEBAAG0HkNocmlzIFJlZXMg PGNyZWVzQEZyZWVCU0Qub3JnPokBOAQTAQIAIgUCUDnkPAIbAwYLCQgHAwIGFQgCCQoLBBYCAwEC HgECF4AACgkQkA9Fph4S6WoK/gf/eghgBaGoxfXXbNZwZNIC0NUhISasXVYnKNpKCojFl80ZGzI5 mPAFUiQm6aMh3fSrzTIB1uxxd9T9A3KN5ghf9jjtOmpU+uYEm1aW4wHYSWzKDfgfV3QlFOROBn02 V8xc1XPaZr0pqBCSJ18BDVwsI8UG9odw/vPrrcE/Gm3psKJRwaHVGTtvJYPZYB5dQM5XD0shvj7D DSdut5l7DGDGUhp6Q8R32iMkCSTbaJEQNMzUqoIIw/oPrgsVeNxG7zFrkxbdl4YLmuzy9nZhRPLZ 7lWpoRrf3lsvo7WktMEXiW+uAX23wKH3P0gSypcsJ/jbb0nfV1r13/8O8plXwo5Z9LACAAC5AQ0E VPxUlAEIALN/EYmN7OVxEUwJXAgu0xjeAAmd4p8Q0UTX0d7cQCUFo1xltQP3JaITxzAJSFbpSuAV 2b+27Ly6xmLbloJp9bgutqGSW/yWd7UNrxULA77WmSnX6rcgvRXfL75ZMg5JQ04Qffp66IM/NSAo 7rQqDOKgVTHvAomP9AORQKB8vsgSiYRPEMJrkUJH6dXVmRCNKJE27SnM2WDZ1FByQhaWQcIUTCXA FKw89W5PwF10GpIf8JDxlV1gGRyGUuPKjYqCencFvpSZF0PISdSoINDey2D3g5K8epcwIhpfO2Y9 Qti5pzSc9G+2CmFN7oihOhDsIW8WodsBGmJgyRrdzu/woZ8AEQEAAYkBJQQYAQIADwUCVPxUlAIb DAUJCWYBgAAKCRCQD0WmHhLpatS6B/9T7y/L1XRyqopmq3n2Wx05qWZEh6mSqw/BxiunwL7OK9TJ OrxIykpkrcmKGElNKFUJpcLFLGJE+wid6ys0c1EvyQnmp3OPSpaiE+YdRR9xPRCtLUF1ibp2CeKW LOLs6WN+tURAE0GLCqX8K5OyeRvAD2j3aJLcmZbcOFDUEK3Gq00X8bx4kw4LxRW0l/DZdYj/TMoF Ub1FzrdvIvw9L7gbso5xwA1N5YXN8GCIRAg0hIV5t1prFcfx+q2JhijP+vYc3UIjTvpTo+F1KBnI A9NHLxTtREKsGPEuErGG46eyvZ7THl44SkdxWrwvs7Wal6qy7qxz59OOAuu0f0T3ZtHq Subject: Re: svn commit: r342389 - head/share/man/man5 To: Niclas Zeising , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Chris Rees Message-ID: <9956BAC0-1CBC-47C5-BFAF-85931CC94201@FreeBSD.org> X-bayofrum-MailScanner-Information: Please contact the ISP for more information X-bayofrum-MailScanner-ID: 7F1F6A308.A75C5 X-bayofrum-MailScanner: Found to be clean X-bayofrum-MailScanner-From: crees@freebsd.org X-Spam-Status: No X-CTCH-RefID: str=0001.0A0B0214.5C2674C0.002A, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=Oo5hNR3t c=1 sm=1 tr=0 a=EuuEpbt/dLJjUk3psnl2FQ==:117 a=EuuEpbt/dLJjUk3psnl2FQ==:17 a=IkcTkHD0fZMA:10 a=2ur7OfE09M0A:10 a=6I5d2MoRAAAA:8 a=rjS4v_Ixg7xyYl4jwVMA:9 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 X-Rspamd-Queue-Id: 6EFF396366 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 19:08:51 -0000 On 28 December 2018 19:02:14 GMT+00:00, Niclas Zeising wrote: >On 12/28/18 7:43 PM, Chris Rees wrote: >> Hey, >>=20 >> On 28 December 2018 18:19:57 GMT+00:00, Niclas Zeising > wrote: >>> On 12/24/18 11:47 AM, Chris Rees wrote: >>>> Author: crees (doc,ports committer) >>>> Date: Mon Dec 24 10:47:48 2018 >>>> New Revision: 342389 >>>> URL: https://svnweb.freebsd.org/changeset/base/342389 >>>> >>>> Log: >>>> Clarify kld_list format >>>>=20=20=20=20=20 >>>> PR: docs/234248 >>>> Submitted by: David Fiander >>>> Submitted by: Miroslav Lachman >>>> >>>> Modified: >>>> head/share/man/man5/rc.conf.5 >>>> >>>> Modified: head/share/man/man5/rc.conf.5 >>>> >>> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >>>> --- head/share/man/man5/rc.conf.5 Mon Dec 24 06:14:32 >2018 (r342388) >>>> +++ head/share/man/man5/rc.conf.5 Mon Dec 24 10:47:48 >2018 (r342389) >>>> @@ -248,12 +248,14 @@ Default >>>> .Pa /etc/ddb.conf . >>>> .It Va kld_list >>>> .Pq Vt str >>>> -A list of kernel modules to load right after the local >>>> -disks are mounted. >>>> +A whitespace-separated list of kernel modules to load right after >>>> +the local disks are mounted, without any >>>> +.Pa .ko >>>> +extension or path. >>>> Loading modules at this point in the boot process is >>>> much faster than doing it via >>>> .Pa /boot/loader.conf >>>> -for those modules not necessary for mounting local disk. >>>> +for those modules not necessary for mounting local disks. >>>> .It Va kldxref_enable >>>> .Pq Vt bool >>>> Set to >>> >>> >>> Hi! >>> Sorry for jumping into this so late. >>> Please please PLEASE don't break loading modules by path in >kld_list. >>> This is used by the drm-kmod files to distinguish them from the base >>> modules, and this has been communicated in documentation all over >the >>> place, including numerous ports. >>> >>> Can this please be reverted, or amended to match reality. >>> >>> In practice, adding both the path and the extension (.ko) to a >module >>> in >>> kld_list works and the module loads. >>=20 >> As the code itself stands, it works for loading, but throws an error >if you try to load an already loaded module adding a .ko extension. In >other words, it works but is wrong. The path actually still does work, >which was my mistake. >>=20 >> I'm awaiting approval for this, which correctly handles all cases: >>=20 >> https://reviews.freebsd.org/D18670 >>=20 >> Konstantin has reviewed, but doesn't feel comfortable giving approval >as it's not his area, which is fair enough. >>=20 >> Chris >>=20 > >Ok. >Will this continue to work when loading /path/to/foo.ko rather than=20 >path/to/foo? (I assume it will) >Regards Unlike now, it will work correctly, including if the module is already load= ed. Chris --=20 This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. From owner-svn-src-head@freebsd.org Fri Dec 28 19:49:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82C741420A15; Fri, 28 Dec 2018 19:49:59 +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) server-signature RSA-PSS (4096 bits) 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 25E1B97B95; Fri, 28 Dec 2018 19:49:59 +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 1AFB4277F0; Fri, 28 Dec 2018 19:49:59 +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 wBSJnwj4055287; Fri, 28 Dec 2018 19:49:58 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBSJnwag055285; Fri, 28 Dec 2018 19:49:58 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201812281949.wBSJnwag055285@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: Fri, 28 Dec 2018 19:49:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342578 - 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: 342578 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25E1B97B95 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 19:49:59 -0000 Author: 0mp (ports committer) Date: Fri Dec 28 19:49:58 2018 New Revision: 342578 URL: https://svnweb.freebsd.org/changeset/base/342578 Log: Add a style.mdoc(5) manual page. The aim of this manual page is to act as a style and formatting guide for mdoc(7) manual pages. Currently, mdoc(7) does not provide much guidance when it comes to the usage of macros making it difficult to format manual pages in a consistent way. Reviewed by: bcr Approved by: bcr (doc), krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18394 Added: head/share/man/man5/style.mdoc.5 (contents, props changed) Modified: head/share/man/man5/Makefile Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Fri Dec 28 17:51:40 2018 (r342577) +++ head/share/man/man5/Makefile Fri Dec 28 19:49:58 2018 (r342578) @@ -66,6 +66,7 @@ MAN= acct.5 \ src.conf.5 \ stab.5 \ style.Makefile.5 \ + style.mdoc.5 \ sysctl.conf.5 \ tmpfs.5 Added: head/share/man/man5/style.mdoc.5 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man5/style.mdoc.5 Fri Dec 28 19:49:58 2018 (r342578) @@ -0,0 +1,205 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2018 Mateusz Piotrowski <0mp@FreeBSD.org> +.\" +.\" 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 December 28, 2018 +.Dt STYLE.MDOC 5 +.Os +.Sh NAME +.Nm style.mdoc +.Nd +.Fx +.Xr mdoc 7 +file style guide +.Sh DESCRIPTION +This file specifies the preferred style for manual pages in the +.Fx +source tree. +.Ss Code examples +.Bl -dash -width "" +.It +Use literal formatting for examples and literal shell commands, e.g.: +.Bd -literal -offset indent +Then run +\&.Dq Li make install clean . +.Ed +.Pp +which renders as: +.Bd -filled -offset indent +Then run +.Dq Li make install clean . +.Ed +.Pp +The incorrect way would be to use macros like +.Sy \&Nm +to stylize the command invocation: +.Bd -literal -offset indent +Then run +\&.Dq Nm make Cm install Cm clean . +.Ed +.Pp +which renders as: +.Bd -filled -offset indent +Then run +.Dq Nm make Cm install Cm clean . +.Ed +.El +.Ss Synopsis formatting +.Bl -dash -width "" +.It +Do not put whitespace between alternative parameters separated with a pipe +.Pq Dq | , +e.g.: +.Bd -literal -offset indent +\&.Cm compression Cm on Ns | Ns Cm off +\&.Cm install Fl -all Ns | Ns Ar portname Ar ... +.Ed +.Pp +which in the SYNOPSIS section is rendered as: +.Bd -unfilled -offset indent +.Cm compression Cm on Ns | Ns Cm off +.Cm install Fl -all Ns | Ns Ar portname Ar ... +.Ed +.It +Use +.Sy \&Cm +to stylize characters that are command modifiers +.Po e.g., +.Dq \&, , +.Dq @ +or +.Dq "=" +.Pc . +For example: +.Bd -literal -offset indent +\&.Sm off +\&.Fl -meet Cm = Ar who Oo Cm \&, Ar who " " Ar "..." Oc Cm @ Ar where +\&.Sm on +.Ed +.Pp +which renders as: +.Bd -filled -offset indent +.Sm off +.Fl -meet Cm = Ar who Oo Cm \&, Ar who " " Ar "..." Oc Cm @ Ar where +.Sm on +.Ed +.Pp +instead of: +.Bd -literal -offset indent +\&.Sm off +\&.Fl -meet No = Ar who Oo , Ar who " " Ar "..." Oc @ Ar where +\&.Sm on +.Ed +.Pp +which would render as: +.Bd -filled -offset indent +.Sm off +.Fl -meet No = Ar who Oo , Ar who " " Ar "..." Oc @ Ar where +.Sm on +.Ed +.Pp +It is important to realize that in the correct example, +.Dq \&, , +.Dq @ +and +.Dq = +are stylized with +.Sy \&Cm . +At the same time, the square brackets +.Pq Dq "[]" +are not stylized as they do not belong to the syntax of the +.Fl -meet +flag. +.El +.Ss Quoting +.Bl -dash -width "" +.It +Use the +.Sy \&Dq +.Pq Do Dc +macro +for quoting. +Use the +.Sy \&Sq +.Pq So Sc +macro for quoting inside quotes. +The use of the +.Sy \&Qq +.Pq Qo Qc +macro is usually not necessary. +.El +.Ss Variables +.Bl -dash -width "" +.It +Use +.Sy \&Va +instead of: +.Sy \&Dv +for +.Xr sysctl 8 +variables like +.Va kdb.enter.panic . +.It +Use the angle brackets +.Sy \&Aq +.Pq Dq "<>" +macro +for arguments +.Pq Sy \&Ar +when they are mixed with similarly stylized macros like +.Sy \&Pa +or +.Sy \&Va , +e.g.: +.Bd -literal -offset indent +\&.Va critical_filesystems_ Ns Aq Ar type +.Ed +.Pp +which renders as: +.Bd -filled -offset indent +.Va critical_filesystems_ Ns Aq Ar type +.Ed +.Pp +instead of: +.Bd -literal -offset indent +\&.Va critical_filesystems_ Ns Ar type +.Ed +.Pp +that would be rendered as: +.Bd -filled -offset indent +.Va critical_filesystems_ Ns Ar type +.Ed +.El +.Sh SEE ALSO +.Xr man 1 , +.Xr mandoc 1 , +.Xr mdoc 7 +.Sh HISTORY +This manual page first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org From owner-svn-src-head@freebsd.org Fri Dec 28 21:26:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CA6E1423144; Fri, 28 Dec 2018 21:26:46 +0000 (UTC) (envelope-from bcran@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) server-signature RSA-PSS (4096 bits) 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 C73056C6C8; Fri, 28 Dec 2018 21:26:45 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B6AB5951; Fri, 28 Dec 2018 21:26:45 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBSLQjU0008701; Fri, 28 Dec 2018 21:26:45 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBSLQjwb008700; Fri, 28 Dec 2018 21:26:45 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812282126.wBSLQjwb008700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Fri, 28 Dec 2018 21:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342579 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 342579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C73056C6C8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 21:26:46 -0000 Author: bcran Date: Fri Dec 28 21:26:45 2018 New Revision: 342579 URL: https://svnweb.freebsd.org/changeset/base/342579 Log: Improve the efibootmgr(8) man page Fix formatting, typos, and attempt to improve the wording. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18646 Modified: head/usr.sbin/efibootmgr/efibootmgr.8 Modified: head/usr.sbin/efibootmgr/efibootmgr.8 ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.8 Fri Dec 28 19:49:58 2018 (r342578) +++ head/usr.sbin/efibootmgr/efibootmgr.8 Fri Dec 28 21:26:45 2018 (r342579) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2017 Netflix, Inc +.\" Copyright (c) 2017-2018 Netflix, Inc .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,19 +24,19 @@ .\" .\" $FreeBSD$ .\" -.Dd May 8, 2018 +.Dd December 28, 2018 .Dt EFIBOOTMGR 8 .Os .Sh NAME .Nm efibootmgr .Nd manipulate the EFI Boot Manager .Sh SYNOPSIS -.Op Fl aAnNB Ar Bootvar +.Op Fl aAnNB Ar bootnum .Op Fl t Ar timeout .Op Fl T .Op Fl o Ar bootorder -.Op Fl verbose -.Op Fl c -k Ar kernel -l Ar loader [-L Ar label] [--dry-run] [-b Bootvar] +.Op Fl v +.Op Fl c l Ar loader [ Fl k Ar kernel ] [ Fl L Ar label ] [ Fl -dry-run ] [ Fl b Ar bootnum ] .Sh "DESCRIPTION" .Nm manipulates how UEFI Boot Managers boot the system. @@ -59,7 +59,7 @@ The currently booting method is communicated using A global timeout can also be set. .Pp .Nm -requires that the kernel efirt module to get and set these +requires that the kernel efirt module be loaded to get and set these non-volatile variables. .Pp The following options are available: @@ -70,45 +70,45 @@ Create a new Boot Variable The path to and name of the loader. .It Fl k -kernel Ar kernel The path to and name of the kernel. -.It Fl b Bootvar -When creating an entry, use Bootvar as the index. +.It Fl b -bootnum Ar bootnum +When creating a new entry, use bootnum as the index. Fail if it already exists. .It Fl L -label Ar label An optional description for the entry. .It Fl D -dry-run -Process but do not set the given BootVar. -.It Fl B -delete Ar BootVarNum -Delete the given BootVar Num. -.It Fl a -activate Ar BootVarNum -Activate the given BootVarNum. -.It Fl A -deactivate Ar BootVarNum -Deactivate the given BootVarNum. -.It Fl n -bootnext Ar BootVarNum -Set BootVarNum as the BootNext variable. +Process but do not change any variables. +.It Fl B -delete Ar bootnum +Delete the given bootnum boot entry. +.It Fl a -activate Ar bootnum +Activate the given bootnum boot entry. +.It Fl A -deactivate Ar bootnum +Deactivate the given bootnum boot entry. +.It Fl n -bootnext Ar bootnum +Set bootnum boot entry as the BootNext variable. .It Fl N -delete-bootnext -Delete the BootNext optional BootVar. +Delete the BootNext optional variable. .It Fl o -bootorder Ar bootorder -Set BootOrder variable to the given comma delimited set of BootVarNums. +Set BootOrder variable to the given comma delimited set of bootnums. The numbers are in hex to match BootXXXX, but may omit leading zeros. .It Fl t -set-timeout Ar timeout Set the bootmenu timeout value. .It Fl T -del-timeout Delete the BootTimeout variable. .It Fl v -verbose -Display the device path of BootVars in the output. +Display the device path of boot entries in the output. .El .Pp -.Sh Exammples +.Sh Examples .Pp To Display the current Boot related variables in the system: .Pp .Dl efibootmgr [-v] .Pp -This will display the optional BootNext BootVar, BootCurrent, -or currently booted BootVar, followed by the optional Timeout value, any -BootOrder that maybe set, followed finally by all currently defined Boot +This will display the optional BootNext bootnum, BootCurrent, +or currently booted bootnum, followed by the optional Timeout value, any +BootOrder that may be set, followed finally by all currently defined Boot variables, active or not. The verbose flag will augment this output with -the hardrive partition uuids, size/offset and device-path of the +the disk partition uuids, size/offset and device-path of the variable. .Pp The @@ -117,28 +117,28 @@ program can be used to create new EFI boot variables. boot var pointing to an installation with its EFI partition mounted under /mnt, the given loader and a label "FreeBSD-11": .Pp -.Dl efibootmgr -c -l /mnt/EFI/BOOT/BOOTX64.EFI -L FreeBSD-11 +.Dl efibootmgr -c -l /mnt/EFI/freebsd/loader.efi -L FreeBSD-11 .Pp -This will result in the next available BootVarNum being assigned to a -new UEFI load variable, and given the label "FreeBSD-11" such as: +This will result in the next available bootnum being assigned to a +new UEFI boot variable, and given the label "FreeBSD-11" such as: .Pp .Dl Boot0009 FreeBSD-11 .Pp -Note newly created BootVars are created inactive. The active state is denoted -by an '*' following the BootVar name in the output. They are also inserted +Note newly created boot entries are created inactive. The active state is denoted +by an '*' following the BootXXXX name in the output. They are also inserted into the first position of current BootOrder variable if it exists. They must first be set to active before being considered available to attempt booting from, else they are ignored. .Pp .Dl efibootmgr -B 0009 .Pp -Will delete the given BootVar Boot0009 +Will delete the given boot entry Boot0009 .Pp -To set a given newly created BootVar active use: +To set a given newly created boot entry active use: .Pp .Dl efibootmgr -a 0009 .Pp -To set a given BootVar to be used as the BootNext variable, irrespective +To set a given boot entry to be used as the BootNext variable, irrespective of its active state, use: .Pp .Dl efibootmgr -n 0009 From owner-svn-src-head@freebsd.org Fri Dec 28 22:47:56 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B186A1424E6A; Fri, 28 Dec 2018 22:47:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 5904B6EBCE; Fri, 28 Dec 2018 22:47:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A93016DC; Fri, 28 Dec 2018 22:47:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBSMlu2G050439; Fri, 28 Dec 2018 22:47:56 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBSMlu72050438; Fri, 28 Dec 2018 22:47:56 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201812282247.wBSMlu72050438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 28 Dec 2018 22:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342580 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 342580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5904B6EBCE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 22:47:56 -0000 Author: emaste Date: Fri Dec 28 22:47:55 2018 New Revision: 342580 URL: https://svnweb.freebsd.org/changeset/base/342580 Log: ar: detect and error out on 32-bit symbol table overflow BSD ar currently does not support the /SYM64/ 64-bit symbol table, and previously truncated to 32-bits, silently producing corrupted archives larger than 4GB. This is another overflow case in addtion to r342575. PR: 234454 Reported by: Aijaz Baig, imp MFC after: 2 weeks MFC with: r342575 Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/ar/write.c Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Fri Dec 28 21:26:45 2018 (r342579) +++ head/usr.bin/ar/write.c Fri Dec 28 22:47:55 2018 (r342580) @@ -628,6 +628,9 @@ write_objs(struct bsdar *bsdar) if (strlen(obj->name) > _MAXNAMELEN_SVR4) add_to_ar_str_table(bsdar, obj->name); bsdar->rela_off += _ARHDR_LEN + obj->size + obj->size % 2; + if (bsdar->rela_off > UINT32_MAX) + bsdar_errc(bsdar, EX_SOFTWARE, 0, + "Symbol table offset overflow"); } /* From owner-svn-src-head@freebsd.org Fri Dec 28 23:27:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76F9D1425EA9; Fri, 28 Dec 2018 23:27:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A7696FFC6; Fri, 28 Dec 2018 23:27:03 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wBSNQpl5052244; Fri, 28 Dec 2018 15:26:52 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wBSNQp3H052243; Fri, 28 Dec 2018 15:26:51 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201812282326.wBSNQp3H052243@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r342576 - head/share/skel In-Reply-To: <201812281750.wBSHofEt092542@repo.freebsd.org> To: Edward Tomasz Napierala Date: Fri, 28 Dec 2018 15:26:51 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 9A7696FFC6 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 23:27:04 -0000 > Author: trasz > Date: Fri Dec 28 17:50:40 2018 > New Revision: 342576 > URL: https://svnweb.freebsd.org/changeset/base/342576 > > Log: > Simplify the way we set the default sh(1) PS1. No functional changes. > > Reviewed by: jilles > MFC after: 2 weeks > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D18662 > > Modified: > head/share/skel/dot.shrc > > Modified: head/share/skel/dot.shrc > ============================================================================== > --- head/share/skel/dot.shrc Fri Dec 28 17:00:12 2018 (r342575) > +++ head/share/skel/dot.shrc Fri Dec 28 17:50:40 2018 (r342576) > @@ -33,11 +33,7 @@ alias g='egrep -i' > > > # # set prompt: ``username@hostname$ '' > -# PS1="`whoami`@`hostname | sed 's/\..*//'`" > -# case `id -u` in > -# 0) PS1="${PS1}# ";; > -# *) PS1="${PS1}$ ";; > -# esac > +# PS1="`whoami`@\h\\$ " You lost the fact that for root the prompt ends in # > > # search path for cd(1) > # CDPATH=:$HOME > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Dec 28 23:50:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A4F1426370; Fri, 28 Dec 2018 23:50:09 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F417707ED; Fri, 28 Dec 2018 23:50:08 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 119AB21B42; Fri, 28 Dec 2018 18:50:02 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Fri, 28 Dec 2018 18:50:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.net; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; s=fm3; bh=ectx403YbTVeSAnIe+HPmxNfCZI gcD88NEV6g2uoMhI=; b=r7VhcFocf1X5lCsCjko0qIEulm0wHxH7/l29+kf/mKN h9xvR1rI7WoSo6kvc812TJvRyNnD5EUdIr7tRfHg1QT56tVFQBvtmV7KVDeboLyi yTvtiKoXyO6KyCv0gTfprAUkmj26HUJcsLvgkn4OaxAQYBFbdexCx55R7J9D4+6j BmRV7+A/uiJo6NX6jHJQJU1/GbUwrf9S7Wycr+CZrCgS+b0GXF0Z/NjNmjyvgQY9 TthPoTL7BPdorAFTeDmBhUFlAPkxG4cO+5COshmaBk5J1hSAvQQnjSYsyBb9tqAK 5KcD5GoRmdYVhvI1gpV7HiTsww9GtBOLIkjZv+GVsLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=ectx40 3YbTVeSAnIe+HPmxNfCZIgcD88NEV6g2uoMhI=; b=hchP8hpyT4uv+BqbuOK43J V0Kp9V75ezmAUojG9ImuusFevjOW1kR2QSyuG5GeQYmMbSSlXorgQT93BX9an4pZ fGYhSFIEQum5QlYuv4pRnslJf4JaWQj4MI/EMlxgSF0LvwTOXMJ70OwPtqFfpvbs 2AK2AlHnb4QalbCDima4VR1iFFH6lFQnv6GA90zOD8n9kRSzkvDizrRqZRLDmxv2 2P+UzbIAeXBD0MfNZEP4Fkxg3jIKkPQRDg620VRW7491nOZojP02lK3tbdlOU2W4 xIUrN87yfuWQZuTGynI/HqOI5zBLsvsRf1FWCxTRpXal7T9l8ee2nsG0/b7O4HeQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrtdejgddtleculddtuddrgedtkedrtddtmd cutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfhuthen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgesghdtre fotdefjeenucfhrhhomhepjghurhhiucfrrghnkhhovhcuoeihuhhrihhpvheshihurhhi phhvrdhnvghtqeenucffohhmrghinhepfhhrvggvsghsugdrohhrghenucfkphepkeehrd dujeefrddvjedrvddtleenucfrrghrrghmpehmrghilhhfrhhomhephihurhhiphhvseih uhhrihhpvhdrnhgvthenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.2] (unknown [85.173.27.209]) by mail.messagingengine.com (Postfix) with ESMTPA id 91377E461F; Fri, 28 Dec 2018 18:49:59 -0500 (EST) Subject: Re: svn commit: r342576 - head/share/skel To: rgrimes@freebsd.org, Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812282326.wBSNQp3H052243@pdx.rh.CN85.dnsmgr.net> From: Yuri Pankov Openpgp: preference=signencrypt Autocrypt: addr=yuripv@yuripv.net; keydata= mQENBFu8u6IBCADB11gP0QwnorrHjqAtKLHKHNHskhy0s7jqJKfx0YqXgVBKGLJ9/mjLAz0F CBNvemHSDDTs0mEZ9cBKKi6cmsav6+UQgr//yai6hvXLBJqKchSFO4MhmdvBtsGFq1yKz5Zi uhjmimKyIpgBgvMdbgGbGq6cnSB2uEPmZuJr419SVRODOkXukU+F5WHgaHzDdHAIu1asCt2B +6msxqIqlFWcXyZyTGicTGGvC/PFIsVRUtD1dIJANTC876g7DTb7LZXWiWwJpSJ4GKMXMHVX Ct9BoQ4i3nhKbOxb6Io1wsy+NFyWsTJ9KYrxKKPJP3oG8BWb/cqlFqnE4eNSsiq2q7krABEB AAG0H1l1cmkgUGFua292IDx5dXJpcHZAeXVyaXB2Lm5ldD6JAVcEEwEIAEECGwMFCQWjmoAF CwkIBwMFFQoJCAsFFgMCAQACHgECF4AWIQT4arc+w94tPi0v/3CTi+B/sSrhbAUCW708wAIZ AQAKCRCTi+B/sSrhbPxBB/961alcU091O+yKT5/oReHVc/PX0Tz4sW3V44AcgLfYlrZavCro EFz90qmCrl0xqEwuAKcC4bjmL8SjPWAhSN6IH9nxdw+HeZnAPiHm/q679Bu47+nHBl3qD/9p +t1PkKeKZfaWToFMt1nq06ytSu6VLMCwLdlDNe6DReX0ex/afEqKsuaIZSKL4UYjRwklp8PU Uf98QkrfapyHB67hQMzfI4tPeJaYyv0cTgfq3kUWJx1V6Xi0b6Zxj4ZrB2TXvaMO5g7yhU9E E3WWAvoe4FgB3a7dHe8atnHhq5+Cuvm6+LD4Jh7jvMAE5UMN+xxQpnGpNghHjaCy4vXrLRBZ nhRYuQENBFu8u6IBCADKih3Q933rDNj4ZA8FhBQ2RlmBgvwOLcDPIL3h0V7h38y3+HisgFSc XACDsdrTlYZ1bRXkD9FHENynBcv0l/3uGJDk8jaGIDE0TP8OQBRp+IaU9/BHnAqrKxTJGIol Dahy2m+yx2yhdc6B4ujWMDqCF1rWOD+ymOWw+VLllOkrHcZa5PJtX9UOGbApZl8ZTM8El4CA NN8F1bg9MWzUi+8LYoGWGc+BwsFS1OUB1c4SPgMu5fD4Wfsr9yRl06fdpEA2YT7B/j5/5RSC 0sE2Zs/tmJ/JRflHJ12ycj59ma2xQMfEJF40hZDpMFQmZvbVqgEg3ocQcltjbxlIKZ/mjC4z ABEBAAGJATwEGAEKACYWIQT4arc+w94tPi0v/3CTi+B/sSrhbAUCW7y7ogIbDAUJBaOagAAK CRCTi+B/sSrhbIDcCACqAZMcoxUBLZa40a5b24j5i1jplvCYYb3h+Q5lt5+BFJ87kCb4dJuU D3kh2i29BrxWQWa9WNue9ozxeYkbkfXubQYXexVolRsnh64OdGsE8KvorBFBB3zdK/GRt2Jy +jsnTfUWuQllbzMP0MfhCDMk1Mo8WvDH2/cOEP/yLKf20a+cd6nLs7bidjmGXo9pyuBKAtV6 Kv+VRu54AL+A/UBYu/eB3Dtvzcnut+1Zq6KaP++kUwPwINLIk04OBDwN0zRNTiqMAFYYyz2v ZHBB6E1th/l//ZC5b9Dk0ZpFI1bYdL9ymnrZe1MqbGPnDCToQxu00T/pZCm6Z92YrZQYuNwl Message-ID: Date: Sat, 29 Dec 2018 02:49:48 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201812282326.wBSNQp3H052243@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ma69spvSY9IqCIZapbV7JtZcd8y48FAA5" X-Rspamd-Queue-Id: 0F417707ED X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.985,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2018 23:50:09 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ma69spvSY9IqCIZapbV7JtZcd8y48FAA5 Content-Type: multipart/mixed; boundary="F8zu6r3rI3vgRbn10awMGJLjtnEf3Xw7A"; protected-headers="v1" From: Yuri Pankov To: rgrimes@freebsd.org, Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r342576 - head/share/skel References: <201812282326.wBSNQp3H052243@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201812282326.wBSNQp3H052243@pdx.rh.CN85.dnsmgr.net> --F8zu6r3rI3vgRbn10awMGJLjtnEf3Xw7A Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Rodney W. Grimes wrote: >> Author: trasz >> Date: Fri Dec 28 17:50:40 2018 >> New Revision: 342576 >> URL: https://svnweb.freebsd.org/changeset/base/342576 >> >> Log: >> Simplify the way we set the default sh(1) PS1. No functional change= s. >> =20 >> Reviewed by: jilles >> MFC after: 2 weeks >> Sponsored by: DARPA, AFRL >> Differential Revision: https://reviews.freebsd.org/D18662 >> >> Modified: >> head/share/skel/dot.shrc >> >> Modified: head/share/skel/dot.shrc >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/share/skel/dot.shrc Fri Dec 28 17:00:12 2018 (r342575) >> +++ head/share/skel/dot.shrc Fri Dec 28 17:50:40 2018 (r342576) >> @@ -33,11 +33,7 @@ alias g=3D'egrep -i' >> =20 >> =20 >> # # set prompt: ``username@hostname$ ''=20 >> -# PS1=3D"`whoami`@`hostname | sed 's/\..*//'`" >> -# case `id -u` in >> -# 0) PS1=3D"${PS1}# ";; >> -# *) PS1=3D"${PS1}$ ";; >> -# esac >> +# PS1=3D"`whoami`@\h\\$ " >=20 > You lost the fact that for root the prompt ends in # Note that '$' is not literal here. '\$' is expanded to '$' for normal users, and to '#' for superusers. >> =20 >> # search path for cd(1) >> # CDPATH=3D:$HOME >> >> >=20 --F8zu6r3rI3vgRbn10awMGJLjtnEf3Xw7A-- --ma69spvSY9IqCIZapbV7JtZcd8y48FAA5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEE+Gq3PsPeLT4tL/9wk4vgf7Eq4WwFAlwmtqUACgkQk4vgf7Eq 4WzGfwf+Ldhw3Gn6UONalTItPly+NWE1++/vuBpZNhh24bGF1zWMQUXiCoSAsfLA EZQZZFqyRj7McwPXRASK6P3fZbHn3avkAyIfDUI6wP9ALVljwLvHzJYlsD6mRM/V ZyFvcIQxkvzH6SSr6RSPcH0pQGYr1kH7uJLA9uzXtVneijWZp3D3KC/2sViEnX5z 1ceF/oQAYjrb/2Zw5hMqIiwoKiPqCUOBZHOXWmchdg9boL5fW3ZqqLvPBTRhGPnp 4jqajUUAfTqFOkK2fhkENUSxmr4ZxbDwM4TxY5k9JLCfmzbQymDo3YAAT41DelAH sAlClqVzrZuKfrb1+28WdHucipqylw== =hBsx -----END PGP SIGNATURE----- --ma69spvSY9IqCIZapbV7JtZcd8y48FAA5-- From owner-svn-src-head@freebsd.org Sat Dec 29 14:48:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A151421F63; Sat, 29 Dec 2018 14:48:52 +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) server-signature RSA-PSS (4096 bits) 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 2AE7D71225; Sat, 29 Dec 2018 14:48:52 +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 1EAE3C62E; Sat, 29 Dec 2018 14: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 wBTEmpVh056172; Sat, 29 Dec 2018 14:48:51 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTEmpmt056171; Sat, 29 Dec 2018 14:48:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201812291448.wBTEmpmt056171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 29 Dec 2018 14:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342591 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342591 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2AE7D71225 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 14:48:52 -0000 Author: kp Date: Sat Dec 29 14:48:51 2018 New Revision: 342591 URL: https://svnweb.freebsd.org/changeset/base/342591 Log: Make kernel print jail ID when logging a process exit Kernel now includes jail ID when logging a process exit. jid is 0 for unjailed processes. Submitted by: Marie Helene Kvello-Aune Relnotes: yes Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D18618 Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Sat Dec 29 06:52:52 2018 (r342590) +++ head/sys/kern/kern_sig.c Sat Dec 29 14:48:51 2018 (r342591) @@ -3094,12 +3094,17 @@ proc_wkilled(struct proc *p) void killproc(struct proc *p, char *why) { + int jid = -1; + if (p->p_ucred && p->p_ucred->cr_prison) + jid = p->p_ucred->cr_prison->pr_id; + PROC_LOCK_ASSERT(p, MA_OWNED); CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid, p->p_comm); - log(LOG_ERR, "pid %d (%s), uid %d, was killed: %s\n", p->p_pid, - p->p_comm, p->p_ucred ? p->p_ucred->cr_uid : -1, why); + log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n", + p->p_pid, p->p_comm, jid, + p->p_ucred ? p->p_ucred->cr_uid : -1, why); proc_wkilled(p); kern_psignal(p, SIGKILL); } @@ -3116,7 +3121,11 @@ void sigexit(struct thread *td, int sig) { struct proc *p = td->td_proc; + int jid = -1; + if (p->p_ucred && p->p_ucred->cr_prison) + jid = p->p_ucred->cr_prison->pr_id; + PROC_LOCK_ASSERT(p, MA_OWNED); p->p_acflag |= AXSIG; /* @@ -3142,8 +3151,8 @@ sigexit(struct thread *td, int sig) sig |= WCOREFLAG; if (kern_logsigexit) log(LOG_INFO, - "pid %d (%s), uid %d: exited on signal %d%s\n", - p->p_pid, p->p_comm, + "pid %d (%s), jid %d, uid %d: exited on " + "signal %d%s\n", p->p_pid, p->p_comm, jid, td->td_ucred ? td->td_ucred->cr_uid : -1, sig &~ WCOREFLAG, sig & WCOREFLAG ? " (core dumped)" : ""); From owner-svn-src-head@freebsd.org Sat Dec 29 15:13:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48CEC1422C39; Sat, 29 Dec 2018 15:13:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 BFB6A72048; Sat, 29 Dec 2018 15:13:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD5EBCB58; Sat, 29 Dec 2018 15:13:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBTFDnGO071763; Sat, 29 Dec 2018 15:13:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTFDntw071762; Sat, 29 Dec 2018 15:13:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201812291513.wBTFDntw071762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 29 Dec 2018 15:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342592 - head/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Commit-Revision: 342592 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BFB6A72048 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.948,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 15:13:50 -0000 Author: dim Date: Sat Dec 29 15:13:49 2018 New Revision: 342592 URL: https://svnweb.freebsd.org/changeset/base/342592 Log: Pull in r342397 from upstream llvm trunk (by Amara Emerson): Revert "Revert r342183 "[DAGCombine] Fix crash when store merging created an extract_subvector with invalid index."" Fixed the assertion failure. Differential Revision: https://reviews.llvm.org/D51831 This fixes 'Assertion failed: ((VT.getVectorNumElements() + N2C->getZExtValue() <= N1.getValueType().getVectorNumElements()) && "Extract subvector overflow!"), function getNode' when building the multimedia/aom port (with AVX2 enabled). Reported by: jbeich PR: 234480 MFC after: 6 weeks X-MFC-With: r341825 Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Dec 29 14:48:51 2018 (r342591) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Dec 29 15:13:49 2018 (r342592) @@ -13727,17 +13727,26 @@ bool DAGCombiner::MergeStoresOfConstantsOrVecElts( Val.getOpcode() == ISD::EXTRACT_SUBVECTOR)) { SDValue Vec = Val.getOperand(0); EVT MemVTScalarTy = MemVT.getScalarType(); + SDValue Idx = Val.getOperand(1); // We may need to add a bitcast here to get types to line up. if (MemVTScalarTy != Vec.getValueType()) { unsigned Elts = Vec.getValueType().getSizeInBits() / MemVTScalarTy.getSizeInBits(); + if (Val.getValueType().isVector() && MemVT.isVector()) { + unsigned IdxC = cast(Idx)->getZExtValue(); + unsigned NewIdx = + ((uint64_t)IdxC * MemVT.getVectorNumElements()) / Elts; + Idx = DAG.getConstant(NewIdx, SDLoc(Val), Idx.getValueType()); + } + if (!MemVT.isVector() && Val.getValueType().isVector()) + dbgs() << "hit!\n"; EVT NewVecTy = EVT::getVectorVT(*DAG.getContext(), MemVTScalarTy, Elts); Vec = DAG.getBitcast(NewVecTy, Vec); } auto OpC = (MemVT.isVector()) ? ISD::EXTRACT_SUBVECTOR : ISD::EXTRACT_VECTOR_ELT; - Val = DAG.getNode(OpC, SDLoc(Val), MemVT, Vec, Val.getOperand(1)); + Val = DAG.getNode(OpC, SDLoc(Val), MemVT, Vec, Idx); } Ops.push_back(Val); } From owner-svn-src-head@freebsd.org Sat Dec 29 15:21:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 258161423239; Sat, 29 Dec 2018 15:21:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) 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 C164C727CF; Sat, 29 Dec 2018 15:21:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B504FCBC7; Sat, 29 Dec 2018 15:21:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBTFLpFa076807; Sat, 29 Dec 2018 15:21:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTFLpdh076806; Sat, 29 Dec 2018 15:21:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201812291521.wBTFLpdh076806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 29 Dec 2018 15:21:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342593 - head/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm/lib/CodeGen/SelectionDAG X-SVN-Commit-Revision: 342593 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C164C727CF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 15:21:52 -0000 Author: dim Date: Sat Dec 29 15:21:51 2018 New Revision: 342593 URL: https://svnweb.freebsd.org/changeset/base/342593 Log: Pull in r342863 from upstream llvm trunk (by Hans Wennborg): Remove debug printf leftover from r342397 PR: 234480 MFC after: 6 weeks X-MFC-With: r341825 Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Modified: head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp ============================================================================== --- head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Dec 29 15:13:49 2018 (r342592) +++ head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sat Dec 29 15:21:51 2018 (r342593) @@ -13738,8 +13738,6 @@ bool DAGCombiner::MergeStoresOfConstantsOrVecElts( ((uint64_t)IdxC * MemVT.getVectorNumElements()) / Elts; Idx = DAG.getConstant(NewIdx, SDLoc(Val), Idx.getValueType()); } - if (!MemVT.isVector() && Val.getValueType().isVector()) - dbgs() << "hit!\n"; EVT NewVecTy = EVT::getVectorVT(*DAG.getContext(), MemVTScalarTy, Elts); Vec = DAG.getBitcast(NewVecTy, Vec); From owner-svn-src-head@freebsd.org Sat Dec 29 15:49:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFCF11423CC3; Sat, 29 Dec 2018 15:49: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) server-signature RSA-PSS (4096 bits) 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 5770D737DE; Sat, 29 Dec 2018 15:49:04 +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 4ACF9D074; Sat, 29 Dec 2018 15:49:04 +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 wBTFn4b4088615; Sat, 29 Dec 2018 15:49:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTFn4hB088614; Sat, 29 Dec 2018 15:49:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812291549.wBTFn4hB088614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 29 Dec 2018 15:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342594 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 342594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5770D737DE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 15:49:04 -0000 Author: kib Date: Sat Dec 29 15:49:03 2018 New Revision: 342594 URL: https://svnweb.freebsd.org/changeset/base/342594 Log: i386: Fix allocation of the KVA frame for pmap_quick_enter_page(). Due to the typo, it shared the frame with the CMAP1 transient mapping. In collaboration with: pho MFC after: 3 days Sponsored by: The FreeBSD Foundation (kib) Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Dec 29 15:21:51 2018 (r342593) +++ head/sys/i386/i386/pmap.c Sat Dec 29 15:49:03 2018 (r342594) @@ -735,7 +735,7 @@ pmap_init_reserved_pages(void) pc->pc_cmap_pte2 = vtopte(pages + PAGE_SIZE); pc->pc_cmap_addr1 = (caddr_t)pages; pc->pc_cmap_addr2 = (caddr_t)(pages + PAGE_SIZE); - pc->pc_qmap_addr = pages + atop(2); + pc->pc_qmap_addr = pages + ptoa(2); } } From owner-svn-src-head@freebsd.org Sat Dec 29 15:55:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99AF314242A6; Sat, 29 Dec 2018 15:55:45 +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) server-signature RSA-PSS (4096 bits) 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 3EAD674231; Sat, 29 Dec 2018 15:55:45 +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 2435BD21C; Sat, 29 Dec 2018 15:55:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBTFtiNY093567; Sat, 29 Dec 2018 15:55:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTFtiwj093566; Sat, 29 Dec 2018 15:55:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812291555.wBTFtiwj093566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 29 Dec 2018 15:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342595 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3EAD674231 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 15:55:45 -0000 Author: kib Date: Sat Dec 29 15:55:44 2018 New Revision: 342595 URL: https://svnweb.freebsd.org/changeset/base/342595 Log: For hw.{physmem,realmem,usermem} MIBs, clamp instead truncating. If the memory size does not fit into u_long, current code truncates the returned value and returns complete nonsense. Make the result slightly more useful by clamping it at ULONG_MAX. Reported and tested : pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sat Dec 29 15:49:03 2018 (r342594) +++ head/sys/kern/kern_mib.c Sat Dec 29 15:55:44 2018 (r342595) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -177,35 +178,45 @@ SYSCTL_PROC(_kern, KERN_ARND, arandom, static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { - u_long val; + u_long val, p; - val = ctob(physmem); + p = SIZE_T_MAX >> PAGE_SHIFT; + if (physmem < p) + p = physmem; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } - SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "LU", ""); + 0, 0, sysctl_hw_physmem, "LU", ""); static int sysctl_hw_realmem(SYSCTL_HANDLER_ARGS) { - u_long val; - val = ctob(realmem); + u_long val, p; + + p = SIZE_T_MAX >> PAGE_SHIFT; + if (realmem < p) + p = realmem; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } SYSCTL_PROC(_hw, HW_REALMEM, realmem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_realmem, "LU", ""); + 0, 0, sysctl_hw_realmem, "LU", ""); + static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { - u_long val; + u_long val, p, p1; - val = ctob(physmem - vm_wire_count()); + p1 = physmem - vm_wire_count(); + p = SIZE_T_MAX >> PAGE_SHIFT; + if (p1 < p) + p = p1; + val = ctob(p); return (sysctl_handle_long(oidp, &val, 0, req)); } - SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG | CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "LU", ""); + 0, 0, sysctl_hw_usermem, "LU", ""); SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); From owner-svn-src-head@freebsd.org Sat Dec 29 18:11:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6CE51429B9F; Sat, 29 Dec 2018 18:11:18 +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) server-signature RSA-PSS (4096 bits) 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 5FA508092E; Sat, 29 Dec 2018 18:11:18 +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 215ACE962; Sat, 29 Dec 2018 18:11:18 +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 wBTIBIBF063758; Sat, 29 Dec 2018 18:11:18 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTIBIg6063757; Sat, 29 Dec 2018 18:11:18 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812291811.wBTIBIg6063757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 29 Dec 2018 18:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342596 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 342596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FA508092E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 18:11:19 -0000 Author: cy Date: Sat Dec 29 18:11:17 2018 New Revision: 342596 URL: https://svnweb.freebsd.org/changeset/base/342596 Log: Remove duplicate include of sys/mbuf.h. Reported by: Trond Endrest MFC after: 3 days Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 29 15:55:44 2018 (r342595) +++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Dec 29 18:11:17 2018 (r342596) @@ -39,7 +39,6 @@ static const char rcsid[] = "@(#)$Id$"; # include # include # include -# include #include # include # include From owner-svn-src-head@freebsd.org Sat Dec 29 20:02:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A056142BAAD; Sat, 29 Dec 2018 20:02:21 +0000 (UTC) (envelope-from ngie@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) server-signature RSA-PSS (4096 bits) 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 CF0BA838E4; Sat, 29 Dec 2018 20:02:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1BE7FCB8; Sat, 29 Dec 2018 20:02:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBTK2Kmk023980; Sat, 29 Dec 2018 20:02:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTK2KwZ023979; Sat, 29 Dec 2018 20:02:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201812292002.wBTK2KwZ023979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Enji Cooper Date: Sat, 29 Dec 2018 20:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342597 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 342597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CF0BA838E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 20:02:21 -0000 Author: ngie Date: Sat Dec 29 20:02:20 2018 New Revision: 342597 URL: https://svnweb.freebsd.org/changeset/base/342597 Log: Remove legacy rc.d infrastructure references from rc(8) Legacy rc.d scripts (.sh extension) have not been supported since r193118. Remove the outdated references to the legacy format, as they are no longer valid. Bug: 193936 MFC after: 1 week Reviewed by: cress, emaste (mentor) Differential Revision: https://reviews.freebsd.org/D18666 Modified: head/share/man/man8/rc.8 Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Sat Dec 29 18:11:17 2018 (r342596) +++ head/share/man/man8/rc.8 Sat Dec 29 20:02:20 2018 (r342597) @@ -31,7 +31,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd September 18, 2018 +.Dd December 29, 2018 .Dt RC 8 .Os .Sh NAME @@ -156,9 +156,6 @@ which sets to .Dq Li start , and sources the script in a subshell. -If the script has a -.Pa .sh -suffix then it is sourced directly into the current shell. Stop processing when the script that is the value of the .Va $early_late_divider has been run. @@ -219,9 +216,6 @@ which sets to .Dq Li stop , and sources the script in a subshell. -If the script has a -.Pa .sh -suffix then it is sourced directly into the current shell. .El .Ss Contents of Nm rc.d/ .Nm rc.d/ @@ -261,13 +255,6 @@ as well as services which might run commands as users and .Pa sendmail ) . .El -.It Pa foo.sh -Scripts that are to be sourced into the current shell rather than a subshell -have a -.Pa .sh -suffix. -Extreme care must be taken in using this, as the startup sequence will -terminate if the script does. .It Pa bar Scripts that are sourced in a subshell. The boot does not stop if such a script terminates with a non-zero status, From owner-svn-src-head@freebsd.org Sat Dec 29 21:18:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73B64142D27A; Sat, 29 Dec 2018 21:18:04 +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) server-signature RSA-PSS (4096 bits) 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 116B78595B; Sat, 29 Dec 2018 21:18:04 +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 D16201893D; Sat, 29 Dec 2018 21:18:03 +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 wBTLI32i061917; Sat, 29 Dec 2018 21:18:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTLI1UW061903; Sat, 29 Dec 2018 21:18:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201812292118.wBTLI1UW061903@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 29 Dec 2018 21:18:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342598 - in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib/meson sys/contrib/zstd/contrib/pzstd sys/contrib/zstd/contrib/seekable_format sys/contrib/zstd/contrib/... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libzstd sys/conf sys/contrib/zstd sys/contrib/zstd/contrib/meson sys/contrib/zstd/contrib/pzstd sys/contrib/zstd/contrib/seekable_format sys/contrib/zstd/contrib/seekable_format/examples ... X-SVN-Commit-Revision: 342598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 116B78595B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Dec 2018 21:18:05 -0000 Author: cem Date: Sat Dec 29 21:18:01 2018 New Revision: 342598 URL: https://svnweb.freebsd.org/changeset/base/342598 Log: Update to Zstandard 1.3.8 This merge brings in a couple new files, which needed to be attached to the build; a new dependency on , which must be stubbed; and a name change in the Context parameter constants, from ZSTD_p_foo to ZSTD_c_foo. Significantly, it fixes a kernel build error with GCC where floating-point functions were included in the kernel build, by hiding them under the same compile-time #ifdef that already covered their invocation. That issue was introduced to FreeBSD in the 1.3.7 update and tracked upstream here: https://github.com/facebook/zstd/issues/1386 The full 1.3.8 release notes can be found on Github: https://github.com/facebook/zstd/releases/tag/v1.3.8 Relnotes: yes Added: head/sys/contrib/zstd/lib/decompress/zstd_ddict.c - copied unchanged from r342590, vendor/zstd/dist/lib/decompress/zstd_ddict.c head/sys/contrib/zstd/lib/decompress/zstd_ddict.h - copied unchanged from r342590, vendor/zstd/dist/lib/decompress/zstd_ddict.h head/sys/contrib/zstd/lib/decompress/zstd_decompress_block.c - copied unchanged from r342590, vendor/zstd/dist/lib/decompress/zstd_decompress_block.c head/sys/contrib/zstd/lib/decompress/zstd_decompress_block.h - copied unchanged from r342590, vendor/zstd/dist/lib/decompress/zstd_decompress_block.h head/sys/contrib/zstd/lib/decompress/zstd_decompress_internal.h - copied unchanged from r342590, vendor/zstd/dist/lib/decompress/zstd_decompress_internal.h head/sys/contrib/zstd/lib/freebsd/limits.h - copied, changed from r342590, head/sys/contrib/zstd/lib/freebsd/stddef.h head/sys/contrib/zstd/programs/benchfn.c - copied unchanged from r342590, vendor/zstd/dist/programs/benchfn.c head/sys/contrib/zstd/programs/benchfn.h - copied unchanged from r342590, vendor/zstd/dist/programs/benchfn.h head/sys/contrib/zstd/programs/benchzstd.c - copied unchanged from r342590, vendor/zstd/dist/programs/benchzstd.c head/sys/contrib/zstd/programs/benchzstd.h - copied unchanged from r342590, vendor/zstd/dist/programs/benchzstd.h head/sys/contrib/zstd/programs/util.c - copied unchanged from r342590, vendor/zstd/dist/programs/util.c head/sys/contrib/zstd/tests/regression/ - copied from r342590, vendor/zstd/dist/tests/regression/ Deleted: head/sys/contrib/zstd/NEWS head/sys/contrib/zstd/contrib/meson/ head/sys/contrib/zstd/programs/bench.c head/sys/contrib/zstd/programs/bench.h Modified: head/lib/libzstd/Makefile head/sys/conf/files head/sys/contrib/zstd/Makefile head/sys/contrib/zstd/README.md head/sys/contrib/zstd/appveyor.yml head/sys/contrib/zstd/contrib/pzstd/Makefile head/sys/contrib/zstd/contrib/seekable_format/examples/parallel_processing.c head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c head/sys/contrib/zstd/doc/zstd_compression_format.md head/sys/contrib/zstd/doc/zstd_manual.html head/sys/contrib/zstd/lib/BUCK head/sys/contrib/zstd/lib/Makefile head/sys/contrib/zstd/lib/README.md head/sys/contrib/zstd/lib/common/bitstream.h head/sys/contrib/zstd/lib/common/compiler.h head/sys/contrib/zstd/lib/common/cpu.h head/sys/contrib/zstd/lib/common/debug.h head/sys/contrib/zstd/lib/common/error_private.c head/sys/contrib/zstd/lib/common/fse.h head/sys/contrib/zstd/lib/common/huf.h head/sys/contrib/zstd/lib/common/pool.c head/sys/contrib/zstd/lib/common/zstd_common.c head/sys/contrib/zstd/lib/common/zstd_errors.h head/sys/contrib/zstd/lib/common/zstd_internal.h head/sys/contrib/zstd/lib/compress/fse_compress.c head/sys/contrib/zstd/lib/compress/hist.c head/sys/contrib/zstd/lib/compress/hist.h head/sys/contrib/zstd/lib/compress/huf_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h head/sys/contrib/zstd/lib/compress/zstd_double_fast.c head/sys/contrib/zstd/lib/compress/zstd_fast.c head/sys/contrib/zstd/lib/compress/zstd_lazy.c head/sys/contrib/zstd/lib/compress/zstd_ldm.c head/sys/contrib/zstd/lib/compress/zstd_ldm.h head/sys/contrib/zstd/lib/compress/zstd_opt.c head/sys/contrib/zstd/lib/compress/zstd_opt.h head/sys/contrib/zstd/lib/compress/zstdmt_compress.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.h head/sys/contrib/zstd/lib/decompress/huf_decompress.c head/sys/contrib/zstd/lib/decompress/zstd_decompress.c head/sys/contrib/zstd/lib/dictBuilder/cover.c head/sys/contrib/zstd/lib/dictBuilder/fastcover.c head/sys/contrib/zstd/lib/dictBuilder/zdict.c head/sys/contrib/zstd/lib/legacy/zstd_v04.c head/sys/contrib/zstd/lib/legacy/zstd_v05.c head/sys/contrib/zstd/lib/zstd.h head/sys/contrib/zstd/programs/Makefile head/sys/contrib/zstd/programs/README.md head/sys/contrib/zstd/programs/datagen.c head/sys/contrib/zstd/programs/dibio.c head/sys/contrib/zstd/programs/fileio.c head/sys/contrib/zstd/programs/fileio.h head/sys/contrib/zstd/programs/platform.h head/sys/contrib/zstd/programs/util.h head/sys/contrib/zstd/programs/zstd.1 head/sys/contrib/zstd/programs/zstd.1.md head/sys/contrib/zstd/programs/zstdcli.c head/sys/contrib/zstd/programs/zstdgrep head/sys/contrib/zstd/programs/zstdgrep.1 head/sys/contrib/zstd/programs/zstdless.1 head/sys/contrib/zstd/tests/Makefile head/sys/contrib/zstd/tests/README.md head/sys/contrib/zstd/tests/datagencli.c head/sys/contrib/zstd/tests/decodecorpus.c head/sys/contrib/zstd/tests/fullbench.c head/sys/contrib/zstd/tests/fuzz/Makefile head/sys/contrib/zstd/tests/fuzz/simple_round_trip.c head/sys/contrib/zstd/tests/fuzz/stream_round_trip.c head/sys/contrib/zstd/tests/fuzz/zstd_helpers.c head/sys/contrib/zstd/tests/fuzzer.c head/sys/contrib/zstd/tests/libzstd_partial_builds.sh head/sys/contrib/zstd/tests/longmatch.c head/sys/contrib/zstd/tests/paramgrill.c head/sys/contrib/zstd/tests/playTests.sh head/sys/contrib/zstd/tests/poolTests.c head/sys/contrib/zstd/tests/roundTripCrash.c head/sys/contrib/zstd/tests/seqgen.c head/sys/contrib/zstd/tests/symbols.c head/sys/contrib/zstd/tests/zstreamtest.c head/sys/contrib/zstd/zlibWrapper/Makefile head/sys/contrib/zstd/zlibWrapper/examples/zwrapbench.c head/sys/contrib/zstd/zlibWrapper/zstd_zlibwrapper.c head/sys/kern/subr_compressor.c head/usr.bin/zstd/Makefile Directory Properties: head/sys/contrib/zstd/ (props changed) Modified: head/lib/libzstd/Makefile ============================================================================== --- head/lib/libzstd/Makefile Sat Dec 29 20:02:20 2018 (r342597) +++ head/lib/libzstd/Makefile Sat Dec 29 21:18:01 2018 (r342598) @@ -13,7 +13,9 @@ SRCS= entropy_common.c \ zstd_compress.c \ zstdmt_compress.c \ huf_decompress.c \ + zstd_ddict.c \ zstd_decompress.c \ + zstd_decompress_block.c \ zbuff_common.c \ zbuff_compress.c \ zbuff_decompress.c \ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/conf/files Sat Dec 29 21:18:01 2018 (r342598) @@ -652,7 +652,9 @@ contrib/zstd/lib/compress/zstd_fast.c optional zstdio contrib/zstd/lib/compress/zstd_lazy.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_ldm.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/compress/zstd_opt.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/zstd_ddict.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/decompress/zstd_decompress.c optional zstdio compile-with ${ZSTD_C} +contrib/zstd/lib/decompress/zstd_decompress_block.c optional zstdio compile-with ${ZSTD_C} contrib/zstd/lib/decompress/huf_decompress.c optional zstdio compile-with ${ZSTD_C} # Blake 2 contrib/libb2/blake2b-ref.c optional crypto | ipsec | ipsec_support \ Modified: head/sys/contrib/zstd/Makefile ============================================================================== --- head/sys/contrib/zstd/Makefile Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/contrib/zstd/Makefile Sat Dec 29 21:18:01 2018 (r342598) @@ -64,7 +64,8 @@ zlibwrapper: lib ## test: run long-duration tests .PHONY: test -test: MOREFLAGS += -g -DDEBUGLEVEL=1 -Werror +DEBUGLEVEL ?= 1 +test: MOREFLAGS += -g -DDEBUGLEVEL=$(DEBUGLEVEL) -Werror test: MOREFLAGS="$(MOREFLAGS)" $(MAKE) -j -C $(PRGDIR) allVariants $(MAKE) -C $(TESTDIR) $@ @@ -129,7 +130,12 @@ ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFree HOST_OS = POSIX CMAKE_PARAMS = -DZSTD_BUILD_CONTRIB:BOOL=ON -DZSTD_BUILD_STATIC:BOOL=ON -DZSTD_BUILD_TESTS:BOOL=ON -DZSTD_ZLIB_SUPPORT:BOOL=ON -DZSTD_LZMA_SUPPORT:BOOL=ON -DCMAKE_BUILD_TYPE=Release -EGREP = egrep --color=never +HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0) +EGREP_OPTIONS ?= +ifeq ($HAVE_COLORNEVER, 1) +EGREP_OPTIONS += --color=never +endif +EGREP = egrep $(EGREP_OPTIONS) # Print a two column output of targets and their description. To add a target description, put a # comment in the Makefile with the format "## : ". For example: Modified: head/sys/contrib/zstd/README.md ============================================================================== --- head/sys/contrib/zstd/README.md Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/contrib/zstd/README.md Sat Dec 29 21:18:01 2018 (r342598) @@ -9,8 +9,12 @@ and a command line utility producing and decoding `.zs Should your project require another programming language, a list of known ports and bindings is provided on [Zstandard homepage](http://www.zstd.net/#other-languages). -Development branch status : [![Build Status][travisDevBadge]][travisLink] [![Build status][AppveyorDevBadge]][AppveyorLink] [![Build status][CircleDevBadge]][CircleLink] +**Development branch status:** +[![Build Status][travisDevBadge]][travisLink] +[![Build status][AppveyorDevBadge]][AppveyorLink] +[![Build status][CircleDevBadge]][CircleLink] + [travisDevBadge]: https://travis-ci.org/facebook/zstd.svg?branch=dev "Continuous Integration test suite" [travisLink]: https://travis-ci.org/facebook/zstd [AppveyorDevBadge]: https://ci.appveyor.com/api/projects/status/xt38wbdxjk5mrbem/branch/dev?svg=true "Windows test suite" @@ -18,7 +22,7 @@ Development branch status : [![Build Status][travisDev [CircleDevBadge]: https://circleci.com/gh/facebook/zstd/tree/dev.svg?style=shield "Short test suite" [CircleLink]: https://circleci.com/gh/facebook/zstd -### Benchmarks +## Benchmarks For reference, several fast compression algorithms were tested and compared on a server running Linux Debian (`Linux version 4.14.0-3-amd64`), @@ -42,7 +46,7 @@ on the [Silesia compression corpus]. | snappy 1.1.4 | 2.091 | 530 MB/s | 1800 MB/s | | lzf 3.6 -1 | 2.077 | 400 MB/s | 860 MB/s | -[zlib]:http://www.zlib.net/ +[zlib]: http://www.zlib.net/ [LZ4]: http://www.lz4.org/ Zstd can also offer stronger compression ratios at the cost of compression speed. @@ -65,7 +69,7 @@ A few other algorithms can produce higher compression For a larger picture including slow modes, [click on this link](doc/images/DCspeed5.png). -### The case for Small Data compression +## The case for Small Data compression Previous charts provide results applicable to typical file and stream scenarios (several MB). Small data comes with different perspectives. @@ -89,24 +93,24 @@ Training works if there is some correlation in a famil Hence, deploying one dictionary per type of data will provide the greatest benefits. Dictionary gains are mostly effective in the first few KB. Then, the compression algorithm will gradually use previously decoded content to better compress the rest of the file. -#### Dictionary compression How To: +### Dictionary compression How To: -1) Create the dictionary +1. Create the dictionary -`zstd --train FullPathToTrainingSet/* -o dictionaryName` + `zstd --train FullPathToTrainingSet/* -o dictionaryName` -2) Compress with dictionary +2. Compress with dictionary -`zstd -D dictionaryName FILE` + `zstd -D dictionaryName FILE` -3) Decompress with dictionary +3. Decompress with dictionary -`zstd -D dictionaryName --decompress FILE.zst` + `zstd -D dictionaryName --decompress FILE.zst` -### Build instructions +## Build instructions -#### Makefile +### Makefile If your system is compatible with standard `make` (or `gmake`), invoking `make` in root directory will generate `zstd` cli in root directory. @@ -115,7 +119,7 @@ Other available options include: - `make install` : create and install zstd cli, library and man pages - `make check` : create and run `zstd`, tests its behavior on local platform -#### cmake +### cmake A `cmake` project generator is provided within `build/cmake`. It can generate Makefiles or other build scripts @@ -123,29 +127,39 @@ to create `zstd` binary, and `libzstd` dynamic and sta By default, `CMAKE_BUILD_TYPE` is set to `Release`. -#### Meson +### Meson -A Meson project is provided within `contrib/meson`. +A Meson project is provided within [`build/meson`](build/meson). Follow +build instructions in that directory. -#### Visual Studio (Windows) +You can also take a look at [`.travis.yml`](.travis.yml) file for an +example about how Meson is used to build this project. +Note that default build type is **release**. + +### Visual Studio (Windows) + Going into `build` directory, you will find additional possibilities: - Projects for Visual Studio 2005, 2008 and 2010. + VS2010 project is compatible with VS2012, VS2013, VS2015 and VS2017. - Automated build scripts for Visual compiler by [@KrzysFR](https://github.com/KrzysFR), in `build/VS_scripts`, which will build `zstd` cli and `libzstd` library without any need to open Visual Studio solution. +### Buck -### Status +You can build the zstd binary via buck by executing: `buck build programs:zstd` from the root of the repo. +The output binary will be in `buck-out/gen/programs/`. +## Status + Zstandard is currently deployed within Facebook. It is used continuously to compress large amounts of data in multiple formats and use cases. Zstandard is considered safe for production environments. -### License +## License Zstandard is dual-licensed under [BSD](LICENSE) and [GPLv2](COPYING). -### Contributing +## Contributing The "dev" branch is the one where all contributions are merged before reaching "master". If you plan to propose a patch, please commit into the "dev" branch, or its own feature branch. Modified: head/sys/contrib/zstd/appveyor.yml ============================================================================== --- head/sys/contrib/zstd/appveyor.yml Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/contrib/zstd/appveyor.yml Sat Dec 29 21:18:01 2018 (r342598) @@ -3,6 +3,8 @@ branches: only: - master + - appveyorTest + - /visual*/ environment: matrix: - COMPILER: "gcc" Modified: head/sys/contrib/zstd/contrib/pzstd/Makefile ============================================================================== --- head/sys/contrib/zstd/contrib/pzstd/Makefile Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/contrib/zstd/contrib/pzstd/Makefile Sat Dec 29 21:18:01 2018 (r342598) @@ -171,7 +171,7 @@ roundtripcheck: roundtrip check $(TESTPROG) ./test/RoundTripTest$(EXT) $(TESTFLAGS) # Build the main binary -pzstd$(EXT): main.o Options.o Pzstd.o SkippableFrame.o $(ZSTDDIR)/libzstd.a +pzstd$(EXT): main.o $(PROGDIR)/util.o Options.o Pzstd.o SkippableFrame.o $(ZSTDDIR)/libzstd.a $(LD_COMMAND) # Target that depends on all the tests Modified: head/sys/contrib/zstd/contrib/seekable_format/examples/parallel_processing.c ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/examples/parallel_processing.c Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/contrib/zstd/contrib/seekable_format/examples/parallel_processing.c Sat Dec 29 21:18:01 2018 (r342598) @@ -148,20 +148,20 @@ static void sumFile_orDie(const char* fname, int nbThr size_t const initResult = ZSTD_seekable_initFile(seekable, fin); if (ZSTD_isError(initResult)) { fprintf(stderr, "ZSTD_seekable_init() error : %s \n", ZSTD_getErrorName(initResult)); exit(11); } - size_t const numFrames = ZSTD_seekable_getNumFrames(seekable); + unsigned const numFrames = ZSTD_seekable_getNumFrames(seekable); struct sum_job* jobs = (struct sum_job*)malloc(numFrames * sizeof(struct sum_job)); - size_t i; - for (i = 0; i < numFrames; i++) { - jobs[i] = (struct sum_job){ fname, 0, i, 0 }; - POOL_add(pool, sumFrame, &jobs[i]); + unsigned fnb; + for (fnb = 0; fnb < numFrames; fnb++) { + jobs[fnb] = (struct sum_job){ fname, 0, fnb, 0 }; + POOL_add(pool, sumFrame, &jobs[fnb]); } unsigned long long total = 0; - for (i = 0; i < numFrames; i++) { - while (!jobs[i].done) SLEEP(5); /* wake up every 5 milliseconds to check */ - total += jobs[i].sum; + for (fnb = 0; fnb < numFrames; fnb++) { + while (!jobs[fnb].done) SLEEP(5); /* wake up every 5 milliseconds to check */ + total += jobs[fnb].sum; } printf("Sum: %llu\n", total); Modified: head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c Sat Dec 29 21:18:01 2018 (r342598) @@ -8,6 +8,8 @@ */ #include /* malloc, free */ +#include /* UINT_MAX */ +#include #define XXH_STATIC_LINKING_ONLY #define XXH_NAMESPACE ZSTD_ @@ -139,7 +141,7 @@ size_t ZSTD_seekable_freeCStream(ZSTD_seekable_CStream size_t ZSTD_seekable_initCStream(ZSTD_seekable_CStream* zcs, int compressionLevel, int checksumFlag, - U32 maxFrameSize) + unsigned maxFrameSize) { zcs->framelog.size = 0; zcs->frameCSize = 0; @@ -167,9 +169,9 @@ size_t ZSTD_seekable_initCStream(ZSTD_seekable_CStream } size_t ZSTD_seekable_logFrame(ZSTD_frameLog* fl, - unsigned compressedSize, - unsigned decompressedSize, - unsigned checksum) + unsigned compressedSize, + unsigned decompressedSize, + unsigned checksum) { if (fl->size == ZSTD_SEEKABLE_MAXFRAMES) return ERROR(frameIndex_tooLarge); @@ -184,7 +186,8 @@ size_t ZSTD_seekable_logFrame(ZSTD_frameLog* fl, if (newEntries == NULL) return ERROR(memory_allocation); fl->entries = newEntries; - fl->capacity = newCapacity; + assert(newCapacity <= UINT_MAX); + fl->capacity = (U32)newCapacity; } fl->entries[fl->size] = (framelogEntry_t){ @@ -268,7 +271,7 @@ size_t ZSTD_seekable_compressStream(ZSTD_seekable_CStr static inline size_t ZSTD_seekable_seekTableSize(const ZSTD_frameLog* fl) { size_t const sizePerFrame = 8 + (fl->checksumFlag?4:0); - size_t const seekTableLen = ZSTD_skippableHeaderSize + + size_t const seekTableLen = ZSTD_SKIPPABLEHEADERSIZE + sizePerFrame * fl->size + ZSTD_seekTableFooterSize; @@ -307,32 +310,32 @@ size_t ZSTD_seekable_writeSeekTable(ZSTD_frameLog* fl, size_t const seekTableLen = ZSTD_seekable_seekTableSize(fl); CHECK_Z(ZSTD_stwrite32(fl, output, ZSTD_MAGIC_SKIPPABLE_START | 0xE, 0)); - CHECK_Z(ZSTD_stwrite32(fl, output, seekTableLen - ZSTD_skippableHeaderSize, - 4)); + assert(seekTableLen <= (size_t)UINT_MAX); + CHECK_Z(ZSTD_stwrite32(fl, output, (U32)seekTableLen - ZSTD_SKIPPABLEHEADERSIZE, 4)); while (fl->seekTableIndex < fl->size) { + unsigned long long const start = ZSTD_SKIPPABLEHEADERSIZE + sizePerFrame * fl->seekTableIndex; + assert(start + 8 <= UINT_MAX); CHECK_Z(ZSTD_stwrite32(fl, output, fl->entries[fl->seekTableIndex].cSize, - ZSTD_skippableHeaderSize + - sizePerFrame * fl->seekTableIndex + 0)); + (U32)start + 0)); CHECK_Z(ZSTD_stwrite32(fl, output, fl->entries[fl->seekTableIndex].dSize, - ZSTD_skippableHeaderSize + - sizePerFrame * fl->seekTableIndex + 4)); + (U32)start + 4)); if (fl->checksumFlag) { CHECK_Z(ZSTD_stwrite32( fl, output, fl->entries[fl->seekTableIndex].checksum, - ZSTD_skippableHeaderSize + - sizePerFrame * fl->seekTableIndex + 8)); + (U32)start + 8)); } fl->seekTableIndex++; } + assert(seekTableLen <= UINT_MAX); CHECK_Z(ZSTD_stwrite32(fl, output, fl->size, - seekTableLen - ZSTD_seekTableFooterSize)); + (U32)seekTableLen - ZSTD_seekTableFooterSize)); if (output->size - output->pos < 1) return seekTableLen - fl->seekTablePos; if (fl->seekTablePos < seekTableLen - 4) { @@ -345,7 +348,7 @@ size_t ZSTD_seekable_writeSeekTable(ZSTD_frameLog* fl, } CHECK_Z(ZSTD_stwrite32(fl, output, ZSTD_SEEKABLE_MAGICNUMBER, - seekTableLen - 4)); + (U32)seekTableLen - 4)); if (fl->seekTablePos != seekTableLen) return ERROR(GENERIC); return 0; Modified: head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Sat Dec 29 21:18:01 2018 (r342598) @@ -54,8 +54,9 @@ # define LONG_SEEK fseek #endif -#include /* malloc, free */ -#include /* FILE* */ +#include /* malloc, free */ +#include /* FILE* */ +#include /* UNIT_MAX */ #include #define XXH_STATIC_LINKING_ONLY @@ -200,13 +201,14 @@ size_t ZSTD_seekable_free(ZSTD_seekable* zs) * Performs a binary search to find the last frame with a decompressed offset * <= pos * @return : the frame's index */ -U32 ZSTD_seekable_offsetToFrameIndex(ZSTD_seekable* const zs, unsigned long long pos) +unsigned ZSTD_seekable_offsetToFrameIndex(ZSTD_seekable* const zs, unsigned long long pos) { U32 lo = 0; - U32 hi = zs->seekTable.tableLen; + U32 hi = (U32)zs->seekTable.tableLen; + assert(zs->seekTable.tableLen <= UINT_MAX); if (pos >= zs->seekTable.entries[zs->seekTable.tableLen].dOffset) { - return zs->seekTable.tableLen; + return (U32)zs->seekTable.tableLen; } while (lo + 1 < hi) { @@ -220,31 +222,32 @@ U32 ZSTD_seekable_offsetToFrameIndex(ZSTD_seekable* co return lo; } -U32 ZSTD_seekable_getNumFrames(ZSTD_seekable* const zs) +unsigned ZSTD_seekable_getNumFrames(ZSTD_seekable* const zs) { - return zs->seekTable.tableLen; + assert(zs->seekTable.tableLen <= UINT_MAX); + return (unsigned)zs->seekTable.tableLen; } -unsigned long long ZSTD_seekable_getFrameCompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) +unsigned long long ZSTD_seekable_getFrameCompressedOffset(ZSTD_seekable* const zs, unsigned frameIndex) { if (frameIndex >= zs->seekTable.tableLen) return ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE; return zs->seekTable.entries[frameIndex].cOffset; } -unsigned long long ZSTD_seekable_getFrameDecompressedOffset(ZSTD_seekable* const zs, U32 frameIndex) +unsigned long long ZSTD_seekable_getFrameDecompressedOffset(ZSTD_seekable* const zs, unsigned frameIndex) { if (frameIndex >= zs->seekTable.tableLen) return ZSTD_SEEKABLE_FRAMEINDEX_TOOLARGE; return zs->seekTable.entries[frameIndex].dOffset; } -size_t ZSTD_seekable_getFrameCompressedSize(ZSTD_seekable* const zs, U32 frameIndex) +size_t ZSTD_seekable_getFrameCompressedSize(ZSTD_seekable* const zs, unsigned frameIndex) { if (frameIndex >= zs->seekTable.tableLen) return ERROR(frameIndex_tooLarge); return zs->seekTable.entries[frameIndex + 1].cOffset - zs->seekTable.entries[frameIndex].cOffset; } -size_t ZSTD_seekable_getFrameDecompressedSize(ZSTD_seekable* const zs, U32 frameIndex) +size_t ZSTD_seekable_getFrameDecompressedSize(ZSTD_seekable* const zs, unsigned frameIndex) { if (frameIndex > zs->seekTable.tableLen) return ERROR(frameIndex_tooLarge); return zs->seekTable.entries[frameIndex + 1].dOffset - @@ -275,7 +278,7 @@ static size_t ZSTD_seekable_loadSeekTable(ZSTD_seekabl { U32 const numFrames = MEM_readLE32(zs->inBuff); U32 const sizePerEntry = 8 + (checksumFlag?4:0); U32 const tableSize = sizePerEntry * numFrames; - U32 const frameSize = tableSize + ZSTD_seekTableFooterSize + ZSTD_skippableHeaderSize; + U32 const frameSize = tableSize + ZSTD_seekTableFooterSize + ZSTD_SKIPPABLEHEADERSIZE; U32 remaining = frameSize - ZSTD_seekTableFooterSize; /* don't need to re-read footer */ { @@ -290,7 +293,7 @@ static size_t ZSTD_seekable_loadSeekTable(ZSTD_seekabl if (MEM_readLE32(zs->inBuff) != (ZSTD_MAGIC_SKIPPABLE_START | 0xE)) { return ERROR(prefix_unknown); } - if (MEM_readLE32(zs->inBuff+4) + ZSTD_skippableHeaderSize != frameSize) { + if (MEM_readLE32(zs->inBuff+4) + ZSTD_SKIPPABLEHEADERSIZE != frameSize) { return ERROR(prefix_unknown); } @@ -444,7 +447,7 @@ size_t ZSTD_seekable_decompress(ZSTD_seekable* zs, voi return len; } -size_t ZSTD_seekable_decompressFrame(ZSTD_seekable* zs, void* dst, size_t dstSize, U32 frameIndex) +size_t ZSTD_seekable_decompressFrame(ZSTD_seekable* zs, void* dst, size_t dstSize, unsigned frameIndex) { if (frameIndex >= zs->seekTable.tableLen) { return ERROR(frameIndex_tooLarge); Modified: head/sys/contrib/zstd/doc/zstd_compression_format.md ============================================================================== --- head/sys/contrib/zstd/doc/zstd_compression_format.md Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/contrib/zstd/doc/zstd_compression_format.md Sat Dec 29 21:18:01 2018 (r342598) @@ -16,7 +16,7 @@ Distribution of this document is unlimited. ### Version -0.3.0 (25/09/18) +0.3.1 (25/10/18) Introduction @@ -913,13 +913,39 @@ Note that blocks which are not `Compressed_Block` are ###### Offset updates rules The newest offset takes the lead in offset history, -shifting others back (up to its previous place if it was already present). +shifting others back by one rank, +up to the previous rank of the new offset _if it was present in history_. -This means that when `Repeated_Offset1` (most recent) is used, history is unmodified. -When `Repeated_Offset2` is used, it's swapped with `Repeated_Offset1`. -If any other offset is used, it becomes `Repeated_Offset1` and the rest are shift back by one. +__Examples__ : +In the common case, when new offset is not part of history : +`Repeated_Offset3` = `Repeated_Offset2` +`Repeated_Offset2` = `Repeated_Offset1` +`Repeated_Offset1` = `NewOffset` +When the new offset _is_ part of history, there may be specific adjustments. + +When `NewOffset` == `Repeated_Offset1`, offset history remains actually unmodified. + +When `NewOffset` == `Repeated_Offset2`, +`Repeated_Offset1` and `Repeated_Offset2` ranks are swapped. +`Repeated_Offset3` is unmodified. + +When `NewOffset` == `Repeated_Offset3`, +there is actually no difference with the common case : +all offsets are shifted by one rank, +`NewOffset` (== `Repeated_Offset3`) becomes the new `Repeated_Offset1`. + +Also worth mentioning, the specific corner case when `offset_value` == 3, +and the literal length of the current sequence is zero. +In which case , `NewOffset` = `Repeated_Offset1` - 1_byte. +Here also, from an offset history update perspective, it's just a common case : +`Repeated_Offset3` = `Repeated_Offset2` +`Repeated_Offset2` = `Repeated_Offset1` +`Repeated_Offset1` = `NewOffset` ( == `Repeated_Offset1` - 1_byte ) + + + Skippable Frames ---------------- @@ -1629,6 +1655,7 @@ or at least provide a meaningful error code explaining Version changes --------------- +- 0.3.1 : minor clarification regarding offset history update rules - 0.3.0 : minor edits to match RFC8478 - 0.2.9 : clarifications for huffman weights direct representation, by Ulrich Kunitz - 0.2.8 : clarifications for IETF RFC discuss Modified: head/sys/contrib/zstd/doc/zstd_manual.html ============================================================================== --- head/sys/contrib/zstd/doc/zstd_manual.html Sat Dec 29 20:02:20 2018 (r342597) +++ head/sys/contrib/zstd/doc/zstd_manual.html Sat Dec 29 21:18:01 2018 (r342598) @@ -1,10 +1,10 @@ -zstd 1.3.7 Manual +zstd 1.3.8 Manual -

zstd 1.3.7 Manual

+

zstd 1.3.8 Manual


Contents

    @@ -19,16 +19,19 @@
  1. Streaming compression - HowTo
  2. Streaming decompression - HowTo
  3. ADVANCED AND EXPERIMENTAL FUNCTIONS
  4. -
  5. Frame size functions
  6. -
  7. Memory management
  8. -
  9. Advanced compression functions
  10. -
  11. Advanced decompression functions
  12. -
  13. Advanced streaming functions
  14. -
  15. Buffer-less and synchronous inner streaming functions
  16. -
  17. Buffer-less streaming compression (synchronous mode)
  18. -
  19. Buffer-less streaming decompression (synchronous mode)
  20. -
  21. New advanced API (experimental)
  22. -
  23. Block level API
  24. +
  25. Candidate API for promotion to stable status
  26. +
  27. Advanced compression API
  28. +
  29. experimental API (static linking only)
  30. +
  31. Frame size functions
  32. +
  33. Memory management
  34. +
  35. Advanced compression functions
  36. +
  37. Advanced decompression functions
  38. +
  39. Advanced streaming functions
  40. +
  41. Buffer-less and synchronous inner streaming functions
  42. +
  43. Buffer-less streaming compression (synchronous mode)
  44. +
  45. Buffer-less streaming decompression (synchronous mode)
  46. +
  47. ZSTD_getFrameHeader() :
  48. +
  49. Block level API

Introduction

@@ -64,7 +67,7 @@
 
 

Version


 
-
unsigned ZSTD_versionNumber(void);   /**< useful to check dll version */
+
unsigned ZSTD_versionNumber(void);   /**< to check runtime library version */
 

Default constant


 
@@ -139,11 +142,13 @@ int         ZSTD_maxCLevel(void);               
/* ZSTD_CCtx* ZSTD_createCCtx(void); size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx);

-
size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx,
+
size_t ZSTD_compressCCtx(ZSTD_CCtx* cctx,
                          void* dst, size_t dstCapacity,
                    const void* src, size_t srcSize,
                          int compressionLevel);
-

Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()). +

Same as ZSTD_compress(), using an explicit ZSTD_CCtx + The function will compress at requested compression level, + ignoring any other parameter


Decompression context

  When decompressing many times,
@@ -155,10 +160,13 @@ size_t     ZSTD_freeCCtx(ZSTD_CCtx* cctx);
 ZSTD_DCtx* ZSTD_createDCtx(void);
 size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
 

-
size_t ZSTD_decompressDCtx(ZSTD_DCtx* ctx,
+
size_t ZSTD_decompressDCtx(ZSTD_DCtx* dctx,
                            void* dst, size_t dstCapacity,
                      const void* src, size_t srcSize);
-

Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx (see ZSTD_createDCtx()) +

Same as ZSTD_decompress(), + requires an allocated ZSTD_DCtx. + Compatible with sticky parameters. +


Simple dictionary API


@@ -168,18 +176,22 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
                          const void* src, size_t srcSize,
                          const void* dict,size_t dictSize,
                                int compressionLevel);
-

Compression using a predefined Dictionary (see dictBuilder/zdict.h). +

Compression at an explicit compression level using a Dictionary. + A dictionary can be any arbitrary data segment (also called a prefix), + or a buffer with specified information (see dictBuilder/zdict.h). Note : This function loads the dictionary, resulting in significant startup delay. - Note : When `dict == NULL || dictSize < 8` no dictionary is used. + It's intended for a dictionary used only once. + Note 2 : When `dict == NULL || dictSize < 8` no dictionary is used.


size_t ZSTD_decompress_usingDict(ZSTD_DCtx* dctx,
                                  void* dst, size_t dstCapacity,
                            const void* src, size_t srcSize,
                            const void* dict,size_t dictSize);
-

Decompression using a predefined Dictionary (see dictBuilder/zdict.h). +

Decompression using a known Dictionary. Dictionary must be identical to the one used during compression. Note : This function loads the dictionary, resulting in significant startup delay. + It's intended for a dictionary used only once. Note : When `dict == NULL || dictSize < 8` no dictionary is used.


@@ -187,11 +199,12 @@ size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);
ZSTD_CDict* ZSTD_createCDict(const void* dictBuffer, size_t dictSize,
                              int compressionLevel);
-

When compressing multiple messages / blocks with the same dictionary, it's recommended to load it just once. - ZSTD_createCDict() will create a digested dictionary, ready to start future compression operations without startup delay. +

When compressing multiple messages / blocks using the same dictionary, it's recommended to load it only once. + ZSTD_createCDict() will create a digested dictionary, ready to start future compression operations without startup cost. ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. - `dictBuffer` can be released after ZSTD_CDict creation, since its content is copied within CDict - Note : A ZSTD_CDict can be created with an empty dictionary, but it is inefficient for small data. + `dictBuffer` can be released after ZSTD_CDict creation, because its content is copied within CDict. + Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate `dictBuffer` content. + Note : A ZSTD_CDict can be created from an empty dictBuffer, but it is inefficient when used to compress small data.


size_t      ZSTD_freeCDict(ZSTD_CDict* CDict);
@@ -203,16 +216,14 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
                           const void* src, size_t srcSize,
                           const ZSTD_CDict* cdict);
 

Compression using a digested Dictionary. - Faster startup than ZSTD_compress_usingDict(), recommended when same dictionary is used multiple times. - Note that compression level is decided during dictionary creation. - Frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no) - Note : ZSTD_compress_usingCDict() can be used with a ZSTD_CDict created from an empty dictionary. - But it is inefficient for small data, and it is recommended to use ZSTD_compressCCtx(). + Recommended when same dictionary is used multiple times. + Note : compression level is _decided at dictionary creation time_, + and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no)


ZSTD_DDict* ZSTD_createDDict(const void* dictBuffer, size_t dictSize);
 

Create a digested dictionary, ready to start decompression operation without startup delay. - dictBuffer can be released after DDict creation, as its content is copied inside DDict + dictBuffer can be released after DDict creation, as its content is copied inside DDict.


size_t      ZSTD_freeDDict(ZSTD_DDict* ddict);
@@ -224,7 +235,7 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
                             const void* src, size_t srcSize,
                             const ZSTD_DDict* ddict);
 

Decompression using a digested Dictionary. - Faster startup than ZSTD_decompress_usingDict(), recommended when same dictionary is used multiple times. + Recommended when same dictionary is used multiple times.


Streaming


@@ -245,14 +256,18 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
   A ZSTD_CStream object is required to track streaming operation.
   Use ZSTD_createCStream() and ZSTD_freeCStream() to create/release resources.
   ZSTD_CStream objects can be reused multiple times on consecutive compression operations.
-  It is recommended to re-use ZSTD_CStream in situations where many streaming operations will be achieved consecutively,
-  since it will play nicer with system's memory, by re-using already allocated memory.
-  Use one separate ZSTD_CStream per thread for parallel execution.
+  It is recommended to re-use ZSTD_CStream since it will play nicer with system's memory, by re-using already allocated memory.
 
-  Start a new compression by initializing ZSTD_CStream context.
-  Use ZSTD_initCStream() to start a new compression operation.
-  Use variants ZSTD_initCStream_usingDict() or ZSTD_initCStream_usingCDict() for streaming with dictionary (experimental section)
+  For parallel execution, use one separate ZSTD_CStream per thread.
 
+  note : since v1.3.0, ZSTD_CStream and ZSTD_CCtx are the same thing.
+
+  Parameters are sticky : when starting a new compression on the same context,
+  it will re-use the same sticky parameters as previous compression session.
+  When in doubt, it's recommended to fully initialize the context before usage.
+  Use ZSTD_initCStream() to set the parameter to a selected compression level.
+  Use advanced API (ZSTD_CCtx_setParameter(), etc.) to set more specific parameters.
+
   Use ZSTD_compressStream() as many times as necessary to consume input stream.
   The function will automatically update both `pos` fields within `input` and `output`.
   Note that the function may not consume the entire input,
@@ -260,12 +275,11 @@ size_t     ZSTD_freeDCtx(ZSTD_DCtx* dctx);
   in which case `input.pos < input.size`.
   The caller must check if input has been entirely consumed.
   If not, the caller must make some room to receive more compressed data,
-  typically by emptying output buffer, or allocating a new output buffer,
   and then present again remaining input data.
-  @return : a size hint, preferred nb of bytes to use as input for next function call
-            or an error code, which can be tested using ZSTD_isError().
-            Note 1 : it's just a hint, to help latency a little, any other value will work fine.
-            Note 2 : size hint is guaranteed to be <= ZSTD_CStreamInSize()
+ @return : a size hint, preferred nb of bytes to use as input for next function call
+           or an error code, which can be tested using ZSTD_isError().
+           Note 1 : it's just a hint, to help latency a little, any value will work fine.
+           Note 2 : size hint is guaranteed to be <= ZSTD_CStreamInSize()
 
   At any moment, it's possible to flush whatever data might remain stuck within internal buffer,
   using ZSTD_flushStream(). `output->pos` will be updated.
@@ -305,25 +319,24 @@ size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffe
   Use ZSTD_createDStream() and ZSTD_freeDStream() to create/release resources.
   ZSTD_DStream objects can be re-used multiple times.
 
-  Use ZSTD_initDStream() to start a new decompression operation,
-   or ZSTD_initDStream_usingDict() if decompression requires a dictionary.
-   @return : recommended first input size
+  Use ZSTD_initDStream() to start a new decompression operation.
+ @return : recommended first input size
+  Alternatively, use advanced API to set specific properties.
 
   Use ZSTD_decompressStream() repetitively to consume your input.
   The function will update both `pos` fields.
   If `input.pos < input.size`, some input has not been consumed.
   It's up to the caller to present again remaining data.
-  The function tries to flush all data decoded immediately, repecting buffer sizes.
+  The function tries to flush all data decoded immediately, respecting output buffer size.
   If `output.pos < output.size`, decoder has flushed everything it could.
-  But if `output.pos == output.size`, there is no such guarantee,
-  it's likely that some decoded data was not flushed and still remains within internal buffers.
+  But if `output.pos == output.size`, there might be some data left within internal buffers.,
   In which case, call ZSTD_decompressStream() again to flush whatever remains in the buffer.
-  When no additional input is provided, amount of data flushed is necessarily <= ZSTD_BLOCKSIZE_MAX.
+  Note : with no additional input provided, amount of data flushed is necessarily <= ZSTD_BLOCKSIZE_MAX.
  @return : 0 when a frame is completely decoded and fully flushed,
         or an error code, which can be tested using ZSTD_isError(),
         or any other value > 0, which means there is still some decoding or flushing to do to complete current frame :
-                                the return value is a suggested next input size (a hint for better latency)
-                                that will never load more than the current frame.
+                                the return value is a suggested next input size (just a hint for better latency)
+                                that will never request more than the remaining frame size.
  
 
@@ -340,32 +353,477 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o
size_t ZSTD_DStreamOutSize(void);   /*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */
 

ADVANCED AND EXPERIMENTAL FUNCTIONS

- The definitions in this section are considered experimental.
- They should never be used with a dynamic library, as prototypes may change in the future.
+ The definitions in the following section are considered experimental.
  They are provided for advanced scenarios.
+ They should never be used with a dynamic library, as prototypes may change in the future.
  Use them only in association with static linking.
  
 
+

Candidate API for promotion to stable status

+ The following symbols and constants form the "staging area" :
+ they are considered to join "stable API" by v1.4.0.
+ The proposal is written so that it can be made stable "as is",
+ though it's still possible to suggest improvements.
+ Staging is in fact last chance for changes,
+ the API is locked once reaching "stable" status.
+ 
+
+
int ZSTD_minCLevel(void);  /*!< minimum negative compression level allowed */
 

-
typedef enum { ZSTD_fast=1, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2,
-               ZSTD_btlazy2, ZSTD_btopt, ZSTD_btultra } ZSTD_strategy;   /* from faster to stronger */
+
size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
+

`src` should point to the start of a ZSTD frame or skippable frame. + `srcSize` must be >= first frame size + @return : the compressed size of the first frame starting at `src`, + suitable to pass as `srcSize` to `ZSTD_decompress` or similar, + or an error code if input is invalid +


+ +
size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
+size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
+size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs);
+size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
+size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
+size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
+

These functions give the _current_ memory usage of selected object. + Note that object memory usage can evolve (increase or decrease) over time. +


+ +

Advanced compression API


+
+
typedef enum { ZSTD_fast=1,
+               ZSTD_dfast=2,
+               ZSTD_greedy=3,
+               ZSTD_lazy=4,
+               ZSTD_lazy2=5,
+               ZSTD_btlazy2=6,
+               ZSTD_btopt=7,
+               ZSTD_btultra=8,
+               ZSTD_btultra2=9
+               /* note : new strategies _might_ be added in the future.
+                         Only the order (from fast to strong) is guaranteed */
+} ZSTD_strategy;
 

+
typedef enum {
+
+    /* compression parameters */
+    ZSTD_c_compressionLevel=100, /* Update all compression parameters according to pre-defined cLevel table
+                              * Default level is ZSTD_CLEVEL_DEFAULT==3.
+                              * Special: value 0 means default, which is controlled by ZSTD_CLEVEL_DEFAULT.
+                              * Note 1 : it's possible to pass a negative compression level.
+                              * Note 2 : setting a level sets all default values of other compression parameters */
+    ZSTD_c_windowLog=101,    /* Maximum allowed back-reference distance, expressed as power of 2.
+                              * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX.
+                              * Special: value 0 means "use default windowLog".
+                              * Note: Using a windowLog greater than ZSTD_WINDOWLOG_LIMIT_DEFAULT
+                              *       requires explicitly allowing such window size at decompression stage if using streaming. */
+    ZSTD_c_hashLog=102,      /* Size of the initial probe table, as a power of 2.
+                              * Resulting memory usage is (1 << (hashLog+2)).
+                              * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.
+                              * Larger tables improve compression ratio of strategies <= dFast,
+                              * and improve speed of strategies > dFast.
+                              * Special: value 0 means "use default hashLog". */
+    ZSTD_c_chainLog=103,     /* Size of the multi-probe search table, as a power of 2.
+                              * Resulting memory usage is (1 << (chainLog+2)).
+                              * Must be clamped between ZSTD_CHAINLOG_MIN and ZSTD_CHAINLOG_MAX.
+                              * Larger tables result in better and slower compression.
+                              * This parameter is useless when using "fast" strategy.
+                              * It's still useful when using "dfast" strategy,
+                              * in which case it defines a secondary probe table.
+                              * Special: value 0 means "use default chainLog". */
+    ZSTD_c_searchLog=104,    /* Number of search attempts, as a power of 2.
+                              * More attempts result in better and slower compression.
+                              * This parameter is useless when using "fast" and "dFast" strategies.
+                              * Special: value 0 means "use default searchLog". */
+    ZSTD_c_minMatch=105,     /* Minimum size of searched matches.
+                              * Note that Zstandard can still find matches of smaller size,
+                              * it just tweaks its search algorithm to look for this size and larger.
+                              * Larger values increase compression and decompression speed, but decrease ratio.
+                              * Must be clamped between ZSTD_MINMATCH_MIN and ZSTD_MINMATCH_MAX.
+                              * Note that currently, for all strategies < btopt, effective minimum is 4.
+                              *                    , for all strategies > fast, effective maximum is 6.
+                              * Special: value 0 means "use default minMatchLength". */
+    ZSTD_c_targetLength=106, /* Impact of this field depends on strategy.
+                              * For strategies btopt, btultra & btultra2:
+                              *     Length of Match considered "good enough" to stop search.
+                              *     Larger values make compression stronger, and slower.
+                              * For strategy fast:
+                              *     Distance between match sampling.
+                              *     Larger values make compression faster, and weaker.
+                              * Special: value 0 means "use default targetLength". */
+    ZSTD_c_strategy=107,     /* See ZSTD_strategy enum definition.
+                              * The higher the value of selected strategy, the more complex it is,
+                              * resulting in stronger and slower compression.
+                              * Special: value 0 means "use default strategy". */
+
+    /* LDM mode parameters */
+    ZSTD_c_enableLongDistanceMatching=160, /* Enable long distance matching.
+                                     * This parameter is designed to improve compression ratio
+                                     * for large inputs, by finding large matches at long distance.
+                                     * It increases memory usage and window size.
+                                     * Note: enabling this parameter increases default ZSTD_c_windowLog to 128 MB
+                                     * except when expressly set to a different value. */
+    ZSTD_c_ldmHashLog=161,   /* Size of the table for long distance matching, as a power of 2.
+                              * Larger values increase memory usage and compression ratio,
+                              * but decrease compression speed.
+                              * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX
+                              * default: windowlog - 7.
+                              * Special: value 0 means "automatically determine hashlog". */
+    ZSTD_c_ldmMinMatch=162,  /* Minimum match size for long distance matcher.
+                              * Larger/too small values usually decrease compression ratio.
+                              * Must be clamped between ZSTD_LDM_MINMATCH_MIN and ZSTD_LDM_MINMATCH_MAX.
+                              * Special: value 0 means "use default value" (default: 64). */
+    ZSTD_c_ldmBucketSizeLog=163, /* Log size of each bucket in the LDM hash table for collision resolution.
+                              * Larger values improve collision resolution but decrease compression speed.
+                              * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX.
+                              * Special: value 0 means "use default value" (default: 3). */
+    ZSTD_c_ldmHashRateLog=164, /* Frequency of inserting/looking up entries into the LDM hash table.
+                              * Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
+                              * Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
+                              * Larger values improve compression speed.
+                              * Deviating far from default value will likely result in a compression ratio decrease.
+                              * Special: value 0 means "automatically determine hashRateLog". */
+
+    /* frame parameters */
+    ZSTD_c_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1)
+                              * Content size must be known at the beginning of compression.
+                              * This is automatically the case when using ZSTD_compress2(),
+                              * For streaming variants, content size must be provided with ZSTD_CCtx_setPledgedSrcSize() */
+    ZSTD_c_checksumFlag=201, /* A 32-bits checksum of content is written at end of frame (default:0) */
+    ZSTD_c_dictIDFlag=202,   /* When applicable, dictionary's ID is written into frame header (default:1) */
+
+    /* multi-threading parameters */
+    /* These parameters are only useful if multi-threading is enabled (compiled with build macro ZSTD_MULTITHREAD).
+     * They return an error otherwise. */
+    ZSTD_c_nbWorkers=400,    /* Select how many threads will be spawned to compress in parallel.
+                              * When nbWorkers >= 1, triggers asynchronous mode when used with ZSTD_compressStream*() :
+                              * ZSTD_compressStream*() consumes input and flush output if possible, but immediately gives back control to caller,
+                              * while compression work is performed in parallel, within worker threads.
+                              * (note : a strong exception to this rule is when first invocation of ZSTD_compressStream2() sets ZSTD_e_end :
+                              *  in which case, ZSTD_compressStream2() delegates to ZSTD_compress2(), which is always a blocking call).
+                              * More workers improve speed, but also increase memory usage.
+                              * Default value is `0`, aka "single-threaded mode" : no worker is spawned, compression is performed inside Caller's thread, all invocations are blocking */
+    ZSTD_c_jobSize=401,      /* Size of a compression job. This value is enforced only when nbWorkers >= 1.
+                              * Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads.
+                              * 0 means default, which is dynamically determined based on compression parameters.
+                              * Job size must be a minimum of overlap size, or 1 MB, whichever is largest.
+                              * The minimum size is automatically and transparently enforced */
+    ZSTD_c_overlapLog=402,   /* Control the overlap size, as a fraction of window size.
+                              * The overlap size is an amount of data reloaded from previous job at the beginning of a new job.
+                              * It helps preserve compression ratio, while each job is compressed in parallel.
+                              * This value is enforced only when nbWorkers >= 1.
+                              * Larger values increase compression ratio, but decrease speed.
+                              * Possible values range from 0 to 9 :
+                              * - 0 means "default" : value will be determined by the library, depending on strategy
+                              * - 1 means "no overlap"
+                              * - 9 means "full overlap", using a full window size.
+                              * Each intermediate rank increases/decreases load size by a factor 2 :
+                              * 9: full window;  8: w/2;  7: w/4;  6: w/8;  5:w/16;  4: w/32;  3:w/64;  2:w/128;  1:no overlap;  0:default
+                              * default value varies between 6 and 9, depending on strategy */
+
+    /* note : additional experimental parameters are also available
+     * within the experimental section of the API.
+     * At the time of this writing, they include :
+     * ZSTD_c_rsyncable
+     * ZSTD_c_format
+     * ZSTD_c_forceMaxWindow
+     * ZSTD_c_forceAttachDict
+     * Because they are not stable, it's necessary to define ZSTD_STATIC_LINKING_ONLY to access them.
+     * note : never ever use experimentalParam? names directly;
+     *        also, the enums values themselves are unstable and can still change.
+     */
+     ZSTD_c_experimentalParam1=500,
+     ZSTD_c_experimentalParam2=10,
+     ZSTD_c_experimentalParam3=1000,
+     ZSTD_c_experimentalParam4=1001
+} ZSTD_cParameter;
+

typedef struct {
-    unsigned windowLog;      /**< largest match distance : larger == more compression, more memory needed during decompression */
-    unsigned chainLog;       /**< fully searched segment : larger == more compression, slower, more memory (useless for fast) */
-    unsigned hashLog;        /**< dispatch table : larger == faster, more memory */
-    unsigned searchLog;      /**< nb of searches : larger == more compression, slower */
-    unsigned searchLength;   /**< match length searched : larger == faster decompression, sometimes less compression */
-    unsigned targetLength;   /**< acceptable match size for optimal parser (only) : larger == more compression, slower */
-    ZSTD_strategy strategy;
+    size_t error;
+    int lowerBound;
+    int upperBound;
+} ZSTD_bounds;
+

+
ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter cParam);
+

All parameters must belong to an interval with lower and upper bounds, + otherwise they will either trigger an error or be automatically clamped. + @return : a structure, ZSTD_bounds, which contains + - an error status field, which must be tested using ZSTD_isError() + - lower and upper bounds, both inclusive + +


+ +
size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value);
+

Set one compression parameter, selected by enum ZSTD_cParameter. + All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds(). + Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). + Setting a parameter is generally only possible during frame initialization (before starting compression). + Exception : when using multi-threading mode (nbWorkers >= 1), + the following parameters can be updated _during_ compression (within same frame): + => compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy. + new parameters will be active for next job only (after a flush()). + @return : an error code (which can be tested using ZSTD_isError()). + +


+ +
size_t ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx* cctx, unsigned long long pledgedSrcSize);
+

Total input data size to be compressed as a single frame. + Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag. + This value will also be controlled at end of frame, and trigger an error if not respected. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame. + In order to mean "unknown content size", pass constant ZSTD_CONTENTSIZE_UNKNOWN. + ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame. + Note 2 : pledgedSrcSize is only valid once, for the next frame. + It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN. + Note 3 : Whenever all input data is provided and consumed in a single round, + for example with ZSTD_compress2(), + or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end), + this value is automatically overriden by srcSize instead. + +


+ +
size_t ZSTD_CCtx_loadDictionary(ZSTD_CCtx* cctx, const void* dict, size_t dictSize);
+

Create an internal CDict from `dict` buffer. + Decompression will have to use same dictionary. + @result : 0, or an error code (which can be tested with ZSTD_isError()). + Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary, + meaning "return to no-dictionary mode". + Note 1 : Dictionary is sticky, it will be used for all future compressed frames. + To return to "no-dictionary" situation, load a NULL dictionary (or reset parameters). + Note 2 : Loading a dictionary involves building tables. + It's also a CPU consuming operation, with non-negligible impact on latency. + Tables are dependent on compression parameters, and for this reason, + compression parameters can no longer be changed after loading a dictionary. + Note 3 :`dict` content will be copied internally. + Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead. + In such a case, dictionary buffer must outlive its users. + Note 4 : Use ZSTD_CCtx_loadDictionary_advanced() + to precisely select how dictionary content must be interpreted. +


+ +
size_t ZSTD_CCtx_refCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@freebsd.org  Sat Dec 29 21:36:03 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56C23142DA82;
 Sat, 29 Dec 2018 21:36:03 +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)
 server-signature RSA-PSS (4096 bits)
 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 EFFED86476;
 Sat, 29 Dec 2018 21:36:02 +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 E3D6B18D19;
 Sat, 29 Dec 2018 21:36:02 +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 wBTLa28g072561;
 Sat, 29 Dec 2018 21:36:02 GMT (envelope-from kp@FreeBSD.org)
Received: (from kp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTLa25i072560;
 Sat, 29 Dec 2018 21:36:02 GMT (envelope-from kp@FreeBSD.org)
Message-Id: <201812292136.wBTLa25i072560@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org
 using -f
From: Kristof Provost 
Date: Sat, 29 Dec 2018 21:36:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r342599 - head/sys/kern
X-SVN-Group: head
X-SVN-Commit-Author: kp
X-SVN-Commit-Paths: head/sys/kern
X-SVN-Commit-Revision: 342599
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: EFFED86476
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.97 / 15.00];
 local_wl_from(0.00)[FreeBSD.org];
 NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
 NEURAL_HAM_SHORT(-0.97)[-0.972,0];
 NEURAL_HAM_LONG(-1.00)[-0.998,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 29 Dec 2018 21:36:03 -0000

Author: kp
Date: Sat Dec 29 21:36:02 2018
New Revision: 342599
URL: https://svnweb.freebsd.org/changeset/base/342599

Log:
  Simplify jail ID printing on process exit
  
  As suggested by kib@, we don't need to check p_ucred, because that's only NULL
  during process creation, and cr_prison is never NULL.

Modified:
  head/sys/kern/kern_sig.c

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Sat Dec 29 21:18:01 2018	(r342598)
+++ head/sys/kern/kern_sig.c	Sat Dec 29 21:36:02 2018	(r342599)
@@ -3094,16 +3094,12 @@ proc_wkilled(struct proc *p)
 void
 killproc(struct proc *p, char *why)
 {
-	int jid = -1;
 
-	if (p->p_ucred && p->p_ucred->cr_prison)
-		jid = p->p_ucred->cr_prison->pr_id;
-
 	PROC_LOCK_ASSERT(p, MA_OWNED);
 	CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid,
 	    p->p_comm);
 	log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n",
-	    p->p_pid, p->p_comm, jid,
+	    p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id,
 	    p->p_ucred ? p->p_ucred->cr_uid : -1, why);
 	proc_wkilled(p);
 	kern_psignal(p, SIGKILL);
@@ -3121,11 +3117,7 @@ void
 sigexit(struct thread *td, int sig)
 {
 	struct proc *p = td->td_proc;
-	int jid = -1;
 
-	if (p->p_ucred && p->p_ucred->cr_prison)
-		jid = p->p_ucred->cr_prison->pr_id;
-
 	PROC_LOCK_ASSERT(p, MA_OWNED);
 	p->p_acflag |= AXSIG;
 	/*
@@ -3152,7 +3144,8 @@ sigexit(struct thread *td, int sig)
 		if (kern_logsigexit)
 			log(LOG_INFO,
 			    "pid %d (%s), jid %d, uid %d: exited on "
-			    "signal %d%s\n", p->p_pid, p->p_comm, jid,
+			    "signal %d%s\n", p->p_pid, p->p_comm,
+			    p->p_ucred->cr_prison->pr_id,
 			    td->td_ucred ? td->td_ucred->cr_uid : -1,
 			    sig &~ WCOREFLAG,
 			    sig & WCOREFLAG ? " (core dumped)" : "");

From owner-svn-src-head@freebsd.org  Sat Dec 29 23:00:21 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51BC5142FD62;
 Sat, 29 Dec 2018 23:00:21 +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)
 server-signature RSA-PSS (4096 bits)
 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 EAC4988F18;
 Sat, 29 Dec 2018 23:00:20 +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 CAFD219B7F;
 Sat, 29 Dec 2018 23:00:20 +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 wBTN0K0Z015009;
 Sat, 29 Dec 2018 23:00:20 GMT (envelope-from 0mp@FreeBSD.org)
Received: (from 0mp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTN0Kk3015008;
 Sat, 29 Dec 2018 23:00:20 GMT (envelope-from 0mp@FreeBSD.org)
Message-Id: <201812292300.wBTN0Kk3015008@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: Sat, 29 Dec 2018 23:00:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r342600 - 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: 342600
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: EAC4988F18
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.95 / 15.00];
 local_wl_from(0.00)[FreeBSD.org];
 NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
 NEURAL_HAM_SHORT(-0.95)[-0.955,0];
 NEURAL_HAM_LONG(-1.00)[-0.998,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 29 Dec 2018 23:00:21 -0000

Author: 0mp (ports committer)
Date: Sat Dec 29 23:00:20 2018
New Revision: 342600
URL: https://svnweb.freebsd.org/changeset/base/342600

Log:
  style.mdoc.5: Suggest preferred formatting for EXAMPLES
  
  Add an example of how to format examples in EXAMPLES sections. The
  suggested format is heavily based on zfs.8.
  
  While here, capitalize subsection titles.
  
  Reviewed by:	bcr
  Approved by:	bcr (doc),
  Approved by:	krion (mentor, implicit), mat (mentor, implicit)
  Differential Revision:	https://reviews.freebsd.org/D18681

Modified:
  head/share/man/man5/style.mdoc.5

Modified: head/share/man/man5/style.mdoc.5
==============================================================================
--- head/share/man/man5/style.mdoc.5	Sat Dec 29 21:36:02 2018	(r342599)
+++ head/share/man/man5/style.mdoc.5	Sat Dec 29 23:00:20 2018	(r342600)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 28, 2018
+.Dd December 29, 2018
 .Dt STYLE.MDOC 5
 .Os
 .Sh NAME
@@ -39,7 +39,7 @@ file style guide
 This file specifies the preferred style for manual pages in the
 .Fx
 source tree.
-.Ss Code examples
+.Ss Code Examples
 .Bl -dash -width ""
 .It
 Use literal formatting for examples and literal shell commands, e.g.:
@@ -68,7 +68,53 @@ Then run
 .Dq Nm make Cm install Cm clean .
 .Ed
 .El
-.Ss Synopsis formatting
+.Ss EXAMPLES Section
+.Bl -dash -width ""
+.It
+Format the
+.Sx EXAMPLES
+section in the following way:
+.Bd -literal -offset indent
+\&.Bl -tag -width 0n
+\&.It Sy Example 1\&: No Doing Something
+\&.Pp
+The following command does something.
+\&.Bd -literal -offset 2n
+\&.Li # Ic make -VLEGAL
+\&.Ed
+\&.It Sy Example 2\&: No Doing Something Different
+\&.Pp
+The following command does something different.
+\&.Bd -literal -offset 2n
+\&.Li # Ic bectl list
+\&.Ed
+\&.Pp
+It is good to know this command.
+\&.El
+\&.El
+.Ed
+.Pp
+which renders as:
+.Bd -filled -offset indent
+.Bl -tag -width 0n
+.It Sy Example 1\&: No Doing Something
+.Pp
+The following command does something.
+.Bd -literal -offset 2n
+.Li # Ic make -VLEGAL
+.Ed
+.It Sy Example 2\&: No Doing Something Different
+.Pp
+The following command does something different.
+.Bd -literal -offset 2n
+.Li # Ic bectl list
+.Ed
+.Pp
+It is good to know this command.
+.El
+.Ed
+.El
+.Ss Synopsis Formatting
 .Bl -dash -width ""
 .It
 Do not put whitespace between alternative parameters separated with a pipe

From owner-svn-src-head@freebsd.org  Sat Dec 29 23:09:00 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78F7914300A2;
 Sat, 29 Dec 2018 23:09:00 +0000 (UTC)
 (envelope-from crees@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)
 server-signature RSA-PSS (4096 bits)
 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 1CC168955E;
 Sat, 29 Dec 2018 23:09:00 +0000 (UTC)
 (envelope-from crees@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00D0D19D4D;
 Sat, 29 Dec 2018 23:08:59 +0000 (UTC)
 (envelope-from crees@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBTN8xg2020915;
 Sat, 29 Dec 2018 23:08:59 GMT (envelope-from crees@FreeBSD.org)
Received: (from crees@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBTN8xHL020914;
 Sat, 29 Dec 2018 23:08:59 GMT (envelope-from crees@FreeBSD.org)
Message-Id: <201812292308.wBTN8xHL020914@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: crees set sender to
 crees@FreeBSD.org using -f
From: Chris Rees 
Date: Sat, 29 Dec 2018 23:08:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r342601 - head/bin/pax
X-SVN-Group: head
X-SVN-Commit-Author: crees
X-SVN-Commit-Paths: head/bin/pax
X-SVN-Commit-Revision: 342601
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 1CC168955E
X-Spamd-Bar: --
Authentication-Results: mx1.freebsd.org
X-Spamd-Result: default: False [-2.95 / 15.00];
 local_wl_from(0.00)[FreeBSD.org];
 NEURAL_HAM_MEDIUM(-1.00)[-0.999,0];
 NEURAL_HAM_LONG(-1.00)[-0.998,0];
 NEURAL_HAM_SHORT(-0.95)[-0.955,0];
 ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 29 Dec 2018 23:09:00 -0000

Author: crees (doc,ports committer)
Date: Sat Dec 29 23:08:59 2018
New Revision: 342601
URL: https://svnweb.freebsd.org/changeset/base/342601

Log:
  Add a note that the use of -B option does not guarantee a size of fragment
  if -z option also used.
  
  Recommend the use of zip(1) if compressed files of predictable size needed.
  
  PR:			docs/41089
  Submitted by:		Sevan Janiyan
  Reported by:		areilly@bigpond.net.au
  
  While here, pet igor
  
  Reviewed by:		bcr
  Differential Revision:	https://reviews.freebsd.org/D18686

Modified:
  head/bin/pax/pax.1

Modified: head/bin/pax/pax.1
==============================================================================
--- head/bin/pax/pax.1	Sat Dec 29 23:00:20 2018	(r342600)
+++ head/bin/pax/pax.1	Sat Dec 29 23:08:59 2018	(r342601)
@@ -33,7 +33,7 @@
 .\"	@(#)pax.1	8.4 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd March 17, 2015
+.Dd December 29, 2018
 .Dt PAX 1
 .Os
 .Sh NAME
@@ -793,6 +793,16 @@ limits can be separated by
 .Li x
 to indicate a product.
 .Pp
+Note that the specified size is for the uncompressed pax image itself.
+If the
+.Fl z
+option is also used, the resulting file may contain fewer
+.Ar bytes ,
+according to the compressibility of the archive contents.
+See
+.Xr zip 1
+if compressed volumes of predictable size are required.
+.Pp
 .Em Warning :
 Only use this option when writing an archive to a device which supports
 an end of file read condition based on last (or largest) write offset
@@ -804,7 +814,7 @@ This option is the same as the
 option, except that the file inode change time is checked instead of the
 file modification time.
 The file inode change time can be used to select files whose inode information
-(e.g.\& uid, gid, etc.) is newer than a copy of the file in the destination
+(e.g., uid, gid, etc.) is newer than a copy of the file in the destination
 .Ar directory .
 .It Fl E Ar limit
 Limit the number of consecutive read faults while trying to read a flawed
@@ -903,7 +913,7 @@ the file was last written).
 The
 .Ar c
 specifies the comparison of inode change time (the time when the file
-inode was last changed; e.g.\& a change of owner, group, mode, etc).
+inode was last changed; e.g., a change of owner, group, mode, etc).
 When
 .Ar c
 and